bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#42993: 26.3; [PATCH] Let Info bookmarks go to current, not recorded,


From: Drew Adams
Subject: bug#42993: 26.3; [PATCH] Let Info bookmarks go to current, not recorded, version of manual
Date: Sat, 22 Aug 2020 23:07:09 -0700 (PDT)

An Info bookmark, like most bookmarks, records the target file as an
absolute file name.  When you jump to an Info bookmark it jumps to the
recorded node in that Info file.

But what if you have Info bookmarks that were recorded for older Emacs
versions?  They typically have different absolute file names.  When you
jump to such a bookmark it will go to the manual for that older Emacs
version, if you still have it installed (and the Info files are at the
same locations as recorded by the bookmark).

This is a feature: you can have Info bookmarks to manuals for different
Emacs versions.  As long as those manuals are still available, bookmarks
to them continue to work.

But this behavior might not be what you want, in general.  In
particular, if an older, recorded Info file is no longer present, then
jumping to the bookmark just takes you to the top of Info (`dir') in the
manual that corresponds to the current Emacs session, and you're shown
an error message saying that the file in question doesn't exist.

The attached patch (from today's master) does two related things:

1. It adds a user option, `Info-bookmark-use-current-manual', which if
   non-nil makes Info bookmarks use the current manual, that is, the
   manual of the current Emacs session.

   The default value is nil, only for backward compatibility.  It gives
   you the behavior before the patch.

   I personally think the default value should be t, as I think the old
   behavior is essentially broken.  You decide.

2. If the option value is nil, and if the targeted Info file can't be
   found, then instead of raising an error you're taken to the target
   node in the current manual.

Another possibility would be to consider that users may often want to
toggle between the two behaviors, e.g., usually use the latest manuals
but sometimes use a recorded manual.  In that case, a non-option
variable might be better, along with a toggle command.

Still another possibility would be to give users a way to specify (when
creating an Info bookmark or later, by editing it), whether they want it
to go to the latest (current) manual or be tied to the recorded manual.
IOW, put the behavior specified by the variable in the bookmark instead.
IF a bookmark has some particular field value THEN respect its absolute
file name.  OTHERWISE, use the current Info manual.

That last possibility could be combined with the use of the variable, by
changing the OTHERWISE clause to follow the behavior specified by the
variable.

In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor `Microsoft Corp.', version 10.0.18362
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''

Attachment: info-2020-08-22a.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]