all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* editorconfig makes advice
@ 2024-06-22  2:47 Richard Stallman
  2024-06-22  2:56 ` Po Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Stallman @ 2024-06-22  2:47 UTC (permalink / raw)
  To: emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

I was looking at the posted diffs and saw this:

             (advice-add 'find-file-noselect :around #'editorconfig--advice-find-file-noselect)
-            (advice-add 'insert-file-contents :around #'editorconfig--advice-insert-file-contents)
+            (advice-add 'find-auto-coding :after-until
+                        #'editorconfig--advice-find-auto-coding)

Our general design principle is that parts of Emacs should not advise other
parts of Emacs -- instead, they should set up hooks that the other parts run.
The reasons for this are documented.

Is there a rpecial reason to use advice here?  If not,
can we please eliminate this advice, perhaps by making a few new hooks?

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





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

* Re: editorconfig makes advice
  2024-06-22  2:47 editorconfig makes advice Richard Stallman
@ 2024-06-22  2:56 ` Po Lu
  2024-06-25  2:49   ` Richard Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: Po Lu @ 2024-06-22  2:56 UTC (permalink / raw)
  To: Richard Stallman; +Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
> I was looking at the posted diffs and saw this:
>
>              (advice-add 'find-file-noselect :around #'editorconfig--advice-find-file-noselect)
> -            (advice-add 'insert-file-contents :around #'editorconfig--advice-insert-file-contents)
> +            (advice-add 'find-auto-coding :after-until
> +                        #'editorconfig--advice-find-auto-coding)
>
> Our general design principle is that parts of Emacs should not advise other
> parts of Emacs -- instead, they should set up hooks that the other parts run.
> The reasons for this are documented.
>
> Is there a rpecial reason to use advice here?  If not,
> can we please eliminate this advice, perhaps by making a few new hooks?

These advices are only installed on previous releases of Emacs that this
copy of editorconfig.el is also meant to support, and the requisite
hooks are already implemented in Emacs 30.



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

* Re: editorconfig makes advice
  2024-06-22  2:56 ` Po Lu
@ 2024-06-25  2:49   ` Richard Stallman
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Stallman @ 2024-06-25  2:49 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > These advices are only installed on previous releases of Emacs that this
  > copy of editorconfig.el is also meant to support, and the requisite
  > hooks are already implemented in Emacs 30.

That means the problem won't exist in Emacs 30.  I'm relieved.

Thanks.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





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

end of thread, other threads:[~2024-06-25  2:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-22  2:47 editorconfig makes advice Richard Stallman
2024-06-22  2:56 ` Po Lu
2024-06-25  2:49   ` Richard Stallman

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.