From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: search-forward in emacs23 lisp Date: Sun, 28 Mar 2010 18:50:46 +0200 Message-ID: References: <20100327.153148.886429907165788179.rasmith@aristotle.tamu.edu> <20100328.113915.866357745907943848.rasmith@aristotle.tamu.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1269795113 27043 80.91.229.12 (28 Mar 2010 16:51:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 28 Mar 2010 16:51:53 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: rasmith@tamu.edu Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 28 18:51:48 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NvviF-0007G7-To for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Mar 2010 18:51:48 +0200 Original-Received: from localhost ([127.0.0.1]:46234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvviF-0003xQ-Fh for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Mar 2010 12:51:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nvvhg-0003rb-R3 for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 12:51:12 -0400 Original-Received: from [140.186.70.92] (port=38269 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nvvhd-0003qR-69 for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 12:51:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nvvhb-00062s-VX for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 12:51:09 -0400 Original-Received: from mail-fx0-f224.google.com ([209.85.220.224]:55204) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nvvhb-00062n-PN for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 12:51:07 -0400 Original-Received: by fxm24 with SMTP id 24so43431fxm.26 for ; Sun, 28 Mar 2010 09:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:received:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=t3fa8Vx0DsOJpEbQ+qUw8y5sXkqOkSIdiXCElr3yE+E=; b=SKClj9SNotahKX59VejgrnSZrKOqBr6n932rj5NTfrtI6+BOdpL9FalXNIuUxu3mcQ FBhH73mQaxKVS5u1vl3OK7AF1PetgLmDvlvw0WHxtzwZzMJ5SbQmHWMRHIiW6VREDlMO THy0IaugE3KdlLY7mXMsDh6kQVI0GhoenmPsQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=v1F6t+DtnRheBOVNxVpr2lIT7TLlZPNbpf/aVo04rSrGiPPov8cr0zZrGpiK2+NbDG +VkM+8AamMJIM6GRxHbthnh79ssQJoEyAzE7i4K/fYhPtksWGFhkG18NnUskKsxAyvwR m9o/ltn2LeQLrCSY4vYCQhhq1qfYRsb9qROrc= Original-Received: by 10.86.95.20 with HTTP; Sun, 28 Mar 2010 09:50:46 -0700 (PDT) In-Reply-To: <20100328.113915.866357745907943848.rasmith@aristotle.tamu.edu> Original-Received: by 10.86.221.34 with SMTP id t34mr2567355fgg.36.1269795066084; Sun, 28 Mar 2010 09:51:06 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72514 Archived-At: On Sun, Mar 28, 2010 at 6:39 PM, wrote:> Sorry to reply to my own post, but the following rather ugly solution > solves the problem of finding a single FF byte: > =C2=A0 =C2=A0 =C2=A0(while (/=3D (char-after) ?\377) > =C2=A0 =C2=A0 =C2=A0 =C2=A0(forward-char 1) > =C2=A0 =C2=A0 =C2=A0 =C2=A0) > =C2=A0 =C2=A0 =C2=A0(forward-char 1) > This replaces > =C2=A0 =C2=A0 =C2=A0(search-forward (unibyte-string ?\377)) > which, in emacs23, no matter what I do, insists on turning the byte > into the two-byte string \231\277 before searching. > > But surely there's a better way? Hi Robin, Someone else knows this much better than me and can explain the details, but I believe that unibyte-string is a low level function that you do not need here. How about just (search-forward (char-to-string ?\377)) or (search-forward (char-to-string 255)) Does that work for you?