GNU bug report logs - #73046
29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP

Previous Next

Package: emacs;

Reported by: "Suhail Singh" <suhailsingh247 <at> gmail.com>

Date: Thu, 5 Sep 2024 14:56:01 UTC

Severity: normal

Found in version 29.4

Fixed in version 31.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Suhail Singh <suhailsingh247 <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Suhail Singh <suhailsingh247 <at> gmail.com>, 73046 <at> debbugs.gnu.org
Subject: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP
Date: Sun, 08 Sep 2024 11:09:38 -0400
Michael Albinus <michael.albinus <at> gmx.de> writes:

>     ;; Symbolic link to a non-directory.
>     (list dired-re-sym
>           (list (lambda (end)
> -                 (when-let ((file (dired-file-name-at-point)))
> -                   (let ((truename (ignore-errors (file-truename file))))
> -                     (and (or (not truename)
> -		              (not (file-directory-p truename)))
> -		          (search-forward-regexp "\\(.+-> ?\\)\\(.+\\)"
> -                                                 end t)))))
> +                 (if (not (connection-local-value dired-check-symlinks))
> +                     (search-forward-regexp
> +                      "\\(.+-> ?\\)\\(.+\\)" end t)
> +                   (when-let ((file (dired-file-name-at-point)))
> +                     (let ((truename (ignore-errors (file-truename file))))
> +                       (and (or (not truename)
> +		                (not (file-directory-p truename)))
> +		            (search-forward-regexp
> +                             "\\(.+-> ?\\)\\(.+\\)" end t))))))

Minor nitpick: given the comment for this section (which seems to
suggest this only applies to symlinks to non-directories), wouldn't it
be "better" to simply have something like below instead for the if-then
case?  I.e., a separate entry in dired-font-lock-keywords for the
failsafe.

#+begin_src emacs-lisp
  ;; Generic face for symbolic links
  (list dired-re-sym
        (when (not (connection-local-value dired-check-symlinks))
          '(".+" (dired-move-to-filename) nil (0 dired-symlink-face))))
#+end_src

This is essentially what I have in my config today, and seems to behave
as expected.

-- 
Suhail




This bug report was last modified 240 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.