[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 202/299: Disable electric-pair-mode conditionally.
From: |
Stefan Monnier |
Subject: |
[elpa] 202/299: Disable electric-pair-mode conditionally. |
Date: |
Sun, 02 Nov 2014 03:11:27 +0000 |
monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 065c9325f99fd1c32c9aa5b67ee8c0a56e8219b9
Author: Tassilo Horn <address@hidden>
Date: Sun Dec 1 20:09:39 2013 +0100
Disable electric-pair-mode conditionally.
* latex.el (LaTeX-common-initialization): Move disabling of
`electric-pair-mode' from `VirTeX-common-initialization'. Disable
it only if `LaTeX-electric-left-right-brace' is non-nil.
* tex.el (VirTeX-common-initialization): See above.
---
ChangeLog | 8 ++++++++
latex.el | 53 ++++++++++++++++++++++++++++++-----------------------
tex.el | 8 +-------
3 files changed, 39 insertions(+), 30 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 80f89d7..786dcad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-12-01 Tassilo Horn <address@hidden>
+
+ * latex.el (LaTeX-common-initialization): Move disabling of
+ `electric-pair-mode' from `VirTeX-common-initialization'. Disable
+ it only if `LaTeX-electric-left-right-brace' is non-nil.
+
+ * tex.el (VirTeX-common-initialization): See above.
+
2013-11-29 Tassilo Horn <address@hidden>
* tex.el (VirTeX-common-initialization): Disable
diff --git a/latex.el b/latex.el
index e56e7b0..5f6d194 100644
--- a/latex.el
+++ b/latex.el
@@ -5615,7 +5615,7 @@ i.e. you do _not_ have to cater for this yourself by
adding \\\\' or $."
(setq paragraph-separate
(concat
"[ \t]*%*[ \t]*\\("
- "\\$\\$" ; Plain TeX display math
+ "\\$\\$" ; Plain TeX display math
"\\|$\\)"))
(setq TeX-verbatim-p-function 'LaTeX-verbatim-p)
@@ -5964,19 +5964,19 @@ i.e. you do _not_ have to cater for this yourself by
adding \\\\' or $."
'("documentclass" TeX-arg-document)))
(TeX-add-style-hook "latex2e"
- ;; Use new fonts for `\documentclass' documents.
- (lambda ()
- (setq TeX-font-list LaTeX-font-list)
- (setq TeX-font-replace-function 'TeX-font-replace-macro)
- (run-hooks 'LaTeX2e-hook)))
+ ;; Use new fonts for `\documentclass' documents.
+ (lambda ()
+ (setq TeX-font-list LaTeX-font-list)
+ (setq TeX-font-replace-function 'TeX-font-replace-macro)
+ (run-hooks 'LaTeX2e-hook)))
(TeX-add-style-hook "latex2"
- ;; Use old fonts for `\documentstyle' documents.
- (lambda ()
- (setq TeX-font-list (default-value 'TeX-font-list))
- (setq TeX-font-replace-function
- (default-value 'TeX-font-replace-function))
- (run-hooks 'LaTeX2-hook)))
+ ;; Use old fonts for `\documentstyle' documents.
+ (lambda ()
+ (setq TeX-font-list (default-value 'TeX-font-list))
+ (setq TeX-font-replace-function
+ (default-value 'TeX-font-replace-function))
+ (run-hooks 'LaTeX2-hook)))
;; There must be something better-suited, but I don't understand the
;; parsing properly. -- dak
@@ -5984,22 +5984,22 @@ i.e. you do _not_ have to cater for this yourself by
adding \\\\' or $."
(TeX-add-style-hook "pdftricks" 'TeX-PDF-mode-on)
(TeX-add-style-hook "pst-pdf" 'TeX-PDF-mode-on)
(TeX-add-style-hook "dvips" 'TeX-PDF-mode-off)
-;; This is now done in style/pstricks.el because it prevents other
-;; pstricks style files from being loaded.
-;; (TeX-add-style-hook "pstricks" 'TeX-PDF-mode-off)
+ ;; This is now done in style/pstricks.el because it prevents other
+ ;; pstricks style files from being loaded.
+ ;; (TeX-add-style-hook "pstricks" 'TeX-PDF-mode-off)
(TeX-add-style-hook "psfrag" 'TeX-PDF-mode-off)
(TeX-add-style-hook "dvipdf" 'TeX-PDF-mode-off)
(TeX-add-style-hook "dvipdfm" 'TeX-PDF-mode-off)
-;; (TeX-add-style-hook "DVIoutput" 'TeX-PDF-mode-off)
-;;
-;; Well, DVIoutput indicates that we want to run PDFTeX and expect to
-;; get DVI output. Ugh.
+ ;; (TeX-add-style-hook "DVIoutput" 'TeX-PDF-mode-off)
+ ;;
+ ;; Well, DVIoutput indicates that we want to run PDFTeX and expect to
+ ;; get DVI output. Ugh.
(TeX-add-style-hook "ifpdf" (lambda ()
(TeX-PDF-mode-on)
(TeX-PDF-mode-off)))
-;; ifpdf indicates that we cater for either. So calling both
-;; functions will make sure that the default will get used unless the
-;; user overrode it.
+ ;; ifpdf indicates that we cater for either. So calling both
+ ;; functions will make sure that the default will get used unless the
+ ;; user overrode it.
(set (make-local-variable 'imenu-create-index-function)
'LaTeX-imenu-create-index-function)
@@ -6013,7 +6013,14 @@ i.e. you do _not_ have to cater for this yourself by
adding \\\\' or $."
(easy-menu-add LaTeX-mode-menu LaTeX-mode-map)
(easy-menu-add LaTeX-mode-command-menu LaTeX-mode-map)
- (define-key LaTeX-mode-map "\C-xne" 'LaTeX-narrow-to-environment))
+ (define-key LaTeX-mode-map "\C-xne" 'LaTeX-narrow-to-environment)
+
+ ;; AUCTeX's brace pairing feature (`LaTeX-electric-left-right-brace') doesn't
+ ;; play nice with `electric-pair-mode' which is a global minor mode as of
+ ;; emacs 24.4.
+ (when (and LaTeX-electric-left-right-brace
+ (boundp 'electric-pair-mode))
+ (set (make-local-variable 'electric-pair-mode) nil)))
(defun LaTeX-imenu-create-index-function ()
"Imenu support function for LaTeX."
diff --git a/tex.el b/tex.el
index ea882f6..07c452e 100644
--- a/tex.el
+++ b/tex.el
@@ -3169,13 +3169,7 @@ The algorithm is as follows:
(when (or (not (file-exists-p (buffer-file-name)))
(eq TeX-master 'shared))
(TeX-master-file nil nil t))
- (TeX-update-style t)) nil t)
- ;; AUCTeX brace pairing feature doesn't play nice with `electric-pair-mode'
- ;; which is a global minor mode as of emacs 24.4.
- (when (and (boundp 'electric-pair-mode)
- (boundp 'electric-pair-inhibit-predicate))
- (set (make-local-variable 'electric-pair-inhibit-predicate)
- (lambda (char) t))))
+ (TeX-update-style t)) nil t))
;;; Hilighting
- [elpa] 194/299: Distinguish normal and expert macros/envs., (continued)
- [elpa] 194/299: Distinguish normal and expert macros/envs., Stefan Monnier, 2014/11/01
- [elpa] 196/299: * bib-cite.el (bib-highlight-mouse): Change regexp to cope with multiple optional arguments of a macro., Stefan Monnier, 2014/11/01
- [elpa] 192/299: Revert "Distinguish common and advanced macros/envs.", Stefan Monnier, 2014/11/01
- [elpa] 197/299: Fix C-x ` (next-error) for compile commands., Stefan Monnier, 2014/11/01
- [elpa] 200/299: Fix of the fix, my fault., Stefan Monnier, 2014/11/01
- [elpa] 195/299: Better signature of expert declaration functions., Stefan Monnier, 2014/11/01
- [elpa] 204/299: Revert "Skip comment or file in parens in output.", Stefan Monnier, 2014/11/01
- [elpa] 201/299: Disable electric-pair-mode., Stefan Monnier, 2014/11/01
- [elpa] 191/299: Distinguish common and advanced macros/envs., Stefan Monnier, 2014/11/01
- [elpa] 207/299: Add font name completion in fontspec.el., Stefan Monnier, 2014/11/01
- [elpa] 202/299: Disable electric-pair-mode conditionally.,
Stefan Monnier <=
- [elpa] 205/299: Handle package messages with parenthesized text., Stefan Monnier, 2014/11/01
- [elpa] 208/299: Use TeX-electric-math in LaTeX-math-insert/cal., Stefan Monnier, 2014/11/01
- [elpa] 199/299: Fix bindings of narrowing functions., Stefan Monnier, 2014/11/01
- [elpa] 209/299: Fix a bug with reftex where tex-info and LaTeX interferred., Stefan Monnier, 2014/11/01
- [elpa] 206/299: New style files and a fix to imakeidx.el., Stefan Monnier, 2014/11/01
- [elpa] 203/299: Skip comment or file in parens in output., Stefan Monnier, 2014/11/01
- [elpa] 211/299: Adapt style/babel.el to babel 3.9., Stefan Monnier, 2014/11/01
- [elpa] 210/299: Make search for \begin and \end case sensitive., Stefan Monnier, 2014/11/01
- [elpa] 214/299: Fix syntactic fontification., Stefan Monnier, 2014/11/01
- [elpa] 215/299: Declare LaTeX-shortvrb-chars as safe local variable., Stefan Monnier, 2014/11/01