From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dan Sommers <2QdxY4RzWzUUiLuE@potatochowder.com> Newsgroups: gmane.emacs.help Subject: Re: How to search for characters displayed as octal codes in the buffer? Date: Wed, 17 Jul 2019 06:33:28 -0400 Message-ID: <589a8e48-71da-6760-7e0e-1d9df2f838df@potatochowder.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="165648"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 17 12:33:42 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hnhFl-000gw9-VJ for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Jul 2019 12:33:42 +0200 Original-Received: from localhost ([::1]:55758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnhFk-0000EG-Lc for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Jul 2019 06:33:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55248) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1hnhFh-0000Dx-LP for help-gnu-emacs@gnu.org; Wed, 17 Jul 2019 06:33:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1hnhFg-0008IS-K6 for help-gnu-emacs@gnu.org; Wed, 17 Jul 2019 06:33:37 -0400 Original-Received: from www458.your-server.de ([136.243.165.62]:50094) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1hnhFg-0008E0-CG for help-gnu-emacs@gnu.org; Wed, 17 Jul 2019 06:33:36 -0400 Original-Received: from [88.198.220.130] (helo=sslproxy01.your-server.de) by www458.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1hnhFa-0005Qu-Je for help-gnu-emacs@gnu.org; Wed, 17 Jul 2019 12:33:30 +0200 Original-Received: from [208.54.80.142] (helo=[192.168.43.66]) by sslproxy01.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1hnhFZ-0007I3-So for help-gnu-emacs@gnu.org; Wed, 17 Jul 2019 12:33:30 +0200 In-Reply-To: Content-Language: en-US X-Authenticated-Sender: 2QdxY4RzWzUUiLuE@potatochowder.com X-Virus-Scanned: Clear (ClamAV 0.100.3/25513/Wed Jul 17 10:15:42 2019) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 136.243.165.62 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.org gmane.emacs.help:121189 Archived-At: On 7/16/19 8:43 PM, Noam Postavsky wrote: > On Sun, 14 Jul 2019 at 10:50, ndame wrote: >> >> Sometimes I have unprintable characters in the buffer which display with an octal code (e.g. \232). instead of a character (text copied from elsewhere, etc.) How can I find these without knowing the exact codes? >> >> I'd like to find all such places in the buffer where a character appears with an octal code, but I have UTF characters too in the buffer which display properly, so using nonascii is not the answer. > > (re-search-forward "[\x80-\xff]") seems to work, though it's a bit > awkward to enter interactively: > > C-M-s [ C-x 8 RET 3fff80 RET - C-x 8 RET 3fffff RET ] > Use quoted-insert (usually C-q) in the mini buffer once the search is active. One trick is that quoted-insert collects digits until it sees a non-digit, so I often have to add and then delete a space character to the search. So to search for \232: C-s C-q 2 3 2 SPC HTH, Dan