GNU Emacs RTFM question
rich Malloy
rrmalloy at mediaone.net
Mon Oct 16 17:25:38 EDT 2000
I got the following to work.
I apologize if this is a repost.
Rich.
;;; delete-blank-lines is standard
;;; let me know if it isn't
;;; I couldn't find a built-in that did what you wanted.
(defun delete-trailing-blank-lines () (interactive)
(goto-char (point-max))
(delete-blank-lines)
)
(defun delete-save () (interactive)
(delete-trailing-blank-lines)
(save-buffer)
)
(defun delete-save-some ()
(interactive)
(delete-trailing-blank-lines)
(save-some-buffers)
)
;;; the first square is a control as is the second the last is a control-s.
(global-set-key "s" 'delete-save-some)
(global-set-key "" 'delete-save)
Jerry Feldman wrote:
> Is there a built-in elisp function that removes extra newlines from the end
> of a file being edited. I sometimes leave severay trailing newlines in some
> of my files inadvertenly. If there is (either globally in emacs or in c-mode),
> what variable does it test when saving the file.
> --
> Jerry Feldman
> Contractor, eInfrastructure Partner Engineering
> 508-467-4315 http://www.testdrive.compaq.com/linux/
>
> Compaq Computer Corp.
> 200 Forest Street MRO1-3/F1
> Marlboro, Ma. 01752
> -
> Subcription/unsubscription/info requests: send e-mail with
> "subscribe", "unsubscribe", or "info" on the first line of the
> message body to discuss-request at blu.org (Subject line is ignored).
-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).
More information about the Discuss
mailing list