all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* skip over whitespace in same column
@ 2004-11-22 17:03 Albert Reiner
  2004-11-22 17:56 ` Kevin Rodgers
  0 siblings, 1 reply; 3+ messages in thread
From: Albert Reiner @ 2004-11-22 17:03 UTC (permalink / raw)


Hi,

is there a command to move point down (or up) over all lines where
there is whitespace in the column of point?  E.g., invoking that
command on the  "I" of the starting "IF" would get me to the "E" of
"END IF" in the following:

,----
| IF (whatever) THEN
|   foo
|   bar
| END IF
`----

C-h a column RET did not return anything that looked useful to me.

Thanks in advance,

Albert.

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

* Re: skip over whitespace in same column
  2004-11-22 17:03 skip over whitespace in same column Albert Reiner
@ 2004-11-22 17:56 ` Kevin Rodgers
  2004-11-22 18:05   ` Albert Reiner
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Rodgers @ 2004-11-22 17:56 UTC (permalink / raw)


Albert Reiner wrote:
> is there a command to move point down (or up) over all lines where
> there is whitespace in the column of point?  E.g., invoking that
> command on the  "I" of the starting "IF" would get me to the "E" of
> "END IF" in the following:
> 
> ,----
> | IF (whatever) THEN
> |   foo
> |   bar
> | END IF
> `----
> 
> C-h a column RET did not return anything that looked useful to me.

Try this:

(defun forward-to-same-indentation ()
   "Move forward to the next line with the same indentation."
   (interactive)
   (let ((indentation (progn
                        (back-to-indentation)
                        (current-column))))
     (while (and (not (eobp))
                 (progn
                   (forward-to-indentation 1)
                   (/= (current-column) indentation))))
     (move-to-column indentation)))

-- 
Kevin Rodgers

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

* Re: skip over whitespace in same column
  2004-11-22 17:56 ` Kevin Rodgers
@ 2004-11-22 18:05   ` Albert Reiner
  0 siblings, 0 replies; 3+ messages in thread
From: Albert Reiner @ 2004-11-22 18:05 UTC (permalink / raw)


[Kevin Rodgers <ihs_4664@yahoo.com>, Mon, 22 Nov 2004 10:56:50 -0700]:
> Albert Reiner wrote:
> > is there a command to move point down (or up) over all lines where
> > there is whitespace in the column of point?
> 
> Try this:

Thanks, works very well (though slightly differently from the
"specification"): In

,----
|   IF (whatever) THEN
|     foo
| ! comment
|     bar
|   END IF
`----

your function also skips to END IF, not to the comment.  Which, I
guess, is even more desirable most of the time.

Thanks again,

Albert.

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

end of thread, other threads:[~2004-11-22 18:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-22 17:03 skip over whitespace in same column Albert Reiner
2004-11-22 17:56 ` Kevin Rodgers
2004-11-22 18:05   ` Albert Reiner

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.