[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 2b404e8: Use normal double quotes in TeX / LaTeX co
From: |
Karl Fogel |
Subject: |
[Emacs-diffs] master 2b404e8: Use normal double quotes in TeX / LaTeX comments |
Date: |
Tue, 30 Aug 2016 16:14:42 +0000 (UTC) |
branch: master
commit 2b404e8391b7ac26b734710d8290a6ef6a2e32b1
Author: Karl Fogel <address@hidden>
Commit: Karl Fogel <address@hidden>
Use normal double quotes in TeX / LaTeX comments
* lisp/textmodes/tex-mode.el (tex-insert-quote): When in a comment,
default to inserting a normal double quote (") instead of TeX-style
open (``) or close ('') quote marks.
* etc/NEWS (TeX mode): Note the change.
* test/lisp/electric-tests.el (autowrapping-7): Adjust accordingly.
See this thread for discussion:
https://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00611.html
From: Karl Fogel <kfogel {_AT_} red-bean.com>
To: Emacs Development <emacs-devel {_AT_} gnu.org>
Subject: [PATCH] Have LaTeX mode use normal double quotes in comments.
Date: Mon, 29 Aug 2016 14:44:12 -0500
Message-ID: <address@hidden>
---
etc/NEWS | 3 +++
lisp/textmodes/tex-mode.el | 1 +
test/lisp/electric-tests.el | 1 +
3 files changed, 5 insertions(+)
diff --git a/etc/NEWS b/etc/NEWS
index 1290fa4..ee2bc3a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1477,6 +1477,9 @@ looking for macro definitions. By default, no symbols
are ignored.
** TeX mode
+*** When in a TeX (LaTeX, etc) comment, insert a normal double quote (")
+instead of defaulting to TeX-style open (``) or close ('') quote marks.
+
*** New custom variable 'tex-print-file-extension' to help users who
use PDF instead of DVI.
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 710899f..4430fd6 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1311,6 +1311,7 @@ inserts \" characters."
;;
(if (or arg (memq (char-syntax (preceding-char)) '(?/ ?\\))
(eq (get-text-property (point) 'face) 'tex-verbatim)
+ (nth 4 (syntax-ppss)) ; non-nil if point is in a TeX comment
;; Discover if a preceding occurrence of `tex-open-quote'
;; should be morphed to a normal double quote.
;;
diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el
index afd7076..17b4e02 100644
--- a/test/lisp/electric-tests.el
+++ b/test/lisp/electric-tests.el
@@ -578,6 +578,7 @@ baz\"\""
(define-electric-pair-test autowrapping-7
"foo" "\"" :expected-string "``foo''" :expected-point 8
:modes '(tex-mode)
+ :test-in-comments nil
:fixture-fn #'(lambda ()
(electric-pair-mode 1)
(goto-char (point-max))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 2b404e8: Use normal double quotes in TeX / LaTeX comments,
Karl Fogel <=