Article View: gnu.emacs.bug
Article #99614Re: "%%" in mode line, even when buffer modified
From: Joe Wells
Date: Sat, 28 Jul 1990 01:46
Date: Sat, 28 Jul 1990 01:46
86 lines
4093 bytes
4093 bytes
In article <9007260209.AA24274@life.ai.mit.edu> Dan_Jacobson@ATT.COM writes:
[Suggestion] You know the "%%" in the mode line meaning "read-only
buffer". Well, what if you make one of your already-modified buffers
("**",) read-only? Then that buffer's mode line ought to have "*%"
(like the output of list-buffers (C-x C-b)), not "%%", which should
now just mean a non-modified read-only buffer.
Good idea. I'm including the patch to implement that. Knowing that a
buffer is modified is probably important enough to justify adding this
behavior.
--
Joe Wells <jbw@uswest.com>
----------------------------------------------------------------------
*** /home/zeb1/gnu/sparc/dist-18.55/src/xdisp.c Tue Jun 5 00:09:03 1990
--- xdisp.c Fri Jul 27 19:42:45 1990
***************
*** 1781,1792 ****
break;
*/
case '*':
! return (!NULL (bf_cur->read_only)
! ? "%"
! : ((bf_modified > bf_cur->save_modified)
! ? "*"
! : "-"));
case 's':
/* status of process */
--- 1781,1791 ----
break;
*/
+ case '&':
+ return (!NULL (bf_cur->read_only) ? "%" : "-");
+
case '*':
! return ((bf_modified > bf_cur->save_modified) ? "*" : "-");
case 's':
/* status of process */
*** /home/zeb1/gnu/sparc/dist-18.55/src/buffer.c Tue Jun 5 00:09:02 1990
--- buffer.c Fri Jul 27 19:45:02 1990
***************
*** 1256,1263 ****
(%-constructs are allowed when the string is the entire mode-line-format\n\
or when it is found in a cons-cell or a list)\n\
%b -- print buffer name. %f -- print visited file name.\n\
! %* -- print *, % or hyphen. %m -- print value of mode-name (obsolete).\n\
! %s -- print process status. %M -- print value of global-mode-string. (obs)\n\
%p -- print percent of buffer above top of window, or top, bot or all.\n\
%n -- print Narrow if appropriate.\n\
%[ -- print one [ for each recursive editing level. %] similar.\n\
--- 1256,1264 ----
(%-constructs are allowed when the string is the entire mode-line-format\n\
or when it is found in a cons-cell or a list)\n\
%b -- print buffer name. %f -- print visited file name.\n\
! %* -- print * or hyphen. %m -- print value of mode-name (obsolete).\n\
! %& -- print % or hyphen. %M -- print value of global-mode-string. (obs)\n\
! %s -- print process status.\n\
%p -- print percent of buffer above top of window, or top, bot or all.\n\
%n -- print Narrow if appropriate.\n\
%[ -- print one [ for each recursive editing level. %] similar.\n\
*** /home/zeb1/gnu/sparc/dist-18.55/lisp/loaddefs.el Tue Jun 5 00:11:12 1990
--- loaddefs.el Fri Jul 27 19:26:38 1990
***************
*** 55,61 ****
(make-variable-buffer-local 'mode-line-process)
! (defconst mode-line-modified (purecopy '("--%1*%1*-")) "\
Mode-line control for displaying whether current buffer is modified.")
(make-variable-buffer-local 'mode-line-modified)
--- 55,61 ----
(make-variable-buffer-local 'mode-line-process)
! (defconst mode-line-modified (purecopy '("--%1*%1&-")) "\
Mode-line control for displaying whether current buffer is modified.")
(make-variable-buffer-local 'mode-line-modified)
Technical Details
Message-ID:
<JBW.90Jul27194606@zeb.uswest.com>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!snorkelwacker!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sunybcs!boulder!uswat!jbwReferences:
<9007260209.AA24274@life.ai.mit.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,15893dbd2afbbd49 X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1990-07-27 18:46:06 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!snorkelwacker!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sunybcs!boulder!uswat!jbw From: jbw@zeb.uswest.com (Joe Wells) Newsgroups: gnu.emacs.bug Subject: Re: "%%" in mode line, even when buffer modified Message-ID: <JBW.90Jul27194606@zeb.uswest.com> Date: 28 Jul 90 01:46:06 GMT References: <9007260209.AA24274@life.ai.mit.edu> Sender: news@uswat.UUCP Distribution: gnu Organization: U S West Advanced Technologies Lines: 86 Posted: Sat Jul 28 02:46:06 1990 In-reply-to: Dan_Jacobson@ATT.COM's message of 26 Jul 90 01:57:00 GMT