4291 |
(defcustom TeX-quote-language-alist nil |
(defcustom TeX-quote-language-alist nil |
4292 |
"Alist for overriding the default language-specific quote insertion. |
"Alist for overriding the default language-specific quote insertion. |
4293 |
First element in each item is the name of the language as set by |
First element in each item is the name of the language as set by |
4294 |
the language style file. Second element is a cons cell |
the language style file. Second element is the opening quotation |
4295 |
containing the opening and closing quotation marks as strings. |
mark as string. Third element is the closing quotation mark. |
4296 |
Third element is a boolean specifying insertion behavior, |
Fourth element is a boolean specifying insertion behavior, |
4297 |
overriding `TeX-quote-after-quote'." |
overriding `TeX-quote-after-quote'." |
4298 |
:group 'TeX-quote |
:group 'TeX-quote |
4299 |
:type '(alist :key-type (string :tag "Language") |
:type '(repeat (group (string :tag "Language") |
4300 |
:value-type (group |
(string :tag "Opening quotation mark") |
4301 |
(cons (string :tag "Opening quotation mark") |
(string :tag "Closing quotation mark")) |
4302 |
(string :tag "Closing quotation mark")) |
(boolean :tag "Insert plain quote first" :value t)))) |
|
(boolean :tag "Insert plain quote first" |
|
|
:value t)))) |
|
4303 |
|
|
4304 |
(defvar TeX-quote-language nil |
(defvar TeX-quote-language nil |
4305 |
"If non-nil determines behavior of quote insertion. |
"If non-nil determines behavior of quote insertion. |
4306 |
It is usually set by language-related style files. Its value has |
It is usually set by language-related style files. Its value has |
4307 |
the same structure as the elements of `TeX-quote-language-alist'. |
the same structure as the elements of `TeX-quote-language-alist'. |
4308 |
The symbol 'override can be used as its the car in order to |
The symbol 'override can be used as its car in order to override |
4309 |
override the settings of style files. Style files should |
the settings of style files. Style files should therefore check |
4310 |
therefore check if this symbol is present and not alter |
if this symbol is present and not alter `TeX-quote-language' if |
4311 |
`TeX-quote-language' if it is.") |
it is.") |
4312 |
(make-variable-buffer-local 'TeX-quote-language) |
(make-variable-buffer-local 'TeX-quote-language) |
4313 |
|
|
4314 |
(defun TeX-insert-quote (force) |
(defun TeX-insert-quote (force) |
4337 |
(assoc (car TeX-quote-language) |
(assoc (car TeX-quote-language) |
4338 |
TeX-quote-language-alist))) |
TeX-quote-language-alist))) |
4339 |
(lang (or lang-override TeX-quote-language)) |
(lang (or lang-override TeX-quote-language)) |
4340 |
(open-quote (if lang (car (nth 1 lang)) TeX-open-quote)) |
(open-quote (if lang (nth 1 lang) TeX-open-quote)) |
4341 |
(close-quote (if lang (cdr (nth 1 lang)) TeX-close-quote)) |
(close-quote (if lang (nth 2 lang) TeX-close-quote)) |
4342 |
(q-after-q (if lang (nth 2 lang) TeX-quote-after-quote))) |
(q-after-q (if lang (nth 3 lang) TeX-quote-after-quote))) |
4343 |
(if q-after-q |
(if q-after-q |
4344 |
(insert (cond ((bobp) |
(insert (cond ((bobp) |
4345 |
?\") |
?\") |