[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Disabling imenu default of thing-at-point
From: |
Drew Adams |
Subject: |
RE: Disabling imenu default of thing-at-point |
Date: |
Mon, 24 Jul 2017 10:39:03 -0700 (PDT) |
> 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.
Sounds like Ido (or Ido Ubiquitous) needs to be fixed. There
should not be a problem with providing a default value, even
when that default value might not always be helpful.
> 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?
It breaks everyone's ability to pick up what was previously the
default value as a default value.
> - (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)))
If you make that change then what is the sense of binding `name' to
`(thing-at-point 'symbol)' in the first place? It's only purpose
could then be to return a string so that `imenu-find-default' is
used at all. This doesn't make any sense (to me).