branch: feature/fix-mode-names-overlap
commit a6e53e53d8667fae04412d4365b5d1de0743c3f4
Author: Ikumi Keita <[email protected]>
Commit: Ikumi Keita <[email protected]>
Refine management of mode redirection
* tex-site.el.in (TeX-modes-set): Add redirection only when there
isn't the same one.
Delete only AUCTeX mode redirection.
---
tex-site.el.in | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tex-site.el.in b/tex-site.el.in
index a17709fd..59318bd9 100644
--- a/tex-site.el.in
+++ b/tex-site.el.in
@@ -114,7 +114,8 @@ Otherwise, use advice facility."
dst (cdr entry))
(if (memq elt value)
(if (boundp 'major-mode-remap-alist)
- (push (cons elt dst) major-mode-remap-alist)
+ (or (eq (cdr-safe (assq elt major-mode-remap-alist)) dst)
+ (push (cons elt dst) major-mode-remap-alist))
;; COMPATIBILITY for Emacs<29
(advice-add elt :override dst
;; COMPATIBILITY for Emacs 28.[12]
@@ -124,7 +125,7 @@ Otherwise, use advice facility."
'((depth . -10))))
(if (boundp 'major-mode-remap-alist)
(setq major-mode-remap-alist
- (assq-delete-all elt major-mode-remap-alist))
+ (delete entry major-mode-remap-alist))
;; COMPATIBILITY for Emacs<29
(advice-remove elt dst))))))