Eli Zaretskii writes: >> From: Robert Pluim >> Date: Tue, 05 Feb 2019 13:10:07 +0100 >> >> This has been sitting around in my patch queue for a while, and Iʼd >> like to get it in so I can also get the manual update into the texinfo >> project. I think Iʼve addressed all the comments from the last time >> around. > > Thanks, I think this command will be useful. > >> * etc/NEWS: Describe new texinfo dwim reference functionality. > > I understand that the corresponding update to the Texinfo manual will > be submitted to the Texinfo maintainers? If so, the NEWS entry should > be marked with "+++", I think. > Yes and yes. >> +(define-skeleton texinfo-insert-dwim-@ref >> + "Insert appropriate `@pxref{...}', `@xref{}', or `@ref{}' command. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Is Emacs smart enough not to highlight these as links? > You mean in (describe-function 'texinfo-insert-dwim-@ref)? They show up unadorned. >> + ;; parenthesis >> + ((eq (char-before) ?\() >> + "@pxref{") > > @pxref is also good inside parentheses, not just after the opening > paren. Can this command be smarter and support also cases like > > (bla-bla yak-yak @pxref{foo}) > > ? Yes, thatʼs possible. Iʼve limited the opening parenthesis to being on the same or previous line though (I donʼt want excessive backwards matching). >> + ;; beginning of sentence >> + ((looking-back (sentence-end) (point-at-bol 0)) >> + "@xref{") > > What about BOB? Can we produce @xref there as well? Yes. Revised version attached.