From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#41423: Installing the fix for bug#41423 on emacs-27 Date: Mon, 01 Feb 2021 11:13:14 -0500 Message-ID: References: <86k116inmr.fsf@sacsa.i-did-not-set--mail-host-address--so-tickle-me> <86tv0aecgn.fsf@gmail.com> <87r1v4z3f1.fsf_-_@gmx.de> <83bld37sly.fsf@gnu.org> <86czxjg4xs.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2988"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Magne Ingebrigtsen , 41423@debbugs.gnu.org To: =?UTF-8?Q?andr=C3=A9s_?= =?UTF-8?Q?ram=C3=ADrez?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 01 17:16:05 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6brw-0000bU-CF for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Feb 2021 17:16:04 +0100 Original-Received: from localhost ([::1]:50370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6brv-0003xP-Dp for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Feb 2021 11:16:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6bpy-00028i-8L for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2021 11:14:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49645) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l6bpx-0002bH-Qp for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2021 11:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l6bpx-0008Vo-MP for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2021 11:14:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Feb 2021 16:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41423 X-GNU-PR-Package: emacs Original-Received: via spool by 41423-submit@debbugs.gnu.org id=B41423.161219600432660 (code B ref 41423); Mon, 01 Feb 2021 16:14:01 +0000 Original-Received: (at 41423) by debbugs.gnu.org; 1 Feb 2021 16:13:24 +0000 Original-Received: from localhost ([127.0.0.1]:32956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6bpM-0008Ui-C9 for submit@debbugs.gnu.org; Mon, 01 Feb 2021 11:13:24 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:4174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6bpK-0008UW-57 for 41423@debbugs.gnu.org; Mon, 01 Feb 2021 11:13:22 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D854C80C19; Mon, 1 Feb 2021 11:13:16 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5CD358079A; Mon, 1 Feb 2021 11:13:15 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1612195995; bh=I8YlIODjSLjL3b1TJRHy0ur8MFvFwA/J1mVt5/KAnK8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=L+IEqBru5Zh5+gx0k86I25NiYtD8N4lpeuyf3nZje0ilhf/TE4qCNeaG2c7luP/EL 5rGnt6/5dyntL0sXqgnLES+doBhMFRHi6ojf/RaDNZXNNhrQy+Tzx0cZ3cO8vPGCwH yXkuwSOG6CXUQbGueZpOuIa3ETF9oKEfrkmMPjYXpxInAa7JtmtOpxc0I0YpTAhkUk ER3EdCcnxkaMCo3rxm0/4BbtcAkCE04qur5VTkRXiUgqMOH/Z9bx606g+0qIqAgYip YA7+KlGWVOjwHtwsh3VLNRJWplcO0j3Cai4jFZJCOO1ZG9ALKRrixXe9iPzGV1Mj3L ANg2MrltNRExA== Original-Received: from alfajor (69-196-141-46.dsl.teksavvy.com [69.196.141.46]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 23EC11203FF; Mon, 1 Feb 2021 11:13:15 -0500 (EST) In-Reply-To: <86czxjg4xs.fsf@gmail.com> ("=?UTF-8?Q?andr=C3=A9s_?= =?UTF-8?Q?ram=C3=ADrez?="'s message of "Mon, 01 Feb 2021 15:53:35 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199089 Archived-At: > If You code the 'minimalist version of the patch'. I could try it on this > version. See patch below. You don't need to rebuild Emacs either: just recompile that one file and you're done. > commands ). That would simplify compiling emacs master on lower end > machines like my SBC {Single Board Computer}. I know what you mean (recompiling Emacs on my takes quite a while on some of my machines (BananaPi, Mele-A1000, and Thinkpad X30), especially because my build scripts enable all debug options, which makes it even slower). Stefan diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el index faf749d836..744be525ec 100644 --- a/lisp/eshell/em-cmpl.el +++ b/lisp/eshell/em-cmpl.el @@ -399,16 +399,21 @@ (defun eshell-complete-commands-list () "Generate list of applicable, visible commands." - (let ((filename (pcomplete-arg)) glob-name) + ;; Building the commands list can take quite a while, especially over Tramp + ;; (bug#41423), so do it lazily. + (let ((glob-name + ;; When a command is specified using `eshell-explicit-command-char', + ;; that char is not part of the command and hence not part of what + ;; we complete. Adjust `pcomplete-stub' accordingly! + (if (and (> (length pcomplete-stub) 0) + (eq (aref pcomplete-stub 0) eshell-explicit-command-char)) + (setq pcomplete-stub (substring pcomplete-stub 1))))) + (completion-table-dynamic + (lambda (filename) (if (file-name-directory filename) (if eshell-force-execution (pcomplete-dirs-or-entries nil #'file-readable-p) (pcomplete-executables)) - (if (and (> (length filename) 0) - (eq (aref filename 0) eshell-explicit-command-char)) - (setq filename (substring filename 1) - pcomplete-stub filename - glob-name t)) (let* ((paths (eshell-get-path)) (cwd (file-name-as-directory (expand-file-name default-directory))) @@ -455,7 +460,7 @@ (and eshell-show-lisp-alternatives (null completions))) (all-completions filename obarray #'functionp)) - completions))))))) + completions))))))))) (define-obsolete-function-alias 'eshell-pcomplete #'completion-at-point "27.1")