all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Jump to match of regex
@ 2003-04-15 13:35 Joerg Schuster
  0 siblings, 0 replies; 7+ messages in thread
From: Joerg Schuster @ 2003-04-15 13:35 UTC (permalink / raw)


Hello,

In a file with the following structure


'bla': {
     bli : 1
     blo : 2
},

'ble': {
     bli : 3
     blo : 4
},

I would like to jump from "^'" to "^'" instead of jumping from line to
line with C-n. I know I could do a regexp-search, but I want to be
able to edit the items without having to start a new regexp-search
afterwards.

How can this be done?


Jörg

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

* Re: Jump to match of regex
       [not found] <mailman.4649.1050413820.21513.help-gnu-emacs@gnu.org>
@ 2003-04-15 13:56 ` lawrence mitchell
  2003-04-15 15:02 ` Barry Margolin
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: lawrence mitchell @ 2003-04-15 13:56 UTC (permalink / raw)


Joerg Schuster wrote:

[...]

> I would like to jump from "^'" to "^'" instead of jumping from line to
> line with C-n. I know I could do a regexp-search, but I want to be
> able to edit the items without having to start a new regexp-search
> afterwards.

> How can this be done?

You could record a keyboard macro that does the regexp search
you want, something like:

C-x (         ; start recording keyboard macro
C-1 C-s       ; start a regexp isearch
^'            ; search for ^'
RET           ; come out of isearch
C-x )         ; finish recording keyboard macro

Point is now after ^'. (i.e. on the b in 'bla').

You can now call the keyboard macro with C-x e, to move to the
next occurance of ^'.
-- 
lawrence mitchell <wence@gmx.li>

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

* Re: Jump to match of regex
       [not found] <mailman.4649.1050413820.21513.help-gnu-emacs@gnu.org>
  2003-04-15 13:56 ` Jump to match of regex lawrence mitchell
@ 2003-04-15 15:02 ` Barry Margolin
  2003-04-15 17:38 ` Gareth Rees
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Barry Margolin @ 2003-04-15 15:02 UTC (permalink / raw)


In article <mailman.4649.1050413820.21513.help-gnu-emacs@gnu.org>,
Joerg Schuster  <js@cis.uni-muenchen.de> wrote:
>Hello,
>
>In a file with the following structure
>
>
>'bla': {
>     bli : 1
>     blo : 2
>},
>
>'ble': {
>     bli : 3
>     blo : 4
>},
>
>I would like to jump from "^'" to "^'" instead of jumping from line to
>line with C-n. I know I could do a regexp-search, but I want to be
>able to edit the items without having to start a new regexp-search
>afterwards.

If you don't do any other regexp searches while you're editing the items,
C-M-s C-s will search again for the previous regexp.

-- 
Barry Margolin, barry.margolin@level3.com
Genuity Managed Services, a Level(3) Company, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

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

* Re: Jump to match of regex
       [not found] <mailman.4649.1050413820.21513.help-gnu-emacs@gnu.org>
  2003-04-15 13:56 ` Jump to match of regex lawrence mitchell
  2003-04-15 15:02 ` Barry Margolin
@ 2003-04-15 17:38 ` Gareth Rees
  2003-04-15 19:13 ` Stefan Monnier
  2003-04-16  3:12 ` Galen Boyer
  4 siblings, 0 replies; 7+ messages in thread
From: Gareth Rees @ 2003-04-15 17:38 UTC (permalink / raw)


Joerg Schuster wrote:
> In a file with the following structure
> 
> 'bla': {
>      bli : 1
>      blo : 2
> },
> 
> 'ble': {
>      bli : 3
>      blo : 4
> },
> 
> I would like to jump from "^'" to "^'"

Set `paragraph-start' and `paragraph-separate' to "'" (either put these
settings in the local variables section of the file, or if you have many
files with this structure, make a function and put it in
`auto-mode-alist').

Then you can jump from ^' to ^' with the commmands `backward-paragraph'
(C-up or M-{) and `forward-paragraph' (C-down or M-}).

-- 
Gareth Rees

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

* Re: Jump to match of regex
       [not found] <mailman.4649.1050413820.21513.help-gnu-emacs@gnu.org>
                   ` (2 preceding siblings ...)
  2003-04-15 17:38 ` Gareth Rees
@ 2003-04-15 19:13 ` Stefan Monnier
  2003-04-15 19:21   ` Stefan Monnier
  2003-04-16  3:12 ` Galen Boyer
  4 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2003-04-15 19:13 UTC (permalink / raw)


> In a file with the following structure
> 'bla': {
>      bli : 1
>      blo : 2
> },
> 
> 'ble': {
>      bli : 3
>      blo : 4
> },
> I would like to jump from "^'" to "^'" instead of jumping from line to
> line with C-n. I know I could do a regexp-search, but I want to be
> able to edit the items without having to start a new regexp-search
> afterwards.

Not quite what you're asking for, but might work as well depending
on other things you haven't mentioned:

- forward-paragraph and backward-paragraph (bound to M-{ and M-})
- forward-sexp and backward-sexp (M-f and M-b)
- forward-page and backward-page (C-x ] and C-x [), which may require
  you to set the `page-delimiter' variable accordingly.


        Stefan

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

* Re: Jump to match of regex
  2003-04-15 19:13 ` Stefan Monnier
@ 2003-04-15 19:21   ` Stefan Monnier
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2003-04-15 19:21 UTC (permalink / raw)


> - forward-paragraph and backward-paragraph (bound to M-{ and M-})
> - forward-sexp and backward-sexp (M-f and M-b)
> - forward-page and backward-page (C-x ] and C-x [), which may require
>   you to set the `page-delimiter' variable accordingly.

I forgot beginning-of-defun/end-of-defun bound to C-M-a and C-M-e
and which might also need setting up defun-prompt-regexp to something
like "^'[^{]*".


        Stefan

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

* Re: Jump to match of regex
       [not found] <mailman.4649.1050413820.21513.help-gnu-emacs@gnu.org>
                   ` (3 preceding siblings ...)
  2003-04-15 19:13 ` Stefan Monnier
@ 2003-04-16  3:12 ` Galen Boyer
  4 siblings, 0 replies; 7+ messages in thread
From: Galen Boyer @ 2003-04-16  3:12 UTC (permalink / raw)


On 15 Apr 2003, js@cis.uni-muenchen.de wrote:
> Hello,
> 
> In a file with the following structure
> 
> 
> 'bla': {
>      bli : 1
>      blo : 2
>},
> 
> 'ble': {
>      bli : 3
>      blo : 4
>},
> 
> I would like to jump from "^'" to "^'" instead of jumping from line to
> line with C-n. 

M-x occur "^'"

-- 
Galen deForest Boyer
Sweet dreams and flying machines in pieces on the ground.

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

end of thread, other threads:[~2003-04-16  3:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.4649.1050413820.21513.help-gnu-emacs@gnu.org>
2003-04-15 13:56 ` Jump to match of regex lawrence mitchell
2003-04-15 15:02 ` Barry Margolin
2003-04-15 17:38 ` Gareth Rees
2003-04-15 19:13 ` Stefan Monnier
2003-04-15 19:21   ` Stefan Monnier
2003-04-16  3:12 ` Galen Boyer
2003-04-15 13:35 Joerg Schuster

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.