emacs-devel
[Top][All Lists]
Advanced

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

Problem with define-minor-mode with :global t.


From: Kim F. Storm
Subject: Problem with define-minor-mode with :global t.
Date: Fri, 15 Jul 2005 11:06:00 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

In CUA, I have this:

(define-minor-mode cua-mode
  "..."
  :global t
  ...)


Now, assume I have a buffer `xyz' which definitely don't want
cua-mode enabled.

If I do things in the following sequence, it works alright:

M-x cua-mode RET
C-x b xyz RET
M-: (set (make-local-variable 'cua-mode) nil) RET


But if I (accidentally) do it in this sequence:

C-x b xyz RET
M-: (set (make-local-variable 'cua-mode) nil) RET
M-x cua-mode RET

then I end up _enabling_ cua mode in just the xyz buffer,
while the global setting is still nil.


I think that it would make sense if specifying :global t on
define-minor-mode would enforce changing the default (global) value of
the mode variable rather than the potentially buffer-local value.

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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