;;; 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
+;; Copyright (C) 1991,92,93,94,95,96,97,98,99, 2000,01,04
;; 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.
(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)
(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
;;;
(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
(cvs-string->strings (substring string (cdr rfs))
sep)))))))
-;;;;
+;;;;
;;;; file names
-;;;;
+;;;;
(defsubst cvs-expand-dir-name (d)
(file-name-as-directory (expand-file-name d)))
initval hist-sym))
(t initval)))))
-;;;;
+;;;;
;;;; Flags handling
-;;;;
+;;;;
(defstruct (cvs-flags
(:constructor nil)
"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)
(provide 'pcvs-util)
+;;; arch-tag: 3b2588bb-2ae3-4f1f-bf5b-dea91b1f8a59
;;; pcvs-util.el ends here