(auto-mode-alist): Add uppercase version of archive
[bpt/emacs.git] / lisp / x-menu.el
index 8d55d87..4863cee 100644 (file)
@@ -1,8 +1,5 @@
 ;;; x-menu.el --- menu support for X 
 
-;; Maintainer: FSF
-;; Last-Modified: 15 Sep 1987
-
 ;; Copyright (C) 1986 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Code:
 
-(defmacro caar (conscell)
-  (list 'car (list 'car conscell)))
-
-(defmacro cdar (conscell)
-  (list 'cdr (list 'car conscell)))
-
 (defun x-menu-mode ()
   "Major mode for creating permanent menus for use with X.
 These menus are implemented entirely in Lisp; popup menus, implemented
@@ -53,7 +45,8 @@ with x-popup-menu, are implemented using XMenu primitives."
   "*Minimum horizontal spacing between objects in a permanent X menu.")
 
 (defun x-menu-create-menu (name)
-  "Create a permanent X menu.  Returns an item which should be used as a
+  "Create a permanent X menu.
+Returns an item which should be used as a
 menu object whenever referring to the menu."
   (let ((old (current-buffer))
        (buf (get-buffer-create name)))
@@ -64,15 +57,15 @@ menu object whenever referring to the menu."
     buf))
 
 (defun x-menu-change-associated-buffer (menu buffer)
-  "Change associated buffer of MENU to BUFFER.  BUFFER should be a buffer
-object."
+  "Change associated buffer of MENU to BUFFER.
+BUFFER should be a buffer object."
   (let ((old (current-buffer)))
     (set-buffer menu)
     (setq x-menu-assoc-buffer buffer)
     (set-buffer old)))
 
 (defun x-menu-add-item (menu item binding)
-  "Adds to MENU an item with name ITEM, associated with BINDING.
+  "Add to MENU an item with name ITEM, associated with BINDING.
 Following a sequence of calls to x-menu-add-item, a call to x-menu-compute
 should be performed before the menu will be made available to the user.
 
@@ -89,8 +82,8 @@ button/key code as defined in x-menu.el."
     item))
 
 (defun x-menu-delete-item (menu item)
-  "Deletes from MENU the item named ITEM.  x-menu-compute should be called
-before the menu is made available to the user."
+  "Delete from MENU the item named ITEM.
+Call `x-menu-compute' before making the menu available to the user."
   (let ((old (current-buffer))
        elt)
     (set-buffer menu)
@@ -100,10 +93,9 @@ before the menu is made available to the user."
     item))
 
 (defun x-menu-activate (menu)
-  "Computes all necessary parameters for MENU.  This must be called whenever
-a menu is modified before it is made available to the user.
-
-This also creates the menu itself."
+  "Compute all necessary parameters for MENU.
+This must be called whenever a menu is modified before it is made
+available to the user.  This also creates the menu itself."
   (let ((buf (current-buffer)))
     (pop-to-buffer menu)
     (let (buffer-read-only)
@@ -112,11 +104,11 @@ This also creates the menu itself."
       (let (items-head
            (items-tail x-menu-items-alist))
        (while items-tail
-         (if (caar items-tail)
+         (if (car (car items-tail))
              (progn (setq items-head (cons (car items-tail) items-head))
                     (setq x-menu-item-width
                           (max x-menu-item-width
-                               (length (caar items-tail))))))
+                               (length (car (car items-tail)))))))
          (setq items-tail (cdr items-tail)))
        (setq x-menu-items-alist (reverse items-head)))
       (setq x-menu-item-width (+ x-menu-item-spacing x-menu-item-width))
@@ -130,7 +122,7 @@ This also creates the menu itself."
                        (<= (setq items (1+ items)) x-menu-items-per-line))
              (insert (format (concat "%"
                                      (int-to-string x-menu-item-width) "s")
-                             (caar items-head)))
+                             (car (car items-head))))
              (setq items-head (cdr items-head))))
          (insert ?\n)))
       (shrink-window (max 0