• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +defs:buffer +defs:menu

51 ;;      The `printing' menu replaces the usual print options in the menu bar.
55 ;; You can use a buffer interface instead of menus. It looks like a
56 ;; customization buffer. Basically, it has the same options found in the
57 ;; menu and some extra options, all this on a buffer.
66 ;; spool and to despool PostScript buffer. So, `printing' provides an
91 ;; The buffer *Printing Command Output* is where the `printing' log messages
93 ;; buffer *Printing Command Output*. A log entry has the following form:
119 ;; So, if something goes wrong, a good place to take a look is the buffer
120 ;; *Printing Command Output*. Don't forget to see also the buffer *Messages*,
209 ;; 1. Open a buffer (or use the *scratch* buffer).
214 ;; 3. Print this buffer with duplex turned on.
234 ;; 3. Don't try to print a dynamic buffer, that is, a buffer which is
236 ;; message. Instead, save the dynamic buffer to a file or copy it in
237 ;; another buffer and, then, print the file or the new static buffer.
238 ;; An example of dynamic buffer is the *Messages* buffer.
311 ;; it replaces the Tools/Print menu by Tools/Printing menu.
313 ;; it replaces the File/Print* menu entries by File/Print menu.
314 ;; Please, see section Menu Layout below for menu explanation.
316 ;; To use `printing' utilities you can use the Printing menu options, type M-x
327 ;; pr-ps-buffer-preview
328 ;; pr-ps-buffer-using-ghostscript
329 ;; pr-ps-buffer-print
330 ;; pr-ps-buffer-ps-print
351 ;; pr-printify-buffer
354 ;; pr-txt-buffer
387 ;; `pr-interface' buffer interface for printing package.
396 ;; `pr-despool-*' despool the PostScript spooling buffer.
412 ;; `*-buffer*' process a buffer.
420 ;; `pr-ps-buffer-using-ghostscript'
421 ;; Use ghostscript to print a buffer.
427 ;; Toggle spooling buffer.
433 ;; Besides operating one buffer or region each time, you also can postpone
435 ;; temporary Emacs buffer. This way you can save banner pages between
437 ;; `pr-toggle-spool' interactively or through menu bar.
441 ;; C-u M-x pr-ps-buffer-print RET
443 ;; The `pr-ps-buffer-print' command prompts you for a n-up printing number and
462 ;; you're in the *Summary* buffer, if you forget to switch to the *Article*
463 ;; buffer before printing, you'll get a nicely formatted list of article
465 ;; to switch from gnus *Summary* buffer first.
486 ;; (global-set-key "\C-cbp" 'pr-ps-buffer-print)
487 ;; (global-set-key "\C-cbx" 'pr-ps-buffer-preview)
488 ;; (global-set-key "\C-cbb" 'pr-ps-buffer-using-ghostscript)
538 ;; `pr-spool-p' Non-nil means spool printing in a buffer.
562 ;; `pr-menu-lock' Non-nil means menu is locked while selecting
565 ;; `pr-menu-char-height' Specify menu char height in pixels.
567 ;; `pr-menu-char-width' Specify menu char width in pixels.
571 ;; `pr-visible-entry-list' Specify a list of Printing menu visible
579 ;; `pr-buffer-name' Specify the name of the buffer interface for
582 ;; `pr-buffer-name-ignore' Specify a regexp list for buffer names to be
583 ;; ignored in interface buffer.
585 ;; `pr-buffer-verbose' Non-nil means to be verbose when editing a
586 ;; field in interface buffer.
604 ;; click on menu-bar *Help* option,
629 ;; f) or use menu bar, for example:
630 ;; click on menu-bar *File* option,
642 ;; The `printing' menu (Tools/Printing or File/Print) has the following layout:
679 ;; See `pr-visible-entry-list' for hiding some parts of the menu.
681 ;; The menu has the following sections:
685 ;; 0. You can use a buffer interface instead of menus. It looks like the
686 ;; customization buffer. Basically, it has the same options found in the
687 ;; menu and some extra options, all this on a buffer.
692 ;; menu) or PostScript temporary file for a directory, a buffer, a region
697 ;; Instead of previewing each buffer, region or major mode at once, you
698 ;; can save temporarily the PostScript code generated in a buffer and
700 ;; spooling buffer in a temporary file and uses ghostview to preview it.
709 ;; `*-mode*' commands or select Mode option in Printing menu. An
711 ;; or rmail, etc.) and you're in the *Summary* buffer, if you
712 ;; forget to switch to the *Article* buffer before printing,
715 ;; switch from gnus *Summary* buffer first.
737 ;; temporarily in a buffer instead of printing it or saving it in a file.
739 ;; of printing each buffer, region or major mode at once, you can save
740 ;; temporarily the PostScript code generated in a buffer and print it
742 ;; buffer directly on a printer. If you type C-u before choosing this
756 ;; buffer and you want to print them in a text printer, select this
757 ;; option. All control characters in your buffer or region will be
764 ;; 5. If you want to print a directory, buffer, region or major mode in a
822 ;; mode. When this option is on, the `*-buffer*' commands will behave
823 ;; like `*-region*' commands, that is, `*-buffer*' commands will print
824 ;; only the region marked instead of all buffer.
827 ;; declared in `pr-mode-alist', the `*-buffer*' and `*-region*' commands
830 ;; 21. If you want that Printing menu stays open while you are setting
832 ;; `pr-menu-char-height' and `pr-menu-char-width' are used to guess the
833 ;; menu position, so don't forget to adjust these variables if menu
845 ;; 24. Quick help for printing menu layout.
953 ;; `pr-menu-bind' Install `printing' menu in the menubar.
984 ;; printing menu (in `pr-menu-spec') merging suggestion.
1004 ;; - menu entry hiding.
1010 ;; - Tools/Printing menu.
1104 (defalias 'pr-x-find-menu-item 'find-menu-item)
1107 (defalias 'pr-x-get-popup-menu-response 'get-popup-menu-response)
1110 (defalias 'pr-x-relabel-menu-item 'relabel-menu-item)
1150 "Update utility menu entry."
1153 (pr-menu-set-utility-title value)))
1157 "Update `PostScript Printer:' menu entry."
1160 (pr-menu-set-ps-title value)))
1164 "Update `Text Printer:' menu entry."
1167 (pr-menu-set-txt-title value)))
1307 (choice :menu-tag "Directory"
1323 function (see it for documentation) to update text printer menu."
1356 `pr-txt-name' variable setting and for menu selection.
1411 function (see it for documentation) to update text printer menu.
1454 (choice :menu-tag "Printer Name"
1471 function (see it for documentation) to update PostScript printer menu."
1509 `pr-ps-name' variable setting and for menu selection.
1613 function (see it for documentation) to update PostScript printer menu.
1711 (choice :menu-tag "Printer Name Switch"
1715 (choice :menu-tag "Printer Name"
1725 :menu-tag "Variable"
1957 "*Non-nil means spool printing in a buffer."
1994 When this variable is non-nil, the `*-buffer*' commands will behave like
1995 `*-region*' commands, that is, `*-buffer*' commands will print only the region
1996 marked instead of all buffer."
2005 That is, if current major-mode is declared in `pr-mode-alist', the `*-buffer*'
2007 `*-buffer*' commands will print the current buffer and `*-region*' commands
2015 '((mh-folder-mode ; mh summary buffer
2022 (mh-letter-mode ; mh letter buffer
2029 (rmail-summary-mode ; rmail summary buffer
2032 (ps-article-subject ps-article-author buffer-name)
2036 (rmail-mode ; rmail buffer
2039 (ps-article-subject ps-article-author buffer-name)
2043 (gnus-summary-mode ; gnus summary buffer
2050 (gnus-article-mode ; gnus article buffer
2057 (Info-mode ; Info buffer
2067 (ps-article-subject ps-article-author buffer-name)
2077 *Summary* buffer, if you forget to switch to the *Article* buffer before
2080 *Summary* buffer first.
2100 Usually LPR-PRINT function prepares the environment or buffer
2102 process the buffer and send it to text printer.
2117 Usually PS-PRINT function prepares the environment or buffer
2119 process the buffer and send it to PostScript printer.
2142 Non-nil means to kill all buffer local variable declared in
2171 (choice :menu-tag "Number of Header Lines"
2176 (choice :menu-tag "Left Header"
2180 (choice :menu-tag "Right Header"
2190 :menu-tag "Variable"
2223 function (see it for documentation) to update PostScript utility menu.
2258 `pr-ps-utility' variable setting and for menu selection.
2348 function (see it for documentation) to update PostScript utility menu.
2401 (choice :menu-tag "Paper Size"
2405 (choice :menu-tag "N-Up"
2409 (choice :menu-tag "Landscape"
2413 (choice :menu-tag "Duplex"
2417 (choice :menu-tag "Tumble"
2430 :menu-tag "Variable"
2446 (defcustom pr-menu-lock t
2447 "*Non-nil means menu is locked while selecting toggle options.
2449 See also `pr-menu-char-height' and `pr-menu-char-width'."
2455 (defcustom pr-menu-char-height
2460 "*Specify menu char height in pixels.
2463 menu, so don't forget to adjust it if menu position is not ok.
2465 See also `pr-menu-lock' and `pr-menu-char-width'."
2471 (defcustom pr-menu-char-width
2476 "*Specify menu char width in pixels.
2479 menu, so don't forget to adjust it if menu position is not ok.
2481 See also `pr-menu-lock' and `pr-menu-char-height'."
2538 declared local buffer.
2568 (choice :menu-tag "Inheritance"
2580 :menu-tag "Variable"
2606 "*Specify a list of Printing menu visible entries.
2608 Valid values with the corresponding menu parts are:
2646 (choice :menu-tag "Menu Part"
2684 (defcustom pr-buffer-name "*Printing Interface*"
2685 "*Specify the name of the buffer interface for printing package.
2693 (defcustom pr-buffer-name-ignore
2694 (list (regexp-quote pr-buffer-name) ; ignore printing interface buffer
2696 "*Specify a regexp list for buffer names to be ignored in interface buffer.
2707 (defcustom pr-buffer-verbose t
2708 "*Non-nil means to be verbose when editing a field in interface buffer.
2755 (defvar pr-menu-bar nil
2756 "Specify Printing menu-bar entry.")
2777 (let ((temp (get-buffer-create (make-temp-name " *Temp"))))
2779 (set-buffer temp)
2781 (kill-buffer temp))))
2801 (if (fboundp 'easy-menu-intern) ; hacked from easymenu.el
2802 'easy-menu-intern
2816 (defconst pr-menu-spec
2831 pr-:help "Use buffer interface instead of menu interface")]
2841 :keys "\\[pr-ps-buffer-preview]"])
2843 ["1-up" (pr-ps-buffer-preview 1 t) t]
2844 ["2-up" (pr-ps-buffer-preview 2 t) t]
2845 ["4-up" (pr-ps-buffer-preview 4 t) t]
2846 ["Other..." (pr-ps-buffer-preview nil t)
2847 :keys "\\[pr-ps-buffer-preview]"])
2876 ["Landscape" pr-toggle-file-landscape-menu
2881 ["Duplex" pr-toggle-file-duplex-menu
2886 ["Tumble" pr-toggle-file-tumble-menu
2894 pr-:help "Despool PostScript buffer to printer or file (C-u)")])
2903 :keys "\\[pr-ps-buffer-ps-print]"])
2905 ["1-up" (pr-ps-buffer-ps-print 1 t) t]
2906 ["2-up" (pr-ps-buffer-ps-print 2 t) t]
2907 ["4-up" (pr-ps-buffer-ps-print 4 t) t]
2908 ["Other..." (pr-ps-buffer-ps-print nil t)
2909 :keys "\\[pr-ps-buffer-ps-print]"])
2938 ["Landscape" pr-toggle-file-landscape-menu
2943 ["Duplex" pr-toggle-file-duplex-menu
2948 ["Tumble" pr-toggle-file-tumble-menu
2956 pr-:help "Despool PostScript buffer to printer or file (C-u)")])
2967 ["Buffer" pr-printify-buffer t]
2973 ["Buffer" pr-txt-buffer t]
2981 ["Landscape" pr-toggle-landscape-menu
2984 ["Print Header" pr-toggle-header-menu
2987 ["Print Header Frame" pr-toggle-header-frame-menu
2990 ["Line Number" pr-toggle-line-menu
2993 ["Zebra Stripes" pr-toggle-zebra-menu
2996 ["Duplex" pr-toggle-duplex-menu
2999 ["Tumble" pr-toggle-tumble-menu
3002 ["Upside-Down" pr-toggle-upside-down-menu
3019 ["Spool Buffer" pr-toggle-spool-menu
3024 ["Print with faces" pr-toggle-faces-menu
3029 ["Print via Ghostscript" pr-toggle-ghostscript-menu
3035 ["Auto Region" pr-toggle-region-menu
3038 ["Auto Mode" pr-toggle-mode-menu
3041 ["Menu Lock" pr-toggle-lock-menu
3042 :style toggle :selected pr-menu-lock
3057 (defvar pr-menu-print-item "print"
3058 "Non-nil means that menu binding was not done.
3060 Used by `pr-menu-bind' and `pr-update-menus'.")
3063 (defun pr-menu-bind ()
3064 "Install `printing' menu in the menubar.
3066 On Emacs 20, it replaces the Tools/Print menu by Tools/Printing menu.
3068 On Emacs 21 and 22, it replaces the File/Print* menu entries by File/Print
3069 menu.
3077 (pr-x-add-submenu nil (cons "Printing" pr-menu-spec) "Apps"))
3078 (setq pr-menu-print-item nil))
3090 (easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item)
3091 (when pr-menu-print-item
3092 (easy-menu-remove-item nil '("tools") pr-menu-print-item)
3093 (setq pr-menu-print-item nil
3094 pr-menu-bar (vector 'menu-bar 'tools
3098 (let ((menu-file (if (= emacs-major-version 21)
3099 '("menu-bar" "files") ; Emacs 21
3100 '("menu-bar" "file")))) ; Emacs 22 or higher
3102 (pr-menu-print-item
3103 (easy-menu-add-item global-map menu-file
3104 (easy-menu-create-menu "Print" pr-menu-spec)
3105 "print-buffer")
3106 (dolist (item '("print-buffer" "print-region"
3107 "ps-print-buffer-faces" "ps-print-region-faces"
3108 "ps-print-buffer" "ps-print-region"))
3109 (easy-menu-remove-item global-map menu-file item))
3110 (setq pr-menu-print-item nil
3111 pr-menu-bar (vector 'menu-bar
3112 (pr-get-symbol (nth 1 menu-file))
3115 (easy-menu-add-item global-map menu-file
3116 (easy-menu-create-menu "Print" pr-menu-spec)))
3138 ;;;(global-set-key "\C-cbp" 'pr-ps-buffer-print)
3139 ;;;(global-set-key "\C-cbx" 'pr-ps-buffer-preview)
3140 ;;;(global-set-key "\C-cbb" 'pr-ps-buffer-using-ghostscript)
3157 The `printing' menu (Tools/Printing or File/Print) has the following layout:
3194 See `pr-visible-entry-list' for hiding some parts of the menu.
3196 The menu has the following sections:
3200 0. You can use a buffer interface instead of menus. It looks like the
3201 customization buffer. Basically, it has the same options found in the
3202 menu and some extra options, all this on a buffer.
3207 menu) or PostScript temporary file for a directory, a buffer, a region
3212 Instead of previewing each buffer, region or major mode at once, you
3213 can save temporarily the PostScript code generated in a buffer and
3215 spooling buffer in a temporary file and uses ghostview to preview it.
3223 `*-mode*' commands or select Mode option in Printing menu. An
3225 or rmail, etc.) and you're in the *Summary* buffer, if you
3226 forget to switch to the *Article* buffer before printing,
3229 switch from gnus *Summary* buffer first.
3250 temporarily in a buffer instead of printing it or saving it in a file.
3252 Instead of printing each buffer, region or major mode at once, you can
3253 save temporarily the PostScript code generated in a buffer and print it
3254 later. The option `Despool...' despools the PostScript spooling buffer
3269 buffer and you want to print them in a text printer, select this
3270 option. All control characters in your buffer or region will be
3277 5. If you want to print a directory, buffer, region or major mode in a
3335 mode. When this option is on, the `*-buffer*' commands will behave
3336 like `*-region*' commands, that is, `*-buffer*' commands will print
3337 only the region marked instead of all buffer.
3340 declared in `pr-mode-alist', the `*-buffer*' and `*-region*' commands
3343 21. If you want that Printing menu stays open while you are setting
3345 `pr-menu-char-height' and `pr-menu-char-width' are used to guess the
3346 menu position, so don't forget to adjust these variables if menu
3358 24. Quick help for printing menu layout.
3367 The printing interface buffer has the same functionality as the printing menu.
3369 file, n-up printing, etc.) are set and saved between priting buffer
3371 PostScript file and directory/buffer/region/mode processing; using menu, there
3372 are different value sets for PostScript file and directory/buffer/region/mode
3375 The printing interface buffer has the following sections:
3379 Here you can choose to print/preview a buffer, a directory or a PostScript
3385 Select a buffer from the current buffer list.
3388 If it's on, this means that the selected buffer has an active region,
3390 If it's off when a buffer is selected, this means that the selected
3391 buffer has no active region, so it'll not be possible to turn it on.
3393 If you want to process the whole buffer, let this option off.
3396 If it's on, this means that the selected buffer major mode is declared
3398 If it's off when a buffer is selected, this means that the selected
3399 buffer major mode isn't declared for major mode processing, so it'll
3406 `*-mode*' commands or select Mode option in Printing menu. An
3408 or rmail, etc.) and you're in the *Summary* buffer, if you
3409 forget to switch to the *Article* buffer before printing,
3412 switch from gnus *Summary* buffer first.
3454 If it's turned on, specify to despools the PostScript spooling buffer in
3465 Quit from printing interface buffer.
3486 buffer and you want to print them in a text printer, select this
3487 option. All control characters in your buffer or region will be
3495 To print a directory, buffer, region or major mode in a
3499 Quit from printing interface buffer.
3538 mode. When this option is on, the `*-buffer*' commands will behave
3539 like `*-region*' commands, that is, `*-buffer*' commands will print
3540 only the region marked instead of all buffer.
3544 declared in `pr-mode-alist', the `*-buffer*' and `*-region*' commands
3548 If you want that Printing menu stays open while you are setting
3550 `pr-menu-char-height' and `pr-menu-char-width' are used to guess the
3551 menu position, so don't forget to adjust these variables if menu
3577 That is, to be verbose when editing a field in interface buffer.
3591 Quick help for printing interface buffer and printing menu layout. You can
3592 also quit the printing interface buffer or kill all printing help buffer.
3594 "Printing buffer interface help message.")
3602 (defun pr-interface (&optional buffer)
3603 "Activate the printing interface buffer.
3605 If BUFFER is nil, the current buffer is used for printing.
3610 (set-buffer (or buffer (current-buffer)))
3721 (defun pr-ps-buffer-preview (n-up &optional filename)
3722 "Preview buffer using ghostview.
3740 (defun pr-ps-buffer-using-ghostscript (n-up &optional filename)
3741 "Print buffer using PostScript through ghostscript.
3759 (defun pr-ps-buffer-print (n-up &optional filename)
3760 "Print buffer using PostScript printer.
3778 (defun pr-ps-buffer-ps-print (n-up &optional filename)
3779 "Print buffer using PostScript printer or through ghostscript.
3807 See also `pr-ps-buffer-preview'."
3819 See also `pr-ps-buffer-using-ghostscript'."
3831 See also `pr-ps-buffer-print'."
3843 See also `pr-ps-buffer-ps-print'."
3859 See also `pr-ps-buffer-preview'."
3872 See also `pr-ps-buffer-using-ghostscript'."
3886 See also `pr-ps-buffer-print'."
3896 See also `pr-ps-buffer-ps-print'."
3918 (pr-file-list dir file-regexp 'pr-printify-buffer))
3922 (defun pr-printify-buffer ()
3923 "Replace nonprinting characters in buffer with printable representations.
3954 (pr-file-list dir file-regexp 'pr-txt-buffer))
3958 (defun pr-txt-buffer ()
3959 "Print buffer using text printer."
4112 (let ((ps-spool-buffer (get-buffer-create ps-spool-buffer-name)))
4114 (set-buffer ps-spool-buffer)
4115 (erase-buffer)
4177 (pr-toggle-file-duplex-menu t))
4189 (pr-toggle-file-tumble-menu t))
4196 (pr-toggle-file-landscape-menu t))
4203 (pr-toggle-ghostscript-menu t))
4210 (pr-toggle-faces-menu t))
4217 (pr-toggle-spool-menu t))
4224 (pr-toggle-duplex-menu t))
4236 (pr-toggle-tumble-menu t))
4243 (pr-toggle-landscape-menu t))
4250 (pr-toggle-upside-down-menu t))
4257 (pr-toggle-line-menu t))
4264 (pr-toggle-zebra-menu t))
4271 (pr-toggle-header-menu t))
4278 (pr-toggle-header-frame-menu t))
4283 "Toggle menu lock."
4285 (pr-toggle-lock-menu t))
4292 (pr-toggle-region-menu t))
4299 (pr-toggle-mode-menu t))
4327 (pr-menu-set-ps-title
4336 (pr-menu-set-txt-title
4345 (pr-menu-set-utility-title
4379 If a region is active, the region will be printed instead of the whole buffer.
4381 `pr-mode-alist' will be used, that is, the current buffer or region will be
4446 (pr-menu-set-ps-title select))
4455 (pr-ps-buffer-ps-print
4466 If a region is active, the region will be printed instead of the whole buffer.
4468 `pr-mode-alist' will be used, that is, the current buffer or region will be
4490 (pr-menu-set-txt-title select-printer))
4495 (pr-txt-buffer)))
4506 One way to see `printing' setup is to switch to a *Scratch* buffer and type:
4510 Or choose the menu option Printing/Show Settings/printing."
4566 '(20 . pr-menu-lock)
4567 '(20 . pr-menu-char-height)
4568 '(20 . pr-menu-char-width)
4574 '(22 . pr-buffer-verbose)
4575 '(22 . pr-buffer-name)
4576 '(22 . pr-buffer-name-ignore)
4585 One way to see `lpr' setup is to switch to a *Scratch* buffer and type:
4589 Or choose the menu option Printing/Show Settings/lpr."
4616 (defvar mh-show-buffer nil)
4620 "Find the date of an article or mail message in current buffer.
4626 (buffer-substring (match-beginning 1) (match-end 1))
4634 (set-buffer mh-show-buffer)
4669 'rmail-buffer 'rmail-summary-buffer))
4675 'rmail-buffer 'rmail-summary-buffer))
4679 summary-buffer summary-default)
4681 (let ((buf (or (and (boundp summary-buffer)
4682 (symbol-value summary-buffer))
4684 (and (get-buffer buf)
4686 (set-buffer buf)
4690 (defun pr-lpr-message-from-summary (header-list summary-buffer summary-default)
4692 (let ((buf (or (and (boundp summary-buffer)
4693 (symbol-value summary-buffer))
4695 (and (get-buffer buf)
4697 (set-buffer buf)
4711 'gnus-article-buffer 'pr-gnus-article))
4717 'gnus-article-buffer 'pr-gnus-article))
4730 'vm-mail-buffer 'pr-vm-summary))
4736 'vm-mail-buffer 'pr-vm-summary))
4802 (defconst pr-menu-entry-alist
4810 "Alist that associates menu part with number of items per part.
4812 It's used by `pr-menu-index'.
4821 (defun pr-menu-index (entry index)
4840 (cdr (assq key pr-menu-entry-alist)))))))
4844 (defvar pr-menu-position nil)
4845 (defvar pr-menu-state nil)
4852 (defun pr-menu-position (entry index horizontal)
4857 (* horizontal pr-menu-char-width))
4859 (* (pr-menu-index entry index) pr-menu-char-height)))))
4863 (defun pr-menu-position (entry index horizontal)
4868 (* (pr-menu-index entry index) pr-menu-char-height)))
4873 (defun pr-menu-position (entry index horizontal)
4877 (* horizontal pr-menu-char-width))
4879 (* (pr-menu-index entry index) pr-menu-char-height)))
4887 (defun pr-menu-lookup (path)
4888 (car (pr-x-find-menu-item current-menubar (cons "Printing" path))))
4891 (defun pr-menu-lock (entry index horizontal state path)
4892 (when pr-menu-lock
4893 (or (and pr-menu-position (eq state pr-menu-state))
4894 (setq pr-menu-position (pr-menu-position entry index horizontal)
4895 pr-menu-state state))
4896 (let* ((menu (pr-menu-lookup path))
4897 (result (pr-x-get-popup-menu-response menu pr-menu-position)))
4901 (setq pr-menu-position nil))))
4906 (defun pr-menu-lookup (path)
4909 (vconcat pr-menu-bar
4914 pr-menu-bar)))
4917 (defun pr-menu-lock (entry index horizontal state path)
4918 (when pr-menu-lock
4919 (or (and pr-menu-position (eq state pr-menu-state))
4920 (setq pr-menu-position (pr-menu-position entry index horizontal)
4921 pr-menu-state state))
4922 (let* ((menu (pr-menu-lookup path))
4923 (result (x-popup-menu pr-menu-position menu)))
4925 (let ((command (lookup-key menu (vconcat result))))
4929 (setq pr-menu-position nil)))))
4946 otherwise, update PostScript printer menu iff `pr-ps-printer-menu-modified' is
4947 non-nil, update text printer menu iff `pr-txt-printer-menu-modified' is
4948 non-nil, and update PostScript File menus iff `pr-ps-utility-menu-modified' is
4951 If menu binding was not done, calls `pr-menu-bind'."
4953 (if pr-menu-print-item ; since v6.8.4
4954 ;; There was no menu binding yet, so do it now!
4957 (pr-menu-bind)
4958 ;; Here menu binding is ok.
4965 (defvar pr-ps-printer-menu-modified t
4966 "Non-nil means `pr-ps-printer-alist' was modified and we need to update menu.")
4967 (defvar pr-txt-printer-menu-modified t
4968 "Non-nil means `pr-txt-printer-alist' was modified and we need to update menu.")
4969 (defvar pr-ps-utility-menu-modified t
4970 "Non-nil means `pr-ps-utility-alist' was modified and we need to update menu.")
4981 (defun pr-menu-create (name alist var-sym fun entry index)
5007 (pr-menu-alist pr-ps-printer-alist
5009 'pr-menu-set-ps-title
5011 'pr-ps-printer-menu-modified
5015 (pr-menu-alist pr-txt-printer-alist
5017 'pr-menu-set-txt-title
5019 'pr-txt-printer-menu-modified
5023 (let ((save-var pr-ps-utility-menu-modified))
5024 (pr-menu-alist pr-ps-utility-alist
5026 'pr-menu-set-utility-title
5032 (pr-menu-alist pr-ps-utility-alist
5034 'pr-menu-set-utility-title
5036 'pr-ps-utility-menu-modified
5043 (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name
5047 (pr-x-add-submenu menu-path
5048 (pr-menu-create name alist var-sym
5054 (defun pr-relabel-menu-item (newname var-sym)
5056 (pr-x-relabel-menu-item
5062 (defun pr-menu-set-ps-title (value &optional item entry index)
5063 (pr-relabel-menu-item (format "PostScript Printer: %s" value)
5067 (pr-menu-lock entry index 12 'toggle nil)))
5070 (defun pr-menu-set-txt-title (value &optional item entry index)
5071 (pr-relabel-menu-item (format "Text Printer: %s" value)
5075 (pr-menu-lock entry index 12 'toggle nil)))
5078 (defun pr-menu-set-utility-title (value &optional item entry index)
5081 (pr-x-relabel-menu-item
5084 (pr-x-relabel-menu-item
5090 (pr-menu-lock entry index 5 nil '("PostScript Print" "File"))))
5094 (pr-relabel-menu-item (cdr (assq value pr-even-or-odd-alist))
5098 (pr-menu-lock 'postscript-options 8 12 'toggle nil))))
5107 (pr-menu-alist pr-ps-printer-alist
5109 'pr-menu-set-ps-title
5111 'pr-ps-printer-menu-modified
5115 (pr-menu-alist pr-txt-printer-alist
5117 'pr-menu-set-txt-title
5119 'pr-txt-printer-menu-modified
5123 (let ((save-var pr-ps-utility-menu-modified))
5124 (pr-menu-alist pr-ps-utility-alist
5126 'pr-menu-set-utility-title
5132 (pr-menu-alist pr-ps-utility-alist
5134 'pr-menu-set-utility-title
5136 'pr-ps-utility-menu-modified
5143 (defun pr-menu-get-item (name-list)
5151 (menu (lookup-key
5153 (vconcat pr-menu-bar
5155 (assq name (nthcdr 2 menu)))))
5158 (defvar pr-temp-menu nil)
5161 (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name
5164 (easy-menu-define pr-temp-menu nil ""
5165 (pr-menu-create name alist var-sym fun entry index))
5166 (let ((item (pr-menu-get-item menu-path)))
5170 (setcar binding pr-temp-menu)
5177 (defun pr-menu-set-item-name (item name)
5182 (defun pr-menu-set-ps-title (value &optional item entry index)
5183 (pr-menu-set-item-name (or item
5184 (pr-menu-get-item "PostScript Printers"))
5188 (pr-menu-lock entry index 12 'toggle nil)))
5191 (defun pr-menu-set-txt-title (value &optional item entry index)
5192 (pr-menu-set-item-name (or item
5193 (pr-menu-get-item "Text Printers"))
5197 (pr-menu-lock entry index 12 'toggle nil)))
5200 (defun pr-menu-set-utility-title (value &optional item entry index)
5203 (pr-menu-set-item-name item name)
5204 (pr-menu-set-item-name
5205 (pr-menu-get-item
5208 (pr-menu-set-item-name
5209 (pr-menu-get-item
5214 (pr-menu-lock entry index 5 nil '("PostScript Print" "File"))))
5218 (pr-menu-set-item-name (pr-menu-get-item "Print All Pages")
5222 (pr-menu-lock 'postscript-options 8 12 'toggle nil)))))
5315 (message "There are local buffer settings for `%S'." key)
5355 &optional path no-menu)
5358 (or no-menu
5359 (pr-menu-lock entry index horizontal state path)))
5362 (defun pr-toggle-file-duplex-menu (&optional no-menu)
5365 '("PostScript Print" "File") no-menu))
5368 (defun pr-toggle-file-tumble-menu (&optional no-menu)
5371 '("PostScript Print" "File") no-menu))
5374 (defun pr-toggle-file-landscape-menu (&optional no-menu)
5377 '("PostScript Print" "File") no-menu))
5380 (defun pr-toggle-ghostscript-menu (&optional no-menu)
5383 'postscript-process 2 12 'toggle nil no-menu))
5386 (defun pr-toggle-faces-menu (&optional no-menu)
5389 'postscript-process 1 12 'toggle nil no-menu))
5392 (defun pr-toggle-spool-menu (&optional no-menu)
5395 'postscript-process 0 12 'toggle nil no-menu))
5398 (defun pr-toggle-duplex-menu (&optional no-menu)
5401 'postscript-options 5 12 'toggle nil no-menu))
5404 (defun pr-toggle-tumble-menu (&optional no-menu)
5407 'postscript-options 6 12 'toggle nil no-menu))
5410 (defun pr-toggle-landscape-menu (&optional no-menu)
5413 'postscript-options 0 12 'toggle nil no-menu))
5416 (defun pr-toggle-upside-down-menu (&optional no-menu)
5419 'postscript-options 7 12 'toggle nil no-menu))
5422 (defun pr-toggle-line-menu (&optional no-menu)
5425 'postscript-options 3 12 'toggle nil no-menu))
5428 (defun pr-toggle-zebra-menu (&optional no-menu)
5431 'postscript-options 4 12 'toggle nil no-menu))
5434 (defun pr-toggle-header-menu (&optional no-menu)
5437 'postscript-options 1 12 'toggle nil no-menu))
5440 (defun pr-toggle-header-frame-menu (&optional no-menu)
5443 'postscript-options 2 12 'toggle nil no-menu))
5446 (defun pr-toggle-lock-menu (&optional no-menu)
5448 (pr-toggle 'pr-menu-lock "Menu lock"
5449 'printing 2 12 'toggle nil no-menu))
5452 (defun pr-toggle-region-menu (&optional no-menu)
5455 'printing 0 12 'toggle nil no-menu))
5458 (defun pr-toggle-mode-menu (&optional no-menu)
5461 'printing 1 12 'toggle nil no-menu))
5485 'buffer))
5492 " buffer")))
5495 (defun pr-show-setup (settings buffer-name)
5496 (with-output-to-temp-buffer buffer-name
5620 (let ((buffer (get-buffer-create "*Printing Command Output*"))
5626 (set-buffer buffer)
5633 (apply 'call-process cmd nil buffer nil args)
5638 (set-buffer buffer)
5645 "Printing error status: %s (see *Printing Command Output* buffer)"
5723 (let* ((dir-name (file-name-directory (or (buffer-file-name)
5822 (defun pr-find-buffer-visiting (file)
5824 (find-buffer-visiting (if ps-windows-system
5828 (blist (buffer-list))
5832 (set-buffer (car blist))
5836 (string= (buffer-substring-no-properties
5851 (let ((buffer (pr-find-buffer-visiting file))
5854 (and (or buffer
5857 (set-buffer (or buffer
5860 (or buffer
5861 (kill-buffer (current-buffer))))))))
5877 (pr-text2ps 'buffer n-up filename)))))
5892 (cond ((eq kind 'buffer)
5893 (ps-spool-buffer-with-faces))
5899 ((eq kind 'buffer)
5900 (ps-print-buffer-with-faces filename))
5908 (cond ((eq kind 'buffer)
5909 (ps-spool-buffer))
5914 ((eq kind 'buffer)
5915 (ps-print-buffer filename))
6007 (defvar pr-i-buffer nil)
6018 (defvar pr-i-process 'buffer)
6038 (set-buffer pr-i-buffer)
6044 (setq pr-i-buffer (buffer-name (current-buffer))
6053 (kill-buffer (get-buffer-create pr-buffer-name))
6054 (switch-to-buffer (get-buffer-create pr-buffer-name))
6091 (pr-insert-radio-button 'pr-i-process 'buffer)
6092 (pr-insert-menu "Buffer List" 'pr-i-buffer
6093 (let ((blist (buffer-list))
6096 (let ((name (buffer-name (car blist)))
6097 (ignore pr-buffer-name-ignore)
6157 "This buffer isn't in a mode that printing treats specially.")
6201 (pr-insert-menu "PostScript Utility" 'pr-ps-utility
6213 (pr-insert-menu "PostScript Printer" 'pr-ps-name
6274 (pr-insert-menu "Text Printer" 'pr-txt-name
6291 (pr-insert-toggle 'pr-buffer-verbose " Verbose\n ")
6299 (pr-insert-toggle 'pr-menu-lock " Menu Lock\n ")
6336 (pr-insert-menu "Page Parity" 'ps-even-or-odd-pages
6373 "Kill all printing help buffer."
6378 (let ((buffer (get-buffer (car help))))
6380 (when buffer
6381 (delete-windows-on buffer)
6382 (kill-buffer buffer)))))
6387 "Kill the printing buffer interface and quit."
6389 (kill-buffer pr-buffer-name)
6394 "printing buffer interface help."
6408 ((eq pr-i-process 'buffer)
6418 (pr-txt-buffer)))
6432 "Printify a buffer."
6440 ((eq pr-i-process 'buffer)
6444 (pr-printify-buffer))))
6462 'pr-ps-buffer-ps-print))
6471 'pr-ps-buffer-preview))
6475 ps-mode ps-buffer)
6501 ((eq pr-i-process 'buffer)
6511 (funcall ps-buffer pr-i-n-up outfile)))
6547 (and pr-buffer-verbose
6556 (and pr-buffer-verbose
6566 (and pr-buffer-verbose
6575 (and (get-buffer "*Completions*") ; clean frame window
6614 (defun pr-insert-menu (tag var-sym choices &optional before after &rest body)
6616 (eval `(widget-create 'menu-choice