From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: hexl-mode: searching for multi byte sequence? Date: Tue, 14 Jul 2015 17:51:17 +0300 Message-ID: <83zj2y7py2.fsf@gnu.org> References: <87fv4rfc8s.fsf@uwakimon.sk.tsukuba.ac.jp> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1436885498 10347 80.91.229.3 (14 Jul 2015 14:51:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Jul 2015 14:51:38 +0000 (UTC) Cc: ams@gnu.org, emacs-devel@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 14 16:51:28 2015 Return-path: Envelope-to: ged-emacs-devel@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 1ZF1YO-0003Jo-10 for ged-emacs-devel@m.gmane.org; Tue, 14 Jul 2015 16:51:28 +0200 Original-Received: from localhost ([::1]:59910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZF1YI-0004W6-EN for ged-emacs-devel@m.gmane.org; Tue, 14 Jul 2015 10:51:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZF1YE-0004Vm-TT for emacs-devel@gnu.org; Tue, 14 Jul 2015 10:51:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZF1YE-0008TQ-1H for emacs-devel@gnu.org; Tue, 14 Jul 2015 10:51:18 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:41690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZF1Y9-0008RN-M6; Tue, 14 Jul 2015 10:51:13 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NRH00800FB1PK00@mtaout24.012.net.il>; Tue, 14 Jul 2015 17:42:42 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NRH00926FJ6OJ00@mtaout24.012.net.il>; Tue, 14 Jul 2015 17:42:42 +0300 (IDT) In-reply-to: <87fv4rfc8s.fsf@uwakimon.sk.tsukuba.ac.jp> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.180 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:187868 Archived-At: > From: "Stephen J. Turnbull" > Date: Tue, 14 Jul 2015 16:07:47 +0900 > Cc: emacs-devel@gnu.org > > Alfred M. Szmidt writes: > > Is there some way in hexl-mode to search for a (hex, octal, ...) byte > > sequence? Currently, C-s behaves a bit strange in at least two regards: > > > > 1) If file contains the byte sequence #xDEADBEAF, depending on how > > they are aligned (odd or even word), one has to look for "DEAD > > BEAF" and "DE ADBE AF". > > C-u C-s de\(.\n\)*ad\(.\|\n\)*be\(.\|\n\)*af > > is what I'd use. It has obvious defects, and it would be nice if > hexl-mode provided something a little less greedy (eg a transformation > to a 3-armed disjunction allowing at most one newline plus handling > the leading byte number after the newline). Hexl already provides something similar, see hexl-isearch-search-function. It allows to search in the text column strings that span multiple lines, for example. It should be enhanced to support Alfred's use case (and somebody please document it!).