| @@ -1,28 +1,28 @@ | | | @@ -1,28 +1,28 @@ |
1 | $NetBSD: patch-lisp_vc_vc-git.el,v 1.1 2015/09/30 10:11:45 hauke Exp $ | | 1 | $NetBSD: patch-lisp_vc_vc-git.el,v 1.2 2016/04/23 09:24:07 hauke Exp $ |
2 | | | 2 | |
3 | Instead of blindly assuming a utf-8 capable XEmacs, look at the | | 3 | Instead of blindly assuming a utf-8 capable XEmacs, look at the |
4 | current buffer for the encoding to use. | | 4 | current buffer for the encoding to use. |
5 | | | 5 | |
6 | --- lisp/vc/vc-git.el.orig 2007-08-23 21:27:53.000000000 +0000 | | 6 | --- lisp/vc/vc-git.el.orig 2007-08-23 21:27:53.000000000 +0000 |
7 | +++ lisp/vc/vc-git.el | | 7 | +++ lisp/vc/vc-git.el |
8 | @@ -35,7 +35,19 @@ | | 8 | @@ -35,7 +35,19 @@ |
9 | | | 9 | |
10 | (eval-when-compile (require 'cl)) | | 10 | (eval-when-compile (require 'cl)) |
11 | | | 11 | |
12 | -(defvar git-commits-coding-system 'utf-8 | | 12 | -(defvar git-commits-coding-system 'utf-8 |
13 | +(defun vc-git-determine-coding-system () | | 13 | +(defun vc-git-determine-coding-system () |
14 | + | | 14 | + |
15 | + "Return utf-8 om 21.5, or the current buffer's coding on 21,4" | | 15 | + "Return utf-8 on 21.5, or the current buffer's encoding on 21.4" |
16 | + | | 16 | + |
17 | + (if (and (featurep 'xemacs) | | 17 | + (if (and (featurep 'xemacs) |
18 | + (<= emacs-major-version 21) | | 18 | + (<= emacs-major-version 21) |
19 | + (< emacs-minor-version 5)) | | 19 | + (< emacs-minor-version 5)) |
20 | + (if (boundp 'buffer-file-coding-system) | | 20 | + (if (boundp 'buffer-file-coding-system) |
21 | + buffer-file-coding-system | | 21 | + buffer-file-coding-system |
22 | + 'undecided) | | 22 | + 'undecided) |
23 | + 'utf-8)) | | 23 | + 'utf-8)) |
24 | + | | 24 | + |
25 | +(defvar git-commits-coding-system (vc-git-determine-coding-system) | | 25 | +(defvar git-commits-coding-system (vc-git-determine-coding-system) |
26 | "Default coding system for git commits.") | | 26 | "Default coding system for git commits.") |
27 | | | 27 | |
28 | (defun vc-git--run-command-string (file &rest args) | | 28 | (defun vc-git--run-command-string (file &rest args) |