diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2012-04-17 14:38:34 -0700 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-04-17 14:38:34 -0700 |
| commit | ae6e112df045de8ddc22e85f8538975d4664b325 (patch) | |
| tree | 3923d0ff634b043c69f87255b52619d195dfc6ad /lisp/vc | |
| parent | ad85a071cc6d583041969d300793c92f21a54696 (diff) | |
| parent | 197b6f3c605872bfeb7b2024d255142d8f579021 (diff) | |
| download | emacs-ae6e112df045de8ddc22e85f8538975d4664b325.tar.gz | |
Merge from trunk.
Diffstat (limited to 'lisp/vc')
| -rw-r--r-- | lisp/vc/pcvs-util.el | 4 | ||||
| -rw-r--r-- | lisp/vc/pcvs.el | 14 | ||||
| -rw-r--r-- | lisp/vc/vc-dir.el | 14 | ||||
| -rw-r--r-- | lisp/vc/vc-dispatcher.el | 3 | ||||
| -rw-r--r-- | lisp/vc/vc-hg.el | 1 | ||||
| -rw-r--r-- | lisp/vc/vc.el | 12 |
6 files changed, 21 insertions, 27 deletions
diff --git a/lisp/vc/pcvs-util.el b/lisp/vc/pcvs-util.el index b300247e552..a3c525cb896 100644 --- a/lisp/vc/pcvs-util.el +++ b/lisp/vc/pcvs-util.el @@ -182,9 +182,7 @@ arguments. If ARGS is not a list, no argument will be passed." (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 diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el index 9ba65cda143..6aec24755b5 100644 --- a/lisp/vc/pcvs.el +++ b/lisp/vc/pcvs.el @@ -432,8 +432,8 @@ If non-nil, NEW means to create a new buffer no matter what." (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: @@ -887,7 +887,7 @@ RM-MSGS if non-nil means remove messages." (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)) @@ -1839,7 +1839,7 @@ Signal an error if there is no backup file." (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))) @@ -2261,7 +2261,7 @@ With prefix argument, prompt for cvs flags." (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'." @@ -2392,7 +2392,7 @@ The exact behavior is determined also by `cvs-dired-use-hook'." (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) @@ -2423,7 +2423,7 @@ The exact behavior is determined also by `cvs-dired-use-hook'." (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) diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 33611b4eafd..4c32eea2f72 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1,6 +1,6 @@ ;;; 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 @@ -556,7 +556,7 @@ If a prefix argument is given, move by that many lines." (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)) @@ -818,7 +818,7 @@ child files." 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)))) @@ -846,7 +846,7 @@ If it is a file, return the corresponding cons for the file itself." 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) @@ -878,10 +878,10 @@ If it is a file, return the corresponding cons for the file itself." 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))) @@ -915,7 +915,7 @@ If it is a file, return the corresponding cons for the file itself." (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) diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index ec1b127dd19..95c15030953 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -537,13 +537,12 @@ editing!" (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)))))) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 52e8051342d..a2728268816 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2006-2012 Free Software Foundation, Inc. ;; Author: Ivan Kanis +;; Maintainer: FSF ;; Keywords: vc tools ;; Package: vc diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 4cbbf47c2d6..ab7e587eb79 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1,6 +1,6 @@ ;;; 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> @@ -847,7 +847,7 @@ been updated to their corresponding values." (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 @@ -900,7 +900,7 @@ use." (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)))) @@ -2809,11 +2809,7 @@ to provide the `find-revision' operation instead." ;; 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. |
