emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/textmodes/tex-mode.el,v


From: Reiner Steib
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/tex-mode.el,v
Date: Mon, 09 Jul 2007 19:14:49 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Reiner Steib <rsteib>   07/07/09 19:14:48

Index: textmodes/tex-mode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/textmodes/tex-mode.el,v
retrieving revision 1.186
retrieving revision 1.187
diff -u -b -r1.186 -r1.187
--- textmodes/tex-mode.el       10 May 2007 06:00:47 -0000      1.186
+++ textmodes/tex-mode.el       9 Jul 2007 19:14:47 -0000       1.187
@@ -243,6 +243,21 @@
   :options '("''" "\">" "\"'" ">>" "»")
   :group 'tex)
 
+(defcustom tex-fontify-script t
+  "If non-nil, fontify subscript and superscript strings."
+  :type 'boolean
+  :group 'tex)
+(put 'tex-fontify-script 'safe-local-variable 'booleanp)
+
+(defcustom tex-font-script-display '(-0.3 . 0.3)
+  "Display specification for subscript and superscript content.
+The car is used for subscript, the cdr is used for superscripts."
+  :group 'tex
+  :type '(cons (choice (float :tag "Subscript")
+                      (const :tag "No lowering" nil))
+              (choice (float :tag "Superscript")
+                      (const :tag "No raising" nil))))
+
 (defvar tex-last-temp-file nil
   "Latest temporary file generated by \\[tex-region] and \\[tex-buffer].
 Deleted when the \\[tex-region] or \\[tex-buffer] is next run, or when the
@@ -593,13 +608,14 @@
                  (setq pos (1- pos) odd (not odd)))
                odd))
     (if (eq (char-after pos) ?_)
-       '(face subscript display (raise -0.3))
-      '(face superscript display (raise +0.3)))))
+       `(face subscript display (raise ,(car tex-font-script-display)))
+      `(face superscript display (raise ,(cdr tex-font-script-display))))))
 
 (defun tex-font-lock-match-suscript (limit)
   "Match subscript and superscript patterns up to LIMIT."
-  (when (re-search-forward "[_^] *\\([^\n\\{}]\\|\
-\\\\\\(address@hidden|[^ \t\n]\\)\\|\\({\\)\\)" limit t)
+  (when (and tex-fontify-script
+            (re-search-forward "[_^] *\\([^\n\\{}]\\|\
+\\\\\\(address@hidden|[^ \t\n]\\)\\|\\({\\)\\)" limit t))
     (when (match-end 3)
       (let ((beg (match-beginning 3))
            (end (save-restriction




reply via email to

[Prev in Thread] Current Thread [Next in Thread]