comparison lisp/tool-bar.el @ 108110:21b1df34bc55

tool-bar.el: Revert unintended checkin in rev 100010.
author Jan D <jan.h.d@swipnet.se>
date Sun, 25 Apr 2010 09:23:01 +0200
parents 34eca4ecfbe6
children 2f0720afc474
comparison
equal deleted inserted replaced
108109:473b75d8b120 108110:21b1df34bc55
241 (> (length k) 1)) 241 (> (length k) 1))
242 (let ((m (lookup-key menu-bar-map (substring k 0 -1))) 242 (let ((m (lookup-key menu-bar-map (substring k 0 -1)))
243 ;; Last element in the bound key sequence: 243 ;; Last element in the bound key sequence:
244 (kk (aref k (1- (length k))))) 244 (kk (aref k (1- (length k)))))
245 (if (and (keymapp m) 245 (if (and (keymapp m)
246 (symbolp kk)) ;FIXME: Why? --Stef 246 (symbolp kk))
247 (setq submap m 247 (setq submap m
248 key kk))))) 248 key kk)))))
249 (when submap 249 (when (and (symbolp submap) (boundp submap))
250 (let ((defn nil)) 250 (setq submap (eval submap)))
251 ;; Here, we're essentially doing a "lookup-key without get_keyelt". 251 (let ((defn (assq key (cdr submap))))
252 (map-keymap (lambda (k b) (if (eq k key) (setq defn b))) 252 (if (eq (cadr defn) 'menu-item)
253 submap) 253 (define-key-after in-map (vector key)
254 (append (cdr defn) (list :image image-exp) props))
255 (setq defn (cdr defn))
254 (define-key-after in-map (vector key) 256 (define-key-after in-map (vector key)
255 (if (eq (car defn) 'menu-item) 257 (let ((rest (cdr defn)))
256 (append (cdr defn) (list :image image-exp) props) 258 ;; If the rest of the definition starts
257 (let ((rest (cdr defn))) 259 ;; with a list of menu cache info, get rid of that.
258 ;; If the rest of the definition starts 260 (if (and (consp rest) (consp (car rest)))
259 ;; with a list of menu cache info, get rid of that. 261 (setq rest (cdr rest)))
260 (if (and (consp rest) (consp (car rest))) 262 (append `(menu-item ,(car defn) ,rest)
261 (setq rest (cdr rest))) 263 (list :image image-exp) props)))))))
262 (append `(menu-item ,(car defn) ,rest)
263 (list :image image-exp) props))))))))
264 264
265 ;;; Set up some global items. Additions/deletions up for grabs. 265 ;;; Set up some global items. Additions/deletions up for grabs.
266 266
267 (defun tool-bar-setup () 267 (defun tool-bar-setup ()
268 ;; People say it's bad to have EXIT on the tool bar, since users 268 ;; People say it's bad to have EXIT on the tool bar, since users