all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Felipe Ochoa <felipe.nospam.ochoa@gmail.com>, emacs-devel@gnu.org
Subject: RE: Disabling imenu default of thing-at-point
Date: Mon, 24 Jul 2017 10:39:03 -0700 (PDT)	[thread overview]
Message-ID: <a97ac0a6-d932-49a9-8eb3-cebe52f01c2e@default> (raw)
In-Reply-To: <87vamhg3r2.fsf@gmail.com>

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



  reply	other threads:[~2017-07-24 17:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-24 17:10 Disabling imenu default of thing-at-point Felipe Ochoa
2017-07-24 17:39 ` Drew Adams [this message]
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

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

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

  git send-email \
    --in-reply-to=a97ac0a6-d932-49a9-8eb3-cebe52f01c2e@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=felipe.nospam.ochoa@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.