2012-04-16 Glenn Morris <rgm@gnu.org>
+ * 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.
+
* textmodes/two-column.el: Move custom options to the start.
(frame-width): Remove compat definition.
(2C-associate-buffer, 2C-dissociate):
;;; mpc.el --- A client for the Music Player Daemon -*- coding: utf-8; lexical-binding: t -*-
-;; Copyright (C) 2006-2012 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2012 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: multimedia
(abs res))
res))))))))
-(defun mpc-string-prefix-p (str1 str2)
- ;; FIXME: copied from pcvs-util.el.
- "Tell whether STR1 is a prefix of STR2."
- (eq t (compare-strings str2 nil (length str1) str1 nil nil)))
+(define-obsolete-function-alias 'mpc-string-prefix-p 'string-prefix-p "24.2")
;; This can speed up mpc--song-search significantly. The table may grow
;; very large, tho. It's only bounded by the fact that it gets flushed
(process-put (mpc-proc) prop
(delq nil
(mapcar (lambda (x)
- (if (mpc-string-prefix-p name x)
+ (if (string-prefix-p name x)
nil x))
new)))))
(mpc-tagbrowser-refresh)))
(defvar latex-complete-bibtex-cache nil)
-(defun latex-string-prefix-p (str1 str2)
- (eq t (compare-strings str1 nil nil str2 0 (length str1))))
+(define-obsolete-function-alias 'latex-string-prefix-p
+ 'string-prefix-p "24.2")
(defvar bibtex-reference-key)
(declare-function reftex-get-bibfile-list "reftex-cite.el" ())
keys)
(if (and (eq (car latex-complete-bibtex-cache)
(reftex-get-bibfile-list))
- (latex-string-prefix-p (nth 1 latex-complete-bibtex-cache)
+ (string-prefix-p (nth 1 latex-complete-bibtex-cache)
key))
;; Use the cache.
(setq keys (nth 2 latex-complete-bibtex-cache))
OUT describes the output file and is either a %-escaped string
or nil to indicate that there is no output file.")
-;; defsubst* gives better byte-code than defsubst.
-(defsubst* tex-string-prefix-p (str1 str2)
- "Return non-nil if STR1 is a prefix of STR2"
- (eq t (compare-strings str2 nil (length str1) str1 nil nil)))
+(define-obsolete-function-alias 'tex-string-prefix-p 'string-prefix-p "24.2")
(defun tex-guess-main-file (&optional all)
"Find a likely `tex-main-file'.
(with-current-buffer buf
(when (and (cond
((null all) (equal dir default-directory))
- ((eq all 'sub) (tex-string-prefix-p default-directory dir))
+ ((eq all 'sub) (string-prefix-p default-directory dir))
(t))
(stringp tex-main-file))
(throw 'found (expand-file-name tex-main-file)))))
(with-current-buffer buf
(when (and (cond
((null all) (equal dir default-directory))
- ((eq all 'sub) (tex-string-prefix-p default-directory dir))
+ ((eq all 'sub) (string-prefix-p default-directory dir))
(t))
buffer-file-name
;; (or (easy-mmode-derived-mode-p 'latex-mode)
(if oneline (line-end-position) (point-max))))
(file-error nil)))
-(defun cvs-string-prefix-p (str1 str2)
- "Tell whether STR1 is a prefix of STR2."
- (eq t (compare-strings str2 nil (length str1) str1 nil nil)))
+(define-obsolete-function-alias 'cvs-string-prefix-p 'string-prefix-p "24.2")
;;;;
;;;; file names
(case cvs-reuse-cvs-buffer
(always t)
(subdir
- (or (cvs-string-prefix-p default-directory dir)
- (cvs-string-prefix-p dir default-directory)))
+ (or (string-prefix-p default-directory dir)
+ (string-prefix-p dir default-directory)))
(samedir (string= default-directory dir)))
(return buffer)))))
;; we really have to create a new buffer:
(eq (cvs-fileinfo->type last-fi) 'DIRCHANGE)
(not (when first-dir (setq first-dir nil) t))
(or (eq rm-dirs 'all)
- (not (cvs-string-prefix-p
+ (not (string-prefix-p
(cvs-fileinfo->dir last-fi)
(cvs-fileinfo->dir fi)))
(and (eq type 'DIRCHANGE) (eq rm-dirs 'empty))
(setq buffer-file-name (expand-file-name buffer-file-name))
(let (ret)
(dolist (fi (or fis (list (cvs-create-fileinfo 'DIRCHANGE "" "." ""))))
- (when (cvs-string-prefix-p
+ (when (string-prefix-p
(expand-file-name (cvs-fileinfo->full-name fi) dir)
buffer-file-name)
(setq ret t)))
(defun cvs-dir-member-p (fileinfo dir)
"Return true if FILEINFO represents a file in directory DIR."
(and (not (eq (cvs-fileinfo->type fileinfo) 'DIRCHANGE))
- (cvs-string-prefix-p dir (cvs-fileinfo->dir fileinfo))))
+ (string-prefix-p dir (cvs-fileinfo->dir fileinfo))))
(defun cvs-execute-single-file (fi extractor program constant-args)
"Internal function for `cvs-execute-single-file-list'."
(set-buffer cvs-buf)
;; look for a corresponding pcl-cvs buffer
(when (and (eq major-mode 'cvs-mode)
- (cvs-string-prefix-p default-directory dir))
+ (string-prefix-p default-directory dir))
(let ((subdir (substring dir (length default-directory))))
(set-buffer buffer)
(set (make-local-variable 'cvs-buffer) cvs-buf)
(set-buffer cvs-buf)
;; look for a corresponding pcl-cvs buffer
(when (and (eq major-mode 'cvs-mode)
- (cvs-string-prefix-p default-directory file))
+ (string-prefix-p default-directory file))
(let* ((file (substring file (length default-directory)))
(fi (cvs-create-fileinfo
(if (string= "0" version)
;;; vc-dir.el --- Directory status display under VC
-;; Copyright (C) 2007-2012 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2012 Free Software Foundation, Inc.
;; Author: Dan Nicolaescu <dann@ics.uci.edu>
;; Keywords: vc tools
(let ((data (ewoc-data crt))
(dir (vc-dir-node-directory crt)))
(and (vc-dir-fileinfo->directory data)
- (vc-string-prefix-p dir argdir)
+ (string-prefix-p dir argdir)
(vc-dir-fileinfo->marked data)
(setq found data))))
found))
data)
(while
(and (setq crt (ewoc-next vc-ewoc crt))
- (vc-string-prefix-p dir
+ (string-prefix-p dir
(progn
(setq data (ewoc-data crt))
(vc-dir-node-directory crt))))
data)
(while
(and (setq crt (ewoc-next vc-ewoc crt))
- (vc-string-prefix-p dir (progn
+ (string-prefix-p dir (progn
(setq data (ewoc-data crt))
(vc-dir-node-directory crt))))
(unless (vc-dir-fileinfo->directory data)
children
dname)
;; Find DIR
- (while (and crt (not (vc-string-prefix-p
+ (while (and crt (not (string-prefix-p
dirname (vc-dir-node-directory crt))))
(setq crt (ewoc-next vc-ewoc crt)))
- (while (and crt (vc-string-prefix-p
+ (while (and crt (string-prefix-p
dirname
(setq dname (vc-dir-node-directory crt))))
(let ((data (ewoc-data crt)))
(if (not (derived-mode-p 'vc-dir-mode))
(push status-buf drop)
(let ((ddir default-directory))
- (when (vc-string-prefix-p ddir file)
+ (when (string-prefix-p ddir file)
(if (file-directory-p file)
(progn
(vc-dir-resync-directory-files file)
(kill-buffer (current-buffer)))))
(declare-function vc-dir-resynch-file "vc-dir" (&optional fname))
-(declare-function vc-string-prefix-p "vc" (prefix string))
(defun vc-resynch-buffers-in-directory (directory &optional keep noquery reset-vc-info)
"Resync all buffers that visit files in DIRECTORY."
(dolist (buffer (buffer-list))
(let ((fname (buffer-file-name buffer)))
- (when (and fname (vc-string-prefix-p directory fname))
+ (when (and fname (string-prefix-p directory fname))
(with-current-buffer buffer
(vc-resynch-buffer fname keep noquery reset-vc-info))))))
;;; vc.el --- drive a version-control system from within Emacs
-;; Copyright (C) 1992-1998, 2000-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1992-1998, 2000-2012 Free Software Foundation, Inc.
;; Author: FSF (see below for full credits)
;; Maintainer: Andre Spiegel <spiegel@gnu.org>
(if (file-directory-p file)
(dolist (buffer (buffer-list))
(let ((fname (buffer-file-name buffer)))
- (when (and fname (vc-string-prefix-p file fname))
+ (when (and fname (string-prefix-p file fname))
(push fname flist))))
(push file flist)))
,form
(lambda (arg)
(message "arg %s" arg)
(and (file-directory-p arg)
- (vc-string-prefix-p (expand-file-name arg) def-dir)))))))
+ (string-prefix-p (expand-file-name arg) def-dir)))))))
(let ((default-directory repo-dir))
(vc-call-backend bk 'create-repo))
(throw 'found bk))))
\f
;; These things should probably be generally available
-
-(defun vc-string-prefix-p (prefix string)
- (let ((lpref (length prefix)))
- (and (>= (length string) lpref)
- (eq t (compare-strings prefix nil nil string nil lpref)))))
+(define-obsolete-function-alias 'vc-string-prefix-p 'string-prefix-p "24.2")
(defun vc-file-tree-walk (dirname func &rest args)
"Walk recursively through DIRNAME.