aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-08-26 20:53:20 +0000
committerRichard M. Stallman1995-08-26 20:53:20 +0000
commit7ea0b430d7f08957f0b5dffa018dcf7aa0191da3 (patch)
tree44ea282dccfedd5708d239f406217c21470fca42
parent903a238c6189a56ad148bb09c288aa4d6526a14b (diff)
downloademacs-7ea0b430d7f08957f0b5dffa018dcf7aa0191da3.tar.gz
emacs-7ea0b430d7f08957f0b5dffa018dcf7aa0191da3.zip
Doc fixes.
(caar, cdar): Deleted--use (car (car ...)).
-rw-r--r--lisp/x-menu.el32
1 files changed, 13 insertions, 19 deletions
diff --git a/lisp/x-menu.el b/lisp/x-menu.el
index 0d65ce3e514..8233476b42e 100644
--- a/lisp/x-menu.el
+++ b/lisp/x-menu.el
@@ -20,12 +20,6 @@
20 20
21;;; Code: 21;;; Code:
22 22
23(defmacro caar (conscell)
24 (list 'car (list 'car conscell)))
25
26(defmacro cdar (conscell)
27 (list 'cdr (list 'car conscell)))
28
29(defun x-menu-mode () 23(defun x-menu-mode ()
30 "Major mode for creating permanent menus for use with X. 24 "Major mode for creating permanent menus for use with X.
31These menus are implemented entirely in Lisp; popup menus, implemented 25These menus are implemented entirely in Lisp; popup menus, implemented
@@ -50,7 +44,8 @@ with x-popup-menu, are implemented using XMenu primitives."
50 "*Minimum horizontal spacing between objects in a permanent X menu.") 44 "*Minimum horizontal spacing between objects in a permanent X menu.")
51 45
52(defun x-menu-create-menu (name) 46(defun x-menu-create-menu (name)
53 "Create a permanent X menu. Returns an item which should be used as a 47 "Create a permanent X menu.
48Returns an item which should be used as a
54menu object whenever referring to the menu." 49menu object whenever referring to the menu."
55 (let ((old (current-buffer)) 50 (let ((old (current-buffer))
56 (buf (get-buffer-create name))) 51 (buf (get-buffer-create name)))
@@ -61,15 +56,15 @@ menu object whenever referring to the menu."
61 buf)) 56 buf))
62 57
63(defun x-menu-change-associated-buffer (menu buffer) 58(defun x-menu-change-associated-buffer (menu buffer)
64 "Change associated buffer of MENU to BUFFER. BUFFER should be a buffer 59 "Change associated buffer of MENU to BUFFER.
65object." 60BUFFER should be a buffer object."
66 (let ((old (current-buffer))) 61 (let ((old (current-buffer)))
67 (set-buffer menu) 62 (set-buffer menu)
68 (setq x-menu-assoc-buffer buffer) 63 (setq x-menu-assoc-buffer buffer)
69 (set-buffer old))) 64 (set-buffer old)))
70 65
71(defun x-menu-add-item (menu item binding) 66(defun x-menu-add-item (menu item binding)
72 "Adds to MENU an item with name ITEM, associated with BINDING. 67 "Add to MENU an item with name ITEM, associated with BINDING.
73Following a sequence of calls to x-menu-add-item, a call to x-menu-compute 68Following a sequence of calls to x-menu-add-item, a call to x-menu-compute
74should be performed before the menu will be made available to the user. 69should be performed before the menu will be made available to the user.
75 70
@@ -86,8 +81,8 @@ button/key code as defined in x-menu.el."
86 item)) 81 item))
87 82
88(defun x-menu-delete-item (menu item) 83(defun x-menu-delete-item (menu item)
89 "Deletes from MENU the item named ITEM. x-menu-compute should be called 84 "Delete from MENU the item named ITEM.
90before the menu is made available to the user." 85Call `x-menu-compute' before making the menu available to the user."
91 (let ((old (current-buffer)) 86 (let ((old (current-buffer))
92 elt) 87 elt)
93 (set-buffer menu) 88 (set-buffer menu)
@@ -97,10 +92,9 @@ before the menu is made available to the user."
97 item)) 92 item))
98 93
99(defun x-menu-activate (menu) 94(defun x-menu-activate (menu)
100 "Computes all necessary parameters for MENU. This must be called whenever 95 "Compute all necessary parameters for MENU.
101a menu is modified before it is made available to the user. 96This must be called whenever a menu is modified before it is made
102 97available to the user. This also creates the menu itself."
103This also creates the menu itself."
104 (let ((buf (current-buffer))) 98 (let ((buf (current-buffer)))
105 (pop-to-buffer menu) 99 (pop-to-buffer menu)
106 (let (buffer-read-only) 100 (let (buffer-read-only)
@@ -109,11 +103,11 @@ This also creates the menu itself."
109 (let (items-head 103 (let (items-head
110 (items-tail x-menu-items-alist)) 104 (items-tail x-menu-items-alist))
111 (while items-tail 105 (while items-tail
112 (if (caar items-tail) 106 (if (car (car items-tail))
113 (progn (setq items-head (cons (car items-tail) items-head)) 107 (progn (setq items-head (cons (car items-tail) items-head))
114 (setq x-menu-item-width 108 (setq x-menu-item-width
115 (max x-menu-item-width 109 (max x-menu-item-width
116 (length (caar items-tail)))))) 110 (length (car (car items-tail)))))))
117 (setq items-tail (cdr items-tail))) 111 (setq items-tail (cdr items-tail)))
118 (setq x-menu-items-alist (reverse items-head))) 112 (setq x-menu-items-alist (reverse items-head)))
119 (setq x-menu-item-width (+ x-menu-item-spacing x-menu-item-width)) 113 (setq x-menu-item-width (+ x-menu-item-spacing x-menu-item-width))
@@ -127,7 +121,7 @@ This also creates the menu itself."
127 (<= (setq items (1+ items)) x-menu-items-per-line)) 121 (<= (setq items (1+ items)) x-menu-items-per-line))
128 (insert (format (concat "%" 122 (insert (format (concat "%"
129 (int-to-string x-menu-item-width) "s") 123 (int-to-string x-menu-item-width) "s")
130 (caar items-head))) 124 (car (car items-head))))
131 (setq items-head (cdr items-head)))) 125 (setq items-head (cdr items-head))))
132 (insert ?\n))) 126 (insert ?\n)))
133 (shrink-window (max 0 127 (shrink-window (max 0