all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* command help : matching braces
@ 2002-04-04 16:15 Ambardekar, Shailesh
  2002-04-04 18:17 ` Chuck Siska
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ambardekar, Shailesh @ 2002-04-04 16:15 UTC (permalink / raw)


In gnu emacs 20.3.1 under Sun Solaris 2.6,
what is the emacs command for going to the matching brace ?
( looking for emacs equivalent of % vi command ).

Thanks in advance.

Shailesh


**********************************************************************
This message contains confidential information and is intended only for the individual named.  If you are not the named addressee you should not disseminate, distribute or copy this e-mail: to do so could be a breach of confidence.  Please notify us immediately by reply e-mail and then delete this e-mail from your system.  Please contact our IT Helpdesk on +44 (0)20 7212 0000 or e-mail ukithelpdesk@corp.vizzavi.net if you need assistance.

E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message that arise as a result of e-mail transmission.  If verification is required please request a hard-copy version.  This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments.

This e-mail has been sent through the e-mail gateway of Vizzavi Europe Limited ("VEL") on its own account or on behalf of and for the benefit of other Vizzavi group companies who use this facility from time to time.  

VEL Registered office - 80 Strand London WC2R ORJ England. Registered in England No. 04064873

For this message in Dutch, French, German, Greek, Italian, Portuguese and Spanish, click on http://www.corp.vizzavi.net/disclaimer/

Visit Vizzavi at: http://www.vizzavi.net/

This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

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

* Re: command help : matching braces
  2002-04-04 16:15 command help : matching braces Ambardekar, Shailesh
@ 2002-04-04 18:17 ` Chuck Siska
  2002-04-05  5:45 ` Gurucharan
  2002-04-08 17:07 ` Fernando Dobladez
  2 siblings, 0 replies; 6+ messages in thread
From: Chuck Siska @ 2002-04-04 18:17 UTC (permalink / raw)


shailesh --

depends on which way you're going.  from on or just before
the "{", type C-M-f.  from just after the "}", type C-M-b.
these same commands also work for "(", ")", and "[", "]".
oh, note that you can't do this for braces in a lisp-mode
buffer.  the reason for all this is that these commands
work for whatever is considered matching delimiters in the
major mode of the buffer.  hope this helps.

-- chuck

"Ambardekar, Shailesh" wrote:
> 
> In gnu emacs 20.3.1 under Sun Solaris 2.6,
> what is the emacs command for going to the matching brace ?
> ( looking for emacs equivalent of % vi command ).
> 
> Thanks in advance.
> 
> Shailesh

-- 
                                           |\_/\_.-'""``:-._       
What is life without looking for           . . `; -._      )-;-,_`)
the next cute little bug to play with?     v_,-    _  ),(,.\  ``-' 
                                          _.- _.,-_/ /  ((.'       
-- chuck.siska@conexant.com  `<}:..     ((,.-'   ((,/

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

* Re: command help : matching braces
  2002-04-04 16:15 command help : matching braces Ambardekar, Shailesh
  2002-04-04 18:17 ` Chuck Siska
@ 2002-04-05  5:45 ` Gurucharan
  2002-04-08 17:07 ` Fernando Dobladez
  2 siblings, 0 replies; 6+ messages in thread
From: Gurucharan @ 2002-04-05  5:45 UTC (permalink / raw)
  Cc: 'help-gnu-emacs@gnu.org'


[-- Attachment #1.1: Type: text/plain, Size: 367 bytes --]

Hello Ambardekar,

> In gnu emacs 20.3.1 under Sun Solaris 2.6,
> what is the emacs command for going to the matching brace ?
> ( looking for emacs equivalent of % vi command ).

It is by holding the CTRL and ALT keys and then using the
"F" key to do a front brace matching or "B" key for back brace
matching.

Hope this works.

Warm Regards,
             gurucharan

[-- Attachment #1.2: Type: text/html, Size: 604 bytes --]

[-- Attachment #2: InterScan_Disclaimer.txt --]
[-- Type: text/plain, Size: 481 bytes --]

**************************Disclaimer************************************

Information contained in this E-MAIL being proprietary to Wipro Limited
is 'privileged' and 'confidential' and intended for use only by the
individual or entity to which it is addressed. You are notified that any
use, copying or dissemination of the information contained in the E-MAIL
in any manner whatsoever is strictly prohibited.


 ********************************************************************

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

* Re: command help : matching braces
  2002-04-04 16:15 command help : matching braces Ambardekar, Shailesh
  2002-04-04 18:17 ` Chuck Siska
  2002-04-05  5:45 ` Gurucharan
@ 2002-04-08 17:07 ` Fernando Dobladez
  2002-04-08 17:21   ` Matthew O. Smith
  2 siblings, 1 reply; 6+ messages in thread
From: Fernando Dobladez @ 2002-04-08 17:07 UTC (permalink / raw)
  Cc: 'help-gnu-emacs@gnu.org'

If you miss VI's % too much, you'd probably like to include the 
following in your .emacs:

(defun match-paren (arg)
  "Go to the matching parenthesis if on parenthesis, otherwise insert %. 
(Like in VI editor)"
  (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 "%"                  'match-paren)


That will make the '%' go to the matching brace if the cursor is on a 
brace, and it will insert "%" otherwise.

Fernando.


Ambardekar, Shailesh wrote:

>In gnu emacs 20.3.1 under Sun Solaris 2.6,
>what is the emacs command for going to the matching brace ?
>( looking for emacs equivalent of % vi command ).
>
>Thanks in advance.
>
>Shailesh
>
>

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

* Re: command help : matching braces
  2002-04-08 17:07 ` Fernando Dobladez
@ 2002-04-08 17:21   ` Matthew O. Smith
  2002-04-08 19:07     ` Fernando Dobladez
  0 siblings, 1 reply; 6+ messages in thread
From: Matthew O. Smith @ 2002-04-08 17:21 UTC (permalink / raw)
  Cc: help-gnu-emacs

Hi,

I added curly brace matching as well.
Thanks.

(defun match-paren (arg)
  "Go to the matching parenthesis if on parenthesis, otherwise insert %.
(Like in VI editor).  Thanks Fernando Dobladez <ferd@fuego.com>"
  (interactive "p")
  (cond
   ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
   ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
   ((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)))))


----- Original Message -----
From: "Fernando Dobladez" <ferd@fuego.com>
To: "Ambardekar, Shailesh" <Shailesh.Ambardekar@corp.vizzavi.net>
Cc: <help-gnu-emacs@gnu.org>
Sent: Monday, April 08, 2002 11:07 AM
Subject: Re: command help : matching braces


> If you miss VI's % too much, you'd probably like to include the
> following in your .emacs:
>
> (defun match-paren (arg)
>   "Go to the matching parenthesis if on parenthesis, otherwise insert %.
> (Like in VI editor)"
>   (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 "%"                  'match-paren)
>
>
> That will make the '%' go to the matching brace if the cursor is on a
> brace, and it will insert "%" otherwise.
>
> Fernando.
>
>
> Ambardekar, Shailesh wrote:
>
> >In gnu emacs 20.3.1 under Sun Solaris 2.6,
> >what is the emacs command for going to the matching brace ?
> >( looking for emacs equivalent of % vi command ).
> >
> >Thanks in advance.
> >
> >Shailesh
> >
> >
>
>
>
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-gnu-emacs

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

* Re: command help : matching braces
  2002-04-08 17:21   ` Matthew O. Smith
@ 2002-04-08 19:07     ` Fernando Dobladez
  0 siblings, 0 replies; 6+ messages in thread
From: Fernando Dobladez @ 2002-04-08 19:07 UTC (permalink / raw)
  Cc: Ambardekar, Shailesh, help-gnu-emacs

It shouldn't be necessary. Actually the special \s( and \s) in a regular 
expresion matches any opening/closing "parenthesis" (generic meaning) 
character. This meaning depends on the current mode. From the elisp 
manual: "In English text, and in C code, the parenthesis pairs are 
`()',     `[]', and `{}'.  In Emacs Lisp, the delimiters for lists and 
vectors (`()' and `[]') are classified as parenthesis characters."

Fernando.


Matthew O. Smith wrote:

>Hi,
>
>I added curly brace matching as well.
>Thanks.
>
>(defun match-paren (arg)
>  "Go to the matching parenthesis if on parenthesis, otherwise insert %.
>(Like in VI editor).  Thanks Fernando Dobladez <ferd@fuego.com>"
>  (interactive "p")
>  (cond
>   ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
>   ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
>   ((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)))))
>
>
>----- Original Message -----
>From: "Fernando Dobladez" <ferd@fuego.com>
>To: "Ambardekar, Shailesh" <Shailesh.Ambardekar@corp.vizzavi.net>
>Cc: <help-gnu-emacs@gnu.org>
>Sent: Monday, April 08, 2002 11:07 AM
>Subject: Re: command help : matching braces
>
>
>>If you miss VI's % too much, you'd probably like to include the
>>following in your .emacs:
>>
>>(defun match-paren (arg)
>>  "Go to the matching parenthesis if on parenthesis, otherwise insert %.
>>(Like in VI editor)"
>>  (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 "%"                  'match-paren)
>>
>>
>>That will make the '%' go to the matching brace if the cursor is on a
>>brace, and it will insert "%" otherwise.
>>
>>Fernando.
>>
>>
>>Ambardekar, Shailesh wrote:
>>
>>>In gnu emacs 20.3.1 under Sun Solaris 2.6,
>>>what is the emacs command for going to the matching brace ?
>>>( looking for emacs equivalent of % vi command ).
>>>
>>>Thanks in advance.
>>>
>>>Shailesh
>>>
>>>
>>
>>
>>_______________________________________________
>>Help-gnu-emacs mailing list
>>Help-gnu-emacs@gnu.org
>>http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
>>
>
>

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

end of thread, other threads:[~2002-04-08 19:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-04 16:15 command help : matching braces Ambardekar, Shailesh
2002-04-04 18:17 ` Chuck Siska
2002-04-05  5:45 ` Gurucharan
2002-04-08 17:07 ` Fernando Dobladez
2002-04-08 17:21   ` Matthew O. Smith
2002-04-08 19:07     ` Fernando Dobladez

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.