From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Roland Winkler" Newsgroups: gmane.emacs.bugs Subject: bug#29513: 25.2; find-dired-centinel Date: Thu, 30 Nov 2017 18:50:22 -0600 Message-ID: <42830.33502.227610.23072@gargle.gargle.HOWL> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1512089471 5820 195.159.176.226 (1 Dec 2017 00:51:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 1 Dec 2017 00:51:11 +0000 (UTC) To: 29513@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 01 01:51:05 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKZXi-0000vH-3M for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Dec 2017 01:51:02 +0100 Original-Received: from localhost ([::1]:50642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKZXp-0004CJ-4F for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Nov 2017 19:51:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKZXj-0004CC-9y for bug-gnu-emacs@gnu.org; Thu, 30 Nov 2017 19:51:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKZXi-0007nH-7a for bug-gnu-emacs@gnu.org; Thu, 30 Nov 2017 19:51:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58329) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eKZXi-0007mp-3D for bug-gnu-emacs@gnu.org; Thu, 30 Nov 2017 19:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eKZXh-00020A-Md for bug-gnu-emacs@gnu.org; Thu, 30 Nov 2017 19:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Roland Winkler" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Dec 2017 00:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29513 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15120894447667 (code B ref -1); Fri, 01 Dec 2017 00:51:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Dec 2017 00:50:44 +0000 Original-Received: from localhost ([127.0.0.1]:38777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKZXP-0001zb-OZ for submit@debbugs.gnu.org; Thu, 30 Nov 2017 19:50:43 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35855) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKZXN-0001zO-VV for submit@debbugs.gnu.org; Thu, 30 Nov 2017 19:50:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKZXH-0007ZQ-Ks for submit@debbugs.gnu.org; Thu, 30 Nov 2017 19:50:36 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:58513) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eKZXH-0007ZK-HD for submit@debbugs.gnu.org; Thu, 30 Nov 2017 19:50:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKZXG-0004C0-1m for bug-gnu-emacs@gnu.org; Thu, 30 Nov 2017 19:50:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKZXE-0007Xe-K8 for bug-gnu-emacs@gnu.org; Thu, 30 Nov 2017 19:50:34 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKZXE-0007XM-FF for bug-gnu-emacs@gnu.org; Thu, 30 Nov 2017 19:50:32 -0500 Original-Received: from [2602:30a:2e52:d720:65b7:1416:12e7:8bfb] (port=56164 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1eKZXE-00052r-2U for bug-gnu-emacs@gnu.org; Thu, 30 Nov 2017 19:50:32 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140566 Archived-At: 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