]> git.eshelyaron.com Git - emacs.git/commitdiff
(texinfo-open-quote, texinfo-close-quote):
authorEli Zaretskii <eliz@gnu.org>
Sat, 2 Dec 2000 15:33:30 +0000 (15:33 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 2 Dec 2000 15:33:30 +0000 (15:33 +0000)
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.

lisp/ChangeLog
lisp/textmodes/texinfo.el

index ff8f53731fd63af1139c2147756d6180e4f77f2e..dd549963e45b83e04f142c2e655fea7a01004848 100644 (file)
@@ -1,5 +1,13 @@
 2000-12-02  Eli Zaretskii  <eliz@is.elta.co.il>
 
+       * textmode/texinfo.el (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.
+       
        * internat/mule.el (make-char): Doc fix.
 
 2000-12-02  Jason Rumney  <jasonr@gnu.org>
index 7f5ff90484b84b0dc204bb47bb32c0a4d3afd794..0564fe766a55d4e38faa39a0e077e8dc122f623a 100644 (file)
   "Texinfo Mode"
   :group 'docs)
 
+;;;###autoload
+(defcustom texinfo-open-quote "``"
+  "*String inserted by typing \\[texinfo-insert-quote] to open a quotation."
+  :type 'string
+  :group 'texinfo)
+
+;;;###autoload
+(defcustom texinfo-close-quote "''"
+  "*String inserted by typing \\[texinfo-insert-quote] to close a quotation."
+  :type 'string
+  :group 'texinfo)
+
 \f
 ;;; Autoloads:
 
@@ -241,6 +253,7 @@ chapter."
 ;;; Code:
 
 ;;; Don't you dare insert any `require' calls at top level in this file--rms.
+(eval-when-compile (require 'cl)) ;; for ignore-errors
 
 (defvar texinfo-section-list
   '(("top" 1)
@@ -655,18 +668,23 @@ Puts point on a blank line between them."
     (and (re-search-backward (concat "@\\(end\\s +\\)?" env) bound t)
         (looking-at (concat "@" env)))))
 
-(autoload 'tex-insert-quote "tex-mode" nil t)
 (defun texinfo-insert-quote (&optional arg)
   "Insert the appropriate quote mark for TeXinfo.
-Inserts a plain \" if inside @code or @example, else inserts `` or ''
-by calling `tex-insert-quote'."
+Usually inserts the value of `texinfo-open-quote' (normally ``) or
+`texinfo-close-quote' (normally ''), depending on the context.
+With prefix argument or inside @code or @example, inserts a plain \"."
   (interactive "*P")
   (let ((top (or (save-excursion (re-search-backward "@node\\>" nil t))
                 (point-min))))
-    (if (or (texinfo-inside-env-p "example\\>" top)
+    (if (or arg
+           (texinfo-inside-env-p "example\\>" top)
            (texinfo-inside-macro-p "@code\\>" top))
        (self-insert-command (prefix-numeric-value arg))
-      (tex-insert-quote arg))))
+      (insert
+       (cond ((= (preceding-char) ?\\) ?\")
+            ((memq (char-syntax (preceding-char)) '(?\( ?> ?\ ))
+             texinfo-open-quote)
+            (t texinfo-close-quote))))))
        
 ;; The following texinfo-insert-@end command not only inserts a SPC
 ;; after the @end, but tries to find out what belongs there.  It is