comparison lisp/pcvs.el @ 30717:e6e5480e5b25

(cvs-menu): Don't move point. Use popup-menu. Set cvs-minor-current-files to the selected fileinfo. (cvs-get-marked): Accept fileinfos in cvs-minor-current-files. (cvs-mode-insert): Manually macroexpand `ignore-errors'.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 09 Aug 2000 15:27:48 +0000
parents 9dd1a6504bdd
children 3a1ff1caafe2
comparison
equal deleted inserted replaced
30716:2e1c439e7b1b 30717:e6e5480e5b25
12 ;; (Greg Klanderman) greg@alphatech.com 12 ;; (Greg Klanderman) greg@alphatech.com
13 ;; (Jari Aalto+mail.emacs) jari.aalto@poboxes.com 13 ;; (Jari Aalto+mail.emacs) jari.aalto@poboxes.com
14 ;; Maintainer: (Stefan Monnier) monnier+lists/cvs/pcl@flint.cs.yale.edu 14 ;; Maintainer: (Stefan Monnier) monnier+lists/cvs/pcl@flint.cs.yale.edu
15 ;; Keywords: CVS, version control, release management 15 ;; Keywords: CVS, version control, release management
16 ;; Version: $Name: $ 16 ;; Version: $Name: $
17 ;; Revision: $Id: pcvs.el,v 1.6 2000/08/05 20:08:49 gerd Exp $ 17 ;; Revision: $Id: pcvs.el,v 1.7 2000/08/06 09:18:00 gerd Exp $
18 18
19 ;; This file is part of GNU Emacs. 19 ;; This file is part of GNU Emacs.
20 20
21 ;; GNU Emacs is free software; you can redistribute it and/or modify 21 ;; GNU Emacs is free software; you can redistribute it and/or modify
22 ;; it under the terms of the GNU General Public License as published by 22 ;; it under the terms of the GNU General Public License as published by
48 ;; Contrary to what you'd expect, PCL-CVS is not a replacement for VC but only 48 ;; Contrary to what you'd expect, PCL-CVS is not a replacement for VC but only
49 ;; for VC-dired. As such, I've tried to make PCL-CVS and VC interoperate 49 ;; for VC-dired. As such, I've tried to make PCL-CVS and VC interoperate
50 ;; seamlessly (I also use VC). 50 ;; seamlessly (I also use VC).
51 51
52 ;; To use PCL-CVS just use `M-x cvs-examine RET <dir> RET'. 52 ;; To use PCL-CVS just use `M-x cvs-examine RET <dir> RET'.
53 ;; There used to be a TeXinfo manual, but it's now so out of date that 53 ;; There is a TeXinfo manual, which can be helpful to get started.
54 ;; it's not even worth looking at it.
55 54
56 ;;; Todo: 55 ;;; Todo:
57 56
58 ;; ******** FIX THE DOCUMENTATION ********* 57 ;; ******** FIX THE DOCUMENTATION *********
59 ;; 58 ;;
59 ;; - hide fileinfos without getting rid of them (will require ewok work).
60 ;; - proper `g' that passes safe args and uses either cvs-status or cvs-examine 60 ;; - proper `g' that passes safe args and uses either cvs-status or cvs-examine
61 ;; - add toolbar entries 61 ;; - add toolbar entries
62 ;; - marking 62 ;; - marking
63 ;; marking directories should jump to just after the dir. 63 ;; marking directories should jump to just after the dir.
64 ;; allow (un)marking directories at a time with the mouse. 64 ;; allow (un)marking directories at a time with the mouse.
186 ;;;; 186 ;;;;
187 187
188 (defun cvs-menu (e) 188 (defun cvs-menu (e)
189 "Popup the CVS menu." 189 "Popup the CVS menu."
190 (interactive "e") 190 (interactive "e")
191 (mouse-set-point e) 191 (let ((cvs-minor-current-files
192 (x-popup-menu e cvs-menu-map)) 192 (list (ewoc-data (ewoc-locate
193 cvs-cookies (posn-point (event-end e)))))))
194 (popup-menu cvs-menu-map e)))
193 195
194 (defvar cvs-mode-line-process nil 196 (defvar cvs-mode-line-process nil
195 "Mode-line control for displaying info on cvs process status.") 197 "Mode-line control for displaying info on cvs process status.")
196 198
197 199
1214 an empty list if it doesn't point to a file at all. 1216 an empty list if it doesn't point to a file at all.
1215 1217
1216 Args: &optional IGNORE-MARKS IGNORE-CONTENTS." 1218 Args: &optional IGNORE-MARKS IGNORE-CONTENTS."
1217 1219
1218 (let ((fis nil)) 1220 (let ((fis nil))
1219 (dolist (fi (if (boundp 'cvs-minor-current-files) 1221 (dolist (fi (if (and (boundp 'cvs-minor-current-files)
1222 (consp cvs-minor-current-files))
1220 (mapcar 1223 (mapcar
1221 (lambda (f) 1224 (lambda (f)
1222 (let ((f (file-relative-name f))) 1225 (if (cvs-fileinfo-p f) f
1223 (if (file-directory-p f) 1226 (let ((f (file-relative-name f)))
1224 (cvs-create-fileinfo 1227 (if (file-directory-p f)
1225 'DIRCHANGE (file-name-as-directory f) "." "") 1228 (cvs-create-fileinfo
1226 (let ((dir (file-name-directory f)) 1229 'DIRCHANGE (file-name-as-directory f) "." "")
1227 (file (file-name-nondirectory f))) 1230 (let ((dir (file-name-directory f))
1228 (cvs-create-fileinfo 1231 (file (file-name-nondirectory f)))
1229 'UNKNOWN (or dir "") file ""))))) 1232 (cvs-create-fileinfo
1233 'UNKNOWN (or dir "") file ""))))))
1230 cvs-minor-current-files) 1234 cvs-minor-current-files)
1231 (or (and (not ignore-marks) 1235 (or (and (not ignore-marks)
1232 (ewoc-collect cvs-cookies 1236 (ewoc-collect cvs-cookies
1233 'cvs-fileinfo->marked)) 1237 'cvs-fileinfo->marked))
1234 (list (ewoc-data (ewoc-locate cvs-cookies (point))))))) 1238 (list (ewoc-data (ewoc-locate cvs-cookies (point)))))))
1327 1331
1328 (defun-cvs-mode (cvs-mode-insert . NOARGS) (file) 1332 (defun-cvs-mode (cvs-mode-insert . NOARGS) (file)
1329 "Insert an entry for a specific file." 1333 "Insert an entry for a specific file."
1330 (interactive 1334 (interactive
1331 (list (read-file-name "File to insert: " nil nil nil 1335 (list (read-file-name "File to insert: " nil nil nil
1332 (ignore-errors 1336 ;; Can't use ignore-errors here because interactive
1333 (cvs-fileinfo->dir 1337 ;; specs aren't byte-compiled.
1334 (car (cvs-mode-marked nil nil :read-only t))))))) 1338 (condition-case nil
1339 (cvs-fileinfo->dir
1340 (car (cvs-mode-marked nil nil :read-only t)))
1341 (error nil)))))
1335 (let ((file (file-relative-name (directory-file-name file))) last) 1342 (let ((file (file-relative-name (directory-file-name file))) last)
1336 (dolist (fi (cvs-fileinfo-from-entries file)) 1343 (dolist (fi (cvs-fileinfo-from-entries file))
1337 (setq last (cvs-addto-collection cvs-cookies fi last))))) 1344 (setq last (cvs-addto-collection cvs-cookies fi last)))))
1338 1345
1339 (defun-cvs-mode (cvs-mode-add . SIMPLE) (flags) 1346 (defun-cvs-mode (cvs-mode-add . SIMPLE) (flags)