switching on highlight-paren-mode

switching on highlight-paren-mode

Post by Massimiliano Mirra - bar » Tue, 15 Jul 2003 09:45:08



Is there a way to turn highlight-paren-mode on unconditionally, like
(show-paren-mode t)?  toggle-highlight-paren-mode only toggles
(surprise) it.

 
 
 

switching on highlight-paren-mode

Post by Olivier Ramar » Tue, 15 Jul 2003 17:33:32



Quote:> Is there a way to turn highlight-paren-mode on unconditionally, like
> (show-paren-mode t)?  toggle-highlight-paren-mode only toggles
> (surprise) it.

Well, "M-x toggle-highlight-paren-mode" says "Show Paren mode disabled"
(or enabled), so I believe this switch is only the interactive menu-bar
counter-part of show-paren-stuff with a toggle in between ... And it
does not correspond to another of highlighting parenthesis.
Hope that helps,
Best,
Amities,
          Olivier

 
 
 

switching on highlight-paren-mode

Post by Massimiliano Mirra - bar » Tue, 15 Jul 2003 21:59:23



> Well, "M-x toggle-highlight-paren-mode" says "Show Paren mode disabled"
> (or enabled), so I believe this switch is only the interactive menu-bar
> counter-part of show-paren-stuff with a toggle in between ... And it
> does not correspond to another of highlighting parenthesis.
> Hope that helps,

I gather Emacs uses two ways of showing a matching parenthesis.

Setting show-paren-mode and not toggle-highlight-paren-mode has the
cursor move to the opening parenthesis when the closing parenthesis is
inserted.

Setting show-paren-mode and toggle-highlight-paren-mode has the
opening parenthesis highlight when the closing parenthesis is
inserted.

Setting either show-paren-mode or toggle-highlight-paren-mode is
necessary but not sufficient for parentheses to be highlighted, both
must be set at the same time.

As you note, you can unconditionally turn on show-paren-mode.  I've
not found a way to unconditionally turn on highlight-paren-mode yet.

Thank you anyway.

Massimiliano

 
 
 

switching on highlight-paren-mode

Post by Olivier Ramar » Tue, 15 Jul 2003 22:40:35


Ok, ok.

toggle-highlight-paren-mode  is defined in menu-bar.el
through menu-bar-make-toggle.
To make a long story short, its definition is essentially
(defun toggle-highlight-paren-mode nil
   (interactive)
   (setq show-paren-mode (not show-paren-mode))
   (show-paren-mode))

so
(setq show-paren-mode nil) ;; or t
(show-paren-mode 1)
should do the trick.
Hope this time it is ok !
                               Olivier

 
 
 

switching on highlight-paren-mode

Post by Massimiliano Mirra - bar » Wed, 16 Jul 2003 00:56:42



> toggle-highlight-paren-mode  is defined in menu-bar.el
> through menu-bar-make-toggle.
[...]
> Hope this time it is ok !

Yes.  First time your explanation was ok as well, it was my
presuppositions which were off by a mile.  :-) (I tried to make sense
of it by looking at the sources, too, but for me it's still `macro
field, mine field'.)

Thanks!