comparison lisp/printing.el @ 58164:4db6f3a44cd6

fix to use new easymenu
author Vinicius Jose Latorre <viniciusjl@ig.com.br>
date Fri, 12 Nov 2004 02:14:03 +0000
parents a93efc8bd56c
children 687bb63efa9d cb7f41387eb3
comparison
equal deleted inserted replaced
58163:7048d946d9df 58164:4db6f3a44cd6
3 ;; Copyright (C) 2000, 2001, 2002, 2003, 2004 3 ;; Copyright (C) 2000, 2001, 2002, 2003, 2004
4 ;; Free Software Foundation, Inc. 4 ;; Free Software Foundation, Inc.
5 5
6 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> 6 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
7 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> 7 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
8 ;; Time-stamp: <2004/09/26 22:11:24 vinicius> 8 ;; Time-stamp: <2004/11/11 23:54:13 vinicius>
9 ;; Keywords: wp, print, PostScript 9 ;; Keywords: wp, print, PostScript
10 ;; Version: 6.8.1 10 ;; Version: 6.8.2
11 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ 11 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
12 12
13 (defconst pr-version "6.8.1" 13 (defconst pr-version "6.8.2"
14 "printing.el, v 6.8.1 <2004/09/26 vinicius> 14 "printing.el, v 6.8.2 <2004/11/11 vinicius>
15 15
16 Please send all bug fixes and enhancements to 16 Please send all bug fixes and enhancements to
17 Vinicius Jose Latorre <viniciusjl@ig.com.br> 17 Vinicius Jose Latorre <viniciusjl@ig.com.br>
18 ") 18 ")
19 19
1097 (defgroup printing nil 1097 (defgroup printing nil
1098 "Printing Utilities group" 1098 "Printing Utilities group"
1099 :tag "Printing Utilities" 1099 :tag "Printing Utilities"
1100 :link '(emacs-library-link :tag "Source Lisp File" "printing.el") 1100 :link '(emacs-library-link :tag "Source Lisp File" "printing.el")
1101 :prefix "pr-" 1101 :prefix "pr-"
1102 :version "20"
1102 :group 'wp 1103 :group 'wp
1103 :group 'postscript) 1104 :group 'postscript)
1104 1105
1105 1106
1106 (defcustom pr-path-style 1107 (defcustom pr-path-style
2472 (and pr-print-using-ghostscript (not pr-spool-p))) 2473 (and pr-print-using-ghostscript (not pr-spool-p)))
2473 2474
2474 2475
2475 (eval-and-compile 2476 (eval-and-compile
2476 (defun pr-get-symbol (name) 2477 (defun pr-get-symbol (name)
2477 (or (intern-soft name) 2478 (easy-menu-intern name))
2478 (make-symbol name)))
2479 2479
2480 (cond 2480 (cond
2481 ((eq ps-print-emacs-type 'emacs) ; GNU Emacs 2481 ((eq ps-print-emacs-type 'emacs) ; GNU Emacs
2482 (defsubst pr-region-active-p () 2482 (defun pr-region-active-p ()
2483 (and pr-auto-region transient-mark-mode mark-active))) 2483 (and pr-auto-region transient-mark-mode mark-active)))
2484 2484
2485 ((eq ps-print-emacs-type 'xemacs) ; XEmacs 2485 ((eq ps-print-emacs-type 'xemacs) ; XEmacs
2486 (defvar zmacs-region-stays nil) ; to avoid compilation gripes 2486 (defvar zmacs-region-stays nil) ; to avoid compilation gripes
2487 (defsubst pr-region-active-p () 2487 (defun pr-region-active-p ()
2488 (and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p))))) 2488 (and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p)))))
2489 2489
2490 2490
2491 (defconst pr-menu-spec 2491 (defconst pr-menu-spec
2492 (cond 2492 (cond
2902 (setq pr-menu-print-item nil 2902 (setq pr-menu-print-item nil
2903 pr-menu-bar (vector 'menu-bar 'tools 2903 pr-menu-bar (vector 'menu-bar 'tools
2904 (pr-get-symbol "Printing"))))) 2904 (pr-get-symbol "Printing")))))
2905 ;; Emacs 21 2905 ;; Emacs 21
2906 (pr-menu-print-item 2906 (pr-menu-print-item
2907 (easy-menu-change '("files") "Print" pr-menu-spec "print-buffer") 2907 (easy-menu-change '("file") "Print" pr-menu-spec "print-buffer")
2908 (let ((items '("print-buffer" "print-region" 2908 (let ((items '("print-buffer" "print-region"
2909 "ps-print-buffer-faces" "ps-print-region-faces" 2909 "ps-print-buffer-faces" "ps-print-region-faces"
2910 "ps-print-buffer" "ps-print-region"))) 2910 "ps-print-buffer" "ps-print-region")))
2911 (while items 2911 (while items
2912 (easy-menu-remove-item nil '("files") (car items)) 2912 (easy-menu-remove-item nil '("file") (car items))
2913 (setq items (cdr items))) 2913 (setq items (cdr items)))
2914 (setq pr-menu-print-item nil 2914 (setq pr-menu-print-item nil
2915 pr-menu-bar (vector 'menu-bar 'files 2915 pr-menu-bar (vector 'menu-bar 'file
2916 (pr-get-symbol "Print"))))) 2916 (pr-get-symbol "Print")))))
2917 (t 2917 (t
2918 (easy-menu-change '("files") "Print" pr-menu-spec))) 2918 (easy-menu-change '("file") "Print" pr-menu-spec)))
2919 2919
2920 ;; Key binding 2920 ;; Key binding
2921 (global-set-key [print] 'pr-ps-fast-fire) 2921 (global-set-key [print] 'pr-ps-fast-fire)
2922 (global-set-key [M-print] 'pr-ps-mode-using-ghostscript) 2922 (global-set-key [M-print] 'pr-ps-mode-using-ghostscript)
2923 (global-set-key [C-print] 'pr-txt-fast-fire)) 2923 (global-set-key [C-print] 'pr-txt-fast-fire))