all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* matching parenthesis
@ 2005-07-22 12:30 Jan Guido Donath
  2005-07-22 14:12 ` Johan Bockgård
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Guido Donath @ 2005-07-22 12:30 UTC (permalink / raw


hi, 

in my .emacs, i have the following in order to show matching parenthesis:

(setq show-paren-delay 0
      show-paren-style 'parenthesis)
(show-paren-mode 1)

Actually, it highlights the matching parenthesis in a different colour.
The problem is: when the matching parenthesis is out of the display,
that doesnt make much sense to me ...
I remember that once, it showed an expression in the minibuffer like 
"mathes (defun..." or something like this. this makes a lot of sense!!

Unfortunately, I couldnt get that back. I tried to set show-paren-style
to 'mixed etc, but thats not what I want ...

Is there any lisp-code that might work as described?

Thanks, 

Guido

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

* Re: matching parenthesis
  2005-07-22 12:30 matching parenthesis Jan Guido Donath
@ 2005-07-22 14:12 ` Johan Bockgård
  2005-07-22 19:58   ` Klaus Berndl
  0 siblings, 1 reply; 8+ messages in thread
From: Johan Bockgård @ 2005-07-22 14:12 UTC (permalink / raw


Jan Guido Donath <donath@cpfs.mpg.de> writes:

> The problem is: when the matching parenthesis is out of the display,
> that doesnt make much sense to me ... I remember that once, it
> showed an expression in the minibuffer like "mathes (defun..." or
> something like this. this makes a lot of sense!!

mic-paren.el

-- 
Johan Bockgård

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

* Re: matching parenthesis
  2005-07-22 14:12 ` Johan Bockgård
@ 2005-07-22 19:58   ` Klaus Berndl
  2005-07-25  9:09     ` Sergei
  0 siblings, 1 reply; 8+ messages in thread
From: Klaus Berndl @ 2005-07-22 19:58 UTC (permalink / raw


On Fri, 22 Jul 2005, Johan Bockgård wrote:



>  Jan Guido Donath <donath@cpfs.mpg.de> writes:
>  
> > The problem is: when the matching parenthesis is out of the display,
> > that doesnt make much sense to me ... I remember that once, it
> > showed an expression in the minibuffer like "mathes (defun..." or
> > something like this. this makes a lot of sense!!
>  
>  mic-paren.el

A tip from the author and maintainer ;-)

;; This file can be obtained from "The EmacsWiki" and here from the
;; packages-site: http://www.emacswiki.org/elisp/index.html

Klaus

-- 
Klaus Berndl			mailto: klaus.berndl@sdm.de
sd&m AG				http://www.sdm.de
software design & management	
Carl-Wery-Str. 42, 81739 Muenchen, Germany
Tel +49 89 63812-392, Fax -220

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

* Re: matching parenthesis
  2005-07-22 19:58   ` Klaus Berndl
@ 2005-07-25  9:09     ` Sergei
  2005-07-25 20:57       ` Martin Slouf
                         ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sergei @ 2005-07-25  9:09 UTC (permalink / raw


Klaus Berndl:
> On Fri, 22 Jul 2005, Johan Bockg?rd wrote:

...

>>  mic-paren.el

> A tip from the author and maintainer ;-)

> ;; This file can be obtained from "The EmacsWiki" and here from the
> ;; packages-site: http://www.emacswiki.org/elisp/index.html

I do not know, if this is a known issue, but I had to comment out
;(require 'mic-paren) (paren-activate)
from my .emacs, because it blocks calc, making it report on every
input:

,----
| byte-code: Key sequence C-M-f uses invalid prefix characters
`----

That's a pity, as mic-paren.el is a great package :(

-- 
Sergei

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

* Re: matching parenthesis
  2005-07-25  9:09     ` Sergei
@ 2005-07-25 20:57       ` Martin Slouf
  2005-07-26  0:24       ` Johan Bockgård
       [not found]       ` <mailman.1684.1122325407.20277.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 8+ messages in thread
From: Martin Slouf @ 2005-07-25 20:57 UTC (permalink / raw


not exactly what you ask for, but i know this one:

(show-paren-mode 1)
;; define function to match a parenthesis otherwise insert a '~'
(defun goto-match-paren (arg)
  "Go to the matching parenthesis if on parenthesis otherwise insert '~'."
  (interactive "p")
  (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
        ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
        (t (self-insert-command (or arg 1)))))
(global-set-key (kbd "~") 'goto-match-paren)

copy to your .emacs and pressing '~' will jump to matching parenthesis instead
of inserting '~' if and only if your point is on the parenthesis

this is not mine function, it was stolen from somenone else by me.

(so i can thank him for it now :)

m.


On Mon, Jul 25, 2005 at 02:09:12AM -0700, Sergei wrote:
> Klaus Berndl:
> > On Fri, 22 Jul 2005, Johan Bockg?rd wrote:
> 
> ...
> 
> >>  mic-paren.el
> 
> > A tip from the author and maintainer ;-)
> 
> > ;; This file can be obtained from "The EmacsWiki" and here from the
> > ;; packages-site: http://www.emacswiki.org/elisp/index.html
> 
> I do not know, if this is a known issue, but I had to comment out
> ;(require 'mic-paren) (paren-activate)
> from my .emacs, because it blocks calc, making it report on every
> input:
> 
> ,----
> | byte-code: Key sequence C-M-f uses invalid prefix characters
> `----
> 
> That's a pity, as mic-paren.el is a great package :(
> 

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

* Re: matching parenthesis
  2005-07-25  9:09     ` Sergei
  2005-07-25 20:57       ` Martin Slouf
@ 2005-07-26  0:24       ` Johan Bockgård
  2005-07-26  3:41         ` Sergei
       [not found]       ` <mailman.1684.1122325407.20277.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 8+ messages in thread
From: Johan Bockgård @ 2005-07-26  0:24 UTC (permalink / raw


"Sergei" <sergio.pokrovskij@gmail.com> writes:

> I do not know, if this is a known issue, but I had to comment out
> ;(require 'mic-paren) (paren-activate) from my .emacs, because it
> blocks calc, making it report on every input:
>
> ,----
> | byte-code: Key sequence C-M-f uses invalid prefix characters
> `----

I can't seem to reproduce this now, but I have used this workaround:

 (defadvice calcDigit-start (around mic-paren activate)
   (let ((minibuffer-setup-hook (remq 'mic-paren-minibuffer-setup-hook
 				     minibuffer-setup-hook))
 	(minibuffer-exit-hook (remq 'mic-paren-minibuffer-exit-hook
 				    minibuffer-exit-hook)))
     ad-do-it))


-- 
Johan Bockgård

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

* Re: matching parenthesis
  2005-07-26  0:24       ` Johan Bockgård
@ 2005-07-26  3:41         ` Sergei
  0 siblings, 0 replies; 8+ messages in thread
From: Sergei @ 2005-07-26  3:41 UTC (permalink / raw


Yes, this seems to work.  Thank you.


Johan Bockgård:
> "Sergei" <sergio.pokrovskij@gmail.com> writes:
>
> > I do not know, if this is a known issue, but I had to comment out
> > ;(require 'mic-paren) (paren-activate) from my .emacs, because it
> > blocks calc, making it report on every input:
> >
> > ,----
> > | byte-code: Key sequence C-M-f uses invalid prefix characters
> > `----
>
> I can't seem to reproduce this now, but I have used this workaround:
>
>  (defadvice calcDigit-start (around mic-paren activate)
>    (let ((minibuffer-setup-hook (remq 'mic-paren-minibuffer-setup-hook
>  				     minibuffer-setup-hook))
>  	(minibuffer-exit-hook (remq 'mic-paren-minibuffer-exit-hook
>  				    minibuffer-exit-hook)))
>      ad-do-it))
> 
> 
> -- 
> Johan Bockgård

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

* Re: matching parenthesis
       [not found]       ` <mailman.1684.1122325407.20277.help-gnu-emacs@gnu.org>
@ 2005-07-26  8:36         ` Marc Tfardy
  0 siblings, 0 replies; 8+ messages in thread
From: Marc Tfardy @ 2005-07-26  8:36 UTC (permalink / raw


Martin Slouf schrieb:
> not exactly what you ask for, but i know this one:
> 
> (show-paren-mode 1)
> ;; define function to match a parenthesis otherwise insert a '~'
> (defun goto-match-paren (arg)
>   "Go to the matching parenthesis if on parenthesis otherwise insert '~'."
>   (interactive "p")
>   (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
>         ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
>         (t (self-insert-command (or arg 1)))))
> (global-set-key (kbd "~") 'goto-match-paren)
> 
> copy to your .emacs and pressing '~' will jump to matching parenthesis instead
> of inserting '~' if and only if your point is on the parenthesis
> 
> this is not mine function, it was stolen from somenone else by me.
> 
> (so i can thank him for it now :)

And I thank too! Very very useful function! It is already in
my .emacs :-)

regards

Marc

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

end of thread, other threads:[~2005-07-26  8:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-22 12:30 matching parenthesis Jan Guido Donath
2005-07-22 14:12 ` Johan Bockgård
2005-07-22 19:58   ` Klaus Berndl
2005-07-25  9:09     ` Sergei
2005-07-25 20:57       ` Martin Slouf
2005-07-26  0:24       ` Johan Bockgård
2005-07-26  3:41         ` Sergei
     [not found]       ` <mailman.1684.1122325407.20277.help-gnu-emacs@gnu.org>
2005-07-26  8:36         ` Marc Tfardy

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.