aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2016-04-11 09:07:16 -0700
committerPaul Eggert2016-04-11 09:07:16 -0700
commit435da5d2955ce35be4785b7d46566ed9b42ea9fb (patch)
tree581fac64374d0997e53bba0ae3cbd4968fa55121
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...
-rw-r--r--ChangeLog.22
-rw-r--r--doc/emacs/frames.texi50
-rw-r--r--doc/lispref/display.texi76
-rw-r--r--doc/lispref/elisp.texi1
-rw-r--r--doc/lispref/text.texi5
-rw-r--r--doc/misc/efaq.texi15
-rw-r--r--doc/misc/texinfo.tex70
-rw-r--r--etc/NEWS19
-rw-r--r--etc/PROBLEMS8
-rw-r--r--lib/stdint.in.h9
-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
-rw-r--r--src/ChangeLog.122
-rw-r--r--src/nsterm.m9
-rw-r--r--src/unexmacosx.c21
-rw-r--r--src/xsmfns.c4
-rw-r--r--src/xwidget.c34
30 files changed, 409 insertions, 142 deletions
diff --git a/ChangeLog.2 b/ChangeLog.2
index bc09faf6508..04ecc82901e 100644
--- a/ChangeLog.2
+++ b/ChangeLog.2
@@ -21251,7 +21251,7 @@
21251 21251
212522015-09-01 Paul Eggert <eggert@cs.ucla.edu> 212522015-09-01 Paul Eggert <eggert@cs.ucla.edu>
21253 21253
21254 terminal-init-w32console mimicks command-line 21254 terminal-init-w32console mimics command-line
21255 Problem reported by Eli Zaretskii. 21255 Problem reported by Eli Zaretskii.
21256 * lisp/startup.el (startup--setup-quote-display): 21256 * lisp/startup.el (startup--setup-quote-display):
21257 New function, refactored from a part of ‘command-line’. 21257 New function, refactored from a part of ‘command-line’.
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index 35b3f83ab33..383ae7fd6ee 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -1152,11 +1152,11 @@ change the variable @code{x-gtk-file-dialog-help-text} to @code{nil}.
1152@section Tooltips 1152@section Tooltips
1153@cindex tooltips 1153@cindex tooltips
1154 1154
1155 @dfn{Tooltips} are small windows that display text information at 1155 @dfn{Tooltips} are small special frames that display text
1156the current mouse position. They activate when there is a pause in 1156information at the current mouse position. They activate when there
1157mouse movement over some significant piece of text in a window, or the 1157is a pause in mouse movement over some significant piece of text in a
1158mode line, or some other part of the Emacs frame such as a tool bar 1158window, or the mode line, or some other part of the Emacs frame such
1159button or menu item. 1159as a tool bar button or menu item.
1160 1160
1161@findex tooltip-mode 1161@findex tooltip-mode
1162 You can toggle the use of tooltips with the command @kbd{M-x 1162 You can toggle the use of tooltips with the command @kbd{M-x
@@ -1164,11 +1164,41 @@ tooltip-mode}. When Tooltip mode is disabled, the help text is
1164displayed in the echo area instead. To control the use of tooltips at 1164displayed in the echo area instead. To control the use of tooltips at
1165startup, customize the variable @code{tooltip-mode}. 1165startup, customize the variable @code{tooltip-mode}.
1166 1166
1167@vindex tooltip-delay 1167The following variables provide customization options for tooltip
1168 The variables @code{tooltip-delay} specifies how long Emacs should 1168display:
1169wait before displaying a tooltip. For additional customization 1169
1170options for displaying tooltips, use @kbd{M-x customize-group 1170@vtable @code
1171@key{RET} tooltip @key{RET}}. 1171@item tooltip-delay
1172This variable specifies how long Emacs should wait before displaying
1173the first tooltip. The value is in seconds.
1174
1175@item tooltip-short-delay
1176This variable specifies how long Emacs should wait before displaying
1177subsequent tooltips on different items, having already displayed the
1178first tooltip. The value is in seconds.
1179
1180@item tooltip-hide-delay
1181The number of seconds since displaying a tooltip to hide it, if the
1182mouse doesn't move.
1183
1184@item tooltip-x-offset
1185@itemx tooltip-y-offset
1186The X and Y offsets, in pixels, of the left top corner of the tooltip
1187from the mouse pointer position. Note that these are ignored if
1188@code{tooltip-frame-parameters} was customized to include,
1189respectively, the @code{left} and @code{top} parameters. The values
1190of the offsets should be chosen so that the tooltip doesn't cover the
1191mouse pointer's hot spot, or it might interfere with clicking the
1192mouse.
1193
1194@item tooltip-frame-parameters
1195The frame parameters used for displaying tooltips. @xref{Frame
1196Parameters,,, elisp, The Emacs Lisp Reference Manual}, and also
1197@ref{Tooltips,,, elisp, The Emacs Lisp Reference Manual}.
1198@end vtable
1199
1200For additional customization options for displaying tooltips, use
1201@kbd{M-x customize-group @key{RET} tooltip @key{RET}}.
1172 1202
1173@vindex x-gtk-use-system-tooltips 1203@vindex x-gtk-use-system-tooltips
1174 If Emacs is built with GTK+ support, it displays tooltips via GTK+, 1204 If Emacs is built with GTK+ support, it displays tooltips via GTK+,
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 1e45501482c..3cd1d4edf1c 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -34,6 +34,7 @@ that Emacs presents to the user.
34* Character Display:: How Emacs displays individual characters. 34* Character Display:: How Emacs displays individual characters.
35* Beeping:: Audible signal to the user. 35* Beeping:: Audible signal to the user.
36* Window Systems:: Which window system is being used. 36* Window Systems:: Which window system is being used.
37* Tooltips:: Tooltip display in Emacs.
37* Bidirectional Display:: Display of bidirectional scripts, such as 38* Bidirectional Display:: Display of bidirectional scripts, such as
38 Arabic and Farsi. 39 Arabic and Farsi.
39@end menu 40@end menu
@@ -7131,6 +7132,81 @@ indicator of Emacs capabilities on a given display type. Instead, use
7131@code{display-graphic-p} or any of the other @code{display-*-p} 7132@code{display-graphic-p} or any of the other @code{display-*-p}
7132predicates described in @ref{Display Feature Testing}. 7133predicates described in @ref{Display Feature Testing}.
7133 7134
7135@node Tooltips
7136@section Tooltips
7137@cindex tooltips
7138@dfn{Tooltips} are special frames (@pxref{Frames}) that are used to
7139display helpful hints (a.k.a.@: ``tips'') related to the current
7140position of the mouse pointer. Emacs uses tooltips to display help
7141strings about active portions of text (@pxref{Special Properties}) and
7142about various UI elements, such as menu items (@pxref{Extended Menu
7143Items}) and tool-bar buttons (@pxref{Tool Bar}).
7144
7145@defun tooltip-mode
7146Tooltip Mode is a minor mode that enables display of tooltips.
7147Turning off this mode causes the tooltips be displayed in the echo
7148area. On text-mode (a.k.a.@: ``TTY'') frames, tooltips are always
7149displayed in the echo area.
7150@end defun
7151
7152@vindex x-gtk-use-system-tooltips
7153When Emacs is built with GTK+ support, it by default displays tooltips
7154using GTK+ functions, and the appearance of the tooltips is then
7155controlled by GTK+ settings. GTK+ tooltips can be disabled by
7156changing the value of the variable @code{x-gtk-use-system-tooltips} to
7157@code{nil}. The rest of this subsection describes how to control
7158non-GTK+ tooltips, which are presented by Emacs itself.
7159
7160Since tooltips are special frames, they have their frame parameters
7161(@pxref{Frame Parameters}). Unlike other frames, the frame parameters
7162for tooltips are stored in a special variable.
7163
7164@defvar tooltip-frame-parameters
7165This customizable option holds the frame parameters used for
7166displaying tooltips. Any font and color parameters are ignored, and
7167the corresponding attributes of the @code{tooltip} face are used
7168instead. If @code{left} or @code{top} parameters are included, they
7169are used as absolute frame-relative coordinates where the tooltip
7170should be shown. (Mouse-relative position of the tooltip can be
7171customized using the variables described in @ref{Tooltips,,, emacs,
7172The GNU Emacs Manual}.) Note that the @code{left} and @code{top}
7173parameters, if present, override the values of mouse-relative offsets.
7174@end defvar
7175
7176@vindex tooltip@r{ face}
7177The @code{tooltip} face determines the appearance of text shown in
7178tooltips. It should generally use a variable-pitch font of size that
7179is preferably smaller than the default frame font.
7180
7181@findex tooltip-help-tips
7182@defvar tooltip-functions
7183This abnormal hook is a list of functions to call when Emacs needs to
7184display a tooltip. Each function is called with a single argument
7185@var{event} which is a copy of the last mouse movement event. If a
7186function on this list actually displays the tooltip, it should return
7187non-@code{nil}, and then the rest of the functions will not be
7188called. The default value of this variable is a single function
7189@code{tooltip-help-tips}.
7190@end defvar
7191
7192If you write your own function to be put on the
7193@code{tooltip-functions} list, you may need to know the buffer of the
7194mouse event that triggered the tooltip display. The following
7195function provides that information.
7196
7197@defun tooltip-event-buffer event
7198This function returns the buffer over which @var{event} occurred.
7199Call it with the argument of the function from
7200@code{tooltip-functions} to obtain the buffer whose text triggered the
7201tooltip. Note that the event might occur not over a buffer (e.g.,
7202over the tool bar), in which case this function will return
7203@code{nil}.
7204@end defun
7205
7206Other aspects of tooltip display are controlled by several
7207customizable settings; see @ref{Tooltips,,, emacs, The GNU Emacs
7208Manual}.
7209
7134@node Bidirectional Display 7210@node Bidirectional Display
7135@section Bidirectional Display 7211@section Bidirectional Display
7136@cindex bidirectional display 7212@cindex bidirectional display
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index 4c1541e98c6..a3bff0b07ac 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -1380,6 +1380,7 @@ Emacs Display
1380* Character Display:: How Emacs displays individual characters. 1380* Character Display:: How Emacs displays individual characters.
1381* Beeping:: Audible signal to the user. 1381* Beeping:: Audible signal to the user.
1382* Window Systems:: Which window system is being used. 1382* Window Systems:: Which window system is being used.
1383* Tooltips:: Tooltip display in Emacs.
1383* Bidirectional Display:: Display of bidirectional scripts, such as 1384* Bidirectional Display:: Display of bidirectional scripts, such as
1384 Arabic and Farsi. 1385 Arabic and Farsi.
1385 1386
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 55f02904fa1..991b47d20b4 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -3279,12 +3279,11 @@ or shorter, higher or lower, wider or narrow, or replaced with an image.
3279 3279
3280@item help-echo 3280@item help-echo
3281@kindex help-echo @r{(text property)} 3281@kindex help-echo @r{(text property)}
3282@cindex tooltip 3282@cindex tooltip for help strings
3283@anchor{Text help-echo} 3283@anchor{Text help-echo}
3284If text has a string as its @code{help-echo} property, then when you 3284If text has a string as its @code{help-echo} property, then when you
3285move the mouse onto that text, Emacs displays that string in the echo 3285move the mouse onto that text, Emacs displays that string in the echo
3286area, or in the tooltip window (@pxref{Tooltips,,, emacs, The GNU Emacs 3286area, or in the tooltip window (@pxref{Tooltips}).
3287Manual}).
3288 3287
3289If the value of the @code{help-echo} property is a function, that 3288If the value of the @code{help-echo} property is a function, that
3290function is called with three arguments, @var{window}, @var{object} and 3289function is called with three arguments, @var{window}, @var{object} and
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index 5008db31f25..1fa46492080 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -2664,11 +2664,6 @@ by typing @kbd{M-x ansi-color-for-comint-mode} in the Shell buffer, or
2664by adding @code{(add-hook 'shell-mode-hook 2664by adding @code{(add-hook 'shell-mode-hook
2665'ansi-color-for-comint-mode-on)} to your init file. 2665'ansi-color-for-comint-mode-on)} to your init file.
2666 2666
2667In Emacs versions before 21.1, the @code{ansi-color} package is not
2668included. In that case, you need to unalias @code{ls} for interactive
2669shells running in Emacs; this can be done by checking the @code{EMACS}
2670variable in the environment.
2671
2672@node Fullscreen mode on MS-Windows 2667@node Fullscreen mode on MS-Windows
2673@section How can I start Emacs in fullscreen mode on MS-Windows? 2668@section How can I start Emacs in fullscreen mode on MS-Windows?
2674@cindex Maximize frame 2669@cindex Maximize frame
@@ -2757,11 +2752,9 @@ For @code{tcsh}, put this in your @file{.cshrc} (or @file{.tcshrc})
2757file: 2752file:
2758 2753
2759@example 2754@example
2760if ($?EMACS) then 2755if ($?INSIDE_EMACS && $?tcsh)
2761 if ("$EMACS" =~ /*) then 2756 unset edit
2762 if ($?tcsh) unset edit 2757 stty -icrnl -onlcr -echo susp ^Z
2763 stty nl
2764 endif
2765endif 2758endif
2766@end example 2759@end example
2767 2760
@@ -2769,7 +2762,7 @@ Or put this in your @file{.emacs_tcsh} or @file{~/.emacs.d/init_tcsh.sh} file:
2769 2762
2770@example 2763@example
2771unset edit 2764unset edit
2772stty nl 2765stty -icrnl -onlcr -echo susp ^Z
2773@end example 2766@end example
2774 2767
2775Alternatively, use @code{csh} in your shell buffers instead of 2768Alternatively, use @code{csh} in your shell buffers instead of
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex
index 75017af5035..d164d451b89 100644
--- a/doc/misc/texinfo.tex
+++ b/doc/misc/texinfo.tex
@@ -3,7 +3,7 @@
3% Load plain if necessary, i.e., if running under initex. 3% Load plain if necessary, i.e., if running under initex.
4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi 4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
5% 5%
6\def\texinfoversion{2016-03-25.17} 6\def\texinfoversion{2016-03-29.15}
7% 7%
8% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 8% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -1550,8 +1550,7 @@ output) for that.)}
1550 \fi 1550 \fi
1551 \turnoffactive 1551 \turnoffactive
1552 \makevalueexpandable 1552 \makevalueexpandable
1553 % In the case of XeTeX, xdvipdfmx converts strings to UTF-16. 1553 \txiescapepdf\pdfdestname
1554 % Therefore \txiescapepdf is not necessary.
1555 \safewhatsit{\pdfdest name{\pdfdestname} xyz}% 1554 \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
1556 }} 1555 }}
1557 % 1556 %
@@ -1566,9 +1565,12 @@ output) for that.)}
1566 \fi 1565 \fi
1567 { 1566 {
1568 \turnoffactive 1567 \turnoffactive
1569 % In the case of XeTeX, xdvipdfmx converts strings to UTF-16. 1568 \txiescapepdf\pdfoutlinedest
1570 % Therefore \txiescapepdf is not necessary. 1569 \edef\pdfoutlinetext{#1}%
1571 \special{pdf:out [-] #2 << /Title (#1) /A << /S /GoTo /D (name\pdfoutlinedest) >> >> }% 1570 \txiescapepdf\pdfoutlinetext
1571 %
1572 \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A
1573 << /S /GoTo /D (name\pdfoutlinedest) >> >> }%
1572 } 1574 }
1573 } 1575 }
1574 % 1576 %
@@ -1624,6 +1626,20 @@ output) for that.)}
1624 % ``\special{pdf:dest ...}'' can not handle non-ASCII strings. 1626 % ``\special{pdf:dest ...}'' can not handle non-ASCII strings.
1625 % It fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). 1627 % It fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
1626% 1628%
1629 \def\skipspaces#1{\def\PP{#1}\def\D{|}%
1630 \ifx\PP\D\let\nextsp\relax
1631 \else\let\nextsp\skipspaces
1632 \addtokens{\filename}{\PP}%
1633 \advance\filenamelength by 1
1634 \fi
1635 \nextsp}
1636 \def\getfilename#1{%
1637 \filenamelength=0
1638 % If we don't expand the argument now, \skipspaces will get
1639 % snagged on things like "@value{foo}".
1640 \edef\temp{#1}%
1641 \expandafter\skipspaces\temp|\relax
1642 }
1627 % make a live url in pdf output. 1643 % make a live url in pdf output.
1628 \def\pdfurl#1{% 1644 \def\pdfurl#1{%
1629 \begingroup 1645 \begingroup
@@ -8760,6 +8776,7 @@ end
8760 % 8776 %
8761 % Make link in pdf output. 8777 % Make link in pdf output.
8762 \ifpdf 8778 \ifpdf
8779 % For pdfTeX and LuaTeX
8763 {\indexnofonts 8780 {\indexnofonts
8764 \turnoffactive 8781 \turnoffactive
8765 \makevalueexpandable 8782 \makevalueexpandable
@@ -8786,6 +8803,47 @@ end
8786 \fi 8803 \fi
8787 }% 8804 }%
8788 \setcolor{\linkcolor}% 8805 \setcolor{\linkcolor}%
8806 \else
8807 \ifx\XeTeXrevision\thisisundefined
8808 \else
8809 % For XeTeX
8810 {\indexnofonts
8811 \turnoffactive
8812 \makevalueexpandable
8813 % This expands tokens, so do it after making catcode changes, so _
8814 % etc. don't get their TeX definitions. This ignores all spaces in
8815 % #4, including (wrongly) those in the middle of the filename.
8816 \getfilename{#4}%
8817 %
8818 % This (wrongly) does not take account of leading or trailing
8819 % spaces in #1, which should be ignored.
8820 \iftxiuseunicodedestname
8821 \def\pdfxrefdest{#1}% Pass through Unicode characters.
8822 \else
8823 \edef\pdfxrefdest{#1}% Replace Unicode characters to ASCII.
8824 \fi
8825 \ifx\pdfxrefdest\empty
8826 \def\pdfxrefdest{Top}% no empty targets
8827 \else
8828 \txiescapepdf\pdfxrefdest % escape PDF special chars
8829 \fi
8830 %
8831 \leavevmode
8832 \ifnum\filenamelength>0
8833 % By the default settings,
8834 % XeTeX (xdvipdfmx) replaces link destination names with integers.
8835 % In this case, the replaced destination names of
8836 % remote PDF cannot be known. In order to avoid replacement,
8837 % you can use commandline option `-C 0x0010' for xdvipdfmx.
8838 \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
8839 << /S /GoToR /F (\the\filename.pdf) /D (name\pdfxrefdest) >> >>}%
8840 \else
8841 \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
8842 << /S /GoTo /D (name\pdfxrefdest) >> >>}%
8843 \fi
8844 }%
8845 \setcolor{\linkcolor}%
8846 \fi
8789 \fi 8847 \fi
8790 {% 8848 {%
8791 % Have to otherify everything special to allow the \csname to 8849 % Have to otherify everything special to allow the \csname to
diff --git a/etc/NEWS b/etc/NEWS
index 0152593de8f..59f8d086717 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1303,6 +1303,17 @@ See the 'vc-faces' customization group.
1303the color range from 'vc-annotate-color-map' is applied to the 1303the color range from 'vc-annotate-color-map' is applied to the
1304background or to the foreground. 1304background or to the foreground.
1305 1305
1306---
1307*** New options for customizing encoding of Git commit log messages.
1308The new options `vc-git-commits-coding-system' and
1309`vc-git-log-output-coding-system' allow to customize the encoding of
1310the log messages sent to Git when committing, and the decoding of the
1311log messages read from Git history commands. Both default to UTF-8;
1312if you customize them, make sure they are consistent with the Git
1313config variables i18n.commitEncoding and i18n.logOutputEncoding.
1314(`vc-git-commits-coding-system' existed previously, but was a
1315variable, not a user option.)
1316
1306+++ 1317+++
1307*** 'compare-windows' now compares text with the most recently selected window 1318*** 'compare-windows' now compares text with the most recently selected window
1308instead of the next window. If you want the previous behavior of 1319instead of the next window. If you want the previous behavior of
@@ -1723,8 +1734,10 @@ symbol-function was changed not to signal 'void-function' any more.
1723*** As a consequence, the second arg of 'indirect-function' is now obsolete. 1734*** As a consequence, the second arg of 'indirect-function' is now obsolete.
1724 1735
1725+++ 1736+++
1726** Although comint, term, and compile still set the EMACS variable, 1737** M-x shell and M-x compile no longer set the EMACS environment variable.
1727this is now considered deprecated and will be removed in a future release. 1738This avoids clashing when other programs use the variable for other purposes.
1739Although M-x term still sets EMACS for compatibility with Bash 4.3 and earlier,
1740this is deprecated and will be phased out when Bash 4.4 or later takes over.
1728Use the INSIDE_EMACS environment variable instead. 1741Use the INSIDE_EMACS environment variable instead.
1729 1742
1730** 'C-up', 'C-down', 'C-left' and 'C-right' are now defined in term 1743** 'C-up', 'C-down', 'C-left' and 'C-right' are now defined in term
@@ -2119,7 +2132,7 @@ function 'encode-time', which already accepted a simple time zone rule
2119argument, has been extended to accept all the new forms. 2132argument, has been extended to accept all the new forms.
2120 2133
2121*** Incompatible change in the third argument of 'format-time-string'. 2134*** Incompatible change in the third argument of 'format-time-string'.
2122Previously, any non-nil argument was interpeted as specifying Universal Time. 2135Previously, any non-nil argument was interpreted as specifying Universal Time.
2123This is no longer true; packages that want Universal Time should pass t 2136This is no longer true; packages that want Universal Time should pass t
2124as the third argument. 2137as the third argument.
2125 2138
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index f61921a6562..2ccb7711376 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -459,11 +459,9 @@ smart. It sees that the Shell uses terminal type 'unknown' and turns
459on the flag to output ^M at the end of each line. You can fix the 459on the flag to output ^M at the end of each line. You can fix the
460problem by adding this to your .cshrc file: 460problem by adding this to your .cshrc file:
461 461
462 if ($?EMACS) then 462 if ($?INSIDE_EMACS && $?tcsh)
463 if ("$EMACS" =~ /*) then 463 unset edit
464 unset edit 464 stty -icrnl -onlcr -echo susp ^Z
465 stty -icrnl -onlcr -echo susp ^Z
466 endif
467 endif 465 endif
468 466
469*** Emacs startup on GNU/Linux systems (and possibly other systems) is slow. 467*** Emacs startup on GNU/Linux systems (and possibly other systems) is slow.
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
index 0bb9ad41b29..cf65ec62e97 100644
--- a/lib/stdint.in.h
+++ b/lib/stdint.in.h
@@ -118,15 +118,10 @@
118 picky compilers. */ 118 picky compilers. */
119 119
120#define _STDINT_MIN(signed, bits, zero) \ 120#define _STDINT_MIN(signed, bits, zero) \
121 ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero)) 121 ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero))
122 122
123#define _STDINT_MAX(signed, bits, zero) \ 123#define _STDINT_MAX(signed, bits, zero) \
124 ((signed) \ 124 (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
125 ? ~ _STDINT_MIN (signed, bits, zero) \
126 : /* The expression for the unsigned case. The subtraction of (signed) \
127 is a nop in the unsigned case and avoids "signed integer overflow" \
128 warnings in the signed case. */ \
129 ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
130 125
131#if !GNULIB_defined_stdint_types 126#if !GNULIB_defined_stdint_types
132 127
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)
diff --git a/src/ChangeLog.12 b/src/ChangeLog.12
index 3045ecdca92..b2df482ba77 100644
--- a/src/ChangeLog.12
+++ b/src/ChangeLog.12
@@ -2895,7 +2895,7 @@
2895 (wait_reading_process_output, init_process_emacs): 2895 (wait_reading_process_output, init_process_emacs):
2896 Assume O_NONBLOCK. 2896 Assume O_NONBLOCK.
2897 (wait_reading_process_output): Put in a special case for WINDOWSNT 2897 (wait_reading_process_output): Put in a special case for WINDOWSNT
2898 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK. 2898 to mimic the older behavior where it had O_NDELAY but not O_NONBLOCK.
2899 It's not clear this is needed, but it's a more-conservative change. 2899 It's not clear this is needed, but it's a more-conservative change.
2900 (create_process): Assume FD_CLOEXEC. 2900 (create_process): Assume FD_CLOEXEC.
2901 (create_process, create_pty): Assume O_NOCTTY. 2901 (create_process, create_pty): Assume O_NOCTTY.
diff --git a/src/nsterm.m b/src/nsterm.m
index 4048ac46546..34c5395b630 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -596,8 +596,15 @@ ns_init_locale (void)
596 596
597 @try 597 @try
598 { 598 {
599 /* It seems OS X should probably use UTF-8 everywhere.
600 'localeIdentifier' does not specify the encoding, and I can't
601 find any way to get the OS to tell us which encoding to use,
602 so hard-code '.UTF-8'. */
603 NSString *localeID = [NSString stringWithFormat:@"%@.UTF-8",
604 [locale localeIdentifier]];
605
599 /* Set LANG to locale, but not if LANG is already set. */ 606 /* Set LANG to locale, but not if LANG is already set. */
600 setenv("LANG", [[locale localeIdentifier] UTF8String], 0); 607 setenv("LANG", [localeID UTF8String], 0);
601 } 608 }
602 @catch (NSException *e) 609 @catch (NSException *e)
603 { 610 {
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 827eda56e08..bdacc8b540b 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -103,9 +103,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
103#include <stdio.h> 103#include <stdio.h>
104#include <fcntl.h> 104#include <fcntl.h>
105#include <stdarg.h> 105#include <stdarg.h>
106#include <stdint.h>
106#include <sys/types.h> 107#include <sys/types.h>
107#include <unistd.h> 108#include <unistd.h>
108#include <mach/mach.h> 109#include <mach/mach.h>
110#include <mach/vm_map.h>
109#include <mach-o/loader.h> 111#include <mach-o/loader.h>
110#include <mach-o/reloc.h> 112#include <mach-o/reloc.h>
111#ifdef HAVE_MALLOC_MALLOC_H 113#ifdef HAVE_MALLOC_MALLOC_H
@@ -217,10 +219,27 @@ unexec_read (void *dest, size_t n)
217static int 219static int
218unexec_write (off_t dest, const void *src, size_t count) 220unexec_write (off_t dest, const void *src, size_t count)
219{ 221{
222 task_t task = mach_task_self();
223 if (task == MACH_PORT_NULL || task == MACH_PORT_DEAD)
224 return false;
225
220 if (lseek (outfd, dest, SEEK_SET) != dest) 226 if (lseek (outfd, dest, SEEK_SET) != dest)
221 return 0; 227 return 0;
222 228
223 return write (outfd, src, count) == count; 229 /* We use the Mach virtual memory API to read our process memory
230 because using src directly would be undefined behavior and fails
231 under Address Sanitizer. */
232 bool success = false;
233 vm_offset_t data;
234 mach_msg_type_number_t data_count;
235 if (vm_read (task, (uintptr_t) src, count, &data, &data_count)
236 == KERN_SUCCESS)
237 {
238 success =
239 write (outfd, (const void *) (uintptr_t) data, data_count) == count;
240 vm_deallocate (task, data, data_count);
241 }
242 return success;
224} 243}
225 244
226/* Write COUNT bytes of zeros to outfd starting at offset DEST. 245/* Write COUNT bytes of zeros to outfd starting at offset DEST.
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 296b1cc3603..a7ec8e0c7e2 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -545,7 +545,7 @@ syms_of_xsmfns (void)
545Changing the value does not change the session id used by Emacs. 545Changing the value does not change the session id used by Emacs.
546The value is nil if no session manager is running. 546The value is nil if no session manager is running.
547See also `x-session-previous-id', `emacs-save-session-functions', 547See also `x-session-previous-id', `emacs-save-session-functions',
548`emacs-session-save' and `emacs-session-restore'." */); 548`emacs-session-save' and `emacs-session-restore'. */);
549 Vx_session_id = Qnil; 549 Vx_session_id = Qnil;
550 550
551 DEFVAR_LISP ("x-session-previous-id", Vx_session_previous_id, 551 DEFVAR_LISP ("x-session-previous-id", Vx_session_previous_id,
@@ -568,7 +568,7 @@ The session id Emacs has while it is running is in the variable
568same, depending on how the session manager works. 568same, depending on how the session manager works.
569 569
570See also `emacs-save-session-functions', `emacs-session-save' and 570See also `emacs-save-session-functions', `emacs-session-save' and
571`emacs-session-restore'." */); 571`emacs-session-restore'. */);
572 Vx_session_previous_id = Qnil; 572 Vx_session_previous_id = Qnil;
573 573
574 defsubr (&Shandle_save_session); 574 defsubr (&Shandle_save_session);
diff --git a/src/xwidget.c b/src/xwidget.c
index 8ff4c23b1f2..7e96307bdd8 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -578,24 +578,22 @@ x_draw_xwidget_glyph_string (struct glyph_string *s)
578 other time to know things like window placement etc. */ 578 other time to know things like window placement etc. */
579 xv = xwidget_init_view (xww, s, x, y); 579 xv = xwidget_init_view (xww, s, x, y);
580 580
581 /* Calculate clipping, which is used for all manner of onscreen 581 int text_area_x, text_area_y, text_area_width, text_area_height;
582 xwidget views. Each widget border can get clipped by other emacs 582
583 objects so there are four clipping variables. */ 583 window_box (s->w,
584 clip_right = 584 ANY_AREA,
585 min (xww->width, 585 &text_area_x,
586 WINDOW_RIGHT_EDGE_X (s->w) - x - 586 &text_area_y,
587 WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH (s->w) - 587 &text_area_width,
588 WINDOW_RIGHT_FRINGE_WIDTH (s->w)); 588 &text_area_height);
589 clip_left = 589 clip_right = min (xww->width,
590 max (0, 590 text_area_width);
591 WINDOW_LEFT_EDGE_X (s->w) - x + 591 clip_left = max (0,
592 WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (s->w) + 592 text_area_x);
593 WINDOW_LEFT_FRINGE_WIDTH (s->w)); 593
594 594 clip_bottom = min (xww->height,
595 clip_bottom = 595 text_area_height);
596 min (xww->height, 596 clip_top = max (0, text_area_y);
597 WINDOW_BOTTOM_EDGE_Y (s->w) - WINDOW_MODE_LINE_HEIGHT (s->w) - y);
598 clip_top = max (0, WINDOW_TOP_EDGE_Y (s->w) - y);
599 597
600 /* We are concerned with movement of the onscreen area. The area 598 /* We are concerned with movement of the onscreen area. The area
601 might sit still when the widget actually moves. This happens 599 might sit still when the widget actually moves. This happens