unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 11131@debbugs.gnu.org
Subject: bug#11131: 24.0.94; Apropos bookmarks
Date: Tue, 11 Sep 2012 13:41:08 +0530	[thread overview]
Message-ID: <87wr01htcz.fsf@gmail.com> (raw)
In-Reply-To: <jwv4nt68djo.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 30 Mar 2012 08:45:59 -0400")

Stefan Monnier <monnier@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.




-- 





  reply	other threads:[~2012-09-11  8:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-30  8:26 bug#11131: 24.0.94; Apropos bookmarks Jambunathan K
2012-03-30 12:45 ` Stefan Monnier
2012-09-11  8:11   ` Jambunathan K [this message]
2012-09-11 13:18     ` Stefan Monnier
2012-09-11 16:52       ` Jambunathan K
2012-09-11 18:04         ` Stefan Monnier
2012-09-11 19:29           ` Juri Linkov
2012-10-26 17:35         ` Stefan Monnier
2012-10-26 20:11           ` Jambunathan K
2012-10-26 20:45             ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wr01htcz.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=11131@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).