]> code.delx.au - gnu-emacs/blobdiff - lisp/vc/pcvs-util.el
Update copyright year to 2015
[gnu-emacs] / lisp / vc / pcvs-util.el
index b300247e552bf38622137438b2b550f1802c2383..d3cc3c5da33062316e959ea1201b6df1fb8f4d79 100644 (file)
@@ -1,6 +1,6 @@
 ;;; pcvs-util.el --- utility functions for PCL-CVS  -*- byte-compile-dynamic: t -*-
 
-;; Copyright (C) 1991-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1991-2015 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: pcl-cvs
@@ -26,7 +26,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
 
 ;;;;
 ;;;; list processing
@@ -63,7 +63,7 @@
        (while (and l (> n 1))
          (setcdr nl (list (pop l)))
          (setq nl (cdr nl))
-         (decf n))
+         (cl-decf n))
        ret))))
 
 (defun cvs-partition (p l)
@@ -97,7 +97,7 @@ try to split a new window instead."
 BUF is assumed to be a temporary buffer used from the buffer MAINBUF."
   (interactive (list (current-buffer)))
   (save-current-buffer
-    (let ((win (if (eq buf (window-buffer (selected-window))) (selected-window)
+    (let ((win (if (eq buf (window-buffer)) (selected-window)
                 (get-buffer-window buf t))))
       (when win
        (if (window-dedicated-p win)
@@ -111,8 +111,8 @@ BUF is assumed to be a temporary buffer used from the buffer MAINBUF."
 ;;;          )
          )))
     (with-current-buffer buf
-      (bury-buffer (unless (and (eq buf (window-buffer (selected-window)))
-                               (not (window-dedicated-p (selected-window))))
+      (bury-buffer (unless (and (eq buf (window-buffer))
+                               (not (window-dedicated-p)))
                     buf)))
     (when mainbuf
       (let ((mainwin (or (get-buffer-window mainbuf)
@@ -130,10 +130,10 @@ If NOREUSE is non-nil, always return a new buffer."
            (if noreuse (generate-new-buffer name)
              (get-buffer-create name)))
       (unless noreuse
-       (dolist (buf (buffer-list))
+       (cl-dolist (buf (buffer-list))
          (with-current-buffer buf
            (when (equal name list-buffers-directory)
-             (return buf)))))
+             (cl-return buf)))))
       (with-current-buffer (create-file-buffer name)
        (setq list-buffers-directory name)
        (current-buffer))))
@@ -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.3")
 
 ;;;;
 ;;;; file names
@@ -197,10 +195,10 @@ arguments.  If ARGS is not a list, no argument will be passed."
 ;;;; (interactive <foo>) support function
 ;;;;
 
-(defstruct (cvs-qtypedesc
-           (:constructor nil) (:copier nil)
-           (:constructor cvs-qtypedesc-create
-                         (str2obj obj2str &optional complete hist-sym require)))
+(cl-defstruct (cvs-qtypedesc
+               (:constructor nil) (:copier nil)
+               (:constructor cvs-qtypedesc-create
+                (str2obj obj2str &optional complete hist-sym require)))
   str2obj
   obj2str
   hist-sym
@@ -233,10 +231,10 @@ arguments.  If ARGS is not a list, no argument will be passed."
 ;;;; Flags handling
 ;;;;
 
-(defstruct (cvs-flags
-           (:constructor nil)
-           (:constructor -cvs-flags-make
-                         (desc defaults &optional qtypedesc hist-sym)))
+(cl-defstruct (cvs-flags
+               (:constructor nil)
+               (:constructor -cvs-flags-make
+                (desc defaults &optional qtypedesc hist-sym)))
   defaults persist desc qtypedesc hist-sym)
 
 (defmacro cvs-flags-define (sym defaults
@@ -255,7 +253,7 @@ arguments.  If ARGS is not a list, no argument will be passed."
 Optional argument DESC will be used for the prompt.
 If ARG (or a prefix argument) is nil, just use the 0th default.
 If it is a non-negative integer, use the corresponding default.
-If it is a negative integer query for a new value of the corresponding
+If it is a negative integer, query for a new value of the corresponding
   default and return that new value.
 If it is \\[universal-argument], just query and return a value without
   altering the defaults.
@@ -288,7 +286,7 @@ If it is \\[universal-argument] \\[universal-argument], behave just
       (nth numarg defaults))))
 
 (defsubst cvs-flags-set (sym index value)
-  "Set SYM's INDEX'th setting to VALUE."
+  "Set SYM's INDEXth setting to VALUE."
   (setf (nth index (cvs-flags-defaults (symbol-value sym))) value))
 
 ;;;;
@@ -325,7 +323,7 @@ See `cvs-prefix-set' for further description of the behavior."))
   "Set the cvs-prefix contained in SYM.
 If ARG is between 0 and 9, it selects the corresponding default.
 If ARG is negative (or \\[universal-argument] which corresponds to negative 0),
-  it queries the user and sets the -ARG'th default.
+  it queries the user and sets the -ARGth default.
 If ARG is greater than 9 (or \\[universal-argument] \\[universal-argument]),
   the (ARG mod 10)'th prefix is made persistent.
 If ARG is nil toggle the PREFIX's value between its 0th default and nil