emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/printing.el [emacs-unicode-2]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/printing.el [emacs-unicode-2]
Date: Fri, 16 Jul 2004 22:50:43 -0400

Index: emacs/lisp/printing.el
diff -c emacs/lisp/printing.el:1.3.6.2 emacs/lisp/printing.el:1.3.6.3
*** emacs/lisp/printing.el:1.3.6.2      Sun Jul 11 22:07:44 2004
--- emacs/lisp/printing.el      Sat Jul 17 02:46:46 2004
***************
*** 5,17 ****
  
  ;; Author: Vinicius Jose Latorre <address@hidden>
  ;; Maintainer: Vinicius Jose Latorre <address@hidden>
! ;; Time-stamp: <2004/07/10 18:48:24 vinicius>
  ;; Keywords: wp, print, PostScript
  ;; Version: 6.8
  ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
  
  (defconst pr-version "6.8"
!   "printing.el, v 6.8 <2004/07/10 vinicius>
  
  Please send all bug fixes and enhancements to
        Vinicius Jose Latorre <address@hidden>
--- 5,17 ----
  
  ;; Author: Vinicius Jose Latorre <address@hidden>
  ;; Maintainer: Vinicius Jose Latorre <address@hidden>
! ;; Time-stamp: <2004/07/12 21:10:35 vinicius>
  ;; Keywords: wp, print, PostScript
  ;; Version: 6.8
  ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
  
  (defconst pr-version "6.8"
!   "printing.el, v 6.8 <2004/07/12 vinicius>
  
  Please send all bug fixes and enhancements to
        Vinicius Jose Latorre <address@hidden>
***************
*** 48,59 ****
  ;;
  ;; Indeed, there are two user interfaces:
  ;;
! ;;    * one is via menubar:
  ;;      When `printing' is loaded, the menubar is modified to use `printing'
  ;;      menu instead of the print options in menubar.
  ;;      This is the default user interface.
  ;;
! ;;    * other is via buffer interface:
  ;;      It is an option of `printing' menu, but it can be binded into another
  ;;      key, so user can activate the buffer interface directly without using
  ;;      a menu.  See `pr-interface' command.
--- 48,59 ----
  ;;
  ;; Indeed, there are two user interfaces:
  ;;
! ;;    * Menu interface:
  ;;      When `printing' is loaded, the menubar is modified to use `printing'
  ;;      menu instead of the print options in menubar.
  ;;      This is the default user interface.
  ;;
! ;;    * Buffer interface:
  ;;      It is an option of `printing' menu, but it can be binded into another
  ;;      key, so user can activate the buffer interface directly without using
  ;;      a menu.  See `pr-interface' command.
***************
*** 78,89 ****
  ;; To obtain ghostscript, ghostview and GSview see the URL
  ;; `http://www.gnu.org/software/ghostscript/ghostscript.html'.
  ;;
! ;; `printing' also depends on ps-print and lpr GNU Emacs packages.
  ;; To download the latest ps-print package see
  ;; `http://www.cpqd.com.br/~vinicius/emacs/ps-print.tar.gz'.
  ;; Please, see README file for ps-print installation instructions.
  ;;
  ;;
  ;; Novices (First Users)
  ;; ---------------------
  ;;
--- 78,128 ----
  ;; To obtain ghostscript, ghostview and GSview see the URL
  ;; `http://www.gnu.org/software/ghostscript/ghostscript.html'.
  ;;
! ;; `printing' depends on ps-print package to generate PostScript files, to
! ;; spool and to despool PostScript buffer.  So, `printing' provides an
! ;; 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'.
  ;; Please, see README file for ps-print installation instructions.
  ;;
  ;;
+ ;; Log Messages
+ ;; ------------
+ ;;
+ ;; The buffer *Printing Command Output* is where the `printing' log messages
+ ;; are inserted.  All program called by `printing' has a log entry in the
+ ;; buffer *Printing Command Output*.  A log entry has the following form:
+ ;;
+ ;;    PROGRAM (ARG...)
+ ;;    MESSAGE
+ ;;    Exit status: CODE
+ ;;
+ ;; Where
+ ;; PROGRAM is the program activated by `printing',
+ ;; ARG is an argument passed to PROGRAM (it can have more than one argument),
+ ;; MESSAGE is an error message returned by PROGRAM (it can have no message, if
+ ;; PROGRAM is successful),
+ ;; and CODE is a numeric exit status or a signal description string.
+ ;;
+ ;; For example, after previewing a PostScript file, *Printing Command Output*
+ ;; will have the following entry:
+ ;;
+ ;;    /usr/X11R6/bin/gv ("/home/user/example/file.ps")
+ ;;    Exit status: 0
+ ;;
+ ;; In the example above, the previewing was successful.  If during previewing,
+ ;; you quit gv execution (by typing C-g during Emacs session), the log entry
+ ;; would be:
+ ;;
+ ;;    /usr/X11R6/bin/gv ("/home/user/example/file.ps")
+ ;;    Exit status: Quit
+ ;;
+ ;; So, if something goes wrong, a good place to take a look is the buffer
+ ;; *Printing Command Output*.  Don't forget to see also the buffer *Messages*,
+ ;; it can help.
+ ;;
+ ;;
  ;; Novices (First Users)
  ;; ---------------------
  ;;
***************
*** 205,211 ****
  ;;
  ;;       print /D:\\host\printer somefile.txt
  ;;
! ;;    Where, `host' is the machine where your printer is directly connected,
  ;;    `printer' is the printer name and `somefile.txt' is a text file.
  ;;
  ;;    If the printer `\\host\printer' doesn't print the content of
--- 244,250 ----
  ;;
  ;;       print /D:\\host\printer somefile.txt
  ;;
! ;;    Where, `host' is the machine where the printer is directly connected,
  ;;    `printer' is the printer name and `somefile.txt' is a text file.
  ;;
  ;;    If the printer `\\host\printer' doesn't print the content of
***************
*** 892,899 ****
  ;; Acknowledgments
  ;; ---------------
  ;;
! ;; Thanks to Drew Adams <address@hidden> for directory processing and
! ;; `pr-path-alist' suggestions.
  ;;
  ;; Thanks to Fred Labrosse <address@hidden> for XEmacs tests.
  ;;
--- 931,941 ----
  ;; Acknowledgments
  ;; ---------------
  ;;
! ;; Thanks to Drew Adams <address@hidden> for suggestions:
! ;;    - directory processing.
! ;;    - `pr-path-alist' variable.
! ;;    - doc fix.
! ;;    - a lot of tests on Windows.
  ;;
  ;; Thanks to Fred Labrosse <address@hidden> for XEmacs tests.
  ;;
***************
*** 1068,1074 ****
  ;; Internal Functions (I)
  
  
! (defun pr-dosify-path (path)
    "Replace unix-style directory separator character with dos/windows one."
    (interactive "sPath: ")
    (if (eq pr-path-style 'windows)
--- 1110,1116 ----
  ;; Internal Functions (I)
  
  
! (defun pr-dosify-file-name (path)
    "Replace unix-style directory separator character with dos/windows one."
    (interactive "sPath: ")
    (if (eq pr-path-style 'windows)
***************
*** 1076,1082 ****
      path))
  
  
! (defun pr-unixify-path (path)
    "Replace dos/windows-style directory separator character with unix one."
    (interactive "sPath: ")
    (if (eq pr-path-style 'windows)
--- 1118,1124 ----
      path))
  
  
! (defun pr-unixify-file-name (path)
    "Replace dos/windows-style directory separator character with unix one."
    (interactive "sPath: ")
    (if (eq pr-path-style 'windows)
***************
*** 1084,1090 ****
      path))
  
  
! (defun pr-standard-path (path)
    "Ensure the proper directory separator depending on the OS.
  That is, if Emacs is running on DOS/Windows, ensure dos/windows-style 
directory
  separator; otherwise, ensure unix-style directory separator."
--- 1126,1132 ----
      path))
  
  
! (defun pr-standard-file-name (path)
    "Ensure the proper directory separator depending on the OS.
  That is, if Emacs is running on DOS/Windows, ensure dos/windows-style 
directory
  separator; otherwise, ensure unix-style directory separator."
***************
*** 1510,1516 ****
  
  
  (defcustom pr-temp-dir
!   (pr-dosify-path
     (if (boundp 'temporary-file-directory)
         (symbol-value 'temporary-file-directory)
       ;; hacked from `temporary-file-directory' variable in files.el
--- 1552,1558 ----
  
  
  (defcustom pr-temp-dir
!   (pr-dosify-file-name
     (if (boundp 'temporary-file-directory)
         (symbol-value 'temporary-file-directory)
       ;; hacked from `temporary-file-directory' variable in files.el
***************
*** 3831,3837 ****
    (interactive (list (pr-ps-infile-preprint "Print preview ")))
    (and (stringp filename) (file-exists-p filename)
         (let* ((file (pr-expand-file-name filename))
!             (tempfile (pr-dosify-path (make-temp-name file))))
         ;; gs use
         (pr-call-process pr-gs-command
                          (format "-sDEVICE=%s" pr-gs-device)
--- 3873,3879 ----
    (interactive (list (pr-ps-infile-preprint "Print preview ")))
    (and (stringp filename) (file-exists-p filename)
         (let* ((file (pr-expand-file-name filename))
!             (tempfile (pr-dosify-file-name (make-temp-name file))))
         ;; gs use
         (pr-call-process pr-gs-command
                          (format "-sDEVICE=%s" pr-gs-device)
***************
*** 5004,5010 ****
         "Invalid PostScript printer name `%s' for variable `pr-ps-name'."
         value))
      (setq pr-ps-name           value
!         pr-ps-command        (pr-dosify-path (nth 0 ps))
          pr-ps-switches       (nth 1 ps)
          pr-ps-printer-switch (nth 2 ps)
          pr-ps-printer        (nth 3 ps))
--- 5046,5052 ----
         "Invalid PostScript printer name `%s' for variable `pr-ps-name'."
         value))
      (setq pr-ps-name           value
!         pr-ps-command        (pr-dosify-file-name (nth 0 ps))
          pr-ps-switches       (nth 1 ps)
          pr-ps-printer-switch (nth 2 ps)
          pr-ps-printer        (nth 3 ps))
***************
*** 5030,5036 ****
        (error "Invalid text printer name `%s' for variable `pr-txt-name'."
               value))
      (setq pr-txt-name     value
!         pr-txt-command  (pr-dosify-path (nth 0 txt))
          pr-txt-switches (nth 1 txt)
          pr-txt-printer  (nth 2 txt)))
    (or (stringp pr-txt-command)
--- 5072,5078 ----
        (error "Invalid text printer name `%s' for variable `pr-txt-name'."
               value))
      (setq pr-txt-name     value
!         pr-txt-command  (pr-dosify-file-name (nth 0 txt))
          pr-txt-switches (nth 1 txt)
          pr-txt-printer  (nth 2 txt)))
    (or (stringp pr-txt-command)
***************
*** 5169,5175 ****
  
  
  (defun pr-expand-file-name (filename)
!   (pr-dosify-path (expand-file-name filename)))
  
  
  (defun pr-ps-outfile-preprint (&optional mess)
--- 5211,5217 ----
  
  
  (defun pr-expand-file-name (filename)
!   (pr-dosify-file-name (expand-file-name filename)))
  
  
  (defun pr-ps-outfile-preprint (&optional mess)
***************
*** 5230,5243 ****
    ;; input file
    (or (symbol-value infile-sym)
        (error "%s: input PostScript file name is missing" prompt))
!   (set infile-sym (pr-dosify-path (symbol-value infile-sym)))
    ;; output file
    (and (eq (symbol-value outfile-sym) t)
         (set outfile-sym (and (not (interactive-p))
                             current-prefix-arg
                             (pr-ps-outfile-preprint prompt))))
    (and (symbol-value outfile-sym)
!        (set outfile-sym (pr-dosify-path (symbol-value outfile-sym))))
    (pr-ps-file (symbol-value outfile-sym)))
  
  
--- 5272,5285 ----
    ;; input file
    (or (symbol-value infile-sym)
        (error "%s: input PostScript file name is missing" prompt))
!   (set infile-sym (pr-dosify-file-name (symbol-value infile-sym)))
    ;; output file
    (and (eq (symbol-value outfile-sym) t)
         (set outfile-sym (and (not (interactive-p))
                             current-prefix-arg
                             (pr-ps-outfile-preprint prompt))))
    (and (symbol-value outfile-sym)
!        (set outfile-sym (pr-dosify-file-name (symbol-value outfile-sym))))
    (pr-ps-file (symbol-value outfile-sym)))
  
  
***************
*** 5284,5290 ****
        (set-buffer buffer)
        (goto-char (point-max))
        (insert (format "%s %S\n" cmd args)))
!     (setq status (apply 'call-process cmd nil buffer nil args))
      (save-excursion
        (set-buffer buffer)
        (goto-char (point-max))
--- 5326,5336 ----
        (set-buffer buffer)
        (goto-char (point-max))
        (insert (format "%s %S\n" cmd args)))
!     (setq status
!         (condition-case data
!             (apply 'call-process cmd nil buffer nil args)
!           ((quit error)
!            (error-message-string data))))
      (save-excursion
        (set-buffer buffer)
        (goto-char (point-max))
***************
*** 5292,5298 ****
  
  
  (defun pr-txt-print (from to)
!   (let ((lpr-command  (pr-standard-path (pr-command pr-txt-command)))
        (lpr-switches (pr-switches pr-txt-switches "pr-txt-switches"))
        (printer-name pr-txt-printer))
      (lpr-region from to)))
--- 5338,5344 ----
  
  
  (defun pr-txt-print (from to)
!   (let ((lpr-command  (pr-standard-file-name (pr-command pr-txt-command)))
        (lpr-switches (pr-switches pr-txt-switches "pr-txt-switches"))
        (printer-name pr-txt-printer))
      (lpr-region from to)))
***************
*** 5335,5343 ****
  
  
  (defun pr-ps-file (&optional filename)
!   (pr-dosify-path (or filename
!                     (convert-standard-filename
!                      (expand-file-name pr-ps-temp-file pr-temp-dir)))))
  
  
  (defun pr-interactive-n-up (mess)
--- 5381,5389 ----
  
  
  (defun pr-ps-file (&optional filename)
!   (pr-dosify-file-name (or filename
!                          (convert-standard-filename
!                           (expand-file-name pr-ps-temp-file pr-temp-dir)))))
  
  
  (defun pr-interactive-n-up (mess)
***************
*** 5430,5436 ****
                              current-prefix-arg
                              (ps-print-preprint current-prefix-arg))))
    (and (symbol-value filename-sym)
!        (set filename-sym (pr-dosify-path (symbol-value filename-sym)))))
  
  
  (defun pr-set-n-up-and-filename (n-up-sym filename-sym mess)
--- 5476,5482 ----
                              current-prefix-arg
                              (ps-print-preprint current-prefix-arg))))
    (and (symbol-value filename-sym)
!        (set filename-sym (pr-dosify-file-name (symbol-value filename-sym)))))
  
  
  (defun pr-set-n-up-and-filename (n-up-sym filename-sym mess)
***************
*** 5574,5580 ****
  COMMAND.exe, COMMAND.bat and COMMAND.com in this order."
    (if (string= command "")
        command
!     (pr-dosify-path
       (or (pr-find-command command)
         (pr-path-command (cond (pr-cygwin-system  'cygwin)
                                (ps-windows-system 'windows)
--- 5620,5626 ----
  COMMAND.exe, COMMAND.bat and COMMAND.com in this order."
    (if (string= command "")
        command
!     (pr-dosify-file-name
       (or (pr-find-command command)
         (pr-path-command (cond (pr-cygwin-system  'cygwin)
                                (ps-windows-system 'windows)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]