aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorPaul Eggert2016-04-11 09:07:16 -0700
committerPaul Eggert2016-04-11 09:07:16 -0700
commit435da5d2955ce35be4785b7d46566ed9b42ea9fb (patch)
tree581fac64374d0997e53bba0ae3cbd4968fa55121 /lisp
parent7c9e6254bbac949aa5493ab1741d2523a7d595b7 (diff)
parentb134c206bc07dbbb9e74b3be2db269c4f1196e40 (diff)
downloademacs-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')
-rw-r--r--lisp/ChangeLog.152
-rw-r--r--lisp/comint.el7
-rw-r--r--lisp/emacs-lisp/lisp-mode.el6
-rw-r--r--lisp/emacs-lisp/package.el1
-rw-r--r--lisp/face-remap.el29
-rw-r--r--lisp/ffap.el4
-rw-r--r--lisp/net/tramp-sh.el1
-rw-r--r--lisp/play/studly.el8
-rw-r--r--lisp/progmodes/compile.el8
-rw-r--r--lisp/progmodes/grep.el48
-rw-r--r--lisp/progmodes/prolog.el16
-rw-r--r--lisp/rect.el5
-rw-r--r--lisp/subr.el7
-rw-r--r--lisp/vc/vc-git.el66
-rw-r--r--lisp/vc/vc-hooks.el18
15 files changed, 153 insertions, 73 deletions
diff --git a/lisp/ChangeLog.15 b/lisp/ChangeLog.15
index 88f5487ca74..46fa01acc5e 100644
--- a/lisp/ChangeLog.15
+++ b/lisp/ChangeLog.15
@@ -5820,7 +5820,7 @@
5820 * epa.el (epa-passphrase-callback-function): Say what we're 5820 * epa.el (epa-passphrase-callback-function): Say what we're
5821 querying the password for. 5821 querying the password for.
5822 5822
5823 * ibuffer.el (ibuffer-visit-buffer): To mimick list-buffers 5823 * ibuffer.el (ibuffer-visit-buffer): To mimic list-buffers
5824 behavior, don't bury the ibuffer buffer when visiting other buffers. 5824 behavior, don't bury the ibuffer buffer when visiting other buffers.
5825 5825
58262010-10-08 Chong Yidong <cyd@stupidchicken.com> 58262010-10-08 Chong Yidong <cyd@stupidchicken.com>
diff --git a/lisp/comint.el b/lisp/comint.el
index cb79c175f0e..dcd4a5ae4cf 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -816,13 +816,6 @@ series of processes in the same Comint buffer. The hook
816 (format "COLUMNS=%d" (window-width))) 816 (format "COLUMNS=%d" (window-width)))
817 (list "TERM=emacs" 817 (list "TERM=emacs"
818 (format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width)))) 818 (format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width))))
819
820 ;; This hack is for backward compatibility with Bash 4.3 and
821 ;; earlier. It can break common uses of 'configure', so
822 ;; remove it once Bash 4.4 or later is common.
823 (unless (getenv "EMACS")
824 (list "EMACS=t"))
825
826 (list (format "INSIDE_EMACS=%s,comint" emacs-version)) 819 (list (format "INSIDE_EMACS=%s,comint" emacs-version))
827 process-environment)) 820 process-environment))
828 (default-directory 821 (default-directory
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index b4bb3b0acce..74aebc0a66a 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -398,6 +398,9 @@ This will generate compile-time constants from BINDINGS."
398 lisp-el-font-lock-keywords-1 398 lisp-el-font-lock-keywords-1
399 `( ;; Regexp negated char group. 399 `( ;; Regexp negated char group.
400 ("\\[\\(\\^\\)" 1 font-lock-negation-char-face prepend) 400 ("\\[\\(\\^\\)" 1 font-lock-negation-char-face prepend)
401 ;; Erroneous structures.
402 (,(concat "(" el-errs-re "\\_>")
403 (1 font-lock-warning-face))
401 ;; Control structures. Common Lisp forms. 404 ;; Control structures. Common Lisp forms.
402 (lisp--el-match-keyword . 1) 405 (lisp--el-match-keyword . 1)
403 ;; Exit/Feature symbols as constants. 406 ;; Exit/Feature symbols as constants.
@@ -405,9 +408,6 @@ This will generate compile-time constants from BINDINGS."
405 "[ \t']*\\(" lisp-mode-symbol-regexp "\\)?") 408 "[ \t']*\\(" lisp-mode-symbol-regexp "\\)?")
406 (1 font-lock-keyword-face) 409 (1 font-lock-keyword-face)
407 (2 font-lock-constant-face nil t)) 410 (2 font-lock-constant-face nil t))
408 ;; Erroneous structures.
409 (,(concat "(" el-errs-re "\\_>")
410 (1 font-lock-warning-face prepend))
411 ;; Words inside \\[] tend to be for `substitute-command-keys'. 411 ;; Words inside \\[] tend to be for `substitute-command-keys'.
412 (,(concat "\\\\\\\\\\[\\(" lisp-mode-symbol-regexp "\\)\\]") 412 (,(concat "\\\\\\\\\\[\\(" lisp-mode-symbol-regexp "\\)\\]")
413 (1 font-lock-constant-face prepend)) 413 (1 font-lock-constant-face prepend))
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 4da66d2fabf..d5d35d78b83 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -146,6 +146,7 @@
146(eval-when-compile (require 'subr-x)) 146(eval-when-compile (require 'subr-x))
147(eval-when-compile (require 'cl-lib)) 147(eval-when-compile (require 'cl-lib))
148(eval-when-compile (require 'epg)) ;For setf accessors. 148(eval-when-compile (require 'epg)) ;For setf accessors.
149(require 'seq)
149 150
150(require 'tabulated-list) 151(require 'tabulated-list)
151(require 'macroexp) 152(require 'macroexp)
diff --git a/lisp/face-remap.el b/lisp/face-remap.el
index 0da6be7430b..9c2cae14b38 100644
--- a/lisp/face-remap.el
+++ b/lisp/face-remap.el
@@ -256,6 +256,23 @@ disable `text-scale-mode' as necessary)."
256 text-scale-mode-amount)))) 256 text-scale-mode-amount))))
257 (force-window-update (current-buffer))) 257 (force-window-update (current-buffer)))
258 258
259(defun text-scale-min-amount ()
260 "Return the minimum amount of text-scaling we allow."
261 ;; When the resulting pixel-height of characters will become smaller
262 ;; than 1 pixel, we can expect trouble from the display engine.
263 ;; E.g., it requires that the character glyph's ascent is
264 ;; non-negative.
265 (log (/ 1.0 (frame-char-height)) text-scale-mode-step))
266
267(defun text-scale-max-amount ()
268 "Return the maximum amount of text-scaling we allow."
269 ;; The display engine uses a 16-bit short for pixel-width of
270 ;; characters, thus the 0xffff limitation. It also makes no sense
271 ;; to have characters wider than the display.
272 (log (/ (min (display-pixel-width) #xffff)
273 (frame-char-width))
274 text-scale-mode-step))
275
259;;;###autoload 276;;;###autoload
260(defun text-scale-set (level) 277(defun text-scale-set (level)
261 "Set the scale factor of the default face in the current buffer to LEVEL. 278 "Set the scale factor of the default face in the current buffer to LEVEL.
@@ -266,7 +283,8 @@ Each step scales the height of the default face by the variable
266`text-scale-mode-step' (a negative number decreases the height by 283`text-scale-mode-step' (a negative number decreases the height by
267the same amount)." 284the same amount)."
268 (interactive "p") 285 (interactive "p")
269 (setq text-scale-mode-amount level) 286 (setq text-scale-mode-amount
287 (max (min level (text-scale-max-amount)) (text-scale-min-amount)))
270 (text-scale-mode (if (zerop text-scale-mode-amount) -1 1))) 288 (text-scale-mode (if (zerop text-scale-mode-amount) -1 1)))
271 289
272;;;###autoload 290;;;###autoload
@@ -279,8 +297,13 @@ Each step scales the height of the default face by the variable
279height by the same amount). As a special case, an argument of 0 297height by the same amount). As a special case, an argument of 0
280will remove any scaling currently active." 298will remove any scaling currently active."
281 (interactive "p") 299 (interactive "p")
282 (setq text-scale-mode-amount 300 (let* ((current-value (if text-scale-mode text-scale-mode-amount 0))
283 (if (= inc 0) 0 (+ (if text-scale-mode text-scale-mode-amount 0) inc))) 301 (new-value (if (= inc 0) 0 (+ current-value inc))))
302 (if (or (> new-value (text-scale-max-amount))
303 (< new-value (text-scale-min-amount)))
304 (user-error "Cannot %s the default face height more than it already is"
305 (if (> inc 0) "increase" "decrease")))
306 (setq text-scale-mode-amount new-value))
284 (text-scale-mode (if (zerop text-scale-mode-amount) -1 1))) 307 (text-scale-mode (if (zerop text-scale-mode-amount) -1 1)))
285 308
286;;;###autoload 309;;;###autoload
diff --git a/lisp/ffap.el b/lisp/ffap.el
index abf979f6129..7013e6e8ba4 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1966,7 +1966,9 @@ Only intended for interactive use."
1966(defun ffap-guess-file-name-at-point () 1966(defun ffap-guess-file-name-at-point ()
1967 "Try to get a file name at point. 1967 "Try to get a file name at point.
1968This hook is intended to be put in `file-name-at-point-functions'." 1968This hook is intended to be put in `file-name-at-point-functions'."
1969 (let ((guess (ffap-guesser))) 1969 ;; ffap-guesser can signal an error, and we don't want that when,
1970 ;; e.g., the user types M-n at the "C-x C-f" prompt.
1971 (let ((guess (ignore-errors (ffap-guesser))))
1970 (when (stringp guess) 1972 (when (stringp guess)
1971 (let ((url (ffap-url-p guess))) 1973 (let ((url (ffap-url-p guess)))
1972 (or url 1974 (or url
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 2667aaff0db..b2293a2b014 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -542,7 +542,6 @@ as given in your `~/.profile'."
542(defcustom tramp-remote-process-environment 542(defcustom tramp-remote-process-environment
543 `("TMOUT=0" "LC_CTYPE=''" 543 `("TMOUT=0" "LC_CTYPE=''"
544 ,(format "TERM=%s" tramp-terminal-type) 544 ,(format "TERM=%s" tramp-terminal-type)
545 "EMACS=t" ;; Deprecated; remove this line once Bash 4.4-or-later is common.
546 ,(format "INSIDE_EMACS='%s,tramp:%s'" emacs-version tramp-version) 545 ,(format "INSIDE_EMACS='%s,tramp:%s'" emacs-version tramp-version)
547 "CDPATH=" "HISTORY=" "MAIL=" "MAILCHECK=" "MAILPATH=" "PAGER=cat" 546 "CDPATH=" "HISTORY=" "MAIL=" "MAILCHECK=" "MAILPATH=" "PAGER=cat"
548 "autocorrect=" "correct=") 547 "autocorrect=" "correct=")
diff --git a/lisp/play/studly.el b/lisp/play/studly.el
index f6aae4548b1..ff1bf03e118 100644
--- a/lisp/play/studly.el
+++ b/lisp/play/studly.el
@@ -25,10 +25,10 @@
25 (setq begin (point)) 25 (setq begin (point))
26 (while (and (<= (point) end) 26 (while (and (<= (point) end)
27 (not (looking-at "\\W*\\'"))) 27 (not (looking-at "\\W*\\'")))
28 (forward-word 1) 28 (forward-word-strictly 1)
29 (backward-word 1) 29 (backward-word-strictly 1)
30 (setq begin (max (point) begin)) 30 (setq begin (max (point) begin))
31 (forward-word 1) 31 (forward-word-strictly 1)
32 (let ((offset 0) 32 (let ((offset 0)
33 (word-end (min (point) end)) 33 (word-end (min (point) end))
34 c) 34 c)
@@ -55,7 +55,7 @@
55 "Studlify-case the current word, or COUNT words if given an argument." 55 "Studlify-case the current word, or COUNT words if given an argument."
56 (interactive "*p") 56 (interactive "*p")
57 (let ((begin (point)) end rb re) 57 (let ((begin (point)) end rb re)
58 (forward-word count) 58 (forward-word-strictly count)
59 (setq end (point)) 59 (setq end (point))
60 (setq rb (min begin end) re (max begin end)) 60 (setq rb (min begin end) re (max begin end))
61 (studlify-region rb re))) 61 (studlify-region rb re)))
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 0b15a283090..b7ab408f744 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1702,14 +1702,6 @@ Returns the compilation buffer created."
1702 (list "TERM=emacs" 1702 (list "TERM=emacs"
1703 (format "TERMCAP=emacs:co#%d:tc=unknown:" 1703 (format "TERMCAP=emacs:co#%d:tc=unknown:"
1704 (window-width)))) 1704 (window-width))))
1705
1706 ;; Set the EMACS variable, but
1707 ;; don't override users' setting of $EMACS.
1708 ;; Remove this hack once Bash 4.4-or-later is common,
1709 ;; since it can break 'configure'.
1710 (unless (getenv "EMACS")
1711 (list "EMACS=t"))
1712
1713 (list (format "INSIDE_EMACS=%s,compile" emacs-version)) 1705 (list (format "INSIDE_EMACS=%s,compile" emacs-version))
1714 (copy-sequence process-environment)))) 1706 (copy-sequence process-environment))))
1715 (set (make-local-variable 'compilation-arguments) 1707 (set (make-local-variable 'compilation-arguments)
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 2b44b58f245..a478c95eb4f 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -427,21 +427,34 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
427This gets tacked on the end of the generated expressions.") 427This gets tacked on the end of the generated expressions.")
428 428
429;;;###autoload 429;;;###autoload
430(defvar grep-program (purecopy "grep") 430(defcustom grep-program (purecopy "grep")
431 "The default grep program for `grep-command' and `grep-find-command'. 431 "The default grep program for `grep-command' and `grep-find-command'.
432This variable's value takes effect when `grep-compute-defaults' is called.") 432This variable's value takes effect when `grep-compute-defaults' is called."
433 :type 'string
434 :version "25.1"
435 :group 'grep)
433 436
434;;;###autoload 437;;;###autoload
435(defvar find-program (purecopy "find") 438(defcustom grep-find-program (purecopy "find")
436 "The default find program. 439 "The default find program.
437This is used by commands like `grep-find-command', `find-dired' 440This is used by commands like `grep-find-command', `find-dired'
438and others.") 441and others."
442 :type 'string
443 :version "25.1"
444 :group 'grep)
445
446(define-obsolete-variable-alias 'find-program 'grep-find-program "25.1")
439 447
440;;;###autoload 448;;;###autoload
441(defvar xargs-program (purecopy "xargs") 449(defcustom grep-xargs-program (purecopy "xargs")
442 "The default xargs program for `grep-find-command'. 450 "The default xargs program for `grep-find-command'.
443See `grep-find-use-xargs'. 451See `grep-find-use-xargs'.
444This variable's value takes effect when `grep-compute-defaults' is called.") 452This variable's value takes effect when `grep-compute-defaults' is called."
453 :type 'string
454 :version "25.1"
455 :group 'grep)
456
457(define-obsolete-variable-alias 'xargs-program 'grep-xargs-program "25.1")
445 458
446;;;###autoload 459;;;###autoload
447(defvar grep-find-use-xargs nil 460(defvar grep-find-use-xargs nil
@@ -611,13 +624,14 @@ This function is called from `compilation-filter-hook'."
611 (unless grep-find-use-xargs 624 (unless grep-find-use-xargs
612 (setq grep-find-use-xargs 625 (setq grep-find-use-xargs
613 (cond 626 (cond
614 ((grep-probe find-program 627 ((grep-probe grep-find-program
615 `(nil nil nil ,null-device "-exec" "echo" 628 `(nil nil nil ,null-device "-exec" "echo"
616 "{}" "+")) 629 "{}" "+"))
617 'exec-plus) 630 'exec-plus)
618 ((and 631 ((and
619 (grep-probe find-program `(nil nil nil ,null-device "-print0")) 632 (grep-probe grep-find-program
620 (grep-probe xargs-program `(nil nil nil "-0" "echo"))) 633 `(nil nil nil ,null-device "-print0"))
634 (grep-probe grep-xargs-program `(nil nil nil "-0" "echo")))
621 'gnu) 635 'gnu)
622 (t 636 (t
623 'exec)))) 637 'exec))))
@@ -628,10 +642,11 @@ This function is called from `compilation-filter-hook'."
628 ;; after the pipe symbol be quoted if they use 642 ;; after the pipe symbol be quoted if they use
629 ;; forward slashes as directory separators. 643 ;; forward slashes as directory separators.
630 (format "%s . -type f -print0 | \"%s\" -0 %s" 644 (format "%s . -type f -print0 | \"%s\" -0 %s"
631 find-program xargs-program grep-command)) 645 grep-find-program grep-xargs-program
646 grep-command))
632 ((memq grep-find-use-xargs '(exec exec-plus)) 647 ((memq grep-find-use-xargs '(exec exec-plus))
633 (let ((cmd0 (format "%s . -type f -exec %s" 648 (let ((cmd0 (format "%s . -type f -exec %s"
634 find-program grep-command)) 649 grep-find-program grep-command))
635 (null (if grep-use-null-device 650 (null (if grep-use-null-device
636 (format "%s " null-device) 651 (format "%s " null-device)
637 ""))) 652 "")))
@@ -643,7 +658,8 @@ This function is called from `compilation-filter-hook'."
643 (1+ (length cmd0))))) 658 (1+ (length cmd0)))))
644 (t 659 (t
645 (format "%s . -type f -print | \"%s\" %s" 660 (format "%s . -type f -print | \"%s\" %s"
646 find-program xargs-program grep-command))))) 661 grep-find-program grep-xargs-program
662 grep-command)))))
647 (unless grep-find-template 663 (unless grep-find-template
648 (setq grep-find-template 664 (setq grep-find-template
649 (let ((gcmd (format "%s <C> %s <R>" 665 (let ((gcmd (format "%s <C> %s <R>"
@@ -653,17 +669,17 @@ This function is called from `compilation-filter-hook'."
653 ""))) 669 "")))
654 (cond ((eq grep-find-use-xargs 'gnu) 670 (cond ((eq grep-find-use-xargs 'gnu)
655 (format "%s <D> <X> -type f <F> -print0 | \"%s\" -0 %s" 671 (format "%s <D> <X> -type f <F> -print0 | \"%s\" -0 %s"
656 find-program xargs-program gcmd)) 672 grep-find-program grep-xargs-program gcmd))
657 ((eq grep-find-use-xargs 'exec) 673 ((eq grep-find-use-xargs 'exec)
658 (format "%s <D> <X> -type f <F> -exec %s {} %s%s" 674 (format "%s <D> <X> -type f <F> -exec %s {} %s%s"
659 find-program gcmd null 675 grep-find-program gcmd null
660 (shell-quote-argument ";"))) 676 (shell-quote-argument ";")))
661 ((eq grep-find-use-xargs 'exec-plus) 677 ((eq grep-find-use-xargs 'exec-plus)
662 (format "%s <D> <X> -type f <F> -exec %s %s{} +" 678 (format "%s <D> <X> -type f <F> -exec %s %s{} +"
663 find-program gcmd null)) 679 grep-find-program gcmd null))
664 (t 680 (t
665 (format "%s <D> <X> -type f <F> -print | \"%s\" %s" 681 (format "%s <D> <X> -type f <F> -print | \"%s\" %s"
666 find-program xargs-program gcmd)))))))) 682 grep-find-program grep-xargs-program gcmd))))))))
667 683
668 ;; Save defaults for this host. 684 ;; Save defaults for this host.
669 (setq grep-host-defaults-alist 685 (setq grep-host-defaults-alist
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 9ee405b31e1..212a5fa69ab 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -1374,8 +1374,20 @@ the variable `prolog-prompt-regexp'."
1374 () 1374 ()
1375 (with-current-buffer (get-buffer-create "*prolog*") 1375 (with-current-buffer (get-buffer-create "*prolog*")
1376 (prolog-inferior-mode) 1376 (prolog-inferior-mode)
1377 (apply 'make-comint-in-buffer "prolog" (current-buffer) 1377
1378 (prolog-program-name) nil (prolog-program-switches)) 1378 ;; The "INFERIOR=yes" hack is for SWI-Prolog 7.2.3 and earlier,
1379 ;; which assumes it is running under Emacs if either INFERIOR=yes or
1380 ;; if EMACS is set to a nonempty value. The EMACS setting is
1381 ;; obsolescent, so set INFERIOR. Newer versions of SWI-Prolog should
1382 ;; know about INSIDE_EMACS (which replaced EMACS) and should not need
1383 ;; this hack.
1384 (let ((process-environment
1385 (if (getenv "INFERIOR")
1386 process-environment
1387 (cons "INFERIOR=yes" process-environment))))
1388 (apply 'make-comint-in-buffer "prolog" (current-buffer)
1389 (prolog-program-name) nil (prolog-program-switches)))
1390
1379 (unless prolog-system 1391 (unless prolog-system
1380 ;; Setup auto-detection. 1392 ;; Setup auto-detection.
1381 (setq-local 1393 (setq-local
diff --git a/lisp/rect.el b/lisp/rect.el
index 73790f2f92a..685213a0635 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -398,8 +398,9 @@ With a prefix (or a FILL) argument, also fill too short lines."
398(defun rectangle--space-to (col) 398(defun rectangle--space-to (col)
399 (propertize " " 'display `(space :align-to ,col))) 399 (propertize " " 'display `(space :align-to ,col)))
400 400
401(defface rectangle-preview-face '((t :inherit region)) 401(defface rectangle-preview '((t :inherit region))
402 "The face to use for the `string-rectangle' preview.") 402 "The face to use for the `string-rectangle' preview."
403 :version "25.1")
403 404
404(defcustom rectangle-preview t 405(defcustom rectangle-preview t
405 "If non-nil, `string-rectangle' will show an-the-fly preview." 406 "If non-nil, `string-rectangle' will show an-the-fly preview."
diff --git a/lisp/subr.el b/lisp/subr.el
index a6d6fa44ca1..2dfd96edc07 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2087,6 +2087,10 @@ some sort of escape sequence, the ambiguity is resolved via `read-key-delay'."
2087 (aref keys 1) 2087 (aref keys 1)
2088 key))) 2088 key)))
2089 (cancel-timer timer) 2089 (cancel-timer timer)
2090 ;; For some reason, `read-key(-sequence)' leaves the prompt in the echo
2091 ;; area, whereas `read-event' seems to empty it just before returning
2092 ;; (bug#22714). So, let's mimic the behavior of `read-event'.
2093 (message nil)
2090 (use-global-map old-global-map)))) 2094 (use-global-map old-global-map))))
2091 2095
2092(defvar read-passwd-map 2096(defvar read-passwd-map
@@ -4107,7 +4111,8 @@ This function makes or adds to an entry on `after-load-alist'."
4107(defmacro with-eval-after-load (file &rest body) 4111(defmacro with-eval-after-load (file &rest body)
4108 "Execute BODY after FILE is loaded. 4112 "Execute BODY after FILE is loaded.
4109FILE is normally a feature name, but it can also be a file name, 4113FILE is normally a feature name, but it can also be a file name,
4110in case that file does not provide any feature." 4114in case that file does not provide any feature. See `eval-after-load'
4115for more details about the different forms of FILE and their semantics."
4111 (declare (indent 1) (debug t)) 4116 (declare (indent 1) (debug t))
4112 `(eval-after-load ,file (lambda () ,@body))) 4117 `(eval-after-load ,file (lambda () ,@body)))
4113 4118
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
171Should be consistent with the Git config value i18n.commitEncoding,
172and 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
179Should 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'.
854If START-REVISION is non-nil, it is the newest revision to show. 888If START-REVISION is non-nil, it is the newest revision to show.
855If LIMIT is non-nil, show no more than this many entries." 889If 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]."
1389The difference to vc-do-command is that this function always invokes 1423The 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)