unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17644: 24.4.50; provide access to all mode-line lighters (e.g. those from C code)
@ 2014-05-30 15:34 Drew Adams
  2014-05-30 15:57 ` Andreas Schwab
  2014-05-30 16:02 ` Christopher Schmidt
  0 siblings, 2 replies; 6+ messages in thread
From: Drew Adams @ 2014-05-30 15:34 UTC (permalink / raw)
  To: 17644

Elisp users can modify mode-line lighters for a major or a minor mode,
using `mode-name' and `minor-mode-alist'.  But they cannot modify (or
even remove) other lighters that are added by Emacs C code.  Please
enhance Emacs by making this possible (from Lisp).

For example, when the buffer is narrowed, the lighter `Narrow' appears.
It is neither a major-mode lighter nor a minor-mode lighter.  And there
is no way for a programmer to modify it from Lisp.

Please (a) document all such abnormal/extraneous lighters together,
somewhere in the Elisp manual and (b) provide a means for users to
access and modify them using Lisp.

In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-05-25 on ODIEONE
Bzr revision: 117153 tsdh@gnu.org-20140525174054-vzeh4zeg00a1ley8
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/snapshot/trunk
 --enable-checking=yes,glyphs 'CFLAGS=-O0 -g3'
 LDFLAGS=-Lc:/Devel/emacs/lib 'CPPFLAGS=-DGC_MCHECK=1
 -Ic:/Devel/emacs/include''





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#17644: 24.4.50; provide access to all mode-line lighters (e.g. those from C code)
  2014-05-30 15:34 bug#17644: 24.4.50; provide access to all mode-line lighters (e.g. those from C code) Drew Adams
@ 2014-05-30 15:57 ` Andreas Schwab
  2014-05-30 16:02 ` Christopher Schmidt
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2014-05-30 15:57 UTC (permalink / raw)
  To: Drew Adams; +Cc: 17644

Drew Adams <drew.adams@oracle.com> writes:

> For example, when the buffer is narrowed, the lighter `Narrow' appears.
> It is neither a major-mode lighter nor a minor-mode lighter.  And there
> is no way for a programmer to modify it from Lisp.

Just replace %n with your own implementation.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#17644: 24.4.50; provide access to all mode-line lighters (e.g. those from C code)
  2014-05-30 15:34 bug#17644: 24.4.50; provide access to all mode-line lighters (e.g. those from C code) Drew Adams
  2014-05-30 15:57 ` Andreas Schwab
@ 2014-05-30 16:02 ` Christopher Schmidt
  2014-05-30 16:08   ` Drew Adams
  1 sibling, 1 reply; 6+ messages in thread
From: Christopher Schmidt @ 2014-05-30 16:02 UTC (permalink / raw)
  To: 17644

Drew Adams <drew.adams@oracle.com> writes:
> (b) provide a means for users to access and modify them using Lisp.

    (info "(elisp)%-Constructs")

    (setq mode-line-modes
          (cl-nsubstitute '(:eval (when (buffer-narrowed-p) " DREW"))
                          "%n"
                          mode-line-modes
                          :test 'string=
                          :key (lambda (e)
                                 (when (stringp e)
                                   e))))





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#17644: 24.4.50; provide access to all mode-line lighters (e.g. those from C code)
  2014-05-30 16:02 ` Christopher Schmidt
@ 2014-05-30 16:08   ` Drew Adams
  2014-05-30 23:37     ` Drew Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2014-05-30 16:08 UTC (permalink / raw)
  To: Christopher Schmidt, 17644

>     (setq mode-line-modes
>           (cl-nsubstitute '(:eval (when (buffer-narrowed-p) " DREW"))
>                           "%n"
>                           mode-line-modes
>                           :test 'string=
>                           :key (lambda (e) (when (stringp e) e))))

Good; thx.  I didn't realize there was a separate % construct
just for `Narrow'.

Is `Narrow' the only such "abnormal" lighter implemented in C?
If so then I will close this bug.  Thx.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#17644: 24.4.50; provide access to all mode-line lighters (e.g. those from C code)
  2014-05-30 16:08   ` Drew Adams
@ 2014-05-30 23:37     ` Drew Adams
  2016-04-29 20:09       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2014-05-30 23:37 UTC (permalink / raw)
  To: 17644

> I didn't realize there was a separate % construct just for `Narrow'.
> 
> Is `Narrow' the only such "abnormal" lighter implemented in C?
> If so then I will close this bug.

Actually, no.  I would also like to be able to keep `%n' and its
behavior, and use alternative text instead of " Narrow".





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#17644: 24.4.50; provide access to all mode-line lighters (e.g. those from C code)
  2014-05-30 23:37     ` Drew Adams
@ 2016-04-29 20:09       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-29 20:09 UTC (permalink / raw)
  To: Drew Adams; +Cc: 17644

Drew Adams <drew.adams@oracle.com> writes:

>> I didn't realize there was a separate % construct just for `Narrow'.
>> 
>> Is `Narrow' the only such "abnormal" lighter implemented in C?
>> If so then I will close this bug.
>
> Actually, no.  I would also like to be able to keep `%n' and its
> behavior, and use alternative text instead of " Narrow".

I think you can just create a new one that has the same behaviour and a
new text?  So I don't think there's anything to fix here.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-04-29 20:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-30 15:34 bug#17644: 24.4.50; provide access to all mode-line lighters (e.g. those from C code) Drew Adams
2014-05-30 15:57 ` Andreas Schwab
2014-05-30 16:02 ` Christopher Schmidt
2014-05-30 16:08   ` Drew Adams
2014-05-30 23:37     ` Drew Adams
2016-04-29 20:09       ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).