unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: Caps-mode vs. Overwrite mode
Date: Fri, 03 Apr 2015 11:26:36 -0400	[thread overview]
Message-ID: <jwvvbhd1blf.fsf-monnier+gmane.emacs.help@gnu.org> (raw)
In-Reply-To: mfm93h$fdk$2@dont-email.me

>> The caps-mode.el that's in GNU ELPA shouldn't suffer from this
>> problem, AFAIK.
> My first search only turns up caps-lock.el?

Ah, right, that's the one.  Sorry for the typo.

> Spoke too soon.
> caps-lock mode isn't buffer local.

Indeed.

You can make it buffer-local with the patch below.

If someone wants to submit a patch which adds buffer-local variant, that
could be included in the GNU ELPA package.


        Stefan


diff --git a/packages/caps-lock/caps-lock.el b/packages/caps-lock/caps-lock.el
index 24729a4..5787ef8 100644
--- a/packages/caps-lock/caps-lock.el
+++ b/packages/caps-lock/caps-lock.el
@@ -29,10 +29,10 @@
 ;;;###autoload
 (define-minor-mode caps-lock-mode
   "Make self-inserting keys invert the capitalization."
-  :global t
+  ;; :global t
   (if caps-lock-mode
-      (add-hook 'pre-command-hook #'caps-lock--pch)
-    (remove-hook 'pre-command-hook #'caps-lock--pch)))
+      (add-hook 'pre-command-hook #'caps-lock--pch nil t)
+    (remove-hook 'pre-command-hook #'caps-lock--pch t)))
 
 (defun caps-lock--pch ()
   (when (and (characterp last-command-event)




  parent reply	other threads:[~2015-04-03 15:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-03 14:21 Caps-mode vs. Overwrite mode Dan Espen
2015-04-03 14:35 ` Stefan Monnier
     [not found] ` <mailman.3242.1428071743.31049.help-gnu-emacs@gnu.org>
2015-04-03 14:47   ` Dan Espen
2015-04-03 15:10     ` Eli Zaretskii
2015-04-03 15:25       ` Eli Zaretskii
2015-04-03 15:14     ` Dan Espen
     [not found]     ` <mailman.3243.1428073855.31049.help-gnu-emacs@gnu.org>
2015-04-03 15:21       ` Dan Espen
2015-04-03 15:26     ` Stefan Monnier [this message]
     [not found]     ` <mailman.3246.1428074815.31049.help-gnu-emacs@gnu.org>
2015-04-03 16:35       ` Dan Espen
2015-04-03 16:44         ` Stefan Monnier
     [not found]         ` <mailman.3250.1428079480.31049.help-gnu-emacs@gnu.org>
2015-04-03 17:10           ` Dan Espen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvvbhd1blf.fsf-monnier+gmane.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).