diff options
| author | Vinicius Jose Latorre | 2007-07-25 14:57:09 +0000 |
|---|---|---|
| committer | Vinicius Jose Latorre | 2007-07-25 14:57:09 +0000 |
| commit | 41a247c2c1c75d13fce1d510d83b1aa73550db8a (patch) | |
| tree | afa5b0105f0c38f9ce7c77ba05d8f66a1dd92ab0 | |
| parent | d918f936d5bfc7e126cc3b1bbf6ce80836c8d6f1 (diff) | |
| download | emacs-41a247c2c1c75d13fce1d510d83b1aa73550db8a.tar.gz emacs-41a247c2c1c75d13fce1d510d83b1aa73550db8a.zip | |
Doc/docstring fix
| -rw-r--r-- | lisp/ChangeLog.unicode | 11 | ||||
| -rw-r--r-- | lisp/ps-mule.el | 122 |
2 files changed, 71 insertions, 62 deletions
diff --git a/lisp/ChangeLog.unicode b/lisp/ChangeLog.unicode index 7b245382c5e..c6dec06b85c 100644 --- a/lisp/ChangeLog.unicode +++ b/lisp/ChangeLog.unicode | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2007-07-25 Vinicius Jose Latorre <viniciusjl@ig.com.br> | ||
| 2 | |||
| 3 | * ps-print.el (ps-multibyte-buffer): Docstring fix. | ||
| 4 | |||
| 5 | * ps-mule.el: Doc fix. | ||
| 6 | (ps-multibyte-buffer, ps-mule-font-info-database, ps-mule-prepare-font) | ||
| 7 | (ps-mule-external-libraries, ps-mule-encode-region) | ||
| 8 | (ps-mule-plot-composition, ps-mule-encode-header-string) | ||
| 9 | (ps-mule-begin-job): Docstring fix. | ||
| 10 | (ps-mule-prologue-generated): Code fix. | ||
| 11 | |||
| 1 | 2007-07-20 Vinicius Jose Latorre <viniciusjl@ig.com.br> | 12 | 2007-07-20 Vinicius Jose Latorre <viniciusjl@ig.com.br> |
| 2 | 13 | ||
| 3 | * ps-print.el: Problem with foreground and background color when | 14 | * ps-print.el: Problem with foreground and background color when |
diff --git a/lisp/ps-mule.el b/lisp/ps-mule.el index a99e1843513..b13554227ef 100644 --- a/lisp/ps-mule.el +++ b/lisp/ps-mule.el | |||
| @@ -46,24 +46,24 @@ | |||
| 46 | ;; | 46 | ;; |
| 47 | ;; Valid values for `ps-multibyte-buffer' are: | 47 | ;; Valid values for `ps-multibyte-buffer' are: |
| 48 | ;; | 48 | ;; |
| 49 | ;; nil This is the value to use the default settings which | 49 | ;; nil This is the value to use the default settings; |
| 50 | ;; is by default for printing buffer with only ASCII | 50 | ;; by default, this only works to print buffers with |
| 51 | ;; and Latin characters. The default setting can be | 51 | ;; only ASCII and Latin characters. But this default |
| 52 | ;; changed by setting the variable | 52 | ;; setting can be changed by setting the variable |
| 53 | ;; `ps-mule-font-info-database-default' differently. | 53 | ;; `ps-mule-font-info-database-default' differently. |
| 54 | ;; The initial value of this variable is | 54 | ;; The initial value of this variable is |
| 55 | ;; `ps-mule-font-info-database-latin' (see | 55 | ;; `ps-mule-font-info-database-latin' (see |
| 56 | ;; documentation). | 56 | ;; documentation). |
| 57 | ;; | 57 | ;; |
| 58 | ;; `non-latin-printer' This is the value to use when you have a japanese | 58 | ;; `non-latin-printer' This is the value to use when you have a japanese |
| 59 | ;; or korean PostScript printer and want to print | 59 | ;; or korean PostScript printer and want to print |
| 60 | ;; buffer with ASCII, Latin-1, Japanese (JISX0208 and | 60 | ;; buffer with ASCII, Latin-1, Japanese (JISX0208 and |
| 61 | ;; JISX0201-Kana) and Korean characters. At present, | 61 | ;; JISX0201-Kana) and Korean characters. At present, |
| 62 | ;; it was not tested the Korean characters printing. | 62 | ;; it was not tested with the Korean characters |
| 63 | ;; If you have a korean PostScript printer, please, | 63 | ;; printing. If you have a korean PostScript printer, |
| 64 | ;; test it. | 64 | ;; please, test it. |
| 65 | ;; | 65 | ;; |
| 66 | ;; `bdf-font' This is the value to use when you want to print | 66 | ;; `bdf-font' This is the value to use when you want to print |
| 67 | ;; buffer with BDF fonts. BDF fonts include both latin | 67 | ;; buffer with BDF fonts. BDF fonts include both latin |
| 68 | ;; and non-latin fonts. BDF (Bitmap Distribution | 68 | ;; and non-latin fonts. BDF (Bitmap Distribution |
| 69 | ;; Format) is a format used for distributing X's font | 69 | ;; Format) is a format used for distributing X's font |
| @@ -75,7 +75,7 @@ | |||
| 75 | ;; `bdf-directory-list' appropriately (see ps-bdf.el | 75 | ;; `bdf-directory-list' appropriately (see ps-bdf.el |
| 76 | ;; for documentation of this variable). | 76 | ;; for documentation of this variable). |
| 77 | ;; | 77 | ;; |
| 78 | ;; `bdf-font-except-latin' This is like `bdf-font' except that it is used | 78 | ;; `bdf-font-except-latin' This is like `bdf-font' except that it uses |
| 79 | ;; PostScript default fonts to print ASCII and Latin-1 | 79 | ;; PostScript default fonts to print ASCII and Latin-1 |
| 80 | ;; characters. This is convenient when you want or | 80 | ;; characters. This is convenient when you want or |
| 81 | ;; need to use both latin and non-latin characters on | 81 | ;; need to use both latin and non-latin characters on |
| @@ -100,24 +100,24 @@ | |||
| 100 | 100 | ||
| 101 | Valid values are: | 101 | Valid values are: |
| 102 | 102 | ||
| 103 | nil This is the value to use the default settings which | 103 | nil This is the value to use the default settings; |
| 104 | is by default for printing buffer with only ASCII | 104 | by default, this only works to print buffers with |
| 105 | and Latin characters. The default setting can be | 105 | only ASCII and Latin characters. But this default |
| 106 | changed by setting the variable | 106 | setting can be changed by setting the variable |
| 107 | `ps-mule-font-info-database-default' differently. | 107 | `ps-mule-font-info-database-default' differently. |
| 108 | The initial value of this variable is | 108 | The initial value of this variable is |
| 109 | `ps-mule-font-info-database-latin' (see | 109 | `ps-mule-font-info-database-latin' (see |
| 110 | documentation). | 110 | documentation). |
| 111 | 111 | ||
| 112 | `non-latin-printer' This is the value to use when you have a Japanese | 112 | `non-latin-printer' This is the value to use when you have a Japanese |
| 113 | or Korean PostScript printer and want to print | 113 | or Korean PostScript printer and want to print |
| 114 | buffer with ASCII, Latin-1, Japanese (JISX0208 and | 114 | buffer with ASCII, Latin-1, Japanese (JISX0208 and |
| 115 | JISX0201-Kana) and Korean characters. At present, | 115 | JISX0201-Kana) and Korean characters. At present, |
| 116 | it was not tested the Korean characters printing. | 116 | it was not tested with the Korean characters |
| 117 | If you have a korean PostScript printer, please, | 117 | printing. If you have a korean PostScript printer, |
| 118 | test it. | 118 | please, test it. |
| 119 | 119 | ||
| 120 | `bdf-font' This is the value to use when you want to print | 120 | `bdf-font' This is the value to use when you want to print |
| 121 | buffer with BDF fonts. BDF fonts include both latin | 121 | buffer with BDF fonts. BDF fonts include both latin |
| 122 | and non-latin fonts. BDF (Bitmap Distribution | 122 | and non-latin fonts. BDF (Bitmap Distribution |
| 123 | Format) is a format used for distributing X's font | 123 | Format) is a format used for distributing X's font |
| @@ -129,7 +129,7 @@ Valid values are: | |||
| 129 | `bdf-directory-list' appropriately (see ps-bdf.el for | 129 | `bdf-directory-list' appropriately (see ps-bdf.el for |
| 130 | documentation of this variable). | 130 | documentation of this variable). |
| 131 | 131 | ||
| 132 | `bdf-font-except-latin' This is like `bdf-font' except that it is used | 132 | `bdf-font-except-latin' This is like `bdf-font' except that it uses |
| 133 | PostScript default fonts to print ASCII and Latin-1 | 133 | PostScript default fonts to print ASCII and Latin-1 |
| 134 | characters. This is convenient when you want or | 134 | characters. This is convenient when you want or |
| 135 | need to use both latin and non-latin characters on | 135 | need to use both latin and non-latin characters on |
| @@ -146,7 +146,7 @@ Any other value is treated as nil." | |||
| 146 | "Alist of charsets with the corresponding font information. | 146 | "Alist of charsets with the corresponding font information. |
| 147 | Each element has the form: | 147 | Each element has the form: |
| 148 | 148 | ||
| 149 | (CHARSET (FONT-TYPE FONT-SRC FONT-NAME ENCODING BYTES)) ...) | 149 | (CHARSET (FONT-TYPE FONT-SRC FONT-NAME ENCODING BYTES) ...) |
| 150 | 150 | ||
| 151 | Where | 151 | Where |
| 152 | 152 | ||
| @@ -166,20 +166,15 @@ FONT-SRC is a font source: builtin, bdf, vflib, or nil. | |||
| 166 | To use this font, the external library `vflib' is required. | 166 | To use this font, the external library `vflib' is required. |
| 167 | 167 | ||
| 168 | If FONT-SRC is nil, a proper ASCII font in the variable | 168 | If FONT-SRC is nil, a proper ASCII font in the variable |
| 169 | `ps-font-info-database' is used, and FONT-NAME is ignored. | 169 | `ps-font-info-database' is used. This is useful for Latin-1 characters. |
| 170 | This is useful for Latin-1 characters. | ||
| 171 | 170 | ||
| 172 | ENCODING is a charset to encode a character of CHARSET to a glyph | 171 | ENCODING is a coding system to encode a string of characters of CHARSET into a |
| 173 | code of the specifies font. ENCODING may be a function that does | 172 | proper string matching an encoding of the specified font. ENCODING may be a |
| 174 | this encoding. In this case, the function is called with one | 173 | function that does this encoding. In this case, the function is called with |
| 175 | argument, the character to encode, and it should return an | 174 | one argument, the string to encode, and it should return an encoded string. |
| 176 | encoded code. ENCODING may be nil, in which case CHARSET is used | ||
| 177 | to encode a character. | ||
| 178 | 175 | ||
| 179 | BYTES specifies how many bytes each character has in the encoded | 176 | BYTES specifies how many bytes each character has in the encoded byte |
| 180 | byte sequence; it should be 1 or 2. If ENCODING is a charset, | 177 | sequence; it should be 1 or 2. |
| 181 | BYTES may be nil, in chich case the dimension of ENCODING is | ||
| 182 | used. | ||
| 183 | 178 | ||
| 184 | All multi-byte characters are printed by fonts specified in this database | 179 | All multi-byte characters are printed by fonts specified in this database |
| 185 | regardless of a font family of ASCII characters. The exception is Latin-1 | 180 | regardless of a font family of ASCII characters. The exception is Latin-1 |
| @@ -419,18 +414,19 @@ format of font spec." | |||
| 419 | t)))) | 414 | t)))) |
| 420 | 415 | ||
| 421 | (defconst ps-mule-external-libraries | 416 | (defconst ps-mule-external-libraries |
| 422 | '((builtin nil nil nil nil nil nil) | 417 | '((builtin nil nil nil |
| 423 | (bdf ps-bdf nil bdf-generate-prologue | 418 | nil nil nil) |
| 424 | bdf-check-font bdf-generate-font bdf-generate-glyph) | 419 | (bdf ps-bdf nil bdf-generate-prologue |
| 425 | (pcf nil nil pcf-generate-prologue | 420 | bdf-check-font bdf-generate-font bdf-generate-glyph) |
| 426 | pcf-check-font pcf-generate-font pcf-generate-glyph) | 421 | (pcf nil nil pcf-generate-prologue |
| 427 | (vflib nil nil vflib-generate-prologue | 422 | pcf-check-font pcf-generate-font pcf-generate-glyph) |
| 428 | vflib-check-font vflib-generate-font vflib-generate-glyphs)) | 423 | (vflib nil nil vflib-generate-prologue |
| 429 | "Alist of information of external libraries to support PostScript printing. | 424 | vflib-check-font vflib-generate-font vflib-generate-glyphs)) |
| 425 | "Alist of external libraries information to support PostScript printing. | ||
| 430 | Each element has the form: | 426 | Each element has the form: |
| 431 | 427 | ||
| 432 | (FONT-SRC FEATURE INITIALIZED-P | 428 | (FONT-SRC FEATURE INITIALIZED-P PROLOGUE-FUNC |
| 433 | PROLOGUE-FUNC CHECK-FUNC FONT-FUNC GLYPH-FUNC) | 429 | CHECK-FUNC FONT-FUNC GLYPH-FUNC) |
| 434 | 430 | ||
| 435 | FONT-SRC is the font source: builtin, bdf, pcf, or vflib. | 431 | FONT-SRC is the font source: builtin, bdf, pcf, or vflib. |
| 436 | 432 | ||
| @@ -440,22 +436,20 @@ FONT-SRC. Currently, we only have the feature `ps-bdf'. | |||
| 440 | 436 | ||
| 441 | INITIALIZED-P indicates if this library is initialized or not. | 437 | INITIALIZED-P indicates if this library is initialized or not. |
| 442 | 438 | ||
| 443 | PROLOGUE-FUNC is a function to generate PostScript code which | 439 | PROLOGUE-FUNC is a function to generate PostScript code which define several |
| 444 | define several PostScript procedures that will be called by | 440 | PostScript procedures that will be called by FONT-FUNC and GLYPHS-FUNC. It is |
| 445 | FONT-FUNC and GLYPHS-FUNC. It is called with no argument, and | 441 | called with no argument, and should return a list of strings. |
| 446 | should return a list of strings. | ||
| 447 | 442 | ||
| 448 | CHECK-FUNC is a function to check if a font is available or not. | 443 | CHECK-FUNC is a function to check if a font is available or not. |
| 449 | It is called with one argument FONT-SPEC, and should return | 444 | It is called with one argument FONT-SPEC, and should return non-nil iff the |
| 450 | non-nil iff the font specified in FONT-SPEC is available. | 445 | font specified in FONT-SPEC is available. |
| 451 | 446 | ||
| 452 | FONT-FUNC is a function to generate PostScript code which define | 447 | FONT-FUNC is a function to generate PostScript code which define a new font. |
| 453 | a new font. It is called with one argument FONT-SPEC, and should | 448 | It is called with one argument FONT-SPEC, and should return a list of strings. |
| 454 | return a list of strings. | ||
| 455 | 449 | ||
| 456 | GLYPH-FUNC is a function to generate PostScript code which define a glyph of | 450 | GLYPH-FUNC is a function to generate PostScript code which define glyphs of |
| 457 | characters. It is called with two arguments FONT-SPEC and CODE, | 451 | characters. It is called with two arguments FONT-SPEC and CODE, and should |
| 458 | and should return a list of strings.") | 452 | return a list of strings.") |
| 459 | 453 | ||
| 460 | (defsubst ps-mule-exlib-feature (exlib) (nth 1 exlib)) | 454 | (defsubst ps-mule-exlib-feature (exlib) (nth 1 exlib)) |
| 461 | (defsubst ps-mule-exlib-initialized-p (exlib) (nth 2 exlib)) | 455 | (defsubst ps-mule-exlib-initialized-p (exlib) (nth 2 exlib)) |
| @@ -490,7 +484,7 @@ See the documentation of `ps-mule-external-libraries' for EXLIB's meaning." | |||
| 490 | (funcall (ps-mule-exlib-check exlib) font-spec)))))) | 484 | (funcall (ps-mule-exlib-check exlib) font-spec)))))) |
| 491 | 485 | ||
| 492 | (defun ps-mule-prepare-font (font-spec) | 486 | (defun ps-mule-prepare-font (font-spec) |
| 493 | "Generate PostScript codes defining a new font of FONT-TYPE for CHARSET." | 487 | "Generate PostScript codes defining a new font of FONT-SPEC for charset." |
| 494 | (let* ((font-src (ps-mule-font-spec-src font-spec)) | 488 | (let* ((font-src (ps-mule-font-spec-src font-spec)) |
| 495 | (exlib (assq font-src ps-mule-external-libraries)) | 489 | (exlib (assq font-src ps-mule-external-libraries)) |
| 496 | (id (ps-mule-font-spec-id font-spec)) | 490 | (id (ps-mule-font-spec-id font-spec)) |
| @@ -573,14 +567,16 @@ The generated code is inserted on prologue part." | |||
| 573 | (defun ps-mule-prologue-generated () | 567 | (defun ps-mule-prologue-generated () |
| 574 | (unless ps-mule-prologue-generated | 568 | (unless ps-mule-prologue-generated |
| 575 | (ps-output-prologue ps-mule-prologue) | 569 | (ps-output-prologue ps-mule-prologue) |
| 576 | (ps-output-prologue (format "/EscChar %d def\n" ps-mule-esc-char)) | 570 | (ps-output-prologue |
| 571 | (format "\n/EscChar %d def\n\n%%%% End of Mule Section\n\n" | ||
| 572 | ps-mule-esc-char)) | ||
| 577 | (setq ps-mule-prologue-generated t))) | 573 | (setq ps-mule-prologue-generated t))) |
| 578 | 574 | ||
| 579 | (defun ps-mule-encode-region (from to font-spec-table) | 575 | (defun ps-mule-encode-region (from to font-spec-table) |
| 580 | "Generate PostScript code for plotting characters in the region FROM and TO. | 576 | "Generate PostScript code for plotting characters in the region FROM and TO. |
| 581 | 577 | ||
| 582 | FONT-NUM is 0, 1, 2, 3, 4, 5, or 6, each represents font tags | 578 | FONT-SPEC-TABLE is 0, 1, 2, 3, 4, 5, or 6, each represents font tags f0, f1, |
| 583 | f0, f1, f2, f3, h0, h1, and H0 respectively." | 579 | f2, f3, h0, h1, and H0 respectively." |
| 584 | (let* ((font-spec nil) | 580 | (let* ((font-spec nil) |
| 585 | (font-id 0) | 581 | (font-id 0) |
| 586 | (string-list nil) | 582 | (string-list nil) |
| @@ -624,7 +620,7 @@ f0, f1, f2, f3, h0, h1, and H0 respectively." | |||
| 624 | (nreverse (cons (substring str 0 i) string-list)))) | 620 | (nreverse (cons (substring str 0 i) string-list)))) |
| 625 | 621 | ||
| 626 | (defun ps-mule-plot-composition (composition font-spec-table) | 622 | (defun ps-mule-plot-composition (composition font-spec-table) |
| 627 | "Generate PostScript code for plotting COMPOSITION with FONT-NUM." | 623 | "Generate PostScript code for plotting COMPOSITION with FONT-SPEC-TABLE." |
| 628 | (ps-output "[") | 624 | (ps-output "[") |
| 629 | (let ((components (copy-sequence (nth 2 composition))) | 625 | (let ((components (copy-sequence (nth 2 composition))) |
| 630 | (font-spec nil)) | 626 | (font-spec nil)) |
| @@ -879,6 +875,7 @@ the sequence." | |||
| 879 | SpecialEffect % Reflect special effects. | 875 | SpecialEffect % Reflect special effects. |
| 880 | ShowComponents % Draw components. | 876 | ShowComponents % Draw components. |
| 881 | } def | 877 | } def |
| 878 | |||
| 882 | %%%% End of procedures for character composition | 879 | %%%% End of procedures for character composition |
| 883 | " | 880 | " |
| 884 | "PostScript code for printing character composition.") | 881 | "PostScript code for printing character composition.") |
| @@ -1041,7 +1038,8 @@ the sequence." | |||
| 1041 | 1038 | ||
| 1042 | (defun ps-mule-encode-header-string (string fonttag) | 1039 | (defun ps-mule-encode-header-string (string fonttag) |
| 1043 | "Generate PostScript code for ploting STRING by font FONTTAG. | 1040 | "Generate PostScript code for ploting STRING by font FONTTAG. |
| 1044 | FONTTAG should be a string \"/h0\", \"/h1\", \"/L0\", or \"/H0\"." | 1041 | FONTTAG should be a string \"/h0\", \"/h1\", \"/L0\", or \"/H0\". |
| 1042 | Any other value is treated as \"/H0\"." | ||
| 1045 | (with-temp-buffer | 1043 | (with-temp-buffer |
| 1046 | (insert string) | 1044 | (insert string) |
| 1047 | (ps-mule-encode-region (point-min) (point-max) | 1045 | (ps-mule-encode-region (point-min) (point-max) |
| @@ -1055,7 +1053,7 @@ FONTTAG should be a string \"/h0\", \"/h1\", \"/L0\", or \"/H0\"." | |||
| 1055 | ;;;###autoload | 1053 | ;;;###autoload |
| 1056 | (defun ps-mule-begin-job (from to) | 1054 | (defun ps-mule-begin-job (from to) |
| 1057 | "Start printing job for multi-byte chars between FROM and TO. | 1055 | "Start printing job for multi-byte chars between FROM and TO. |
| 1058 | This checks if all multi-byte characters in the region are printable or not." | 1056 | It checks if all multi-byte characters in the region are printable or not." |
| 1059 | (auto-compose-region from to) | 1057 | (auto-compose-region from to) |
| 1060 | (if (and (not (find-composition from to)) | 1058 | (if (and (not (find-composition from to)) |
| 1061 | (save-excursion | 1059 | (save-excursion |