GNU bug report logs - #24780
26.0.50; describe-mode lexical-binding

Previous Next

Package: emacs;

Reported by: Andreas Röhler <andreas.roehler <at> easy-emacs.de>

Date: Mon, 24 Oct 2016 09:06:01 UTC

Severity: wishlist

Tags: fixed

Found in version 26.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24780 in the body.
You can then email your comments to 24780 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#24780; Package emacs. (Mon, 24 Oct 2016 09:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Röhler <andreas.roehler <at> easy-emacs.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 24 Oct 2016 09:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; describe-mode lexical-binding
Date: Mon, 24 Oct 2016 11:13:32 +0200
Hi,

consider it useful if `describe-mode' reports value of var 
`lexical-binding'.
Even displaying it in mode-line might be an option.

Thanks,
Andreas


In GNU Emacs 26.0.50.1 (i686-pc-linux-gnu, GTK+ Version 3.14.5)
 of 2016-10-11

Repository revision: 8b4aebf4559522d19193cc19cc8a255e764a8676
Windowing system distributor 'The X.Org Foundation', version 11.0.11604000
System Description:    Debian GNU/Linux 8.6 (jessie)

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...
a=a-value b=new-b-value c=c-value d=new-d-value
Type C-x 1 to delete the help window, C-M-v to scroll help.
Page has 34 lines (0 + 34)
user-error: No previous help buffer
e is undefined
x is undefined
Mark set
Mark saved where search started

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS NOTIFY ACL GNUTLS
LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: de_DE.utf8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message subr-x puny seq byte-opt gv
bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml
mml-sec password-cache epa derived epg epg-config gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils misearch multi-isearch cl-extra help-fns
radix-tree help-mode easymenu cl-loaddefs pcase cl-lib time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev
obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face
macroexp files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
dbusbind inotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 8 171502 10130)
 (symbols 24 38666 0)
 (miscs 20 111 202)
 (strings 16 54056 5227)
 (string-bytes 1 888586)
 (vectors 8 13890)
 (vector-slots 4 477450 6294)
 (floats 8 188 36)
 (intervals 28 630 24)
 (buffers 520 14)
 (heap 1024 19082 955))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24780; Package emacs. (Sat, 27 Jul 2019 13:00:02 GMT) Full text and rfc822 format available.

Message #8 received at 24780 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
Cc: 24780 <at> debbugs.gnu.org
Subject: Re: bug#24780: 26.0.50; describe-mode lexical-binding
Date: Sat, 27 Jul 2019 14:58:53 +0200
Andreas Röhler <andreas.roehler <at> easy-emacs.de> writes:

> consider it useful if `describe-mode' reports value of var
> `lexical-binding'.

Hm...  That command describes the mode, and whether the current .el file
uses lexical binding or not isn't really tied to the mode, so I think
that sounds a bit confusing.  The user may believe that we're talking
about whether the mode uses lexical binding or not.

> Even displaying it in mode-line might be an option.

That does sound more useful -- I often find jumping back to the start of
the buffer to check.

`emacs-lisp-mode' could display that somewhere in the mode line, I
guess?  But where?  Perhaps among the U:**- thing at the start?  Or in
the mode stuff?

So instead of

(Emacs-Lisp)

we'd get

(Emacs-Lisp Lexical)

when we have lexical binding in the current buffer?  Does anybody have
an opinion here?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24780; Package emacs. (Sat, 27 Jul 2019 13:11:02 GMT) Full text and rfc822 format available.

Message #11 received at 24780 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Andreas Röhler <andreas.roehler <at> easy-emacs.de>,
 24780 <at> debbugs.gnu.org
Subject: Re: bug#24780: 26.0.50; describe-mode lexical-binding
Date: Sat, 27 Jul 2019 09:10:10 -0400
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

>> Even displaying it in mode-line might be an option.
>
> That does sound more useful -- I often find jumping back to the start of
> the buffer to check.

> (Emacs-Lisp Lexical)
>
> when we have lexical binding in the current buffer?  Does anybody have
> an opinion here?

IMO it's not worth spending space on the mode line for this.  Yeah,
sometimes I want to check, and M-< followed by C-u C-SPC to go back
works fine for that.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24780; Package emacs. (Sat, 27 Jul 2019 13:12:01 GMT) Full text and rfc822 format available.

Message #14 received at 24780 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 24780 <at> debbugs.gnu.org
Subject: Re: bug#24780: 26.0.50; describe-mode lexical-binding
Date: 27 Jul 2019 12:19:02 -0000
Hello, Lars.

In article <mailman.2389.1564232406.2688.bug-gnu-emacs <at> gnu.org> you wrote:
> Andreas Röhler <andreas.roehler <at> easy-emacs.de> writes:

>> consider it useful if `describe-mode' reports value of var
>> `lexical-binding'.

> Hm...  That command describes the mode, and whether the current .el file
> uses lexical binding or not isn't really tied to the mode, so I think
> that sounds a bit confusing.  The user may believe that we're talking
> about whether the mode uses lexical binding or not.

>> Even displaying it in mode-line might be an option.

> That does sound more useful -- I often find jumping back to the start of
> the buffer to check.

> `emacs-lisp-mode' could display that somewhere in the mode line, I
> guess?  But where?  Perhaps among the U:**- thing at the start?  Or in
> the mode stuff?

> So instead of

> (Emacs-Lisp)

> we'd get

> (Emacs-Lisp Lexical)

> when we have lexical binding in the current buffer?  Does anybody have
> an opinion here?

Yes.  "Lexical" is too long, considering its relative lack of
importance.  Space on the mode line is precious, particularly when
running Follow Mode.  Also, "Lexical" isn't really a minor mode, so
shouldn't look like one.

How about, instead,

    (Emacs-Lisp/L)

or

    (Emacs-Lisp/D)

?  Even that is going to be a nuisance to some people, so it really
needs a user option to turn it off.

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

-- 
Alan Mackenzie (Nuremberg, Germany).





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24780; Package emacs. (Sat, 27 Jul 2019 16:43:02 GMT) Full text and rfc822 format available.

Message #17 received at 24780 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: Andreas Röhler <andreas.roehler <at> easy-emacs.de>,
 24780 <at> debbugs.gnu.org
Subject: Re: bug#24780: 26.0.50; describe-mode lexical-binding
Date: Sat, 27 Jul 2019 18:42:17 +0200
Noam Postavsky <npostavs <at> gmail.com> writes:

> IMO it's not worth spending space on the mode line for this.  Yeah,
> sometimes I want to check, and M-< followed by C-u C-SPC to go back
> works fine for that.

OK, there doesn't seem to be much enthusiasm for putting this in our
precious mode line real estate, and I concur.

But I had another look at `describe-mode', and contrary to what I
believed, it does include stuff that's not directly mode-related.  In
particular:

	;; Narrowing is not a minor mode, but its indicator is part of
	;; mode-line-modes.
	(when (buffer-narrowed-p)
	  (push '(narrow-to-region "Narrow" " Narrow") minor-modes))

So perhaps it'd be an idea to do the same with `lexical-binding'?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24780; Package emacs. (Sat, 27 Jul 2019 17:13:01 GMT) Full text and rfc822 format available.

Message #20 received at 24780 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Noam Postavsky <npostavs <at> gmail.com>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 24780 <at> debbugs.gnu.org
Subject: RE: bug#24780: 26.0.50; describe-mode lexical-binding
Date: Sat, 27 Jul 2019 10:12:17 -0700 (PDT)
> >> Even displaying it in mode-line might be an option.
> >
> > That does sound more useful -- I often find jumping back to the start
> > of the buffer to check.
> 
> > (Emacs-Lisp Lexical)
> >
> > when we have lexical binding in the current buffer?  Does anybody
> > have an opinion here?
> 
> IMO it's not worth spending space on the mode line for this.  Yeah,
> sometimes I want to check, and M-< followed by C-u C-SPC to go back
> works fine for that.

+10.  YAGNI.

Emacs itself should avoid adding more stuff to the
mode line.  It should be conservative about that.

In addition to `M-< C-u C-SPC', it's trivial and
quick to do `C-h v lex TAB'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24780; Package emacs. (Wed, 12 Aug 2020 01:08:02 GMT) Full text and rfc822 format available.

Message #23 received at 24780 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 24780 <at> debbugs.gnu.org
Subject: Re: bug#24780: 26.0.50; describe-mode lexical-binding
Date: Tue, 11 Aug 2020 18:06:39 -0700
Alan Mackenzie <acm <at> muc.de> writes:

>> Andreas Röhler <andreas.roehler <at> easy-emacs.de> writes:
>
>>> consider it useful if `describe-mode' reports value of var
>>> `lexical-binding'.
[...]
>>> Even displaying it in mode-line might be an option.
>
>> That does sound more useful -- I often find jumping back to the start of
>> the buffer to check.
>
>> `emacs-lisp-mode' could display that somewhere in the mode line, I
>> guess?  But where?  Perhaps among the U:**- thing at the start?  Or in
>> the mode stuff?
>
>> So instead of
>
>> (Emacs-Lisp)
>
>> we'd get
>
>> (Emacs-Lisp Lexical)
>
>> when we have lexical binding in the current buffer?  Does anybody have
>> an opinion here?
>
> Yes.  "Lexical" is too long, considering its relative lack of
> importance.  Space on the mode line is precious, particularly when
> running Follow Mode.  Also, "Lexical" isn't really a minor mode, so
> shouldn't look like one.
>
> How about, instead,
>
>     (Emacs-Lisp/L)
>
> or
>
>     (Emacs-Lisp/D)

How about:

     (Emacs-Lisp)

And:

     (Emacs-Lisp/D)

This would indicate the legacy nature of dynamic binding, and gently
nudge users to move to lexical-binding.

> ?  Even that is going to be a nuisance to some people, so it really
> needs a user option to turn it off.

I wouldn't add a user option.  The correct way to get rid of the "/D",
if it bothers you, would then be to convert the code to
lexical-binding.

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24780; Package emacs. (Wed, 12 Aug 2020 10:54:01 GMT) Full text and rfc822 format available.

Message #26 received at 24780 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Alan Mackenzie <acm <at> muc.de>, 24780 <at> debbugs.gnu.org
Subject: Re: bug#24780: 26.0.50; describe-mode lexical-binding
Date: Wed, 12 Aug 2020 12:52:46 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> How about:
>
>      (Emacs-Lisp)
>
> And:
>
>      (Emacs-Lisp/D)
>
> This would indicate the legacy nature of dynamic binding, and gently
> nudge users to move to lexical-binding.

That's a very good idea, I think.

>> ?  Even that is going to be a nuisance to some people, so it really
>> needs a user option to turn it off.
>
> I wouldn't add a user option.  The correct way to get rid of the "/D",
> if it bothers you, would then be to convert the code to
> lexical-binding.

Heh heh.  Nice.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24780; Package emacs. (Wed, 12 Aug 2020 10:57:01 GMT) Full text and rfc822 format available.

Message #29 received at 24780 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Alan Mackenzie <acm <at> muc.de>, 24780 <at> debbugs.gnu.org
Subject: Re: bug#24780: 26.0.50; describe-mode lexical-binding
Date: Wed, 12 Aug 2020 12:56:03 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

>> This would indicate the legacy nature of dynamic binding, and gently
>> nudge users to move to lexical-binding.
>
> That's a very good idea, I think.

Heh.  I should look at the mode line more -- it currently says "Elisp/l"
and "Elisp/d" with a ugly orange on the "/d", so I guess somebody
already fixed this without us noticing?

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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 12 Aug 2020 10:57:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 24780 <at> debbugs.gnu.org and Andreas Röhler <andreas.roehler <at> easy-emacs.de> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 12 Aug 2020 10:57:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24780; Package emacs. (Wed, 12 Aug 2020 13:11:01 GMT) Full text and rfc822 format available.

Message #36 received at 24780 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Alan Mackenzie <acm <at> muc.de>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 24780 <at> debbugs.gnu.org
Subject: Re: bug#24780: 26.0.50; describe-mode lexical-binding
Date: Wed, 12 Aug 2020 06:10:31 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>>> This would indicate the legacy nature of dynamic binding, and gently
>>> nudge users to move to lexical-binding.
>>
>> That's a very good idea, I think.
>
> Heh.  I should look at the mode line more -- it currently says "Elisp/l"
> and "Elisp/d" with a ugly orange on the "/d", so I guess somebody
> already fixed this without us noticing?

I missed that due to diminish, which changes it to "el" for me in both
cases.  But you are correct now that I'm trying emacs -Q.

This was added in:

commit 620f672518b1c009a028ebdb0fd1d4a0aabfa1d0
Author: Stefan Monnier <monnier <at> iro.umontreal.ca>
Date:   Tue Mar 3 11:34:49 2020 -0500

    * lisp/progmodes/elisp-mode.el (elisp-enable-lexical-binding): New command

    (emacs-lisp-mode): Indicate lex/dyn binding mode in the mode line.
    (elisp--dynlex-modeline-map): New var.

We could of course still change it to "Elisp" for the "Elisp/l" case.
Or we could just close this bug.

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24780; Package emacs. (Wed, 12 Aug 2020 13:15:02 GMT) Full text and rfc822 format available.

Message #39 received at 24780 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Alan Mackenzie <acm <at> muc.de>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 24780 <at> debbugs.gnu.org
Subject: Re: bug#24780: 26.0.50; describe-mode lexical-binding
Date: Wed, 12 Aug 2020 15:14:00 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> We could of course still change it to "Elisp" for the "Elisp/l" case.
> Or we could just close this bug.

I think "Elisp/l" is fine (for the time being; we can remove the "/l" in
some years).

So I've already closed the bug.  :-)

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24780; Package emacs. (Wed, 12 Aug 2020 14:04:02 GMT) Full text and rfc822 format available.

Message #42 received at 24780 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Alan Mackenzie <acm <at> muc.de>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 24780 <at> debbugs.gnu.org
Subject: Re: bug#24780: 26.0.50; describe-mode lexical-binding
Date: Wed, 12 Aug 2020 07:03:17 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> We could of course still change it to "Elisp" for the "Elisp/l" case.
>> Or we could just close this bug.
>
> I think "Elisp/l" is fine (for the time being; we can remove the "/l" in
> some years).
>
> So I've already closed the bug.  :-)

Sounds good, thanks.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 10 Sep 2020 11:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 287 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.