help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: delete-horizontal-space and NO-BREAK SPACE


From: Andreas Röhler
Subject: Re: delete-horizontal-space and NO-BREAK SPACE
Date: Tue, 24 Aug 2010 08:16:51 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]