unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* parenthesis matching in lisp mode
@ 2003-01-18 21:44 Zimmen Gnauh
  2003-01-18 21:54 ` Phillip Garland
  0 siblings, 1 reply; 5+ messages in thread
From: Zimmen Gnauh @ 2003-01-18 21:44 UTC (permalink / raw)



   By parenthesis matching, I mean that the paired parenthesis are
highlighted when the cursor is on one of the parenthesis. How can I
make this work in lisp mode? 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: parenthesis matching in lisp mode
  2003-01-18 21:44 Zimmen Gnauh
@ 2003-01-18 21:54 ` Phillip Garland
  0 siblings, 0 replies; 5+ messages in thread
From: Phillip Garland @ 2003-01-18 21:54 UTC (permalink / raw)
  Cc: help-gnu-emacs

When in a lisp mode buffer do 

M-x show-paren-mode

or add this in your .emacs file to have this done automatically:

(add-hook 'lisp-mode-hook (lambda () (show-paren-mode)))

~Phillip

On Sat, 18 Jan 2003, Zimmen Gnauh wrote:

> 
>    By parenthesis matching, I mean that the paired parenthesis are
> highlighted when the cursor is on one of the parenthesis. How can I
> make this work in lisp mode? 
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: parenthesis matching in lisp mode
       [not found] <mailman.536.1042927135.21513.help-gnu-emacs@gnu.org>
@ 2003-01-18 22:17 ` David Kastrup
  2003-01-19 12:24   ` Ehud Karni
  2003-01-19 10:07 ` Oliver Scholz
  1 sibling, 1 reply; 5+ messages in thread
From: David Kastrup @ 2003-01-18 22:17 UTC (permalink / raw)


Phillip Garland <pgarland@u.washington.edu> writes:

> When in a lisp mode buffer do 
> 
> M-x show-paren-mode
> 
> or add this in your .emacs file to have this done automatically:
> 
> (add-hook 'lisp-mode-hook (lambda () (show-paren-mode)))

Nonsense.  You could enter the above just as
(add-hook 'lisp-mode-hook 'show-paren-mode)
but it would be equally wrong: it _toggles_ show-paren-mode every
time the lisp mode hook gets executed.

So please rather write
(add-hook 'lisp-mode-hook (lambda() (show-paren-mode 1)))

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: parenthesis matching in lisp mode
       [not found] <mailman.536.1042927135.21513.help-gnu-emacs@gnu.org>
  2003-01-18 22:17 ` parenthesis matching in lisp mode David Kastrup
@ 2003-01-19 10:07 ` Oliver Scholz
  1 sibling, 0 replies; 5+ messages in thread
From: Oliver Scholz @ 2003-01-19 10:07 UTC (permalink / raw)


Phillip Garland <pgarland@u.washington.edu> writes:

> When in a lisp mode buffer do 
>
> M-x show-paren-mode
>
> or add this in your .emacs file to have this done automatically:
>
> (add-hook 'lisp-mode-hook (lambda () (show-paren-mode)))
>
> ~Phillip

David mentioned already that this should be `(show-paren-mode 1)'.
Besides that `show-paren-mode' is a _global_ minor mode. So a simple

(show-paren-mode 1)

in your .emacs would do. You have it in all major mode then, but that
won't hurt IMO. If you really want it *only* in lisp-mode, you have to
make it buffer local first:

(add-hook 'lisp-mode-hook
	  (lambda ()
	    (make-local-variable 'show-paren-mode)
	    (show-paren-mode 1)))

    Oliver
-- 
30 Nivôse an 211 de la Révolution
Liberté, Egalité, Fraternité!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: parenthesis matching in lisp mode
  2003-01-18 22:17 ` parenthesis matching in lisp mode David Kastrup
@ 2003-01-19 12:24   ` Ehud Karni
  0 siblings, 0 replies; 5+ messages in thread
From: Ehud Karni @ 2003-01-19 12:24 UTC (permalink / raw)
  Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 18 Jan 2003 23:17:13 +0100, David Kastrup <dak@gnu.org> wrote:
>
> (add-hook 'lisp-mode-hook (lambda() (show-paren-mode 1)))

Since `show-paren-mode' is a global minor-mode, I don't see whats good
in it turned on (and staying on) only after the 1st visit of elisp file.
I suggest to turn it on permanently in your initialization file.
Add    (show-paren-mode 1)    to your .emacs file. 

BTW. You can do it through `customize' (The way is: Editing -->
     Matching --> Paren Matching --> Paren Showing, or use
     M-x customize-apropos show-paren).

Ehud


- -- 
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 mailto:ehud@unix.mvs.co.il                  Better  Safe  Than  Sorry
-----BEGIN PGP SIGNATURE-----
Comment: use http://www.keyserver.net/ to get my key (and others)

iD8DBQE+KpjlLFvTvpjqOY0RAqXxAJ9elHRKUMwTfWkBDGcuzWq0hp4zVwCghjvG
QtxfjKWKb9arzJXaZR6Tf+E=
=DEy4
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-01-19 12:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.536.1042927135.21513.help-gnu-emacs@gnu.org>
2003-01-18 22:17 ` parenthesis matching in lisp mode David Kastrup
2003-01-19 12:24   ` Ehud Karni
2003-01-19 10:07 ` Oliver Scholz
2003-01-18 21:44 Zimmen Gnauh
2003-01-18 21:54 ` Phillip Garland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).