diff options
| author | Vinicius Jose Latorre | 2004-07-13 01:32:18 +0000 |
|---|---|---|
| committer | Vinicius Jose Latorre | 2004-07-13 01:32:18 +0000 |
| commit | 0117451de7e30adf240f369f26b7667dbf3788bf (patch) | |
| tree | d6dd39c6356a7eab67d205e86d0c9733f1bef0b0 | |
| parent | 0925fc3e7757122d0f1d525144076b6e0cd43c14 (diff) | |
| download | emacs-0117451de7e30adf240f369f26b7667dbf3788bf.tar.gz emacs-0117451de7e30adf240f369f26b7667dbf3788bf.zip | |
Doc fix. Change name of some funs.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/printing.el | 96 |
2 files changed, 79 insertions, 25 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c72237eec36..b860134af46 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2004-07-12 Vinicius Jose Latorre <viniciusjl@ig.com.br> | ||
| 2 | |||
| 3 | * printing.el: Doc fix. Change name of some funs. | ||
| 4 | (pr-dosify-file-name): New fun. Replace ps-dosify-path. | ||
| 5 | (pr-unixify-file-name): New fun. Replace ps-unixify-path. | ||
| 6 | (pr-standard-file-name): New fun. Replace pr-standard-path. | ||
| 7 | (pr-call-process): Code fix. | ||
| 8 | |||
| 1 | 2004-07-12 Luc Teirlinck <teirllm@auburn.edu> | 9 | 2004-07-12 Luc Teirlinck <teirllm@auburn.edu> |
| 2 | 10 | ||
| 3 | * subr.el (with-selected-window): Doc fix. | 11 | * subr.el (with-selected-window): Doc fix. |
diff --git a/lisp/printing.el b/lisp/printing.el index 351d6b64e85..ae6e194d731 100644 --- a/lisp/printing.el +++ b/lisp/printing.el | |||
| @@ -5,13 +5,13 @@ | |||
| 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/07/10 18:48:24 vinicius> | 8 | ;; Time-stamp: <2004/07/12 21:10:35 vinicius> |
| 9 | ;; Keywords: wp, print, PostScript | 9 | ;; Keywords: wp, print, PostScript |
| 10 | ;; Version: 6.8 | 10 | ;; Version: 6.8 |
| 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" | 13 | (defconst pr-version "6.8" |
| 14 | "printing.el, v 6.8 <2004/07/10 vinicius> | 14 | "printing.el, v 6.8 <2004/07/12 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> |
| @@ -48,12 +48,12 @@ Please send all bug fixes and enhancements to | |||
| 48 | ;; | 48 | ;; |
| 49 | ;; Indeed, there are two user interfaces: | 49 | ;; Indeed, there are two user interfaces: |
| 50 | ;; | 50 | ;; |
| 51 | ;; * one is via menubar: | 51 | ;; * Menu interface: |
| 52 | ;; When `printing' is loaded, the menubar is modified to use `printing' | 52 | ;; When `printing' is loaded, the menubar is modified to use `printing' |
| 53 | ;; menu instead of the print options in menubar. | 53 | ;; menu instead of the print options in menubar. |
| 54 | ;; This is the default user interface. | 54 | ;; This is the default user interface. |
| 55 | ;; | 55 | ;; |
| 56 | ;; * other is via buffer interface: | 56 | ;; * Buffer interface: |
| 57 | ;; It is an option of `printing' menu, but it can be binded into another | 57 | ;; It is an option of `printing' menu, but it can be binded into another |
| 58 | ;; key, so user can activate the buffer interface directly without using | 58 | ;; key, so user can activate the buffer interface directly without using |
| 59 | ;; a menu. See `pr-interface' command. | 59 | ;; a menu. See `pr-interface' command. |
| @@ -78,12 +78,51 @@ Please send all bug fixes and enhancements to | |||
| 78 | ;; To obtain ghostscript, ghostview and GSview see the URL | 78 | ;; To obtain ghostscript, ghostview and GSview see the URL |
| 79 | ;; `http://www.gnu.org/software/ghostscript/ghostscript.html'. | 79 | ;; `http://www.gnu.org/software/ghostscript/ghostscript.html'. |
| 80 | ;; | 80 | ;; |
| 81 | ;; `printing' also depends on ps-print and lpr GNU Emacs packages. | 81 | ;; `printing' depends on ps-print package to generate PostScript files, to |
| 82 | ;; spool and to despool PostScript buffer. So, `printing' provides an | ||
| 83 | ;; interface to ps-print package and it also provides some extra stuff. | ||
| 84 | ;; | ||
| 82 | ;; To download the latest ps-print package see | 85 | ;; To download the latest ps-print package see |
| 83 | ;; `http://www.cpqd.com.br/~vinicius/emacs/ps-print.tar.gz'. | 86 | ;; `http://www.cpqd.com.br/~vinicius/emacs/ps-print.tar.gz'. |
| 84 | ;; Please, see README file for ps-print installation instructions. | 87 | ;; Please, see README file for ps-print installation instructions. |
| 85 | ;; | 88 | ;; |
| 86 | ;; | 89 | ;; |
| 90 | ;; Log Messages | ||
| 91 | ;; ------------ | ||
| 92 | ;; | ||
| 93 | ;; The buffer *Printing Command Output* is where the `printing' log messages | ||
| 94 | ;; are inserted. All program called by `printing' has a log entry in the | ||
| 95 | ;; buffer *Printing Command Output*. A log entry has the following form: | ||
| 96 | ;; | ||
| 97 | ;; PROGRAM (ARG...) | ||
| 98 | ;; MESSAGE | ||
| 99 | ;; Exit status: CODE | ||
| 100 | ;; | ||
| 101 | ;; Where | ||
| 102 | ;; PROGRAM is the program activated by `printing', | ||
| 103 | ;; ARG is an argument passed to PROGRAM (it can have more than one argument), | ||
| 104 | ;; MESSAGE is an error message returned by PROGRAM (it can have no message, if | ||
| 105 | ;; PROGRAM is successful), | ||
| 106 | ;; and CODE is a numeric exit status or a signal description string. | ||
| 107 | ;; | ||
| 108 | ;; For example, after previewing a PostScript file, *Printing Command Output* | ||
| 109 | ;; will have the following entry: | ||
| 110 | ;; | ||
| 111 | ;; /usr/X11R6/bin/gv ("/home/user/example/file.ps") | ||
| 112 | ;; Exit status: 0 | ||
| 113 | ;; | ||
| 114 | ;; In the example above, the previewing was successful. If during previewing, | ||
| 115 | ;; you quit gv execution (by typing C-g during Emacs session), the log entry | ||
| 116 | ;; would be: | ||
| 117 | ;; | ||
| 118 | ;; /usr/X11R6/bin/gv ("/home/user/example/file.ps") | ||
| 119 | ;; Exit status: Quit | ||
| 120 | ;; | ||
| 121 | ;; So, if something goes wrong, a good place to take a look is the buffer | ||
| 122 | ;; *Printing Command Output*. Don't forget to see also the buffer *Messages*, | ||
| 123 | ;; it can help. | ||
| 124 | ;; | ||
| 125 | ;; | ||
| 87 | ;; Novices (First Users) | 126 | ;; Novices (First Users) |
| 88 | ;; --------------------- | 127 | ;; --------------------- |
| 89 | ;; | 128 | ;; |
| @@ -205,7 +244,7 @@ Please send all bug fixes and enhancements to | |||
| 205 | ;; | 244 | ;; |
| 206 | ;; print /D:\\host\printer somefile.txt | 245 | ;; print /D:\\host\printer somefile.txt |
| 207 | ;; | 246 | ;; |
| 208 | ;; Where, `host' is the machine where your printer is directly connected, | 247 | ;; Where, `host' is the machine where the printer is directly connected, |
| 209 | ;; `printer' is the printer name and `somefile.txt' is a text file. | 248 | ;; `printer' is the printer name and `somefile.txt' is a text file. |
| 210 | ;; | 249 | ;; |
| 211 | ;; If the printer `\\host\printer' doesn't print the content of | 250 | ;; If the printer `\\host\printer' doesn't print the content of |
| @@ -892,8 +931,11 @@ Please send all bug fixes and enhancements to | |||
| 892 | ;; Acknowledgments | 931 | ;; Acknowledgments |
| 893 | ;; --------------- | 932 | ;; --------------- |
| 894 | ;; | 933 | ;; |
| 895 | ;; Thanks to Drew Adams <drew.adams@oracle.com> for directory processing and | 934 | ;; Thanks to Drew Adams <drew.adams@oracle.com> for suggestions: |
| 896 | ;; `pr-path-alist' suggestions. | 935 | ;; - directory processing. |
| 936 | ;; - `pr-path-alist' variable. | ||
| 937 | ;; - doc fix. | ||
| 938 | ;; - a lot of tests on Windows. | ||
| 897 | ;; | 939 | ;; |
| 898 | ;; Thanks to Fred Labrosse <f.labrosse@maths.bath.ac.uk> for XEmacs tests. | 940 | ;; Thanks to Fred Labrosse <f.labrosse@maths.bath.ac.uk> for XEmacs tests. |
| 899 | ;; | 941 | ;; |
| @@ -1068,7 +1110,7 @@ Valid values are: | |||
| 1068 | ;; Internal Functions (I) | 1110 | ;; Internal Functions (I) |
| 1069 | 1111 | ||
| 1070 | 1112 | ||
| 1071 | (defun pr-dosify-path (path) | 1113 | (defun pr-dosify-file-name (path) |
| 1072 | "Replace unix-style directory separator character with dos/windows one." | 1114 | "Replace unix-style directory separator character with dos/windows one." |
| 1073 | (interactive "sPath: ") | 1115 | (interactive "sPath: ") |
| 1074 | (if (eq pr-path-style 'windows) | 1116 | (if (eq pr-path-style 'windows) |
| @@ -1076,7 +1118,7 @@ Valid values are: | |||
| 1076 | path)) | 1118 | path)) |
| 1077 | 1119 | ||
| 1078 | 1120 | ||
| 1079 | (defun pr-unixify-path (path) | 1121 | (defun pr-unixify-file-name (path) |
| 1080 | "Replace dos/windows-style directory separator character with unix one." | 1122 | "Replace dos/windows-style directory separator character with unix one." |
| 1081 | (interactive "sPath: ") | 1123 | (interactive "sPath: ") |
| 1082 | (if (eq pr-path-style 'windows) | 1124 | (if (eq pr-path-style 'windows) |
| @@ -1084,7 +1126,7 @@ Valid values are: | |||
| 1084 | path)) | 1126 | path)) |
| 1085 | 1127 | ||
| 1086 | 1128 | ||
| 1087 | (defun pr-standard-path (path) | 1129 | (defun pr-standard-file-name (path) |
| 1088 | "Ensure the proper directory separator depending on the OS. | 1130 | "Ensure the proper directory separator depending on the OS. |
| 1089 | That is, if Emacs is running on DOS/Windows, ensure dos/windows-style directory | 1131 | That is, if Emacs is running on DOS/Windows, ensure dos/windows-style directory |
| 1090 | separator; otherwise, ensure unix-style directory separator." | 1132 | separator; otherwise, ensure unix-style directory separator." |
| @@ -1510,7 +1552,7 @@ Examples: | |||
| 1510 | 1552 | ||
| 1511 | 1553 | ||
| 1512 | (defcustom pr-temp-dir | 1554 | (defcustom pr-temp-dir |
| 1513 | (pr-dosify-path | 1555 | (pr-dosify-file-name |
| 1514 | (if (boundp 'temporary-file-directory) | 1556 | (if (boundp 'temporary-file-directory) |
| 1515 | (symbol-value 'temporary-file-directory) | 1557 | (symbol-value 'temporary-file-directory) |
| 1516 | ;; hacked from `temporary-file-directory' variable in files.el | 1558 | ;; hacked from `temporary-file-directory' variable in files.el |
| @@ -3831,7 +3873,7 @@ image in a file with that name." | |||
| 3831 | (interactive (list (pr-ps-infile-preprint "Print preview "))) | 3873 | (interactive (list (pr-ps-infile-preprint "Print preview "))) |
| 3832 | (and (stringp filename) (file-exists-p filename) | 3874 | (and (stringp filename) (file-exists-p filename) |
| 3833 | (let* ((file (pr-expand-file-name filename)) | 3875 | (let* ((file (pr-expand-file-name filename)) |
| 3834 | (tempfile (pr-dosify-path (make-temp-name file)))) | 3876 | (tempfile (pr-dosify-file-name (make-temp-name file)))) |
| 3835 | ;; gs use | 3877 | ;; gs use |
| 3836 | (pr-call-process pr-gs-command | 3878 | (pr-call-process pr-gs-command |
| 3837 | (format "-sDEVICE=%s" pr-gs-device) | 3879 | (format "-sDEVICE=%s" pr-gs-device) |
| @@ -5004,7 +5046,7 @@ non-nil." | |||
| 5004 | "Invalid PostScript printer name `%s' for variable `pr-ps-name'." | 5046 | "Invalid PostScript printer name `%s' for variable `pr-ps-name'." |
| 5005 | value)) | 5047 | value)) |
| 5006 | (setq pr-ps-name value | 5048 | (setq pr-ps-name value |
| 5007 | pr-ps-command (pr-dosify-path (nth 0 ps)) | 5049 | pr-ps-command (pr-dosify-file-name (nth 0 ps)) |
| 5008 | pr-ps-switches (nth 1 ps) | 5050 | pr-ps-switches (nth 1 ps) |
| 5009 | pr-ps-printer-switch (nth 2 ps) | 5051 | pr-ps-printer-switch (nth 2 ps) |
| 5010 | pr-ps-printer (nth 3 ps)) | 5052 | pr-ps-printer (nth 3 ps)) |
| @@ -5030,7 +5072,7 @@ non-nil." | |||
| 5030 | (error "Invalid text printer name `%s' for variable `pr-txt-name'." | 5072 | (error "Invalid text printer name `%s' for variable `pr-txt-name'." |
| 5031 | value)) | 5073 | value)) |
| 5032 | (setq pr-txt-name value | 5074 | (setq pr-txt-name value |
| 5033 | pr-txt-command (pr-dosify-path (nth 0 txt)) | 5075 | pr-txt-command (pr-dosify-file-name (nth 0 txt)) |
| 5034 | pr-txt-switches (nth 1 txt) | 5076 | pr-txt-switches (nth 1 txt) |
| 5035 | pr-txt-printer (nth 2 txt))) | 5077 | pr-txt-printer (nth 2 txt))) |
| 5036 | (or (stringp pr-txt-command) | 5078 | (or (stringp pr-txt-command) |
| @@ -5169,7 +5211,7 @@ non-nil." | |||
| 5169 | 5211 | ||
| 5170 | 5212 | ||
| 5171 | (defun pr-expand-file-name (filename) | 5213 | (defun pr-expand-file-name (filename) |
| 5172 | (pr-dosify-path (expand-file-name filename))) | 5214 | (pr-dosify-file-name (expand-file-name filename))) |
| 5173 | 5215 | ||
| 5174 | 5216 | ||
| 5175 | (defun pr-ps-outfile-preprint (&optional mess) | 5217 | (defun pr-ps-outfile-preprint (&optional mess) |
| @@ -5230,14 +5272,14 @@ non-nil." | |||
| 5230 | ;; input file | 5272 | ;; input file |
| 5231 | (or (symbol-value infile-sym) | 5273 | (or (symbol-value infile-sym) |
| 5232 | (error "%s: input PostScript file name is missing" prompt)) | 5274 | (error "%s: input PostScript file name is missing" prompt)) |
| 5233 | (set infile-sym (pr-dosify-path (symbol-value infile-sym))) | 5275 | (set infile-sym (pr-dosify-file-name (symbol-value infile-sym))) |
| 5234 | ;; output file | 5276 | ;; output file |
| 5235 | (and (eq (symbol-value outfile-sym) t) | 5277 | (and (eq (symbol-value outfile-sym) t) |
| 5236 | (set outfile-sym (and (not (interactive-p)) | 5278 | (set outfile-sym (and (not (interactive-p)) |
| 5237 | current-prefix-arg | 5279 | current-prefix-arg |
| 5238 | (pr-ps-outfile-preprint prompt)))) | 5280 | (pr-ps-outfile-preprint prompt)))) |
| 5239 | (and (symbol-value outfile-sym) | 5281 | (and (symbol-value outfile-sym) |
| 5240 | (set outfile-sym (pr-dosify-path (symbol-value outfile-sym)))) | 5282 | (set outfile-sym (pr-dosify-file-name (symbol-value outfile-sym)))) |
| 5241 | (pr-ps-file (symbol-value outfile-sym))) | 5283 | (pr-ps-file (symbol-value outfile-sym))) |
| 5242 | 5284 | ||
| 5243 | 5285 | ||
| @@ -5284,7 +5326,11 @@ non-nil." | |||
| 5284 | (set-buffer buffer) | 5326 | (set-buffer buffer) |
| 5285 | (goto-char (point-max)) | 5327 | (goto-char (point-max)) |
| 5286 | (insert (format "%s %S\n" cmd args))) | 5328 | (insert (format "%s %S\n" cmd args))) |
| 5287 | (setq status (apply 'call-process cmd nil buffer nil args)) | 5329 | (setq status |
| 5330 | (condition-case data | ||
| 5331 | (apply 'call-process cmd nil buffer nil args) | ||
| 5332 | ((quit error) | ||
| 5333 | (error-message-string data)))) | ||
| 5288 | (save-excursion | 5334 | (save-excursion |
| 5289 | (set-buffer buffer) | 5335 | (set-buffer buffer) |
| 5290 | (goto-char (point-max)) | 5336 | (goto-char (point-max)) |
| @@ -5292,7 +5338,7 @@ non-nil." | |||
| 5292 | 5338 | ||
| 5293 | 5339 | ||
| 5294 | (defun pr-txt-print (from to) | 5340 | (defun pr-txt-print (from to) |
| 5295 | (let ((lpr-command (pr-standard-path (pr-command pr-txt-command))) | 5341 | (let ((lpr-command (pr-standard-file-name (pr-command pr-txt-command))) |
| 5296 | (lpr-switches (pr-switches pr-txt-switches "pr-txt-switches")) | 5342 | (lpr-switches (pr-switches pr-txt-switches "pr-txt-switches")) |
| 5297 | (printer-name pr-txt-printer)) | 5343 | (printer-name pr-txt-printer)) |
| 5298 | (lpr-region from to))) | 5344 | (lpr-region from to))) |
| @@ -5335,9 +5381,9 @@ non-nil." | |||
| 5335 | 5381 | ||
| 5336 | 5382 | ||
| 5337 | (defun pr-ps-file (&optional filename) | 5383 | (defun pr-ps-file (&optional filename) |
| 5338 | (pr-dosify-path (or filename | 5384 | (pr-dosify-file-name (or filename |
| 5339 | (convert-standard-filename | 5385 | (convert-standard-filename |
| 5340 | (expand-file-name pr-ps-temp-file pr-temp-dir))))) | 5386 | (expand-file-name pr-ps-temp-file pr-temp-dir))))) |
| 5341 | 5387 | ||
| 5342 | 5388 | ||
| 5343 | (defun pr-interactive-n-up (mess) | 5389 | (defun pr-interactive-n-up (mess) |
| @@ -5430,7 +5476,7 @@ non-nil." | |||
| 5430 | current-prefix-arg | 5476 | current-prefix-arg |
| 5431 | (ps-print-preprint current-prefix-arg)))) | 5477 | (ps-print-preprint current-prefix-arg)))) |
| 5432 | (and (symbol-value filename-sym) | 5478 | (and (symbol-value filename-sym) |
| 5433 | (set filename-sym (pr-dosify-path (symbol-value filename-sym))))) | 5479 | (set filename-sym (pr-dosify-file-name (symbol-value filename-sym))))) |
| 5434 | 5480 | ||
| 5435 | 5481 | ||
| 5436 | (defun pr-set-n-up-and-filename (n-up-sym filename-sym mess) | 5482 | (defun pr-set-n-up-and-filename (n-up-sym filename-sym mess) |
| @@ -5574,7 +5620,7 @@ If Emacs is running on Windows 95/98/NT/2000, tries to find COMMAND, | |||
| 5574 | COMMAND.exe, COMMAND.bat and COMMAND.com in this order." | 5620 | COMMAND.exe, COMMAND.bat and COMMAND.com in this order." |
| 5575 | (if (string= command "") | 5621 | (if (string= command "") |
| 5576 | command | 5622 | command |
| 5577 | (pr-dosify-path | 5623 | (pr-dosify-file-name |
| 5578 | (or (pr-find-command command) | 5624 | (or (pr-find-command command) |
| 5579 | (pr-path-command (cond (pr-cygwin-system 'cygwin) | 5625 | (pr-path-command (cond (pr-cygwin-system 'cygwin) |
| 5580 | (ps-windows-system 'windows) | 5626 | (ps-windows-system 'windows) |