summaryrefslogtreecommitdiff
path: root/lisp/printing.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2006-11-06 15:13:24 +0000
committerChong Yidong <cyd@stupidchicken.com>2006-11-06 15:13:24 +0000
commit94bc59c3fa2e0eb65e2fc13087790d91f5b1654b (patch)
treee6f262c09e88ee1f8f2ce3a180f254ea29b48367 /lisp/printing.el
parent6a9b374e93801921321a922881787d82fd786c7b (diff)
downloademacs-94bc59c3fa2e0eb65e2fc13087790d91f5b1654b.tar.gz
(pr-alist-custom-set, pr-ps-utility-custom-set)
(pr-ps-name-custom-set, pr-txt-name-custom-set): Don't update the Printing menu if it's not initialized. (pr-menu-bind): Act on menu-bar-file-menu directly.
Diffstat (limited to 'lisp/printing.el')
-rw-r--r--lisp/printing.el36
1 files changed, 19 insertions, 17 deletions
diff --git a/lisp/printing.el b/lisp/printing.el
index 18252155e49..508d0bde585 100644
--- a/lisp/printing.el
+++ b/lisp/printing.el
@@ -1144,6 +1144,7 @@ If SUFFIX is non-nil, add that at the end of the file name."
"Set the value of custom variables for printer & utility selection."
(set symbol value)
(and (featurep 'printing) ; update only after printing is loaded
+ (not pr-menu-print-item)
(pr-update-menus t)))
@@ -1151,6 +1152,7 @@ If SUFFIX is non-nil, add that at the end of the file name."
"Update utility menu entry."
(set symbol value)
(and (featurep 'printing) ; update only after printing is loaded
+ (not pr-menu-print-item)
(pr-menu-set-utility-title value)))
@@ -1158,6 +1160,7 @@ If SUFFIX is non-nil, add that at the end of the file name."
"Update `PostScript Printer:' menu entry."
(set symbol value)
(and (featurep 'printing) ; update only after printing is loaded
+ (not pr-menu-print-item)
(pr-menu-set-ps-title value)))
@@ -1165,6 +1168,7 @@ If SUFFIX is non-nil, add that at the end of the file name."
"Update `Text Printer:' menu entry."
(set symbol value)
(and (featurep 'printing) ; update only after printing is loaded
+ (not pr-menu-print-item)
(pr-menu-set-txt-title value)))
@@ -3096,23 +3100,21 @@ Calls `pr-update-menus' to adjust menus."
(pr-get-symbol "Printing")))))
;; Emacs 21 & 22
(t
- (let* ((has-file (lookup-key global-map (vector 'menu-bar 'file)))
- (item-file (if has-file '("file") '("files"))))
- (cond
- (pr-menu-print-item
- (easy-menu-change item-file "Print" pr-menu-spec "print-buffer")
- (let ((items '("print-buffer" "print-region"
- "ps-print-buffer-faces" "ps-print-region-faces"
- "ps-print-buffer" "ps-print-region")))
- (while items
- (easy-menu-remove-item nil item-file (car items))
- (setq items (cdr items)))
- (setq pr-menu-print-item nil
- pr-menu-bar (vector 'menu-bar
- (if has-file 'file 'files)
- (pr-get-symbol "Print")))))
- (t
- (easy-menu-change item-file "Print" pr-menu-spec))))))))
+ (cond
+ (pr-menu-print-item
+ (easy-menu-add-item menu-bar-file-menu nil
+ (easy-menu-create-menu "Print" pr-menu-spec)
+ "print-buffer")
+ (dolist (item '("print-buffer" "print-region"
+ "ps-print-buffer-faces" "ps-print-region-faces"
+ "ps-print-buffer" "ps-print-region"))
+ (easy-menu-remove-item menu-bar-file-menu nil item))
+ (setq pr-menu-print-item nil
+ pr-menu-bar (vector 'menu-bar
+ 'file
+ (pr-get-symbol "Print"))))
+ (t
+ (easy-menu-change '("file") "Print" pr-menu-spec)))))))
(pr-update-menus t))