From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: bug#31636: 27.0.50; lockfile syntax searchable from info manual Date: Mon, 04 Jun 2018 19:17:16 +0200 Message-ID: <87zi0a5v4z.fsf@gmail.com> 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> 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 1528132571 29508 195.159.176.226 (4 Jun 2018 17:16:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 4 Jun 2018 17:16:11 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 04 19:16:07 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 1fPt5S-0007ZU-O0 for ged-emacs-devel@m.gmane.org; Mon, 04 Jun 2018 19:16:06 +0200 Original-Received: from localhost ([::1]:41120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPt7Z-0005iv-Pt for ged-emacs-devel@m.gmane.org; Mon, 04 Jun 2018 13:18:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPt6i-0005hH-2P for emacs-devel@gnu.org; Mon, 04 Jun 2018 13:17:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPt6e-00086g-JY for emacs-devel@gnu.org; Mon, 04 Jun 2018 13:17:23 -0400 Original-Received: from mail-wr0-x235.google.com ([2a00:1450:400c:c0c::235]:35732) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPt6e-00086L-DM; Mon, 04 Jun 2018 13:17:20 -0400 Original-Received: by mail-wr0-x235.google.com with SMTP id l10-v6so10148070wrn.2; Mon, 04 Jun 2018 10:17:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=MDgpMD82ttSLqjBqJFhAufvJj2PNkivN1UXDBhRYjN0=; b=MOPzV0wDBeft7hKA32j1frBwfZ4TNErG/PeSmKzqX2HyAYiie0t1X2Powpic4K9gzX U6mOEulYeCyLRO2++JwoUCLyEi0kBoUMBcf205VLmfEeavYYYfO2yWvd1+dgW0jEeF3V FIfdLECT7YmMPypgKWVv40srgHKDhvttM4ydRRIgPQAzVbYx8DiBsMb1FzGd+0Wcssm1 oblNeV97v07c15zWg8Rtiete9x9XoTcL0nge32t9x/XS2WKUHjD6dxS1HQ5O93nQ8Ntg sbH2oa0K80GpgeIwxi6jhAIgbV8di1CuWJ2QLW9aMBjqSjnY1I4eIrnOUgYwz0AuS7DP J6cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=MDgpMD82ttSLqjBqJFhAufvJj2PNkivN1UXDBhRYjN0=; b=rwCN+BYsMk1eUGqjEId8NjD+1fQv/dfJXL2bKRfvzUQA1jkKp2AA6Nbv94QaUOYG/d yw65bJN731d5fuLrvP8RJlfZ/q0JmXSJbg8u9w1yUu2+TlqKfQDlQhfkRDez4bSOGoth PWIdHKz3wfe/pTGgWDPNUODKjup/+EqZKZHJEr64gZkhxNVqtdEp9EUkEXRiPPdeN5Di tvo3wN6mlKJMXA2ziFSEmE7lJf0GP0ZQbgg+J34c7SsITbdqtxipHAb1mzB5Uairq6Az WPdo/H0JeYVfknlZzImEtoaxYZUV8U3JFsXi2940ZQqLOX4F4M9KZkWQO09vhcEVoXsG c9rA== X-Gm-Message-State: ALKqPwcAc24rHcobP4OCQ5yrgI8YRg/7h33A5ZSNWQSWKEM4I3wwWKnc q9LLLY+H8YoOhp8zagAMBrP2CyZ5 X-Google-Smtp-Source: ADUXVKKqujlOkogO3XdA0TMsS3hAl/8N8aDHMlTvedBYOvyAZ/EGl2wexBIEhByI/bX6IWCdtC9Rkw== X-Received: by 2002:adf:bbcd:: with SMTP id z13-v6mr17396349wrg.183.1528132638676; Mon, 04 Jun 2018 10:17:18 -0700 (PDT) Original-Received: from rpluim-ubuntu ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id e2-v6sm1838615wro.97.2018.06.04.10.17.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jun 2018 10:17:17 -0700 (PDT) In-Reply-To: <8336y2czrp.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 04 Jun 2018 18:55:22 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::235 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:226007 Archived-At: Eli Zaretskii writes: >> From: Robert Pluim >> Cc: emacs-devel@gnu.org >> Date: Mon, 04 Jun 2018 11:41:24 +0200 >>=20 >> + ;; beginning of sentence >> + ((looking-back " ") >> + "@xref{") > > This misses the beginning of a sentence after a newline, right? Hmm. (looking-back (sentence-end)) perhaps? Or if that=CA=BCs overkill "\\(?: \\|\\.\n\\)" (I did wonder why there=CA=BCs no (sentence-beginning)) >> + ;; bol or eol >> + ((looking-at "^\\|$") >> + "@ref{") >> + ;; inside word >> + ((not (eq (char-syntax (char-after)) ? )) >> + (skip-syntax-backward "^ ") >> + "@ref{") >> + ;; everything else >> + (t >> + "@ref{")) >> + _ "}") > > Why did you need the first 2 cases that yield @ref? If I have text like this: word one word two ^ with point where the ^ is, then we need to skip backwards until we reach whitespace, otherwise we insert the ref in the middle of a word. If we have this: word one word two ^ Then we don=CA=BCt want to skip backwards, since we'll end up before 'one', hence we need to check for bol first. Similar reasoning applies for eol. I strongly suspect you'll now either ask for this to be explained in the code and the docstring, or show me a single line of code that achieves the same effect, thus providing me with another Emacs 'Aha!' moment. > This will need a NEWS entry. Of course. Something like this, which will also go in the doc string. ** Texinfo *** New function for inserting @pxref, @xref, or @ref commands The function 'texinfo-insert-dwim-@ref', bound to 'C-c C-c r' by default, inserts one of the three types of references based on the text surrounding point, namely @pxref after a parenthesis, @xref at the start of a sentence, else @ref. Regards Robert