[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 updated (ea42107189 -> 561a08e1cf), Tassilo Horn, 2024/02/07
- [elpa] externals/auctex a3c343654c 02/43: Commit for Texinfo mode, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex e073809830 04/43: Commit for LaTeX mode and docTeX 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 5bd8ca03ff 13/43: ; * tex-jp.el (japanese-plain-TeX-mode): Fix mode lighter., 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 ae43b62283 03/43: Commit for ConTeXt modes, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 938e82ed8e 01/43: Commit for plain TeX and AmS-TeX, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 9b6130ad9a 11/43: Revert menu title, 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 43be8c047b 26/43: * doc/changes.texi: Document the change related mode name renewal., Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 997bff87d2 23/43: Retain compatibility for directory local variables, 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 77ae6b5652 19/43: Restore tool bar on japanese-plain-TeX-mode, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex f9fc9619a1 35/43: ; Replace keyword wp with text, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex d7f1d28159 32/43: ; * tex.el (TeX-auto-parse-length): Fix Typo., Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 5b61f6c563 42/43: Merge remote-tracking branch 'origin/master' into externals/auctex, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 94127f5e10 37/43: Make banner regexp customizable, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex f41fbc0eac 18/43: Improve mode cleanup functions, Tassilo Horn, 2024/02/07
- [elpa] externals/auctex 52f903a4e9 08/43: Take care of `unload-feature', Tassilo Horn, 2024/02/07