diff options
| author | João Távora | 2015-04-26 11:44:41 +0100 |
|---|---|---|
| committer | João Távora | 2015-04-26 11:44:41 +0100 |
| commit | a40869789fc5502e3d4e393b7c31d78cb7f29aa1 (patch) | |
| tree | 8e2ec7195e4589d307e93132a0bc33f1831a0fc2 | |
| parent | fddff05e889b3290222cdfd339af78c074ea1b3e (diff) | |
| download | emacs-a40869789fc5502e3d4e393b7c31d78cb7f29aa1.tar.gz emacs-a40869789fc5502e3d4e393b7c31d78cb7f29aa1.zip | |
`tex-insert-quote' after single `'' opens quotes instead of closing
Without this, it's very hard to precede double quotes with the
apostrophe character, i.e. insert the sequence '``
(quote-backquote-backquote), commonly useful in portuguese, for
instance.
* tex-mode.el (tex-insert-quote): Add ?' to the list of preceding
chars making `tex-insert-quote' be in the "opening" context.
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index c26c6098364..274cb4aa434 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -1331,7 +1331,9 @@ inserts \" characters." | |||
| 1331 | (goto-char saved) | 1331 | (goto-char saved) |
| 1332 | (insert (if (> saved (mark)) tex-close-quote tex-open-quote))) | 1332 | (insert (if (> saved (mark)) tex-close-quote tex-open-quote))) |
| 1333 | (if (or (memq (char-syntax (preceding-char)) '(?\( ?> ?\s)) | 1333 | (if (or (memq (char-syntax (preceding-char)) '(?\( ?> ?\s)) |
| 1334 | (memq (preceding-char) '(?~))) | 1334 | (memq (preceding-char) '(?~ ?'))) |
| 1335 | ;; We're in an "opening" context | ||
| 1336 | ;; | ||
| 1335 | (if electric-pair-mode | 1337 | (if electric-pair-mode |
| 1336 | (if (looking-at (regexp-quote tex-close-quote)) | 1338 | (if (looking-at (regexp-quote tex-close-quote)) |
| 1337 | (forward-char (length tex-close-quote)) | 1339 | (forward-char (length tex-close-quote)) |
| @@ -1339,6 +1341,8 @@ inserts \" characters." | |||
| 1339 | (insert tex-close-quote) | 1341 | (insert tex-close-quote) |
| 1340 | (backward-char (length tex-close-quote))) | 1342 | (backward-char (length tex-close-quote))) |
| 1341 | (insert tex-open-quote)) | 1343 | (insert tex-open-quote)) |
| 1344 | ;; We're in a "closing" context. | ||
| 1345 | ;; | ||
| 1342 | (if (looking-at (regexp-quote tex-close-quote)) | 1346 | (if (looking-at (regexp-quote tex-close-quote)) |
| 1343 | (forward-char (length tex-close-quote)) | 1347 | (forward-char (length tex-close-quote)) |
| 1344 | (insert tex-close-quote)))))) | 1348 | (insert tex-close-quote)))))) |