/[emacs]/emacs/lisp/ibuf-macs.el
ViewVC logotype

Diff of /emacs/lisp/ibuf-macs.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by walters, Wed Jan 16 06:33:20 2002 UTC revision 1.3 by walters, Mon Feb 4 03:57:35 2002 UTC
# Line 71  During evaluation of body, bind `it' to Line 71  During evaluation of body, bind `it' to
71  ;; (put 'ibuffer-save-marks 'lisp-indent-function 0)  ;; (put 'ibuffer-save-marks 'lisp-indent-function 0)
72    
73  ;;;###autoload  ;;;###autoload
74  (defmacro* define-ibuffer-column (symbol (&key name inline props) &rest body)  (defmacro* define-ibuffer-column (symbol (&key name inline props
75                                                   summarizer) &rest body)
76    "Define a column SYMBOL for use with `ibuffer-formats'.    "Define a column SYMBOL for use with `ibuffer-formats'.
77    
78  BODY will be called with `buffer' bound to the buffer object, and  BODY will be called with `buffer' bound to the buffer object, and
# Line 81  will be `buffer'. Line 82  will be `buffer'.
82  If NAME is given, it will be used as a title for the column.  If NAME is given, it will be used as a title for the column.
83  Otherwise, the title will default to a capitalized version of the  Otherwise, the title will default to a capitalized version of the
84  SYMBOL's name.  PROPS is a plist of additional properties to add to  SYMBOL's name.  PROPS is a plist of additional properties to add to
85  the text, such as `mouse-face'.  the text, such as `mouse-face'.  And SUMMARIZER, if given, is a
86    function which will be passed a list of all the strings in its column;
87    it should return a string to display at the bottom.
88    
89  Note that this macro expands into a `defun' for a function named  Note that this macro expands into a `defun' for a function named
90  ibuffer-make-column-NAME.  If INLINE is non-nil, then the form will be  ibuffer-make-column-NAME.  If INLINE is non-nil, then the form will be
# Line 90  change its definition, you should explic Line 93  change its definition, you should explic
93  `ibuffer-recompile-formats'."  `ibuffer-recompile-formats'."
94    (let* ((sym (intern (concat "ibuffer-make-column-"    (let* ((sym (intern (concat "ibuffer-make-column-"
95                                (symbol-name symbol))))                                (symbol-name symbol))))
96           (bod-1 `(with-current-buffer buffer           (bod-2 `(with-current-buffer buffer
97                     ,@body))                     ,@body))
98             (bod-1 (if summarizer
99                        `(car
100                          (push ,bod-2
101                                ,(intern (format "ibuffer-summary-for-column-%s"
102                                                 name))))
103                      bod-2))
104           (bod (if props           (bod (if props
105                   `(propertize                   `(propertize
106                     ,bod-1                     ,bod-1
# Line 106  change its definition, you should explic Line 115  change its definition, you should explic
115              ,(if (stringp name)              ,(if (stringp name)
116                   name                   name
117                 (capitalize (symbol-name symbol))))                 (capitalize (symbol-name symbol))))
118           ,(if summarizer
119                `(put (quote ,sym) 'ibuffer-column-summarizer
120                      (quote ,summarizer)))
121           ,(if summarizer
122                `(defvar ,(intern (format "ibuffer-summary-for-column-%s"
123                                          name))
124                   nil))
125         :autoload-end)))         :autoload-end)))
126  ;; (put 'define-ibuffer-column 'lisp-indent-function 'defun)  ;; (put 'define-ibuffer-column 'lisp-indent-function 'defun)
127    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26