GNU bug report logs - #12107
24.1.50; In Info mode, add the name of the manual as completion candidate for "bookmark-set"

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Tue, 31 Jul 2012 20:31:01 UTC

Severity: wishlist

Found in version 24.1.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 12107 <at> debbugs.gnu.org, Dani Moncayo <dmoncayo <at> gmail.com>
Subject: bug#12107: 24.1.50; In Info mode, add the name of the manual as completion candidate for "bookmark-set"
Date: Thu, 02 Aug 2012 02:04:48 +0300
>> Multiple values for bookmark names are not supported
>> by `bookmark-make-record'.
>
> Then let's change that.

Due to the extensible design of bookmark records,
it's easy to implement this:

=== modified file 'lisp/bookmark.el'
--- lisp/bookmark.el	2012-07-10 11:51:54 +0000
+++ lisp/bookmark.el	2012-08-01 23:02:43 +0000
@@ -772,7 +772,14 @@ (defun bookmark-set (&optional name no-o
   (interactive (list nil current-prefix-arg))
   (unwind-protect
        (let* ((record (bookmark-make-record))
-              (default (car record)))
+              (defaults (bookmark-prop-get record 'defaults))
+              (default (if (consp defaults) (car defaults) defaults)))
+
+         (if defaults
+             ;; Don't store default values in the record.
+             (setq record (assq-delete-all 'defaults record))
+           ;; When no defaults in the record, use its first element.
+           (setq defaults (car record) default defaults))
 
          (bookmark-maybe-load-default-file)
          ;; Don't set `bookmark-yank-point' and `bookmark-current-buffer'
@@ -788,7 +795,7 @@ (defun bookmark-set (&optional name no-o
                      (format "Set bookmark (%s): " default)
                      nil
                      bookmark-minibuffer-read-name-map
-                     nil nil default))))
+                     nil nil defaults))))
            (and (string-equal str "") (setq str default))
            (bookmark-store str (cdr record) no-overwrite)
 
=== modified file 'lisp/info.el'
--- lisp/info.el	2012-07-10 11:51:54 +0000
+++ lisp/info.el	2012-08-01 23:02:53 +0000
@@ -5020,11 +5025,18 @@ (declare-function bookmark-get-bookmark-
 (defun Info-bookmark-make-record ()
   "This implements the `bookmark-make-record-function' type (which see)
 for Info nodes."
-  `(,Info-current-node
-    ,@(bookmark-make-record-default 'no-file)
-    (filename . ,Info-current-file)
-    (info-node . ,Info-current-node)
-    (handler . Info-bookmark-jump)))
+  (let* ((file (and (stringp Info-current-file)
+		    (file-name-nondirectory Info-current-file)))
+	 (bookmark-name (if file
+			    (concat "(" file ") " Info-current-node)
+			  Info-current-node))
+	 (defaults (delq nil (list bookmark-name file Info-current-node))))
+    `(,bookmark-name
+      ,@(bookmark-make-record-default 'no-file)
+      (filename . ,Info-current-file)
+      (info-node . ,Info-current-node)
+      (handler . Info-bookmark-jump)
+      (defaults . ,defaults))))
 
 ;;;###autoload
 (defun Info-bookmark-jump (bmk)





This bug report was last modified 13 years and 4 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.