all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Eli Zaretskii'" <eliz@gnu.org>, <help-gnu-emacs@gnu.org>
Subject: RE: how to scan file for non-ascii chars (egcut-n-paste	from	ms-word)
Date: Sun, 9 Jan 2011 09:53:28 -0800	[thread overview]
Message-ID: <2C9E1718AFEC42C99F020E590CB34205@us.oracle.com> (raw)
In-Reply-To: <83lj2uj87e.fsf@gnu.org>

> > query-replace works once one has found the non-ASCII 
> > character.  However, it's often not obvious where the
> > offending text is.
> 
> When Emacs asks you to select a suitable encoding, it highlights these
> characters, so you can see where they are in the buffer.
> 
> > Is there a way to search for anything that isn't ASCII?
> 
> If the above is not enough, then try
>    M-: (skip-chars-forward "\000-\377") RET

Better: you can easily search incrementally for non-ascii chars, starting with
Emacs 22, like this:  C-M-s [^[:ascii:]]

I just filed an Emacs bug (#7809) to get this info added to the Emacs manual.
It was added to the Elisp manual (node `Regexp Special') in Emacs 23, but
apparently it wasn't considered useful info for users. ;-)  (Probably just an
oversight, actually.)

---

If you use Icicles, you can also see and search for all
sequences of non-ascii chars this way:  C-` [^[:ascii]]+
`S-TAB' to see hits, `C-next' to visit them, etc.
http://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview

When the set of hits is thus those defined by [^[:ascii]]+, you can type any
string using a subset of those chars (i.e., one or more particular non-ascii
chars) to narrow the hits, then visit any of those, and optionally replace any
or all of them with alternatives.
http://www.emacswiki.org/emacs/Icicles_-_Search-And-Replace




  reply	other threads:[~2011-01-09 17:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-09  0:53 how to scan file for non-ascii chars (eg cut-n-paste from ms-word) David Combs
2011-01-09 14:23 ` Eli Zaretskii
2011-01-09 16:24   ` Kenneth Goldman
2011-01-09 17:30     ` Eli Zaretskii
2011-01-09 17:53       ` Drew Adams [this message]
     [not found]       ` <mailman.8.1294595713.11727.help-gnu-emacs@gnu.org>
2011-01-18 20:19         ` how to scan file for non-ascii chars (egcut-n-paste " David Combs
2011-01-19  2:02           ` how to scan file for non-ascii chars(egcut-n-paste " Drew Adams
     [not found]     ` <mailman.5.1294594249.11727.help-gnu-emacs@gnu.org>
2011-01-18 20:06       ` how to scan file for non-ascii chars (eg cut-n-paste " David Combs
     [not found] ` <mailman.11.1294583034.18702.help-gnu-emacs@gnu.org>
2011-01-18 19:54   ` David Combs
2011-01-18 21:32     ` harven
2011-01-19  4:38     ` Teemu Likonen
2011-01-20  6:57       ` Kevin Rodgers

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

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

  git send-email \
    --in-reply-to=2C9E1718AFEC42C99F020E590CB34205@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.