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

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

Re: How to get rid of annoying ^M lineendings


From: Emanuel Berg
Subject: Re: How to get rid of annoying ^M lineendings
Date: Fri, 18 Jul 2014 00:31:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

scott.althoff@gmail.com writes:

> Is there a way to execute this every time emacs starts?

Yes, there are hooks: `emacs-startup-hook' - but isn't
this something that should rather go into
`find-file-hook' or perhaps `before-save-hook'?

Because if you use the Emacs startup hook, won't you
get the same situation whenever you `find-file' or the
like from Emacs, i.e., whenever you don't open files by
means of arguments to the emacs shell command?

Anyway, for example, I have

(untab-all delete-trailing-whitespace)

as `before-save-hook'. You could put a call there to
the function that removes those chars.

Hooks are a often an efficient-but-still poor-man's
solution. If you can do something without using them,
that is often better. In this case I can't tell. But if
there isn't an obvious better way to do it, sure, use
hooks.

-- 
underground experts united


reply via email to

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