unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* lexical-bindings... is that what we indent?
@ 2024-05-05  6:45 Pedro Andres Aranda Gutierrez
  2024-05-05  8:18 ` Colin Baxter
  0 siblings, 1 reply; 8+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2024-05-05  6:45 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 3231 bytes --]

Hi

```
⛔ Warning (lexical-binding): File
/usr/share/emacs/30.0.50/site-lisp/subdirs.el lacks `lexical-binding'
directive on its first line
⛔ Warning (lexical-binding): File /usr/share/emacs/site-lisp/subdirs.el
lacks `lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/early-init.el lacks
`lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/init.el lacks
`lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/defaults.el lacks
`lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/functions.el lacks
`lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/packages.el lacks
`lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/use-emacs.el lacks
`lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/keymaps.el lacks
`lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/eglot-company.el
lacks `lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/modes.el lacks
`lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/hooks.el lacks
`lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/jinx-setup.el lacks
`lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/org-hook.el lacks
`lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/bibtex.el lacks
`lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/mode-line.el lacks
`lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/x-init.el lacks
`lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/cycle-appearance.el
lacks `lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/themes/sur-theme.el
lacks `lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/custom.el lacks
`lexical-binding' directive on its first line
⛔ Warning (lexical-binding): File /home/paag/.emacs.d/yas-functions.el
lacks `lexical-binding' directive on its first line
```

Is that what we intend on every boot? Please, no.

At the end, people will ignore this warning completely and it will just a
message from "bugging, hysterical emacs".
This may well be a reason for novel users to switch to other editors.
Do we want that?
How critical is this missing lexical binding?

Thx, /PA
PS: sorry if it reads extreme :-)
-- 
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet

[-- Attachment #2: Type: text/html, Size: 3773 bytes --]

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

* Re: lexical-bindings... is that what we indent?
  2024-05-05  6:45 lexical-bindings... is that what we indent? Pedro Andres Aranda Gutierrez
@ 2024-05-05  8:18 ` Colin Baxter
  2024-05-05 10:35   ` Pedro Andres Aranda Gutierrez
  0 siblings, 1 reply; 8+ messages in thread
From: Colin Baxter @ 2024-05-05  8:18 UTC (permalink / raw)
  To: Pedro Andres Aranda Gutierrez; +Cc: emacs-devel

>>>>> Pedro Andres Aranda Gutierrez <paaguti@gmail.com> writes:

    > Hi ``` ⛔️ Warning (lexical-binding): File
    > /usr/share/emacs/30.0.50/site-lisp/subdirs.el lacks
    > `lexical-binding' directive on its first line ⛔️ Warning

--- snip ---

    > Is that what we intend on every boot? Please, no.

Early days. I expect (hope?) these warnings will decrease over time as
adjustments are made.

One thing that does concern me is that some (many?) users use packages
directly from a git clone, without "installing" them. One that I use is
slime, which contains an autoloads .el file with no lexical binding and a
'no-byte-compile' set to `t'. I am sure that are other similar
examples. Unless such files are exempted the user will have no way of
switching off the warnings unless they adjust their
'warning-minimum-level', which is not always a good thing to do.

Colin.
   



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

* Re: lexical-bindings... is that what we indent?
  2024-05-05  8:18 ` Colin Baxter
@ 2024-05-05 10:35   ` Pedro Andres Aranda Gutierrez
  2024-05-05 10:58     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2024-05-05 10:35 UTC (permalink / raw)
  To: m43cap; +Cc: emacs-devel

HI

> El 5 may 2024, a las 10:18, Colin Baxter <m43cap@yandex.com> escribió:
> 
>>>>>> Pedro Andres Aranda Gutierrez <paaguti@gmail.com> writes:
> 
>> Hi ``` ⛔️ Warning (lexical-binding): File
>> /usr/share/emacs/30.0.50/site-lisp/subdirs.el lacks
>> `lexical-binding' directive on its first line ⛔️ Warning
> 

I hate to revive old skeletons from the wardrobe, but the “No way” sign has NEVER been a warning
and if you take it like that, the best thing that can happen is that you are a couple hundred Euros poorer
and have some points less in your driver’s license when you are caught ;-)

— snip ---
> Unless such files are exempted the user will have no way of
> switching off the warnings unless they adjust their
> 'warning-minimum-level', which is not always a good thing to do.
> 
> Colin.
I already have it at :emergency ;-)

Best, /PA




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

* Re: lexical-bindings... is that what we indent?
  2024-05-05 10:35   ` Pedro Andres Aranda Gutierrez
@ 2024-05-05 10:58     ` Eli Zaretskii
  2024-05-05 12:48       ` Yuri Khan
  2024-05-05 16:19       ` [External] : " Drew Adams
  0 siblings, 2 replies; 8+ messages in thread
From: Eli Zaretskii @ 2024-05-05 10:58 UTC (permalink / raw)
  To: Pedro Andres Aranda Gutierrez; +Cc: m43cap, emacs-devel

> From: Pedro Andres Aranda Gutierrez <paaguti@gmail.com>
> Date: Sun, 5 May 2024 12:35:43 +0200
> Cc: emacs-devel <emacs-devel@gnu.org>
> 
> >>>>>> Pedro Andres Aranda Gutierrez <paaguti@gmail.com> writes:
> > 
> >> Hi ``` ⛔️ Warning (lexical-binding): File
> >> /usr/share/emacs/30.0.50/site-lisp/subdirs.el lacks
> >> `lexical-binding' directive on its first line ⛔️ Warning
> > 
> 
> I hate to revive old skeletons from the wardrobe, but the “No way” sign has NEVER been a warning
> and if you take it like that, the best thing that can happen is that you are a couple hundred Euros poorer
> and have some points less in your driver’s license when you are caught ;-)

I hate to answer this very question again, but the "No way" sign is
not meant to indicate a warning, it is meant to be the icon saying
"press me to stop this warning from being emitted".



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

* Re: lexical-bindings... is that what we indent?
  2024-05-05 10:58     ` Eli Zaretskii
@ 2024-05-05 12:48       ` Yuri Khan
  2024-05-05 13:46         ` Mattias Engdegård
  2024-05-05 16:19       ` [External] : " Drew Adams
  1 sibling, 1 reply; 8+ messages in thread
From: Yuri Khan @ 2024-05-05 12:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Pedro Andres Aranda Gutierrez, m43cap, emacs-devel

On Sun, 5 May 2024 at 17:59, Eli Zaretskii <eliz@gnu.org> wrote:

> > I hate to revive old skeletons from the wardrobe, but the “No way” sign has NEVER been a warning> > and if you take it like that, the best thing that can happen is that you are a couple hundred Euros poorer
> > and have some points less in your driver’s license when you are caught ;-)
>
> I hate to answer this very question again, but the "No way" sign is
> not meant to indicate a warning, it is meant to be the icon saying
> "press me to stop this warning from being emitted".

I hate to interrupt you guys hating various different things, but a
color emoji does not quite say “press me” the way a colored
underscored plain text label or a 3D-boxed button would. (Also a 🔇
U+1F507 SPEAKER WITH CANCELLATION STROKE or a 🔕 U+1F515 BELL WITH
CANCELLATION STROKE would in my opinion be clearer at expressing
“interact with me to mute this warning”, and at the same time appear
less shouty.)



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

* Re: lexical-bindings... is that what we indent?
  2024-05-05 12:48       ` Yuri Khan
@ 2024-05-05 13:46         ` Mattias Engdegård
  2024-05-05 23:15           ` Rudolf Adamkovič
  0 siblings, 1 reply; 8+ messages in thread
From: Mattias Engdegård @ 2024-05-05 13:46 UTC (permalink / raw)
  To: Yuri Khan; +Cc: Eli Zaretskii, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1083 bytes --]

5 maj 2024 kl. 14.48 skrev Yuri Khan <yuri.v.khan@gmail.com>:

> a color emoji does not quite say “press me” the way a colored
> underscored plain text label or a 3D-boxed button would.

Eli is entirely right, and so are you. In interaction design, our intentions count for very little.

The icon is not obviously a button, and even if it were, a wrong-entrance traffic sign doesn't say 'suppress warning'.

The context and positioning of the icon are more those of a bullet, which is not generally considered a target for interaction. But having an inert bullet or other conspicuous marker there does make sense, because it marks the start of a warning and makes the buffer easier to read at a glance.

A button for disabling is useful, but it should be clear what it does, and it probably makes more sense to put it at the end of the entry. (Space is not a concern there, so let's not use words rather than a symbol.)

This suggests that something like

  * Warning: beware of the leopard!  [Disable]

would probably work better. Here is a tentative patch.


[-- Attachment #2: warning-bullet-and-button.diff --]
[-- Type: application/octet-stream, Size: 1347 bytes --]

diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index 8c1e43934ff..6623caed4b7 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -316,18 +316,18 @@ display-warning
 	      (unless (bolp)
 		(funcall newline))
 	      (setq start (point))
-              ;; Don't output the button when doing batch compilation
-              ;; and similar.
-              (unless (or noninteractive (eq type 'bytecomp))
-                (insert (buttonize (icon-string 'warnings-suppress)
-                                   #'warnings-suppress type)
-                        " "))
+              (insert (propertize "***" 'face 'bold) " ")
 	      (if warning-prefix-function
 		  (setq level-info (funcall warning-prefix-function
 					    level level-info)))
 	      (insert (format (nth 1 level-info)
 			      (format warning-type-format typename))
 		      message)
+              ;; Don't output the button when doing batch compilation
+              ;; and similar.
+              (unless (or noninteractive (eq type 'bytecomp))
+                (insert " " (buttonize "[Disable]" #'warnings-suppress type
+                                       "Disable this warning")))
               (funcall newline)
 	      (when (and warning-fill-prefix
                          (not (string-search "\n" message))

[-- Attachment #3: Type: text/plain, Size: 2 bytes --]




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

* RE: [External] : Re: lexical-bindings... is that what we indent?
  2024-05-05 10:58     ` Eli Zaretskii
  2024-05-05 12:48       ` Yuri Khan
@ 2024-05-05 16:19       ` Drew Adams
  1 sibling, 0 replies; 8+ messages in thread
From: Drew Adams @ 2024-05-05 16:19 UTC (permalink / raw)
  To: Eli Zaretskii, Pedro Andres Aranda Gutierrez
  Cc: m43cap@yandex.com, emacs-devel@gnu.org

> > >> Hi ``` ⛔️ Warning (lexical-binding): File
> > >> /usr/share/emacs/30.0.50/site-lisp/subdirs.el lacks
> > >> `lexical-binding' directive on its first line ⛔️ Warning
> >
> > I hate to revive old skeletons from the wardrobe, but the
> > “No way” sign has NEVER been a warning and if you take it
> > like that, the best thing that can happen is that you are
> > a couple hundred Euros poorer and have some points less
> > in your driver’s license when you are caught ;-)
> 
> I hate to answer this very question again, but the "No way" sign is
> not meant to indicate a warning, it is meant to be the icon saying
> "press me to stop this warning from being emitted".

... which is not what the sign really means,
which is "Do Not Enter" or "No Entry".

Maybe Someone could conceivably guess that it's
intended by Emacs to mean "DON'T click here".
But other than such a bizarre misdirection, I
can't imagine any connection.

(This is like supposing that a skull & crossbones
icon on a bottle of poison invites you to "Drink
me for good health!")

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

* Re: lexical-bindings... is that what we indent?
  2024-05-05 13:46         ` Mattias Engdegård
@ 2024-05-05 23:15           ` Rudolf Adamkovič
  0 siblings, 0 replies; 8+ messages in thread
From: Rudolf Adamkovič @ 2024-05-05 23:15 UTC (permalink / raw)
  To: Mattias Engdegård, Yuri Khan; +Cc: Eli Zaretskii, emacs-devel

Mattias Engdegård <mattias.engdegard@gmail.com> writes:

> This suggests that something like
>
>   * Warning: beware of the leopard!  [Disable]
>
> would probably work better. Here is a tentative patch.

Yes, please.

Rudy
-- 
“Those who cannot remember the past are condemned to repeat it.”
--- George Santayana, Life of Reason: Reason in Common Sense, 1905

Rudolf Adamkovič <rudolf@adamkovic.org> [he/him]
Studenohorská 25, 84103 Bratislava, Slovakia, European Union



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

end of thread, other threads:[~2024-05-05 23:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-05  6:45 lexical-bindings... is that what we indent? Pedro Andres Aranda Gutierrez
2024-05-05  8:18 ` Colin Baxter
2024-05-05 10:35   ` Pedro Andres Aranda Gutierrez
2024-05-05 10:58     ` Eli Zaretskii
2024-05-05 12:48       ` Yuri Khan
2024-05-05 13:46         ` Mattias Engdegård
2024-05-05 23:15           ` Rudolf Adamkovič
2024-05-05 16:19       ` [External] : " Drew Adams

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).