X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/ed7f1a6c5caaf4159125c08db5d18c5471fdd032..e8757f091a502b858912a4c267210e009227d6e6:/lisp/vc/pcvs-util.el diff --git a/lisp/vc/pcvs-util.el b/lisp/vc/pcvs-util.el index 752016a039..fdef490d4a 100644 --- a/lisp/vc/pcvs-util.el +++ b/lisp/vc/pcvs-util.el @@ -1,6 +1,6 @@ ;;; pcvs-util.el --- utility functions for PCL-CVS -*- byte-compile-dynamic: t -*- -;; Copyright (C) 1991-2011 Free Software Foundation, Inc. +;; Copyright (C) 1991-2012 Free Software Foundation, Inc. ;; Author: Stefan Monnier ;; 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) @@ -88,8 +88,8 @@ try to split a new window instead." (pop-up-frames nil)) (or (let ((buf (get-buffer-window buf))) (and buf (select-window buf))) (and pop-up-windows - (ignore-errors (select-window (split-window-vertically))) - (switch-to-buffer buf)) + (ignore-errors (select-window (split-window-below))) + (switch-to-buffer buf nil 'force-same-window)) (pop-to-buffer (current-buffer))))) (defun cvs-bury-buffer (buf &optional 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 ) 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 @@ -307,7 +305,7 @@ If it is \\[universal-argument] \\[universal-argument], behave just See `cvs-prefix-set' for further description of the behavior.")) (defvar ,cps (let ((defaults ,defaults)) - ;; sanity ensurance + ;; sanity insurance (unless (>= (length defaults) cvs-prefix-number) (setq defaults (append defaults (make-list (1- cvs-prefix-number)