emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/auctex 7ba3caa 03/12: Remove compatibility code for Ema


From: Tassilo Horn
Subject: [elpa] externals/auctex 7ba3caa 03/12: Remove compatibility code for Emacs<24.3
Date: Sat, 17 Apr 2021 15:13:21 -0400 (EDT)

branch: externals/auctex
commit 7ba3caa2e199be4d0af96566636e4e0b3b6c8693
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>

    Remove compatibility code for Emacs<24.3
    
    * latex.el (LaTeX-insert-left-brace):
    * tex.el (TeX-insert-dollar):
    Simplify the property `delete-selection-mode'.
    (VirTeX-common-initialization): Use " " for `comment-padding'.
    (TeX-math-input-method-off): Never use `inactivate-input-method'.
---
 latex.el | 42 ++++++++++++++++++------------------------
 tex.el   | 21 +++++----------------
 2 files changed, 23 insertions(+), 40 deletions(-)

diff --git a/latex.el b/latex.el
index 5311a30..1c3b213 100644
--- a/latex.el
+++ b/latex.el
@@ -2936,30 +2936,24 @@ Normally bound to keys \(, { and [."
 ;; Cater for `delete-selection-mode' (bug#36385)
 ;; See the header comment of delsel.el for detail.
 (put #'LaTeX-insert-left-brace 'delete-selection
-     ;; COMPATIBILITY for Emacs < 24.3
-     (if (and (= emacs-major-version 24)
-              (< emacs-minor-version 3))
-         ;; Emacs < 24.3 doesn't support a function as value of
-         ;; `delete-selection' property.
-         nil
-       (lambda ()
-         ;; Consult `delete-selection' property when
-         ;; `LaTeX-insert-left-brace' works just the same as
-         ;; `self-insert-command'.
-         (and (or (not LaTeX-electric-left-right-brace)
-                  current-prefix-arg)
-              (let ((f (get #'self-insert-command 'delete-selection)))
-                ;; If `delete-selection' property of
-                ;; `self-insert-command' is one of the predefined
-                ;; special symbols, just return itself.
-                (if (memq f '(yank supersede kill t nil))
-                    ;; FIXME: if this list of special symbols is
-                    ;; extended in future delsel.el, this discrimination
-                    ;; will become wrong.
-                    f
-                  ;; Otherwise, call it as a function and return
-                  ;; its value.
-                  (funcall f)))))))
+     (lambda ()
+       ;; Consult `delete-selection' property when
+       ;; `LaTeX-insert-left-brace' works just the same as
+       ;; `self-insert-command'.
+       (and (or (not LaTeX-electric-left-right-brace)
+                current-prefix-arg)
+            (let ((f (get #'self-insert-command 'delete-selection)))
+              ;; If `delete-selection' property of
+              ;; `self-insert-command' is one of the predefined
+              ;; special symbols, just return itself.
+              (if (memq f '(yank supersede kill t nil))
+                  ;; FIXME: if this list of special symbols is
+                  ;; extended in future delsel.el, this discrimination
+                  ;; will become wrong.
+                  f
+                ;; Otherwise, call it as a function and return
+                ;; its value.
+                (funcall f))))))
 
 (defun LaTeX-insert-corresponding-right-macro-and-brace
   (lmacro lbrace &optional optional prompt)
diff --git a/tex.el b/tex.el
index d68dfb4..7a7ba9b 100644
--- a/tex.el
+++ b/tex.el
@@ -3735,9 +3735,7 @@ The algorithm is as follows:
         "\\)*\\)\\(%+[ \t]*\\)"))
   (set (make-local-variable 'comment-end-skip) "[ \t]*\\(\\s>\\|\n\\)")
   (set (make-local-variable 'comment-use-syntax) t)
-  ;; `comment-padding' is defined here as an integer for compatibility
-  ;; reasons because older Emacsen could not cope with a string.
-  (set (make-local-variable 'comment-padding) 1)
+  (set (make-local-variable 'comment-padding) " ")
   ;; Removed as commenting in (La)TeX is done with one `%' not two
   ;; (make-local-variable 'comment-add)
   ;; (setq comment-add 1) ;default to `%%' in comment-region
@@ -5976,11 +5974,7 @@ sign.  With optional ARG, insert that many dollar signs."
        (texmathp)
        (boundp 'current-input-method) current-input-method
        (string-match TeX-math-input-method-off-regexp current-input-method)
-       ;; inactivate-input-method is obsolete since emacs 24.3.
-       (if (fboundp 'deactivate-input-method)
-           (deactivate-input-method)
-         (with-no-warnings
-           (inactivate-input-method)))))
+       (deactivate-input-method)))
 
 ;;; Simple Commands
 
@@ -6626,14 +6620,9 @@ error."
 ;; `delete-selection-mode', but when it's nil users may want to be able to
 ;; delete active region if `delete-selection-mode' is active, see bug#23177.  
We
 ;; can dynamically determine the behavior of `delete-selection' with
-;; `TeX-insert-dollar' based on the value of `TeX-electric-math'.  This
-;; dynamicity has been introduced in Emacs 24.3, for previous versions keep
-;; `TeX-insert-dollar' without this property.
-(if (or (> emacs-major-version 24)
-        (and (= emacs-major-version 24)
-             (>= emacs-minor-version 3)))
-    (put 'TeX-insert-dollar 'delete-selection
-         (lambda () (null TeX-electric-math))))
+;; `TeX-insert-dollar' based on the value of `TeX-electric-math'.
+(put 'TeX-insert-dollar 'delete-selection
+     (lambda () (null TeX-electric-math)))
 
 (defun TeX--list-of-string-p (lst)
   "Return non-nil iff `LST' is a list of strings.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]