emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/ibuffer.el


From: Colin Walters
Subject: [Emacs-diffs] Changes to emacs/lisp/ibuffer.el
Date: Sun, 03 Feb 2002 22:58:26 -0500

Index: emacs/lisp/ibuffer.el
diff -c emacs/lisp/ibuffer.el:1.5 emacs/lisp/ibuffer.el:1.6
*** emacs/lisp/ibuffer.el:1.5   Mon Jan 21 16:33:20 2002
--- emacs/lisp/ibuffer.el       Sun Feb  3 22:58:26 2002
***************
*** 63,69 ****
  Ibuffer allows you to operate on buffers in a manner much like Dired.
  Operations include sorting, marking by regular expression, and
  the ability to filter the displayed buffers by various criteria."
-   :link '(url-link "http://cvs.verbum.org/ibuffer";)
    :group 'convenience)
  
  (defcustom ibuffer-formats '((mark modified read-only " " (name 16 16 :left 
:elide)
--- 63,68 ----
***************
*** 116,122 ****
    This format displays the current mark (if any), its modification and
    read-only status, as well as the name of the buffer and its size.  In
    this format, the name is restricted to 16 characters (longer names
!   will be truncated, nad shorter names will be padded with spaces), and
    the name is also aligned to the right.  The size of the buffer will
    be padded with spaces up to a minimum of six characters, but there is
    no upper limit on its size.  The size will also be aligned to the
--- 115,121 ----
    This format displays the current mark (if any), its modification and
    read-only status, as well as the name of the buffer and its size.  In
    this format, the name is restricted to 16 characters (longer names
!   will be truncated, and shorter names will be padded with spaces), and
    the name is also aligned to the right.  The size of the buffer will
    be padded with spaces up to a minimum of six characters, but there is
    no upper limit on its size.  The size will also be aligned to the
***************
*** 1183,1196 ****
               (not (buffer-live-p buf)))
        (error "Buffer %s has been killed!" buf))
      buf))
!       
! (defun ibuffer-current-format ()
!   (when (null ibuffer-formats)
!     (error "No format!"))
!   (ibuffer-check-formats)
    (or ibuffer-current-format
        (setq ibuffer-current-format 0))
!   (nth ibuffer-current-format ibuffer-compiled-formats))
  
  (defun ibuffer-expand-format-entry (form)
    (if (or (consp form)
--- 1182,1216 ----
               (not (buffer-live-p buf)))
        (error "Buffer %s has been killed!" buf))
      buf))
! 
! (defun ibuffer-active-formats-name ()
!   (if (boundp 'ibuffer-filter-format-alist)
!       (let ((ret nil))
!       (dolist (filter ibuffer-filtering-qualifiers ret)
!         (let ((val (assq (car filter) ibuffer-filter-format-alist)))
!           (when val
!             (setq ret (car filter)))))
!       (if ret
!           ret
!         :ibuffer-formats))
!     :ibuffer-formats))
! 
! (defun ibuffer-current-formats (uncompiledp)
!   (let* ((name (ibuffer-active-formats-name)))
!     (ibuffer-check-formats)
!     (if (eq name :ibuffer-formats)
!       (if uncompiledp
!           ibuffer-formats
!         ibuffer-compiled-formats)
!       (cadr (assq name
!                 (if uncompiledp
!                     ibuffer-filter-format-alist
!                   ibuffer-compiled-filter-formats))))))
!        
! (defun ibuffer-current-format (&optional uncompiledp)
    (or ibuffer-current-format
        (setq ibuffer-current-format 0))
!   (nth ibuffer-current-format (ibuffer-current-formats uncompiledp)))  
  
  (defun ibuffer-expand-format-entry (form)
    (if (or (consp form)
***************
*** 1363,1384 ****
    "Recompile `ibuffer-formats'."
    (interactive)
    (setq ibuffer-compiled-formats
!         (mapcar #'ibuffer-compile-format ibuffer-formats)))
  
  (defun ibuffer-check-formats ()
    (when (or (null ibuffer-compiled-formats)
            (null ibuffer-cached-formats)
!           (not (equal ibuffer-cached-formats ibuffer-formats))
            (null ibuffer-cached-eliding-string)
            (not (equal ibuffer-cached-eliding-string ibuffer-eliding-string))
            (eql 0 ibuffer-cached-elide-long-columns)
            (not (eql ibuffer-cached-elide-long-columns
!                     ibuffer-elide-long-columns)))
      (message "Formats have changed, recompiling...")
      (ibuffer-recompile-formats)
      (setq ibuffer-cached-formats ibuffer-formats
          ibuffer-cached-eliding-string ibuffer-eliding-string
!         ibuffer-cached-elide-long-columns ibuffer-elide-long-columns)
      (message "Formats have changed, recompiling...done")))
  
  (defvar ibuffer-inline-columns nil)
--- 1383,1419 ----
    "Recompile `ibuffer-formats'."
    (interactive)
    (setq ibuffer-compiled-formats
!         (mapcar #'ibuffer-compile-format ibuffer-formats))
!   (when (boundp 'ibuffer-filter-format-alist)
!     (setq ibuffer-compiled-filter-formats
!         (mapcar #'(lambda (entry)
!                     (cons (car entry)
!                           (mapcar #'(lambda (formats)
!                                       (mapcar #'ibuffer-compile-format 
formats))
!                                   (cdr entry))))
!                 ibuffer-filter-format-alist))))
  
  (defun ibuffer-check-formats ()
+   (when (null ibuffer-formats)
+     (error "No formats!"))
    (when (or (null ibuffer-compiled-formats)
            (null ibuffer-cached-formats)
!           (not (eq ibuffer-cached-formats ibuffer-formats))
            (null ibuffer-cached-eliding-string)
            (not (equal ibuffer-cached-eliding-string ibuffer-eliding-string))
            (eql 0 ibuffer-cached-elide-long-columns)
            (not (eql ibuffer-cached-elide-long-columns
!                     ibuffer-elide-long-columns))
!           (not (eq ibuffer-cached-filter-formats
!                    ibuffer-filter-format-alist))
!           (and ibuffer-filter-format-alist
!                (null ibuffer-compiled-filter-formats)))
      (message "Formats have changed, recompiling...")
      (ibuffer-recompile-formats)
      (setq ibuffer-cached-formats ibuffer-formats
          ibuffer-cached-eliding-string ibuffer-eliding-string
!         ibuffer-cached-elide-long-columns ibuffer-elide-long-columns
!         ibuffer-cached-filter-formats ibuffer-filter-format-alist)
      (message "Formats have changed, recompiling...done")))
  
  (defvar ibuffer-inline-columns nil)
***************
*** 1415,1423 ****
  
  (define-ibuffer-column process ()
    (let ((proc (get-buffer-process buffer)))
!     (format "%s" (if proc
!                    (list proc (process-status proc))
!                  "none"))))
  
  (define-ibuffer-column filename ()
    (let ((directory-abbrev-alist ibuffer-directory-abbrev-alist))
--- 1450,1458 ----
  
  (define-ibuffer-column process ()
    (let ((proc (get-buffer-process buffer)))
!     (if proc 
!       (format "(%s %s)" proc (process-status proc))
!       "none")))
  
  (define-ibuffer-column filename ()
    (let ((directory-abbrev-alist ibuffer-directory-abbrev-alist))
***************
*** 1659,1665 ****
    (unless (consp ibuffer-formats)
      (error "Ibuffer error: No formats!"))
    (setq ibuffer-current-format
!       (if (>= ibuffer-current-format (1- (length ibuffer-formats)))
            0
          (1+ ibuffer-current-format)))
    (ibuffer-update-format)
--- 1694,1700 ----
    (unless (consp ibuffer-formats)
      (error "Ibuffer error: No formats!"))
    (setq ibuffer-current-format
!       (if (>= ibuffer-current-format (1- (length (ibuffer-current-formats))))
            0
          (1+ ibuffer-current-format)))
    (ibuffer-update-format)
***************
*** 1832,1838 ****
               (car entry)
               (cdr entry)
               --ibuffer-insert-buffers-and-marks-format)))
!         (ibuffer-update-title (nth ibuffer-current-format ibuffer-formats)))
        (setq buffer-read-only t)
        (set-buffer-modified-p ibuffer-did-modification)
        (setq ibuffer-did-modification nil)
--- 1867,1873 ----
               (car entry)
               (cdr entry)
               --ibuffer-insert-buffers-and-marks-format)))
!         (ibuffer-update-title (ibuffer-current-format t)))
        (setq buffer-read-only t)
        (set-buffer-modified-p ibuffer-did-modification)
        (setq ibuffer-did-modification nil)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]