emacs-devel
[Top][All Lists]
Advanced

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

Re: Patch: Syntax and Hard Newlines


From: Herbert Euler
Subject: Re: Patch: Syntax and Hard Newlines
Date: Thu, 16 Nov 2006 18:47:05 +0800

A silly question maybe: Wouldn't

+     (kill-local-variable 'parse-sexp-lookup-properties)

cause problems for major modes using that?

I suppose it would be cleaner to require minor modes that want to turn
on/off `parse-sexp-lookup-properties' in a buffer append/remove their
name from/to that variable and kill it iff that list gets empty.

No, `kill-local-variable' only makes a variable no longer have a
separate value in the current buffer.  The same variable (perhaps
local) in other buffers is not affected, either does the global
version of the variable:

(setq abc 7)
==> 7
(setq b1 (get-buffer-create "b1"))
==> #<buffer b1>
(setq b2 (get-buffer-create "b2"))
==> #<buffer b2>
(save-window-excursion (switch-to-buffer b1)
                      abc)
==> 7
(save-window-excursion (switch-to-buffer b2)
                      abc)
==> 7
(save-window-excursion (switch-to-buffer b1)
                      (make-local-variable 'abc)
                      (setq abc 5)
                      abc)
==> 5
abc
==> 7
(save-window-excursion (switch-to-buffer b2)
                      (make-local-variable 'abc)
                      (setq abc 9)
                      abc)
==> 9
abc
==> 7
(save-window-excursion (switch-to-buffer b1)
                      (kill-local-variable 'abc)
                      abc)
==> 7
abc
==> 7
(save-window-excursion (switch-to-buffer b2)
                      abc)
==> 9
abc
==> 7

Regards,
Guanpeng Xu

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/





reply via email to

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