all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Subject: Problem with define-minor-mode with :global t.
Date: Fri, 15 Jul 2005 11:06:00 +0200	[thread overview]
Message-ID: <m3br54wi9z.fsf@kfs-l.imdomain.dk> (raw)


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 <storm@cua.dk> http://www.cua.dk

             reply	other threads:[~2005-07-15  9:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-15  9:06 Kim F. Storm [this message]
2005-07-15 20:32 ` Problem with define-minor-mode with :global t Stefan Monnier
2005-07-16 20:46 ` Richard M. Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3br54wi9z.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.