Raymond Toy writes:
>>>>> "Mats" == Mats Lidell
<matsl(a)xemacs.org> writes:
>>>>> Raymond Toy <toy.raymond(a)gmail.com> writes:
>> Now I'm stuck. It wants process-file and I don't know the xemacs
>> equivalent of that.
Based on the docstring for process-file, I just had process-file call
call-process, as a first approximation. Now it causes some error
(duh!) which I haven't looked into yet.
Look for a file handler defined in the magit code with key
'process-file. If there isn't one, then basically it's call-process.
However, Emacs has a different way of handling stderr from XEmacs, and
that may be the source of the error. Just for kicks, the code for
process-file is appended below.
missing is that git.el wants sdiff to handle unmerged files and I
haven't done anything about that. Oh, and also the bad bug where
trying to add a directory causes xemacs to crash. :-(
AFAIK we can just drop in sdiff somewhere, probably in ediff but maybe
in prog-utils. At least at one point it seemed to work OK in XEmacs.
Have you reported and provided a backtrace for the crash? It doesn't
seem to be in the tracker. :-( A crash is our bug and needs to be
fixed in XEmacs.
Steve
(defun process-file (program &optional infile buffer display &rest
args)
"Process files synchronously in a separate process.
Similar to `call-process', but may invoke a file handler based on
`default-directory'. The current working directory of the
subprocess is `default-directory'.
File names in INFILE and BUFFER are handled normally, but file
names in ARGS should be relative to `default-directory', as they
are passed to the process verbatim. \(This is a difference to
`call-process' which does not support file handlers for INFILE
and BUFFER.\)
Some file handlers might not support all variants, for example
they might behave as if DISPLAY was nil, regardless of the actual
value passed."
(let ((fh (find-file-name-handler default-directory 'process-file))
lc stderr-file)
(unwind-protect
(if fh (apply fh 'process-file program infile buffer display args)
(when infile (setq lc (file-local-copy infile)))
(setq stderr-file (when (and (consp buffer)
(stringp (cadr buffer)))
(make-temp-file "emacs")))
(prog1
(apply 'call-process program
(or lc infile)
;; XXX Maybe this is where things go wonky?
(if stderr-file (list (car buffer) stderr-file) buffer)
display args)
(when stderr-file (copy-file stderr-file (cadr buffer)))))
(when stderr-file (delete-file stderr-file))
(when lc (delete-file lc)))))
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta