diff options
| author | Gerd Moellmann | 2000-08-29 10:58:13 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-08-29 10:58:13 +0000 |
| commit | bf061ba601a6256352a04b19cd54c011614cc5fd (patch) | |
| tree | 4b84e5ce8b71fd254e5dc64b727dc7f663920cd6 | |
| parent | c3d6d211fe7ee91de4adf61d1f60b09cc9207271 (diff) | |
| download | emacs-bf061ba601a6256352a04b19cd54c011614cc5fd.tar.gz emacs-bf061ba601a6256352a04b19cd54c011614cc5fd.zip | |
Doc fix.
(ebnf-version): New version (3.3).
(ebnf-user-arrow): Change variable customization to sexp.
(ebnf-user-arrow): Function eliminated.
(ebnf-eps-finish-and-write, ebnf-insert-ebnf-prologue): Code fix.
| -rw-r--r-- | lisp/progmodes/ebnf2ps.el | 100 |
1 files changed, 24 insertions, 76 deletions
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el index 493ceb9cecd..c19dc332b85 100644 --- a/lisp/progmodes/ebnf2ps.el +++ b/lisp/progmodes/ebnf2ps.el | |||
| @@ -5,8 +5,8 @@ | |||
| 5 | ;; Author: Vinicius Jose Latorre <vinicius@cpqd.com.br> | 5 | ;; Author: Vinicius Jose Latorre <vinicius@cpqd.com.br> |
| 6 | ;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br> | 6 | ;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br> |
| 7 | ;; Keywords: wp, ebnf, PostScript | 7 | ;; Keywords: wp, ebnf, PostScript |
| 8 | ;; Time-stamp: <2000/07/29 13:09:47 vinicius> | 8 | ;; Time-stamp: <2000/08/27 14:24:32 vinicius> |
| 9 | ;; Version: 3.2 | 9 | ;; Version: 3.3 |
| 10 | ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/Emacs.html | 10 | ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/Emacs.html |
| 11 | 11 | ||
| 12 | ;; This file is part of GNU Emacs. | 12 | ;; This file is part of GNU Emacs. |
| @@ -26,8 +26,8 @@ | |||
| 26 | ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 26 | ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 27 | ;; Boston, MA 02111-1307, USA. | 27 | ;; Boston, MA 02111-1307, USA. |
| 28 | 28 | ||
| 29 | (defconst ebnf-version "3.2" | 29 | (defconst ebnf-version "3.3" |
| 30 | "ebnf2ps.el, v 3.2 <2000/07/29 vinicius> | 30 | "ebnf2ps.el, v 3.2 <2000/08/27 vinicius> |
| 31 | 31 | ||
| 32 | Vinicius's last change version. When reporting bugs, please also | 32 | Vinicius's last change version. When reporting bugs, please also |
| 33 | report the version of Emacs, if any, that ebnf2ps was running with. | 33 | report the version of Emacs, if any, that ebnf2ps was running with. |
| @@ -607,7 +607,7 @@ Please send all bug fixes and enhancements to | |||
| 607 | ;; | 607 | ;; |
| 608 | ;; `ebnf-line-color' Specify flow line color. | 608 | ;; `ebnf-line-color' Specify flow line color. |
| 609 | ;; | 609 | ;; |
| 610 | ;; `ebnf-user-arrow' Specify a user arrow shape (a | 610 | ;; `ebnf-user-arrow' Specify a sexp for user arrow shape (a |
| 611 | ;; PostScript code). | 611 | ;; PostScript code). |
| 612 | ;; | 612 | ;; |
| 613 | ;; `ebnf-debug-ps' Non-nil means to generate PostScript | 613 | ;; `ebnf-debug-ps' Non-nil means to generate PostScript |
| @@ -1503,9 +1503,10 @@ See documentation for `ebnf-non-terminal-shape'." | |||
| 1503 | 1503 | ||
| 1504 | 1504 | ||
| 1505 | (defcustom ebnf-user-arrow nil | 1505 | (defcustom ebnf-user-arrow nil |
| 1506 | "*Specify a user arrow shape (a PostScript code). | 1506 | "*Specify a sexp for user arrow shape (a PostScript code). |
| 1507 | 1507 | ||
| 1508 | PostScript code should draw a right arrow. | 1508 | When evaluated, the sexp should return nil or a string containing PostScript |
| 1509 | code. PostScript code should draw a right arrow. | ||
| 1509 | 1510 | ||
| 1510 | The anatomy of a right arrow is: | 1511 | The anatomy of a right arrow is: |
| 1511 | 1512 | ||
| @@ -1535,17 +1536,8 @@ values, if you need to modify them. | |||
| 1535 | The relation between these variables is: hT = 2 * hT2 = 4 * hT4. | 1536 | The relation between these variables is: hT = 2 * hT2 = 4 * hT4. |
| 1536 | 1537 | ||
| 1537 | The variable `ebnf-user-arrow' is only used when `ebnf-arrow-shape' is set to | 1538 | The variable `ebnf-user-arrow' is only used when `ebnf-arrow-shape' is set to |
| 1538 | symbol `user'. | 1539 | symbol `user'." |
| 1539 | 1540 | :type '(sexp :tag "User Arrow Shape") | |
| 1540 | See function `ebnf-user-arrow' for valid values and how values are processed." | ||
| 1541 | :type '(radio :tag "User Arrow Shape" | ||
| 1542 | (const nil) | ||
| 1543 | string | ||
| 1544 | symbol | ||
| 1545 | (repeat :tag "List" | ||
| 1546 | (radio string | ||
| 1547 | symbol | ||
| 1548 | sexp))) | ||
| 1549 | :group 'ebnf-shape) | 1541 | :group 'ebnf-shape) |
| 1550 | 1542 | ||
| 1551 | 1543 | ||
| @@ -4380,17 +4372,16 @@ end | |||
| 4380 | "\n%%DocumentNeededResources: font " | 4372 | "\n%%DocumentNeededResources: font " |
| 4381 | (or ebnf-fonts-required | 4373 | (or ebnf-fonts-required |
| 4382 | (setq ebnf-fonts-required | 4374 | (setq ebnf-fonts-required |
| 4383 | (let ((fonts (ps-remove-duplicates | 4375 | (mapconcat 'identity |
| 4384 | (mapcar 'ebnf-font-name-select | 4376 | (ps-remove-duplicates |
| 4385 | (list ebnf-production-font | 4377 | (mapcar 'ebnf-font-name-select |
| 4386 | ebnf-terminal-font | 4378 | (list ebnf-production-font |
| 4387 | ebnf-non-terminal-font | 4379 | ebnf-terminal-font |
| 4388 | ebnf-special-font | 4380 | ebnf-non-terminal-font |
| 4389 | ebnf-except-font | 4381 | ebnf-special-font |
| 4390 | ebnf-repeat-font))))) | 4382 | ebnf-except-font |
| 4391 | (concat (car fonts) | 4383 | ebnf-repeat-font))) |
| 4392 | (and (cdr fonts) "\n%%+ font ") | 4384 | "\n%%+ font "))) |
| 4393 | (mapconcat 'identity (cdr fonts) "\n%%+ font "))))) | ||
| 4394 | "\n%%Pages: 0\n%%EndComments\n\n%%BeginPrologue\n" | 4385 | "\n%%Pages: 0\n%%EndComments\n\n%%BeginPrologue\n" |
| 4395 | ebnf-eps-prologue) | 4386 | ebnf-eps-prologue) |
| 4396 | (ebnf-insert-ebnf-prologue) | 4387 | (ebnf-insert-ebnf-prologue) |
| @@ -4553,57 +4544,14 @@ end | |||
| 4553 | (ebnf-shape-value ebnf-chart-shape | 4544 | (ebnf-shape-value ebnf-chart-shape |
| 4554 | ebnf-terminal-shape-alist)) | 4545 | ebnf-terminal-shape-alist)) |
| 4555 | (format "/UserArrow{%s}def\n" | 4546 | (format "/UserArrow{%s}def\n" |
| 4556 | (ebnf-user-arrow ebnf-user-arrow)) | 4547 | (let ((arrow (eval ebnf-user-arrow))) |
| 4548 | (if (stringp arrow) | ||
| 4549 | arrow | ||
| 4550 | ""))) | ||
| 4557 | "\n% === end EBNF settings\n\n" | 4551 | "\n% === end EBNF settings\n\n" |
| 4558 | (and ebnf-debug-ps ebnf-debug)))) | 4552 | (and ebnf-debug-ps ebnf-debug)))) |
| 4559 | ebnf-prologue)) | 4553 | ebnf-prologue)) |
| 4560 | 4554 | ||
| 4561 | |||
| 4562 | (defun ebnf-user-arrow (user-arrow) | ||
| 4563 | "Return a user arrow shape from USER-ARROW (a PostScript code). | ||
| 4564 | |||
| 4565 | This function is only called when `ebnf-arrow-shape' is set to symbol `user'. | ||
| 4566 | |||
| 4567 | If is a string, should be a PostScript procedure body. | ||
| 4568 | If is a variable symbol, should contain a string. | ||
| 4569 | If is a function symbol, it is called and the result is applied recursively. | ||
| 4570 | If is a cons and car is a function symbol, it is called as: | ||
| 4571 | (funcall (car cons) (cdr cons)) | ||
| 4572 | and the result is applied recursively. | ||
| 4573 | If is a cons and car is not a function symbol, it is applied recursively on | ||
| 4574 | car and cdr, and the results are concatened as: | ||
| 4575 | (concat RESULT-FROM-CAR \" \" RESULT-FROM-CDR) | ||
| 4576 | If is a list and car is a function symbol, it is called as: | ||
| 4577 | (apply (car list) (cdr list)) | ||
| 4578 | and the result is applied recursively. | ||
| 4579 | If is a list and car is not a function symbol, it is applied recursively on | ||
| 4580 | each element and the resulting list is concatened as: | ||
| 4581 | (mapconcat 'identity RESULTING-LIST \" \") | ||
| 4582 | Otherwise, it is treated as an empty string." | ||
| 4583 | (cond | ||
| 4584 | ((null user-arrow) | ||
| 4585 | "") | ||
| 4586 | ((stringp user-arrow) | ||
| 4587 | user-arrow) | ||
| 4588 | ((and (symbolp user-arrow) (fboundp user-arrow)) | ||
| 4589 | (ebnf-user-arrow (funcall user-arrow))) | ||
| 4590 | ((and (symbolp user-arrow) (boundp user-arrow)) | ||
| 4591 | (ebnf-user-arrow (symbol-value user-arrow))) | ||
| 4592 | ((consp user-arrow) | ||
| 4593 | (if (and (symbolp (car user-arrow)) (fboundp (car user-arrow))) | ||
| 4594 | (ebnf-user-arrow (funcall (car user-arrow) (cdr user-arrow))) | ||
| 4595 | (concat (ebnf-user-arrow (car user-arrow)) | ||
| 4596 | " " | ||
| 4597 | (ebnf-user-arrow (cdr user-arrow))))) | ||
| 4598 | ((listp user-arrow) | ||
| 4599 | (if (and (symbolp (car user-arrow)) | ||
| 4600 | (fboundp (car user-arrow))) | ||
| 4601 | (ebnf-user-arrow (apply (car user-arrow) (cdr user-arrow))) | ||
| 4602 | (mapconcat 'ebnf-user-arrow user-arrow " "))) | ||
| 4603 | (t | ||
| 4604 | "") | ||
| 4605 | )) | ||
| 4606 | |||
| 4607 | 4555 | ||
| 4608 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4556 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 4609 | ;; Adjusting dimensions | 4557 | ;; Adjusting dimensions |