aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Wiegley2016-02-15 14:11:03 -0800
committerJohn Wiegley2016-02-15 14:11:03 -0800
commit220613e089ec012ae4ab319637365132ce8dc306 (patch)
tree715595598dfd3d80ba7c4306a0ea8f010b320db4
parentca03b85b9c1b8908f2651eaf594780c7b5217f61 (diff)
parentd4b93e11a519cf71beca69654fda158d01a26c3b (diff)
downloademacs-220613e089ec012ae4ab319637365132ce8dc306.tar.gz
emacs-220613e089ec012ae4ab319637365132ce8dc306.zip
Merge from origin/emacs-25
d4b93e1 Minor fixes in global-auto-composition-mode 02b037b Allow arithmetic operators inside C++ template constructs. 44b16f6 Avoid crashes in semi-malformed 'condition-case' 652e5b4 Allow arithmetic operators inside C++ template constructs. d9ea795 Fix regression with 'recent-keys' and keyboard macros 903603f Fix wording in a doc-view.el comment cf79616 ; Spelling fixes f8bf1b3 CONTRIBUTE cleanups and updates f3aaca3 Port USE_STACK_LISP_OBJECTS fix to Clang 1834ac7 Port to x86 GCC 4.3.1 and earlier 8482949 Fix point movement under 'scroll-conservatively' c1313b5 Replace colon in file name (not legal on Windows) f7af26c Fix a typo in edt.texi 8badf95 Make 'mmap_realloc' on MS-Windows more reliable 856cd94 Grep alias `all' shall not match parent directory
-rw-r--r--CONTRIBUTE213
-rw-r--r--ChangeLog.24
-rw-r--r--admin/notes/git-workflow36
-rw-r--r--doc/misc/edt.texi2
-rw-r--r--lisp/ChangeLog.132
-rw-r--r--lisp/ChangeLog.172
-rw-r--r--lisp/composite.el1
-rw-r--r--lisp/doc-view.el22
-rw-r--r--lisp/emacs-lisp/easy-mmode.el1
-rw-r--r--lisp/gnus/ChangeLog.36
-rw-r--r--lisp/progmodes/cc-engine.el14
-rw-r--r--lisp/progmodes/cc-langs.el33
-rw-r--r--lisp/progmodes/grep.el2
-rw-r--r--src/emacs.c4
-rw-r--r--src/eval.c2
-rw-r--r--src/keyboard.c50
-rw-r--r--src/lisp.h6
-rw-r--r--src/w32heap.c51
-rw-r--r--src/xdisp.c2
19 files changed, 259 insertions, 194 deletions
diff --git a/CONTRIBUTE b/CONTRIBUTE
index 7cb4a1c7544..d17e53cc636 100644
--- a/CONTRIBUTE
+++ b/CONTRIBUTE
@@ -1,48 +1,51 @@
1This file contains information on Emacs developer processes. 1* How developers contribute to GNU Emacs
2 2
3For information on contributing to Emacs as a non-developer, see 3Here is how software developers can contribute to Emacs. (Non-developers: see
4(info "(emacs)Contributing") or
5http://www.gnu.org/software/emacs/manual/html_node/emacs/Contributing.html 4http://www.gnu.org/software/emacs/manual/html_node/emacs/Contributing.html
5or run the shell command 'info "(emacs)Contributing"'.)
6 6
7* Information for Emacs Developers. 7** The Emacs repository
8 8
9An "Emacs Developer" is someone who contributes a lot of code or 9Emacs development uses Git on Savannah for its main repository.
10documentation to the Emacs repository. Generally, they have write 10Briefly, the following shell commands build and run Emacs from scratch:
11access to the Emacs git repository on Savannah
12https://savannah.gnu.org/git/?group=emacs.
13 11
14** Write access to the Emacs repository. 12 git config --global user.name 'Your Name'
13 git config --global user.email 'your.name@example.com'
14 git config --global transfer.fsckObjects true
15 git clone git://git.sv.gnu.org/emacs.git
16 cd emacs
17 ./autogen.sh
18 ./configure
19 make
20 src/emacs
15 21
16Once you become a frequent contributor to Emacs, we can consider 22For more details, see
17giving you write access to the version-control repository. Request 23http://www.emacswiki.org/emacs/GitQuickStartForEmacsDevs and
18access on the emacs-devel@gnu.org mailing list. Also, be sure to 24http://www.emacswiki.org/emacs/GitForEmacsDevs or see the file
19subscribe to the emacs-devel@gnu.org mailing list and include the 25admin/notes/git-workflow.
20"emacs-announce" topic, so that you get the announcements about
21feature freeze and other important events.
22 26
23** Using the Emacs repository 27** Getting involved with development
24 28
25Emacs uses Git for the source code repository. 29You can subscribe to the emacs-devel@gnu.org mailing list, paying
30attention to postings with subject lines containing "emacs-announce",
31as these discuss important events like feature freezes. See
32http://lists.gnu.org/mailman/listinfo/emacs-devel for mailing list
33instructions and archives. You can develop and commit changes in your
34own copy of the repository, and discuss proposed changes on the
35mailing list. Frequent contributors to Emacs can request write access
36there.
26 37
27See http://www.emacswiki.org/emacs/GitQuickStartForEmacsDevs to get 38** Committing changes by others
28started, and http://www.emacswiki.org/emacs/GitForEmacsDevs for more
29advanced information.
30 39
31Alternately, see admin/notes/git-workflow. 40If committing changes written by someone else, commit in their name,
32 41not yours. You can use 'git commit --author="AUTHOR"' to specify a
33If committing changes written by someone else, make the commit in 42change's author.
34their name, not yours. Git distinguishes between the author
35and the committer; use the --author option on the commit command to
36specify the actual author; the committer defaults to you.
37 43
38** Commit messages 44** Commit messages
39 45
40Emacs development no longer stores descriptions of new changes in 46Ordinarily, a change you commit should contain a log entry in its
41ChangeLog files. Instead, a single ChangeLog file is generated from 47commit message and should not touch the repository's ChangeLog files.
42the commit messages when a release is prepared. So changes you commit 48Here is an example commit message (indented):
43should not touch any of the ChangeLog files in the repository, but
44instead should contain the log entries in the commit message. Here is
45an example of a commit message (indented):
46 49
47 Deactivate shifted region 50 Deactivate shifted region
48 51
@@ -53,12 +56,13 @@ an example of a commit message (indented):
53 * src/frame.c (Fhandle_switch_frame, Fselected_frame): 56 * src/frame.c (Fhandle_switch_frame, Fselected_frame):
54 Deactivate the mark. 57 Deactivate the mark.
55 58
56Below are some rules and recommendations for formatting commit 59Occasionally, commit messages are collected and prepended to a
57messages: 60ChangeLog file, where they can be corrected. It saves time to get
61them right the first time, so here are guidelines for formatting them:
58 62
59- Start with a single unindented summary line explaining the change; 63- Start with a single unindented summary line explaining the change;
60 do not end this line with a period. If that line starts with a 64 do not end this line with a period. If that line starts with a
61 semi-colon and a space "; ", the log message will be ignored when 65 semicolon and a space "; ", the commit message will be ignored when
62 generating the ChangeLog file. Use this for minor commits that do 66 generating the ChangeLog file. Use this for minor commits that do
63 not need separate ChangeLog entries, such as changes in etc/NEWS. 67 not need separate ChangeLog entries, such as changes in etc/NEWS.
64 68
@@ -104,19 +108,19 @@ messages:
104 the rationale for a change; that can be done in the commit message 108 the rationale for a change; that can be done in the commit message
105 between the summary line and the file entries. 109 between the summary line and the file entries.
106 110
107- Emacs generally follows the GNU coding standards when it comes to 111- Emacs generally follows the GNU coding standards for ChangeLogs: see
108 ChangeLogs: 112 http://www.gnu.org/prep/standards/html_node/Change-Logs.html
109 http://www.gnu.org/prep/standards/html_node/Change-Logs.html or 113 or run 'info "(standards)Change Logs"'. One exception is that
110 "(info (standards)Change Logs"). One exception is that we still 114 commits still sometimes quote `like-this' (as the standards used to
111 sometimes quote `like-this' (as the standards used to recommend) 115 recommend) rather than 'like-this' or ‘like this’ (as they do now),
112 rather than 'like-this' (as they do now), because `...' is so widely 116 as `...' is so widely used elsewhere in Emacs.
113 used elsewhere in Emacs.
114 117
115- Some of the rules in the GNU coding standards section 5.2 118- Some commenting rules in the GNU coding standards also apply
116 "Commenting Your Work" also apply to ChangeLog entries: they must be 119 to ChangeLog entries: they must be in English, and be complete
117 in English, and be complete sentences starting with a capital and 120 sentences starting with a capital and ending with a period (except
118 ending with a period (except the summary line should not end in a 121 the summary line should not end in a period). See
119 period). 122 http://www.gnu.org/prep/standards/html_node/Comments.html
123 or run 'info "(standards)Comments"'.
120 124
121 They are preserved indefinitely, and have a reasonable chance of 125 They are preserved indefinitely, and have a reasonable chance of
122 being read in the future, so it's better that they have good 126 being read in the future, so it's better that they have good
@@ -145,15 +149,15 @@ messages:
145 will suffice. 149 will suffice.
146 150
147- There is no need to mention files such as NEWS and MAINTAINERS, or 151- There is no need to mention files such as NEWS and MAINTAINERS, or
148 to indicate regeneration of files such as 'configure', in the 152 to indicate regeneration of files such as 'lib/gnulib.mk', in the
149 ChangeLog entry. "There is no need" means you don't have to, but 153 ChangeLog entry. "There is no need" means you don't have to, but
150 you can if you want to. 154 you can if you want to.
151 155
152** Generating ChangeLog entries 156** Generating ChangeLog entries
153 157
154- You can use various Emacs functions to ease the process of writing 158- You can use Emacs functions to write ChangeLog entries; see
155 ChangeLog entries; see (info "(emacs)Change Log Commands") or 159 http://www.gnu.org/software/emacs/manual/html_node/emacs/Change-Log-Commands.html
156 http://www.gnu.org/software/emacs/manual/html_node/emacs/Change-Log-Commands.html. 160 or run 'info "(emacs)Change Log Commands"'.
157 161
158- If you use Emacs VC, one way to format ChangeLog entries is to create 162- If you use Emacs VC, one way to format ChangeLog entries is to create
159 a top-level ChangeLog file manually, and update it with 'C-x 4 a' as 163 a top-level ChangeLog file manually, and update it with 'C-x 4 a' as
@@ -171,32 +175,33 @@ messages:
171 175
172** Branches 176** Branches
173 177
174Development normally takes places on the trunk. 178Future development normally takes place on the master branch.
175Sometimes specialized features are developed on separate branches 179Sometimes specialized features are developed on other branches before
176before possibly being merged to the trunk. 180possibly being merged to the master. Release branches are named
177 181"emacs-NN" where NN is the major version number, and are mainly
178Development is discussed on the emacs-devel mailing list. 182intended for more-conservative changes such as bug fixes. Typically,
179 183collective development is active on the master branch and possibly on
180The trunk branch is named "master" in git; release branches are named 184the current release branch. Periodically, the current release branch
181"emacs-nn" where "nn" is the major version. 185is merged into the master, using the gitmerge function described in
186admin/notes-git-workflow.
182 187
183If you are fixing a bug that exists in the current release, be sure to 188If you are fixing a bug that exists in the current release, be sure to
184commit it to the release branch; it will be merged to the master 189commit it to the release branch; it will be merged to the master
185branch later. 190branch later by the gitmerge function.
186 191
187However, if you know that the change will be difficult to merge to 192However, if you know that the change will be difficult to merge to the
188master (eg because the code on master has changed a lot), you can 193master (e.g., because the code on master has changed a lot), you can
189apply the change to both master and branch yourself. It could also 194apply the change to both master and branch yourself. It could also
190happen that a change is cherry-picked from master to the release 195happen that a change is cherry-picked from master to the release
191branch, and so doesn't need to be merged back. In these cases, 196branch, and so doesn't need to be merged back. In these cases,
192indicate in the release branch commit log that there is no need to 197say in the release branch commit message that there is no need to merge
193merge the commit to master; start the commit message with "Backport:". 198the commit to master, by starting the commit message with "Backport:".
194gitmerge.el will then exclude that commit from the merge to trunk. 199The gitmerge function excludes these commits from the merge to the master.
195 200
196Some changes should not be merged to master at all, for whatever 201Some changes should not be merged to master at all, for whatever
197reasons. These should be marked by including something like "Do not 202reasons. These should be marked by including something like "Do not
198merge to master" or anything that matches gitmerge-skip-regexp (see 203merge to master" or anything that matches gitmerge-skip-regexp (see
199gitmerge.el) in the log message. 204admin/gitmerge.el) in the commit message.
200 205
201** Other process information 206** Other process information
202 207
@@ -206,10 +211,11 @@ Discussion about Emacs development takes place on emacs-devel@gnu.org.
206 211
207Bug reports and fixes, feature requests and implementations should be 212Bug reports and fixes, feature requests and implementations should be
208sent to bug-gnu-emacs@gnu.org, the bug/feature list. This is coupled 213sent to bug-gnu-emacs@gnu.org, the bug/feature list. This is coupled
209to the tracker at http://debbugs.gnu.org . 214to the http://debbugs.gnu.org tracker.
210 215
211You can subscribe to the mailing lists, or see the list archives, 216The Savannah info page http://savannah.gnu.org/mail/?group=emacs
212by following links from http://savannah.gnu.org/mail/?group=emacs . 217describes how to subscribe to the mailing lists, or see the list
218archives.
213 219
214To email a patch you can use a shell command like 'git format-patch -1' 220To email a patch you can use a shell command like 'git format-patch -1'
215to create a file, and then attach the file to your email. This nicely 221to create a file, and then attach the file to your email. This nicely
@@ -219,11 +225,10 @@ such patch without additional remarks, you can use a command like
219 225
220** Issue tracker (a.k.a. "bug tracker") 226** Issue tracker (a.k.a. "bug tracker")
221 227
222The Emacs issue tracker is at http://debbugs.gnu.org/. The form 228The Emacs issue tracker at http://debbugs.gnu.org lets you view bug
223presented by that page allows to view bug reports and search the 229reports and search the database for bugs matching several criteria.
224database for bugs matching several criteria. Messages posted to the 230Messages posted to the bug-gnu-emacs@gnu.org mailing list, mentioned
225bug-gnu-emacs@gnu.org mailing list, mentioned above, are recorded by 231above, are recorded by the tracker with the corresponding bugs/issues.
226the tracker with the corresponding bugs/issues.
227 232
228GNU ELPA has a 'debbugs' package that allows accessing the tracker 233GNU ELPA has a 'debbugs' package that allows accessing the tracker
229database from Emacs. 234database from Emacs.
@@ -239,7 +244,7 @@ The process of going through old or new bugs and acting on them is
239called bug triage. This process is described in the file 244called bug triage. This process is described in the file
240admin/notes/bug-triage. 245admin/notes/bug-triage.
241 246
242** Document your changes. 247** Documenting your changes
243 248
244Any change that matters to end-users should have an entry in etc/NEWS. 249Any change that matters to end-users should have an entry in etc/NEWS.
245 250
@@ -250,21 +255,21 @@ know it does not, mark the NEWS entry with "---". If you know
250that *all* the necessary documentation updates have been made, mark 255that *all* the necessary documentation updates have been made, mark
251the entry with "+++". Otherwise do not mark it. 256the entry with "+++". Otherwise do not mark it.
252 257
253Please see (info "(elisp)Documentation Tips") or 258For more specific tips on Emacs's doc style, see
254https://www.gnu.org/software/emacs/manual/html_node/elisp/Documentation-Tips.html 259http://www.gnu.org/software/emacs/manual/html_node/elisp/Documentation-Tips.html
255for more specific tips on Emacs's doc style. Use 'checkdoc' to check 260Use 'checkdoc' to check for documentation errors before submitting a patch.
256for documentation errors before submitting a patch.
257 261
258** Test your changes. 262** Testing your changes
259 263
260Please test your changes before committing them or sending them to the 264Please test your changes before committing them or sending them to the
261list. If possible, add a new test along with any bug fix or new 265list. If possible, add a new test along with any bug fix or new
262functionality you commit (of course, some changes cannot be easily 266functionality you commit (of course, some changes cannot be easily
263tested). 267tested).
264 268
265Emacs uses ERT, Emacs Lisp Regression Testing, for testing. See (info 269Emacs uses ERT, Emacs Lisp Regression Testing, for testing. See
266"(ert)") or https://www.gnu.org/software/emacs/manual/html_node/ert/ 270http://www.gnu.org/software/emacs/manual/html_node/ert/
267for more information on writing and running tests. 271or run 'info "(ert)"' for for more information on writing and running
272tests.
268 273
269If your test lasts longer than some few seconds, mark it in its 274If your test lasts longer than some few seconds, mark it in its
270'ert-deftest' definition with ":tags '(:expensive-test)". 275'ert-deftest' definition with ":tags '(:expensive-test)".
@@ -293,27 +298,26 @@ If your test file contains the tests "test-foo", "test2-foo" and
293"test-foo-remote", and you want to run only the former two tests, you 298"test-foo-remote", and you want to run only the former two tests, you
294could use a regexp: "make <filename> SELECTOR='\"foo$$\"'" . 299could use a regexp: "make <filename> SELECTOR='\"foo$$\"'" .
295 300
296** Understanding Emacs Internals. 301** Understanding Emacs internals
302
303The best way to understand Emacs internals is to read the code. Some
304source files, such as xdisp.c, have extensive comments describing the
305design and implementation. The following resources may also help:
306
307http://www.gnu.org/software/emacs/manual/html_node/elisp/Tips.html
308http://www.gnu.org/software/emacs/manual/html_node/elisp/GNU-Emacs-Internals.html
297 309
298The best way to understand Emacs Internals is to read the code, 310or run 'info "(elisp)Tips"' or 'info "(elisp)GNU Emacs Internals"'.
299but the nodes "Tips" and "GNU Emacs Internals" in the Appendix
300of the Emacs Lisp Reference Manual may also help. Some source files,
301such as xdisp.c, have large commentaries describing the design and
302implementation in more detail.
303 311
304The file etc/DEBUG describes how to debug Emacs bugs. 312The file etc/DEBUG describes how to debug Emacs bugs.
305 313
306*** Non-ASCII characters in Emacs files 314*** Non-ASCII characters in Emacs files
307 315
308If you introduce non-ASCII characters into Emacs source files, it is a 316If you introduce non-ASCII characters into Emacs source files, use the
309good idea to add a 'coding' cookie to the file to state its encoding. 317UTF-8 encoding unless it cannot do the job for some good reason.
310Please use the UTF-8 encoding unless it cannot do the job for some 318Although it is generally a good idea to add 'coding:' cookies to
311good reason. As of Emacs 24.4, it is no longer necessary to have 319non-ASCII source files, cookies are not needed in UTF-8-encoded *.el
312explicit 'coding' cookies in *.el files if they are encoded in UTF-8, 320files intended for use only with Emacs version 24.5 and later.
313but other files need them even if encoded in UTF-8. However, if
314an *.el file is intended for use with older Emacs versions (e.g. if
315it's also distributed via ELPA), having an explicit encoding
316specification is still a good idea.
317 321
318*** Useful files in the admin/ directory 322*** Useful files in the admin/ directory
319 323
@@ -335,15 +339,15 @@ changed heuristic to deduce that a file was renamed. So if you are
335planning to make extensive changes to a file after renaming it (or 339planning to make extensive changes to a file after renaming it (or
336moving it to another directory), you should: 340moving it to another directory), you should:
337 341
338- create a feature branch 342- Create a feature branch.
339 343
340- commit the rename without any changes 344- Commit the rename without any changes.
341 345
342- make other changes 346- Make other changes.
343 347
344- merge the feature branch to trunk, _not_ squashing the commits into 348- Merge the feature branch to the master branch, instead of squashing
345 one. The commit message on this merge should summarize the renames 349 the commits into one. The commit message on this merge should
346 and all the changes. 350 summarize the renames and all the changes.
347 351
348 352
349 353
@@ -365,4 +369,5 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
365Local variables: 369Local variables:
366mode: outline 370mode: outline
367paragraph-separate: "[ ]*$" 371paragraph-separate: "[ ]*$"
372coding: utf-8
368end: 373end:
diff --git a/ChangeLog.2 b/ChangeLog.2
index 024eff0f051..6edc6546034 100644
--- a/ChangeLog.2
+++ b/ChangeLog.2
@@ -13864,7 +13864,7 @@
13864 (unexec): Don't search for bss style sections by name. Instead, 13864 (unexec): Don't search for bss style sections by name. Instead,
13865 use the last PT_LOAD header address range covered by p_memsz 13865 use the last PT_LOAD header address range covered by p_memsz
13866 but not p_filesz and match any SHT_NOBITS section in that 13866 but not p_filesz and match any SHT_NOBITS section in that
13867 address range. Simplify initialisation of section header vars. 13867 address range. Simplify initialization of section header vars.
13868 Don't assume that section headers are above bss segment. Move 13868 Don't assume that section headers are above bss segment. Move
13869 copying of bss area out of section loop. Align .data2 section 13869 copying of bss area out of section loop. Align .data2 section
13870 to 1, since it now covers the entire bss area. For SHT_NOBITS 13870 to 1, since it now covers the entire bss area. For SHT_NOBITS
@@ -13923,7 +13923,7 @@
13923 Separate out some of the more mechanical changes so following patches 13923 Separate out some of the more mechanical changes so following patches
13924 are smaller. 13924 are smaller.
13925 13925
13926 * src/unexelf.c (unexec): Rearrange initialisation of program 13926 * src/unexelf.c (unexec): Rearrange initialization of program
13927 header vars. Use pointer vars in loops rather than indexing 13927 header vars. Use pointer vars in loops rather than indexing
13928 section header array via macros. Simplify _OBJC_ sym code 13928 section header array via macros. Simplify _OBJC_ sym code
13929 and reloc handling code. 13929 and reloc handling code.
diff --git a/admin/notes/git-workflow b/admin/notes/git-workflow
index b6168c31bd5..2e4bbac70fe 100644
--- a/admin/notes/git-workflow
+++ b/admin/notes/git-workflow
@@ -19,17 +19,15 @@ Initial setup
19============= 19=============
20 20
21Then we want to clone the repository. We normally want to have both 21Then we want to clone the repository. We normally want to have both
22the current trunk and the emacs-24 branch. 22the current master and the emacs-25 branch.
23 23
24mkdir ~/emacs 24mkdir ~/emacs
25cd ~/emacs 25cd ~/emacs
26git clone <membername>@git.sv.gnu.org:/srv/git/emacs.git 26git clone <membername>@git.sv.gnu.org:/srv/git/emacs.git master
27mv emacs trunk 27(cd master; git config push.default current)
28(cd trunk; git config push.default current) 28./master/admin/git-new-workdir master emacs-25
29./trunk/admin/git-new-workdir trunk emacs-24 29cd emacs-25
30cd emacs-24 30git checkout emacs-25
31git checkout emacs-24
32git config push.default current
33 31
34You now have both branches conveniently accessible, and you can do 32You now have both branches conveniently accessible, and you can do
35"git pull" in them once in a while to keep updated. 33"git pull" in them once in a while to keep updated.
@@ -59,13 +57,13 @@ you commit your change locally and then send a patch file as a bug report
59as described in ../../CONTRIBUTE. 57as described in ../../CONTRIBUTE.
60 58
61 59
62Backporting to emacs-24 60Backporting to emacs-25
63======================= 61=======================
64 62
65If you have applied a fix to the trunk, but then decide that it should 63If you have applied a fix to the master, but then decide that it should
66be applied to the emacs-24 branch, too, then 64be applied to the emacs-25 branch, too, then
67 65
68cd ~/emacs/trunk 66cd ~/emacs/master
69git log 67git log
70 68
71and find the commit you're looking for. Then find the commit ID, 69and find the commit you're looking for. Then find the commit ID,
@@ -73,7 +71,7 @@ which will look like
73 71
74commit 958b768a6534ae6e77a8547a56fc31b46b63710b 72commit 958b768a6534ae6e77a8547a56fc31b46b63710b
75 73
76cd ~/emacs/emacs-24 74cd ~/emacs/emacs-25
77git cherry-pick -xe 958b768a6534ae6e77a8547a56fc31b46b63710b 75git cherry-pick -xe 958b768a6534ae6e77a8547a56fc31b46b63710b
78 76
79and add "Backport:" to the commit string. Then 77and add "Backport:" to the commit string. Then
@@ -81,17 +79,17 @@ and add "Backport:" to the commit string. Then
81git push 79git push
82 80
83 81
84Merging emacs-24 to trunk/master 82Merging emacs-25 to the master
85================================ 83==============================
86 84
87It is recommended to use the file gitmerge.el in the admin directory 85It is recommended to use the file gitmerge.el in the admin directory
88for merging 'emacs-24' into 'master'. It will take care of many 86for merging 'emacs-25' into 'master'. It will take care of many
89things which would otherwise have to be done manually, like ignoring 87things which would otherwise have to be done manually, like ignoring
90commits that should not land in master, fixing up ChangeLogs and 88commits that should not land in master, fixing up ChangeLogs and
91automatically dealing with certain types of conflicts. If you really 89automatically dealing with certain types of conflicts. If you really
92want to, you can do the merge manually, but then you're on your own. 90want to, you can do the merge manually, but then you're on your own.
93If you still choose to do that, make absolutely sure that you *always* 91If you still choose to do that, make absolutely sure that you *always*
94use the 'merge' command to transport commits from 'emacs-24' to 92use the 'merge' command to transport commits from 'emacs-25' to
95'master'. *Never* use 'cherry-pick'! If you don't know why, then you 93'master'. *Never* use 'cherry-pick'! If you don't know why, then you
96shouldn't manually do the merge in the first place; just use 94shouldn't manually do the merge in the first place; just use
97gitmerge.el instead. 95gitmerge.el instead.
@@ -104,11 +102,11 @@ up-to-date by doing a pull. Then start Emacs with
104 emacs -l admin/gitmerge.el -f gitmerge 102 emacs -l admin/gitmerge.el -f gitmerge
105 103
106You'll be asked for the branch to merge, which will default to 104You'll be asked for the branch to merge, which will default to
107'origin/emacs-24', which you should accept. Merging a local tracking 105'origin/emacs-25', which you should accept. Merging a local tracking
108branch is discouraged, since it might not be up-to-date, or worse, 106branch is discouraged, since it might not be up-to-date, or worse,
109contain commits from you which are not yet pushed upstream. 107contain commits from you which are not yet pushed upstream.
110 108
111You will now see the list of commits from 'emacs-24' which are not yet 109You will now see the list of commits from 'emacs-25' which are not yet
112merged to 'master'. You might also see commits that are already 110merged to 'master'. You might also see commits that are already
113marked for "skipping", which means that they will be merged with a 111marked for "skipping", which means that they will be merged with a
114different merge strategy ('ours'), which will effectively ignore the 112different merge strategy ('ours'), which will effectively ignore the
diff --git a/doc/misc/edt.texi b/doc/misc/edt.texi
index 2361313f262..cb22b82e262 100644
--- a/doc/misc/edt.texi
+++ b/doc/misc/edt.texi
@@ -30,7 +30,7 @@ modify this GNU manual.''
30@titlepage 30@titlepage
31@title EDT Emulation User's Manual 31@title EDT Emulation User's Manual
32@author Kevin Gallagher 32@author Kevin Gallagher
33@author @email{kevin.gal@verizon.net} 33@author @email{kevin.gal@@verizon.net}
34@page 34@page
35@vskip 0pt plus 1filll 35@vskip 0pt plus 1filll
36@insertcopying 36@insertcopying
diff --git a/lisp/ChangeLog.13 b/lisp/ChangeLog.13
index 041e8c0c86b..d792889b3b7 100644
--- a/lisp/ChangeLog.13
+++ b/lisp/ChangeLog.13
@@ -7656,7 +7656,7 @@
76562007-11-07 Glenn Morris <rgm@gnu.org> 76562007-11-07 Glenn Morris <rgm@gnu.org>
7657 7657
7658 * emulation/tpu-mapper.el (tpu-map-key): Use unless rather than cond. 7658 * emulation/tpu-mapper.el (tpu-map-key): Use unless rather than cond.
7659 Remove superfluous concats. Move final set-buffer to 7659 Remove superfluous concatenations. Move final set-buffer to
7660 non-emacs-specific code. 7660 non-emacs-specific code.
7661 7661
76622007-11-07 Rob Riepel <riepel@networking.stanford.edu> 76622007-11-07 Rob Riepel <riepel@networking.stanford.edu>
diff --git a/lisp/ChangeLog.17 b/lisp/ChangeLog.17
index 1785a336732..ee03661ece0 100644
--- a/lisp/ChangeLog.17
+++ b/lisp/ChangeLog.17
@@ -1758,7 +1758,7 @@
1758 1758
1759 * net/shr.el (shr-insert): Make sure the space inserted has the 1759 * net/shr.el (shr-insert): Make sure the space inserted has the
1760 right font (for width). 1760 right font (for width).
1761 (shr-fill-line): Preserve background colours when indenting/folding. 1761 (shr-fill-line): Preserve background colors when indenting/folding.
1762 (shr-ensure-paragraph): Don't insert a new paragraph as the first 1762 (shr-ensure-paragraph): Don't insert a new paragraph as the first
1763 item in a <li>. 1763 item in a <li>.
1764 1764
diff --git a/lisp/composite.el b/lisp/composite.el
index 205f5ed3712..94b14dfc94a 100644
--- a/lisp/composite.el
+++ b/lisp/composite.el
@@ -838,6 +838,7 @@ omitted or nil.
838 838
839For more information on Auto Composition mode, see 839For more information on Auto Composition mode, see
840`auto-composition-mode' ." 840`auto-composition-mode' ."
841 :global t
841 :variable (default-value 'auto-composition-mode)) 842 :variable (default-value 'auto-composition-mode))
842 843
843(defalias 'toggle-auto-composition 'auto-composition-mode) 844(defalias 'toggle-auto-composition 'auto-composition-mode)
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 06cf8dcef3a..af7f1996cc5 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -140,6 +140,7 @@
140(require 'dired) 140(require 'dired)
141(require 'image-mode) 141(require 'image-mode)
142(require 'jka-compr) 142(require 'jka-compr)
143(require 'subr-x)
143 144
144;;;; Customization Options 145;;;; Customization Options
145 146
@@ -695,14 +696,19 @@ It's a subdirectory of `doc-view-cache-directory'."
695 (setq doc-view--current-cache-dir 696 (setq doc-view--current-cache-dir
696 (file-name-as-directory 697 (file-name-as-directory
697 (expand-file-name 698 (expand-file-name
698 (concat (subst-char-in-string ?% ?_ ;; bug#13679 699 (concat (thread-last
699 (file-name-nondirectory doc-view--buffer-file-name)) 700 (file-name-nondirectory doc-view--buffer-file-name)
700 "-" 701 ;; bug#13679
701 (let ((file doc-view--buffer-file-name)) 702 (subst-char-in-string ?% ?_)
702 (with-temp-buffer 703 ;; arc-mode concatenates archive name and file name
703 (set-buffer-multibyte nil) 704 ;; with colon, which isn't allowed on MS-Windows.
704 (insert-file-contents-literally file) 705 (subst-char-in-string ?: ?_))
705 (md5 (current-buffer))))) 706 "-"
707 (let ((file doc-view--buffer-file-name))
708 (with-temp-buffer
709 (set-buffer-multibyte nil)
710 (insert-file-contents-literally file)
711 (md5 (current-buffer)))))
706 doc-view-cache-directory))))) 712 doc-view-cache-directory)))))
707 713
708;;;###autoload 714;;;###autoload
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index f29f64f0562..6a4d835b63c 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -68,6 +68,7 @@ replacing its case-insensitive matches with the literal string in LIGHTER."
68 "toggle-\\|-mode\\'" "" 68 "toggle-\\|-mode\\'" ""
69 (symbol-name mode)))) 69 (symbol-name mode))))
70 " mode"))) 70 " mode")))
71 (setq name (replace-regexp-in-string "\\`Global-" "Global " name))
71 (if (not (stringp lighter)) name 72 (if (not (stringp lighter)) name
72 ;; Strip leading and trailing whitespace from LIGHTER. 73 ;; Strip leading and trailing whitespace from LIGHTER.
73 (setq lighter (replace-regexp-in-string "\\`\\s-+\\|\\s-+\\'" "" 74 (setq lighter (replace-regexp-in-string "\\`\\s-+\\|\\s-+\\'" ""
diff --git a/lisp/gnus/ChangeLog.3 b/lisp/gnus/ChangeLog.3
index 5e7e95b0466..e6cbe0458b4 100644
--- a/lisp/gnus/ChangeLog.3
+++ b/lisp/gnus/ChangeLog.3
@@ -1732,7 +1732,7 @@
1732 * eww.el (eww-convert-widgets): Put `help-echo' on input fields so that 1732 * eww.el (eww-convert-widgets): Put `help-echo' on input fields so that
1733 we can navigate to them. 1733 we can navigate to them.
1734 1734
1735 * shr.el (shr-colorize-region): Put the colours over the entire region. 1735 * shr.el (shr-colorize-region): Put the colors over the entire region.
1736 (shr-inhibit-decoration): New variable. 1736 (shr-inhibit-decoration): New variable.
1737 (shr-add-font): Use it to inhibit text property decorations while doing 1737 (shr-add-font): Use it to inhibit text property decorations while doing
1738 preliminary table renderings. This speeds up typical Wikipedia page 1738 preliminary table renderings. This speeds up typical Wikipedia page
@@ -1824,7 +1824,7 @@
1824 * shr.el (shr-expand-url): Respect // URLs. 1824 * shr.el (shr-expand-url): Respect // URLs.
1825 1825
1826 * eww.el (eww-tag-body): Override the shr body rendering so that we can 1826 * eww.el (eww-tag-body): Override the shr body rendering so that we can
1827 put a background colour onto the entire buffer. 1827 put a background color onto the entire buffer.
1828 (eww-render): When being redirected, use the redirect URL as the new 1828 (eww-render): When being redirected, use the redirect URL as the new
1829 base URL. 1829 base URL.
1830 1830
@@ -3514,7 +3514,7 @@
3514 3514
3515 * mm-archive.el (mm-archive-decoders): Add support for tar. 3515 * mm-archive.el (mm-archive-decoders): Add support for tar.
3516 3516
3517 * gnus.el (gnus-logo-color-alist): Change the colours for Ma Gnus. 3517 * gnus.el (gnus-logo-color-alist): Change the colors for Ma Gnus.
3518 3518
3519 * nnmail.el (nnmail-extra-headers): Add Cc to the default. 3519 * nnmail.el (nnmail-extra-headers): Add Cc to the default.
3520 3520
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 39600cf28f8..8f2acf3cd61 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -6056,7 +6056,10 @@ comment at the start of cc-engine.el for more info."
6056 ;; Stop on ',', '|', '&', '+' and '-' to catch 6056 ;; Stop on ',', '|', '&', '+' and '-' to catch
6057 ;; common binary operators that could be between 6057 ;; common binary operators that could be between
6058 ;; two comparison expressions "a<b" and "c>d". 6058 ;; two comparison expressions "a<b" and "c>d".
6059 "[<;{},|+&-]\\|[>)]" 6059 ;; 2016-02-11: C++11 templates can now contain arithmetic
6060 ;; expressions, so template detection in C++ is now less
6061 ;; robust than it was.
6062 c-<>-notable-chars-re
6060 nil t t)) 6063 nil t t))
6061 6064
6062 (cond 6065 (cond
@@ -6064,7 +6067,9 @@ comment at the start of cc-engine.el for more info."
6064 ;; Either an operator starting with '>' or the end of 6067 ;; Either an operator starting with '>' or the end of
6065 ;; the angle bracket arglist. 6068 ;; the angle bracket arglist.
6066 6069
6067 (if (looking-at c->-op-without->-cont-regexp) 6070 (if (save-excursion
6071 (c-backward-token-2)
6072 (looking-at c-multichar->-op-not->>-regexp))
6068 (progn 6073 (progn
6069 (goto-char (match-end 0)) 6074 (goto-char (match-end 0))
6070 t) ; Continue the loop. 6075 t) ; Continue the loop.
@@ -6134,6 +6139,11 @@ comment at the start of cc-engine.el for more info."
6134 ))) 6139 )))
6135 t) ; carry on looping. 6140 t) ; carry on looping.
6136 6141
6142 ((and
6143 (eq (char-before) ?\()
6144 (c-go-up-list-forward)
6145 (eq (char-before) ?\))))
6146
6137 ((and (not c-restricted-<>-arglists) 6147 ((and (not c-restricted-<>-arglists)
6138 (or (and (eq (char-before) ?&) 6148 (or (and (eq (char-before) ?&)
6139 (not (eq (char-after) ?&))) 6149 (not (eq (char-after) ?&)))
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index ef894043bce..86b6bec78a1 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -228,6 +228,12 @@ the evaluated constant value at compile time."
228 ;; with the group symbol for each group and should return non-nil 228 ;; with the group symbol for each group and should return non-nil
229 ;; if that group is to be included. 229 ;; if that group is to be included.
230 ;; 230 ;;
231 ;; OP-FILTER selects the operators. It is either t to select all
232 ;; operators, a string to select all operators for which `string-match'
233 ;; matches the operator with the string, or a function which will be
234 ;; called with the operator and should return non-nil when the operator
235 ;; is to be selected.
236 ;;
231 ;; If XLATE is given, it's a function which is called for each 237 ;; If XLATE is given, it's a function which is called for each
232 ;; matching operator and its return value is collected instead. 238 ;; matching operator and its return value is collected instead.
233 ;; If it returns a list, the elements are spliced directly into 239 ;; If it returns a list, the elements are spliced directly into
@@ -1237,7 +1243,6 @@ operators."
1237 t 1243 t
1238 "\\`<." 1244 "\\`<."
1239 (lambda (op) (substring op 1))))) 1245 (lambda (op) (substring op 1)))))
1240
1241(c-lang-defvar c-<-op-cont-regexp (c-lang-const c-<-op-cont-regexp)) 1246(c-lang-defvar c-<-op-cont-regexp (c-lang-const c-<-op-cont-regexp))
1242 1247
1243(c-lang-defconst c->-op-cont-tokens 1248(c-lang-defconst c->-op-cont-tokens
@@ -1256,7 +1261,6 @@ operators."
1256 ;; Regexp matching the second and subsequent characters of all 1261 ;; Regexp matching the second and subsequent characters of all
1257 ;; multicharacter tokens that begin with ">". 1262 ;; multicharacter tokens that begin with ">".
1258 t (c-make-keywords-re nil (c-lang-const c->-op-cont-tokens))) 1263 t (c-make-keywords-re nil (c-lang-const c->-op-cont-tokens)))
1259
1260(c-lang-defvar c->-op-cont-regexp (c-lang-const c->-op-cont-regexp)) 1264(c-lang-defvar c->-op-cont-regexp (c-lang-const c->-op-cont-regexp))
1261 1265
1262(c-lang-defconst c->-op-without->-cont-regexp 1266(c-lang-defconst c->-op-without->-cont-regexp
@@ -1271,10 +1275,19 @@ operators."
1271 "\\`>>" 1275 "\\`>>"
1272 (lambda (op) (substring op 1))) 1276 (lambda (op) (substring op 1)))
1273 :test 'string-equal))) 1277 :test 'string-equal)))
1274
1275(c-lang-defvar c->-op-without->-cont-regexp 1278(c-lang-defvar c->-op-without->-cont-regexp
1276 (c-lang-const c->-op-without->-cont-regexp)) 1279 (c-lang-const c->-op-without->-cont-regexp))
1277 1280
1281(c-lang-defconst c-multichar->-op-not->>-regexp
1282 ;; Regexp matching multichar tokens containing ">", except ">>"
1283 t (c-make-keywords-re nil
1284 (delete ">>"
1285 (c-filter-ops (c-lang-const c-all-op-syntax-tokens)
1286 t
1287 "\\(.>\\|>.\\)"))))
1288(c-lang-defvar c-multichar->-op-not->>-regexp
1289 (c-lang-const c-multichar->-op-not->>-regexp))
1290
1278(c-lang-defconst c-stmt-delim-chars 1291(c-lang-defconst c-stmt-delim-chars
1279 ;; The characters that should be considered to bound statements. To 1292 ;; The characters that should be considered to bound statements. To
1280 ;; optimize `c-crosses-statement-barrier-p' somewhat, it's assumed to 1293 ;; optimize `c-crosses-statement-barrier-p' somewhat, it's assumed to
@@ -3079,6 +3092,20 @@ expression is considered to be a type."
3079 ; generics is not yet coded in CC Mode. 3092 ; generics is not yet coded in CC Mode.
3080(c-lang-defvar c-recognize-<>-arglists (c-lang-const c-recognize-<>-arglists)) 3093(c-lang-defvar c-recognize-<>-arglists (c-lang-const c-recognize-<>-arglists))
3081 3094
3095(c-lang-defconst c-<>-notable-chars-re
3096 "A regexp matching any single character notable inside a <...> construct.
3097This must include \"<\" and \">\", and should include \",\", and
3098any character which cannot be valid inside such a construct.
3099This is used in `c-forward-<>-arglist-recur' to try to detect
3100sequences of tokens which cannot be a template/generic construct.
3101When \"(\" is present, that defun will attempt to parse a
3102parenthesized expression inside the template. When \")\" is
3103present it will treat an unbalanced closing paren as a sign of
3104the invalidity of the putative template construct."
3105 t "[<;{},|+&->)]"
3106 c++ "[<;{},>()]")
3107(c-lang-defvar c-<>-notable-chars-re (c-lang-const c-<>-notable-chars-re))
3108
3082(c-lang-defconst c-enums-contain-decls 3109(c-lang-defconst c-enums-contain-decls
3083 "Non-nil means that an enum structure can contain declarations." 3110 "Non-nil means that an enum structure can contain declarations."
3084 t nil 3111 t nil
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 7e6f157f5fe..f04a7226d18 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -189,7 +189,7 @@ Customize or call the function `grep-apply-setting'."
189 :group 'grep) 189 :group 'grep)
190 190
191(defcustom grep-files-aliases 191(defcustom grep-files-aliases
192 '(("all" . "* .*") 192 '(("all" . "* .[!.]* ..?*") ;; Don't match `..'. See bug#22577
193 ("el" . "*.el") 193 ("el" . "*.el")
194 ("ch" . "*.[ch]") 194 ("ch" . "*.[ch]")
195 ("c" . "*.c") 195 ("c" . "*.c")
diff --git a/src/emacs.c b/src/emacs.c
index 628b9be3131..c512885076c 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1316,8 +1316,8 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1316#endif 1316#endif
1317 1317
1318#ifdef HAVE_NS 1318#ifdef HAVE_NS
1319 /* Initialise the locale from user defaults. */ 1319 /* Initialize the locale from user defaults. */
1320 ns_init_locale(); 1320 ns_init_locale ();
1321#endif 1321#endif
1322 1322
1323 /* Initialize and GC-protect Vinitial_environment and 1323 /* Initialize and GC-protect Vinitial_environment and
diff --git a/src/eval.c b/src/eval.c
index 6c912bc4762..26104a58277 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1245,7 +1245,7 @@ internal_lisp_condition_case (volatile Lisp_Object var, Lisp_Object bodyform,
1245 for (i = 0; i < clausenb; i++) 1245 for (i = 0; i < clausenb; i++)
1246 { 1246 {
1247 Lisp_Object clause = clauses[i]; 1247 Lisp_Object clause = clauses[i];
1248 Lisp_Object condition = XCAR (clause); 1248 Lisp_Object condition = CONSP (clause) ? XCAR (clause) : Qnil;
1249 if (!CONSP (condition)) 1249 if (!CONSP (condition))
1250 condition = Fcons (condition, Qnil); 1250 condition = Fcons (condition, Qnil);
1251 struct handler *c = push_handler (condition, CONDITION_CASE); 1251 struct handler *c = push_handler (condition, CONDITION_CASE);
diff --git a/src/keyboard.c b/src/keyboard.c
index baca4b56fb5..3431cd8fbd2 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3220,33 +3220,37 @@ record_char (Lisp_Object c)
3220 else 3220 else
3221 store_kbd_macro_char (c); 3221 store_kbd_macro_char (c);
3222 3222
3223 if (!recorded) 3223 /* recent_keys should not include events from keyboard macros. */
3224 { 3224 if (NILP (Vexecuting_kbd_macro))
3225 total_keys += total_keys < NUM_RECENT_KEYS;
3226 ASET (recent_keys, recent_keys_index, c);
3227 if (++recent_keys_index >= NUM_RECENT_KEYS)
3228 recent_keys_index = 0;
3229 }
3230 else if (recorded < 0)
3231 { 3225 {
3232 /* We need to remove one or two events from recent_keys. 3226 if (!recorded)
3233 To do this, we simply put nil at those events and move the
3234 recent_keys_index backwards over those events. Usually,
3235 users will never see those nil events, as they will be
3236 overwritten by the command keys entered to see recent_keys
3237 (e.g. C-h l). */
3238
3239 while (recorded++ < 0 && total_keys > 0)
3240 { 3227 {
3241 if (total_keys < NUM_RECENT_KEYS) 3228 total_keys += total_keys < NUM_RECENT_KEYS;
3242 total_keys--; 3229 ASET (recent_keys, recent_keys_index, c);
3243 if (--recent_keys_index < 0) 3230 if (++recent_keys_index >= NUM_RECENT_KEYS)
3244 recent_keys_index = NUM_RECENT_KEYS - 1; 3231 recent_keys_index = 0;
3245 ASET (recent_keys, recent_keys_index, Qnil); 3232 }
3233 else if (recorded < 0)
3234 {
3235 /* We need to remove one or two events from recent_keys.
3236 To do this, we simply put nil at those events and move the
3237 recent_keys_index backwards over those events. Usually,
3238 users will never see those nil events, as they will be
3239 overwritten by the command keys entered to see recent_keys
3240 (e.g. C-h l). */
3241
3242 while (recorded++ < 0 && total_keys > 0)
3243 {
3244 if (total_keys < NUM_RECENT_KEYS)
3245 total_keys--;
3246 if (--recent_keys_index < 0)
3247 recent_keys_index = NUM_RECENT_KEYS - 1;
3248 ASET (recent_keys, recent_keys_index, Qnil);
3249 }
3246 } 3250 }
3247 }
3248 3251
3249 num_nonmacro_input_events++; 3252 num_nonmacro_input_events++;
3253 }
3250 3254
3251 /* Write c to the dribble file. If c is a lispy event, write 3255 /* Write c to the dribble file. If c is a lispy event, write
3252 the event's symbol to the dribble file, in <brackets>. Bleaugh. 3256 the event's symbol to the dribble file, in <brackets>. Bleaugh.
diff --git a/src/lisp.h b/src/lisp.h
index 2221acd5827..8aa286159d7 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4526,6 +4526,12 @@ extern void *record_xmalloc (size_t) ATTRIBUTE_ALLOC_SIZE ((1));
4526 This feature is experimental and requires careful debugging. 4526 This feature is experimental and requires careful debugging.
4527 Build with CPPFLAGS='-DUSE_STACK_LISP_OBJECTS=0' to disable it. */ 4527 Build with CPPFLAGS='-DUSE_STACK_LISP_OBJECTS=0' to disable it. */
4528 4528
4529#if (!defined USE_STACK_LISP_OBJECTS \
4530 && defined __GNUC__ && !defined __clang__ \
4531 && !(4 < __GNUC__ + (3 < __GNUC_MINOR__ + (2 <= __GNUC_PATCHLEVEL__))))
4532 /* Work around GCC bugs 36584 and 35271, which were fixed in GCC 4.3.2. */
4533# define USE_STACK_LISP_OBJECTS false
4534#endif
4529#ifndef USE_STACK_LISP_OBJECTS 4535#ifndef USE_STACK_LISP_OBJECTS
4530# define USE_STACK_LISP_OBJECTS true 4536# define USE_STACK_LISP_OBJECTS true
4531#endif 4537#endif
diff --git a/src/w32heap.c b/src/w32heap.c
index 00da86a9598..69706a3a57d 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -652,15 +652,19 @@ mmap_alloc (void **var, size_t nbytes)
652 { 652 {
653 /* Now, commit pages for NBYTES. */ 653 /* Now, commit pages for NBYTES. */
654 *var = VirtualAlloc (p, nbytes, MEM_COMMIT, PAGE_READWRITE); 654 *var = VirtualAlloc (p, nbytes, MEM_COMMIT, PAGE_READWRITE);
655 if (*var == NULL)
656 p = *var;
655 } 657 }
656 658
657 if (!p) 659 if (!p)
658 { 660 {
659 if (GetLastError () == ERROR_NOT_ENOUGH_MEMORY) 661 DWORD e = GetLastError ();
662
663 if (e == ERROR_NOT_ENOUGH_MEMORY)
660 errno = ENOMEM; 664 errno = ENOMEM;
661 else 665 else
662 { 666 {
663 DebPrint (("mmap_alloc: error %ld\n", GetLastError ())); 667 DebPrint (("mmap_alloc: error %ld\n", e));
664 errno = EINVAL; 668 errno = EINVAL;
665 } 669 }
666 } 670 }
@@ -683,6 +687,7 @@ void *
683mmap_realloc (void **var, size_t nbytes) 687mmap_realloc (void **var, size_t nbytes)
684{ 688{
685 MEMORY_BASIC_INFORMATION memInfo, m2; 689 MEMORY_BASIC_INFORMATION memInfo, m2;
690 void *old_ptr;
686 691
687 if (*var == NULL) 692 if (*var == NULL)
688 return mmap_alloc (var, nbytes); 693 return mmap_alloc (var, nbytes);
@@ -694,12 +699,14 @@ mmap_realloc (void **var, size_t nbytes)
694 return mmap_alloc (var, nbytes); 699 return mmap_alloc (var, nbytes);
695 } 700 }
696 701
702 memset (&memInfo, 0, sizeof (memInfo));
697 if (VirtualQuery (*var, &memInfo, sizeof (memInfo)) == 0) 703 if (VirtualQuery (*var, &memInfo, sizeof (memInfo)) == 0)
698 DebPrint (("mmap_realloc: VirtualQuery error = %ld\n", GetLastError ())); 704 DebPrint (("mmap_realloc: VirtualQuery error = %ld\n", GetLastError ()));
699 705
700 /* We need to enlarge the block. */ 706 /* We need to enlarge the block. */
701 if (memInfo.RegionSize < nbytes) 707 if (memInfo.RegionSize < nbytes)
702 { 708 {
709 memset (&m2, 0, sizeof (m2));
703 if (VirtualQuery (*var + memInfo.RegionSize, &m2, sizeof(m2)) == 0) 710 if (VirtualQuery (*var + memInfo.RegionSize, &m2, sizeof(m2)) == 0)
704 DebPrint (("mmap_realloc: VirtualQuery error = %ld\n", 711 DebPrint (("mmap_realloc: VirtualQuery error = %ld\n",
705 GetLastError ())); 712 GetLastError ()));
@@ -715,31 +722,31 @@ mmap_realloc (void **var, size_t nbytes)
715 MEM_COMMIT, PAGE_READWRITE); 722 MEM_COMMIT, PAGE_READWRITE);
716 if (!p /* && GetLastError() != ERROR_NOT_ENOUGH_MEMORY */) 723 if (!p /* && GetLastError() != ERROR_NOT_ENOUGH_MEMORY */)
717 { 724 {
718 DebPrint (("realloc enlarge: VirtualAlloc error %ld\n", 725 DebPrint (("realloc enlarge: VirtualAlloc (%p + %I64x, %I64x) error %ld\n",
726 *var, (uint64_t)memInfo.RegionSize,
727 (uint64_t)(nbytes - memInfo.RegionSize),
719 GetLastError ())); 728 GetLastError ()));
720 errno = ENOMEM; 729 DebPrint (("next region: %p %p %I64x %x\n", m2.BaseAddress,
730 m2.AllocationBase, m2.RegionSize, m2.AllocationProtect));
721 } 731 }
732 else
733 return *var;
734 }
735 /* Else we must actually enlarge the block by allocating a new
736 one and copying previous contents from the old to the new one. */
737 old_ptr = *var;
738
739 if (mmap_alloc (var, nbytes))
740 {
741 CopyMemory (*var, old_ptr, memInfo.RegionSize);
742 mmap_free (&old_ptr);
722 return *var; 743 return *var;
723 } 744 }
724 else 745 else
725 { 746 {
726 /* Else we must actually enlarge the block by allocating a 747 /* We failed to reallocate the buffer. */
727 new one and copying previous contents from the old to the 748 *var = old_ptr;
728 new one. */ 749 return NULL;
729 void *old_ptr = *var;
730
731 if (mmap_alloc (var, nbytes))
732 {
733 CopyMemory (*var, old_ptr, memInfo.RegionSize);
734 mmap_free (&old_ptr);
735 return *var;
736 }
737 else
738 {
739 /* We failed to enlarge the buffer. */
740 *var = old_ptr;
741 return NULL;
742 }
743 } 750 }
744 } 751 }
745 752
@@ -751,7 +758,7 @@ mmap_realloc (void **var, size_t nbytes)
751 { 758 {
752 /* Let's give some memory back to the system and release 759 /* Let's give some memory back to the system and release
753 some pages. */ 760 some pages. */
754 void *old_ptr = *var; 761 old_ptr = *var;
755 762
756 if (mmap_alloc (var, nbytes)) 763 if (mmap_alloc (var, nbytes))
757 { 764 {
diff --git a/src/xdisp.c b/src/xdisp.c
index 840699d00fb..fed58799eaa 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -16920,7 +16920,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p)
16920 if (scroll_conservatively > SCROLL_LIMIT) 16920 if (scroll_conservatively > SCROLL_LIMIT)
16921 { 16921 {
16922 int window_total_lines 16922 int window_total_lines
16923 = WINDOW_TOTAL_LINES (w) * FRAME_LINE_HEIGHT (f) * frame_line_height; 16923 = WINDOW_TOTAL_LINES (w) * FRAME_LINE_HEIGHT (f) / frame_line_height;
16924 int margin = 16924 int margin =
16925 scroll_margin > 0 16925 scroll_margin > 0
16926 ? min (scroll_margin, window_total_lines / 4) 16926 ? min (scroll_margin, window_total_lines / 4)