diff options
| author | Eli Zaretskii | 2000-12-02 15:33:30 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2000-12-02 15:33:30 +0000 |
| commit | 9768eaa75d86f08bcea5aaf477693d58f8471cb0 (patch) | |
| tree | 781b39274261b4adaad38ba5f49ac63e6385b4fa | |
| parent | d3e7e7cf2c868daaf915c9c10a8f57675d02dc56 (diff) | |
| download | emacs-9768eaa75d86f08bcea5aaf477693d58f8471cb0.tar.gz emacs-9768eaa75d86f08bcea5aaf477693d58f8471cb0.zip | |
(texinfo-open-quote, texinfo-close-quote):
New defcustoms.
(texinfo-insert-quote): Don't call tex-insert-quote, to avoid
autoloading tex-mode; instead, do the same manually. Use
texinfo-open-quote and texinfo-close-quote. Insert literal quote
with numeric argument. Docstring fix.
(toplevel): Require cl when compiling.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/textmodes/texinfo.el | 28 |
2 files changed, 31 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ff8f53731fd..dd549963e45 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,13 @@ | |||
| 1 | 2000-12-02 Eli Zaretskii <eliz@is.elta.co.il> | 1 | 2000-12-02 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 2 | ||
| 3 | * textmode/texinfo.el (texinfo-open-quote, texinfo-close-quote): | ||
| 4 | New defcustoms. | ||
| 5 | (texinfo-insert-quote): Don't call tex-insert-quote, to avoid | ||
| 6 | autoloading tex-mode; instead, do the same manually. Use | ||
| 7 | texinfo-open-quote and texinfo-close-quote. Insert literal quote | ||
| 8 | with numeric argument. Docstring fix. | ||
| 9 | (toplevel): Require cl when compiling. | ||
| 10 | |||
| 3 | * internat/mule.el (make-char): Doc fix. | 11 | * internat/mule.el (make-char): Doc fix. |
| 4 | 12 | ||
| 5 | 2000-12-02 Jason Rumney <jasonr@gnu.org> | 13 | 2000-12-02 Jason Rumney <jasonr@gnu.org> |
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index 7f5ff90484b..0564fe766a5 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el | |||
| @@ -37,6 +37,18 @@ | |||
| 37 | "Texinfo Mode" | 37 | "Texinfo Mode" |
| 38 | :group 'docs) | 38 | :group 'docs) |
| 39 | 39 | ||
| 40 | ;;;###autoload | ||
| 41 | (defcustom texinfo-open-quote "``" | ||
| 42 | "*String inserted by typing \\[texinfo-insert-quote] to open a quotation." | ||
| 43 | :type 'string | ||
| 44 | :group 'texinfo) | ||
| 45 | |||
| 46 | ;;;###autoload | ||
| 47 | (defcustom texinfo-close-quote "''" | ||
| 48 | "*String inserted by typing \\[texinfo-insert-quote] to close a quotation." | ||
| 49 | :type 'string | ||
| 50 | :group 'texinfo) | ||
| 51 | |||
| 40 | 52 | ||
| 41 | ;;; Autoloads: | 53 | ;;; Autoloads: |
| 42 | 54 | ||
| @@ -241,6 +253,7 @@ chapter." | |||
| 241 | ;;; Code: | 253 | ;;; Code: |
| 242 | 254 | ||
| 243 | ;;; Don't you dare insert any `require' calls at top level in this file--rms. | 255 | ;;; Don't you dare insert any `require' calls at top level in this file--rms. |
| 256 | (eval-when-compile (require 'cl)) ;; for ignore-errors | ||
| 244 | 257 | ||
| 245 | (defvar texinfo-section-list | 258 | (defvar texinfo-section-list |
| 246 | '(("top" 1) | 259 | '(("top" 1) |
| @@ -655,18 +668,23 @@ Puts point on a blank line between them." | |||
| 655 | (and (re-search-backward (concat "@\\(end\\s +\\)?" env) bound t) | 668 | (and (re-search-backward (concat "@\\(end\\s +\\)?" env) bound t) |
| 656 | (looking-at (concat "@" env))))) | 669 | (looking-at (concat "@" env))))) |
| 657 | 670 | ||
| 658 | (autoload 'tex-insert-quote "tex-mode" nil t) | ||
| 659 | (defun texinfo-insert-quote (&optional arg) | 671 | (defun texinfo-insert-quote (&optional arg) |
| 660 | "Insert the appropriate quote mark for TeXinfo. | 672 | "Insert the appropriate quote mark for TeXinfo. |
| 661 | Inserts a plain \" if inside @code or @example, else inserts `` or '' | 673 | Usually inserts the value of `texinfo-open-quote' (normally ``) or |
| 662 | by calling `tex-insert-quote'." | 674 | `texinfo-close-quote' (normally ''), depending on the context. |
| 675 | With prefix argument or inside @code or @example, inserts a plain \"." | ||
| 663 | (interactive "*P") | 676 | (interactive "*P") |
| 664 | (let ((top (or (save-excursion (re-search-backward "@node\\>" nil t)) | 677 | (let ((top (or (save-excursion (re-search-backward "@node\\>" nil t)) |
| 665 | (point-min)))) | 678 | (point-min)))) |
| 666 | (if (or (texinfo-inside-env-p "example\\>" top) | 679 | (if (or arg |
| 680 | (texinfo-inside-env-p "example\\>" top) | ||
| 667 | (texinfo-inside-macro-p "@code\\>" top)) | 681 | (texinfo-inside-macro-p "@code\\>" top)) |
| 668 | (self-insert-command (prefix-numeric-value arg)) | 682 | (self-insert-command (prefix-numeric-value arg)) |
| 669 | (tex-insert-quote arg)))) | 683 | (insert |
| 684 | (cond ((= (preceding-char) ?\\) ?\") | ||
| 685 | ((memq (char-syntax (preceding-char)) '(?\( ?> ?\ )) | ||
| 686 | texinfo-open-quote) | ||
| 687 | (t texinfo-close-quote)))))) | ||
| 670 | 688 | ||
| 671 | ;; The following texinfo-insert-@end command not only inserts a SPC | 689 | ;; The following texinfo-insert-@end command not only inserts a SPC |
| 672 | ;; after the @end, but tries to find out what belongs there. It is | 690 | ;; after the @end, but tries to find out what belongs there. It is |