GNU bug report logs - #11131
24.0.94; Apropos bookmarks

Previous Next

Package: emacs;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Fri, 30 Mar 2012 08:59:02 UTC

Severity: wishlist

Found in version 24.0.94

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 11131 <at> debbugs.gnu.org
Subject: bug#11131: 24.0.94; Apropos bookmarks
Date: Tue, 11 Sep 2012 13:41:08 +0530
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> Please provide an ido-like completion read for C-x r b.
>
> It's a bit late to change things for 24.1, but for 24.2 we can adjust.
> Which part of "ido-like" would you like to see there?
>
>> Please provide a convenient default for C-x r m.  You can work out the
>> details.
>
> C-x r m already provides a default, so could you give some more details
> as to what kind of default would be more "convenient"?

Use case:
========

I mark frequently used functions with `C-x r m' and I create a bookmark
to that function name using something like this in .emacs.

    (defadvice bookmark-set
      (around my-bookmark-set (name no-overwrite))
      (ad-set-arg 0 (which-function))
      (ad-set-arg 1 nil)
      (message "Bookmark: %s" (ad-get-arg 0))
      ad-do-it)

    (ad-activate 'bookmark-set)

With a simple ido-like completion (or iswitchb-like completion), I can
jump to the function name quickly without typing the whole function
name.

(Indicative) patch
==================

This is not an actual patch.  Something like this will do.

=== modified file 'lisp/bookmark.el'
--- lisp/bookmark.el	2012-08-08 08:48:57 +0000
+++ lisp/bookmark.el	2012-09-11 08:03:37 +0000
@@ -433,7 +433,7 @@ the empty string."
                                       (format " (%s): " default)
                                     ": ")))
 	   (str
-	    (completing-read prompt
+	    (ido-completing-read prompt
 			     bookmark-alist
 			     nil
 			     0

Gnus also does it
=================

Gnus also tries to achieve the same thing - that which I am trying to do
wrt bookmarks - by it's own private user variable.


,---- from gnus-util.el :: L43
| (defcustom gnus-completing-read-function 'gnus-emacs-completing-read
|   "Function use to do completing read."
|   :version "24.1"
|   :group 'gnus-meta
|   :type `(radio (function-item
|                  :doc "Use Emacs standard `completing-read' function."
|                  gnus-emacs-completing-read)
| 		;; iswitchb.el is very old and ido.el is unavailable
| 		;; in XEmacs, so we exclude those function items.
| 		,@(unless (featurep 'xemacs)
| 		    '((function-item
| 		       :doc "Use `ido-completing-read' function."
| 		       gnus-ido-completing-read)
| 		      (function-item
| 		       :doc "Use iswitchb based completing-read function."
| 		       gnus-iswitchb-completing-read)))))
`----

There is another way to do it
=============================

Have bookmark use completing-read-function.  Then I can set it to use
ido-completing-read.

,----[ C-h v completing-read-function RET ]
| completing-read-function is a variable defined in `minibuffer.el'.
| Its value is completing-read-default
| 
|   This variable may be risky if used as a file-local variable.
| 
| Documentation:
| The function called by `completing-read' to do its work.
| It should accept the same arguments as `completing-read'.
| 
| [back]
`----

Question
========

Now the question is, what is the best way to kill multiple mangoes with
a single stone and not allow above customizations to proliferate on
per-package basis.




-- 




This bug report was last modified 12 years and 213 days ago.

Previous Next


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