emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Disabling imenu default of thing-at-point


From: Felipe Ochoa
Subject: Disabling imenu default of thing-at-point
Date: Mon, 24 Jul 2017 19:10:25 +0200

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]