Discussion:
XEmacs 21.4, vc-git.el and utf-8
Hauke Fath
2015-09-29 14:35:24 UTC
Permalink
All,

using vc on XEmacs 21.4, git operations error out with "No such coding
system: utf-8".

M-x toggle-debug-on-error before a C-x v l gives

Debugger entered--Lisp error: (error "No such coding system" utf-8)
start-process-internal("git" #<buffer "*vc-change-log*"> "git"
"rev-list" "--pretty" "HEAD" "--" "Makefile")
apply(start-process-internal "git" #<buffer "*vc-change-log*"> "git"
("rev-list" "--pretty" "HEAD" "--" "Makefile"))
start-process("git" #<buffer "*vc-change-log*"> "git" "rev-list"
"--pretty" "HEAD" "--" "Makefile")
apply(start-process "git" #<buffer "*vc-change-log*"> "git"
("rev-list" "--pretty" "HEAD" "--" "Makefile"))
ad-Orig-vc-do-command("*vc-change-log*" async "git" "Makefile"
"rev-list" "--pretty" "HEAD" "--")
apply(ad-Orig-vc-do-command "*vc-change-log*" async "git" "Makefile"
("rev-list" "--pretty" "HEAD" "--"))
(setq ad-return-value (apply (quote ad-Orig-vc-do-command) buffer
okstatus command file flags))
(if (or (and ... ...) (and ... ...)) (setq ad-return-value (apply ...
buffer okstatus command file flags)) (setq ad-return-value (apply ...
buffer okstatus command file flags)))
(let ((file ...)) (if (or ... ...) (setq ad-return-value ...) (setq
ad-return-value ...)))
(let (ad-return-value) (let (...) (if ... ... ...)) ad-return-value)
vc-do-command("*vc-change-log*" async "git" "Makefile" "rev-list"
"--pretty" "HEAD" "--")
(let ((name ...) (coding-system-for-read git-commits-coding-system))
(vc-do-command buffer (quote async) "git" name "rev-list" "--pretty"
"HEAD" "--"))
vc-git-print-log("/misc/pkgsrc/wip/c-news/Makefile" "*vc-change-log*")
apply(vc-git-print-log ("/misc/pkgsrc/wip/c-news/Makefile"
"*vc-change-log*"))
vc-call-backend(GIT print-log "/misc/pkgsrc/wip/c-news/Makefile"
"*vc-change-log*")
byte-code("..." [file vc-call-backend vc-backend print-log
"*vc-change-log*"] 5)
#<compiled-function (&optional focus-rev) "...(64)" [buffer-file-name
focus-rev file vc-ensure-vc-buffer vc-workfile-version err (byte-code
"Á!Ä$<88>Äq<87>" ... 5) (...) pop-to-buffer vc-exec-after let (...)
ignore-errors vc-call-backend quote vc-backend (...) (goto-char ...)
(forward-line -1) (while ... ... ...) (goto-char ...) (if ... ...)
(quote show-log-entry) (...)] 14
("/usr/pkg/lib/xemacs/xemacs-packages/lisp/vc/vc.elc" . 56788) nil>()
call-interactively(vc-print-log)


I tried to set gits-commit-coding-system in vc-git.el, but to no avail.
The brute-force approach

(require 'un-define)

appears to help, but seems to be frowned upon.

What is the proper way to use vc.git.el on 21.4?

Cheerio,
Hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
Stephen J. Turnbull
2015-09-29 18:30:12 UTC
Permalink
Post by Hauke Fath
(require 'un-define)
appears to help, but seems to be frowned upon.
What is the proper way to use vc.git.el on 21.4?
If vc-git requires UTF-8, as your question appears to imply, then
there is no "proper" way to use it in XEmacs 21.4. un-define may work
well enough, but as far as I know it's completely unsupported (I
certainly won't touch it), and there is no other way to use utf-8 in
XEmacs 21.4.

If you're lucky there may be somebody around who can help debug
problems with the Mule-UCS package, but my recommendation is to take
this as a sign to move on to 21.5.

Sorry.
Julian Bradfield
2015-09-29 20:23:28 UTC
Permalink
Post by Stephen J. Turnbull
If vc-git requires UTF-8, as your question appears to imply, then
there is no "proper" way to use it in XEmacs 21.4. un-define may work
well enough, but as far as I know it's completely unsupported (I
certainly won't touch it), and there is no other way to use utf-8 in
XEmacs 21.4.
If you're lucky there may be somebody around who can help debug
problems with the Mule-UCS package, but my recommendation is to take
this as a sign to move on to 21.5.
Or if you're really wedded to 21.4, use JCBmacs :-)

http://homepages.inf.ed.ac.uk/jcb/Software/emacs/
Hauke Fath
2015-09-30 10:01:35 UTC
Permalink
Post by Stephen J. Turnbull
Post by Hauke Fath
What is the proper way to use vc.git.el on 21.4?
If vc-git requires UTF-8, as your question appears to imply, then
there is no "proper" way to use it in XEmacs 21.4.
Well, unlike vc.el which tries to accomodate (see
vc-coding-system-for-diff), vc-git.el assumes "All the world's utf-8 -
and if it isn't, that is Somebody Else's Problem(tm)'. From cursory
googling, the utf-8 is not a git requirement.

I ended up with the following patch (comments?) which works for me:

--- lisp/vc/vc-git.el.orig 2007-08-23 21:27:53.000000000 +0000
+++ lisp/vc/vc-git.el
@@ -35,7 +35,19 @@

(eval-when-compile (require 'cl))

-(defvar git-commits-coding-system 'utf-8
+(defun vc-git-determine-coding-system ()
+
+ "Return utf-8 om 21.5, or the current buffer's coding on 21,4"
+
+ (if (and (featurep 'xemacs)
+ (<= emacs-major-version 21)
+ (< emacs-minor-version 5))
+ (if (boundp 'buffer-file-coding-system)
+ buffer-file-coding-system
+ 'undecided)
+ 'utf-8))
+
+(defvar git-commits-coding-system (vc-git-determine-coding-system)
"Default coding system for git commits.")

(defun vc-git--run-command-string (file &rest args)


-- from reading vc-git.el, I am not sure how exactly the encoding is
used - by XEmacs? By git? - and whether - where? - an actual conversion
takes place. But, as I said, this works with 21.4.23 and 21.5.27 here.

Cheerio,
hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
Loading...