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 11:41:24 +0200 Message-ID: <87bmcqlwhn.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> 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 1528105198 16748 195.159.176.226 (4 Jun 2018 09:39:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 4 Jun 2018 09:39:58 +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 11:39:54 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 1fPlxy-0004AC-87 for ged-emacs-devel@m.gmane.org; Mon, 04 Jun 2018 11:39:54 +0200 Original-Received: from localhost ([::1]:38558 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPm00-0002Hx-7Q for ged-emacs-devel@m.gmane.org; Mon, 04 Jun 2018 05:42:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPlzY-00026H-I2 for emacs-devel@gnu.org; Mon, 04 Jun 2018 05:41:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPlzV-0007d2-GA for emacs-devel@gnu.org; Mon, 04 Jun 2018 05:41:32 -0400 Original-Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:33698) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPlzV-0007cL-A9; Mon, 04 Jun 2018 05:41:29 -0400 Original-Received: by mail-wm0-x235.google.com with SMTP id z6-v6so13461462wma.0; Mon, 04 Jun 2018 02:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-followup-to:mail-copies-to :gmane-reply-to-list:date:message-id:mime-version :content-transfer-encoding; bh=Vcayw72XyhCUWXP/3vYF8Q9vaKp1dXpCY9McSoSABTc=; b=XQv9nFLI6Z/vj7C00PlWkVGSFmUV2WUEyPFF4VVVcXXEXYDlKvDXUUErxp8sNIG8KV U1vnBwrxarOwyi2l3VQfah6pllJWCn3XPajoW5/mvFj6hQrwjmeybNSTsKnmx3eM4oUp lQLRAOMoyYTJCyepxRiS3CbSKQBTeszKHegblE1Ve0XjqjiYtuBwxIQTl4Bbaakhd8cd Goo5NQJ9m4Q/j9lpKpTp19ou5xy1DqqTJAe9Q9HVgevfHQGDs69+UMNbbTWolJ5PIDlx 2rm1DNZxZWgfRw8SiE9nCPnSnGHh6vGf8e7Fj4cnfrtsbtqd+H1frfjwWeSIRLKsM04m VoOg== 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:mail-followup-to :mail-copies-to:gmane-reply-to-list:date:message-id:mime-version :content-transfer-encoding; bh=Vcayw72XyhCUWXP/3vYF8Q9vaKp1dXpCY9McSoSABTc=; b=ih6hrcnCQ8XSORlY8IjJn/3Z9O0Ql5MydfVGKeGhBv9Y/88IeHjVKpDNu2ein5sjdQ ugaYgT6/mSf2g3t7mUw96KOkEFfhBM6Qriu5sSHxSaqjLQdQFxR+aLuam8dd+wFD6Xds nNJPtdNbigxKGKlc7c5TsAXfTWRt/FIdgPENIXhMDLwM8eBO8l1FipFOGdk/imBVlOWA sQPVnirLgDs1ECpRq+9V0atPyW7nGNXXTF4z93Cq4d78ipW6gKpDhOZBIVp3P4zfDM4D agcG9kfre3mLI+w/EjFlLpNDlSS3kCqGu62lFCehLFhGEc93Egc3OFKsstyUOrQmKXBS bZJA== X-Gm-Message-State: APt69E1B1PBSpkw2Y1s+xPXGcFVZ2osHm1ygUk4Pp7HLpWvg8ajcL8Qp 1cFwNAze/0mI4JNAjhtrUPRKdoY9 X-Google-Smtp-Source: ADUXVKJVKna7QWb48ijZ63JJsNHfyMjYoWmmWhlyvXhahsupmDOQRvFqQDAS0Xg904v5TX2479gWAQ== X-Received: by 2002:a1c:8cc8:: with SMTP id o191-v6mr8702735wmd.75.1528105287469; Mon, 04 Jun 2018 02:41:27 -0700 (PDT) Original-Received: from rpluim-ubuntu (vav06-1-78-207-202-134.fbx.proxad.net. [78.207.202.134]) by smtp.gmail.com with ESMTPSA id q17-v6sm8024149wrs.5.2018.06.04.02.41.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jun 2018 02:41:26 -0700 (PDT) Mail-Followup-To: emacs-devel@gnu.org Mail-Copies-To: never Gmane-Reply-To-List: yes X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::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:225987 Archived-At: >>>> (I noticed that texinfo.el has no bindings for inserting @ref, >>>> @xref, and @pxref, should I add some? C-cC-c[rp] are free, but x is >>>> already used for @example, so 'C-cC-cX'? Or maybe 'C-cC-cC-x' for >>>> @xref?) >>> >>> How about using just "C-c C-c r" and letting it intuit the exact form >>> from the context? @xref is only used at the beginning of a sentence, >>> and @pxref should normally follow an open paren. >>> >> >> OK. I=CA=BCll think about how best to add that. Here=CA=BCs a simple implementation, no doubt I=CA=BCve missed some corner = cases. diff --git i/lisp/textmodes/texinfo.el w/lisp/textmodes/texinfo.el index c2ceee6e6b..b696b81c1c 100644 --- i/lisp/textmodes/texinfo.el +++ w/lisp/textmodes/texinfo.el @@ -470,6 +470,7 @@ texinfo-mode-map (define-key map "\C-c\C-cu" 'texinfo-insert-@uref) (define-key map "\C-c\C-ct" 'texinfo-insert-@table) (define-key map "\C-c\C-cs" 'texinfo-insert-@samp) + (define-key map "\C-c\C-cr" 'texinfo-insert-dwim-@ref) (define-key map "\C-c\C-cq" 'texinfo-insert-@quotation) (define-key map "\C-c\C-co" 'texinfo-insert-@noindent) (define-key map "\C-c\C-cn" 'texinfo-insert-@node) @@ -826,6 +827,31 @@ texinfo-insert-@quotation "Insert the string `@quotation' in a Texinfo buffer." \n "@quotation" \n _ \n) =20 +(define-skeleton texinfo-insert-dwim-@ref + "Insert appropriate `@ref{...}', `@xref{}', or `@pxref{}' command +in a Texinfo buffer depending on surrounding context. +A numeric argument says how many words the braces should surround. +The default is not to surround any existing words with the braces." + nil + (cond + ;; parenthetical + ((looking-back "\(") + "@pxref{") + ;; beginning of sentence + ((looking-back " ") + "@xref{") + ;; bol or eol + ((looking-at "^\\|$") + "@ref{") + ;; inside word + ((not (eq (char-syntax (char-after)) ? )) + (skip-syntax-backward "^ ") + "@ref{") + ;; everything else + (t + "@ref{")) + _ "}") + (define-skeleton texinfo-insert-@samp "Insert a `@samp{...}' command in a Texinfo buffer. A numeric argument says how many words the braces should surround.