;; Author: Stefan Monnier <monnier@cs.yale.edu>
;; Keywords: pcl-cvs
-;; Revision: $Id: pcvs-util.el,v 1.14 2001/10/03 20:28:01 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)
(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
If ONELINE is t, only the first line (no \\n) will be returned.
If ARGS is non-nil, the file will be executed with ARGS as its
arguments. If ARGS is not a list, no argument will be passed."
- (with-temp-buffer
- (condition-case nil
- (progn
- (if args
- (apply 'call-process
- file nil t nil (when (listp args) args))
- (insert-file-contents file))
- (buffer-substring (point-min)
- (if oneline
- (progn (goto-char (point-min)) (end-of-line) (point))
- (point-max))))
- (file-error nil))))
+ (condition-case nil
+ (with-temp-buffer
+ (if args
+ (apply 'call-process
+ file nil t nil (when (listp args) args))
+ (insert-file-contents file))
+ (goto-char (point-min))
+ (buffer-substring (point)
+ (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."
(append (unless (eq i 0) (split-string (substring string 0 i) sep))
(let ((rfs (read-from-string string i)))
(cons (car rfs)
- (cvs-string->strings (substring string (cdr rfs)) sep)))))))
+ (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)
it queries the user and sets the -ARG'th 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
+If ARG is nil toggle the PREFIX's value between its 0th default and nil
and reset the persistence."
(let* ((prefix (symbol-value (cvs-prefix-sym sym)))
(numarg (if (integerp arg) arg 0))
(provide 'pcvs-util)
+;;; arch-tag: 3b2588bb-2ae3-4f1f-bf5b-dea91b1f8a59
;;; pcvs-util.el ends here