summaryrefslogtreecommitdiff
path: root/lisp/printing.el
diff options
context:
space:
mode:
authorVinicius Jose Latorre <viniciusjl@ig.com.br>2006-11-08 14:04:09 +0000
committerVinicius Jose Latorre <viniciusjl@ig.com.br>2006-11-08 14:04:09 +0000
commit0695be6f01b625daca0103266a63c446709cff8e (patch)
treef0ebd1ea31b16d75d495fda638ce0c82e87d3507 /lisp/printing.el
parentf8061cecca58d673955d0668f6b1ffd4f81ffb9b (diff)
downloademacs-0695be6f01b625daca0103266a63c446709cff8e.tar.gz
Fix Print submenu creation
Diffstat (limited to 'lisp/printing.el')
-rw-r--r--lisp/printing.el51
1 files changed, 26 insertions, 25 deletions
diff --git a/lisp/printing.el b/lisp/printing.el
index 508d0bde585..d99d6985af4 100644
--- a/lisp/printing.el
+++ b/lisp/printing.el
@@ -5,7 +5,7 @@
;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
-;; Time-stamp: <2006/09/15 18:53:14 vinicius>
+;; Time-stamp: <2006/11/08 12:01:50 vinicius>
;; Keywords: wp, print, PostScript
;; Version: 6.8.4
;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
@@ -68,7 +68,7 @@ Please send all bug fixes and enhancements to
;; interface to ps-print package and it also provides some extra stuff.
;;
;; To download the latest ps-print package see
-;; `http://www.cpqd.com.br/~vinicius/emacs/ps-print.tar.gz'.
+;; `http://www.emacswiki.org/cgi-bin/emacs/download/ps-print.tar.gz'.
;; Please, see README file for ps-print installation instructions.
;;
;; `printing' was inspired on:
@@ -958,8 +958,8 @@ Please send all bug fixes and enhancements to
;;
;; * For `printing' package:
;;
-;; printing `http://www.cpqd.com.br/~vinicius/emacs/printing.el.gz'
-;; ps-print `http://www.cpqd.com.br/~vinicius/emacs/ps-print.tar.gz'
+;; printing `http://www.emacswiki.org/cgi-bin/emacs/download/printing.el'
+;; ps-print `http://www.emacswiki.org/cgi-bin/emacs/download/ps-print.tar.gz'
;;
;; * For GNU or Unix system:
;;
@@ -1144,7 +1144,6 @@ 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)))
@@ -1152,7 +1151,6 @@ 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)))
@@ -1160,7 +1158,6 @@ 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)))
@@ -1168,7 +1165,6 @@ 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)))
@@ -3091,7 +3087,7 @@ Calls `pr-update-menus' to adjust menus."
;; third... time, but "print" item exists only in the first load.
(cond
;; Emacs 20
- ((string< emacs-version "21.")
+ ((< emacs-major-version 21)
(easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item)
(when pr-menu-print-item
(easy-menu-remove-item nil '("tools") pr-menu-print-item)
@@ -3100,21 +3096,24 @@ Calls `pr-update-menus' to adjust menus."
(pr-get-symbol "Printing")))))
;; Emacs 21 & 22
(t
- (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)))))))
+ (let ((menu-file (if (= emacs-major-version 21)
+ '("menu-bar" "files") ; Emacs 21
+ '("menu-bar" "file")))) ; Emacs 22 or higher
+ (cond
+ (pr-menu-print-item
+ (easy-menu-add-item global-map menu-file
+ (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 global-map menu-file item))
+ (setq pr-menu-print-item nil
+ pr-menu-bar (vector 'menu-bar
+ (pr-get-symbol (nth 1 menu-file))
+ (pr-get-symbol "Print"))))
+ (t
+ (easy-menu-change (cdr menu-file) "Print" pr-menu-spec))))))))
(pr-update-menus t))
@@ -6056,7 +6055,9 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order."
;; header
(let ((versions (concat "printing v" pr-version
" ps-print v" ps-print-version)))
- (widget-insert (make-string (- 79 (length versions)) ?\s) versions))
+ ;; to keep compatibility with Emacs 20 & 21:
+ ;; DO NOT REPLACE `?\ ' BY `?\s'
+ (widget-insert (make-string (- 79 (length versions)) ?\ ) versions))
(pr-insert-italic "\nCurrent Directory : " 1)
(pr-insert-italic default-directory)