From: Filipp Gunbin <fgunbin@fastmail.fm>
To: emacs-devel@gnu.org
Subject: dired: make dired-maybe-insert-subdir always skip trivial files
Date: Thu, 25 Dec 2014 21:21:36 +0300 [thread overview]
Message-ID: <m261czegjz.fsf@fastmail.fm> (raw)
When `dired-maybe-insert-subdir' is called on a subdir not yet present
in the dired buffer, it inserts that subdir and skips to a first
"non-trivial" file.
But when it is already present, the point jumps to the header line and
stays there.
Below is the fix which makes it select the first non-trivial file
always. Is it ok to apply?
Filipp
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index bb93cce..acc7e76 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -2062,7 +2062,10 @@ See Info node `(emacs)Subdir switches' for more details."
;; inserted *after* opoint.
(setq dirname (file-name-as-directory dirname))
(or (and (not switches)
- (dired-goto-subdir dirname))
+ (when (dired-goto-subdir dirname)
+ (unless (dired-subdir-hidden-p dirname)
+ (dired-initial-position dirname))
+ t))
(dired-insert-subdir dirname switches no-error-if-not-dir-p))
;; Push mark so that it's easy to find back. Do this after the
;; insert message so that the user sees the `Mark set' message.
next reply other threads:[~2014-12-25 18:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-25 18:21 Filipp Gunbin [this message]
2014-12-25 19:32 ` dired: make dired-maybe-insert-subdir always skip trivial files Juri Linkov
2014-12-25 19:51 ` Filipp Gunbin
2014-12-25 20:18 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m261czegjz.fsf@fastmail.fm \
--to=fgunbin@fastmail.fm \
--cc=emacs-devel@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.