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: Tue, 24 Aug 2010 08:16:51 +0200 Message-ID: <4C7363D3.2060000@easy-emacs.de> References: <4C72A19D.2040000@easy-emacs.de> 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 1282630717 30170 80.91.229.12 (24 Aug 2010 06:18:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 24 Aug 2010 06:18:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 24 08:18:36 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 1Onmpm-0007fx-Hg for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Aug 2010 08:18:34 +0200 Original-Received: from localhost ([127.0.0.1]:52518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Onmpi-0004tu-Pi for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Aug 2010 02:18:06 -0400 Original-Received: from [140.186.70.92] (port=58850 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OnmpH-0004tU-Nd for help-gnu-emacs@gnu.org; Tue, 24 Aug 2010 02:17:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OnmpG-0000h1-6y for help-gnu-emacs@gnu.org; Tue, 24 Aug 2010 02:17:39 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.171]:62723) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OnmpF-0000gn-Ob for help-gnu-emacs@gnu.org; Tue, 24 Aug 2010 02:17:38 -0400 Original-Received: from [192.168.178.27] (brln-4db9c4ae.pool.mediaWays.net [77.185.196.174]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0M0v6Z-1P7wCf44K7-00uZ1Y; Tue, 24 Aug 2010 08:17:35 +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:vUgmWfRLT2idABZSTa2iA4wlapa34CcI2kXMZ32sMmE D8hcyr1ZHgcuCH6IQn9qXNrIq5sLCXR32e83IyYufqEsIZGqxi Epu/NwpHEGNw9T4SgGLozbsVKab62kFpVcX+lEz6GT5gcUB6Ge B2obtDKrKNn0ZNx5CrYmoyCOICgMdU+Ch7p/XQtSxUu/4L3tpF y2oUDXa4hnWAYGA4l6Yd+AgeIVqTAVGmep4fulaSGc= 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:74787 Archived-At: Am 23.08.2010 23:15, schrieb Detlev Zundel: > Hi Andreas, > > > [...] > >> 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 > > Thanks for the code but what I really wanted to know is how Emacs itself > handles this. I have a feeling that this should not need custom code to > handle. There is a function 'delete-horizontal-space' and I wanted to > know if and how it applies to this specific 'space' also. > > When I encounter a problem not too specific to the special case, I > usually try to find out how other people cope with it before inventing > "yet another wheel(tm)". > > If nobody else points me to a already supported way of handling my case > I'll follow Drews advise and pose the question to a wider audience. > > Thanks! > Detlev > Hi, some questions remain: Can't see an (ascii 160). Assume you got some character, whose meaning in other context is formatting. Then it's just a character, who doesn't belong to the mode, you use. 'delete-horizontal-space' is an edit-function, not designed to cure encoding-errors. Presumable you got chars into a text-mode buffer, which are not text. That may indicate a bug, but must not. Andreas