auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 513490f7b15fbc4676c70


From: Tassilo Horn
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 513490f7b15fbc4676c706e3968eba9768d0194c
Date: Thu, 03 Sep 2015 10:48:55 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  513490f7b15fbc4676c706e3968eba9768d0194c (commit)
      from  dd9adef7b2fee77fa2da0be5f6891e2d2649a46e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 513490f7b15fbc4676c706e3968eba9768d0194c
Author: Tassilo Horn <address@hidden>
Date:   Thu Sep 3 12:48:24 2015 +0200

    Implement multi-level script fontification
    
    * font-latex.el (font-latex-fontify-script): Add possible value
    `multi-level' to allow raising/lowering scripts of scripts.
    (font-latex-match-script): Use it.

diff --git a/ChangeLog b/ChangeLog
index d57cf18..3d698b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2015-09-03  Tassilo Horn  <address@hidden>
 
+       * font-latex.el (font-latex-fontify-script): Add possible value
+       `multi-level' to allow raising/lowering scripts of scripts.
+       (font-latex-match-script): Use it.
+
        * tex.el (TeX-tex-mode): Don't ignore case when matching the
        TeX-format-list regexes.
        (TeX-expand-list): Add expansion of %(PDFout) to -output-format
diff --git a/font-latex.el b/font-latex.el
index 18c0866..2a9fc26 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -851,10 +851,22 @@ locking machinery will be triggered."
 
 (defcustom font-latex-fontify-script (not (featurep 'xemacs))
   "If non-nil, fontify subscript and superscript strings.
-This feature does not work in XEmacs."
-  :type 'boolean
+This feature does not work in XEmacs.
+
+By default, super/subscripts are raised/lowered if this variable
+is non-nil.  This fontification only affects one level of
+scripts, e.g., in x^y^z, the y and the z have the same size and
+are equally raised over x.  If this variable is set to the symbol
+`multi-level', then y is raised above x, and z is raised above y.
+With many script levels, the text might become too small to be
+readable."
+  :type '(choice (boolean :tag "Enabled")
+                (const :tag "Multiple levels" multi-level))
   :group 'font-latex)
-(put 'font-latex-fontify-script 'safe-local-variable 'TeX-booleanp)
+(put 'font-latex-fontify-script 'safe-local-variable
+     (lambda (val)
+       (or (TeX-booleanp val)
+          (eq 'multi-level val))))
 
 (defcustom font-latex-script-display '((raise -0.3) . (raise 0.3))
   "Display specification for subscript and superscript content.
@@ -1852,11 +1864,12 @@ END marks boundaries for searching for quotation ends."
   (when (and font-latex-fontify-script
             (re-search-forward "[_^] *\\([^\n\\{}]\\|\
 \\\\\\(address@hidden|[^ \t\n]\\)\\|\\({\\)\\)" limit t))
-    (if (font-latex-faces-present-p '(font-latex-subscript-face
-                                     font-latex-superscript-face))
-       ;; Apply subscript and superscript highlighting only once in
-       ;; order to prevent the font size becoming too small.  We set
-       ;; an empty match to do that.
+    (if (and (not (eq 'multi-level font-latex-fontify-script))
+            (font-latex-faces-present-p '(font-latex-subscript-face
+                                          font-latex-superscript-face)))
+       ;; Apply subscript and superscript highlighting only once (in case
+       ;; font-latex-fontify-script is not 'multi-level) in order to prevent
+       ;; the font size becoming too small.  We set an empty match to do that.
        (let ((point (point)))
          (store-match-data (list point point point point)))
       (when (match-end 3)

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog     |    4 ++++
 font-latex.el |   29 +++++++++++++++++++++--------
 2 files changed, 25 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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