From unknown Mon Jun 23 02:22:27 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#5955 <5955@debbugs.gnu.org> To: bug#5955 <5955@debbugs.gnu.org> Subject: Status: completions in M-x find-library include .elc files Reply-To: bug#5955 <5955@debbugs.gnu.org> Date: Mon, 23 Jun 2025 09:22:27 +0000 retitle 5955 completions in M-x find-library include .elc files reassign 5955 emacs submitter 5955 "Aaron S. Hawley" severity 5955 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 15 22:39:11 2010 Received: (at submit) by debbugs.gnu.org; 16 Apr 2010 02:39:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2bSZ-0001mT-B4 for submit@debbugs.gnu.org; Thu, 15 Apr 2010 22:39:11 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2bQo-0001lL-B7 for submit@debbugs.gnu.org; Thu, 15 Apr 2010 22:37:23 -0400 Received: from lists.gnu.org ([199.232.76.165]:53403) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1O2bQj-0002Jj-Mi for submit@debbugs.gnu.org; Thu, 15 Apr 2010 22:37:17 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2bQi-0005Ht-SZ for bug-gnu-emacs@gnu.org; Thu, 15 Apr 2010 22:37:16 -0400 Received: from [140.186.70.92] (port=39768 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2bQe-00053h-4C for bug-gnu-emacs@gnu.org; Thu, 15 Apr 2010 22:37:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.0 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2bIh-0005CJ-6S for bug-gnu-emacs@gnu.org; Thu, 15 Apr 2010 22:29:00 -0400 Received: from mail-yw0-f191.google.com ([209.85.211.191]:43934) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2bIh-0005CC-3o for bug-gnu-emacs@gnu.org; Thu, 15 Apr 2010 22:28:59 -0400 Received: by ywh29 with SMTP id 29so1986319ywh.14 for ; Thu, 15 Apr 2010 19:28:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=Xw7umg24sRvXBCpRdtZBfDSlyGF2x4kA2ENyZM0OvCU=; b=x4COOS3+tjz/0pjLXTt4rNOodIaIZ+xRN2wKCL86irTiXvb4EwyCSli3Y2uONLlPO0 VgKcxxZUq9qutj+MXghXRQ61QGdMyB0XfAm+QejLObVvR9JYSYXJ7DRM3L2mJHFEWk2r AzTWYblSUr8YhTwLi2th5cc5A7vRn4B3Vv7aA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=etaKeYYJfzvQGWENyiGco8QwXl6Y1468MtPwAQxa+hl8LYOL5eH4wll0buOqQnagv6 roZfSWxmkQdW7dkZQ/senwP1r0Z/nvEjLXctiGv26blQPM46RDlOWkmn7UoUKJE3lmJ2 +LqCQbvzCizmtFiTLizkK6ikBkAPfGoBsm2aE= MIME-Version: 1.0 Received: by 10.231.184.82 with HTTP; Thu, 15 Apr 2010 19:28:57 -0700 (PDT) Date: Thu, 15 Apr 2010 22:28:57 -0400 Received: by 10.150.180.16 with SMTP id c16mr1193011ybf.4.1271384937843; Thu, 15 Apr 2010 19:28:57 -0700 (PDT) Message-ID: Subject: completions in M-x find-library include .elc files From: "Aaron S. Hawley" To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 15 Apr 2010 22:39:10 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) Typing TAB or ? in M-x find-library shows .el and .elc files when it probably should just be the name of the library without the extension. Appears that this is a general problem with locate-file-completion-table in files.el. It appears to put all files in to the completion table without condition. The fix is just removing the first `push' operation. === modified file 'lisp/files.el' --- lisp/files.el 2010-03-31 01:51:54 +0000 +++ lisp/files.el 2010-04-16 01:57:24 +0000 @@ -760,7 +760,6 @@ (when (file-directory-p dir) (dolist (file (file-name-all-completions string-file dir)) - (push file names) (when (string-match suffix file) (setq file (substring file 0 (match-beginning 0))) (push file names))))) Hope this can get fixed. I'd love to have the size of my *completions* buffers reduced by a factor of 3! Thanks for Emacs, /a From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 23 19:00:07 2010 Received: (at 5955) by debbugs.gnu.org; 23 Jul 2010 23:00:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcRDr-0008CG-Jz for submit@debbugs.gnu.org; Fri, 23 Jul 2010 19:00:07 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcRDq-0008BZ-Kr for 5955@debbugs.gnu.org; Fri, 23 Jul 2010 19:00:06 -0400 Received: from ceviche.home (vpn-132-204-232-95.acd.umontreal.ca [132.204.232.95]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id o6NN001Y028504; Fri, 23 Jul 2010 19:00:01 -0400 Received: by ceviche.home (Postfix, from userid 20848) id BA606660D2; Sat, 24 Jul 2010 00:59:59 +0200 (CEST) From: Stefan Monnier To: "Aaron S. Hawley" Subject: Re: bug#5955: completions in M-x find-library include .elc files Message-ID: References: Date: Sat, 24 Jul 2010 00:59:59 +0200 In-Reply-To: (Aaron S. Hawley's message of "Thu, 15 Apr 2010 22:28:57 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3585=0 X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 5955 Cc: 5955@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > Typing TAB or ? in M-x find-library shows .el and .elc files when it > probably should just be the name of the library without the extension. > Appears that this is a general problem with > locate-file-completion-table in files.el. It appears to put all files > in to the completion table without condition. The fix is just > removing the first `push' operation. I added the `push' because in load-library I often want to select a particular file (i.e. either the .el or the .elc file). Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 24 20:44:16 2010 Received: (at 5955) by debbugs.gnu.org; 25 Jul 2010 00:44:16 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcpKB-0002pi-Ky for submit@debbugs.gnu.org; Sat, 24 Jul 2010 20:44:15 -0400 Received: from mail-iw0-f172.google.com ([209.85.214.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcpK8-0002pc-Rv for 5955@debbugs.gnu.org; Sat, 24 Jul 2010 20:44:13 -0400 Received: by iwn38 with SMTP id 38so1482954iwn.3 for <5955@debbugs.gnu.org>; Sat, 24 Jul 2010 17:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=qHmCCA4ujFvabhCxnZYguOnVbmcHApwS+e6bGqiadCg=; b=XSfN3tSFTS6yGA63/G9Bxp+jkxE8dOewxtojP+Vn/Psw9ULFUCqbs1pbfzfTX14uuM MdKPyjpCpIAqn1W4rcyg81sXUeaj/h18I+JATeLsuZqVOnvWvRITinjjppcqMbYtnxSw DAZVcdePyuk7Lcnv9nMs8U7VZhIQNJRs8N32c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=rm4+rFZg0uhJLIDbzEzPKNwM41qx8JDe+ifnkXr21v7voq9IaxxQwbZb+IX8KhPTG9 gcc1XvMk5PdpHAWBuFCfmURlTSwssoXpqjKCES8QVi6xgTB1eCo8jjiOx9zAU4Pw+Dmc ljsshnz+xNVjtMsLJO7w23Or8ON5lKS5Z7Ig0= MIME-Version: 1.0 Received: by 10.231.19.198 with SMTP id c6mr5138263ibb.140.1280018653794; Sat, 24 Jul 2010 17:44:13 -0700 (PDT) Received: by 10.231.173.196 with HTTP; Sat, 24 Jul 2010 17:44:13 -0700 (PDT) In-Reply-To: References: Date: Sat, 24 Jul 2010 20:44:13 -0400 Message-ID: Subject: Re: bug#5955: completions in M-x find-library include .elc files From: "Aaron S. Hawley" To: Stefan Monnier Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 5955 Cc: 5955@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On Fri, Jul 23, 2010 at 6:59 PM, Stefan Monnier wrote: >> Typing TAB or ? in M-x find-library shows .el and .elc files when it >> probably should just be the name of the library without the extension. > > I added the `push' because in load-library I often want to > select a particular file (i.e. either the .el or the .elc file). Doesn't M-x load-library and specifying no extension load the .elc? From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 25 19:14:39 2010 Received: (at 5955) by debbugs.gnu.org; 25 Jul 2010 23:14:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdAP1-0004TZ-Jd for submit@debbugs.gnu.org; Sun, 25 Jul 2010 19:14:39 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdAOz-0004TS-Ge for 5955@debbugs.gnu.org; Sun, 25 Jul 2010 19:14:38 -0400 Received: from ceviche.home (vpn-132-204-232-49.acd.umontreal.ca [132.204.232.49]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id o6PNEbOD030260; Sun, 25 Jul 2010 19:14:38 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 5909E660B6; Sun, 25 Jul 2010 22:03:13 +0200 (CEST) From: Stefan Monnier To: "Aaron S. Hawley" Subject: Re: bug#5955: completions in M-x find-library include .elc files Message-ID: References: Date: Sun, 25 Jul 2010 22:03:13 +0200 In-Reply-To: (Aaron S. Hawley's message of "Sat, 24 Jul 2010 20:44:13 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3585=0 X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 5955 Cc: 5955@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) >>> Typing TAB or ? in M-x find-library shows .el and .elc files when it >>> probably should just be the name of the library without the extension. >> I added the `push' because in load-library I often want to >> select a particular file (i.e. either the .el or the .elc file). > Doesn't M-x load-library and specifying no extension load the .elc? Usually, yes. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 25 19:58:51 2010 Received: (at 5955) by debbugs.gnu.org; 25 Jul 2010 23:58:52 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdB5n-0004nc-49 for submit@debbugs.gnu.org; Sun, 25 Jul 2010 19:58:51 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdB5l-0004nX-EN for 5955@debbugs.gnu.org; Sun, 25 Jul 2010 19:58:49 -0400 Received: from ceviche.home (vpn-132-204-232-49.acd.umontreal.ca [132.204.232.49]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id o6PNwovf031297; Sun, 25 Jul 2010 19:58:51 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 863FA660B6; Mon, 26 Jul 2010 01:58:49 +0200 (CEST) From: Stefan Monnier To: "Aaron S. Hawley" Subject: Re: bug#5955: completions in M-x find-library include .elc files Message-ID: References: Date: Mon, 26 Jul 2010 01:58:49 +0200 In-Reply-To: (Stefan Monnier's message of "Sun, 25 Jul 2010 22:03:13 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3585=0 X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 5955 Cc: 5955@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) >>>>> "Stefan" == Stefan Monnier writes: >>>> Typing TAB or ? in M-x find-library shows .el and .elc files when it >>>> probably should just be the name of the library without the extension. >>> I added the `push' because in load-library I often want to >>> select a particular file (i.e. either the .el or the .elc file). >> Doesn't M-x load-library and specifying no extension load the .elc? > Usually, yes. BTW, please try the patch below, to see if you like the resulting behavior. Stefan === modified file 'lisp/files.el' --- lisp/files.el 2010-06-13 19:52:42 +0000 +++ lisp/files.el 2010-07-25 23:57:51 +0000 @@ -777,9 +777,12 @@ (if x (1- (length x)) (length suffix)))))) (t (let ((names nil) + (stripsuffix t) (suffix (concat (regexp-opt suffixes t) "\\'")) (string-dir (file-name-directory string)) (string-file (file-name-nondirectory string))) + (while + (progn (dolist (dir dirs) (unless dir (setq dir default-directory)) @@ -787,10 +790,15 @@ (when (file-directory-p dir) (dolist (file (file-name-all-completions string-file dir)) + (if (not (string-match suffix file)) (push file names) - (when (string-match suffix file) + (unless stripsuffix (push file names)) (setq file (substring file 0 (match-beginning 0))) (push file names))))) + ;; Remove duplicates of the first element. + (setq names (cons (car names) (delete (car names) (cdr names)))) + (prog1 (and stripsuffix (= 1 (length names))) + (setq stripsuffix nil)))) (completion-table-with-context string-dir names string-file pred action))))) From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 19 17:32:58 2010 Received: (at 5955-done) by debbugs.gnu.org; 19 Aug 2010 21:32:58 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmCjJ-0002Ac-Jz for submit@debbugs.gnu.org; Thu, 19 Aug 2010 17:32:58 -0400 Received: from impaqm5.telefonica.net ([213.4.138.5]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmCa4-00026V-5p for 5955-done@debbugs.gnu.org; Thu, 19 Aug 2010 17:23:25 -0400 Received: from IMPmailhost4.adm.correo ([10.20.102.125]) by IMPaqm5.telefonica.net with bizsmtp id wKuP1e00H2iL0W23RMQWJ4; Thu, 19 Aug 2010 23:24:30 +0200 Received: from ceviche.home ([83.61.35.93]) by IMPmailhost4.adm.correo with BIZ IMP id wMQV1e00220aCvn1kMQVVp; Thu, 19 Aug 2010 23:24:30 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="monnier$movistar.es" |auth_email="monnier@movistar.es" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" Received: by ceviche.home (Postfix, from userid 20848) id 3CAF5660E9; Thu, 19 Aug 2010 23:24:29 +0200 (CEST) From: Stefan Monnier To: "Aaron S. Hawley" Subject: Re: bug#5955: completions in M-x find-library include .elc files Message-ID: References: Date: Thu, 19 Aug 2010 23:24:29 +0200 In-Reply-To: (Aaron S. Hawley's message of "Mon, 26 Jul 2010 09:44:51 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 5955-done X-Mailman-Approved-At: Thu, 19 Aug 2010 17:32:56 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) >> BTW, please try the patch below, to see if you like the >> resulting behavior. > Interesting idea. Show matches for more than one library without > suffixes, but if there is only one match show the possible extensions. > I'd say this is an improvement for users over the current behavior. I've installed this change (well, a slightly different version). > However, some libraries names are a prefix for another. So really, Yes, it's not perfect, but I think it's good enough. I don't think it's a clean enough behavior to warrant documenting. Stefan From unknown Mon Jun 23 02:22:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 17 Sep 2010 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator