all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Yagnesh Raghava Yakkala <yagneshmsc@gmail.com>
Cc: 9932@debbugs.gnu.org
Subject: bug#9932: 24.0.90; electric pair mode is getting enabled globally , not just for a buffer.
Date: Tue, 08 Nov 2011 23:23:29 -0500	[thread overview]
Message-ID: <jwvfwhyq64i.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87hb2n3o8n.fsf@live.com> (Yagnesh Raghava Yakkala's message of "Tue, 01 Nov 2011 23:34:48 +0900")

> Electric pair mode enables globally. I would rather prefer it to be
> buffer local.

> I think it would be good to have an electric-pair-mode for a single
> buffer and an electric-pair-global-mode/global-electric-pair-mode for
> enabling the feature globally.

How 'bout a way to turn it off buffer-locally, so you can have it
enabled globally but can also disable it in some modes?
E.g. the patch below would be enough for that, after which you could do

(add-hook 'text-mode-hook
          (lambda () (set (make-local-variable 'electric-pair-mode) nil)))

to turn if off in all modes derived from text-mode.

We could easily provide this in 24.1, whereas what you suggest would
have to wait for 24.2.


        Stefan


=== modified file 'lisp/electric.el'
--- lisp/electric.el	2011-10-19 21:57:06 +0000
+++ lisp/electric.el	2011-11-09 04:21:51 +0000
@@ -284,6 +284,7 @@
 
 (defun electric-pair-post-self-insert-function ()
   (let* ((syntax (and (eq (char-before) last-command-event) ; Sanity check.
+                      electric-pair-mode
                       (let ((x (assq last-command-event electric-pair-pairs)))
                         (cond
                          (x (if (eq (car x) (cdr x)) ?\" ?\())






  reply	other threads:[~2011-11-09  4:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 14:34 bug#9932: 24.0.90; electric pair mode is getting enabled globally , not just for a buffer Yagnesh Raghava Yakkala
2011-11-09  4:23 ` Stefan Monnier [this message]
     [not found] ` <handler.9932.B.13201637308411.ack@debbugs.gnu.org>
2011-11-11 19:12   ` bug#9932: Acknowledgement (24.0.90; electric pair mode is getting enabled globally , not just for a buffer.) yagnesh raghava
2011-11-11 22:12     ` Stefan Monnier

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=jwvfwhyq64i.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=9932@debbugs.gnu.org \
    --cc=yagneshmsc@gmail.com \
    /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.