diff options
| author | Chong Yidong | 2006-11-06 15:13:24 +0000 |
|---|---|---|
| committer | Chong Yidong | 2006-11-06 15:13:24 +0000 |
| commit | a6d583c00a8079c98000fdc80c870f7cdcc9f291 (patch) | |
| tree | 99beeb4822ccede6b1b7c59984caa19795b105a1 | |
| parent | b734d8ea4cddcf3b0066aa09638be36b33ee191a (diff) | |
| download | emacs-a6d583c00a8079c98000fdc80c870f7cdcc9f291.tar.gz emacs-a6d583c00a8079c98000fdc80c870f7cdcc9f291.zip | |
(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.
| -rw-r--r-- | lisp/printing.el | 36 |
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." | |||
| 1144 | "Set the value of custom variables for printer & utility selection." | 1144 | "Set the value of custom variables for printer & utility selection." |
| 1145 | (set symbol value) | 1145 | (set symbol value) |
| 1146 | (and (featurep 'printing) ; update only after printing is loaded | 1146 | (and (featurep 'printing) ; update only after printing is loaded |
| 1147 | (not pr-menu-print-item) | ||
| 1147 | (pr-update-menus t))) | 1148 | (pr-update-menus t))) |
| 1148 | 1149 | ||
| 1149 | 1150 | ||
| @@ -1151,6 +1152,7 @@ If SUFFIX is non-nil, add that at the end of the file name." | |||
| 1151 | "Update utility menu entry." | 1152 | "Update utility menu entry." |
| 1152 | (set symbol value) | 1153 | (set symbol value) |
| 1153 | (and (featurep 'printing) ; update only after printing is loaded | 1154 | (and (featurep 'printing) ; update only after printing is loaded |
| 1155 | (not pr-menu-print-item) | ||
| 1154 | (pr-menu-set-utility-title value))) | 1156 | (pr-menu-set-utility-title value))) |
| 1155 | 1157 | ||
| 1156 | 1158 | ||
| @@ -1158,6 +1160,7 @@ If SUFFIX is non-nil, add that at the end of the file name." | |||
| 1158 | "Update `PostScript Printer:' menu entry." | 1160 | "Update `PostScript Printer:' menu entry." |
| 1159 | (set symbol value) | 1161 | (set symbol value) |
| 1160 | (and (featurep 'printing) ; update only after printing is loaded | 1162 | (and (featurep 'printing) ; update only after printing is loaded |
| 1163 | (not pr-menu-print-item) | ||
| 1161 | (pr-menu-set-ps-title value))) | 1164 | (pr-menu-set-ps-title value))) |
| 1162 | 1165 | ||
| 1163 | 1166 | ||
| @@ -1165,6 +1168,7 @@ If SUFFIX is non-nil, add that at the end of the file name." | |||
| 1165 | "Update `Text Printer:' menu entry." | 1168 | "Update `Text Printer:' menu entry." |
| 1166 | (set symbol value) | 1169 | (set symbol value) |
| 1167 | (and (featurep 'printing) ; update only after printing is loaded | 1170 | (and (featurep 'printing) ; update only after printing is loaded |
| 1171 | (not pr-menu-print-item) | ||
| 1168 | (pr-menu-set-txt-title value))) | 1172 | (pr-menu-set-txt-title value))) |
| 1169 | 1173 | ||
| 1170 | 1174 | ||
| @@ -3096,23 +3100,21 @@ Calls `pr-update-menus' to adjust menus." | |||
| 3096 | (pr-get-symbol "Printing"))))) | 3100 | (pr-get-symbol "Printing"))))) |
| 3097 | ;; Emacs 21 & 22 | 3101 | ;; Emacs 21 & 22 |
| 3098 | (t | 3102 | (t |
| 3099 | (let* ((has-file (lookup-key global-map (vector 'menu-bar 'file))) | 3103 | (cond |
| 3100 | (item-file (if has-file '("file") '("files")))) | 3104 | (pr-menu-print-item |
| 3101 | (cond | 3105 | (easy-menu-add-item menu-bar-file-menu nil |
| 3102 | (pr-menu-print-item | 3106 | (easy-menu-create-menu "Print" pr-menu-spec) |
| 3103 | (easy-menu-change item-file "Print" pr-menu-spec "print-buffer") | 3107 | "print-buffer") |
| 3104 | (let ((items '("print-buffer" "print-region" | 3108 | (dolist (item '("print-buffer" "print-region" |
| 3105 | "ps-print-buffer-faces" "ps-print-region-faces" | 3109 | "ps-print-buffer-faces" "ps-print-region-faces" |
| 3106 | "ps-print-buffer" "ps-print-region"))) | 3110 | "ps-print-buffer" "ps-print-region")) |
| 3107 | (while items | 3111 | (easy-menu-remove-item menu-bar-file-menu nil item)) |
| 3108 | (easy-menu-remove-item nil item-file (car items)) | 3112 | (setq pr-menu-print-item nil |
| 3109 | (setq items (cdr items))) | 3113 | pr-menu-bar (vector 'menu-bar |
| 3110 | (setq pr-menu-print-item nil | 3114 | 'file |
| 3111 | pr-menu-bar (vector 'menu-bar | 3115 | (pr-get-symbol "Print")))) |
| 3112 | (if has-file 'file 'files) | 3116 | (t |
| 3113 | (pr-get-symbol "Print"))))) | 3117 | (easy-menu-change '("file") "Print" pr-menu-spec))))))) |
| 3114 | (t | ||
| 3115 | (easy-menu-change item-file "Print" pr-menu-spec)))))))) | ||
| 3116 | (pr-update-menus t)) | 3118 | (pr-update-menus t)) |
| 3117 | 3119 | ||
| 3118 | 3120 | ||