[ESS] Highlighting matching parentheses

Frank E Harrell Jr f.harrell at vanderbilt.edu
Sat Apr 25 16:13:07 CEST 2009


Chris Evans wrote:
> Kevin W sent the following  at 24/04/2009 01:20:
>> I have been using show-paren-mode to highlight matching parentheses, but
>> wished that I could highlight more than one par of matching parentheses at a
>> time.  (Similar to the way Excel highlights parentheses when editing
>> formulas).
>>
>> I'm excited to report that I have discovered a way to do this and offer the
>> following bit from my .emacs file for your enjoyment.
>>
>> ; Download this into your emacs lisp directory
>> ; http://nschum.de/src/emacs/highlight-parentheses/highlight-parentheses.el
>> (require 'highlight-parentheses)
>> (setq hl-paren-colors '("gold" "IndianRed" "cyan" "green" "orange"
>> "magenta"))
>> (defun hpm-on ()
>>   (highlight-parentheses-mode t))
>> (add-hook 'ess-mode-hook 'hpm-on)
>> (add-hook 'inferior-ess-mode-hook 'hpm-on)
>>
>> I think you can add more colors to the list if needed.  hl-paren-colors can
>> also be set via customization groups if you want.
>>
>> Kevin Wright
> 
> I not infrequently mess up with parentheses so this sounded very good to
> me too, though I wasn't entirely sure what Excel had that was being
> emulated. I had a quick play with Excel and still wasn't that sure.
> 
> However, I think I have installed highlight-parentheses.el correctly and
> put those lines (above) where they should be but I'm not seeing anything
> different in ESS.
> 
> Could it be that I'm using XEmacs (21.4.21 on Windoze XP sp3)?  I have
> downloaded highlight-parentheses.el at:
> 	D:\XEmacs\site-packages\lisp\highlight-parentheses.el
> and put those lines above in
> 	C:\Documents and Settings\admin\.xemacs\init.el
> which are the appropriate places in XEmacs in my set up I think.
> 
> However, I don't see any change as I say.
> 
> Several questions for people, including, and great thanks to, Kevin, but
> also perhaps to fellow XEmacs users.
> 
> 1) what should I see that would indicate that things are working (I'll
> put my glasses on!)?
> 2) what could I do that would confirm that XEmacs has loaded those lines
> correctly, invoking highlight-parentheses.el?
> 
> TIA and continued thanks to everyone who makes ESS so wonderful.
> 
> Chris
> 
> 
> 
> 

I installed the new .el file in /usr/share/emacs22/site-lisp/ess and 
added the above lines to .emacs, then restarted Emacs22.  I see gold 
highlighting, but I don't see usage of any of the other colors listed.

Frank
-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University




More information about the ESS-help mailing list