100 |
|
|
101 |
(defcustom font-latex-quotes 'french |
(defcustom font-latex-quotes 'french |
102 |
"Whether to fontify << French quotes >> or >>German quotes<<. |
"Whether to fontify << French quotes >> or >>German quotes<<. |
103 |
Also selects \"<quote\"> versus \">quote\"<. |
Also selects \"<quote\"> versus \">quote\"<." |
|
|
|
|
Setting this variable directly does not take effect; |
|
|
use \\[customize]." |
|
104 |
:type '(choice (const french) (const german)) |
:type '(choice (const french) (const german)) |
|
:set (lambda (symbol value) |
|
|
(set-default symbol value) |
|
|
(if (equal value 'french) |
|
|
(setq font-latex-quote-list |
|
|
'(("``" . "''") ("\"`" . "\"'") |
|
|
("\"<" . "\">") ("<<" . ">>") ("«" . "»"))) |
|
|
(setq font-latex-quote-list |
|
|
'(("``" . "''") ("\"`" . "\"'") |
|
|
("\">" . "\"<") (">>" . "<<") ("»" . "«")))) |
|
|
(setq font-latex-quote-regexp-beg |
|
|
(regexp-opt (mapcar 'car font-latex-quote-list) t))) |
|
105 |
:group 'font-latex) |
:group 'font-latex) |
106 |
|
|
107 |
|
(defvar font-latex-quotes-control font-latex-quotes |
108 |
|
"Internal variable for keeping track if `font-latex-quotes' changed.") |
109 |
|
|
110 |
;; The definitions of the title faces were originally taken from |
;; The definitions of the title faces were originally taken from |
111 |
;; info.el (Copyright (C) 1985, 86, 92, 93, 94, 95, 96, 97, 98, 99, |
;; info.el (Copyright (C) 1985, 86, 92, 93, 94, 95, 96, 97, 98, 99, |
112 |
;; 2000, 2001 Free Software Foundation, Inc.) and adapted to the needs |
;; 2000, 2001 Free Software Foundation, Inc.) and adapted to the needs |
1417 |
\"< french \"> and \"`german\"' quotes. |
\"< french \"> and \"`german\"' quotes. |
1418 |
The quotes << french >> and 8-bit french are used if `font-latex-quotes' is |
The quotes << french >> and 8-bit french are used if `font-latex-quotes' is |
1419 |
set to french, and >> german << (and 8-bit) are used if set to german." |
set to french, and >> german << (and 8-bit) are used if set to german." |
1420 |
|
;; Update quotes list and regexp if value of `font-latex-quotes' changed. |
1421 |
|
(unless (eq font-latex-quotes-control font-latex-quotes) |
1422 |
|
(setq font-latex-quotes-control font-latex-quotes) |
1423 |
|
(if (eq font-latex-quotes 'french) |
1424 |
|
(setq font-latex-quote-list |
1425 |
|
'(("``" . "''") ("\"`" . "\"'") |
1426 |
|
("\"<" . "\">") ("<<" . ">>") ("«" . "»"))) |
1427 |
|
(setq font-latex-quote-list |
1428 |
|
'(("``" . "''") ("\"`" . "\"'") |
1429 |
|
("\">" . "\"<") (">>" . "<<") ("»" . "«")))) |
1430 |
|
(setq font-latex-quote-regexp-beg |
1431 |
|
(regexp-opt (mapcar 'car font-latex-quote-list) t))) |
1432 |
|
;; Search for matches. |
1433 |
(when (re-search-forward font-latex-quote-regexp-beg limit t) |
(when (re-search-forward font-latex-quote-regexp-beg limit t) |
1434 |
(let ((beg (match-beginning 0))) |
(let ((beg (match-beginning 0))) |
1435 |
(search-forward (cdr (assoc (match-string 0) font-latex-quote-list)) |
(search-forward (cdr (assoc (match-string 0) font-latex-quote-list)) |