emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Run hook when variable is set


From: Richard Stallman
Subject: Re: [PATCH] Run hook when variable is set
Date: Sat, 31 Jan 2015 18:16:44 -0500

[[[ 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. ]]]

  > But what if it's documented? For example, it's documented that
  > setting the variable cursor-type not only sets a variable, but
  > also has the side effect of changing how the cursor is displayed.

That is safe because it does not run Lisp code when you set the
variable.  Basically, redisplay looks at the value of the variable,
and that happens only when redisplay gets called.

  > Disabling dynamic-cursor-mode could simply be another documented
  > side effect of setting cursor-type.

If you do it by having redisplay check cursor-type and decide
what to do about the cursor mode, I have nothing against it.

However, having any variable, the binding of which can run Lisp code,
is an absolute disaster.  If the price we pay for to avoid that disaster
is that we don't have the feature you would like, so be it.

  > Besides that, hooks on setting variables would be useful for debugging.

No matter what they would be useful for, it is not worth the chaos
they would cause.

Maybe a specialized feature solely for debugging could be made safe.

-- 
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use Ekiga or an ordinary phone call.




reply via email to

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