From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: delete-horizontal-space and NO-BREAK SPACE Date: Mon, 23 Aug 2010 18:28:13 +0200 Message-ID: <4C72A19D.2040000@easy-emacs.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1282581014 24054 80.91.229.12 (23 Aug 2010 16:30:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 23 Aug 2010 16:30:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 23 18:30:13 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OnZuV-0005qx-Fg for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Aug 2010 18:30:12 +0200 Original-Received: from localhost ([127.0.0.1]:33395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OnZuK-0006vj-G9 for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Aug 2010 12:30:00 -0400 Original-Received: from [140.186.70.92] (port=36687 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OnZtX-0006px-Qb for help-gnu-emacs@gnu.org; Mon, 23 Aug 2010 12:29:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OnZtT-0004R6-F1 for help-gnu-emacs@gnu.org; Mon, 23 Aug 2010 12:29:08 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.171]:56003) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OnZtT-0004QT-35 for help-gnu-emacs@gnu.org; Mon, 23 Aug 2010 12:29:07 -0400 Original-Received: from [192.168.178.27] (brln-4db9da5d.pool.mediaWays.net [77.185.218.93]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MQJyK-1OQWhf3qua-00UJxd; Mon, 23 Aug 2010 18:29:04 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 In-Reply-To: X-Provags-ID: V02:K0:DcjdtqsYDcAUrONTnWMn33Ykyv6u0W2Bmja7cw5M0Ts JFuuH6a0D2ikfW4vTvrIkltW7lG/d5WviTxzdTgsjna89m2j0r nleyg5IEGs3cQSP4X6h+OiytP4KdjF9oYAREarfFk7cMtWZ8Yj TyJFPvW5p3I+yKSD2tudZvtqKoMjBdCy2k87MAnu0dYXRWUFM4 MPGmyo6UPNfz7LRSbpB69mlfCcsHncJdH62YpjDWDE= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:74777 Archived-At: Am 23.08.2010 15:33, schrieb Detlev Zundel: > Hi, > > more and more often I get emails with NO-BREAK SPACE characters (ascii > 160) in them which are used for alignment purposes. When replying to > such e-mails, I usually have to edit this a lot and wish 'M-\' would > erase the whole stretch of the characters. > > Looking up the definition of delete-horizontal-space, it is obvious that > it doesn't do this as it only erases " \t". > > Is there another nice function really erasing all space characters > (i.e. chars belonging to the "space" category) or should the funtion be > improved? > > Thanks > Detlev > Hi, to get rid of nasty single chars, I use forms like this: (defun delete-zero-fourteen () "Delete chars ascii octal \\014 " (interactive "*") (let ((beg (cond ((region-active-p) (region-beginning)) (t (point-min)))) (end (cond ((region-active-p) (region-end)) (t (point-max))))) (save-excursion (goto-char beg) (while (re-search-forward (concat (list 12)) end t 1) (replace-match ""))))) HTH Andreas