diff options
| author | Paul Eggert | 2016-04-11 09:07:16 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-04-11 09:07:16 -0700 |
| commit | 435da5d2955ce35be4785b7d46566ed9b42ea9fb (patch) | |
| tree | 581fac64374d0997e53bba0ae3cbd4968fa55121 /lisp/vc | |
| parent | 7c9e6254bbac949aa5493ab1741d2523a7d595b7 (diff) | |
| parent | b134c206bc07dbbb9e74b3be2db269c4f1196e40 (diff) | |
| download | emacs-435da5d2955ce35be4785b7d46566ed9b42ea9fb.tar.gz emacs-435da5d2955ce35be4785b7d46566ed9b42ea9fb.zip | |
Merge from origin/emacs-25
b134c20 Sync with gnulib
bb30fa9 Fix last change on 2016-01-02
488a72f ; Spelling fixes
9b1aab9 Port run-prolog EMACS to SWI-Prolog 7.2.3
0e7bcec Avoid crashes due to unreasonably large or small text scaling
85f257c Improve documentation of 'with-eval-after-load'
668c7bc Improve handling of non-ASCII characters in Git log messages
b570769 Remove undefined behavior in OS X dumper.
97211f3 Fix clipping of xwidgets
e87fbc0 Improve Lisp-level documentation of tooltips
9f1786e Faces names should not end in "-face".
3283271 * src/xsmfns.c (syms_of_xsmfns): Remove stray "s in doc strings.
a1f221b Comint and compile no longer set EMACS
5c28890 * lisp/subr.el (read-key): Don't let the prompt linger (bug#2...
a75b9a6 Merge branch 'emacs-25' of git.savannah.gnu.org:/srv/git/emac...
c93ae7a Allow to customize names of executables used by grep.el
f6497c6 Set locale encoding to UTF-8 when run from OS X GUI.
7ad1d07 Avoid signaling errors in 'M-n' at the 'C-x C-f' prompt
a3f1ac2 Avoid infinite loop in 'studlify-word'
f36df4b Don’t recommend obsolete EMACS env var
fb0b531 * lisp/emacs-lisp/package.el: Change from a few days ago need...
Diffstat (limited to 'lisp/vc')
| -rw-r--r-- | lisp/vc/vc-git.el | 66 | ||||
| -rw-r--r-- | lisp/vc/vc-hooks.el | 18 |
2 files changed, 60 insertions, 24 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index f2466d86493..2fd84f102f8 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el | |||
| @@ -165,8 +165,20 @@ matching the resulting Git log output, and KEYWORDS is a list of | |||
| 165 | :type '(list string string (repeat sexp)) | 165 | :type '(list string string (repeat sexp)) |
| 166 | :version "24.1") | 166 | :version "24.1") |
| 167 | 167 | ||
| 168 | (defvar vc-git-commits-coding-system 'utf-8 | 168 | (defcustom vc-git-commits-coding-system 'utf-8 |
| 169 | "Default coding system for git commits.") | 169 | "Default coding system for sending commit log messages to Git. |
| 170 | |||
| 171 | Should be consistent with the Git config value i18n.commitEncoding, | ||
| 172 | and should also be consistent with `locale-coding-system'." | ||
| 173 | :type '(coding-system :tag "Coding system to encode Git commit logs") | ||
| 174 | :version "25.1") | ||
| 175 | |||
| 176 | (defcustom vc-git-log-output-coding-system 'utf-8 | ||
| 177 | "Default coding system for receiving log output from Git. | ||
| 178 | |||
| 179 | Should be consistent with the Git config value i18n.logOutputEncoding." | ||
| 180 | :type '(coding-system :tag "Coding system to decode Git log output") | ||
| 181 | :version "25.1") | ||
| 170 | 182 | ||
| 171 | ;; History of Git commands. | 183 | ;; History of Git commands. |
| 172 | (defvar vc-git-history nil) | 184 | (defvar vc-git-history nil) |
| @@ -680,21 +692,43 @@ It is based on `log-edit-mode', and has Git-specific extensions.") | |||
| 680 | (default-directory (expand-file-name root)) | 692 | (default-directory (expand-file-name root)) |
| 681 | (only (or (cdr files) | 693 | (only (or (cdr files) |
| 682 | (not (equal root (abbreviate-file-name file1))))) | 694 | (not (equal root (abbreviate-file-name file1))))) |
| 683 | (coding-system-for-write vc-git-commits-coding-system)) | 695 | (pcsw coding-system-for-write) |
| 696 | (coding-system-for-write | ||
| 697 | ;; On MS-Windows, we must encode command-line arguments in | ||
| 698 | ;; the system codepage. | ||
| 699 | (if (eq system-type 'windows-nt) | ||
| 700 | locale-coding-system | ||
| 701 | (or coding-system-for-write vc-git-commits-coding-system))) | ||
| 702 | (msg-file | ||
| 703 | ;; On MS-Windows, pass the commit log message through a | ||
| 704 | ;; file, to work around the limitation that command-line | ||
| 705 | ;; arguments must be in the system codepage, and therefore | ||
| 706 | ;; might not support the non-ASCII characters in the log | ||
| 707 | ;; message. | ||
| 708 | (if (eq system-type 'windows-nt) (make-temp-file "git-msg")))) | ||
| 684 | (cl-flet ((boolean-arg-fn | 709 | (cl-flet ((boolean-arg-fn |
| 685 | (argument) | 710 | (argument) |
| 686 | (lambda (value) (when (equal value "yes") (list argument))))) | 711 | (lambda (value) (when (equal value "yes") (list argument))))) |
| 687 | ;; When operating on the whole tree, better pass "-a" than ".", since "." | 712 | ;; When operating on the whole tree, better pass "-a" than ".", since "." |
| 688 | ;; fails when we're committing a merge. | 713 | ;; fails when we're committing a merge. |
| 689 | (apply 'vc-git-command nil 0 (if only files) | 714 | (apply 'vc-git-command nil 0 (if only files) |
| 690 | (nconc (list "commit" "-m") | 715 | (nconc (if msg-file (list "commit" "-F" msg-file) |
| 691 | (log-edit-extract-headers | 716 | (list "commit" "-m")) |
| 692 | `(("Author" . "--author") | 717 | (let ((args |
| 693 | ("Date" . "--date") | 718 | (log-edit-extract-headers |
| 694 | ("Amend" . ,(boolean-arg-fn "--amend")) | 719 | `(("Author" . "--author") |
| 695 | ("Sign-Off" . ,(boolean-arg-fn "--signoff"))) | 720 | ("Date" . "--date") |
| 696 | comment) | 721 | ("Amend" . ,(boolean-arg-fn "--amend")) |
| 697 | (if only (list "--only" "--") '("-a"))))))) | 722 | ("Sign-Off" . ,(boolean-arg-fn "--signoff"))) |
| 723 | comment))) | ||
| 724 | (when msg-file | ||
| 725 | (let ((coding-system-for-write | ||
| 726 | (or pcsw vc-git-commits-coding-system))) | ||
| 727 | (write-region (car args) nil msg-file)) | ||
| 728 | (setq args (cdr args))) | ||
| 729 | args) | ||
| 730 | (if only (list "--only" "--") '("-a"))))) | ||
| 731 | (if (and msg-file (file-exists-p msg-file)) (delete-file msg-file)))) | ||
| 698 | 732 | ||
| 699 | (defun vc-git-find-revision (file rev buffer) | 733 | (defun vc-git-find-revision (file rev buffer) |
| 700 | (let* (process-file-side-effects | 734 | (let* (process-file-side-effects |
| @@ -854,7 +888,7 @@ If SHORTLOG is non-nil, use a short format based on `vc-git-root-log-format'. | |||
| 854 | If START-REVISION is non-nil, it is the newest revision to show. | 888 | If START-REVISION is non-nil, it is the newest revision to show. |
| 855 | If LIMIT is non-nil, show no more than this many entries." | 889 | If LIMIT is non-nil, show no more than this many entries." |
| 856 | (let ((coding-system-for-read | 890 | (let ((coding-system-for-read |
| 857 | (or coding-system-for-read vc-git-commits-coding-system))) | 891 | (or coding-system-for-read vc-git-log-output-coding-system))) |
| 858 | ;; `vc-do-command' creates the buffer, but we need it before running | 892 | ;; `vc-do-command' creates the buffer, but we need it before running |
| 859 | ;; the command. | 893 | ;; the command. |
| 860 | (vc-setup-buffer buffer) | 894 | (vc-setup-buffer buffer) |
| @@ -1389,7 +1423,7 @@ This command shares argument histories with \\[rgrep] and \\[grep]." | |||
| 1389 | The difference to vc-do-command is that this function always invokes | 1423 | The difference to vc-do-command is that this function always invokes |
| 1390 | `vc-git-program'." | 1424 | `vc-git-program'." |
| 1391 | (let ((coding-system-for-read | 1425 | (let ((coding-system-for-read |
| 1392 | (or coding-system-for-read vc-git-commits-coding-system)) | 1426 | (or coding-system-for-read vc-git-log-output-coding-system)) |
| 1393 | (coding-system-for-write | 1427 | (coding-system-for-write |
| 1394 | (or coding-system-for-write vc-git-commits-coding-system))) | 1428 | (or coding-system-for-write vc-git-commits-coding-system))) |
| 1395 | (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program | 1429 | (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program |
| @@ -1414,8 +1448,10 @@ The difference to vc-do-command is that this function always invokes | |||
| 1414 | ;; directories. We enable `inhibit-null-byte-detection', otherwise | 1448 | ;; directories. We enable `inhibit-null-byte-detection', otherwise |
| 1415 | ;; Tramp's eol conversion might be confused. | 1449 | ;; Tramp's eol conversion might be confused. |
| 1416 | (let ((inhibit-null-byte-detection t) | 1450 | (let ((inhibit-null-byte-detection t) |
| 1417 | (coding-system-for-read vc-git-commits-coding-system) | 1451 | (coding-system-for-read |
| 1418 | (coding-system-for-write vc-git-commits-coding-system) | 1452 | (or coding-system-for-read vc-git-log-output-coding-system)) |
| 1453 | (coding-system-for-write | ||
| 1454 | (or coding-system-for-write vc-git-commits-coding-system)) | ||
| 1419 | (process-environment (cons "PAGER=" process-environment))) | 1455 | (process-environment (cons "PAGER=" process-environment))) |
| 1420 | (apply 'process-file vc-git-program nil buffer nil command args))) | 1456 | (apply 'process-file vc-git-program nil buffer nil command args))) |
| 1421 | 1457 | ||
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 97ccec84550..4c0161d7978 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el | |||
| @@ -40,7 +40,7 @@ | |||
| 40 | :group 'mode-line | 40 | :group 'mode-line |
| 41 | :version "25.1") | 41 | :version "25.1") |
| 42 | 42 | ||
| 43 | (defface vc-state-base-face | 43 | (defface vc-state-base |
| 44 | '((default)) | 44 | '((default)) |
| 45 | "Base face for VC state indicator." | 45 | "Base face for VC state indicator." |
| 46 | :group 'vc-faces | 46 | :group 'vc-faces |
| @@ -48,49 +48,49 @@ | |||
| 48 | :version "25.1") | 48 | :version "25.1") |
| 49 | 49 | ||
| 50 | (defface vc-up-to-date-state | 50 | (defface vc-up-to-date-state |
| 51 | '((default :inherit vc-state-base-face)) | 51 | '((default :inherit vc-state-base)) |
| 52 | "Face for VC modeline state when the file is up to date." | 52 | "Face for VC modeline state when the file is up to date." |
| 53 | :version "25.1" | 53 | :version "25.1" |
| 54 | :group 'vc-faces) | 54 | :group 'vc-faces) |
| 55 | 55 | ||
| 56 | (defface vc-needs-update-state | 56 | (defface vc-needs-update-state |
| 57 | '((default :inherit vc-state-base-face)) | 57 | '((default :inherit vc-state-base)) |
| 58 | "Face for VC modeline state when the file needs update." | 58 | "Face for VC modeline state when the file needs update." |
| 59 | :version "25.1" | 59 | :version "25.1" |
| 60 | :group 'vc-faces) | 60 | :group 'vc-faces) |
| 61 | 61 | ||
| 62 | (defface vc-locked-state | 62 | (defface vc-locked-state |
| 63 | '((default :inherit vc-state-base-face)) | 63 | '((default :inherit vc-state-base)) |
| 64 | "Face for VC modeline state when the file locked." | 64 | "Face for VC modeline state when the file locked." |
| 65 | :version "25.1" | 65 | :version "25.1" |
| 66 | :group 'vc-faces) | 66 | :group 'vc-faces) |
| 67 | 67 | ||
| 68 | (defface vc-locally-added-state | 68 | (defface vc-locally-added-state |
| 69 | '((default :inherit vc-state-base-face)) | 69 | '((default :inherit vc-state-base)) |
| 70 | "Face for VC modeline state when the file is locally added." | 70 | "Face for VC modeline state when the file is locally added." |
| 71 | :version "25.1" | 71 | :version "25.1" |
| 72 | :group 'vc-faces) | 72 | :group 'vc-faces) |
| 73 | 73 | ||
| 74 | (defface vc-conflict-state | 74 | (defface vc-conflict-state |
| 75 | '((default :inherit vc-state-base-face)) | 75 | '((default :inherit vc-state-base)) |
| 76 | "Face for VC modeline state when the file contains merge conflicts." | 76 | "Face for VC modeline state when the file contains merge conflicts." |
| 77 | :version "25.1" | 77 | :version "25.1" |
| 78 | :group 'vc-faces) | 78 | :group 'vc-faces) |
| 79 | 79 | ||
| 80 | (defface vc-removed-state | 80 | (defface vc-removed-state |
| 81 | '((default :inherit vc-state-base-face)) | 81 | '((default :inherit vc-state-base)) |
| 82 | "Face for VC modeline state when the file was removed from the VC system." | 82 | "Face for VC modeline state when the file was removed from the VC system." |
| 83 | :version "25.1" | 83 | :version "25.1" |
| 84 | :group 'vc-faces) | 84 | :group 'vc-faces) |
| 85 | 85 | ||
| 86 | (defface vc-missing-state | 86 | (defface vc-missing-state |
| 87 | '((default :inherit vc-state-base-face)) | 87 | '((default :inherit vc-state-base)) |
| 88 | "Face for VC modeline state when the file is missing from the file system." | 88 | "Face for VC modeline state when the file is missing from the file system." |
| 89 | :version "25.1" | 89 | :version "25.1" |
| 90 | :group 'vc-faces) | 90 | :group 'vc-faces) |
| 91 | 91 | ||
| 92 | (defface vc-edited-state | 92 | (defface vc-edited-state |
| 93 | '((default :inherit vc-state-base-face)) | 93 | '((default :inherit vc-state-base)) |
| 94 | "Face for VC modeline state when the file is edited." | 94 | "Face for VC modeline state when the file is edited." |
| 95 | :version "25.1" | 95 | :version "25.1" |
| 96 | :group 'vc-faces) | 96 | :group 'vc-faces) |