From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Christopher Schmidt Newsgroups: gmane.emacs.bugs Subject: bug#6799: 24.0.50; Please add dired-details.el to Emacs [patch] Date: Sat, 15 Dec 2012 22:17:33 +0000 (GMT) Message-ID: <87k3sj6juj@ch.ristopher.com> References: <9C9137560F644E759AD573BBBD8E59EF@us.oracle.com> <5EA47A0255F8494DB430B52D46876641@us.oracle.com> <65D921448B0644988BE6445A2EF3E021@us.oracle.com> <21FFB8EA85964411A9B790386C5DA3AD@us.oracle.com> <878v8zow44@ch.ristopher.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1355609884 15607 80.91.229.3 (15 Dec 2012 22:18:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Dec 2012 22:18:04 +0000 (UTC) Cc: Michael Heerdegen To: 6799@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 15 23:18:18 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tk03m-0007ft-4J for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Dec 2012 23:18:18 +0100 Original-Received: from localhost ([::1]:47006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tk03Y-00007p-Vd for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Dec 2012 17:18:04 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tk03T-00007j-Qe for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2012 17:18:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tk03R-0003lL-MC for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2012 17:17:59 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tk03R-0003lH-It for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2012 17:17:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tk04U-0001Fx-I9 for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2012 17:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Christopher Schmidt Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Dec 2012 22:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6799 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13556099334815 (code B ref -1); Sat, 15 Dec 2012 22:19:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Dec 2012 22:18:53 +0000 Original-Received: from localhost ([127.0.0.1]:44447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tk04K-0001Fb-JA for submit@debbugs.gnu.org; Sat, 15 Dec 2012 17:18:53 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51513) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tk04H-0001FT-QG for submit@debbugs.gnu.org; Sat, 15 Dec 2012 17:18:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tk03B-0003j6-Jb for submit@debbugs.gnu.org; Sat, 15 Dec 2012 17:17:43 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:56582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tk03B-0003j2-GS for submit@debbugs.gnu.org; Sat, 15 Dec 2012 17:17:41 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tk038-00007e-Vg for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2012 17:17:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tk036-0003ip-Iv for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2012 17:17:38 -0500 Original-Received: from ristopher.com ([146.185.21.93]:36910 helo=saturn.ch.ristopher.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tk036-0003ij-6Y for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2012 17:17:36 -0500 Original-Received: by saturn.ch.ristopher.com (Postfix, from userid 0) id BF56620168; Sat, 15 Dec 2012 22:17:33 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ch.ristopher.com; s=mail; t=1355609853; bh=YaB6P3vTfveBxvTTq25vJQWmUgZbs59bXGh6SMqq5ig=; h=From:To:Cc:Subject:In-Reply-To:Message-ID:References:MIME-Version: Content-Type:Date; b=2amBBDUUgZSPD0ZA3i2NlNBTNhTZ+0OTdy67Ogga3IdJQ+nB5dONeeeLv37sxn6vm F3kh7lqPtsEOPNNem1AN+AU8jx3GQ7fduG54nARSQ2xuoMBzuIpcMww7vEB9Bf740L arEjFwGbcL3E4x6brzvBx6rHWxhw16ht6lIqaSRY= In-Reply-To: <878v8zow44@ch.ristopher.com> (Christopher Schmidt's message of "Sat, 15 Dec 2012 21:15:16 +0000 (GMT)") Mail-Followup-To: bug-gnu-emacs@gnu.org, Drew Adams , Michael Heerdegen X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x 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.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:68589 Archived-At: --=-=-= Content-Type: text/plain Christopher Schmidt writes: > Here is my attempt. Here is a better one. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=my-dired-hide-details-mode.el Content-Transfer-Encoding: quoted-printable (define-minor-mode my-dired-hide-details-mode "" nil nil nil (cl-assert (derived-mode-p 'dired-mode)) (save-restriction (widen) (save-excursion (goto-char (point-min)) (unless (or (eobp) (unless (get-text-property (point) 'dired-details-to-hide) (goto-char (next-single-property-change (point) 'dired-details-to-hide nil (point-max))) (eobp)) (eq (get-text-property (point) 'invisible) my-dired-hide-details-mode)) (cl-loop until (eobp) for end =3D (next-single-property-change (point) 'dired-details-to-hide nil (point-max)) do (let ((buffer-read-only)) (put-text-property (point) end 'invisible my-dired-hide-details-mode)) (goto-char (1+ end)) until (eobp) for next =3D (next-single-property-change (1+ end) 'dired-details-to-hide) while next do (goto-char next)))))) (defadvice dired-insert-set-properties (after my-add-hide-props (beg end) activate) (save-restriction (narrow-to-region beg end) (save-excursion (goto-char (point-min)) (unless (get-text-property (point) 'dired-filename) (let ((from (point))) (unless (let ((c (next-single-property-change (point) 'dired-filename))) (when c (goto-char c) (move-beginning-of-line nil) t)) (forward-line 1)) (let ((buffer-read-only)) (add-text-properties from (point) `(invisible ,my-dired-hide-details-mode dired-details-to-hide t))))) (cl-loop for p =3D (next-single-property-change (point) 'dired-filename) while p do (goto-char p) (when (get-text-property (point) 'dired-filename) (let ((buffer-read-only)) (add-text-properties (+ (line-beginning-position) 2) (point) `(invisible ,my-dired-hide-details-mode dired-details-to-hide t))) (save-restriction (narrow-to-region (point) (line-end-position)) (let ((link (next-single-property-change (point) 'dired-filename))) (when link (let ((buffer-read-only)) (add-text-properties (+ link 4) (point-max) `(invisible ,my-dired-hide-details-mode dired-details-to-hide t))))))))))) (defadvice find-dired (after my-fix-move-process-mark-to-arg activate) (move-marker (process-mark (get-buffer-process (current-buffer))) (save-excursion (goto-char (point-min)) (forward-line 1) (point)))) (define-key dired-mode-map "(" 'my-dired-hide-details-mode) (provide 'my-dired-hide-details-mode) --=-=-= Content-Type: text/plain Christopher --=-=-=--