[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 46f2f2215d 07/43: Inherit abbrevs saved in table
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 46f2f2215d 07/43: Inherit abbrevs saved in table with former mode name |
Date: |
Wed, 7 Feb 2024 06:07:08 -0500 (EST) |
branch: externals/auctex
commit 46f2f2215d9b626f09700697a4231d9e1a805ad6
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>
Inherit abbrevs saved in table with former mode name
* tex.el (TeX-abbrev-mode-setup): Add argument for additional parent
abbrev table for compatibility.
* latex.el (LaTeX-mode): Add `latex-mode-abbrev-table' as parent of
`LaTeX-mode-abbrev-table'.
(docTeX-mode): Add `doctex-mode-abbrev-table' as parent of
`docTeX-mode-abbrev-table'.
* plain-tex.el (plain-TeX-mode): Add `plain-tex-mode-abbrev-table' as
parent of `plain-TeX-mode-abbrev-table'.
* context.el (ConTeXt-mode): Add `context-mode-abbrev-table' as parent
of `ConTeXt-mode-abbrev-table'.
---
context.el | 2 +-
latex.el | 4 ++--
plain-tex.el | 2 +-
tex.el | 15 ++++++++++++---
4 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/context.el b/context.el
index a3716237df..a7c2b8391a 100644
--- a/context.el
+++ b/context.el
@@ -1819,7 +1819,7 @@ that is, you do _not_ have to cater for this yourself by
adding \\\\\\=' or $."
:type '(repeat regexp)
:group 'TeX-command)
-(TeX-abbrev-mode-setup ConTeXt-mode)
+(TeX-abbrev-mode-setup ConTeXt-mode context-mode-abbrev-table)
(defun ConTeXt-mode-common-initialization ()
"Initialization code that is common for all ConTeXt interfaces."
diff --git a/latex.el b/latex.el
index a19564f1b1..8da3a61cd2 100644
--- a/latex.el
+++ b/latex.el
@@ -7858,7 +7858,7 @@ This happens when \\left is inserted."
:type 'hook
:group 'LaTeX)
-(TeX-abbrev-mode-setup LaTeX-mode)
+(TeX-abbrev-mode-setup LaTeX-mode latex-mode-abbrev-table)
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.drv\\'" . LaTeX-mode) t) ;; append to the
end of `auto-mode-alist' to give higher priority to Guix/Nix's derivation modes
@@ -7933,7 +7933,7 @@ of `LaTeX-mode-hook'."
;;;###autoload
(defalias 'LaTeX-mode #'TeX-LaTeX-mode)
-(TeX-abbrev-mode-setup docTeX-mode)
+(TeX-abbrev-mode-setup docTeX-mode doctex-mode-abbrev-table)
;;;###autoload
(define-derived-mode docTeX-mode LaTeX-mode "docTeX"
diff --git a/plain-tex.el b/plain-tex.el
index 63366d9b62..2397f71bf8 100644
--- a/plain-tex.el
+++ b/plain-tex.el
@@ -113,7 +113,7 @@ plain-TeX file, or any mode derived thereof. See variable
:type 'hook
:group 'TeX-misc)
-(TeX-abbrev-mode-setup plain-TeX-mode)
+(TeX-abbrev-mode-setup plain-TeX-mode plain-tex-mode-abbrev-table)
;; We want to use `plain-TeX-mode' as the function name. However, it is
;; overwritten when tex-mode.el, prior to Emacs 29, is loaded afterwards
diff --git a/tex.el b/tex.el
index db8b998119..52c61f6ee5 100644
--- a/tex.el
+++ b/tex.el
@@ -6704,15 +6704,24 @@ error."
;;; Abbrev mode
-(defmacro TeX-abbrev-mode-setup (mode)
- "Set up the abbrev table and variable for MODE."
+(defmacro TeX-abbrev-mode-setup (mode usertable)
+ "Set up the abbrev table and variable for MODE.
+The table inherits from USERTABLE if it is a valid abbrev table."
(let ((symbol (intern (concat (symbol-name mode) "-abbrev-table")))
(name (TeX-mode-prefix mode)))
`(progn
(defvar ,symbol nil
,(format "Abbrev table for %s mode." name))
(define-abbrev-table ',symbol nil)
- (abbrev-table-put ,symbol :parents (list text-mode-abbrev-table)))))
+ (let ((parents (list text-mode-abbrev-table)))
+ ;; Users may already have user abbrevs in tables based on the
+ ;; former mode names such as `latex-mode-abbrev-table',
+ ;; stored in .emacs.d/abbrev_defs. In that case, add them as
+ ;; parent abbrev tables.
+ (if (and (boundp ',usertable)
+ (abbrev-table-p ,usertable))
+ (push ,usertable parents))
+ (abbrev-table-put ,symbol :parents parents)))))
;;; Special provisions for other modes and libraries
- [elpa] externals/auctex b407b239e2 36/43: Update style/simpleicons.el to package v11.1.0, (continued)
- [elpa] externals/auctex b407b239e2 36/43: Update style/simpleicons.el to package v11.1.0, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 8cb64a3487 21/43: Augment suitable default entry for M-?, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 43be8c047b 26/43: * doc/changes.texi: Document the change related mode name renewal., Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 9c6f701a0c 12/43: Use `define-derived-mode' for AUCTeX major modes, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex d42cd150b5 05/43: Commit for japanese LaTeX&plain-TeX mode, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 2dc9539961 25/43: Merge branch 'master' into feature/fix-mode-names-overlap, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 40d3662945 22/43: Add more default entries for M-?, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex a3c343654c 02/43: Commit for Texinfo mode, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex ab8f73a1cc 10/43: Merge branch 'master' into feature/fix-mode-names-overlap, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 15418dc957 34/43: ; * doc/changes.texi: Reshape the new entries., Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 46f2f2215d 07/43: Inherit abbrevs saved in table with former mode name,
Tassilo Horn <=
- [elpa] externals/auctex ebc69e7ae7 14/43: Canonicalize mode names, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 561a08e1cf 43/43: Require emacs 27.1, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex ebd04735e7 16/43: Merge branch 'master' into feature/fix-mode-names-overlap, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 142f28b539 24/43: Update documents, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 96cad45213 31/43: ; Use `defvar-local', Tassilo Horn, 2024/02/07
- [elpa] externals/auctex ef86afdac5 06/43: Commit for initialization codes, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex f41fbc0eac 18/43: Improve mode cleanup functions, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 994079d8cd 15/43: Delete ConTeXt-xx-mode experimentally, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 48cc506998 33/43: Merge branch 'feature/fix-mode-names-overlap', Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 94127f5e10 37/43: Make banner regexp customizable, Tassilo Horn, 2024/02/07