From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel Subject: Re: bug#31636: 27.0.50; lockfile syntax searchable from info manual Date: Wed, 6 Jun 2018 09:13:20 -0400 Message-ID: References: <20180529073311.EEA09102DA@mailuser.nyi.internal> <876036hn2e.fsf@gmail.com> <87tvqqd7rp.fsf@gmail.com> <87r2lufvo9.fsf@gmail.com> <83r2luv28h.fsf@gnu.org> <87a7sib7ty.fsf@gmail.com> <83in75vp8l.fsf@gnu.org> <87wovkyv6l.fsf@gmail.com> <83tvqmga79.fsf@gnu.org> <87h8mmu6jp.fsf@gmail.com> <83k1rifyqo.fsf@gnu.org> <87y3fyskns.fsf@gmail.com> <87tvqmsjww.fsf@gmail.com> <87bmcqlwhn.fsf@gmail.com> <8336y2czrp.fsf@gnu.org> <87zi0a5v4z.fsf@gmail.com> <83tvqh9sqp.fsf@gnu.org> <87lgbtm2q2.fsf@gmail.com> <87fu20mkbm.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1528290950 18072 195.159.176.226 (6 Jun 2018 13:15:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 6 Jun 2018 13:15:50 +0000 (UTC) Cc: Eli Zaretskii To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 06 15:15:46 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fQYHx-0004ay-Av for ged-emacs-devel@m.gmane.org; Wed, 06 Jun 2018 15:15:45 +0200 Original-Received: from localhost ([::1]:52387 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQYK4-0007tj-9y for ged-emacs-devel@m.gmane.org; Wed, 06 Jun 2018 09:17:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQYJp-0007ta-4F for emacs-devel@gnu.org; Wed, 06 Jun 2018 09:17:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQYJo-0008H8-AO for emacs-devel@gnu.org; Wed, 06 Jun 2018 09:17:41 -0400 Original-Received: from mail-oi0-x231.google.com ([2607:f8b0:4003:c06::231]:35418) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fQYJo-0008GV-4h; Wed, 06 Jun 2018 09:17:40 -0400 Original-Received: by mail-oi0-x231.google.com with SMTP id e8-v6so5135526oii.2; Wed, 06 Jun 2018 06:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Y2Fo7fTgMHc7cFBQAp6P5OXFWiw+kXuVmmIJ7VAntww=; b=ITG/h4ja3/YvE0FD3aT5Q7kWNGdNcQBS7nLP4G7+idF7W/ZWrXujRbVqs2d/hOo7cM l14eSmtJ4PmZWIpbVu1cRlV6lHWtI5+xCOwJFjEWopzwwnHKUqqOWKRei4o3W7RoMsg3 AWnfBHxQz31RsvvP0PrHUIIHjxxGzAqn+mdFQ2PJNxtQU6BZ1cKkIaa7J9GStU/BtwLI QSVg5gm0B61y0MbwTB8f4V930LZ3Y+6ZAdwCKlE5sF3KdpVGfrSVJLNB8/pxOJva4KEG yIFXCqqIrPVV6E4EJ4pd/ef0vcyx+GQXEdvNBodgP5BWMNC8hMom4GZLCwNkxitvDllA qYyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Y2Fo7fTgMHc7cFBQAp6P5OXFWiw+kXuVmmIJ7VAntww=; b=V95+YTa1+9T0HxqRdw8VyIQofswz6eOdIKnkttTgXKRE4x304h6DqC4Jizy20rfGFr vCpFg7jsSL0WXm2hnT/qZdBZ+THJVmsAWKUX9x5ORgkovA3k44/qBYa6WXBk/bsuQ5Ov Gr07MGw/Z2LykJxPaoPBzYdZFVQCTz2oSruLt5CK3wy5PCk4tfCMqotZuM7+DLNrUpKo pdDqQ5f+hMIru10bzVs4yKlP8FKzi3T8kL4X+zPhY5/UqqPy3z2PyYNMT8StHKdTDXML 3kCICoC7nTJfZmsWG1JDnJANZ1xe22JzgSudVmQuV+6V9Xk+wZL72UL4JVe71vnG8Xha RWUQ== X-Gm-Message-State: APt69E2yNH2sN2+8BZRVkMBcT3KgGvy0ZZDNaXNgI4m969W7hOzbcBsO 09tvD+HmsPIYcqXKE4eoMcDdVxM9LqHWEFiBZ3f8M5mn X-Google-Smtp-Source: ADUXVKKTWkxWsoazHx39ck4k8MPog6HPW+WUblk8+MfK8EFVNq1HQtd9yxH9Cnee3naCNSpG0RE/AS2056KnN73ToLg= X-Received: by 2002:aca:504d:: with SMTP id e74-v6mr1744830oib.304.1528291057879; Wed, 06 Jun 2018 06:17:37 -0700 (PDT) Original-Received: by 2002:a4a:3b84:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 06:13:20 -0700 (PDT) In-Reply-To: <87fu20mkbm.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::231 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:226059 Archived-At: On 6 June 2018 at 03:43, Robert Pluim wrote: >> And I think you'll want to give a limit >> to the looking-back calls, otherwise they can keep searching until the >> beginning of buffer. > > ((looking-back "(") should never look at more than one character. Perhaps it shouldn't, but Emacs doesn't make that kind of optimization: (with-temp-buffer (let ((last-command-event ?a)) (dotimes (i 8) (self-insert-command (expt 10 i)) (benchmark 1 '(looking-back "("))))) Elapsed time: 0.000036s Elapsed time: 0.000030s Elapsed time: 0.000066s Elapsed time: 0.000427s Elapsed time: 0.004068s Elapsed time: 0.040317s Elapsed time: 0.422173s Elapsed time: 1.514244s (with-temp-buffer (let ((last-command-event ?a)) (dotimes (i 8) (self-insert-command (expt 10 i)) (benchmark 1 '(looking-back "(" (1- (point))))))) Elapsed time: 0.000031s Elapsed time: 0.000027s [5 times] Elapsed time: 0.000041s Elapsed time: 0.000045s > I could always do (eq (char-before) ?() I suppose. That's probably better. But wait! This time you *should* have a backslash: = ?\( > The regexp produced by (sentence-end) looks like it=CA=BCs fairly well > anchored. Besides, I=CA=BCm not searching for an end-of-sentence, I=CA=BC= m > asking "Am I at end-of-sentence". Which is exactly why you should put a limit.