From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: duthen.mac.01@gmail.com Newsgroups: gmane.emacs.help Subject: Re: About abbrevs and spaces at end of line Date: Wed, 11 Dec 2013 12:54:06 -0800 (PST) Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1386795356 27837 80.91.229.3 (11 Dec 2013 20:55:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Dec 2013 20:55:56 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 11 21:56:02 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vqqp8-0006wD-FB for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Dec 2013 21:56:02 +0100 Original-Received: from localhost ([::1]:60185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vqqp8-0001so-5h for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Dec 2013 15:56:02 -0500 X-Received: by 10.182.114.73 with SMTP id je9mr1422535obb.23.1386795247502; Wed, 11 Dec 2013 12:54:07 -0800 (PST) X-Received: by 10.50.9.33 with SMTP id w1mr109034iga.12.1386795247450; Wed, 11 Dec 2013 12:54:07 -0800 (PST) Original-Path: usenet.stanford.edu!p15no19835780qaj.0!news-out.google.com!p7ni15613qat.0!nntp.google.com!ie8no9270357qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=92.139.182.37; posting-account=53aBfAoAAAAUDfozzkyZI3tTzStI93X_ Original-NNTP-Posting-Host: 92.139.182.37 User-Agent: G2/1.0 Injection-Date: Wed, 11 Dec 2013 20:54:07 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:202676 X-Mailman-Approved-At: Wed, 11 Dec 2013 15:55:47 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94945 Archived-At: 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 'id-zap-trailing-blanks) This is another way to handle the problem! HTH