Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pair-mode: remove "(" from pair-mode-chars when in python-mode.

0 views
Skip to first unread message

Livin Stephen Sharma

unread,
Dec 16, 2008, 9:10:46 AM12/16/08
to emacs help - gnu
Hi.
 How can I turn OFF the pair-mode char being inserted ONLY for "("
 ( but NOT for the other quote/braces/etc chars ) .


Details...

 [[[ I don't know lisp. ]]]

... I'm trying to have pair-mode ON in python-mode, BUT not have ")" auto-inserted when I type "(".

 For other characters like
[
{
<
'
"
etc, I DO want pair-mode to provide the matching pair.


I'd been at it (trial-and-error) for some time with no progress, so I tried this to try to see ANY change in behaviour:

  (make-variable-buffer-local 'pair-mode-chars)
  (make-variable-buffer-local 'pair-mode-map)

  (set 'pair-mode-chars '(91))
  (set 'pair-mode-map '(keymap (91 . skeleton-pair-insert-maybe)))

C-h v pair-mode-chars _does_ show this:

.. Its value is (91)                                                                                                                                     
                                                                                                                                                      
Local in buffer HelloBrian.py; global value is                                                                                                        
(40 91 123 60 2219 96 34 39) ...                                                                                                                         


But even so, the matching character being inserted for ALL of these:
<{("'`

I expected pair-mode be working only for "[" ?

I'd appreciate help on this.



Kevin Rodgers

unread,
Dec 17, 2008, 11:05:19 PM12/17/08
to help-gn...@gnu.org
Livin Stephen Sharma wrote:
> Hi.
> How can I turn OFF the pair-mode char being inserted ONLY for "("
> ( but NOT for the other quote/braces/etc chars ) .

What is pair-mode? It is not distributed with Emacs 22.3.

--
Kevin Rodgers
Denver, Colorado, USA

Livin Stephen Sharma

unread,
Dec 18, 2008, 5:00:41 AM12/18/08
to emacs help - gnu


==============================================================================
TOPIC: pair-mode: remove "(" from pair-mode-chars when in python-mode.
http://groups.google.com/group/gnu.emacs.help/t/951e81b16c0890af?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Dec 17 2008 8:05 pm
Thanks for the response - I was losing hope :)

With an example:
 If I type in an opening-parenthesis,
 pair-mode will insert a matching closing-parenthesis immediately after my input.

It works similarly for other characters like {,[,",',<, etc.
By providing a }.],",',>, etc character as the case may be.

 - makes for some minor (and very convenient) key-stroke savings. I'd just like to turn it off for "("  when in python-mode.

I think this is where I got it:
http://www.loveshack.ukfsn.org/emacs/pair-mode.el 

;;; pair-mode.el --- insertion of paired characters
--livin.stephen


0 new messages