Anonymous avatar Anonymous committed efaf5e9

[SC] [PATCH] packages: Sync of clearcase with upstream /main/laptop/156

-------------------- ChangeLog entries follow: --------------------

xemacs-packages/clearcase/ChangeLog addition:

2004-08-16 Adrian Aichner <adrian@xemacs.org>;

* Makefile (AUTHOR_VERSION): Update to upstream /main/laptop/156.
* Makefile (REQUIRES): Add sh-script.
* clearcase.el: Full sync with upstream /main/laptop/156.
* clearcase.el (clearcase-version-stamp):
* clearcase.el (clearcase-sink-file-name): New.
* clearcase.el (executable):
* clearcase.el (clearcase-dump):
* clearcase.el (clearcase-keep-uncheckouts): New.
* clearcase.el (clearcase-keep-unhijacks): New.
* clearcase.el (clearcase-auto-dired-mode):
* clearcase.el (clearcase-display-status): Removed.
* clearcase.el (clearcase-display-branch): Removed.
* clearcase.el (clearcase-checkout-dir-on-mkelem): Removed.
* clearcase.el (clearcase-dired-show-view): New.
* clearcase.el (clearcase-verify-pre-mkelem-dir-checkout): New.
* clearcase.el (clearcase-checkin-switches): Removed.
* clearcase.el (clearcase-checkin-arguments): New.
* clearcase.el (clearcase-checkout-switches): Removed.
* clearcase.el (clearcase-checkout-arguments): New.
* clearcase.el (clearcase-normal-diff-switches): Removed.
* clearcase.el (clearcase-normal-diff-arguments): New.
* clearcase.el (clearcase-prefix-map): New.
* clearcase.el (clearcase-dired-insert-viewtag): New.
* clearcase.el (clearcase-dired-reformat-buffer):
* clearcase.el (clearcase-dired-list-checkouts): Removed.
* clearcase.el (clearcase-dired-list-checkouts-experimental): Removed.
* clearcase.el (clearcase-dired-list-hijacks): Removed.
* clearcase.el (clearcase-dired-prefix-map): New.
* clearcase.el (clearcase-dired-list-modified-files): New.
* clearcase.el (clearcase-comment-start-entry):
* clearcase.el (clearcase-comment-save-comment-for-buffer):
* clearcase.el (clearcase-edcs-edit):
* clearcase.el (clearcase-hijack-current-buffer): New.
* clearcase.el (clearcase-hijack-dired-files): New.
* clearcase.el (clearcase-unhijack-current-buffer): New.
* clearcase.el (clearcase-unhijack-dired-files): New.
* clearcase.el (clearcase-annotate-file): New.
* clearcase.el (clearcase-annotate-current-buffer): New.
* clearcase.el (clearcase-annotate-dired-file): New.
* clearcase.el (clearcase-find-checkouts-in-current-view):
* clearcase.el (clearcase-ucm-set-activity-current-dir):
* clearcase.el (clearcase-ucm-describe-current-activity):
* clearcase.el (clearcase-edit-checkout-comment-current-buffer): New.
* clearcase.el (clearcase-edit-checkout-comment-dired-file): New.
* clearcase.el (clearcase-edit-checkout-comment): New.
* clearcase.el (clearcase-applet-diff-pred-current-buffer): Removed.
* clearcase.el (clearcase-gui-diff-pred-current-buffer): New.
* clearcase.el (clearcase-applet-diff-pred-dired-file): Removed.
* clearcase.el (clearcase-gui-diff-pred-dired-file): New.
* clearcase.el (clearcase-gui-diff-branch-base-current-buffer):
* clearcase.el (clearcase-gui-diff-branch-base-dired-file):
* clearcase.el (clearcase-applet-diff-branch-base-current-buffer()): Removed.
* clearcase.el (clearcase-gui-diff-branch-base-current-buffer()): New.
* clearcase.el (clearcase-applet-diff-branch-base-dired-file()): Removed.
* clearcase.el (clearcase-gui-diff-branch-base-dired-file()): New.
* clearcase.el (clearcase-applet-diff-named-version-current-buffer): Removed.
* clearcase.el (clearcase-gui-diff-named-version-current-buffer): New.
* clearcase.el (clearcase-applet-diff-named-version-dired-file): Removed.
* clearcase.el (clearcase-gui-diff-named-version-dired-file): New.
* clearcase.el (clearcase-applet-diff-file-with-version): Removed.
* clearcase.el (clearcase-gui-diff-file-with-version): New.
* clearcase.el (clearcase-version-other-window): New.
* clearcase.el (clearcase-applet-vtree-browser-current-buffer): Removed.
* clearcase.el (clearcase-gui-vtree-browser-current-buffer): New.
* clearcase.el (clearcase-applet-vtree-browser-dired-file): Removed.
* clearcase.el (clearcase-gui-vtree-browser-dired-file): New.
* clearcase.el (clearcase-applet-vtree-browser): Removed.
* clearcase.el (clearcase-gui-vtree-browser): New.
* clearcase.el (clearcase-applet-clearexplorer): Removed.
* clearcase.el (clearcase-gui-clearexplorer): New.
* clearcase.el (clearcase-applet-deliver): Removed.
* clearcase.el (clearcase-gui-deliver): New.
* clearcase.el (clearcase-applet-rebase): Removed.
* clearcase.el (clearcase-gui-rebase): New.
* clearcase.el (clearcase-applet-merge-manager): Removed.
* clearcase.el (clearcase-gui-merge-manager): New.
* clearcase.el (clearcase-applet-project-explorer): Removed.
* clearcase.el (clearcase-gui-project-explorer): New.
* clearcase.el (clearcase-applet-snapshot-view-updater): Removed.
* clearcase.el (clearcase-gui-snapshot-view-updater): New.
* clearcase.el (clearcase-update-default-directory):
* clearcase.el (clearcase-update-current-buffer):
* clearcase.el (clearcase-post-update-timer): New.
* clearcase.el (clearcase-post-update-work-queue): New.
* clearcase.el (clearcase-post-update-schedule-work): New.
* clearcase.el (clearcase-post-update-timer-function): Retain fix
to ignore nil viewtag.
* clearcase.el (clearcase-post-update-check-process-buffer): New.
* clearcase.el (clearcase-sync-after-scopes-updated): New.
* clearcase.el (clearcase-update):
* clearcase.el (clearcase-file-ok-to-hijack): New.
* clearcase.el (clearcase-hijack-seq): New.
* clearcase.el (clearcase-hijack): New.
* clearcase.el (clearcase-file-ok-to-unhijack): New.
* clearcase.el (clearcase-unhijack): New.
* clearcase.el (cleartool-unhijack-parse-for-kept-files): New.
* clearcase.el (clearcase-utl-files-in-same-view-p): New.
* clearcase.el (clearcase-unhijack-seq): New.
* clearcase.el (clearcase-file-ok-to-mkelem):
* clearcase.el (clearcase-commented-mkelem):
* clearcase.el (clearcase-commented-mkelem-seq):
* clearcase.el (clearcase-commented-checkin):
* clearcase.el (clearcase-file-ok-to-checkout):
* clearcase.el (clearcase-commented-checkout):
* clearcase.el (cleartool-unco-parse-for-kept-file): New.
* clearcase.el (clearcase-uncheckout):
* clearcase.el (clearcase-describe):
* clearcase.el (clearcase-list-history):
* clearcase.el (clearcase-diff-files):
* clearcase.el (clearcase-fprop-unparse-properties):
* clearcase.el (clearcase-fprop-display-properties):
* clearcase.el (clearcase-fprop-dump): Removed.
* clearcase.el (clearcase-fprop-dump-to-current-buffer): New.
* clearcase.el (clearcase-fprop-hijacked): New.
* clearcase.el (clearcase-fprop-fmt-string):
* clearcase.el (clearcase-fprop-read-properties):
* clearcase.el (clearcase-vprop-dump): Removed.
* clearcase.el (clearcase-vprop-dump-to-current-buffer): New.
* clearcase.el (clearcase-vprop-prefetch-queue): Removed.
* clearcase.el (clearcase-vprop-work-queue): New.
* clearcase.el (clearcase-vprop-schedule-fetch): Removed.
* clearcase.el (clearcase-vprop-schedule-work): New.
* clearcase.el (clearcase-vprop-timer-function):
* clearcase.el (clearcase-vprop-read-properties):
* clearcase.el (clearcase-vprop-read-activities-asynchronously):
* clearcase.el (clearcase-vprop-read-activities-synchronously): Removed.
* clearcase.el (clearcase-file-appears-modified-since-checkout-p):
* clearcase.el (clearcase-file-snapshot-root):
* clearcase.el (clearcase-ct-do-cleartool-command):
* clearcase.el (clearcase-ct-get-command-stdout):
* clearcase.el (clearcase-ct-kill-tq):
* clearcase.el (clearcase-do-command):
* clearcase.el (clearcase-path-file-in-any-scopes): New.
* clearcase.el (clearcase-path-file-in-scope): New.
* clearcase.el (clearcase-sync-after-file-updated-from-vob): New.
* clearcase.el (clearcase-sync-from-disk-if-needed): New.
* clearcase.el (clearcase-utl-populate-and-view-buffer): New.
* clearcase.el (clearcase-utl-edit-and-view-buffer): New.
* clearcase.el (clearcase-utl-touch-file): New.
* clearcase.el (clearcase-utl-any): New.
* clearcase.el (clearcase-utl-every): New.
* clearcase.el (clearcase-utl-make-writeable): New.
* clearcase.el (clearcase-utl-make-unwriteable): New.
* clearcase.el (clearcase-menu-contents-minimised):
* clearcase.el (clearcase-menu-contents):
* clearcase.el (clearcase-dired-current-ok-to-hijack): New.
* clearcase.el (clearcase-dired-current-ok-to-unhijack): New.
* clearcase.el (clearcase-dired-marked-ok-to-checkout):
* clearcase.el (clearcase-dired-marked-ok-to-uncheckout):
* clearcase.el (clearcase-dired-marked-ok-to-hijack): New.
* clearcase.el (clearcase-dired-marked-ok-to-mkelem):
* clearcase.el (clearcase-dired-marked-ok-to-unhijack): New.
* clearcase.el (clearcase-dired-menu-contents-minimised):
* clearcase.el (clearcase-dired-menu-contents):
* clearcase.el (clearcase-non-lt-registry-server-online-p):
* clearcase.el (clearcase-lt-registry-server-online-p):
* clearcase.el (clearcase-hook-find-file-hook):
* clearcase.el (clearcase-hook-dired-mode-hook):
* clearcase.el (clearcase-hook-dired-after-readin-hook):
* clearcase.texi: Add dircategory XEmacs.

Comments (0)

Files changed (4)

+2004-08-16  Adrian Aichner  <adrian@xemacs.org>
+
+	* Makefile (AUTHOR_VERSION): Update to upstream /main/laptop/156.
+	* Makefile (REQUIRES): Add sh-script.
+	* clearcase.el: Full sync with upstream /main/laptop/156.
+	* clearcase.el (clearcase-version-stamp):
+	* clearcase.el (clearcase-sink-file-name): New.
+	* clearcase.el (executable):
+	* clearcase.el (clearcase-dump):
+	* clearcase.el (clearcase-keep-uncheckouts): New.
+	* clearcase.el (clearcase-keep-unhijacks): New.
+	* clearcase.el (clearcase-auto-dired-mode):
+	* clearcase.el (clearcase-display-status): Removed.
+	* clearcase.el (clearcase-display-branch): Removed.
+	* clearcase.el (clearcase-checkout-dir-on-mkelem): Removed.
+	* clearcase.el (clearcase-dired-show-view): New.
+	* clearcase.el (clearcase-verify-pre-mkelem-dir-checkout): New.
+	* clearcase.el (clearcase-checkin-switches): Removed.
+	* clearcase.el (clearcase-checkin-arguments): New.
+	* clearcase.el (clearcase-checkout-switches): Removed.
+	* clearcase.el (clearcase-checkout-arguments): New.
+	* clearcase.el (clearcase-normal-diff-switches): Removed.
+	* clearcase.el (clearcase-normal-diff-arguments): New.
+	* clearcase.el (clearcase-prefix-map): New.
+	* clearcase.el (clearcase-dired-insert-viewtag): New.
+	* clearcase.el (clearcase-dired-reformat-buffer):
+	* clearcase.el (clearcase-dired-list-checkouts): Removed.
+	* clearcase.el (clearcase-dired-list-checkouts-experimental): Removed.
+	* clearcase.el (clearcase-dired-list-hijacks): Removed.
+	* clearcase.el (clearcase-dired-prefix-map): New.
+	* clearcase.el (clearcase-dired-list-modified-files): New.
+	* clearcase.el (clearcase-comment-start-entry):
+	* clearcase.el (clearcase-comment-save-comment-for-buffer):
+	* clearcase.el (clearcase-edcs-edit):
+	* clearcase.el (clearcase-hijack-current-buffer): New.
+	* clearcase.el (clearcase-hijack-dired-files): New.
+	* clearcase.el (clearcase-unhijack-current-buffer): New.
+	* clearcase.el (clearcase-unhijack-dired-files): New.
+	* clearcase.el (clearcase-annotate-file): New.
+	* clearcase.el (clearcase-annotate-current-buffer): New.
+	* clearcase.el (clearcase-annotate-dired-file): New.
+	* clearcase.el (clearcase-find-checkouts-in-current-view):
+	* clearcase.el (clearcase-ucm-set-activity-current-dir):
+	* clearcase.el (clearcase-ucm-describe-current-activity):
+	* clearcase.el (clearcase-edit-checkout-comment-current-buffer): New.
+	* clearcase.el (clearcase-edit-checkout-comment-dired-file): New.
+	* clearcase.el (clearcase-edit-checkout-comment): New.
+	* clearcase.el (clearcase-applet-diff-pred-current-buffer): Removed.
+	* clearcase.el (clearcase-gui-diff-pred-current-buffer): New.
+	* clearcase.el (clearcase-applet-diff-pred-dired-file): Removed.
+	* clearcase.el (clearcase-gui-diff-pred-dired-file): New.
+	* clearcase.el (clearcase-gui-diff-branch-base-current-buffer):
+	* clearcase.el (clearcase-gui-diff-branch-base-dired-file):
+	* clearcase.el (clearcase-applet-diff-branch-base-current-buffer()): Removed.
+	* clearcase.el (clearcase-gui-diff-branch-base-current-buffer()): New.
+	* clearcase.el (clearcase-applet-diff-branch-base-dired-file()): Removed.
+	* clearcase.el (clearcase-gui-diff-branch-base-dired-file()): New.
+	* clearcase.el (clearcase-applet-diff-named-version-current-buffer): Removed.
+	* clearcase.el (clearcase-gui-diff-named-version-current-buffer): New.
+	* clearcase.el (clearcase-applet-diff-named-version-dired-file): Removed.
+	* clearcase.el (clearcase-gui-diff-named-version-dired-file): New.
+	* clearcase.el (clearcase-applet-diff-file-with-version): Removed.
+	* clearcase.el (clearcase-gui-diff-file-with-version): New.
+	* clearcase.el (clearcase-version-other-window): New.
+	* clearcase.el (clearcase-applet-vtree-browser-current-buffer): Removed.
+	* clearcase.el (clearcase-gui-vtree-browser-current-buffer): New.
+	* clearcase.el (clearcase-applet-vtree-browser-dired-file): Removed.
+	* clearcase.el (clearcase-gui-vtree-browser-dired-file): New.
+	* clearcase.el (clearcase-applet-vtree-browser): Removed.
+	* clearcase.el (clearcase-gui-vtree-browser): New.
+	* clearcase.el (clearcase-applet-clearexplorer): Removed.
+	* clearcase.el (clearcase-gui-clearexplorer): New.
+	* clearcase.el (clearcase-applet-deliver): Removed.
+	* clearcase.el (clearcase-gui-deliver): New.
+	* clearcase.el (clearcase-applet-rebase): Removed.
+	* clearcase.el (clearcase-gui-rebase): New.
+	* clearcase.el (clearcase-applet-merge-manager): Removed.
+	* clearcase.el (clearcase-gui-merge-manager): New.
+	* clearcase.el (clearcase-applet-project-explorer): Removed.
+	* clearcase.el (clearcase-gui-project-explorer): New.
+	* clearcase.el (clearcase-applet-snapshot-view-updater): Removed.
+	* clearcase.el (clearcase-gui-snapshot-view-updater): New.
+	* clearcase.el (clearcase-update-default-directory):
+	* clearcase.el (clearcase-update-current-buffer):
+	* clearcase.el (clearcase-post-update-timer): New.
+	* clearcase.el (clearcase-post-update-work-queue): New.
+	* clearcase.el (clearcase-post-update-schedule-work): New.
+	* clearcase.el (clearcase-post-update-timer-function): Retain fix
+	to ignore nil viewtag.
+	* clearcase.el (clearcase-post-update-check-process-buffer): New.
+	* clearcase.el (clearcase-sync-after-scopes-updated): New.
+	* clearcase.el (clearcase-update):
+	* clearcase.el (clearcase-file-ok-to-hijack): New.
+	* clearcase.el (clearcase-hijack-seq): New.
+	* clearcase.el (clearcase-hijack): New.
+	* clearcase.el (clearcase-file-ok-to-unhijack): New.
+	* clearcase.el (clearcase-unhijack): New.
+	* clearcase.el (cleartool-unhijack-parse-for-kept-files): New.
+	* clearcase.el (clearcase-utl-files-in-same-view-p): New.
+	* clearcase.el (clearcase-unhijack-seq): New.
+	* clearcase.el (clearcase-file-ok-to-mkelem):
+	* clearcase.el (clearcase-commented-mkelem):
+	* clearcase.el (clearcase-commented-mkelem-seq):
+	* clearcase.el (clearcase-commented-checkin):
+	* clearcase.el (clearcase-file-ok-to-checkout):
+	* clearcase.el (clearcase-commented-checkout):
+	* clearcase.el (cleartool-unco-parse-for-kept-file): New.
+	* clearcase.el (clearcase-uncheckout):
+	* clearcase.el (clearcase-describe):
+	* clearcase.el (clearcase-list-history):
+	* clearcase.el (clearcase-diff-files):
+	* clearcase.el (clearcase-fprop-unparse-properties):
+	* clearcase.el (clearcase-fprop-display-properties):
+	* clearcase.el (clearcase-fprop-dump): Removed.
+	* clearcase.el (clearcase-fprop-dump-to-current-buffer): New.
+	* clearcase.el (clearcase-fprop-hijacked): New.
+	* clearcase.el (clearcase-fprop-fmt-string):
+	* clearcase.el (clearcase-fprop-read-properties):
+	* clearcase.el (clearcase-vprop-dump): Removed.
+	* clearcase.el (clearcase-vprop-dump-to-current-buffer): New.
+	* clearcase.el (clearcase-vprop-prefetch-queue): Removed.
+	* clearcase.el (clearcase-vprop-work-queue): New.
+	* clearcase.el (clearcase-vprop-schedule-fetch): Removed.
+	* clearcase.el (clearcase-vprop-schedule-work): New.
+	* clearcase.el (clearcase-vprop-timer-function):
+	* clearcase.el (clearcase-vprop-read-properties):
+	* clearcase.el (clearcase-vprop-read-activities-asynchronously):
+	* clearcase.el (clearcase-vprop-read-activities-synchronously): Removed.
+	* clearcase.el (clearcase-file-appears-modified-since-checkout-p):
+	* clearcase.el (clearcase-file-snapshot-root):
+	* clearcase.el (clearcase-ct-do-cleartool-command):
+	* clearcase.el (clearcase-ct-get-command-stdout):
+	* clearcase.el (clearcase-ct-kill-tq):
+	* clearcase.el (clearcase-do-command):
+	* clearcase.el (clearcase-path-file-in-any-scopes): New.
+	* clearcase.el (clearcase-path-file-in-scope): New.
+	* clearcase.el (clearcase-sync-after-file-updated-from-vob): New.
+	* clearcase.el (clearcase-sync-from-disk-if-needed): New.
+	* clearcase.el (clearcase-utl-populate-and-view-buffer): New.
+	* clearcase.el (clearcase-utl-edit-and-view-buffer): New.
+	* clearcase.el (clearcase-utl-touch-file): New.
+	* clearcase.el (clearcase-utl-any): New.
+	* clearcase.el (clearcase-utl-every): New.
+	* clearcase.el (clearcase-utl-make-writeable): New.
+	* clearcase.el (clearcase-utl-make-unwriteable): New.
+	* clearcase.el (clearcase-menu-contents-minimised):
+	* clearcase.el (clearcase-menu-contents):
+	* clearcase.el (clearcase-dired-current-ok-to-hijack): New.
+	* clearcase.el (clearcase-dired-current-ok-to-unhijack): New.
+	* clearcase.el (clearcase-dired-marked-ok-to-checkout):
+	* clearcase.el (clearcase-dired-marked-ok-to-uncheckout):
+	* clearcase.el (clearcase-dired-marked-ok-to-hijack): New.
+	* clearcase.el (clearcase-dired-marked-ok-to-mkelem):
+	* clearcase.el (clearcase-dired-marked-ok-to-unhijack): New.
+	* clearcase.el (clearcase-dired-menu-contents-minimised):
+	* clearcase.el (clearcase-dired-menu-contents):
+	* clearcase.el (clearcase-non-lt-registry-server-online-p):
+	* clearcase.el (clearcase-lt-registry-server-online-p):
+	* clearcase.el (clearcase-hook-find-file-hook):
+	* clearcase.el (clearcase-hook-dired-mode-hook):
+	* clearcase.el (clearcase-hook-dired-after-readin-hook):
+	* clearcase.texi: Add dircategory XEmacs.
+
 2003-10-31  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.08 released.
 # Boston, MA 02111-1307, USA.
 
 VERSION = 1.08
-AUTHOR_VERSION = 
+AUTHOR_VERSION = /main/laptop/156
 MAINTAINER = Michael Diers <mdiers@xemacs.org>
 PACKAGE = clearcase
 PKG_TYPE = regular
 # Specify any required libraries which are not part of core lisp.
 # cl comint custom dired easymenu reporter ring timer tq
-REQUIRES = dired fsf-compat mail-lib xemacs-base
+REQUIRES = dired fsf-compat mail-lib xemacs-base sh-script
 CATEGORY = standard
 
 ELCS = clearcase.elc
 ;;; clearcase.el --- ClearCase/Emacs integration.
 
-;; Copyright (C) 1999, 2000, 2001, 2002 Kevin Esler
-
-;; Author: Kevin Esler <esler@rational.com>
-;; Maintainer: Kevin Esler <esler@rational.com>
+;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Kevin Esler
+
+;; Author: Kevin Esler <kaesler@us.ibm.com>
+;; Maintainer: Kevin Esler <kaesler@us.ibm.com>
 ;; Keywords: clearcase tools
 ;; Web home: http://members.verizon.net/~vze24fr2/EmacsClearCase
 
 
 ;; This is a ClearCase/Emacs integration.
 ;;
-
 ;;
 ;; How to use
 ;; ==========
 ;;     unco,
 ;;     describe
 ;;     list history
+;;     edit config spec
 ;;     mkbrtype
-;;     update view
-;;     version comparisons using ediff, diff or applet
-;;   Auto version-stamping (if enabled, e.g in this file)
+;;     snapshot view update: file, directory, view
+;;     version comparisons using ediff, diff or GUI
+;;     find checkouts
+;;     annotate version
+;;     et al.
 ;;
 ;; Acknowledgements
 ;; ================
 ;;     Jonathan Stigelman
 ;;     Steve Baur
 ;;
+;;   Other Contributors:
+;;
+;;     Alastair Rankine
+;;     Andrew Maguire
+;;     Barnaby Dalton
+;;     Christian Savard
+;;     David O'Shea
+;;     Dee Zsombor
+;;     Gabor Zoka
+;;     Jason Rumney
+;;     Jeff Phillips
+;;     Justin Vallon
+;;     Mark Collins
+;;     Patrik Madison
+;;     Ram Bhamidipaty
+;;     Reinhard Hahn
+;;     Richard Kim
+;;     Richard Y. Kim
+;;     Simon Graham
+;;     Stephen Leake
+;;     Steven E. Harris
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;;}}}
 
 ;;{{{ Version info
 
-(defconst clearcase-version-stamp "ClearCase-version: </main/laptop/116>")
+(defconst clearcase-version-stamp "ClearCase-version: </main/laptop/156>")
 (defconst clearcase-version (substring clearcase-version-stamp 19))
 
 (defun clearcase-maintainer-address ()
 
 (defvar clearcase-on-cygwin (memq system-type '(cygwin cygwin32)))
 
+(defvar clearcase-sink-file-name
+  (cond
+   (clearcase-on-cygwin "/dev/null")
+   (clearcase-on-mswindows "NUL")
+   (t "/dev/null")))
+
 (defun clearcase-view-mode-quit (buf)
   "Exit from View mode, restoring the previous window configuration."
   (progn
 (require 'comint)
 (require 'dired)
 (require 'easymenu)
+(require 'executable)
 (require 'reporter)
 (require 'ring)
 (or clearcase-xemacs-p
 
 (defun clearcase-dump ()
   (interactive)
-  (let ((buf (get-buffer-create "*clearcase-dump*"))
-        (camefrom (current-buffer)))
-    (save-excursion
-      (set-buffer buf)
-      (clearcase-view-mode 0 camefrom)
-      (erase-buffer))
-    (clearcase-fprop-dump buf)
-    (clearcase-vprop-dump buf)
-    (clearcase-port-view-buffer-other-window buf)
-    (goto-char 0)
-    (set-buffer-modified-p nil)         ; XEmacs - fsf uses `not-modified'
-    (shrink-window-if-larger-than-buffer)))
+  (clearcase-utl-populate-and-view-buffer
+   "*clearcase-dump*"
+   nil
+   (function (lambda ()
+               (clearcase-fprop-dump-to-current-buffer)
+               (clearcase-vprop-dump-to-current-buffer)))))
 
 (defun clearcase-flush-caches ()
   (interactive)
     (error nil))
   (if (and (featurep 'custom)
            (fboundp 'custom-declare-variable))
-      nil;; We've got what we needed
+      nil ;; We've got what we needed
     ;; We have the old custom-library, hack around it!
     (defmacro defgroup (&rest args)
       nil)
 
 (defgroup clearcase () "ClearCase Options" :group 'tools :prefix "clearcase")
 
+(defcustom clearcase-keep-uncheckouts t
+  "When true, the contents of an undone checkout will be kept in a file
+with a \".keep\" suffix. Otherwise it will be removed."
+  :group 'clearcase
+  :type 'boolean)
+
+(defcustom clearcase-keep-unhijacks t
+  "When true, the contents of an undone hijack will be kept in a file
+with a \".keep\" suffix. Otherwise it will be removed."
+  :group 'clearcase
+  :type 'boolean)
+
 ;; nyi: We could also allow a value of 'prompt here
 ;;
 (defcustom clearcase-set-to-new-activity t
   :group 'clearcase
   :type 'boolean)
 
-;; nyi: Currently unused:
-;;
-(defcustom clearcase-display-status t
-  "*If non-nil, display version string and reservation status in modeline.
-Otherwise, not displayed."
-  :group 'clearcase
-  :type 'boolean)
-
-;; nyi: Currently unused:
-;;
-(defcustom clearcase-display-branch t
-  "*If non-nil, full branch name of ClearCase working file displayed in modeline.
-Otherwise, just the version number or label is displayed."
-  :group 'clearcase
-  :type 'boolean)
-
 (defcustom clearcase-auto-dired-mode t
-  "*If non-nil, automatically enter `clearcase-dired-mode' in dired-mode buffers where
-version control is set-up."
+  "*If non-nil, automatically enter `clearcase-dired-mode' in dired-mode
+for directories in ClearCase."
   :group 'clearcase
   :type 'boolean)
 
   :group 'clearcase
   :type 'boolean)
 
-(defcustom clearcase-checkout-dir-on-mkelem 'ask
-  "*If t, automatically checkout the directory (if needed) when creating an element.
-If nil, don't checkout the directory and cancel the registration.
-If `ask', prompt before checking out the directory.
-
-This only applies to version control systems with versioned directories (namely
-ClearCase."
+(defcustom clearcase-dired-show-view t
+  "If non-nil, show the view tag in dired buffers."
   :group 'clearcase
-  :type '(radio (const :tag "Never checkout dir on mkelem" nil)
-                (const :tag "Automatically checkout dir on mkelem" t)
-                (const :tag "Prompt to checkout dir on mkelem" ask)))
+  :type 'boolean)
+
+(defcustom clearcase-verify-pre-mkelem-dir-checkout nil
+  "*If non-nil, prompt before checking out the containing directory
+before creating a new ClearCase element."
+  :group 'clearcase
+  :type 'boolean)
 
 (defcustom clearcase-diff-on-checkin nil
   "Display diff on checkin to help you compose the checkin comment."
   :group 'clearcase
   :type 'boolean)
 
-(defcustom clearcase-checkin-switches nil
-  "Extra switches passed to the checkin program by \\[clearcase-checkin]."
+(defcustom clearcase-checkin-arguments
+  ;; For backwards compatibility with old name for this variable:
+  ;;
+  (if (and (boundp 'clearcase-checkin-switches)
+           (not (null clearcase-checkin-switches)))
+      (list clearcase-checkin-switches)
+    nil)
+  "A list of extra arguments passed to the checkin command."
   :group 'clearcase
-  :type '(radio (const :tag "No extra switches" nil)
-                (string :tag "Switches")))
+  :type '(repeat (string :tag "Argument")))
 
 (defcustom clearcase-checkin-on-mkelem nil
   "If t, file will be checked-in when first created as an element."
   :group 'clearcase
   :type 'boolean)
 
-(defcustom clearcase-checkout-switches nil
-  "Extra switches passed to the checkout program by \\[clearcase-commented-checkout]."
+(defcustom clearcase-checkout-arguments
+  ;; For backwards compatibility with old name for this variable:
+  ;;
+  (if (and (boundp 'clearcase-checkout-arguments)
+           (not (null clearcase-checkout-arguments)))
+      (list clearcase-checkout-arguments)
+    nil)
+  "A list of extra arguments passed to the checkout command."
   :group 'clearcase
-  :type '(radio (const :tag "No extra switches" nil)
-                (string :tag "Switches")))
+  :type '(repeat (string :tag "Argument")))
 
 (defcustom clearcase-directory-exclusion-list '("lost+found")
   "Directory names ignored by functions that recursively walk file trees."
   :group 'clearcase
   :type 'string)
 
-(defcustom clearcase-normal-diff-switches "-u"
-  "*Switches (combined into single string) passed to `clearcase-normal-diff-program'
+(defcustom clearcase-normal-diff-arguments
+  (if (and (boundp 'clearcase-normal-diff-switches)
+           (not (null clearcase-normal-diff-switches)))
+      (list clearcase-normal-diff-switches)
+    (list "-u"))
+  "A list of extra arguments passed to `clearcase-normal-diff-program'
 when `clearcase-use-normal-diff' is t.  Usage of the -u switch is
 recommended to produce unified diffs, when your
 `clearcase-normal-diff-program' supports it."
   :group 'clearcase
-  :type 'string)
+  :type '(repeat (string :tag "Argument")))
 
 (defcustom clearcase-vxpath-glue "@@"
   "The string used to construct version-extended pathnames."
 (define-key clearcase-prefix-map "b" 'clearcase-browse-vtree-current-buffer)
 (define-key clearcase-prefix-map "c" 'clearcase-uncheckout-current-buffer)
 (define-key clearcase-prefix-map "e" 'clearcase-edcs-edit)
+(define-key clearcase-prefix-map "g" 'clearcase-annotate-current-buffer)
 (define-key clearcase-prefix-map "i" 'clearcase-mkelem-current-buffer)
 (define-key clearcase-prefix-map "l" 'clearcase-list-history-current-buffer)
 (define-key clearcase-prefix-map "m" 'clearcase-mkbrtype)
 (define-key clearcase-prefix-map "w" 'clearcase-what-rule-current-buffer)
 (define-key clearcase-prefix-map "=" 'clearcase-diff-pred-current-buffer)
 (define-key clearcase-prefix-map "?" 'clearcase-describe-current-buffer)
+(define-key clearcase-prefix-map "~" 'clearcase-version-other-window)
 
 ;; To avoid confusion, we prevent VC Mode from being active at all by
 ;; undefining its keybindings for which ClearCase Mode doesn't yet have an
 ;; analogue.
 ;;
-(define-key clearcase-prefix-map "a" 'undefined);; vc-update-change-log
-(define-key clearcase-prefix-map "d" 'undefined);; vc-directory
-(define-key clearcase-prefix-map "g" 'undefined);; vc-annotate
-(define-key clearcase-prefix-map "h" 'undefined);; vc-insert-headers
-(define-key clearcase-prefix-map "m" 'undefined);; vc-merge
-(define-key clearcase-prefix-map "r" 'undefined);; vc-retrieve-snapshot
-(define-key clearcase-prefix-map "s" 'undefined);; vc-create-snapshot
-(define-key clearcase-prefix-map "t" 'undefined);; vc-dired-toggle-terse-mode
-(define-key clearcase-prefix-map "~" 'undefined);; vc-version-other-window
+(define-key clearcase-prefix-map "a" 'undefined) ;; vc-update-change-log
+(define-key clearcase-prefix-map "d" 'undefined) ;; vc-directory
+(define-key clearcase-prefix-map "h" 'undefined) ;; vc-insert-headers
+(define-key clearcase-prefix-map "m" 'undefined) ;; vc-merge
+(define-key clearcase-prefix-map "r" 'undefined) ;; vc-retrieve-snapshot
+(define-key clearcase-prefix-map "s" 'undefined) ;; vc-create-snapshot
+(define-key clearcase-prefix-map "t" 'undefined) ;; vc-dired-toggle-terse-mode
 
 ;; Associate the map and the minor mode
 ;;
               (setq arg (car arg)))
           (if (symbolp arg)
               (if (null arg)
-                  (not clearcase-mode);; toggle mode switch
-                (not (eq '- arg)));; True if symbol is not '-
+                  (not clearcase-mode) ;; toggle mode switch
+                (not (eq '- arg))) ;; True if symbol is not '-
 
             ;; else
             ;; assume it's a number and check that.
       (make-face 'clearcase-dired-checkedout-face)
       (set-face-foreground 'clearcase-dired-checkedout-face "red")))
 
+(defun clearcase-dired-insert-viewtag ()
+  (save-excursion
+    (progn
+      (goto-char (point-min))
+
+      ;; Only do this if the buffer is not currently narrowed
+      ;;
+      (if (= 1 (point))
+          (let ((viewtag (clearcase-fprop-viewtag (file-truename default-directory))))
+            (if viewtag
+                (progn
+                  (forward-line 1)
+                  (let ((buffer-read-only nil))
+                    (insert (format "  [ClearCase View: %s]\n" viewtag))))))))))
+
 (defun clearcase-dired-reformat-buffer ()
   "Reformats the current dired buffer."
   (let* ((checkout-list nil)
+         (modified-file-info nil)
+         (hijack-list nil)
          (directory default-directory)
          subdir
          fullpath)
          ((setq subdir (dired-get-subdir))
 
           ;; We're at a subdirectory line in the dired buffer.
-          ;; Go and list all checkouts in this subdirectory.
+          ;; Go and list all checkouts and hijacks in this subdirectory.
           ;;
-          (setq checkout-list (clearcase-dired-list-checkouts subdir))
+          (setq modified-file-info (clearcase-dired-list-modified-files subdir))
+          (setq checkout-list (nth 0 modified-file-info))
+          (setq hijack-list (nth 1 modified-file-info))
 
           ;; If no checkouts are found, we don't need to check each file, and
           ;; it's very slow.  The checkout-list should contain something so it
           ;;
           (if (null checkout-list)
               (setq checkout-list '(nil)))
+          (if (null hijack-list)
+              (setq hijack-list '(nil)))
           (message "Reformatting %s..." subdir))
 
          ;; Case 2: Look for files (the safest way to get the filename).
           ;;
           (setq fullpath (expand-file-name fullpath))
 
+	  (setq fullpath (clearcase-path-canonicalise-slashes fullpath))
+
           ;; Only modify directory listings of the correct format.
           ;; We replace the GID field with a checkout indicator.
           ;;
                      (replacement-end (match-end 4))
 
                      (replacement-length (- replacement-end replacement-begin))
-                     (replacement-text (format "CHECKOUT"))
+                     (checkout-replacement-text (format "CHECKOUT"))
+                     (hijack-replacement-text (format "HIJACK"))
                      (is-checkout (if checkout-list
                                       (member fullpath checkout-list)
-                                    (clearcase-fprop-checked-out fullpath))))
+                                    (clearcase-fprop-checked-out fullpath)))
+                     (is-hijack (if hijack-list
+                                      (member fullpath hijack-list)
+                                    (clearcase-fprop-hijacked fullpath))))
 
                 ;; Highlight the line if the file is checked-out.
                 ;;
                 (if is-checkout
-                    ;; Replace the GID field with CHECKOUT.
-                    ;;
-                    (let ((buffer-read-only nil))
-
-                      ;; Pad with replacement text with trailing spaces if necessary.
-                      ;;
-                      (if (>= replacement-length (length replacement-text))
-                          (setq replacement-text
-                                (concat replacement-text
-                                        (make-string (- replacement-length (length replacement-text))
-                                                     32))))
-                      (goto-char replacement-begin)
-                      (delete-char replacement-length)
-                      (insert (substring replacement-text 0 replacement-length)))
-
-                  ;; Highlight the checked out files.
-                  ;;
-                  (if (fboundp 'put-text-property)
-                      (let ((buffer-read-only nil))
-                        (put-text-property replacement-begin replacement-end
-                                           'face 'clearcase-dired-checkedout-face)))
-                  )))))
+		    (progn
+		      ;; Replace the GID field with CHECKOUT.
+		      ;;
+		      (let ((buffer-read-only nil))
+			
+			;; Pad with replacement text with trailing spaces if necessary.
+			;;
+			(if (>= replacement-length (length checkout-replacement-text))
+			    (setq checkout-replacement-text
+				  (concat checkout-replacement-text
+					  (make-string (- replacement-length (length checkout-replacement-text))
+						       32))))
+			(goto-char replacement-begin)
+			(delete-char replacement-length)
+			(insert (substring checkout-replacement-text 0 replacement-length)))
+		      
+		      ;; Highlight the checked out files.
+		      ;;
+		      (if (fboundp 'put-text-property)
+			  (let ((buffer-read-only nil))
+			    (put-text-property replacement-begin replacement-end
+					       'face 'clearcase-dired-checkedout-face)))
+		      )
+		  )
+
+                (if is-hijack
+		    (progn
+		      ;; Replace the GID field with CHECKOUT.
+		      ;;
+		      (let ((buffer-read-only nil))
+			
+			;; Pad with replacement text with trailing spaces if necessary.
+			;;
+			(if (>= replacement-length (length hijack-replacement-text))
+			    (setq hijack-replacement-text
+				  (concat hijack-replacement-text
+					  (make-string (- replacement-length (length hijack-replacement-text))
+						       32))))
+			(goto-char replacement-begin)
+			(delete-char replacement-length)
+			(insert (substring hijack-replacement-text 0 replacement-length)))
+		      
+		      ;; Highlight the checked out files.
+		      ;;
+		      (if (fboundp 'put-text-property)
+			  (let ((buffer-read-only nil))
+			    (put-text-property replacement-begin replacement-end
+					       'face 'clearcase-dired-checkedout-face)))		
+		      )
+		  )
+
+                ))))
         (forward-line 1))))
   (message "Reformatting...Done"))
 
     ;;
     path))
 
-(defun clearcase-dired-list-checkouts (directory)
-  "Returns a list of files checked-out to the current view in DIRECTORY."
-
-  ;; Don't bother looking for checkouts in
-  ;;  - a history-mode branch-qua-directory
-  ;;  - a view-private directory
-  ;;
-  ;; NYI: For now don't run lsco in root of a snapshot because it gives errors.
-  ;;      We need to make this smarter.
-  ;;
-  ;; NYI: For a pathname which is a slink to a dir, despite the fact that
-  ;;      clearcase-fprop-file-is-version-p returns true, lsco fails on it,
-  ;;      with "not an element". Sheesh, surely lsco ought to follow links ?
-  ;;      Solution: catch the error and check if the dir is a slink then follow
-  ;;      the link and retry the lsco on the target.
-  ;;
-  ;;      For now just ignore the error.
-  ;;
-  (if (and (not (clearcase-vxpath-p directory))
-           (not (eq 'view-private-object (clearcase-fprop-mtype directory)))
-           (clearcase-fprop-file-is-version-p directory))
-
-
-      (let* ((ignore (message "Listing ClearCase checkouts..."))
-
-             (true-dir-path (file-truename directory))
-
-             ;; Give the directory as an argument so all names will be
-             ;; fullpaths. For some reason ClearCase adds an extra slash if you
-             ;; leave the trailing slash on the directory, so we need to remove
-             ;; it.
-             ;;
-             (native-dir-path (clearcase-path-native (directory-file-name true-dir-path)))
-
-             (followed-dir-path (clearcase-path-follow-if-vob-slink native-dir-path))
-
-             ;; Form the command:
-             ;;
-             (cmd (list
-                   "lsco" "-cview" "-fmt"
-                   (if clearcase-on-mswindows
-                       "%n\\n"
-                     "'%n\\n'")
-
-                   followed-dir-path))
-
-             ;; Capture the output:
-             ;;
-             (string (clearcase-path-canonicalise-slashes
-                      (apply 'clearcase-ct-cleartool-cmd cmd)))
-
-             ;; Split the output at the newlines:
-             ;;
-             (checkout-list (clearcase-utl-split-string-at-char string ?\n)))
-
-        ;; Add entries for "." and ".." if they're checked-out.
-        ;;
-        (let* ((entry ".")
-               (path (expand-file-name (concat (file-name-as-directory true-dir-path)
-                                               entry))))
-          (if (clearcase-fprop-checked-out path)
-              (setq checkout-list (cons path checkout-list))))
-        (let* ((entry "..")
-               (path (expand-file-name (concat (file-name-as-directory true-dir-path)
-                                               entry))))
-          (if (clearcase-fprop-checked-out path)
-              (setq checkout-list (cons path checkout-list))))
-
-        ;; If DIRECTORY is a vob-slink, checkout list will contain pathnames
-        ;; relative to the vob-slink target rather than to DIRECTORY.  Convert
-        ;; them back here.  We're making it appear that lsco works on
-        ;; slinks-to-dirs.
-        ;;
-        (if (clearcase-fprop-file-is-vob-slink-p true-dir-path)
-            (let ((re (regexp-quote (file-name-as-directory followed-dir-path))))
-              (setq checkout-list
-                    (mapcar
-                     (function
-                      (lambda (path)
-                        (replace-regexp-in-string re true-dir-path path)))
-                     checkout-list))))
-
-        (message "Listing ClearCase checkouts...done")
-
-        ;; Return the result.
-        ;;
-        checkout-list)
-    ))
-
-;; I had believed that this implementation below OUGHT to be faster, having
-;; read the code in "ct+lsco". It seemed that "lsco -cview" hit the VOB and
-;; listed all checkouts on all elements in the directory, and then filtered by
-;; view.  I thought it would probably be quicker to run "ct ls -vob_only" and
-;; keep the lines that have "[eclipsed by checkout]".  However this code
-;; actually seemed to run slower.  Leave the code here for now so I can test
-;; further.
-;;
-(defun clearcase-dired-list-checkouts-experimental (directory)
-  "Returns a list of files checked-out to the current view in DIRECTORY."
-
-  ;; Don't bother looking for checkouts in a history-mode listing
-  ;; nor in view-private directories.
-  ;;
-  (if (and (not (clearcase-vxpath-p directory))
-           (not (eq 'view-private-object (clearcase-fprop-mtype directory))))
-
-      (let* ((ignore (message "Listing ClearCase checkouts..."))
-
-             (true-directory (file-truename directory))
-
-             ;; Move temporarily to the directory:
-             ;;
-             (default-directory true-directory)
-
-             ;; Form the command:
-             ;;
-             (cmd (list "ls" "-vob_only"))
-
-             ;; Capture the output:
-             ;;
-             (string (clearcase-path-canonicalise-slashes
-                      (apply 'clearcase-ct-cleartool-cmd cmd)))
-
-             ;; Split the output at the newlines:
-             ;;
-             (line-list (clearcase-utl-split-string-at-char string ?\n))
-
-             (checkout-list nil))
-
-        ;; Look for lines of the form:
-        ;; FILENAME@@ [eclipsed by checkout]
-        ;;
-        (mapcar (function
-                 (lambda (line)
-                   (if (string-match "^\\([^ @]+\\)@@ +\\[eclipsed by checkout\\].*" line)
-                       (setq checkout-list (cons (concat
-                                                  ;; Add back directory name to get
-                                                  ;; full pathname.
-                                                  ;;
-                                                  default-directory
-                                                  (substring line
-                                                             (match-beginning 1)
-                                                             (match-end 1)))
-                                                 checkout-list)))))
-                line-list)
-
-        ;; Add entries for "." and ".." if they're checked-out.
-        ;;
-        (let* ((entry ".")
-               (path (expand-file-name (concat true-directory entry))))
-          (if (clearcase-fprop-checked-out path)
-              (setq checkout-list (cons path checkout-list))))
-        (let* ((entry "..")
-               (path (expand-file-name (concat true-directory entry))))
-          (if (clearcase-fprop-checked-out path)
-              (setq checkout-list (cons path checkout-list))))
-
-        (message "Listing ClearCase checkouts...done")
-
-        ;; Return the result.
-        ;;
-        checkout-list)))
-
-(defun clearcase-dired-list-hijacks (directory)
-  "Returns a list of files hijacked to the current view in DIRECTORY."
+;;{{{ Searching for modified files
+
+;;{{{ Old code
+
+;; (defun clearcase-dired-list-checkouts (directory)
+;;   "Returns a list of files checked-out to the current view in DIRECTORY."
+
+;;   ;; Don't bother looking for checkouts in
+;;   ;;  - a history-mode branch-qua-directory
+;;   ;;  - a view-private directory
+;;   ;;
+;;   ;; NYI: For now don't run lsco in root of a snapshot because it gives errors.
+;;   ;;      We need to make this smarter.
+;;   ;;
+;;   ;; NYI: For a pathname which is a slink to a dir, despite the fact that
+;;   ;;      clearcase-fprop-file-is-version-p returns true, lsco fails on it,
+;;   ;;      with "not an element". Sheesh, surely lsco ought to follow links ?
+;;   ;;      Solution: catch the error and check if the dir is a slink then follow
+;;   ;;      the link and retry the lsco on the target.
+;;   ;;
+;;   ;;      For now just ignore the error.
+;;   ;;
+;;   (if (and (not (clearcase-vxpath-p directory))
+;;            (not (eq 'view-private-object (clearcase-fprop-mtype directory)))
+;;            (clearcase-fprop-file-is-version-p directory))
+
+
+;;       (let* ((ignore (message "Listing ClearCase checkouts..."))
+
+;;              (true-dir-path (file-truename directory))
+
+;;              ;; Give the directory as an argument so all names will be
+;;              ;; fullpaths. For some reason ClearCase adds an extra slash if you
+;;              ;; leave the trailing slash on the directory, so we need to remove
+;;              ;; it.
+;;              ;;
+;;              (native-dir-path (clearcase-path-native (directory-file-name true-dir-path)))
+
+;;              (followed-dir-path (clearcase-path-follow-if-vob-slink native-dir-path))
+
+;;              ;; Form the command:
+;;              ;;
+;;              (cmd (list
+;;                    "lsco" "-cview" "-fmt"
+;;                    (if clearcase-on-mswindows
+;;                        "%n\\n"
+;;                      "'%n\\n'")
+
+;;                    followed-dir-path))
+
+;;              ;; Capture the output:
+;;              ;;
+;;              (string (clearcase-path-canonicalise-slashes
+;;                       (apply 'clearcase-ct-cleartool-cmd cmd)))
+
+;;              ;; Split the output at the newlines:
+;;              ;;
+;;              (checkout-list (clearcase-utl-split-string-at-char string ?\n)))
+
+;;         ;; Add entries for "." and ".." if they're checked-out.
+;;         ;;
+;;         (let* ((entry ".")
+;;                (path (expand-file-name (concat (file-name-as-directory true-dir-path)
+;;                                                entry))))
+;;           (if (clearcase-fprop-checked-out path)
+;;               (setq checkout-list (cons path checkout-list))))
+;;         (let* ((entry "..")
+;;                (path (expand-file-name (concat (file-name-as-directory true-dir-path)
+;;                                                entry))))
+;;           (if (clearcase-fprop-checked-out path)
+;;               (setq checkout-list (cons path checkout-list))))
+
+;;         ;; If DIRECTORY is a vob-slink, checkout list will contain pathnames
+;;         ;; relative to the vob-slink target rather than to DIRECTORY.  Convert
+;;         ;; them back here.  We're making it appear that lsco works on
+;;         ;; slinks-to-dirs.
+;;         ;;
+;;         (if (clearcase-fprop-file-is-vob-slink-p true-dir-path)
+;;             (let ((re (regexp-quote (file-name-as-directory followed-dir-path))))
+;;               (setq checkout-list
+;;                     (mapcar
+;;                      (function
+;;                       (lambda (path)
+;;                         (replace-regexp-in-string re true-dir-path path)))
+;;                      checkout-list))))
+
+;;         (message "Listing ClearCase checkouts...done")
+
+;;         ;; Return the result.
+;;         ;;
+;;         checkout-list)
+;;     ))
+
+;; ;; I had believed that this implementation below OUGHT to be faster, having
+;; ;; read the code in "ct+lsco". It seemed that "lsco -cview" hit the VOB and
+;; ;; listed all checkouts on all elements in the directory, and then filtered by
+;; ;; view.  I thought it would probably be quicker to run "ct ls -vob_only" and
+;; ;; keep the lines that have "[eclipsed by checkout]".  However this code
+;; ;; actually seemed to run slower.  Leave the code here for now so I can test
+;; ;; further.
+;; ;;
+;; (defun clearcase-dired-list-checkouts-experimental (directory)
+;;   "Returns a list of files checked-out to the current view in DIRECTORY."
+
+;;   ;; Don't bother looking for checkouts in a history-mode listing
+;;   ;; nor in view-private directories.
+;;   ;;
+;;   (if (and (not (clearcase-vxpath-p directory))
+;;            (not (eq 'view-private-object (clearcase-fprop-mtype directory))))
+
+;;       (let* ((ignore (message "Listing ClearCase checkouts..."))
+
+;;              (true-directory (file-truename directory))
+
+;;              ;; Move temporarily to the directory:
+;;              ;;
+;;              (default-directory true-directory)
+
+;;              ;; Form the command:
+;;              ;;
+;;              (cmd (list "ls" "-vob_only"))
+
+;;              ;; Capture the output:
+;;              ;;
+;;              (string (clearcase-path-canonicalise-slashes
+;;                       (apply 'clearcase-ct-cleartool-cmd cmd)))
+
+;;              ;; Split the output at the newlines:
+;;              ;;
+;;              (line-list (clearcase-utl-split-string-at-char string ?\n))
+
+;;              (checkout-list nil))
+
+;;         ;; Look for lines of the form:
+;;         ;; FILENAME@@ [eclipsed by checkout]
+;;         ;;
+;;         (mapcar (function
+;;                  (lambda (line)
+;;                    (if (string-match "^\\([^ @]+\\)@@ +\\[eclipsed by checkout\\].*" line)
+;;                        (setq checkout-list (cons (concat
+;;                                                   ;; Add back directory name to get
+;;                                                   ;; full pathname.
+;;                                                   ;;
+;;                                                   default-directory
+;;                                                   (substring line
+;;                                                              (match-beginning 1)
+;;                                                              (match-end 1)))
+;;                                                  checkout-list)))))
+;;                 line-list)
+
+;;         ;; Add entries for "." and ".." if they're checked-out.
+;;         ;;
+;;         (let* ((entry ".")
+;;                (path (expand-file-name (concat true-directory entry))))
+;;           (if (clearcase-fprop-checked-out path)
+;;               (setq checkout-list (cons path checkout-list))))
+;;         (let* ((entry "..")
+;;                (path (expand-file-name (concat true-directory entry))))
+;;           (if (clearcase-fprop-checked-out path)
+;;               (setq checkout-list (cons path checkout-list))))
+
+;;         (message "Listing ClearCase checkouts...done")
+
+;;         ;; Return the result.
+;;         ;;
+;;         checkout-list)))
+
+;; (defun clearcase-dired-list-hijacks (directory)
+;;   "Returns a list of files hijacked to the current view in DIRECTORY."
+
+;;   ;; Don't bother looking for hijacks in;
+;;   ;;   - a history-mode listing
+;;   ;;   - a in view-private directory
+;;   ;;   - a dynamic view
+;;   ;;
+;;   (let* ((true-directory (file-truename directory))
+;;          (viewtag (clearcase-fprop-viewtag true-directory)))
+
+;;     (if (and viewtag
+;;              (not (clearcase-vxpath-p directory))
+;;              (not (eq 'view-private-object (clearcase-fprop-mtype directory)))
+;;              (clearcase-file-would-be-in-snapshot-p true-directory))
+
+;;         (let* ((ignore (message "Listing ClearCase hijacks..."))
+
+;;                (true-directory (file-truename directory))
+
+;;                ;; Form the command:
+;;                ;;
+;;                (cmd (list
+;;                      "ls"
+
+;;                      ;; Give the directory as an argument so all names will be
+;;                      ;; fullpaths. For some reason ClearCase adds an extra slash
+;;                      ;; if you leave the trailing slash on the directory, so we
+;;                      ;; need to remove it.
+;;                      ;;
+;;                      (clearcase-path-native (directory-file-name true-directory))))
+
+;;                ;; Capture the output:
+;;                ;;
+;;                (string (clearcase-path-canonicalise-slashes
+;;                         (apply 'clearcase-ct-cleartool-cmd cmd)))
+
+;;                ;; Split the output at the newlines:
+;;                ;;
+;;                (line-list (clearcase-utl-split-string-at-char string ?\n))
+
+;;                (hijack-list nil))
+
+;;           (mapcar (function
+;;                    (lambda (line)
+;;                      (if (string-match "^\\([^ @]+\\)@@[^ ]+ \\[hijacked\\].*" line)
+;;                          (setq hijack-list (cons (substring line
+;;                                                             (match-beginning 1)
+;;                                                             (match-end 1))
+;;                                                  hijack-list)))))
+;;                   line-list)
+
+;;           (message "Listing ClearCase hijacks...done")
+
+;;           ;; Return the result.
+;;           ;;
+;;           hijack-list))))
+
+;;}}}
+
+(defun clearcase-dired-list-modified-files (directory)
+  "Returns a pair of lists of files (checkouts . hijacks) to the current view in DIRECTORY."
 
   ;; Don't bother looking for hijacks in;
   ;;   - a history-mode listing
   ;;   - a dynamic view
   ;;
   (let* ((true-directory (file-truename directory))
-         (viewtag (clearcase-fprop-viewtag true-directory)))
+         (viewtag (clearcase-fprop-viewtag true-directory))
+         (snapshot (clearcase-file-would-be-in-snapshot-p true-directory))
+         (result '(() ())))
 
     (if (and viewtag
              (not (clearcase-vxpath-p directory))
-             (not (eq 'view-private-object (clearcase-fprop-mtype directory)))
-             (clearcase-file-would-be-in-snapshot-p true-directory))
-
-        (let* ((ignore (message "Listing ClearCase hijacks..."))
+             (not (eq 'view-private-object (clearcase-fprop-mtype directory))))
+
+        (let* ((ignore (message "Listing ClearCase modified files..."))
 
                (true-directory (file-truename directory))
 
                (string (clearcase-path-canonicalise-slashes
                         (apply 'clearcase-ct-cleartool-cmd cmd)))
 
-             ;; Split the output at the newlines:
-             ;;
-             (line-list (clearcase-utl-split-string-at-char string ?\n))
-
-             (hijack-list nil))
+               ;; Split the output at the newlines:
+               ;;
+               (line-list (clearcase-utl-split-string-at-char string ?\n))
+
+               (hijack-list nil)
+               (checkout-list nil))
 
           (mapcar (function
                    (lambda (line)
                          (setq hijack-list (cons (substring line
                                                             (match-beginning 1)
                                                             (match-end 1))
-                                                 hijack-list)))))
+                                                 hijack-list)))
+                     (if (string-match "^\\([^ @]+\\)@@.+CHECKEDOUT from .*" line)
+                         (setq checkout-list (cons (substring line
+                                                              (match-beginning 1)
+                                                              (match-end 1))
+                                                   checkout-list)))))
                   line-list)
 
-          (message "Listing ClearCase hijacks...done")
+          (message "Listing ClearCase modified files...done")
 
           ;; Return the result.
           ;;
-          hijack-list))))
+          (setq result (list checkout-list hijack-list))))
+    result))
+
+;;}}}
 
 ;;}}}
 
 (define-key clearcase-dired-prefix-map "c" 'clearcase-uncheckout-dired-files)
 (define-key clearcase-dired-prefix-map "e" 'clearcase-edcs-edit)
 (define-key clearcase-dired-prefix-map "i" 'clearcase-mkelem-dired-files)
+(define-key clearcase-dired-prefix-map "g" 'clearcase-annotate-dired-file)
 (define-key clearcase-dired-prefix-map "l" 'clearcase-list-history-dired-file)
 (define-key clearcase-dired-prefix-map "m" 'clearcase-mkbrtype)
 (define-key clearcase-dired-prefix-map "u" 'clearcase-uncheckout-dired-files)
 ;; undefining its keybindings for which ClearCase Mode doesn't yet have an
 ;; analogue.
 ;;
-(define-key clearcase-dired-prefix-map "a" 'undefined);; vc-update-change-log
-(define-key clearcase-dired-prefix-map "d" 'undefined);; vc-directory
-(define-key clearcase-dired-prefix-map "g" 'undefined);; vc-annotate
-(define-key clearcase-dired-prefix-map "h" 'undefined);; vc-insert-headers
-(define-key clearcase-dired-prefix-map "m" 'undefined);; vc-merge
-(define-key clearcase-dired-prefix-map "r" 'undefined);; vc-retrieve-snapshot
-(define-key clearcase-dired-prefix-map "s" 'undefined);; vc-create-snapshot
-(define-key clearcase-dired-prefix-map "t" 'undefined);; vc-dired-toggle-terse-mode
+(define-key clearcase-dired-prefix-map "a" 'undefined) ;; vc-update-change-log
+(define-key clearcase-dired-prefix-map "d" 'undefined) ;; vc-directory
+(define-key clearcase-dired-prefix-map "h" 'undefined) ;; vc-insert-headers
+(define-key clearcase-dired-prefix-map "m" 'undefined) ;; vc-merge
+(define-key clearcase-dired-prefix-map "r" 'undefined) ;; vc-retrieve-snapshot
+(define-key clearcase-dired-prefix-map "s" 'undefined) ;; vc-create-snapshot
+(define-key clearcase-dired-prefix-map "t" 'undefined) ;; vc-dired-toggle-terse-mode
 
 ;; Associate the map and the minor mode
 ;;
 
           (if (symbolp arg)
               (if (null arg)
-                  (not clearcase-dired-mode);; toggle mode switch
-                (not (eq '- arg)));; True if symbol is not '-
+                  (not clearcase-dired-mode) ;; toggle mode switch
+                (not (eq '- arg))) ;; True if symbol is not '-
 
             ;; else
             ;; assume it's a number and check that.
 Optional 6th argument specifies a COMMENT-SEED to insert in the comment buffer for
 the user to edit."
 
-  (let ((comment-buffer (get-buffer-create (format "*Comment-%s*" uniquifier)))
+  (let ((comment-buffer (get-buffer-create (format "*clearcase-comment-%s*" uniquifier)))
         (old-window-config (current-window-configuration))
         (parent (or parent-buffer
                     (current-buffer))))
     (pop-to-buffer comment-buffer)
 
+    ;; Record in buffer-local variables information sufficient to restore
+    ;; window context.
+    ;;
     (set (make-local-variable 'clearcase-comment-window-config) old-window-config)
     (set (make-local-variable 'clearcase-parent-buffer) parent)
 
             (clearcase-ct-do-cleartool-command "chevent"
                                                file
                                                comment
-                                               "-replace")
+                                               (list "-replace"))
             (clearcase-fprop-set-comment file comment))
         (error "Can't change comment of checked-in version with this interface")))))
 
        (read-string "View Tag: "))))
 
   (let ((start (current-buffer))
-        (buffer-name (format "*ClearCase-Config-%s*" tag-name)))
+        (buffer-name (format "*clearcase-config-spec-%s*" tag-name)))
     (kill-buffer (get-buffer-create buffer-name))
     (pop-to-buffer (get-buffer-create buffer-name))
     (auto-save-mode auto-save-default)
 
 ;;{{{ Commands
 
-;;{{{ Find checkouts
+;;{{{ Hijack/unhijack
+
+(defun clearcase-hijack-current-buffer ()
+  "Hijack the file in the current buffer."
+  (interactive)
+  (clearcase-hijack buffer-file-name))
+
+(defun clearcase-hijack-dired-files ()
+  "Hijack the selected files."
+  (interactive)
+  (clearcase-hijack-seq (dired-get-marked-files)))
+
+(defun clearcase-unhijack-current-buffer ()
+  "Unhijack the file in the current buffer."
+  (interactive)
+  (clearcase-unhijack buffer-file-name))
+
+(defun clearcase-unhijack-dired-files ()
+  "Hijack the selected files."
+  (interactive)
+  (clearcase-unhijack-seq (dired-get-marked-files)))
+
+;;}}}
+
+;;{{{ Annotate
+
+(defun clearcase-annotate-file (file)
+  (let ((relative-name (file-relative-name file)))
+    (message "Annotating %s ..." relative-name)
+    (clearcase-with-tempfile
+     annotation-file
+     (clearcase-ct-do-cleartool-command "annotate"
+                                        file
+                                        'unused
+                                        (list "-nco"
+                                              "-out"
+                                              annotation-file))
+     (clearcase-utl-populate-and-view-buffer
+      "*clearcase-annotate*"
+      nil
+      (function
+       (lambda ()
+         (insert-file-contents annotation-file)))))
+    (message "Annotating %s ...done" relative-name)))
+
+(defun clearcase-annotate-current-buffer ()
+  (interactive)
+  (clearcase-annotate-file buffer-file-name))
+
+(defun clearcase-annotate-dired-file ()
+  "Annotate the selected file."
+  (interactive)
+  (clearcase-annotate-file (dired-get-filename)))
+
+;;}}}
+
+;;{{{ nyi: Find checkouts
 
 ;; NYI: Enhance this:
 ;;  - group by:
   "Find the checkouts in all vobs in the current view."
   (interactive)
   (let ((viewtag (clearcase-fprop-viewtag default-directory))
-        (dir default-directory)
-        (camefrom (current-buffer)))
+        (dir default-directory))
     (if viewtag
         (let* ((ignore (message "Finding checkouts..."))
-               (ret (clearcase-ct-blocking-call "lsco"
-                                                "-cview"
-                                                "-avobs"
-                                                "-short")))
-          (if (zerop (length ret))
+               (text (clearcase-ct-blocking-call "lsco"
+                                                 "-cview"
+                                                 "-avobs"
+                                                 "-short")))
+          (if (zerop (length text))
               (message "No checkouts found")
-            (message "Finding checkouts...done")
-            (set-buffer (get-buffer-create "*clearcase*"))
-            (clearcase-view-mode 0 camefrom)
-            (erase-buffer)
-            (insert ret)
-            (clearcase-port-view-buffer-other-window "*clearcase*")
-            (goto-char 0)
-            (set-buffer-modified-p nil)   ; XEmacs - fsf uses `not-modified'
-            (shrink-window-if-larger-than-buffer))))))
+            (progn
+              (message "Finding checkouts...done")
+
+              (clearcase-utl-populate-and-view-buffer
+               "*clearcase*"
+               (list text)
+               (function (lambda (s)
+                           (insert s))))))))))
 
 ;;}}}
 
     (let ((activities (clearcase-ucm-filter-out-rebases (clearcase-vprop-activities viewtag))))
       (if (null activities)
           (error "View %s has no activities" viewtag))
-      (clearcase-ucm-make-selection-window (concat "*clearcase-activity-select-%s*" viewtag)
+      (clearcase-ucm-make-selection-window (format "*clearcase-activity-select-%s*" viewtag)
                                            (mapconcat
                                             (function
                                              (lambda (activity)
 
 (defun clearcase-ucm-describe-current-activity ()
   (interactive)
-  (let* ((viewtag (clearcase-fprop-viewtag default-directory))
-         (camefrom (current-buffer)))
+  (let* ((viewtag (clearcase-fprop-viewtag default-directory)))
     (if (not viewtag)
         (error "Not in a view"))
     (if (not (clearcase-vprop-ucm viewtag))
           (current-activity (clearcase-vprop-current-activity viewtag)))
       (if (not current-activity)
           (message "No activity set")
-        (let ((ret (clearcase-ct-blocking-call "desc"
-                                               (concat "activity:"
-                                                       current-activity
-                                                       "@"
-                                                       pvob))))
-          ;; nyi:factor this sort of stuff out
-          ;;
-          (if (not (zerop (length ret)))
-              (progn
-                (set-buffer (get-buffer-create "*clearcase*"))
-                (clearcase-view-mode 0 camefrom)
-                (erase-buffer)
-                (insert ret)
-                (clearcase-port-view-buffer-other-window "*clearcase*")
-                (goto-char 0)
-                (set-buffer-modified-p nil)   ; XEmacs - fsf uses `not-modified'
-                (shrink-window-if-larger-than-buffer))))))))
-
+        (let ((text (clearcase-ct-blocking-call "desc"
+                                                (concat "activity:"
+                                                        current-activity
+                                                        "@"
+                                                        pvob))))
+          (if (not (zerop (length text)))
+              (clearcase-utl-populate-and-view-buffer
+               "*clearcase*"
+               (list text)
+               (function (lambda (s)
+                           (insert s))))))))))
 ;;}}}
 
 ;;}}}
 
 ;;}}}
 
+;;{{{ Edit checkout comment
+
+(defun clearcase-edit-checkout-comment-current-buffer ()
+  "Edit the clearcase comment for the checked-out file in the current buffer."
+  (interactive)
+  (clearcase-edit-checkout-comment buffer-file-name))
+
+(defun clearcase-edit-checkout-comment-dired-file ()
+  "Checkin the selected file."
+  (interactive)
+  (clearcase-edit-checkout-comment (dired-get-filename)))
+
+(defun clearcase-edit-checkout-comment (file &optional comment)
+  "Edit comment for FILE by popping up a buffer to accept one.  If COMMENT
+is specified, save it."
+  (if (null comment)
+      ;; If no comment supplied, go and get one...
+      ;;
+      (clearcase-comment-start-entry (file-name-nondirectory file)
+				     "Edit the file's check-out comment."
+				     'clearcase-edit-checkout-comment
+				     (list buffer-file-name)
+				     (find-file-noselect file)
+				     (clearcase-fprop-comment file))
+    ;; We have a comment, save it
+    (clearcase-comment-save-comment-for-buffer comment clearcase-parent-buffer)))
+
+;;}}}
+
 ;;{{{ Checkout
 
 (defun clearcase-checkout-current-buffer ()
 
 ;;}}}
 
-;;{{{ Applet diff
-
-(defun clearcase-applet-diff-pred-current-buffer ()
-  "Use applet to compare a version in the current buffer against its predecessor."
+;;{{{ GUI diff
+
+(defun clearcase-gui-diff-pred-current-buffer ()
+  "Use GUI to compare a version in the current buffer against its predecessor."
   (interactive)
-  (clearcase-applet-diff-file-with-version buffer-file-name
-                                           (clearcase-fprop-predecessor-version buffer-file-name)))
-
-(defun clearcase-applet-diff-pred-dired-file ()
-  "Use applet to compare the selected version against its predecessor."
+  (clearcase-gui-diff-file-with-version buffer-file-name
+                                        (clearcase-fprop-predecessor-version buffer-file-name)))
+
+(defun clearcase-gui-diff-pred-dired-file ()
+  "Use GUI to compare the selected version against its predecessor."
   (interactive)
   (let ((truename (clearcase-fprop-truename (dired-get-filename))))
-    (clearcase-applet-diff-file-with-version truename
-                                             (clearcase-fprop-predecessor-version truename))))
-
-(defun clearcase-applet-diff-branch-base-current-buffer()
-  "Use applet to compare a version in the current buffer
+    (clearcase-gui-diff-file-with-version truename
+                                          (clearcase-fprop-predecessor-version truename))))
+
+(defun clearcase-gui-diff-branch-base-current-buffer()
+  "Use GUI to compare a version in the current buffer
 against the base of its branch."
   (interactive)
-  (clearcase-applet-diff-file-with-version buffer-file-name
-                                           (clearcase-vxpath-version-of-branch-base buffer-file-name)))
-
-(defun clearcase-applet-diff-branch-base-dired-file()
-  "Use applet to compare the selected version against the base of its branch."
+  (clearcase-gui-diff-file-with-version buffer-file-name
+                                        (clearcase-vxpath-version-of-branch-base buffer-file-name)))
+
+(defun clearcase-gui-diff-branch-base-dired-file()
+  "Use GUI to compare the selected version against the base of its branch."
   (interactive)
   (let ((truename (clearcase-fprop-truename (dired-get-filename))))
-    (clearcase-applet-diff-file-with-version truename
-                                             (clearcase-vxpath-version-of-branch-base truename))))
-
-(defun clearcase-applet-diff-named-version-current-buffer (version)
+    (clearcase-gui-diff-file-with-version truename
+                                          (clearcase-vxpath-version-of-branch-base truename))))
+
+(defun clearcase-gui-diff-named-version-current-buffer (version)
   ;; nyi: if we're in history-mode, probably should just use
   ;; (read-file-name)
   ;;
   (interactive (list (clearcase-read-version-name "Version for comparison: "
                                                   buffer-file-name)))
-  (clearcase-applet-diff-file-with-version buffer-file-name version))
-
-(defun clearcase-applet-diff-named-version-dired-file (version)
+  (clearcase-gui-diff-file-with-version buffer-file-name version))
+
+(defun clearcase-gui-diff-named-version-dired-file (version)
   ;; nyi: if we're in history-mode, probably should just use
   ;; (read-file-name)
   ;;
   (interactive (list (clearcase-read-version-name "Version for comparison: "
                                                   (dired-get-filename))))
-  (clearcase-applet-diff-file-with-version  (clearcase-fprop-truename (dired-get-filename))
-                                            version))
-
-(defun clearcase-applet-diff-file-with-version (truename other-version)
+  (clearcase-gui-diff-file-with-version  (clearcase-fprop-truename (dired-get-filename))
+                                         version))
+
+(defun clearcase-gui-diff-file-with-version (truename other-version)
   (let* ((other-vxpath (clearcase-vxpath-cons-vxpath (clearcase-vxpath-element-part truename)
                                                      other-version))
          (other-file (if (clearcase-file-is-in-mvfs-p truename)
                          other-vxpath
                        (clearcase-vxpath-get-version-in-temp-file other-vxpath)))
-         (applet-name (if clearcase-on-mswindows
-                          "cleardiffmrg"
-                        "xcleardiff")))
-    (start-process-shell-command "Diff"
-                                 nil
-                                 applet-name
-                                 other-file
-                                 truename)))
+         (gui-name (if clearcase-on-mswindows
+                       "cleardiffmrg"
+                     "xcleardiff")))
+    (start-process "Diff"
+                   nil
+                   gui-name
+                   (clearcase-path-native other-file)
+                   (clearcase-path-native truename))))
 
 ;;}}}
 
 
 ;;{{{ Browse vtree
 
+(defun clearcase-version-other-window (version)
+  (interactive
+   (list
+    (clearcase-read-version-name (format "Version of %s to visit: "
+      (file-name-nondirectory buffer-file-name))
+                                 buffer-file-name)))
+  (find-file-other-window (clearcase-vxpath-cons-vxpath
+                           (clearcase-vxpath-element-part buffer-file-name)
+                           version)))
+
 (defun clearcase-browse-vtree-current-buffer ()
   (interactive)
   (clearcase-browse-vtree buffer-file-name))
 
 ;;}}}
 
-;;{{{ Applet vtree
-
-(defun clearcase-applet-vtree-browser-current-buffer ()
+;;{{{ GUI vtree
+
+(defun clearcase-gui-vtree-browser-current-buffer ()
   (interactive)
-  (clearcase-applet-vtree-browser buffer-file-name))
-
-(defun clearcase-applet-vtree-browser-dired-file ()
+  (clearcase-gui-vtree-browser buffer-file-name))
+
+(defun clearcase-gui-vtree-browser-dired-file ()
   (interactive)
-  (clearcase-applet-vtree-browser (dired-get-filename)))
-
-(defun clearcase-applet-vtree-browser (file)
-  (let ((applet-name (if clearcase-on-mswindows
-                         "clearvtree"
-                       "xlsvtree")))
+  (clearcase-gui-vtree-browser (dired-get-filename)))
+
+(defun clearcase-gui-vtree-browser (file)
+  (let ((gui-name (if clearcase-on-mswindows
+                      "clearvtree"
+                    "xlsvtree")))
     (start-process-shell-command "Vtree_browser"
                                  nil
-                                 applet-name
-                                 file)))
+                                 gui-name
+                                 (clearcase-path-native file))))
 
 ;;}}}
 
-;;{{{ Other applets
-
-(defun clearcase-applet-clearexplorer ()
+;;{{{ Other GUIs
+
+(defun clearcase-gui-clearexplorer ()
   (interactive)
   (start-process-shell-command "ClearExplorer"
                                nil
                                "clearexplorer"
                                "."))
 
-(defun clearcase-applet-rebase ()
+(defun clearcase-gui-rebase ()
   (interactive)
   (start-process-shell-command "Rebase"
                                nil
                                    "/rebase"
                                  "-rebase")))
 
-(defun clearcase-applet-deliver ()
+(defun clearcase-gui-deliver ()
   (interactive)
   (start-process-shell-command "Deliver"
                                nil
                                    "/deliver"
                                  "-deliver")))
 
-(defun clearcase-applet-merge-manager ()
+(defun clearcase-gui-merge-manager ()
   (interactive)
   (start-process-shell-command "Merge_manager"
                                nil
                                "clearmrgman"))
 
-(defun clearcase-applet-project-explorer ()
+(defun clearcase-gui-project-explorer ()
   (interactive)
   (start-process-shell-command "Project_explorer"
                                nil
                                "clearprojexp"))
 
-(defun clearcase-applet-snapshot-view-updater ()
+(defun clearcase-gui-snapshot-view-updater ()
   (interactive)
   (start-process-shell-command "View_updater"
                                nil
 
 (defun clearcase-update-default-directory ()
   (interactive)
-  (clearcase-update (clearcase-fprop-viewtag default-directory) default-directory))
+  (clearcase-update (clearcase-fprop-viewtag default-directory)
+                    default-directory))
 
 (defun clearcase-update-current-buffer ()
   (interactive)
-  (clearcase-update (clearcase-fprop-viewtag default-directory) buffer-file-name))
+  (clearcase-update (clearcase-fprop-viewtag default-directory)
+                    buffer-file-name))
 
 (defun clearcase-update-dired-files ()
   (interactive)
   (apply (function clearcase-update)
          (cons (clearcase-fprop-viewtag default-directory)
                (dired-get-marked-files))))
+
+
+;;}}}
+
+;;}}}
+
+;;{{{ Functions
+
+;;{{{ Basic ClearCase operations
+
+;;{{{ Update snapshot view
+
+;;{{{ Asynchronous post-processing of update
+
+(defvar clearcase-post-update-timer nil)
+(defvar clearcase-post-update-work-queue nil)
+
+(defun clearcase-post-update-schedule-work (buffer)
+  (clearcase-trace "entering clearcase-post-update-schedule-work")
+  ;; Add to the work queue.
+  ;;
+  (setq clearcase-post-update-work-queue (cons buffer
+                                               clearcase-post-update-work-queue))
+  ;; Create the timer if necessary.
+  ;;
+  (if (null clearcase-post-update-timer)
+      (if clearcase-xemacs-p
+          ;; Xemacs
+          ;;
+          (setq clearcase-post-update-timer
+                (run-with-idle-timer 2 t 'clearcase-post-update-timer-function))
+        ;; FSF Emacs
+        ;;
+        (progn
+          (setq clearcase-post-update-timer (timer-create))
+          (timer-set-function clearcase-post-update-timer 'clearcase-post-update-timer-function)
+          (timer-set-idle-time clearcase-post-update-timer 2)
+          (timer-activate-when-idle clearcase-post-update-timer)))
+    (clearcase-trace "clearcase-post-update-schedule-work: post-update timer found to be non-null")))
+
+
+(defun clearcase-post-update-timer-function ()
+  (clearcase-trace "Entering clearcase-post-update-timer-function")
+  ;; For (each update-process buffer in the work queue)
+  ;;   if (its process has successfully terminated)
+  ;;      do the post-processing for this update
+  ;;      remove it from the work queue
+  ;;
+  (clearcase-trace (format "Queue before: %s" clearcase-post-update-work-queue))
+  (setq clearcase-post-update-work-queue
+
+        (clearcase-utl-list-filter
+         (function clearcase-post-update-check-process-buffer)
+         clearcase-post-update-work-queue))
+
+  (clearcase-trace (format "Queue after: %s" clearcase-post-update-work-queue))
+  ;; If the work queue is now empty cancel the timer.
+  ;;
+  (if (null clearcase-post-update-work-queue)
+      (progn
+        (cancel-timer clearcase-post-update-timer)
+        (setq clearcase-post-update-timer nil))))
+
+(defun clearcase-post-update-check-process-buffer (buffer)
+  (clearcase-trace "Entering clearcase-post-update-check-process-buffer")
+
+  ;; return t for those buffers that should remain in the work queue
+
+  ;; if it has terminated successfully
+  ;;   go sync buffers on the files that were updated
+
+  ;; We want to field errors here and when they occurm return nil to avoid a
+  ;; loop
+  ;;
+  ;;(condition-case nil
+
+  ;; protected form
+  (let ((proc (get-buffer-process buffer)))
+    (if proc
+        ;; Process still exists so keep this on the work queue.
+        ;;
+        (progn
+          (clearcase-trace "Update process still exists")
+          t)
+
+      ;; Process no longer there, cleaned up by comint code.
+      ;;
+
+      ;; Sync any buffers that need it.
+      ;;
+      (clearcase-trace "Update process finished")
+      (clearcase-sync-after-scopes-updated (with-current-buffer buffer
+                                             ;; Evaluate buffer-local variable.
+                                             ;;
+                                             clearcase-update-buffer-scopes))
+
+      ;; Remove  from work queue
+      ;;
+      nil))
+
+  ;; Error occurred, make sure we return nil to remove the buffer from the
+  ;; work queue, or a loop could develop.
+  ;;
+  ;;(error nil)
+  )
+
+(defun clearcase-sync-after-scopes-updated (scopes)
+  (clearcase-trace "Entering clearcase-sync-after-scopes-updated")
+
+  ;; nyi: reduce scopes to minimal set of disjoint scopes
+
+  ;; Use dynamic binding here since we don't have lexical binding.
+  ;;
+  (let ((clearcase-dynbound-updated-scopes scopes))
+
+    ;; For all buffers...
+    ;;
+    (mapcar
+     (function
+      (lambda (buffer)
+        (let ((visited-file (buffer-file-name buffer)))
+          (if visited-file
+              (if (clearcase-path-file-in-any-scopes visited-file
+                                                     clearcase-dynbound-updated-scopes)
+                  ;; This buffer visits a file within an updated scope.
+                  ;; Sync it from disk if it needs it.
+                  ;;
+                  (clearcase-sync-from-disk-if-needed visited-file))
+
+            ;; Buffer is not visiting a file.  If it is a dired-mode buffer
+            ;; under one of the scopes, revert it.
+            ;;
+            (with-current-buffer buffer
+              (if (eq 'dired-mode major-mode)
+                  (if (clearcase-path-file-in-any-scopes default-directory
+                                                         clearcase-dynbound-updated-scopes)
+                      (dired-revert nil t))))))))
+     (buffer-list))))
+
+;;}}}
+
 ;; Silence compiler complaints about free variable.
 ;;
 (defvar clearcase-update-buffer-viewtag nil)
 
-(defun clearcase-update (viewtag &rest pnames)
+(defun clearcase-update (viewtag &rest files)
   "Run a cleartool+update process in VIEWTAG
 if there isn't one already running in that view.
-Other arguments PNAMES indicate files to update"
+Other arguments FILES indicate files to update"
 
   ;; Check that there is no update process running in that view.
   ;;
                                  (if (not (eq 'exit (process-status proc)))
                                      (let ((buf (process-buffer proc)))
                                        (and buf
-                                            (assq 'clearcase-update-buffer-viewtag (buffer-local-variables buf))
+                                            (assq 'clearcase-update-buffer-viewtag
+                                                  (buffer-local-variables buf))
                                             (save-excursion
                                               (set-buffer buf)
-                                              (equal viewtag clearcase-update-buffer-viewtag)))))))
+                                              (equal viewtag
+                                                     clearcase-update-buffer-viewtag)))))))
                      (process-list)))
       (error "There is already an update running in view %s" viewtag))
 
   ;;  - mark it as one of ours by setting clearcase-update-buffer-viewtag
   ;;
   (pop-to-buffer (apply (function make-comint)
-                        (append (list "clearcase-update-temp-name"
+                        (append (list "*clearcase-update-temp-name*"
                                       clearcase-cleartool-path
                                       nil
                                       "update")
-                                pnames))
-                 t);; other window
+                                files))
+                 t) ;; other window
   (rename-buffer "*clearcase-update*" t)
-  (set (make-local-variable 'clearcase-update-buffer-viewtag) viewtag))
+
+  ;; Store in this buffer what view was being updated and what files.
+  ;;
+  (set (make-local-variable 'clearcase-update-buffer-viewtag) viewtag)
+  (set (make-local-variable 'clearcase-update-buffer-scopes) files)
+
+  ;; nyi: schedule post-update buffer syncing
+  (clearcase-post-update-schedule-work (current-buffer)))
 
 ;;}}}
 
+;;{{{ Hijack
+
+(defun clearcase-file-ok-to-hijack (file)
+
+  "Test if FILE is suitable for hijack."
+
+  (and
+
+   ;; If it is writeable already, no need to offer a hijack operation, even
+   ;; though, according to ClearCase, it may not yet be hijacked.
+   ;;
+   ;;(not (file-writable-p file))
+
+   (not (clearcase-fprop-hijacked file))
+   (clearcase-file-is-in-view-p file)
+   (not (clearcase-file-is-in-mvfs-p file))
+   (eq 'version (clearcase-fprop-mtype file))
+   (not (clearcase-fprop-checked-out file))))
+
+(defun clearcase-hijack-seq (files)
+  (unwind-protect
+      (progn
+        (message "Hijacking...")
+        (mapcar
+         (function
+          (lambda (file)
+            (if (not (file-directory-p file))
+                (clearcase-hijack file))))
+         files))
+    ;; Unwind
+    ;;
+    (message "Hijacking...done")))
+
+(defun clearcase-hijack (file)
+
+  ;; cases
+  ;;  - buffer/files modtimes are equal
+  ;;  - file more recent
+  ;;    ==> revert
+  ;;  - buffer more recent
+  ;;    ==> make file writeable; save buffer ?
+  ;;
+  ;; Post-conditions:
+  ;;   - file is hijacked wrt. CC
+  ;;   - buffer is in sync with disk contents, modtime and writeability
+  ;;     except if the user refused to save
+  ;;
+  (if (not (file-writable-p file))
+      ;; Make it writeable.
+      ;;
+      (clearcase-utl-make-writeable file))
+
+  ;; Attempt to modify the modtime of the file on disk, otherwise ClearCase
+  ;; won't actually deem it hijacked. This will silently fail if there is no
+  ;; "touch" command command available.
+  ;;
+  (clearcase-utl-touch-file file)
+
+  ;; Sync up any buffers.
+  ;;
+  (clearcase-sync-from-disk file t))
+
 ;;}}}
 
-;;{{{ Functions
-
-;;{{{ Basic ClearCase operations
+;;{{{ Unhijack
+
+(defun clearcase-file-ok-to-unhijack (file)
+  "Test if FILE is suitable for unhijack."
+  (clearcase-fprop-hijacked file))
+
+(defun clearcase-unhijack (file)
+  (clearcase-unhijack-seq (list file)))
+
+(defun cleartool-unhijack-parse-for-kept-files (ret snapshot-view-root)
+  ;; Look for occurrences of:
+  ;; Loading "source\emacs\.emacs.el" (296690 bytes).
+  ;; (renaming original hijacked object to ".emacs.el.keep.10").
+  ;;
+  (let ((start 0)
+        (kept-files nil))
+    (while (string-match
+            "^Loading \"\\([^\"]+\\)\"[^\n]+\n(renaming original hijacked object to \"\\([^\"]+\\)\")\\.\n"
+            ret
+            start)
+      (let* ((elt-path (substring ret (match-beginning 1) (match-end 1)))
+             (abs-elt-path (concat (if snapshot-view-root
+                                       snapshot-view-root
+                                     "/")
+                                   elt-path))
+             (abs-elt-dir (file-name-directory abs-elt-path ))
+             (kept-file-rel (concat abs-elt-dir
+                                    (substring ret (match-beginning 2) (match-end 2))))
+
+             ;; This is necessary on Windows to get an absolute path, i.e. one
+             ;; with a drive letter. Note: probably only correct if
+             ;; unhijacking files in a single snapshot view, mounted on a
+             ;; drive-letter.
+             ;;
+             (kept-file (expand-file-name kept-file-rel)))
+        (setq kept-files (cons kept-file kept-files)))
+      (setq start (match-end 0)))
+    kept-files))
+
+(defun clearcase-utl-files-in-same-view-p (files)
+  (if (< (length files) 2)
+      t
+    (let ((v0 (clearcase-fprop-viewtag (nth 0 files)))
+          (v1 (clearcase-fprop-viewtag (nth 1 files))))
+      (if (or (not (stringp v0))
+              (not (stringp v1))
+              (not (string= v0 v1)))
+          nil
+        (clearcase-utl-files-in-same-view-p (cdr files))))))
+
+(defun clearcase-unhijack-seq (files)
+
+  ;; Check: there are no directories involved.
+  ;;
+  (mapcar
+   (function
+    (lambda (file)
+      (if (file-directory-p file)
+          (error "Cannot unhijack a directory"))))
+   files)
+
+  ;; Check: all files are in the same snapshot view.
+  ;;
+  ;; (Why ?  The output from ct+update only has view-root-relative paths
+  ;; and we need to obtain absolute paths of renamed-aside hijacks if we are to
+  ;; dired-relist them.)
+  ;;
+  ;; Alternative: partition the set, with each partition containing elements in
+  ;; the same view.
+  ;;
+  (if (not (clearcase-utl-files-in-same-view-p files))
+      (error "Can't unhijack files in different views in the same operation"))
+
+  ;; Run the scoped workspace update synchronously.
+  ;;
+  (unwind-protect
+      (progn
+        (message "Unhijacking...")
+        (let* ((ret (apply (function clearcase-ct-blocking-call)
+                           (append (list "update"
+                                         (if clearcase-keep-unhijacks
+                                             "-rename"
+                                           "-overwrite")
+                                         "-log" clearcase-sink-file-name)
+                                   files)))
+               (snapshot-view-root (clearcase-file-snapshot-root (car files)))
+
+               ;; Scan for renamed-aside files.
+               ;;
+               (kept-files (if clearcase-keep-unhijacks
+                               (cleartool-unhijack-parse-for-kept-files ret
+                                                                        snapshot-view-root)
+                             nil)))
+
+          ;; Do post-update synchronisation.
+          ;;
+          (mapcar
+           (function clearcase-sync-after-file-updated-from-vob)
+           files)
+
+          ;; Update any dired buffers as to the existence of the kept files.
+          ;;
+          (if clearcase-keep-unhijacks
+              (mapcar (function
+                       (lambda (file)
+                         (dired-relist-file file)))
+                      kept-files))))
+    ;; unwind
+    ;;
+    (message "Unhijacking...done")))
+
+;;}}}
 
 ;;{{{ Mkelem
 
     (and (not (file-directory-p file))
          (and (or (equal 'view-private-object mtype)
                   (equal 'derived-object mtype))
+              (not (clearcase-fprop-hijacked file))
               (not (clearcase-file-covers-element-p file))))))
 
 (defun clearcase-assert-file-ok-to-mkelem (file)
   (if (not (clearcase-file-ok-to-mkelem file))
       (error "%s cannot be made into an element" file)))
 
-(defun clearcase-commented-mkelem (file &optional comment)
-  "Create a new element from FILE. If COMMENT is non-nil, it
-will be used, otherwise the user will be prompted to enter one."
-
+(defun clearcase-commented-mkelem (file &optional okay-to-checkout-dir-first comment)
+  "Create a new element from FILE. If OKAY-TO-CHECKOUT-DIR-FIRST is non-nil,
+the containing directory will be checked out if necessary.
+If COMMENT is non-nil, it will be used, otherwise the user will be prompted
+to enter one."
+
+  ;; Pre-condition
+  ;;
   (clearcase-assert-file-ok-to-mkelem file)
 
-  ;; We may need to checkout the directory.
-  ;;
-  (let ((containing-dir (file-name-directory file))
-        user)
-    (if (eq 'directory-version (clearcase-fprop-mtype containing-dir))
-        (progn
-          (setq user (clearcase-fprop-owner-of-checkout containing-dir))
-          (if user
-              (if (not (equal user (user-login-name)))
-                  (error "Directory is checked-out by %s." user))
-            (if (cond
-                 ((eq clearcase-checkout-dir-on-mkelem 'ask)
-                  (y-or-n-p (format "Checkout directory %s " containing-dir)))
-                 (clearcase-checkout-dir-on-mkelem)
-                 (t nil))
-                (clearcase-commented-checkout containing-dir comment)
-              (error "Can't make an element unless directory is checked-out."))))))
-
-  (if (null comment)
-      ;; If no comment supplied, go and get one...
-      ;;
-      (clearcase-comment-start-entry (file-name-nondirectory file)
-                                     "Enter initial comment for the new element."
-                                     'clearcase-commented-mkelem
-                                     (list file)
-                                     (find-file-noselect file)
-                                     clearcase-initial-mkelem-comment)
-
-    ;; ...otherwise perform the operation.
+  (let ((containing-dir (file-name-directory file)))
+
+    ;; Pre-condition
     ;;
-    (clearcase-fprop-unstore-properties file)
-    (message "Making element %s..." file)
-
-    (save-excursion
-      ;; Sync the buffer to disk.
-      ;;
-      (let ((buffer-on-file (find-buffer-visiting file)))
-        (if buffer-on-file
-            (progn
-              (set-buffer buffer-on-file)
-              (clearcase-sync-to-disk))))
-
-      (if clearcase-checkin-on-mkelem
-          (clearcase-ct-do-cleartool-command "mkelem" file comment "-ci")
-        (clearcase-ct-do-cleartool-command "mkelem" file comment))
-      (message "Making element %s...done" file)
-
-      ;; Resync.
-      ;;
-      (clearcase-sync-from-disk file t))))
+    (if (not (eq 'directory-version (clearcase-fprop-mtype containing-dir)))
+        (error "Parent directory of %s is not a ClearCase versioned directory."
+               file))
+
+    ;; Determine if we'll need to checkout the parent directory first.
+    ;;
+    (let ((dir-checkout-needed (not (clearcase-fprop-checked-out containing-dir))))
+      (if dir-checkout-needed
+          (progn
+            ;; Parent dir will need to be checked out. Get permission if
+            ;; appropriate.
+            ;;
+            (if (null okay-to-checkout-dir-first)
+                (setq okay-to-checkout-dir-first
+                      (or (null clearcase-verify-pre-mkelem-dir-checkout)
+                          (y-or-n-p (format "Checkout directory %s " containing-dir)))))
+            (if (null okay-to-checkout-dir-first)
+                (error "Can't make an element unless directory is checked-out."))))
+
+      (if (null comment)
+          ;; If no comment supplied, go and get one...
+          ;;
+          (clearcase-comment-start-entry (file-name-nondirectory file)
+                                         "Enter initial comment for the new element."
+                                         'clearcase-commented-mkelem
+                                         (list file okay-to-checkout-dir-first)
+                                         (find-file-noselect file)
+                                         clearcase-initial-mkelem-comment)
+
+        ;; ...otherwise perform the operation.
+        ;;
+
+        ;;    We may need to checkout the directory.
+        ;;
+        (if dir-checkout-needed
+            (clearcase-commented-checkout containing-dir comment))
+
+        (clearcase-fprop-unstore-properties file)
+
+        (message "Making element %s..." file)
+
+        (save-excursion
+          ;; Sync the buffer to disk.
+          ;;
+          (let ((buffer-on-file (find-buffer-visiting file)))
+            (if buffer-on-file
+                (progn
+                  (set-buffer buffer-on-file)
+                  (clearcase-sync-to-disk))))
+
+          (clearcase-ct-do-cleartool-command "mkelem"
+                                             file
+                                             comment
+                                             (if clearcase-checkin-on-mkelem
+                                                 (list "-ci")))
+          (message "Making element %s...done" file)
+
+          ;; Resync.
+          ;;
+          (clearcase-sync-from-disk file t))))))
 
 (defun clearcase-commented-mkelem-seq (files &optional comment)
   "Mkelem a sequence of FILES. If COMMENT is supplied it will be
     (mapcar
      (function
       (lambda (file)
-        (clearcase-commented-mkelem file comment)))
+        (clearcase-commented-mkelem file nil comment)))
      files)))
 
 ;;}}}
     ;;
     (message "Checking in %s..." file)
     (save-excursion
-      ;; Sync the buffer to disk, and get local value of clearcase-checkin-switches
+      ;; Sync the buffer to disk, and get local value of clearcase-checkin-arguments
       ;;
       (let ((buffer-on-file (find-buffer-visiting file)))
         (if buffer-on-file
             (progn
               (set-buffer buffer-on-file)
               (clearcase-sync-to-disk))))
-      (apply 'clearcase-ct-do-cleartool-command "ci" file comment
-             clearcase-checkin-switches))
+      (clearcase-ct-do-cleartool-command "ci"
+                                         file
+                                         comment
+                                         clearcase-checkin-arguments))
     (message "Checking in %s...done" file)
 
     ;; Resync.
   "Test if FILE is suitable for checkout."
   (let ((mtype (clearcase-fprop-mtype file)))
     (and (or (eq 'version mtype)
-             (eq 'directory-version mtype))
+             (eq 'directory-version mtype)
+             (clearcase-fprop-hijacked file))
          (not (clearcase-fprop-checked-out file)))))
 
 (defun clearcase-assert-file-ok-to-checkout (file)
     ;; ...otherwise perform the operation.
     ;;
     (message "Checking out %s..." file)
-    ;; Change buffers to get local value of clearcase-checkin-switches.
+    ;; Change buffers to get local value of clearcase-checkin-arguments.
     ;;
     (save-excursion
       (set-buffer (or (find-buffer-visiting file)
       (clearcase-ct-do-cleartool-command "co"
                                          file
                                          comment
-                                         clearcase-checkout-switches))
+                                         clearcase-checkout-arguments))
     (message "Checking out %s...done" file)
 
     ;; Resync.
   (if (not (clearcase-file-ok-to-uncheckout file))
       (error "You cannot uncheckout %s" file)))
 
+(defun cleartool-unco-parse-for-kept-file (ret)
+  ;;Private version of "foo" saved in "foo.keep.1"
+  (if (string-match "^Private version of .* saved in \"\\([^\"]+\\)\"\\.$" ret)
+      (substring ret (match-beginning 1) (match-end 1))
+    nil))
+
 (defun clearcase-uncheckout (file)
   "Uncheckout FILE."
 
            (not (yes-or-no-p (format "Really discard changes to %s ?" file))))
       (message "Uncheckout of %s cancelled" file)
 
-    ;; Go ahead and unco:
+    ;; Go ahead and unco.
     ;;
     (message "Cancelling checkout of %s..." file)
     ;; nyi:
     ;;  - Prompt for -keep or -rm
     ;;  - offer to remove /0 branches
     ;;
-    (clearcase-ct-do-cleartool-command "unco" file 'unused "-keep")
-    (message "Cancelling checkout of %s...done" file)
-
-    ;; Resync.
-    ;;
-    (clearcase-sync-from-disk file t)))
+    (let* ((ret (clearcase-ct-blocking-call "unco"
+                                            (if clearcase-keep-uncheckouts
+                                                "-keep"
+                                              "-rm")
+                                            file))
+           ;; Discover the name of the saved.
+           ;;
+           (kept-file (if clearcase-keep-uncheckouts
+                          (cleartool-unco-parse-for-kept-file ret)
+                        nil)))
+
+      (if kept-file
+          (message "Checkout of %s cancelled (saved in %s)"
+                   (file-name-nondirectory kept-file)
+                   file)
+        (message "Cancelling checkout of %s...done" file))
+
+      ;; Sync any buffers over the file itself.
+      ;;
+      (clearcase-sync-from-disk file t)
+
+      ;; Update any dired buffers as to the existence of the kept file.
+      ;;
+      (if kept-file
+          (dired-relist-file kept-file)))))
 
 (defun clearcase-uncheckout-seq (files)
   "Uncheckout a sequence of FILES."
 
 (defun clearcase-describe (file)
   "Give a ClearCase description of FILE."
-  (clearcase-ct-do-cleartool-command "describe" file 'unused)
-  (clearcase-port-view-buffer-other-window "*clearcase*")
-  (goto-char 0)
-  (shrink-window-if-larger-than-buffer))
+
+  (clearcase-utl-populate-and-view-buffer
+   "*clearcase*"
+   (list file)
+   (function
+    (lambda (file)
+      (clearcase-ct-do-cleartool-command "describe" file 'unused)))))
 
 (defun clearcase-describe-seq (files)
   "Give a ClearCase description of the sequence of FILES."
                                    "-cfile"
                                    (clearcase-path-native comment-file)
                                    qualified-typename)))))
+
 ;;}}}
 
 ;;{{{ Browse vtree (using Dired Mode)
             (eq mtype 'directory-version))
         (progn
           (message "Listing element history...")
-          (apply 'clearcase-ct-do-cleartool-command "lshistory" file 'unused
-                 (list (if (eq mtype 'directory-version) "-d")))
-          (pop-to-buffer (get-buffer-create "*clearcase*"))