]> code.delx.au - gnu-emacs/blobdiff - lisp/pcvs-util.el
Add a provide statement.
[gnu-emacs] / lisp / pcvs-util.el
index 849bbd69f4f7aea3761a915b9bcfd7518ffcd757..a4eda95e23e5e4c244fa6eab8da3fa662ed6516a 100644 (file)
@@ -1,11 +1,10 @@
 ;;; pcvs-util.el --- utility functions for PCL-CVS  -*- byte-compile-dynamic: t -*-
 
-;; Copyright (C) 1991,92,93,94,95,96,97,98,99,2000, 2001
-;;  Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+;;   2000, 2001, 2004  Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@cs.yale.edu>
 ;; Keywords: pcl-cvs
-;; Revision: $Id: pcvs-util.el,v 1.16 2001/12/02 07:41:47 monnier Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -50,7 +49,6 @@
   (let ((zs ys))
     (dolist (x xs zs)
       (unless (member x ys) (push x zs)))))
-      
 
 (defun cvs-map (-cvs-map-f &rest -cvs-map-ls)
   (unless (cvs-every 'null -cvs-map-ls)
@@ -78,22 +76,6 @@ the other elements.  The ordering among elements is maintained."
       (if (funcall p x) (push x car) (push x cdr)))
     (cons (nreverse car) (nreverse cdr))))
 
-;; Copied from CL ;-(
-
-(defun cvs-butlast (x &optional n)
-  "Returns a copy of LIST with the last N elements removed."
-  (if (and n (<= n 0)) x
-    (cvs-nbutlast (copy-sequence x) n)))
-
-(defun cvs-nbutlast (x &optional n)
-  "Modifies LIST to remove the last N elements."
-  (let ((m (length x)))
-    (or n (setq n 1))
-    (and (< n m)
-        (progn
-          (if (> n 0) (setcdr (nthcdr (- (1- m) n) x) nil))
-          x))))
-
 ;;;
 ;;; frame, window, buffer handling
 ;;;
@@ -122,11 +104,12 @@ BUF is assumed to be a temporary buffer used from the buffer MAINBUF."
            (condition-case ()
                (delete-window win)
              (error (iconify-frame (window-frame win))))
-         (if (and mainbuf (get-buffer-window mainbuf))
-             ;; FIXME: if the buffer popped into a pre-existing window,
-             ;; we don't want to delete that window.
-             t ;;(delete-window win)
-             ))))
+;;;      (if (and mainbuf (get-buffer-window mainbuf))
+;;;          ;; FIXME: if the buffer popped into a pre-existing window,
+;;;          ;; we don't want to delete that window.
+;;;          t ;;(delete-window win)
+;;;          )
+         )))
     (with-current-buffer buf
       (bury-buffer (unless (and (eq buf (window-buffer (selected-window)))
                                (not (window-dedicated-p (selected-window))))
@@ -135,7 +118,7 @@ BUF is assumed to be a temporary buffer used from the buffer MAINBUF."
       (let ((mainwin (or (get-buffer-window mainbuf)
                         (get-buffer-window mainbuf 'visible))))
        (when mainwin (select-window mainwin))))))
-             
+
 (defun cvs-get-buffer-create (name &optional noreuse)
   "Create a buffer NAME unless such a buffer already exists.
 If the NAME looks like an absolute file name, the buffer will be created
@@ -198,9 +181,7 @@ arguments.  If ARGS is not a list, no argument will be passed."
 
 (defun cvs-string-prefix-p (str1 str2)
   "Tell whether STR1 is a prefix of STR2."
-  (let ((length1 (length str1)))
-    (and (>= (length str2) length1)
-        (string= str1 (substring str2 0 length1)))))
+  (eq t (compare-strings str2 nil (length str1) str1 nil nil)))
 
 ;; (string->strings (strings->string X)) == X
 (defun cvs-strings->string (strings &optional separator)
@@ -231,9 +212,9 @@ The SEPARATOR regexp defaults to \"\\s-+\"."
                      (cvs-string->strings (substring string (cdr rfs))
                                           sep)))))))
 
-;;;; 
+;;;;
 ;;;; file names
-;;;; 
+;;;;
 
 (defsubst cvs-expand-dir-name (d)
   (file-name-as-directory (expand-file-name d)))
@@ -273,9 +254,9 @@ The SEPARATOR regexp defaults to \"\\s-+\"."
                                initval hist-sym))
              (t initval)))))
 
-;;;; 
+;;;;
 ;;;; Flags handling
-;;;; 
+;;;;
 
 (defstruct (cvs-flags
            (:constructor nil)
@@ -335,9 +316,9 @@ If it is \\[universal-argument] \\[universal-argument], behave just
   "Set SYM's INDEX'th setting to VALUE."
   (setf (nth index (cvs-flags-defaults (symbol-value sym))) value))
 
-;;;; 
+;;;;
 ;;;; Prefix keys
-;;;; 
+;;;;
 
 (defconst cvs-prefix-number 10)
 
@@ -410,4 +391,5 @@ and reset it unless READ-ONLY is non-nil."
 
 (provide 'pcvs-util)
 
+;; arch-tag: 3b2588bb-2ae3-4f1f-bf5b-dea91b1f8a59
 ;;; pcvs-util.el ends here