[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/cdlatex 880723a514 17/49: New variable `cdlatex-use-dollar
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/cdlatex 880723a514 17/49: New variable `cdlatex-use-dollar-to-ensure-math'. |
Date: |
Mon, 11 Jul 2022 02:58:32 -0400 (EDT) |
branch: elpa/cdlatex
commit 880723a514d63e1e14099df7d8d0b9f0566f8aa6
Author: Carsten Dominik <carsten.dominik@gmail.com>
Commit: Carsten Dominik <carsten.dominik@gmail.com>
New variable `cdlatex-use-dollar-to-ensure-math'.
When this variable is set to nil, \(...\) will be used instead.
---
cdlatex.el | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/cdlatex.el b/cdlatex.el
index 3cf6b5949e..e9c60b38bc 100644
--- a/cdlatex.el
+++ b/cdlatex.el
@@ -1,9 +1,9 @@
;;; cdlatex.el --- Fast input methods for LaTeX environments and math
-;; Copyright (c) 2010, 2011, 2012, 2014, 2019 Free Software Foundation, Inc.
+;; Copyright (c) 2010, 2011, 2012, 2014, 2019, 2020 Free Software Foundation,
Inc.
;;
;; Author: Carsten Dominik <carsten.dominik@gmail.com>
;; Keywords: tex
-;; Version: 4.8
+;; Version: 4.9
;;
;; This file is not part of GNU Emacs.
;;
@@ -558,6 +558,12 @@ When nil, `_' and `^' will just self-insert."
:group 'cdlatex-miscellaneous-configurations
:type '(boolean))
+(defcustom cdlatex-use-dollar-to-ensure-math t
+ "*Non-nil means, use $...$ to force a math mode setting where needed.
+When nil, use \\(...\\) instead."
+ :group 'cdlatex-miscellaneous-configurations
+ :type '(boolean))
+
(defcustom cdlatex-auto-help-delay 1.5
"Number of idle seconds before display of auto-help.
When executing cdlatex-math-symbol or cdlatex-math-modify, display
@@ -742,7 +748,10 @@ Entering cdlatex-mode calls the hook cdlatex-mode-hook.
(defun cdlatex-ensure-math ()
;; Make sure we are in math
(unless (texmathp)
- (cdlatex-dollar)))
+ (if cdlatex-use-dollar-to-ensure-math
+ (cdlatex-dollar)
+ (insert "\\(\\)")
+ (backward-char 2))))
(defun cdlatex-dollar (&optional arg)
"Insert a pair of dollars unless number of backslashes before point is odd.
@@ -783,7 +792,7 @@ When not in LaTeX math environment, _{} and ^{} will have
dollars."
(if (and (not (texmathp))
(not cdlatex-sub-super-scripts-outside-math-mode))
(insert (event-basic-type last-command-event))
- (if (not (texmathp)) (cdlatex-dollar))
+ (if (not (texmathp)) (cdlatex-ensure-math))
(if (string= (buffer-substring (max (point-min) (- (point) 2)) (point))
(concat (char-to-string (event-basic-type
last-command-event))
"{"))
@@ -1114,7 +1123,7 @@ math environment, you also get a pair of dollars."
(if (or (not (texmathp))
(cdlatex-number-of-backslashes-is-odd))
- (cdlatex-dollar))
+ (cdlatex-ensure-math))
(insert symbol)
(when (string-match "\\?" symbol)
- [nongnu] elpa/cdlatex 6ae740fccd 34/49: Fixed a couple typos, (continued)
- [nongnu] elpa/cdlatex 6ae740fccd 34/49: Fixed a couple typos, ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex f215b70c5c 33/49: Fix test and math flags for spl abbreviation, ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex 355614380c 48/49: * cdlatex.el: Fix typos and minor stylistic issues., ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex 7791fa94d5 46/49: Bump version to 4.12, ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex a15311a52d 45/49: * cdlatex.el (cdlatex-version): Remove variable, ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex 76e6d8e068 22/49: Add .gitignore, ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex 017735c611 23/49: Use spl as abbreviation for split, ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex 4e939a8386 28/49: reversing previous change for now, ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex 75c4e9c4e5 44/49: Added `text` macro in math mode, ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex 90d785a94c 13/49: New option `cdlatex-sub-super-scripts-outside-math-mode'., ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex 880723a514 17/49: New variable `cdlatex-use-dollar-to-ensure-math'.,
ELPA Syncer <=
- [nongnu] elpa/cdlatex 4d21552480 36/49: Fix whitespace issues, ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex 07d45fb38e 41/49: Update .gitignore to ignore .elc and package files, ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex 720f9145d8 31/49: Fix bug when "*CDLaTeX Help*" buffer was read-only, ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex 573d0918d0 24/49: Make C-c { wrap the region if there is an active region, ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex 8e963c6853 35/49: Merge pull request #31 from aluaces/patch-1, ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex 0eb638546c 37/49: Fix checkdoc issues, ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex d7bec27d31 42/49: Add .dir-locals.el to prevent whitespace issues, ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex ea52268926 47/49: * cdlatex.el: Fix typos and minor stylistic issues., ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex 4633ecf52d 11/49: modified README., ELPA Syncer, 2022/07/11
- [nongnu] elpa/cdlatex f36e5351f6 14/49: Fixed regex in cdlatex-tab to support \(...\), ELPA Syncer, 2022/07/11