[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] Changes to auctex/font-latex.el,v [multiline]
From: |
Ralf Angeli |
Subject: |
[AUCTeX-diffs] Changes to auctex/font-latex.el,v [multiline] |
Date: |
Tue, 06 Jun 2006 19:59:41 +0000 |
CVSROOT: /cvsroot/auctex
Module name: auctex
Branch: multiline
Changes by: Ralf Angeli <angeli> 06/06/06 19:59:40
Index: font-latex.el
===================================================================
RCS file: /cvsroot/auctex/auctex/font-latex.el,v
retrieving revision 5.147.2.3
retrieving revision 5.147.2.4
diff -u -b -r5.147.2.3 -r5.147.2.4
--- font-latex.el 9 May 2006 21:57:26 -0000 5.147.2.3
+++ font-latex.el 6 Jun 2006 19:59:40 -0000 5.147.2.4
@@ -23,8 +23,8 @@
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
;;
@@ -68,6 +68,7 @@
(defvar font-latex-quote-regexp-beg nil
"Regexp used to find quotes.")
+(make-variable-buffer-local 'font-latex-quote-regexp-beg)
(defvar font-latex-quote-list '(("``" "''") ("<<" ">>" french) ("«" "»"
french))
"List of quote specifiers for quotation fontification.
@@ -88,21 +89,64 @@
(defvar font-latex-quotes-control nil
"Internal variable for keeping track if `font-latex-quotes' changed.")
+(make-variable-buffer-local 'font-latex-quotes-control)
-(defcustom font-latex-quotes 'french
+(defvar font-latex-quotes-internal nil
+ "Internal variable for tracking outcome of automatic detection.
+If automatic detection is not enabled, it is assigned the value
+of `font-latex-quotes'.")
+(make-variable-buffer-local 'font-latex-quotes-internal)
+
+(defvar font-latex-quotes-fallback 'french
+ "Fallback value for `font-latex-quotes' if automatic detection fails.")
+
+(defvar font-latex-quote-style-list-french
+ '("french" "frenchb" "frenchle" "frenchpro" "francais" "canadien"
+ "acadian" "italian")
+ "List of styles for which French-style quote matching should be activated.")
+
+(defvar font-latex-quote-style-list-german
+ '("austrian" "german" "germanb" "naustrian" "ngerman")
+ "List of styles for which German-style quote matching should be activated.")
+
+(defcustom font-latex-quotes 'auto
"Whether to fontify << French quotes >> or >>German quotes<<.
-Also selects \"<quote\"> versus \">quote\"<."
- :type '(choice (const french) (const german))
+Also selects \"<quote\"> versus \">quote\"<.
+
+If value `auto' is chosen, an attempt is being made in deriving
+the type of quotation mark matching from document settings like
+the language option supplied to the babel package."
+ :type '(choice (const auto) (const french) (const german))
:group 'font-latex)
+(put 'font-latex-quotes 'safe-local-variable
+ '(lambda (x) (memq x '(auto french german))))
(defun font-latex-add-quotes (quotes)
"Add QUOTES to `font-latex-quote-list'.
QUOTES has to be a list adhering to the format of an element of
`font-latex-quote-list'."
- (set (make-local-variable 'font-latex-quotes-control) nil)
+ (setq font-latex-quotes-control nil)
(make-local-variable 'font-latex-quote-list)
(add-to-list 'font-latex-quote-list quotes))
+(defun font-latex-quotes-set-internal ()
+ "Set `font-latex-quotes-internal' according to `font-latex-quotes'.
+If `font-latex-quotes' is set to `auto', try to derive the
+correct value from document properties."
+ (setq font-latex-quotes-internal
+ (if (eq font-latex-quotes 'auto)
+ (or (when (TeX-elt-of-list-member
+ font-latex-quote-style-list-french TeX-active-styles)
+ 'french)
+ (when (TeX-elt-of-list-member
+ font-latex-quote-style-list-german TeX-active-styles)
+ 'german)
+ font-latex-quotes-fallback)
+ font-latex-quotes)))
+;; Update the value of `font-latex-quotes-internal' when the list of
+;; styles changes.
+(add-hook 'TeX-update-style-hook 'font-latex-quotes-set-internal)
+
;; The definitions of the title faces were originally taken from
;; info.el (Copyright (C) 1985, 86, 92, 93, 94, 95, 96, 97, 98, 99,
;; 2000, 2001 Free Software Foundation, Inc.) and adapted to the needs
@@ -716,6 +760,7 @@
This feature does not work in XEmacs."
:type 'boolean
:group 'font-latex)
+(put 'font-latex-fontify-script 'safe-local-variable 'TeX-booleanp)
(defcustom font-latex-script-display '((raise -0.3) . (raise 0.3))
"Display specification for subscript and superscript content.
@@ -1479,15 +1524,17 @@
"Update quote list and regexp if value of `font-latex-quotes' changed."
(unless (eq font-latex-quotes-control font-latex-quotes)
(setq font-latex-quotes-control font-latex-quotes)
+ (font-latex-quotes-set-internal)
;; Set order of each entry in `font-latex-quote-list' according to
- ;; setting of `font-latex-quotes'.
+ ;; setting of `font-latex-quotes-internal'.
(let ((tail font-latex-quote-list)
elt)
(while tail
(setq elt (car tail))
(when (and (> (safe-length elt) 2)
- (not (eq (nth 2 elt) font-latex-quotes)))
- (setcar tail (list (nth 1 elt) (nth 0 elt) font-latex-quotes)))
+ (not (eq (nth 2 elt) font-latex-quotes-internal)))
+ (setcar tail (list (nth 1 elt) (nth 0 elt)
+ font-latex-quotes-internal)))
(setq tail (cdr tail))))
(setq font-latex-quote-regexp-beg
(regexp-opt (mapcar 'car font-latex-quote-list) t))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [AUCTeX-diffs] Changes to auctex/font-latex.el,v [multiline],
Ralf Angeli <=