;;; mh-tool-bar.el --- MH-E tool bar support
-;; Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2003, 2005-2013 Free Software Foundation, Inc.
;; Author: Satyaki Das <satyaki@theforce.stanford.edu>
;; Maintainer: Bill Wohler <wohler@newt.com>
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs 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 your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; 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, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
first line is useful and complete without the rest of the string.
Optional item ENABLE-EXPR is an arbitrary lisp expression. If it
- evaluates to nil, then the button is deactivated, otherwise it is
+ evaluates to nil, then the button is inactive, otherwise it is
active. If it isn't present then the button is always active."
;; The following variable names have been carefully chosen to make code
;; generation easier. Modifying the names should be done carefully.
(name-str (symbol-name name))
(icon (nth 2 button))
(xemacs-icon (mh-do-in-xemacs
- (cdr (assoc (intern icon) mh-xemacs-icon-map))))
+ `(cdr (assoc (quote ,(intern icon)) mh-xemacs-icon-map))))
(full-doc (nth 3 button))
(doc (if (string-match "\\(.*\\)\n" full-doc)
(match-string 1 full-doc)
(t 'folder-buttons)))
(docs (cond ((eq mbuttons 'letter-buttons) 'letter-docs)
((eq mbuttons 'folder-buttons) 'folder-docs))))
- (add-to-list vector-list `[,xemacs-icon ,function t ,full-doc])
+ (add-to-list vector-list `(vector ,xemacs-icon ',function t ,full-doc))
(add-to-list
setter `(when (member ',name ,list)
(mh-funcall-if-exists
;; XEmacs specific code
(mh-do-in-xemacs
(defvar mh-tool-bar-folder-vector-map
- ',(loop for button in folder-buttons
- for vector in folder-vectors
- collect (cons button vector)))
+ (list ,@(loop for button in folder-buttons
+ for vector in folder-vectors
+ collect `(cons ',button ,vector))))
(defvar mh-tool-bar-show-vector-map
- ',(loop for button in show-buttons
- for vector in show-vectors
- collect (cons button vector)))
+ (list ,@(loop for button in show-buttons
+ for vector in show-vectors
+ collect `(cons ',button ,vector))))
(defvar mh-tool-bar-letter-vector-map
- ',(loop for button in letter-buttons
- for vector in letter-vectors
- collect (cons button vector)))
- (defvar mh-tool-bar-folder-buttons nil)
- (defvar mh-tool-bar-show-buttons nil)
- (defvar mh-tool-bar-letter-buttons nil)
+ (list ,@(loop for button in letter-buttons
+ for vector in letter-vectors
+ collect `(cons ',button ,vector))))
+ (defvar mh-tool-bar-folder-buttons)
+ (defvar mh-tool-bar-show-buttons)
+ (defvar mh-tool-bar-letter-buttons)
;; Custom setter functions
(defun mh-tool-bar-letter-buttons-set (symbol value)
(set-default symbol value)
(when mh-xemacs-has-tool-bar-flag
(setq mh-tool-bar-letter-buttons
(loop for b in value
- collect (cdr (assoc b mh-tool-bar-letter-vector-map))))))
+ collect (cdr
+ (assoc b mh-tool-bar-letter-vector-map))))))
(defun mh-tool-bar-folder-buttons-set (symbol value)
(set-default symbol value)
(when mh-xemacs-has-tool-bar-flag
collect (cdr (assoc b mh-tool-bar-show-vector-map))))))
(defun mh-tool-bar-init (mode)
"Install tool bar in MODE."
- (let ((tool-bar (cond ((eq mode :folder) mh-tool-bar-folder-buttons)
- ((eq mode :letter) mh-tool-bar-letter-buttons)
- ((eq mode :show) mh-tool-bar-show-buttons)))
- (height 37)
- (width 40)
- (buffer (current-buffer)))
- (when mh-xemacs-use-tool-bar-flag
+ (when mh-xemacs-use-tool-bar-flag
+ (let ((tool-bar (cond ((eq mode :folder)
+ mh-tool-bar-folder-buttons)
+ ((eq mode :letter)
+ mh-tool-bar-letter-buttons)
+ ((eq mode :show)
+ mh-tool-bar-show-buttons)))
+ (height 37)
+ (width 40)
+ (buffer (current-buffer)))
(cond
((eq mh-xemacs-tool-bar-position 'top)
(set-specifier top-toolbar tool-bar buffer)
for y in letter-docs
collect `(const :tag ,y ,x)))
;;:package-version '(MH-E "7.1")
- ))))
+ ))))
+;; The icon names are duplicated in the Makefile and mh-xemacs.el.
(mh-tool-bar-define
((:folder mh-inc-folder mh-mime-save-parts
mh-previous-undeleted-msg mh-page-msg
;; sentence-end-double-space: nil
;; End:
-;; arch-tag: 28c2436d-bb8d-486a-a8d7-5a4d9cae3513
;;; mh-tool-bar.el ends here