unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "andrés ramírez" <rrandresf@gmail.com>
Cc: Lars Magne Ingebrigtsen <larsi@gnus.org>, 41423@debbugs.gnu.org
Subject: bug#41423: Installing the fix for bug#41423 on emacs-27
Date: Mon, 01 Feb 2021 11:13:14 -0500	[thread overview]
Message-ID: <jwvlfc7lqgd.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <86czxjg4xs.fsf@gmail.com> ("andrés ramírez"'s message of "Mon,  01 Feb 2021 15:53:35 +0000")

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






  reply	other threads:[~2021-02-01 16:13 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20 16:20 bug#41423: 27.0.91; tramp regression on pretest rrandresf
     [not found] ` <handler.41423.B.158999173030371.ack@debbugs.gnu.org>
2020-05-20 17:35   ` bug#41423: additional info andrés ramírez
2020-05-28 11:48     ` bug#41423: 27.0.91; eshell file completion in tramp dir is slow (3 minutes) [regression on pretest] (was: bug#41423: additional info) Michael Albinus
2021-02-01  2:45       ` bug#41423: 27.0.91; eshell file completion in tramp dir is slow (3 minutes) [regression on pretest] Stefan Monnier
2021-02-01  4:36         ` bug#41423: Installing the fix for bug#41423 on emacs-27 (was: 27.0.91; eshell file completion in tramp dir is slow (3 minutes) [regression on pretest]) Stefan Monnier
2021-02-01  9:59           ` bug#41423: Installing the fix for bug#41423 on emacs-27 Michael Albinus
2021-02-01 14:47           ` bug#41423: Installing the fix for bug#41423 on emacs-27 (was: 27.0.91; eshell file completion in tramp dir is slow (3 minutes) [regression on pretest]) Eli Zaretskii
2021-02-01 15:33             ` bug#41423: Installing the fix for bug#41423 on emacs-27 Stefan Monnier
2021-02-01 15:53               ` andrés ramírez
2021-02-01 16:13                 ` Stefan Monnier [this message]
2021-02-01 17:35                   ` andrés ramírez
2022-06-27  8:29                   ` bug#41423: bug#47389: 27.1.91; completion issue on eshell Lars Ingebrigtsen
2022-06-27 11:37                     ` andrés ramírez
2022-06-27 11:44                       ` Lars Ingebrigtsen
2020-08-19 10:24 ` bug#41423: 27.0.91; eshell file completion in tramp dir is slow (3 minutes) [regression on pretest] Tim Vaughan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-27 14:38 ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-28  9:32   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-28 13:17     ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-28 23:15       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-29 12:38         ` Michael Albinus
2020-08-29 15:44           ` Stefan Monnier
2020-08-29 16:12             ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-30  3:55               ` Stefan Monnier
2020-08-30 22:28                 ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-31  8:30                   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-01  4:23                   ` Stefan Monnier
2020-09-01  8:31                     ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-01 10:14                       ` Eli Zaretskii
2020-09-01 11:50                         ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-01 13:08                           ` Stefan Monnier
2020-09-01 13:30                             ` Stefan Monnier
2020-09-01 15:41                               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-01 13:04                       ` Stefan Monnier
2020-09-01 15:40                         ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-02  0:31                           ` Stefan Monnier
2020-09-02 10:26                             ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-02 10:33                               ` Michael Albinus
2020-09-02 16:00                                 ` Drew Adams
2021-01-31 17:07                                   ` xristos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-02 16:36                               ` Stefan Monnier
2020-09-02 19:52                                 ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-02 20:08                                   ` Stefan Monnier
2020-08-29 13:08 ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-29 16:54   ` Michael Albinus
2020-08-29 17:14     ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-29 17:28       ` Michael Albinus
2021-04-21 16:06 ` bug#41423: Installing the fix for bug#41423 on emacs-27 Andrés Ramírez
2021-04-23 22:14   ` Stefan Monnier
2021-04-24  3:37     ` andrés ramírez

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvlfc7lqgd.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=41423@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=rrandresf@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).