[issue488] Re: VC submenu under Tools
rsparapa at mcw.edu
Tue Mar 3 10:32:48 EST 2009
Rodney Sparapani wrote:
> Rodney Sparapani wrote:
>>> BTW, I just tried using vc+dired integration for the first time and either I
>>> don't understand how it works (which is quite likely as I've never really
>>> used dired either) or it's quite broken; I get "dired-subdir-alist seems to
>>> be mangled" when I try to do something in a vc-dired-mode buffer.
>> Same here and, for me, dired-subdir-alist is nil. This variable comes
>> from dired.el and the error message must be coming from the function
>> also defined therein, dired-current-directory
> I get it now. dired-current-directory is supposed to look at your
> vc-dired buffer and determine if the file you are checking in is
> in the current default-directory or in a subdirectory thereof.
> However, it can't seem to figure out the way subdirectories are
> encoded in the buffer. So, it barfs. But, if you have it return
> something sensible, like default-directory, then it prompts you for
> a log and checks in the marked file. I haven't tried multiple
> files yet. No idea how to fix it completely.
I suppose, technically, some of these are separate issues, but all will
crop up if you use the VC submenu sooner or later. So, I've shoe-horned
in an ugly workaround, that will at least allow VC dired mode to work.
However, marking still pukes with:
Debugger entered--Lisp error: (wrong-type-argument
So there is some disagreement between dired and VC, however, dired only
seems to be working fine. Hopefully, the hack will not create more
havoc than it fixes. But, this investigation led to another bug
discovery. vc-directory does not turn on vc-dired-mode! FYI. Here's
my combo hack/bug-fix for vc.el FWIW:
(defun vc-directory (dir read-switches)
"Create a buffer in VC Dired Mode for directory DIR.
See Info node `VC Dired Mode'.
With prefix arg READ-SWITCHES, specify a value to override
`dired-listing-switches' when generating the listing."
(interactive "DDired under VC (directory): \nP")
(let ((vc-dired-switches (concat vc-dired-listing-switches
(if vc-dired-recurse "R" ""))))
(if (eq (string-match tramp-file-name-regexp dir) 0)
(error "Sorry, vc-directory does not work over Tramp"))
(read-string "Dired listing switches: "
;; XEmacs change: we don't have/need(?) dired-aux
(dired-internal-noselect (expand-file-name (file-name-as-directory
;the above line does not turn on vc-dired-mode, why god, why?
;so I added the next one
;This is a temporary workaround until the problems between dired and VC
;can be finally fixed. As long as vc-dired is only used on one subdir
;at a time this should work. However, if you need to do anything with
;dired afterwards, you may run into trouble. Beware!
(defun dired-current-directory (&optional localp)
"Return the name of the subdirectory to which this line belongs.
This returns a string with trailing slash, like `default-directory'.
Optional argument means return a file name relative to `default-directory'.
In this it returns \"\" for the top directory."
(if localp "./" default-directory))
More information about the XEmacs-Beta