auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] [elpa] externals/auctex 05c09bd 06/43: Remove TeX-how-man


From: Tassilo Horn
Subject: [AUCTeX-diffs] [elpa] externals/auctex 05c09bd 06/43: Remove TeX-how-many function
Date: Tue, 20 Mar 2018 11:34:06 -0400 (EDT)

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

    Remove TeX-how-many function
    
    * tex.el (TeX-how-many): Remove function.
    * latex.el (LaTeX-hanging-ampersand-position): Replace `TeX-how-many' with
      `how-many'.
---
 latex.el |  2 +-
 tex.el   | 28 ----------------------------
 2 files changed, 1 insertion(+), 29 deletions(-)

diff --git a/latex.el b/latex.el
index fe905d6..4dcb4bf 100644
--- a/latex.el
+++ b/latex.el
@@ -6522,7 +6522,7 @@ function would return non-nil and `(match-string 1)' 
would return
    (let* ((cur-pos (point)))
      (save-excursion
        (if (re-search-backward "\\\\" beg-pos t)
-          (let ((cur-idx (TeX-how-many "[^\]&" (point) cur-pos)))
+          (let ((cur-idx (how-many "[^\]&" (point) cur-pos)))
             (goto-char beg-pos)
             (re-search-forward "[^\]&" cur-pos t (+ 1 cur-idx))
             ;; If the above searchs fails, i.e. no "&" found,
diff --git a/tex.el b/tex.el
index 5927b49..bedd252 100644
--- a/tex.el
+++ b/tex.el
@@ -6708,34 +6708,6 @@ error."
     (put 'TeX-insert-dollar 'delete-selection
         (lambda () (null TeX-electric-math))))
 
-(defun TeX-how-many (regexp &optional rstart rend)
-  "Compatibily function for `how-many'.
-Supports restriction to a region where the XEmacs version doesn't
-and always returns the number of matches, also in XEmacs and GNU
-Emacs 21."
-  ;; Emacs >= 22 does what we want.
-  (if (>= emacs-major-version 22)
-      (how-many regexp rstart rend)
-    ;; XEmacs and GNU Emacs 21 don't return the number of matches but only 
print
-    ;; it.
-    (let ((string
-          (if (featurep 'xemacs)
-              ;; XEmacs doesn't even support restriction to a region.
-              (save-excursion
-                (save-restriction
-                  (when (and (integer-or-marker-p rstart)
-                             (integer-or-marker-p rend))
-                    (narrow-to-region rstart rend)
-                    (goto-char (point-min)))
-                  (how-many regexp)))
-            (how-many regexp rstart rend))))
-      ;; Hide the message printed by `how-many'.
-      (message "")
-      ;; Select the number of occurrences and convert it to a number.
-      (if (string-match "\([0-9]+\).*" string)
-         (string-to-number (replace-match "\1" nil nil string))
-       0))))
-
 (defun TeX--list-of-string-p (lst)
   "Return non-nil iff `LST' is a list of strings.
 Used as function for validating a variable's `safe-local-variable' property."



reply via email to

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