X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/2db38a6f98c2abb42b746064ce97417cccc27e68..62f1ca498cf11a3fa9b707c115673ea7b298e957:/lisp/printing.el diff --git a/lisp/printing.el b/lisp/printing.el index 2cbf39f196..9f98c2b6e2 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -1,7 +1,6 @@ ;;; printing.el --- printing utilities -;; Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -;; Free Software Foundation, Inc. +;; Copyright (C) 2000-2001, 2003-2011 Free Software Foundation, Inc. ;; Author: Vinicius Jose Latorre ;; Maintainer: Vinicius Jose Latorre @@ -1387,20 +1386,6 @@ Used by `pr-menu-bind' and `pr-update-menus'.") (require 'easymenu)) ; to avoid compilation gripes (eval-and-compile - (cond - ;; GNU Emacs 20 - ((< emacs-major-version 21) - (defun pr-global-menubar (pr-menu-spec) - (require 'easymenu) - (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) - (setq pr-menu-print-item nil - pr-menu-bar (vector 'menu-bar 'tools - (pr-get-symbol "Printing"))))) - ) - ;; GNU Emacs 21 & 22 - (t (defun pr-global-menubar (pr-menu-spec) (require 'easymenu) (let ((menu-file (if (= emacs-major-version 21) @@ -1422,8 +1407,7 @@ Used by `pr-menu-bind' and `pr-update-menus'.") (t (easy-menu-add-item global-map menu-file (easy-menu-create-menu "Print" pr-menu-spec))) - ))) - ))) + )))) (eval-and-compile (cond @@ -3453,12 +3437,7 @@ See `pr-ps-printer-alist'.") (defun pr-menu-bind () "Install `printing' menu in the menubar. - -On Emacs 20, it replaces the Tools/Print menu by Tools/Printing menu. - -On Emacs 21 and 22, it replaces the File/Print* menu entries by File/Print -menu. - +This replaces the File/Print* menu entries with a File/Print sub-menu. Calls `pr-update-menus' to adjust menus." (interactive) (pr-global-menubar pr-menu-spec) @@ -4632,7 +4611,7 @@ bottom." ;;;###autoload (defun pr-toggle-region () - "Toggle auto region." + "Toggle whether the region is automagically detected." (interactive) (pr-toggle-region-menu t)) @@ -5367,102 +5346,119 @@ If menu binding was not done, calls `pr-menu-bind'." (defun pr-toggle-file-duplex-menu (&optional no-menu) + "Toggle whether to print PostScript files in duplex mode." (interactive) (pr-toggle 'pr-file-duplex "PS file duplex" nil 7 5 nil '("PostScript Print" "File") no-menu)) (defun pr-toggle-file-tumble-menu (&optional no-menu) + "Toggle whether to print PostScript files in tumble mode." (interactive) (pr-toggle 'pr-file-tumble "PS file tumble" nil 8 5 nil '("PostScript Print" "File") no-menu)) (defun pr-toggle-file-landscape-menu (&optional no-menu) + "Toggle whether to print PostScript files in landscape orientation." (interactive) (pr-toggle 'pr-file-landscape "PS file landscape" nil 6 5 nil '("PostScript Print" "File") no-menu)) (defun pr-toggle-ghostscript-menu (&optional no-menu) + "Toggle whether to print using ghostscript." (interactive) (pr-toggle 'pr-print-using-ghostscript "Printing using ghostscript" 'postscript-process 2 12 'toggle nil no-menu)) (defun pr-toggle-faces-menu (&optional no-menu) + "Toggle whether to print with face attributes." (interactive) (pr-toggle 'pr-faces-p "Printing with faces" 'postscript-process 1 12 'toggle nil no-menu)) (defun pr-toggle-spool-menu (&optional no-menu) + "Toggle whether to spool printing in a buffer." (interactive) (pr-toggle 'pr-spool-p "Spooling printing" 'postscript-process 0 12 'toggle nil no-menu)) (defun pr-toggle-duplex-menu (&optional no-menu) + "Toggle whether to generate PostScript for a two-sided printer." (interactive) (pr-toggle 'ps-spool-duplex "Printing duplex" 'postscript-options 5 12 'toggle nil no-menu)) (defun pr-toggle-tumble-menu (&optional no-menu) + "Toggle how pages on opposite sides of a sheet are oriented." (interactive) (pr-toggle 'ps-spool-tumble "Tumble" 'postscript-options 6 12 'toggle nil no-menu)) (defun pr-toggle-landscape-menu (&optional no-menu) + "Toggle whether to print in landscape mode." (interactive) (pr-toggle 'ps-landscape-mode "Landscape" 'postscript-options 0 12 'toggle nil no-menu)) (defun pr-toggle-upside-down-menu (&optional no-menu) + "Toggle whether to print upside-down (that is, rotated by 180 degrees)." (interactive) (pr-toggle 'ps-print-upside-down "Upside-Down" 'postscript-options 7 12 'toggle nil no-menu)) (defun pr-toggle-line-menu (&optional no-menu) + "Toggle whether to means print line numbers." (interactive) (pr-toggle 'ps-line-number "Line number" 'postscript-options 3 12 'toggle nil no-menu)) (defun pr-toggle-zebra-menu (&optional no-menu) + "Toggle whether to print zebra stripes." (interactive) (pr-toggle 'ps-zebra-stripes "Zebra stripe" 'postscript-options 4 12 'toggle nil no-menu)) (defun pr-toggle-header-menu (&optional no-menu) + "Toggle whether to print a header at the top of each page." (interactive) (pr-toggle 'ps-print-header "Print header" 'postscript-options 1 12 'toggle nil no-menu)) (defun pr-toggle-header-frame-menu (&optional no-menu) + "Toggle whether to draw a gaudy frame around the header." (interactive) (pr-toggle 'ps-print-header-frame "Print header frame" 'postscript-options 2 12 'toggle nil no-menu)) (defun pr-toggle-lock-menu (&optional no-menu) + "Toggle whether the menu is locked while selecting toggle options." (interactive) (pr-toggle 'pr-menu-lock "Menu lock" 'printing 2 12 'toggle nil no-menu)) (defun pr-toggle-region-menu (&optional no-menu) + "Toggle whether the region is automagically detected." (interactive) (pr-toggle 'pr-auto-region "Auto region" 'printing 0 12 'toggle nil no-menu)) (defun pr-toggle-mode-menu (&optional no-menu) + "Toggle whether major-mode specific printing is prefered over normal printing." (interactive) (pr-toggle 'pr-auto-mode "Auto mode" 'printing 1 12 'toggle nil no-menu)) @@ -5728,8 +5724,8 @@ If menu binding was not done, calls `pr-menu-bind'." (let* ((dir-name (file-name-directory (or (buffer-file-name) default-directory))) (fmt-prompt (concat "%s[" mess "] Directory to print: ")) - (dir (read-file-name (format fmt-prompt "") - "" dir-name nil dir-name)) + (dir (read-directory-name (format fmt-prompt "") + "" dir-name nil dir-name)) prompt) (while (cond ((not (file-directory-p dir)) (ding) @@ -5739,8 +5735,8 @@ If menu binding was not done, calls `pr-menu-bind'." (setq prompt "Directory is unreadable! ")) (t nil)) (setq dir-name (file-name-directory dir) - dir (read-file-name (format fmt-prompt prompt) - "" dir-name nil dir-name))) + dir (read-directory-name (format fmt-prompt prompt) + "" dir-name nil dir-name))) (file-name-as-directory dir))) @@ -6685,5 +6681,4 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order." (provide 'printing) -;; arch-tag: 9ce9ac3f-0f60-4370-900b-1943215d9d18 ;;; printing.el ends here