emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH] frame.c: focus hooks


From: Drew Adams
Subject: RE: [PATCH] frame.c: focus hooks
Date: Tue, 19 Nov 2013 10:53:55 -0800 (PST)

Hm. I see nothing in either the Emacs manual or the Elisp manual that suggests that Lisp code should not use `add-hook' or `remove-hook'.

 

Where do you find a convention saying that *polite* Lisp packages do not modify hook values and that to do so in a package published for widespread use is "rude" and "ill-mannered"? Or that package authors who do not respect such a presumed convention are impolite or do not act in good faith?

 

Where are the "Emacs etiquette" and "social norms" in this regard put forth?

 

Just wondering.

 

The only thing I see that is related to this is in (elisp) `Coding Conventions', where it says:

 

     If loading the file adds functions to hooks, define a function

     `FEATURE-unload-hook', where FEATURE is the name of the feature

     the package provides, and make it undo any such changes.  Using

     `unload-feature' to unload the file will run this function.  *Note

     Unloading::.

 

You say:

 

It's probably not a bad idea to document the intent of these hooks -- that they are meant for the end user and that it is inappropriate to set them in public packages, but I don't see that adding them opens a huge can of worms.

 

Then please do that. If it is inappropriate for Lisp code to use these hooks, then document that, of course. And perhaps document the reason. I don't think you can assume that people (users or package authors) are aware of the convention that you presume.

 

Are you assuming that these hooks won't be used by any Lisp packages?

 

Yes, I am expecting that they will be left for the user to specify in

his or her local Emacs configuration.

 

That is, I expect that they won't be assigned by *polite* Lisp packages.

It would be rude to set these hooks in a package published for

widespread use.

 

Package authors aren't perfect, but they care enough about Emacs culture

to learn Lisp and contribute work.  We should assume good faith.  When

people write impolite packages, we should teach them Emacs etiquette and

help them observe social norms.

 

Further, ill-mannered Lisp packages are not forced on the user.  They

are deliberately downloaded in source form and installed.  If a package

inappropriately assigns hooks, we are free to uninstall it, to clear the

hooks after load, to modify the package for local use, to contact the

authors and suggest that they not over-specify our environment, or even

to distribute a better-behaved fork of the package.

 

Inappropriate hook assignment is also easier to detect than many

possible package misbehaviors -- just evaluate the hook variables.

 

It's probably not a bad idea to document the intent of these hooks -- that

they are meant for the end user and that it is inappropriate to set them

in public packages, but I don't see that adding them opens a huge can of

worms.

 

Best,

Brian Jenkins 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]