[ESS] Highlighting matching parentheses

Chris Evans chrishold at psyctc.org
Sat Apr 25 13:56:38 CEST 2009


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




-- 
Chris Evans <chris at psyctc.org> Skype: chris-psyctc
Consultant Psychiatrist in Psychotherapy, Notts. PDD network;
Trust Research Governance Lead and Clinical Director, Psychological
  Therapies Directorate in Local Services, Nottinghamshire NHS Trust;
Professor, Psychotherapy, Nottingham University
*If I am writing from one of those roles, it will be clear. Otherwise*
*my views are my own and not representative of those institutions    *
If you have difficulty Emailing me on this address or getting a reply,
send again but cc to:       chris dot evans at nottshc dot nhs dot uk
and to:                     c dot evans at nottingham dot ac dot uk




More information about the ESS-help mailing list