summaryrefslogtreecommitdiff
path: root/editors/xemacs-packages/patches/patch-lisp_vc_vc-git.el
blob: eb710ded0c58439943013c712e8eeffc9c30d490 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$NetBSD: patch-lisp_vc_vc-git.el,v 1.2 2016/04/23 09:24:07 hauke Exp $

Instead of blindly assuming a utf-8 capable XEmacs, look at the
current buffer for the encoding to use.

--- 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 on 21.5, or the current buffer's encoding 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)