unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: help-gnu-emacs@gnu.org
Subject: Re: delete-horizontal-space and NO-BREAK SPACE
Date: Mon, 23 Aug 2010 18:28:13 +0200	[thread overview]
Message-ID: <4C72A19D.2040000@easy-emacs.de> (raw)
In-Reply-To: <m2fwy5a1y9.fsf@ohwell.denx.de>

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





  parent reply	other threads:[~2010-08-23 16:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23 13:33 delete-horizontal-space and NO-BREAK SPACE Detlev Zundel
2010-08-23 15:50 ` Drew Adams
2010-08-23 16:28 ` Andreas Röhler [this message]
2010-08-23 21:15   ` Detlev Zundel
2010-08-23 22:11     ` Drew Adams
2010-08-24  6:16     ` 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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C72A19D.2040000@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).