From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: dired-details: show/hide file details in Dired Date: Wed, 4 Jul 2007 07:57:40 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0008_01C7BE10.FEC92DE0" X-Trace: sea.gmane.org 1183561160 3613 80.91.229.12 (4 Jul 2007 14:59:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 4 Jul 2007 14:59:20 +0000 (UTC) To: , Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 04 16:59:18 2007 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I66K3-0006YN-GM for ged-emacs-devel@m.gmane.org; Wed, 04 Jul 2007 16:59:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I66K3-00026k-00 for ged-emacs-devel@m.gmane.org; Wed, 04 Jul 2007 10:59:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I66Jy-00026V-US for emacs-devel@gnu.org; Wed, 04 Jul 2007 10:59:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I66Jw-00026J-Ho for emacs-devel@gnu.org; Wed, 04 Jul 2007 10:59:09 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I66Jw-00026G-B3 for emacs-devel@gnu.org; Wed, 04 Jul 2007 10:59:08 -0400 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I66Jv-0006et-Ey for emacs-devel@gnu.org; Wed, 04 Jul 2007 10:59:08 -0400 Original-Received: from rgmgw3.us.oracle.com (rgmgw3.us.oracle.com [138.1.186.112]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l64Ex3Y3016801; Wed, 4 Jul 2007 09:59:04 -0500 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by rgmgw3.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l64CCwTl032542; Wed, 4 Jul 2007 08:59:02 -0600 Original-Received: from dhcp-amer-whq-csvpn-gw3-141-144-80-71.vpn.oracle.com by acsmt350.oracle.com with ESMTP id 3011568521183561068; Wed, 04 Jul 2007 07:57:48 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:74296 Archived-At: This is a multi-part message in MIME format. ------=_NextPart_000_0008_01C7BE10.FEC92DE0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit > http://www.emacswiki.org/cgi-bin/wiki/dired-details%2b.el. > > RMS and many others are not going to go to a Web site Attached. ------=_NextPart_000_0008_01C7BE10.FEC92DE0 Content-Type: application/octet-stream; name="dired-details+.el" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="dired-details+.el" ;;; dired-details+.el --- Enhancements to library `dired-details+.el'.=0A= ;; =0A= ;; Filename: dired-details+.el=0A= ;; Description: Enhancements to library `dired-details+.el'.=0A= ;; Author: Drew Adams=0A= ;; Maintainer: Drew Adams=0A= ;; Copyright (C) 2005-2007, Drew Adams, all rights reserved.=0A= ;; Created: Tue Dec 20 13:33:01 2005=0A= ;; Version: =0A= ;; Last-Updated: Fri Jan 19 20:59:48 2007 (-28800 Pacific Standard Time)=0A= ;; By: dradams=0A= ;; Update #: 141=0A= ;; URL: http://www.emacswiki.org/cgi-bin/wiki/dired-details+.el=0A= ;; Keywords: dired, frames=0A= ;; Compatibility: GNU Emacs 20, GNU Emacs 22=0A= ;; =0A= ;; Features that might be required by this library:=0A= ;;=0A= ;; `autofit-frame', `avoid', `dired-details', `fit-frame',=0A= ;; `frame-cmds', `frame-fns', `misc-fns', `strings', `thingatpt',=0A= ;; `thingatpt+'.=0A= ;;=0A= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=0A= ;; =0A= ;;; Commentary: =0A= ;; =0A= ;; This enhances the functionality of library `dired-details.el'.=0A= ;;=0A= ;; 1. It shrink-wraps Dired's frame whenever you show or hide=0A= ;; details. For this enhancement, you will need library=0A= ;; `autofit-frame.el'.=0A= ;;=0A= ;; 2. It advises `dired-byte-compile', `dired-compress',=0A= ;; `dired-create-files' and `dired-create-directory', so that=0A= ;; whenever you create new files or directories or rename them the=0A= ;; hide/show overlays are updated accordingly.=0A= ;;=0A= ;; 3. It adds user option `dired-details-propagate-flag' which, if=0A= ;; non-nil, propagates the last state you chose to the next Dired=0A= ;; buffer you open.=0A= ;;=0A= ;; 4. It binds both `)' and `(' to `dired-details-toggle'.=0A= ;;=0A= ;; Perhaps #2 corresponds to this TO-DO item in `dired-details.el':=0A= ;;=0A= ;; * add a hook for dired-add-file to hide new entries as necessary=0A= ;;=0A= ;;=0A= ;; ***** NOTE: The following function defined in `dired-details.el'=0A= ;; has been REDEFINED HERE:=0A= ;;=0A= ;; `dired-details-activate' - If `dired-details-propagate-flag' is=0A= ;; non-nil, then use the last state.=0A= ;;=0A= ;; ***** NOTE: The following functions defined in `dired-aux.el' have=0A= ;; been REDEFINED HERE (advised only):=0A= ;;=0A= ;; `dired-byte-compile', `dired-compress', `dired-create-files',=0A= ;; `dired-create-directory' - Update overlays.=0A= ;;=0A= ;;=0A= ;; I have submitted these enhancements to Rob Giardina, the author of=0A= ;; `dired-details.el', for inclusion in that library. When they (or=0A= ;; similar) are added to that library, I'll remove this library.=0A= ;;=0A= ;; Put this in your initialization file (~/.emacs):=0A= ;;=0A= ;; (require 'dired-details+)=0A= ;;=0A= ;; I also recommend customizing `dired-details-hidden-string' to use=0A= ;; the value "" instead of the default "[...]" - less wasted space.=0A= ;;=0A= ;; Note: This library also calls `dired-details-install', activating=0A= ;; show/hide and binding keys `(' and `)'.=0A= ;; =0A= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=0A= ;; =0A= ;;; Change log:=0A= ;; =0A= ;; 2006/02/02 dadams=0A= ;; Bind both ) and ( to dired-details-toggle.=0A= ;; 2006/01/02 dadams=0A= ;; Advised dired-byte-compile and dired-compress.=0A= ;; 2006/01/01 dadams=0A= ;; Advised dired-create-directory.=0A= ;; 2005/12/30 dadams=0A= ;; Advised dired-create-files.=0A= ;; dired-details-(show|hide): Only fit frame if it's showing Dired.=0A= ;; 2005/12/26 dadams=0A= ;; Updated groups.=0A= ;; =0A= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=0A= ;; =0A= ;; This program is free software; you can redistribute it and/or modify=0A= ;; it under the terms of the GNU General Public License as published by=0A= ;; the Free Software Foundation; either version 2, or (at your option)=0A= ;; any later version.=0A= ;; =0A= ;; This program is distributed in the hope that it will be useful,=0A= ;; but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= ;; GNU General Public License for more details.=0A= ;; =0A= ;; You should have received a copy of the GNU General Public License=0A= ;; along with this program; see the file COPYING. If not, write to the=0A= ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth=0A= ;; ;; Floor, Boston, MA 02110-1301, USA.=0A= ;; =0A= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=0A= ;; =0A= ;;; Code:=0A= =0A= ;;; Do this `defcustom' first, before we load `dired-details', so we=0A= ;;; don't pick up the `defcustom' there. The default value here is=0A= ;;; the empty string, so the overlay doesn't give a false impression=0A= ;;; of the current column number. This is important for frame fitting=0A= ;;; (see library `fit-frame.el', required by `autofit-frame.el').=0A= (defcustom dired-details-hidden-string ""=0A= "*This string will be shown in place of file details and symbolic = links."=0A= :group 'dired-details :group 'dired=0A= :type 'string)=0A= =0A= (require 'dired-details nil t) ;; (no error if not found): = dired-details-hide,=0A= ;; dired-details-install, = dired-details-show=0A= (require 'autofit-frame nil t) ;; (no error if not found): = fit-frame-if-one-window=0A= =0A= ;;;;;;;;;;;;;;;;;;;;;;;;;;=0A= =0A= =0A= (defcustom dired-details-propagate-flag t=0A= "Non-nil means next Dired buffer should be displayed the same.=0A= The last `dired-details-state' value set is used by the next Dired=0A= buffer created."=0A= :type 'boolean)=0A= =0A= (defvar dired-details-last-state nil=0A= "Last `dired-details-state' value.=0A= This is changed each time any Dired buffer's state changes.")=0A= =0A= =0A= =0A= =0A= ;;; REPLACE ORIGINAL in `dired-details.el'.=0A= ;;;=0A= ;;; Use last hide/show state, if `dired-details-propagate-flag'.=0A= ;;; =0A= (defun dired-details-activate ()=0A= "Set up dired-details in the current dired buffer.=0A= Called by `dired-after-readin-hook' on initial display and when a=0A= subdirectory is inserted (with `i'). The state is chosen as follows:=0A= If the state is already established here, leave it alone.=0A= If `dired-details-propagate-flag' is non-nil, then use the last state.=0A= Otherwise, use the default state, as determined by=0A= `dired-details-initially-hide'."=0A= (cond (dired-details-state ; State chosen in this buffer; = respect it.=0A= (when (eq 'hidden dired-details-state)=0A= (dired-details-hide)))=0A= ((and dired-details-propagate-flag ; Inherit state from previous.=0A= dired-details-last-state)=0A= (when (eq 'hidden dired-details-last-state)=0A= (dired-details-hide)))=0A= (t=0A= ;;otherwise, use the default state=0A= (when dired-details-initially-hide=0A= (dired-details-hide)))))=0A= =0A= ;; The test (get-buffer-window (current-buffer)) is to make sure that=0A= ;; Dired is already displayed. If not, the selected frame is not what=0A= ;; we want to fit.=0A= (when (fboundp 'dired-details-show)=0A= (dired-details-install)=0A= ;; Override bindings in `dired-details-install'.=0A= (define-key dired-mode-map "(" 'dired-details-toggle)=0A= (define-key dired-mode-map ")" 'dired-details-toggle)=0A= (defadvice dired-details-show (after fit-dired-frame activate)=0A= "Save `dired-details-last-state'. Fit Dired frame if = `one-window-p'."=0A= (setq dired-details-last-state dired-details-state)=0A= (when (and (get-buffer-window (current-buffer))=0A= (fboundp 'fit-frame-if-one-window))=0A= (fit-frame-if-one-window)))=0A= =0A= (defadvice dired-details-hide (after fit-dired-frame activate)=0A= "Save `dired-details-last-state'. Fit Dired frame if = `one-window-p'."=0A= (setq dired-details-last-state dired-details-state)=0A= (when (and (get-buffer-window (current-buffer))=0A= (fboundp 'fit-frame-if-one-window))=0A= (fit-frame-if-one-window))))=0A= =0A= =0A= ;; `dired-create-files' is defined in `dired-aux.el'.=0A= ;;;###autoload=0A= (defadvice dired-create-files (after dired-details-activate activate)=0A= "Set up Dired details."=0A= (dired-details-delete-overlays)=0A= (dired-details-activate))=0A= =0A= ;; `dired-create-directory' is defined in `dired-aux.el'.=0A= ;;;###autoload=0A= (defadvice dired-create-directory (after dired-details-activate activate)=0A= "Set up Dired details."=0A= (dired-details-delete-overlays)=0A= (dired-details-activate))=0A= =0A= ;; `dired-byte-compile' is defined in `dired-aux.el'.=0A= ;;;###autoload=0A= (defadvice dired-byte-compile (after dired-details-activate activate)=0A= "Set up Dired details."=0A= (dired-details-delete-overlays)=0A= (dired-details-activate))=0A= =0A= ;; `dired-compress' is defined in `dired-aux.el'.=0A= ;;;###autoload=0A= (defadvice dired-compress (after dired-details-activate activate)=0A= "Set up Dired details."=0A= (dired-details-delete-overlays)=0A= (dired-details-activate))=0A= =0A= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=0A= =0A= (provide 'dired-details+)=0A= =0A= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=0A= ;;; dired-details+.el ends here=0A= ------=_NextPart_000_0008_01C7BE10.FEC92DE0 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel ------=_NextPart_000_0008_01C7BE10.FEC92DE0--