help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: skip over whitespace in same column


From: Kevin Rodgers
Subject: Re: skip over whitespace in same column
Date: Mon, 22 Nov 2004 10:56:50 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]