[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 0263e9c 27/34: [Fix #12] Make default sub/super-script pre
From: |
Vitalie Spinu |
Subject: |
[elpa] master 0263e9c 27/34: [Fix #12] Make default sub/super-script prefix __ and ^^ |
Date: |
Tue, 7 May 2019 16:05:31 -0400 (EDT) |
branch: master
commit 0263e9ce3a76c3d0eadc70daa0f5ccee6c6ce071
Author: Vitalie Spinu <address@hidden>
Commit: Vitalie Spinu <address@hidden>
[Fix #12] Make default sub/super-script prefix __ and ^^
---
company-math.el | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/company-math.el b/company-math.el
index 7906337..7f352e9 100644
--- a/company-math.el
+++ b/company-math.el
@@ -44,15 +44,17 @@
:group 'company-math
:type 'string)
-(defcustom company-math-subscript-prefix "_"
+(defcustom company-math-subscript-prefix "__"
"Prefix to use for unicode subscripts.
-It will also work after `company-math-symbol-prefix'."
+It will also work after `company-math-symbol-prefix'.
+This variable will take effect in a new Emacs session."
:group 'company-math
:type 'string)
-(defcustom company-math-superscript-prefix "^"
+(defcustom company-math-superscript-prefix "^^"
"Prefix to use for unicode subscripts.
-It will also work after `company-math-symbol-prefix'."
+It will also work after `company-math-symbol-prefix'.
+This variable will take effect in a new Emacs session."
:group 'company-math
:type 'string)
@@ -60,12 +62,15 @@ It will also work after `company-math-symbol-prefix'."
(when (boundp 'company-math-prefix-regexp)
(warn "`company-math-prefix-regexp' is deprecated, please remove from your
custom settings."))
-(defvar company-math--latex-prefix-regexp (concat (regexp-quote
company-math-symbol-prefix)
- "[^ \t\n]+"))
+(defvar company-math--latex-prefix-regexp
+ (concat (regexp-quote company-math-symbol-prefix)
+ "[^ \t\n]+"))
+
(let ((psym (regexp-quote company-math-symbol-prefix))
(psub (regexp-quote company-math-subscript-prefix))
(psup (regexp-quote company-math-superscript-prefix)))
- (defvar company-math--unicode-prefix-regexp (concat "\\(" psym "\\|" psub
"\\|" psup "\\)[^ \t\n]*")))
+ (defvar company-math--unicode-prefix-regexp
+ (concat "\\(" psym "\\|" psub "\\|" psup "\\)[^ \t\n]*")))
(defcustom company-math-allow-unicode-symbols-in-faces t
"List of faces to allow the insertion of Unicode symbols.
@@ -97,10 +102,10 @@ When set to special value t, allow on all faces except
those in
;;; INTERNALS
(defun company-math--make-candidates (alist prefix)
- "Build a list of math symbols ready to be used in ac source.
-ALIST is one of the defined alist in package `symbols'. Return a
-list of LaTeX symbols with text property :symbol being the
-corresponding unicode symbol."
+ "Build a list of math symbols ready to be used in a company backend.
+ALIST is one of the defined alist in package
+`math-symbol-lists'. Return a list of LaTeX symbols with text
+property :symbol being the corresponding unicode symbol."
(delq nil
(mapcar
(lambda (el)
@@ -123,11 +128,9 @@ corresponding unicode symbol."
(defconst company-math--unicode
(append
(append (company-math--make-candidates math-symbol-list-subscripts
company-math-subscript-prefix)
- (company-math--make-candidates math-symbol-list-subscripts (concat
company-math-symbol-prefix
-
company-math-subscript-prefix))
+ (company-math--make-candidates math-symbol-list-subscripts (concat
company-math-symbol-prefix "_"))
(company-math--make-candidates math-symbol-list-superscripts
company-math-superscript-prefix)
- (company-math--make-candidates math-symbol-list-superscripts
(concat company-math-symbol-prefix
-
company-math-superscript-prefix)))
+ (company-math--make-candidates math-symbol-list-superscripts
(concat company-math-symbol-prefix "^")))
company-math--symbols)
"List of math completion candidates for unicode backend.")
- [elpa] master 8e64cae 17/34: Untabify and add .dir-locals, (continued)
- [elpa] master 8e64cae 17/34: Untabify and add .dir-locals, Vitalie Spinu, 2019/05/07
- [elpa] master 55f0a03 08/34: require cl-lib, Vitalie Spinu, 2019/05/07
- [elpa] master 9407824 21/34: Company doesn't like nils, remove those, Vitalie Spinu, 2019/05/07
- [elpa] master 96e55e6 20/34: [Fix #8] Don't propose Unicode completions if no Ucode, Vitalie Spinu, 2019/05/07
- [elpa] master 3c906cd 15/34: Always offer completions (workaround for company issue #476), Vitalie Spinu, 2019/05/07
- [elpa] master d0db15e 13/34: [Fix #6] Add `tex-math` to `company-math-allow-latex-symbols-in-faces`, Vitalie Spinu, 2019/05/07
- [elpa] master 26bf67b 34/34: [company-math] Merge from upstream, Vitalie Spinu, 2019/05/07
- [elpa] master a8a98e3 24/34: [Fix #11] Don't require at least one character in prefix regexp, Vitalie Spinu, 2019/05/07
- [elpa] master ce46d91 16/34: Merge pull request #7 from cpitclaudel/always-offer-completions, Vitalie Spinu, 2019/05/07
- [elpa] master 2cb03c4 23/34: Version 1.2, Vitalie Spinu, 2019/05/07
- [elpa] master 0263e9c 27/34: [Fix #12] Make default sub/super-script prefix __ and ^^,
Vitalie Spinu <=
- [elpa] master 3481f03 32/34: Merge pull request #15 from Kaligule/patch-1, Vitalie Spinu, 2019/05/07
- [elpa] master e89ddb2 31/34: Enable latex backend in org-mode per default, Vitalie Spinu, 2019/05/07
- [elpa] master 6ffd24c 22/34: Implement unicode sub(super)scripting, Vitalie Spinu, 2019/05/07
- [elpa] master 1ab4b8e 29/34: Allow nil in sub/super-script prefix customization, Vitalie Spinu, 2019/05/07
- [elpa] master 982c4ef 28/34: Readme, Vitalie Spinu, 2019/05/07
- [elpa] master 92b9968 33/34: Fix checkdoc, Vitalie Spinu, 2019/05/07
- [elpa] master b585117 11/34: Edit before ELPA merge, Vitalie Spinu, 2019/05/07
- [elpa] master 6c08f80 09/34: Fix custom interface, Vitalie Spinu, 2019/05/07
- [elpa] master 2e24a08 18/34: Version 1.1, Vitalie Spinu, 2019/05/07
- [elpa] master 0815c9e 19/34: Readme fixes, Vitalie Spinu, 2019/05/07