Merge from emacs--rel--22
[bpt/emacs.git] / lisp / ibuf-macs.el
index 3e814d4..1ea7e0b 100644 (file)
@@ -1,7 +1,7 @@
 ;;; ibuf-macs.el --- macros for ibuffer
 
 ;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Colin Walters <walters@verbum.org>
 ;; Maintainer: John Paul Wallington <jpw@gnu.org>
@@ -12,7 +12,7 @@
 
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 2, or (at
+;; published by the Free Software Foundation; either version 3, or (at
 ;; your option) any later version.
 
 ;; This program is distributed in the hope that it will be useful, but
@@ -75,8 +75,8 @@ During evaluation of body, bind `it' to the value returned by TEST."
 ;; (put 'ibuffer-save-marks 'lisp-indent-function 0)
 
 ;;;###autoload
-(defmacro* define-ibuffer-column (symbol (&key name inline props
-                                              summarizer) &rest body)
+(defmacro* define-ibuffer-column (symbol (&key name inline props summarizer 
+                                              header-mouse-map) &rest body)
   "Define a column SYMBOL for use with `ibuffer-formats'.
 
 BODY will be called with `buffer' bound to the buffer object, and
@@ -90,6 +90,9 @@ the text, such as `mouse-face'.  And SUMMARIZER, if given, is a
 function which will be passed a list of all the strings in its column;
 it should return a string to display at the bottom.
 
+If HEADER-MOUSE-MAP is given, it will be used as a keymap for the
+title of the column.
+
 Note that this macro expands into a `defun' for a function named
 ibuffer-make-column-NAME.  If INLINE is non-nil, then the form will be
 inlined into the compiled format versions.  This means that if you
@@ -115,6 +118,7 @@ change its definition, you should explicitly call
            ,(if (stringp name)
                 name
               (capitalize (symbol-name symbol))))
+       ,(if header-mouse-map `(put (quote ,sym) 'header-mouse-map ,header-mouse-map))
        ,(if summarizer
            ;; Store the name of the summarizing function.
            `(put (quote ,sym) 'ibuffer-column-summarizer