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

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

[elpa] externals/auctex f366130 03/43: Remove old compat functions for c


From: Tassilo Horn
Subject: [elpa] externals/auctex f366130 03/43: Remove old compat functions for commenting and uncommenting
Date: Tue, 20 Mar 2018 11:34:05 -0400 (EDT)

branch: externals/auctex
commit f366130c9d61acded75ba55ae9c5c3979e15ca8a
Author: Mosè Giordano <address@hidden>
Commit: Mosè Giordano <address@hidden>

    Remove old compat functions for commenting and uncommenting
    
    * tex.el (TeX-comment-regio):
    (TeX-comment-or-uncomment-region):
    (TeX-uncomment-region): Remove old compatibility functions.
    * context.el (ConTeXt-mode-menu):
    * latex.el (LaTeX-mode-menu):
    * plain-tex.el (plain-TeX-menu-entries):
    * tex-info.el (Texinfo-mode-menu):
    * tex.el (TeX-mode-map):
    (TeX-in-comment):
    (TeX-in-commented-line): Replace compat functions with standard functions.
---
 context.el   |  2 +-
 latex.el     |  2 +-
 plain-tex.el |  2 +-
 tex-info.el  |  2 +-
 tex.el       | 64 ++++--------------------------------------------------------
 5 files changed, 8 insertions(+), 64 deletions(-)

diff --git a/context.el b/context.el
index e42423b..ee35eb6 100644
--- a/context.el
+++ b/context.el
@@ -1527,7 +1527,7 @@ else.  There might be text before point."
      ["Delete Font" (TeX-font t ?\C-d) :keys "C-c C-f C-d"]
      "-"
      ["Comment or Uncomment Region"
-      TeX-comment-or-uncomment-region
+      comment-or-uncomment-region
       :help "Make the selected region outcommented or active again"]
      ["Comment or Uncomment Paragraph"
       TeX-comment-or-uncomment-paragraph
diff --git a/latex.el b/latex.el
index 37c77b4..8c340e3 100644
--- a/latex.el
+++ b/latex.el
@@ -5639,7 +5639,7 @@ regenerated by the respective menu filter."
      ["Delete Font" (TeX-font t ?\C-d) :keys "C-c C-f C-d"]
      "-"
      ["Comment or Uncomment Region"
-      TeX-comment-or-uncomment-region
+      comment-or-uncomment-region
       :help "Make the selected region outcommented or active again"]
      ["Comment or Uncomment Paragraph"
       TeX-comment-or-uncomment-paragraph
diff --git a/plain-tex.el b/plain-tex.el
index 9b561ac..99df58a 100644
--- a/plain-tex.el
+++ b/plain-tex.el
@@ -83,7 +83,7 @@ Install tool bar if `plain-TeX-enable-toolbar' is non-nil."
       ["Calligraphic" (TeX-font t ?\C-a) :keys "C-u C-c C-f C-a"])
      ["Delete Font" (TeX-font t ?\C-d) :keys "C-c C-f C-d"]
      "-"
-     ["Comment or Uncomment Region" TeX-comment-or-uncomment-region
+     ["Comment or Uncomment Region" comment-or-uncomment-region
       :help "Comment or uncomment the currently selected region"]
      ["Comment or Uncomment Paragraph" TeX-comment-or-uncomment-paragraph
       :help "Comment or uncomment the paragraph containing point"]
diff --git a/tex-info.el b/tex-info.el
index 4a96e11..5d4fc08 100644
--- a/tex-info.el
+++ b/tex-info.el
@@ -585,7 +585,7 @@ is assumed by default."
      "-"
      ("Commenting"
       ["Comment or Uncomment Region"
-       TeX-comment-or-uncomment-region
+       comment-or-uncomment-region
        :help "Comment or uncomment the currently selected region"]
       ["Comment or Uncomment Paragraph"
        TeX-comment-or-uncomment-paragraph
diff --git a/tex.el b/tex.el
index 5ee02b4..0fc2a86 100644
--- a/tex.el
+++ b/tex.el
@@ -5039,10 +5039,10 @@ Brace insertion is only done if point is in a math 
construct and
     (define-key map "\e\t"     'TeX-complete-symbol) ;*** Emacs 19 way
 
     (define-key map "\C-c'"    'TeX-comment-or-uncomment-paragraph) ;*** Old 
way
-    (define-key map "\C-c:"    'TeX-comment-or-uncomment-region) ;*** Old way
+    (define-key map "\C-c:"    'comment-or-uncomment-region) ;*** Old way
     (define-key map "\C-c\""   'TeX-uncomment) ;*** Old way
 
-    (define-key map "\C-c;"    'TeX-comment-or-uncomment-region)
+    (define-key map "\C-c;"    'comment-or-uncomment-region)
     (define-key map "\C-c%"    'TeX-comment-or-uncomment-paragraph)
 
     (define-key map "\C-c\C-t\C-p"   'TeX-PDF-mode)
@@ -5301,62 +5301,6 @@ Unlike the variable `comment-start-skip' it should not 
match any
 whitespace after the comment starter or any character before it.")
 (make-variable-buffer-local 'TeX-comment-start-regexp)
 
-(defun TeX-comment-region (beg end &optional arg)
-  "Comment each line in the region from BEG to END.
-Numeric prefix arg ARG means use ARG comment characters.
-If ARG is negative, delete that many comment characters instead."
-  (interactive "*r\nP")
-  ;; `comment-padding' will not be recognized in XEmacs' (21.4)
-  ;; `comment-region', so we temporarily modify `comment-start' to get
-  ;; proper spacing.  Unfortunately we have to check for the XEmacs
-  ;; version and cannot test if `comment-padding' is bound as this
-  ;; gets initialized in `VirTeX-common-initialization'.
-  (let ((comment-start (if (and (featurep 'xemacs)
-                               (= emacs-major-version 21)
-                               (<= emacs-minor-version 4))
-                          (concat comment-start (TeX-comment-padding-string))
-                        comment-start)))
-    (comment-region beg end arg)))
-
-(eval-and-compile
-  ;; COMPATIBILITY for Emacs <= 21.3
-  (if (fboundp 'comment-or-uncomment-region)
-      (defalias 'TeX-comment-or-uncomment-region 'comment-or-uncomment-region)
-    ;; The following function was copied from `newcomment.el' on
-    ;; 2004-01-30 and adapted accordingly
-    (defun TeX-comment-or-uncomment-region (beg end &optional arg)
-      "Comment or uncomment a the region from BEG to END.
-Call `TeX-comment-region', unless the region only consists of
-comments, in which case call `TeX-uncomment-region'.  If a prefix
-arg ARG is given, it is passed on to the respective function."
-      (interactive "*r\nP")
-      (funcall (if (save-excursion ;; check for already commented region
-                    (goto-char beg)
-                    (TeX-comment-forward (point-max))
-                    (<= end (point)))
-                  'TeX-uncomment-region 'TeX-comment-region)
-              beg end arg)))
-
-  ;; COMPATIBILITY for Emacs <= 20.  (Introduced in 21.1?)
-  (if (fboundp 'uncomment-region)
-      (defalias 'TeX-uncomment-region 'uncomment-region)
-    (defun TeX-uncomment-region (beg end &optional arg)
-      "Remove comment characters from the beginning of each line
-in the region from BEG to END.  Numeric prefix arg ARG means use
-ARG comment characters.  If ARG is negative, delete that many
-comment characters instead."
-      (interactive "*r\nP")
-      (or arg
-         ;; Determine the number of comment characters at the
-         ;; beginning of the first commented line.
-         (setq arg
-               (save-excursion
-                 (goto-char beg)
-                 (re-search-forward
-                  (concat "^" TeX-comment-start-regexp "+") end t)
-                 (length (match-string 0)))))
-      (comment-region beg end (- arg)))))
-
 (defun TeX-uncomment ()
   "Delete comment characters from the beginning of each line in a comment."
   (interactive)
@@ -5373,7 +5317,7 @@ comment characters instead."
                  (not (eobp)))
        (forward-line 1))
       ;; Uncomment region
-      (TeX-uncomment-region beg (point)))))
+      (uncomment-region beg (point)))))
 
 (defun TeX-comment-or-uncomment-paragraph ()
   "Comment or uncomment current paragraph."
@@ -5389,7 +5333,7 @@ comment characters instead."
       ;; commented without the user noticing.
       (unless (looking-at "^[ \t]*$")
        (mark-paragraph)
-       (TeX-comment-region (point) (mark))))))
+       (comment-region (point) (mark))))))
 
 (defun TeX-in-comment ()
   "Return non-nil if point is in a comment."



reply via email to

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