GNU bug report logs - #74700
[PATCH] Revert Dired buffer when clicking on last segment of directory name

Previous Next

Package: emacs;

Reported by: Visuwesh <visuweshm <at> gmail.com>

Date: Thu, 5 Dec 2024 06:13:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 74700 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 74700 <at> debbugs.gnu.org, Visuwesh <visuweshm <at> gmail.com>
Subject: Re: bug#74700: [PATCH] Revert Dired buffer when clicking on last
 segment of directory name
Date: Thu, 05 Dec 2024 11:42:50 +0100
On Thu, 05 Dec 2024 11:24:23 +0200 Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Visuwesh <visuweshm <at> gmail.com>
>> Cc: 74700 <at> debbugs.gnu.org
>> Date: Thu, 05 Dec 2024 14:32:18 +0530
>> 
>> [வியாழன் டிசம்பர் 05, 2024] Eli Zaretskii wrote:
>> 
>> >> I removed the whitespace.  But isn't that way to make lists such as
>> >> 
>> >>     ( 1
>> >>       2
>> >>       3)
>> >> 
>> >> aligned without manual intervention?
>> >
>> > Typing something like
>> >
>> >    (setq foo (1
>> >               2
>> >               3)
>> >
>> > aligns the members for me.  So I don't think I understand what you are
>> > saying here.
>> 
>> Try to align
>> 
>>     (setq foo '(1 2
>>                 3))
>> 
>> instead.  3 would end up aligning at 2 instead of 1.
>
> Yes, and why is that a problem?  This is the standard Lisp indentation
> in Emacs.  It makes it easy to find the end of the sexps.
>
>> Adding a space after ( prevents this.
>
> I'm not sure I understand why overriding the standard indentation
> would be a good idea.

Sometimes the standard indentation makes the code harder to read, e.g.,
the sexp that the indentation in Visuwesh's patch took as an example is
this (starting at column 10):

(add-text-properties
 segment-start (1- (point))
 `( mouse-face highlight
    help-echo "mouse-1: goto this directory"
    keymap ,(let* ((current-dir dir)
                   (click (lambda ()
                            (interactive)
                            (cond
                             ((assoc current-dir dired-subdir-alist)
                              (dired-goto-subdir current-dir))
                             ;; If there is a wildcard chars
                             ;; in the directory name, don't
                             ;; use the alternate file machinery
                             ;; which tries to keep only one
                             ;; dired buffer open at once.
                             ;;
                             ;; FIXME: Is this code path reachable?
                             ((insert-directory-wildcard-in-dir-p
                               current-dir)
                              (dired current-dir))
                             (t
                              (dired--find-possibly-alternative-file
                               current-dir))))))
              (define-keymap
                "<mouse-2>" click
                "<follow-link>" 'mouse-face
                "RET" click))))

Here is the indentation without the space (in dired.el several lines of
this code extend well beyond column 80):

(add-text-properties
 segment-start (1- (point))
 `(mouse-face highlight
              help-echo "mouse-1: goto this directory"
              keymap ,(let* ((current-dir dir)
                             (click (lambda ()
                                      (interactive)
                                      (cond
                                       ((assoc current-dir dired-subdir-alist)
                                        (dired-goto-subdir current-dir))
                                       ;; If there is a wildcard chars
                                       ;; in the directory name, don't
                                       ;; use the alternate file machinery
                                       ;; which tries to keep only one
                                       ;; dired buffer open at once.
                                       ;;
                                       ;; FIXME: Is this code path reachable?
                                       ((insert-directory-wildcard-in-dir-p
                                         current-dir)
                                        (dired current-dir))
                                       (t
                                        (dired--find-possibly-alternative-file
                                         current-dir))))))
                        (define-keymap
                          "<mouse-2>" click
                          "<follow-link>" 'mouse-face
                          "RET" click))))

Steve Berman




This bug report was last modified 147 days ago.

Previous Next


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