From: Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 74700@debbugs.gnu.org, Visuwesh <visuweshm@gmail.com>
Subject: bug#74700: [PATCH] Revert Dired buffer when clicking on last segment of directory name
Date: Thu, 05 Dec 2024 11:42:50 +0100 [thread overview]
Message-ID: <87a5dammvp.fsf@gmx.net> (raw)
In-Reply-To: <86bjxqxz20.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 05 Dec 2024 11:24:23 +0200")
On Thu, 05 Dec 2024 11:24:23 +0200 Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Visuwesh <visuweshm@gmail.com>
>> Cc: 74700@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
next prev parent reply other threads:[~2024-12-05 10:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-05 6:12 bug#74700: [PATCH] Revert Dired buffer when clicking on last segment of directory name Visuwesh
2024-12-05 7:02 ` Eli Zaretskii
2024-12-05 8:26 ` Visuwesh
2024-12-05 8:41 ` Eli Zaretskii
2024-12-05 9:02 ` Visuwesh
2024-12-05 9:24 ` Eli Zaretskii
2024-12-05 10:42 ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-12-05 17:56 ` Juri Linkov
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=87a5dammvp.fsf@gmx.net \
--to=bug-gnu-emacs@gnu.org \
--cc=74700@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=stephen.berman@gmx.net \
--cc=visuweshm@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).