all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: duthen.mac.01@gmail.com
To: help-gnu-emacs@gnu.org
Subject: Re: About abbrevs and spaces at end of line
Date: Wed, 11 Dec 2013 12:55:57 -0800 (PST)	[thread overview]
Message-ID: <762442a3-8405-4867-8e75-5a9ce1abf16d@googlegroups.com> (raw)
In-Reply-To: <mailman.8702.1386625654.10748.help-gnu-emacs@gnu.org>

Well, actually, I don't like trailing spaces. 
So I always get rid of them with: 

(defun jd-replace-alist (start end alist) 
  "Make all replacements described in alist." 
  (save-excursion 
    (save-restriction 
      (narrow-to-region start end) 
      (mapc (lambda (modif) 
              (let ((from (car modif)) (to (cdr modif))) 
                (goto-char (point-min)) 
                (while (re-search-forward from (null 'bound) 'noerror) 
                  (replace-match to)))) 
            alist)))) 

(defun jd-zap-trailing-blanks () 
  (interactive) 
  (jd-replace-alist (point-min) (point-max) '(("[ \t]+$" . "")))) 

(add-hook 'write-file-functions 'jd-zap-trailing-blanks) 

This is another way to handle the problem! 

HTH 


  parent reply	other threads:[~2013-12-11 20:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.8702.1386625654.10748.help-gnu-emacs@gnu.org>
2013-12-11 20:54 ` About abbrevs and spaces at end of line duthen.mac.01
2013-12-11 20:55 ` duthen.mac.01 [this message]
2013-12-09 21:46 Harry Putnam
2013-12-10  8:07 ` Andreas Röhler
2013-12-10 11:08   ` Harry Putnam
2013-12-10 11:47     ` Andreas Röhler
2013-12-10 11:53       ` Matthias Pfeifer
2013-12-11 12:29       ` Harry Putnam
2013-12-11 13:03         ` Andreas Röhler

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=762442a3-8405-4867-8e75-5a9ce1abf16d@googlegroups.com \
    --to=duthen.mac.01@gmail.com \
    --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.