all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Roland Winkler" <winkler@gnu.org>
To: 29513@debbugs.gnu.org
Subject: bug#29513: 25.2; find-dired-centinel
Date: Thu, 30 Nov 2017 18:50:22 -0600	[thread overview]
Message-ID: <42830.33502.227610.23072@gargle.gargle.HOWL> (raw)


Following a discussion on help-gnu-emacs

https://lists.gnu.org/archive/html/help-gnu-emacs/2017-11/msg00415.html

I request to replace the function find-dired-sentinel by something
like the following that will sort the output of find
lexicographically.  I have tested that the function below works for me.
Yet there might be corner cases I do not know about where it might fail.

(defun find-dired-sentinel (proc state)
  "Sentinel for \\[find-dired] processes."
  (let ((buf (process-buffer proc)))
    (if (buffer-name buf)
	(with-current-buffer buf
	  (let ((inhibit-read-only t))
	    (save-excursion
              (save-restriction
                (widen)
                ;; `find-dired-filter' puts two whitespace characters
                ;; at the beginning of every line.
                (narrow-to-region (point) (- (point-max) 2))
                ;; Sort file names lexicographically.
                (sort-subr nil 'forward-line 'end-of-line
                           (lambda ()
                             (buffer-substring-no-properties
                              (next-single-property-change
                               (point) 'dired-filename)
                              (line-end-position))))
                (widen)
                (let ((point (point-max)))
                  (goto-char point)
                  (insert "\n  find "
                          (substring state 0 -1) ; omit \n at end of STATE.
                          " at " (substring (current-time-string) 0 19))
                  (dired-insert-set-properties point (point))))
              (setq mode-line-process
		    (format ":%s" (process-status proc)))
	      ;; Since the buffer and mode line will show that the
	      ;; process is dead, we can delete it now.  Otherwise it
	      ;; will stay around until M-x `list-processes'.
	      (delete-process proc)
	      (force-mode-line-update))))
	  (message "find-dired %s finished." buf))))




In GNU Emacs 25.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9)
 of 2017-03-03 built on regnitz
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:	Ubuntu 16.04.3 LTS

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF
GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT
LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_US.utf8
  value of $XMODIFIERS: 
  locale-coding-system: utf-8-unix

Major mode: Dired





             reply	other threads:[~2017-12-01  0:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01  0:50 Roland Winkler [this message]
2017-12-01  7:48 ` bug#29513: 25.2; find-dired-centinel Eli Zaretskii
2017-12-01 16:28   ` Roland Winkler
2017-12-01 19:38     ` Eli Zaretskii
2017-12-01 20:05       ` Roland Winkler
2019-06-11 21:15         ` Roland Winkler
2017-12-01  8:09 ` Michael Heerdegen
2017-12-01 15:26   ` Drew Adams
2017-12-01 17:48     ` Roland Winkler
2017-12-01 20:04       ` Eli Zaretskii
2017-12-01 20:16         ` Roland Winkler
2017-12-01 20:27           ` Eli Zaretskii
     [not found] ` <handler.29513.D29513.156028776529426.notifdone@debbugs.gnu.org>
2019-06-11 22:21   ` Noam Postavsky
2019-06-12  3:25     ` Roland Winkler
2019-06-12 10:35       ` Noam Postavsky

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=42830.33502.227610.23072@gargle.gargle.HOWL \
    --to=winkler@gnu.org \
    --cc=29513@debbugs.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.