From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Disabling imenu default of thing-at-point Date: Mon, 24 Jul 2017 10:39:03 -0700 (PDT) Message-ID: References: <87vamhg3r2.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1500918037 27334 195.159.176.226 (24 Jul 2017 17:40:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Jul 2017 17:40:37 +0000 (UTC) To: Felipe Ochoa , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 24 19:40:28 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZhLD-0006Ql-Js for ged-emacs-devel@m.gmane.org; Mon, 24 Jul 2017 19:40:23 +0200 Original-Received: from localhost ([::1]:56123 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZhLJ-0000Gn-8g for ged-emacs-devel@m.gmane.org; Mon, 24 Jul 2017 13:40:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZhK3-0000E5-8e for emacs-devel@gnu.org; Mon, 24 Jul 2017 13:39:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZhK0-0000oe-6K for emacs-devel@gnu.org; Mon, 24 Jul 2017 13:39:11 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:38902) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dZhJz-0000oH-T8 for emacs-devel@gnu.org; Mon, 24 Jul 2017 13:39:08 -0400 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v6OHd4hl016623 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jul 2017 17:39:04 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v6OHd4CA017468 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jul 2017 17:39:04 GMT Original-Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v6OHd4cb008868; Mon, 24 Jul 2017 17:39:04 GMT In-Reply-To: <87vamhg3r2.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6770.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 141.146.126.69 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:216988 Archived-At: > 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) > =09 ((and name (imenu--in-alist name prepared-index-alist)) > =09 (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).