Commits

jpw  committed e97671e

* ibuffer.el (ibuffer-buffer-display-time): make it buffer local.
* ibuf-ext.el (ibuffer-old-time): means hours rather than days.
(ibuffer-mark-old-buffers): use it, docfix.
* Makefile (REQUIRES): remove dired.

  • Participants
  • Parent commits 9c2d66e

Comments (0)

Files changed (4)

+2002-02-21  John Paul Wallington  <jpw@xemacs.org>
+
+	* ibuffer.el (ibuffer-buffer-display-time): make it buffer local.
+	* ibuf-ext.el (ibuffer-old-time): means hours rather than days.
+	(ibuffer-mark-old-buffers): use it, docfix.
+	* Makefile (REQUIRES): remove dired.
+	
 2002-02-21  John Paul Wallington  <jpw@xemacs.org>
 
 	* ibuffer.el (ibuffer-always-compile-formats): change default value.
 MAINTAINER = John Paul Wallington <jpw@shootybangbang.com>
 PACKAGE = ibuffer
 PKG_TYPE = regular
-REQUIRES = ibuffer dired xemacs-base
+REQUIRES = ibuffer xemacs-base
 CATEGORY = standard
 
 ELCS = ibuf-macs.elc ibuffer.elc ibuf-ext.elc 
 (defvar ibuffer-cached-filter-formats nil)
 (defvar ibuffer-compiled-filter-formats nil)  
 
-(defcustom ibuffer-old-time 3
-  "The number of days before a buffer is considered \"old\"."
-  :type 'integer
+(defcustom ibuffer-old-time 72
+  "The number of hours before a buffer is considered \"old\"."
+  :type '(choice (const :tag "72 hours (3 days)" 72)
+		 (const :tag "48 hours (2 days)" 48)
+		 (const :tag "24 hours (1 day)" 24)
+		 (integer :tag "hours"))
   :group 'ibuffer)
 
 (defcustom ibuffer-save-with-custom t
 
 ;;;###autoload
 (defun ibuffer-mark-old-buffers ()
-  "Mark buffers which have not been viewed in `ibuffer-old-time' days."
+  "Mark buffers which have not been viewed in `ibuffer-old-time' hours."
   (interactive)
   (ibuffer-mark-on-buffer
    #'(lambda (buf)
 	   (when bdt
 	     (let* ((tm (current-time))
 		    (now (+ (* (float (ash 1 16)) (car tm))
-			  (float (cadr tm)) (* 0.0000001 (caddr tm))))
+			    (float (cadr tm)) (* 0.0000001 (caddr tm))))
 		    (then (+ (* (float (ash 1 16))
 				(car bdt))
 			     (float (cadr bdt))
 			     (* 0.0000001 (caddr bdt)))))
-	       (> (- now then) (* 24 60 60 ibuffer-old-time)))))))))
+	       (> (- now then) (* 60 60 ibuffer-old-time)))))))))
 
 ;;;###autoload
 (defun ibuffer-mark-special-buffers ()
 ;; leave-window-hook implemented yet.
 (unless (boundp 'buffer-display-time)
   (defvar ibuffer-buffer-display-time nil)
-  (make-variable-buffer-local 'ibuffer-display-time)
+  (make-variable-buffer-local 'ibuffer-buffer-display-time)
   (defvar ibuffer-tracked-buffers (make-hash-table))
   
   (defun ibuffer-track-buffers (frame)