From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Newsgroups: gmane.emacs.help Subject: Re: How do I search for symbols such as \253 in Emacs Date: Tue, 6 Nov 2012 12:24:15 -0800 (PST) Message-ID: <7c0203e4-9363-4695-b7d6-7c6438526fae@googlegroups.com> References: <1352201029905-268928.post@n5.nabble.com> <24FA1A48-0704-403F-A4B5-0503AD2B4441@Web.DE> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1352233465 32530 80.91.229.3 (6 Nov 2012 20:24:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Nov 2012 20:24:25 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: gnu.emacs.help@googlegroups.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 06 21:24:34 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TVphJ-0005Sm-No for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Nov 2012 21:24:33 +0100 Original-Received: from localhost ([::1]:51193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVphA-0000pB-L4 for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Nov 2012 15:24:24 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVph4-0000p3-QD for help-gnu-emacs@gnu.org; Tue, 06 Nov 2012 15:24:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVph3-0001eU-Ck for help-gnu-emacs@gnu.org; Tue, 06 Nov 2012 15:24:18 -0500 Original-Received: from mail-ie0-f189.google.com ([209.85.223.189]:44130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVph3-0001dy-7c for help-gnu-emacs@gnu.org; Tue, 06 Nov 2012 15:24:17 -0500 Original-Received: by mail-ie0-f189.google.com with SMTP id c10so1670974ieb.6 for ; Tue, 06 Nov 2012 12:24:16 -0800 (PST) Original-Received: by 10.68.240.103 with SMTP id vz7mr762186pbc.10.1352233456023; Tue, 06 Nov 2012 12:24:16 -0800 (PST) Original-Path: glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=203.15.64.50; posting-account=xn0CbQoAAAASWsnV689K01BfDuqsREZp Original-NNTP-Posting-Host: 203.15.64.50 User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 203.15.64.50 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.223.189 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87554 Archived-At: I wrote this many years ago when I first picked up Emacs. As I come across = new characters I just add to the list with the expected replacement string.= I tried to keep track of what the character looked like in the comment bes= ide it. The replacement strings are for text files which I am converting to= LaTeX files (which is typically where I run across this problem), so you m= ight want to change some of the replacements to better suit your applicatio= n. Hope this helps, Peter (defun fix-latin-1-chars () (interactive) (let ((change-list '((?\x005397c "``") ; =E2=80=9C (?\xc "") ; Page Feed character (?\x005397d "''") ; =E2=80=9D (?\x2019 "'") ; =E2=80=99 (?\x201c "''") ; =E2=80=9D (?\x201d "''") ; =E2=80=9D (?\x2014 "--") ; =E2=80=94 (?\x2026 " \\ldots ") ; =E2=80=94 (?\x0053974 "--") ; =E2=80=94 (?\x0053979 "'") ; =E2=80=99 (?\x81 "'") (?\x2018 "'") (?\x2019 "'") (?\x201A ".") (?\x2022 ".") (?\x8b4 "'") ; =C2=B4 (?\x53979 "'") (?\x00539a6 " ") ; =E2=80=A6 (?\x0053978 "`") ; =E2=80=98 (?\x0053973 "--") ; =E2=80=93 (?\x2013 "--") ; =E2=80=93 (?\x8b7 "*") ; =C2=B7 (?\x004e647 "*") ; =EF=82=A7 (?\x004e6a0 "*") ; =EF=83=A0 (?\x8bd ".5") ; =C2=BD (?\x8a1 " ") ; =C2=A1 (?\x8a7 " ") ; =C2=A7 (?\x8a8 " ") ; =C2=A8 (?\x0053973 "-") ; =E2=80=93 (?\x0053c39 "*") ; =E2=88=99 (?\x26 "and") ; & (?\x004e657 "*") ; =EF=82=B7 (?\x004e5f1 "*") ; =EF=81=B1 (?\x004e648 "*") ; =EF=82=A8 (?\x004f070 "*") ; =EF=A1=90 (?\x004e5ca "*") ; =EF=81=8A (?\x004e5f6 "*") ; =EF=81=B6 (?\x004e678 "*") ; =EF=83=98 (?\xf0a8 "*") ; =EF=82=A8 (?\xf0b7 "*") ; =EF=82=A8 (?\xf0fc "*") ; =EF=82=A8 (?\x0053972 "*") ; =E2=80=92 (?\x8d8 "*") ; =C3=98 (?\x004e5aa "*") ; =EF=80=AA (?\x8b6 " ") ; =C2=B6 (?\x4f95f "") ;=20 (?\x539a0 "") ; =E2=80=A0 (?\x5397e "") (?\xfeff "") (?\x00539a2 "*"))) ; =E2=80=A2 (search-for) (start-point (point)) (buffer-limit (point-max))) (dolist (item change-list) (setq search-for (make-string 1 (car item))) (goto-char start-point) (while (re-search-forward search-for buffer-limit t) (delete-char -1) (insert (car (cdr item)))))))