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


Message #32 received at 12107 <at> debbugs.gnu.org (full text, mbox):

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: Re: bug#12107: 24.1.50;
	In Info mode, add the name of the manual as completion candidate for
	"bookmark-set"
Date: Sun, 05 Aug 2012 03:01:39 +0300
> Is there a good reason why we can't use a list in (car record) and avoid
> using a new `defaults' field?
> If so, please add a comment explaining it.

BTW, I noticed your comment about removing
`bookmark-insert-current-bookmark', so it could be
replaced with a list of the same default values for M-n
(this patch is an addition to the previous patch):

=== modified file 'lisp/bookmark.el'
--- lisp/bookmark.el	2012-08-04 23:12:29 +0000
+++ lisp/bookmark.el	2012-08-04 23:54:51 +0000
@@ -473,6 +473,12 @@ (defvar bookmark-make-record-function 'b
 (defun bookmark-make-record ()
   "Return a new bookmark record (NAME . ALIST) for the current location."
   (let ((record (funcall bookmark-make-record-function)))
+    ;; Set up defaults.
+    (bookmark-prop-set
+     record 'defaults
+     (delq nil (delete-dups (append (bookmark-prop-get record 'defaults)
+				    (list bookmark-current-bookmark
+					  (bookmark-buffer-name))))))
     ;; Set up default name.
     (if (stringp (car record))
         ;; The function already provided a default name.
@@ -738,10 +744,6 @@ (defvar bookmark-minibuffer-read-name-ma
   (let ((map (make-sparse-keymap)))
     (set-keymap-parent map minibuffer-local-map)
     (define-key map "\C-w" 'bookmark-yank-word)
-    ;; This C-u binding might not be very useful any more now that we
-    ;; provide access to the default via the standard M-n binding.
-    ;; Maybe we should just remove it?  --Stef-08
-    (define-key map "\C-u" 'bookmark-insert-current-bookmark)
     map))
 
 ;;;###autoload
@@ -900,19 +902,6 @@ (defun bookmark-edit-annotation (bookmar
   (bookmark-edit-annotation-mode bookmark-name-or-record))
 
 
-(defun bookmark-insert-current-bookmark ()
-  "Insert into the bookmark name currently being set the value of
-`bookmark-current-bookmark' in `bookmark-current-buffer', defaulting
-to the buffer's file name if `bookmark-current-bookmark' is nil."
-  (interactive)
-  (let ((str
-	 (with-current-buffer bookmark-current-buffer
-	   (or bookmark-current-bookmark
-               (bookmark-buffer-name)))))
-    (insert str)))
-
-
 (defun bookmark-buffer-name ()
   "Return the name of the current buffer in a form usable as a bookmark name.
 If the buffer is associated with a file or directory, use that name."






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

Previous Next


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