all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: How to get rid of annoying ^M lineendings
Date: Fri, 18 Jul 2014 00:31:03 +0200	[thread overview]
Message-ID: <87oawnlis8.fsf@debian.uxu> (raw)
In-Reply-To: c8aa7fac-5cad-4e90-8152-357de2d76d92@googlegroups.com

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	other threads:[~2014-07-17 22:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-22 13:50 How to get rid of annoying ^M lineendings olgo
2008-04-22 14:13 ` Joost Kremers
2008-04-23 16:39   ` Stefan Reichör
2008-04-23 18:19     ` Drew Adams
2014-07-17 20:51     ` scott.althoff
2014-07-17 22:31       ` Emanuel Berg [this message]
2014-07-18  5:53       ` Michael Heerdegen
2014-07-18  6:52       ` Florian Lindner
2014-07-18  5:44   ` Michael Heerdegen
2008-04-23  4:59 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oawnlis8.fsf@debian.uxu \
    --to=embe8573@student.uu.se \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.