unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Disabling imenu default of thing-at-point
@ 2017-07-24 17:10 Felipe Ochoa
  2017-07-24 17:39 ` Drew Adams
  0 siblings, 1 reply; 8+ messages in thread
From: Felipe Ochoa @ 2017-07-24 17:10 UTC (permalink / raw)
  To: emacs-devel

imenu currently uses (thing-at-point 'symbol) to offer a default in
completing read. It's very helpful when symbol at point is one of the
options, but not really useful when not. It's particularly inconvenient
when using ido for completing read (e.g., with ido-ubiquitous), since it
makes M-x imenu RET not do anything instead of jumping to the first
option.

The fix is one-line (below), but the unhelpful (for me) default seems to
be coded explicitly. Would this patch break anyone else's use of imenu?

--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -876,7 +876,7 @@ Return one of the entries in index-alist or nil."
 		    (cdr item)))
 	    index-alist))))
     (when (stringp name)
-      (setq name (or (imenu-find-default name prepared-index-alist) name)))
+      (setq name (imenu-find-default name prepared-index-alist)))
     (cond (prompt)
 	  ((and name (imenu--in-alist name prepared-index-alist))
 	   (setq prompt (format "Index item (default %s): " name)))



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-08-03  8:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-24 17:10 Disabling imenu default of thing-at-point Felipe Ochoa
2017-07-24 17:39 ` Drew Adams
2017-07-24 17:43   ` Noam Postavsky
     [not found]     ` <CAHp7JggMsvE-A4GL2L1MdEceN4nnR9n3RGYjzpNgF2Zk1TRcjA@mail.gmail.com>
2017-07-25  9:01       ` Felipe Ochoa
     [not found]   ` <CAHp7JgjpdXfqwhO+PcVqAFGMT8Sy271sRgDGQt6_eWTYnSiFaQ@mail.gmail.com>
2017-07-25  9:05     ` Felipe Ochoa
2017-07-25  9:13       ` Felipe Ochoa
2017-07-25  9:21       ` Felipe Ochoa
2017-08-03  8:35         ` Felipe Ochoa

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).