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

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

Re: setting continuation chars


From: Mathias Dahl
Subject: Re: setting continuation chars
Date: Thu, 29 Jun 2006 09:38:01 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt)

"gamename" <namesagame-usenet@yahoo.com> writes:

> 2) use some sort of command (regex?) to insert the needed spaces up to
> a certain column and then put in a backslash?

Or, maybe something like this:

(defun line-up-continuations ()
 "Line up all continuations from point and forward."
  (interactive)
  (save-excursion
    ;; Find backslash at the end of a line
    (while (search-forward-regexp "\\\\$" nil t)
      ;; Back up to set point before it
      (backward-char 1)
      ;; Indent to a fixed column
      (indent-to-column 40)
      ;; Step forward again, else the search will find
      ;; the same backslash again.
      (forward-char 1))))

Replace `40' with whatever column number you like.



Enjoy!


reply via email to

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