;;; printing.el --- printing utilities
;; Copyright (C) 2000, 2001, 2003, 2004, 2005,
-;; 2006 Free Software Foundation, Inc.
+;; 2006, 2007 Free Software Foundation, Inc.
;; 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>
;; Keywords: wp, print, PostScript
;; Version: 6.8.4
;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
;; 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
+;; Software Foundation; either version 3, or (at your option) any later
;; version.
;; GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY
;; 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/wiki/PsPrintPackage'.
;; Please, see README file for ps-print installation instructions.
;;
;; `printing' was inspired on:
;;
;; * 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/wiki/PsPrintPackage'
;;
;; * For GNU or Unix system:
;;
"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)))
"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)))
"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)))
"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)))
;; 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)
(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-add-item global-map menu-file
+ (easy-menu-create-menu "Print" pr-menu-spec)))
+ ))))))
(pr-update-menus t))
C-u 2 M-x pr-ps-fast-fire RET
The command prompts the user for a N-UP value, then for a current
PostScript printer and, finally, for a file name. Then change the active
- printer to that choosen by user and saves the PostScript image in
+ printer to that chosen by user and saves the PostScript image in
that file instead of sending it to the printer.
If it's an integer greater or equal to 2, the command prompts the user for a
current PostScript printer and for a file name. Then change the active
- printer to that choosen by user and saves the PostScript image in that file
+ printer to that chosen by user and saves the PostScript image in that file
instead of sending it to the printer.
If it's a symbol which it's defined in `pr-ps-printer-alist', it's the new
If FORCE is non-nil, update menus doesn't matter if `pr-ps-printer-alist',
`pr-txt-printer-alist' or `pr-ps-utility-alist' were modified or not;
-otherwise, update PostScript printer menu iff `pr-ps-printer-menu-modified' is
-non-nil, update text printer menu iff `pr-txt-printer-menu-modified' is
-non-nil, and update PostScript File menus iff `pr-ps-utility-menu-modified' is
+otherwise, update PostScript printer menu if `pr-ps-printer-menu-modified' is
+non-nil, update text printer menu if `pr-txt-printer-menu-modified' is
+non-nil, and update PostScript File menus if `pr-ps-utility-menu-modified' is
non-nil.
If menu binding was not done, calls `pr-menu-bind'."
;; 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)