aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorGlenn Morris2012-04-16 19:57:09 -0400
committerGlenn Morris2012-04-16 19:57:09 -0400
commit121b8917ec329a6bbc292ad02f5c4e39d164fff5 (patch)
tree04108b805e878cd7456cd9d55eada3f35fbb6027 /lisp/textmodes
parentf53a85a90a16970fe9dc15294a2ebdb984369c97 (diff)
downloademacs-121b8917ec329a6bbc292ad02f5c4e39d164fff5.tar.gz
emacs-121b8917ec329a6bbc292ad02f5c4e39d164fff5.zip
Replace independent implementations of string-prefix-p
* vc/vc.el (vc-string-prefix-p): * vc/pcvs-util.el (cvs-string-prefix-p): * textmodes/tex-mode.el (latex-string-prefix-p, tex-string-prefix-p): * mpc.el (mpc-string-prefix-p): Make all of these into obsolete aliases for string-prefix-p. Update callers. * vc/pcvs.el, vc/vc-dispatcher.el, vc/vc-dir.el: Update callers.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/tex-mode.el15
1 files changed, 6 insertions, 9 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 9472d7df879..af00531137a 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1492,8 +1492,8 @@ Puts point on a blank line between them."
1492 1492
1493(defvar latex-complete-bibtex-cache nil) 1493(defvar latex-complete-bibtex-cache nil)
1494 1494
1495(defun latex-string-prefix-p (str1 str2) 1495(define-obsolete-function-alias 'latex-string-prefix-p
1496 (eq t (compare-strings str1 nil nil str2 0 (length str1)))) 1496 'string-prefix-p "24.2")
1497 1497
1498(defvar bibtex-reference-key) 1498(defvar bibtex-reference-key)
1499(declare-function reftex-get-bibfile-list "reftex-cite.el" ()) 1499(declare-function reftex-get-bibfile-list "reftex-cite.el" ())
@@ -1507,7 +1507,7 @@ Puts point on a blank line between them."
1507 keys) 1507 keys)
1508 (if (and (eq (car latex-complete-bibtex-cache) 1508 (if (and (eq (car latex-complete-bibtex-cache)
1509 (reftex-get-bibfile-list)) 1509 (reftex-get-bibfile-list))
1510 (latex-string-prefix-p (nth 1 latex-complete-bibtex-cache) 1510 (string-prefix-p (nth 1 latex-complete-bibtex-cache)
1511 key)) 1511 key))
1512 ;; Use the cache. 1512 ;; Use the cache.
1513 (setq keys (nth 2 latex-complete-bibtex-cache)) 1513 (setq keys (nth 2 latex-complete-bibtex-cache))
@@ -2051,10 +2051,7 @@ IN can be either a string (with the same % escapes in it) indicating
2051OUT describes the output file and is either a %-escaped string 2051OUT describes the output file and is either a %-escaped string
2052 or nil to indicate that there is no output file.") 2052 or nil to indicate that there is no output file.")
2053 2053
2054;; defsubst* gives better byte-code than defsubst. 2054(define-obsolete-function-alias 'tex-string-prefix-p 'string-prefix-p "24.2")
2055(defsubst* tex-string-prefix-p (str1 str2)
2056 "Return non-nil if STR1 is a prefix of STR2"
2057 (eq t (compare-strings str2 nil (length str1) str1 nil nil)))
2058 2055
2059(defun tex-guess-main-file (&optional all) 2056(defun tex-guess-main-file (&optional all)
2060 "Find a likely `tex-main-file'. 2057 "Find a likely `tex-main-file'.
@@ -2069,7 +2066,7 @@ of the current buffer."
2069 (with-current-buffer buf 2066 (with-current-buffer buf
2070 (when (and (cond 2067 (when (and (cond
2071 ((null all) (equal dir default-directory)) 2068 ((null all) (equal dir default-directory))
2072 ((eq all 'sub) (tex-string-prefix-p default-directory dir)) 2069 ((eq all 'sub) (string-prefix-p default-directory dir))
2073 (t)) 2070 (t))
2074 (stringp tex-main-file)) 2071 (stringp tex-main-file))
2075 (throw 'found (expand-file-name tex-main-file))))) 2072 (throw 'found (expand-file-name tex-main-file)))))
@@ -2078,7 +2075,7 @@ of the current buffer."
2078 (with-current-buffer buf 2075 (with-current-buffer buf
2079 (when (and (cond 2076 (when (and (cond
2080 ((null all) (equal dir default-directory)) 2077 ((null all) (equal dir default-directory))
2081 ((eq all 'sub) (tex-string-prefix-p default-directory dir)) 2078 ((eq all 'sub) (string-prefix-p default-directory dir))
2082 (t)) 2079 (t))
2083 buffer-file-name 2080 buffer-file-name
2084 ;; (or (easy-mmode-derived-mode-p 'latex-mode) 2081 ;; (or (easy-mmode-derived-mode-p 'latex-mode)