aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorK. Handa2016-01-14 21:55:43 +0900
committerK. Handa2016-01-14 21:55:43 +0900
commit641a3472ef245157ebcb2114f2d608cb3cb401a7 (patch)
tree85e524c8d12caca29588382205f536b2008edc55 /src
parent9835757013569673854b692ccbb58bfb3c3ed1f7 (diff)
parentee83b77f5ddede0fed518d0c23cf0ae38ce5b745 (diff)
downloademacs-641a3472ef245157ebcb2114f2d608cb3cb401a7.tar.gz
emacs-641a3472ef245157ebcb2114f2d608cb3cb401a7.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit2
-rw-r--r--src/ChangeLog.12
-rw-r--r--src/ChangeLog.102
-rw-r--r--src/ChangeLog.112
-rw-r--r--src/ChangeLog.122
-rw-r--r--src/ChangeLog.132
-rw-r--r--src/ChangeLog.22
-rw-r--r--src/ChangeLog.32
-rw-r--r--src/ChangeLog.42
-rw-r--r--src/ChangeLog.52
-rw-r--r--src/ChangeLog.62
-rw-r--r--src/ChangeLog.72
-rw-r--r--src/ChangeLog.82
-rw-r--r--src/ChangeLog.92
-rw-r--r--src/Makefile.in2
-rw-r--r--src/README2
-rw-r--r--src/alloc.c66
-rw-r--r--src/atimer.c2
-rw-r--r--src/atimer.h2
-rw-r--r--src/bidi.c2
-rw-r--r--src/blockinput.h2
-rw-r--r--src/buffer.c15
-rw-r--r--src/buffer.h2
-rw-r--r--src/bytecode.c2
-rw-r--r--src/callint.c2
-rw-r--r--src/callproc.c2
-rw-r--r--src/casefiddle.c2
-rw-r--r--src/casetab.c2
-rw-r--r--src/category.c2
-rw-r--r--src/ccl.c2
-rw-r--r--src/character.c2
-rw-r--r--src/character.h2
-rw-r--r--src/charset.c2
-rw-r--r--src/charset.h2
-rw-r--r--src/cm.c2
-rw-r--r--src/cm.h2
-rw-r--r--src/cmds.c2
-rw-r--r--src/coding.c2
-rw-r--r--src/coding.h2
-rw-r--r--src/commands.h2
-rw-r--r--src/composite.c2
-rw-r--r--src/composite.h2
-rw-r--r--src/conf_post.h2
-rw-r--r--src/cygw32.c2
-rw-r--r--src/cygw32.h2
-rw-r--r--src/data.c2
-rw-r--r--src/dbusbind.c2
-rw-r--r--src/decompress.c2
-rw-r--r--src/deps.mk2
-rw-r--r--src/dired.c2
-rw-r--r--src/dispextern.h2
-rw-r--r--src/dispnew.c2
-rw-r--r--src/disptab.h2
-rw-r--r--src/doc.c2
-rw-r--r--src/doprnt.c2
-rw-r--r--src/dosfns.c2
-rw-r--r--src/dosfns.h2
-rw-r--r--src/dynlib.c2
-rw-r--r--src/dynlib.h2
-rw-r--r--src/editfns.c2
-rw-r--r--src/emacs-icon.h2
-rw-r--r--src/emacs-module.c8
-rw-r--r--src/emacs-module.h21
-rw-r--r--src/emacs.c2
-rw-r--r--src/emacsgtkfixed.c2
-rw-r--r--src/emacsgtkfixed.h2
-rw-r--r--src/epaths.in2
-rw-r--r--src/eval.c2
-rw-r--r--src/fileio.c2
-rw-r--r--src/filelock.c2
-rw-r--r--src/firstfile.c2
-rw-r--r--src/floatfns.c2
-rw-r--r--src/fns.c2
-rw-r--r--src/font.c2
-rw-r--r--src/font.h2
-rw-r--r--src/fontset.c2
-rw-r--r--src/fontset.h2
-rw-r--r--src/frame.c2
-rw-r--r--src/frame.h2
-rw-r--r--src/fringe.c2
-rw-r--r--src/ftcrfont.c2
-rw-r--r--src/ftfont.c2
-rw-r--r--src/ftxfont.c2
-rw-r--r--src/getpagesize.h2
-rw-r--r--src/gfilenotify.c2
-rw-r--r--src/gmalloc.c2
-rw-r--r--src/gnutls.c2
-rw-r--r--src/gnutls.h2
-rw-r--r--src/gtkutil.c43
-rw-r--r--src/gtkutil.h2
-rw-r--r--src/image.c2
-rw-r--r--src/indent.c11
-rw-r--r--src/indent.h2
-rw-r--r--src/inotify.c2
-rw-r--r--src/insdel.c2
-rw-r--r--src/intervals.c2
-rw-r--r--src/intervals.h2
-rw-r--r--src/keyboard.c7
-rw-r--r--src/keyboard.h4
-rw-r--r--src/keymap.c2
-rw-r--r--src/keymap.h2
-rw-r--r--src/kqueue.c3
-rw-r--r--src/lastfile.c2
-rw-r--r--src/lisp.h8
-rw-r--r--src/lread.c8
-rw-r--r--src/macfont.h2
-rw-r--r--src/macfont.m2
-rw-r--r--src/macros.c2
-rw-r--r--src/macros.h2
-rw-r--r--src/marker.c2
-rw-r--r--src/menu.c2
-rw-r--r--src/menu.h2
-rw-r--r--src/minibuf.c2
-rw-r--r--src/msdos.c2
-rw-r--r--src/msdos.h2
-rw-r--r--src/nsfns.m2
-rw-r--r--src/nsfont.m2
-rw-r--r--src/nsgui.h2
-rw-r--r--src/nsimage.m2
-rw-r--r--src/nsmenu.m2
-rw-r--r--src/nsselect.m2
-rw-r--r--src/nsterm.h2
-rw-r--r--src/nsterm.m37
-rw-r--r--src/print.c14
-rw-r--r--src/process.c2
-rw-r--r--src/process.h2
-rw-r--r--src/profiler.c2
-rw-r--r--src/puresize.h2
-rw-r--r--src/ralloc.c2
-rw-r--r--src/regex.c2
-rw-r--r--src/regex.h2
-rw-r--r--src/region-cache.c2
-rw-r--r--src/region-cache.h2
-rw-r--r--src/scroll.c2
-rw-r--r--src/search.c2
-rw-r--r--src/sheap.c2
-rw-r--r--src/sound.c2
-rw-r--r--src/syntax.c2
-rw-r--r--src/syntax.h2
-rw-r--r--src/sysdep.c2
-rw-r--r--src/sysselect.h2
-rw-r--r--src/syssignal.h2
-rw-r--r--src/sysstdio.h2
-rw-r--r--src/systime.h2
-rw-r--r--src/systty.h2
-rw-r--r--src/syswait.h2
-rw-r--r--src/term.c2
-rw-r--r--src/termcap.c2
-rw-r--r--src/termchar.h2
-rw-r--r--src/termhooks.h2
-rw-r--r--src/terminal.c2
-rw-r--r--src/terminfo.c2
-rw-r--r--src/termopts.h2
-rw-r--r--src/textprop.c2
-rw-r--r--src/tparam.c2
-rw-r--r--src/tparam.h2
-rw-r--r--src/undo.c2
-rw-r--r--src/unexaix.c2
-rw-r--r--src/unexcoff.c2
-rw-r--r--src/unexcw.c2
-rw-r--r--src/unexelf.c2
-rw-r--r--src/unexmacosx.c2
-rw-r--r--src/unexw32.c2
-rw-r--r--src/vm-limit.c2
-rw-r--r--src/w16select.c2
-rw-r--r--src/w32.c25
-rw-r--r--src/w32.h2
-rw-r--r--src/w32common.h2
-rw-r--r--src/w32console.c2
-rw-r--r--src/w32fns.c2
-rw-r--r--src/w32font.c2
-rw-r--r--src/w32font.h2
-rw-r--r--src/w32gui.h2
-rw-r--r--src/w32heap.c2
-rw-r--r--src/w32heap.h2
-rw-r--r--src/w32inevt.c2
-rw-r--r--src/w32inevt.h2
-rw-r--r--src/w32menu.c2
-rw-r--r--src/w32notify.c2
-rw-r--r--src/w32proc.c2
-rw-r--r--src/w32reg.c2
-rw-r--r--src/w32select.c2
-rw-r--r--src/w32select.h2
-rw-r--r--src/w32term.c2
-rw-r--r--src/w32term.h2
-rw-r--r--src/w32uniscribe.c2
-rw-r--r--src/w32xfns.c2
-rw-r--r--src/widget.c2
-rw-r--r--src/widget.h2
-rw-r--r--src/widgetprv.h2
-rw-r--r--src/window.c2
-rw-r--r--src/window.h2
-rw-r--r--src/xdisp.c27
-rw-r--r--src/xfaces.c2
-rw-r--r--src/xfns.c48
-rw-r--r--src/xfont.c2
-rw-r--r--src/xftfont.c2
-rw-r--r--src/xgselect.c2
-rw-r--r--src/xgselect.h2
-rw-r--r--src/xmenu.c2
-rw-r--r--src/xml.c2
-rw-r--r--src/xrdb.c2
-rw-r--r--src/xselect.c2
-rw-r--r--src/xsettings.c2
-rw-r--r--src/xsettings.h2
-rw-r--r--src/xsmfns.c2
-rw-r--r--src/xterm.c18
-rw-r--r--src/xterm.h2
208 files changed, 416 insertions, 329 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index 3b1004ccd9b..a4e9f709386 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -1,4 +1,4 @@
1# Copyright (C) 1992-1998, 2000-2015 Free Software Foundation, Inc. 1# Copyright (C) 1992-1998, 2000-2016 Free Software Foundation, Inc.
2# 2#
3# This file is part of GNU Emacs. 3# This file is part of GNU Emacs.
4# 4#
diff --git a/src/ChangeLog.1 b/src/ChangeLog.1
index 4b6ed3a987c..19cc3a29979 100644
--- a/src/ChangeLog.1
+++ b/src/ChangeLog.1
@@ -3521,7 +3521,7 @@
3521 * minibuf.c: Don't allow entry to minibuffer 3521 * minibuf.c: Don't allow entry to minibuffer
3522 while minibuffer is selected. 3522 while minibuffer is selected.
3523 3523
3524 Copyright (C) 1985-1986, 2001-2015 Free Software Foundation, Inc. 3524 Copyright (C) 1985-1986, 2001-2016 Free Software Foundation, Inc.
3525 3525
3526 This file is part of GNU Emacs. 3526 This file is part of GNU Emacs.
3527 3527
diff --git a/src/ChangeLog.10 b/src/ChangeLog.10
index 6eba7f06b9c..340f15e4d63 100644
--- a/src/ChangeLog.10
+++ b/src/ChangeLog.10
@@ -27912,7 +27912,7 @@ See ChangeLog.9 for earlier changes.
27912;; add-log-time-zone-rule: t 27912;; add-log-time-zone-rule: t
27913;; End: 27913;; End:
27914 27914
27915 Copyright (C) 2001-2015 Free Software Foundation, Inc. 27915 Copyright (C) 2001-2016 Free Software Foundation, Inc.
27916 27916
27917 This file is part of GNU Emacs. 27917 This file is part of GNU Emacs.
27918 27918
diff --git a/src/ChangeLog.11 b/src/ChangeLog.11
index 351f9785765..b93908b3ce8 100644
--- a/src/ChangeLog.11
+++ b/src/ChangeLog.11
@@ -31385,7 +31385,7 @@ See ChangeLog.10 for earlier changes.
31385;; coding: utf-8 31385;; coding: utf-8
31386;; End: 31386;; End:
31387 31387
31388 Copyright (C) 2007-2015 Free Software Foundation, Inc. 31388 Copyright (C) 2007-2016 Free Software Foundation, Inc.
31389 31389
31390 This file is part of GNU Emacs. 31390 This file is part of GNU Emacs.
31391 31391
diff --git a/src/ChangeLog.12 b/src/ChangeLog.12
index f29b175fb37..3045ecdca92 100644
--- a/src/ChangeLog.12
+++ b/src/ChangeLog.12
@@ -22936,7 +22936,7 @@ See ChangeLog.11 for earlier changes.
22936;; coding: utf-8 22936;; coding: utf-8
22937;; End: 22937;; End:
22938 22938
22939 Copyright (C) 2011-2015 Free Software Foundation, Inc. 22939 Copyright (C) 2011-2016 Free Software Foundation, Inc.
22940 22940
22941 This file is part of GNU Emacs. 22941 This file is part of GNU Emacs.
22942 22942
diff --git a/src/ChangeLog.13 b/src/ChangeLog.13
index fd68f5370ad..9e998952361 100644
--- a/src/ChangeLog.13
+++ b/src/ChangeLog.13
@@ -17905,7 +17905,7 @@ See ChangeLog.12 for earlier changes.
17905;; coding: utf-8 17905;; coding: utf-8
17906;; End: 17906;; End:
17907 17907
17908 Copyright (C) 2011-2015 Free Software Foundation, Inc. 17908 Copyright (C) 2011-2016 Free Software Foundation, Inc.
17909 17909
17910 This file is part of GNU Emacs. 17910 This file is part of GNU Emacs.
17911 17911
diff --git a/src/ChangeLog.2 b/src/ChangeLog.2
index f62f3bb5835..eccd24320d6 100644
--- a/src/ChangeLog.2
+++ b/src/ChangeLog.2
@@ -4771,7 +4771,7 @@
4771 4771
4772See ChangeLog.1 for earlier changes. 4772See ChangeLog.1 for earlier changes.
4773 4773
4774 Copyright (C) 1986-1988, 2001-2015 Free Software Foundation, Inc. 4774 Copyright (C) 1986-1988, 2001-2016 Free Software Foundation, Inc.
4775 4775
4776 This file is part of GNU Emacs. 4776 This file is part of GNU Emacs.
4777 4777
diff --git a/src/ChangeLog.3 b/src/ChangeLog.3
index 5e99a2764aa..a62aee7517b 100644
--- a/src/ChangeLog.3
+++ b/src/ChangeLog.3
@@ -16503,7 +16503,7 @@ See ChangeLog.2 for earlier changes.
16503;; coding: utf-8 16503;; coding: utf-8
16504;; End: 16504;; End:
16505 16505
16506 Copyright (C) 1993, 2001-2015 Free Software Foundation, Inc. 16506 Copyright (C) 1993, 2001-2016 Free Software Foundation, Inc.
16507 16507
16508 This file is part of GNU Emacs. 16508 This file is part of GNU Emacs.
16509 16509
diff --git a/src/ChangeLog.4 b/src/ChangeLog.4
index b621d75d378..4970cbdfe7d 100644
--- a/src/ChangeLog.4
+++ b/src/ChangeLog.4
@@ -6906,7 +6906,7 @@ See ChangeLog.3 for earlier changes.
6906;; coding: utf-8 6906;; coding: utf-8
6907;; End: 6907;; End:
6908 6908
6909 Copyright (C) 1993-1994, 2001-2015 Free Software Foundation, Inc. 6909 Copyright (C) 1993-1994, 2001-2016 Free Software Foundation, Inc.
6910 6910
6911 This file is part of GNU Emacs. 6911 This file is part of GNU Emacs.
6912 6912
diff --git a/src/ChangeLog.5 b/src/ChangeLog.5
index 0d1797ca1ce..9af8b80862b 100644
--- a/src/ChangeLog.5
+++ b/src/ChangeLog.5
@@ -7148,7 +7148,7 @@ See ChangeLog.4 for earlier changes.
7148;; coding: utf-8 7148;; coding: utf-8
7149;; End: 7149;; End:
7150 7150
7151 Copyright (C) 1994-1995, 2001-2015 Free Software Foundation, Inc. 7151 Copyright (C) 1994-1995, 2001-2016 Free Software Foundation, Inc.
7152 7152
7153 This file is part of GNU Emacs. 7153 This file is part of GNU Emacs.
7154 7154
diff --git a/src/ChangeLog.6 b/src/ChangeLog.6
index 5f73781c24e..ead1daf563a 100644
--- a/src/ChangeLog.6
+++ b/src/ChangeLog.6
@@ -5358,7 +5358,7 @@ See ChangeLog.5 for earlier changes.
5358;; coding: utf-8 5358;; coding: utf-8
5359;; End: 5359;; End:
5360 5360
5361 Copyright (C) 1995-1996, 2001-2015 Free Software Foundation, Inc. 5361 Copyright (C) 1995-1996, 2001-2016 Free Software Foundation, Inc.
5362 5362
5363 This file is part of GNU Emacs. 5363 This file is part of GNU Emacs.
5364 5364
diff --git a/src/ChangeLog.7 b/src/ChangeLog.7
index f603d53bb6a..f4d77a2c95e 100644
--- a/src/ChangeLog.7
+++ b/src/ChangeLog.7
@@ -11091,7 +11091,7 @@ See ChangeLog.6 for earlier changes.
11091;; coding: utf-8 11091;; coding: utf-8
11092;; End: 11092;; End:
11093 11093
11094 Copyright (C) 1997-1998, 2001-2015 Free Software Foundation, Inc. 11094 Copyright (C) 1997-1998, 2001-2016 Free Software Foundation, Inc.
11095 11095
11096 This file is part of GNU Emacs. 11096 This file is part of GNU Emacs.
11097 11097
diff --git a/src/ChangeLog.8 b/src/ChangeLog.8
index aa331eafc00..3d24b2db120 100644
--- a/src/ChangeLog.8
+++ b/src/ChangeLog.8
@@ -13979,7 +13979,7 @@
13979 13979
13980See ChangeLog.7 for earlier changes. 13980See ChangeLog.7 for earlier changes.
13981 13981
13982 Copyright (C) 1999, 2001-2015 Free Software Foundation, Inc. 13982 Copyright (C) 1999, 2001-2016 Free Software Foundation, Inc.
13983 13983
13984 This file is part of GNU Emacs. 13984 This file is part of GNU Emacs.
13985 13985
diff --git a/src/ChangeLog.9 b/src/ChangeLog.9
index 06ce3c1811c..c2e324a186f 100644
--- a/src/ChangeLog.9
+++ b/src/ChangeLog.9
@@ -13294,7 +13294,7 @@ See ChangeLog.8 for earlier changes.
13294;; coding: utf-8 13294;; coding: utf-8
13295;; End: 13295;; End:
13296 13296
13297 Copyright (C) 2001-2015 Free Software Foundation, Inc. 13297 Copyright (C) 2001-2016 Free Software Foundation, Inc.
13298 13298
13299 This file is part of GNU Emacs. 13299 This file is part of GNU Emacs.
13300 13300
diff --git a/src/Makefile.in b/src/Makefile.in
index 97505b98687..defce62c529 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,6 +1,6 @@
1### @configure_input@ 1### @configure_input@
2 2
3# Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2015 Free Software 3# Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2016 Free Software
4# Foundation, Inc. 4# Foundation, Inc.
5 5
6# This file is part of GNU Emacs. 6# This file is part of GNU Emacs.
diff --git a/src/README b/src/README
index adc782c10fc..5f1fec52e31 100644
--- a/src/README
+++ b/src/README
@@ -1,4 +1,4 @@
1Copyright (C) 2001-2015 Free Software Foundation, Inc. 1Copyright (C) 2001-2016 Free Software Foundation, Inc.
2See the end of the file for license conditions. 2See the end of the file for license conditions.
3 3
4 4
diff --git a/src/alloc.c b/src/alloc.c
index fe55cde49c9..03dacc77c6e 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1,6 +1,6 @@
1/* Storage allocation and gc for GNU Emacs Lisp interpreter. 1/* Storage allocation and gc for GNU Emacs Lisp interpreter.
2 2
3Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2015 Free Software 3Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2016 Free Software
4Foundation, Inc. 4Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
@@ -2119,8 +2119,11 @@ INIT must be an integer that represents a character. */)
2119 { 2119 {
2120 nbytes = XINT (length); 2120 nbytes = XINT (length);
2121 val = make_uninit_string (nbytes); 2121 val = make_uninit_string (nbytes);
2122 memset (SDATA (val), c, nbytes); 2122 if (nbytes)
2123 SDATA (val)[nbytes] = 0; 2123 {
2124 memset (SDATA (val), c, nbytes);
2125 SDATA (val)[nbytes] = 0;
2126 }
2124 } 2127 }
2125 else 2128 else
2126 { 2129 {
@@ -2145,7 +2148,8 @@ INIT must be an integer that represents a character. */)
2145 memcpy (p, beg, len); 2148 memcpy (p, beg, len);
2146 } 2149 }
2147 } 2150 }
2148 *p = 0; 2151 if (nbytes)
2152 *p = 0;
2149 } 2153 }
2150 2154
2151 return val; 2155 return val;
@@ -3188,7 +3192,8 @@ allocate_vector (EMACS_INT len)
3188 if (min ((nbytes_max - header_size) / word_size, MOST_POSITIVE_FIXNUM) < len) 3192 if (min ((nbytes_max - header_size) / word_size, MOST_POSITIVE_FIXNUM) < len)
3189 memory_full (SIZE_MAX); 3193 memory_full (SIZE_MAX);
3190 v = allocate_vectorlike (len); 3194 v = allocate_vectorlike (len);
3191 v->header.size = len; 3195 if (len)
3196 v->header.size = len;
3192 return v; 3197 return v;
3193} 3198}
3194 3199
@@ -3727,7 +3732,7 @@ make_event_array (ptrdiff_t nargs, Lisp_Object *args)
3727#ifdef HAVE_MODULES 3732#ifdef HAVE_MODULES
3728/* Create a new module user ptr object. */ 3733/* Create a new module user ptr object. */
3729Lisp_Object 3734Lisp_Object
3730make_user_ptr (void (*finalizer) (void*), void *p) 3735make_user_ptr (void (*finalizer) (void *), void *p)
3731{ 3736{
3732 Lisp_Object obj; 3737 Lisp_Object obj;
3733 struct Lisp_User_Ptr *uptr; 3738 struct Lisp_User_Ptr *uptr;
@@ -4589,6 +4594,10 @@ maybe_lisp_pointer (void *p)
4589 return (uintptr_t) p % GCALIGNMENT == 0; 4594 return (uintptr_t) p % GCALIGNMENT == 0;
4590} 4595}
4591 4596
4597#ifndef HAVE_MODULES
4598enum { HAVE_MODULES = false };
4599#endif
4600
4592/* If P points to Lisp data, mark that as live if it isn't already 4601/* If P points to Lisp data, mark that as live if it isn't already
4593 marked. */ 4602 marked. */
4594 4603
@@ -4602,8 +4611,17 @@ mark_maybe_pointer (void *p)
4602 VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p)); 4611 VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p));
4603#endif 4612#endif
4604 4613
4605 if (!maybe_lisp_pointer (p)) 4614 if (sizeof (Lisp_Object) == sizeof (void *) || !HAVE_MODULES)
4606 return; 4615 {
4616 if (!maybe_lisp_pointer (p))
4617 return;
4618 }
4619 else
4620 {
4621 /* For the wide-int case, also mark emacs_value tagged pointers,
4622 which can be generated by emacs-module.c's value_to_lisp. */
4623 p = (void *) ((uintptr_t) p & ~(GCALIGNMENT - 1));
4624 }
4607 4625
4608 m = mem_find (p); 4626 m = mem_find (p);
4609 if (m != MEM_NIL) 4627 if (m != MEM_NIL)
@@ -4680,8 +4698,7 @@ mark_maybe_pointer (void *p)
4680static void ATTRIBUTE_NO_SANITIZE_ADDRESS 4698static void ATTRIBUTE_NO_SANITIZE_ADDRESS
4681mark_memory (void *start, void *end) 4699mark_memory (void *start, void *end)
4682{ 4700{
4683 void **pp; 4701 char *pp;
4684 int i;
4685 4702
4686 /* Make START the pointer to the start of the memory region, 4703 /* Make START the pointer to the start of the memory region,
4687 if it isn't already. */ 4704 if it isn't already. */
@@ -4692,6 +4709,8 @@ mark_memory (void *start, void *end)
4692 end = tem; 4709 end = tem;
4693 } 4710 }
4694 4711
4712 eassert (((uintptr_t) start) % GC_POINTER_ALIGNMENT == 0);
4713
4695 /* Mark Lisp data pointed to. This is necessary because, in some 4714 /* Mark Lisp data pointed to. This is necessary because, in some
4696 situations, the C compiler optimizes Lisp objects away, so that 4715 situations, the C compiler optimizes Lisp objects away, so that
4697 only a pointer to them remains. Example: 4716 only a pointer to them remains. Example:
@@ -4710,13 +4729,11 @@ mark_memory (void *start, void *end)
4710 away. The only reference to the life string is through the 4729 away. The only reference to the life string is through the
4711 pointer `s'. */ 4730 pointer `s'. */
4712 4731
4713 for (pp = start; (void *) pp < end; pp++) 4732 for (pp = start; (void *) pp < end; pp += GC_POINTER_ALIGNMENT)
4714 for (i = 0; i < sizeof *pp; i += GC_POINTER_ALIGNMENT) 4733 {
4715 { 4734 mark_maybe_pointer (*(void **) pp);
4716 void *p = *(void **) ((char *) pp + i); 4735 mark_maybe_object (*(Lisp_Object *) pp);
4717 mark_maybe_pointer (p); 4736 }
4718 mark_maybe_object (XIL ((intptr_t) p));
4719 }
4720} 4737}
4721 4738
4722#if !defined GC_SAVE_REGISTERS_ON_STACK && !defined GC_SETJMP_WORKS 4739#if !defined GC_SAVE_REGISTERS_ON_STACK && !defined GC_SETJMP_WORKS
@@ -5508,9 +5525,16 @@ garbage_collect_1 (void *end)
5508 don't let that cause a recursive GC. */ 5525 don't let that cause a recursive GC. */
5509 consing_since_gc = 0; 5526 consing_since_gc = 0;
5510 5527
5511 /* Save what's currently displayed in the echo area. */ 5528 /* Save what's currently displayed in the echo area. Don't do that
5512 message_p = push_message (); 5529 if we are GC'ing because we've run out of memory, since
5513 record_unwind_protect_void (pop_message_unwind); 5530 push_message will cons, and we might have no memory for that. */
5531 if (NILP (Vmemory_full))
5532 {
5533 message_p = push_message ();
5534 record_unwind_protect_void (pop_message_unwind);
5535 }
5536 else
5537 message_p = false;
5514 5538
5515 /* Save a copy of the contents of the stack, for debugging. */ 5539 /* Save a copy of the contents of the stack, for debugging. */
5516#if MAX_SAVE_STACK > 0 5540#if MAX_SAVE_STACK > 0
@@ -5641,7 +5665,7 @@ garbage_collect_1 (void *end)
5641 } 5665 }
5642 } 5666 }
5643 5667
5644 if (garbage_collection_messages) 5668 if (garbage_collection_messages && NILP (Vmemory_full))
5645 { 5669 {
5646 if (message_p || minibuf_level > 0) 5670 if (message_p || minibuf_level > 0)
5647 restore_message (); 5671 restore_message ();
diff --git a/src/atimer.c b/src/atimer.c
index 976b990f5ff..801956082d9 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -1,5 +1,5 @@
1/* Asynchronous timers. 1/* Asynchronous timers.
2 Copyright (C) 2000-2015 Free Software Foundation, Inc. 2 Copyright (C) 2000-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/atimer.h b/src/atimer.h
index d08cd7fcb24..bebd156c832 100644
--- a/src/atimer.h
+++ b/src/atimer.h
@@ -1,5 +1,5 @@
1/* Asynchronous timers. 1/* Asynchronous timers.
2 Copyright (C) 2000-2015 Free Software Foundation, Inc. 2 Copyright (C) 2000-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/bidi.c b/src/bidi.c
index e3b1f549685..7f5d16b39ed 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -1,5 +1,5 @@
1/* Low-level bidirectional buffer/string-scanning functions for GNU Emacs. 1/* Low-level bidirectional buffer/string-scanning functions for GNU Emacs.
2 Copyright (C) 2000-2001, 2004-2005, 2009-2015 Free Software 2 Copyright (C) 2000-2001, 2004-2005, 2009-2016 Free Software
3 Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/blockinput.h b/src/blockinput.h
index b0dbdf22885..5b8bf64049a 100644
--- a/src/blockinput.h
+++ b/src/blockinput.h
@@ -1,5 +1,5 @@
1/* blockinput.h - interface to blocking complicated interrupt-driven input. 1/* blockinput.h - interface to blocking complicated interrupt-driven input.
2 Copyright (C) 1989, 1993, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1989, 1993, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/buffer.c b/src/buffer.c
index ab91aaa4e81..1468e7a2be1 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1,6 +1,6 @@
1/* Buffer manipulation primitives for GNU Emacs. 1/* Buffer manipulation primitives for GNU Emacs.
2 2
3Copyright (C) 1985-1989, 1993-1995, 1997-2015 Free Software Foundation, 3Copyright (C) 1985-1989, 1993-1995, 1997-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
@@ -1999,7 +1999,7 @@ the current buffer's major mode. */)
1999 /* To select a nonfundamental mode, 1999 /* To select a nonfundamental mode,
2000 select the buffer temporarily and then call the mode function. */ 2000 select the buffer temporarily and then call the mode function. */
2001 2001
2002 record_unwind_protect (save_excursion_restore, save_excursion_save ()); 2002 record_unwind_current_buffer ();
2003 2003
2004 Fset_buffer (buffer); 2004 Fset_buffer (buffer);
2005 call0 (function); 2005 call0 (function);
@@ -5803,11 +5803,14 @@ you probably should set this to -2 in that buffer. */);
5803 DEFVAR_PER_BUFFER ("selective-display", &BVAR (current_buffer, selective_display), 5803 DEFVAR_PER_BUFFER ("selective-display", &BVAR (current_buffer, selective_display),
5804 Qnil, 5804 Qnil,
5805 doc: /* Non-nil enables selective display. 5805 doc: /* Non-nil enables selective display.
5806
5806An integer N as value means display only lines 5807An integer N as value means display only lines
5807that start with less than N columns of space. 5808that start with less than N columns of space.
5809
5808A value of t means that the character ^M makes itself and 5810A value of t means that the character ^M makes itself and
5809all the rest of the line invisible; also, when saving the buffer 5811all the rest of the line invisible; also, when saving the buffer
5810in a file, save the ^M as a newline. */); 5812in a file, save the ^M as a newline. This usage is obsolete; use
5813overlays or text properties instead. */);
5811 5814
5812 DEFVAR_PER_BUFFER ("selective-display-ellipses", 5815 DEFVAR_PER_BUFFER ("selective-display-ellipses",
5813 &BVAR (current_buffer, selective_display_ellipses), 5816 &BVAR (current_buffer, selective_display_ellipses),
@@ -6201,11 +6204,11 @@ all windows or just the selected window.
6201 6204
6202Lisp programs may give this variable certain special values: 6205Lisp programs may give this variable certain special values:
6203 6206
6204- A value of `lambda' enables Transient Mark mode temporarily. 6207- The symbol `lambda' enables Transient Mark mode temporarily.
6205 It is disabled again after any subsequent action that would 6208 The mode is disabled again after any subsequent action that would
6206 normally deactivate the mark (e.g. buffer modification). 6209 normally deactivate the mark (e.g. buffer modification).
6207 6210
6208- A value of (only . OLDVAL) enables Transient Mark mode 6211- The pair (only . OLDVAL) enables Transient Mark mode
6209 temporarily. After any subsequent point motion command that is 6212 temporarily. After any subsequent point motion command that is
6210 not shift-translated, or any other action that would normally 6213 not shift-translated, or any other action that would normally
6211 deactivate the mark (e.g. buffer modification), the value of 6214 deactivate the mark (e.g. buffer modification), the value of
diff --git a/src/buffer.h b/src/buffer.h
index f80530a0cdb..5783bfb51ab 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -1,6 +1,6 @@
1/* Header file for the buffer manipulation primitives. 1/* Header file for the buffer manipulation primitives.
2 2
3Copyright (C) 1985-1986, 1993-1995, 1997-2015 Free Software Foundation, 3Copyright (C) 1985-1986, 1993-1995, 1997-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/bytecode.c b/src/bytecode.c
index 464adc633a8..0befe651418 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1,5 +1,5 @@
1/* Execution of byte code produced by bytecomp.el. 1/* Execution of byte code produced by bytecomp.el.
2 Copyright (C) 1985-1988, 1993, 2000-2015 Free Software Foundation, 2 Copyright (C) 1985-1988, 1993, 2000-2016 Free Software Foundation,
3 Inc. 3 Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/callint.c b/src/callint.c
index 76ee13e533e..3b23f222986 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -1,5 +1,5 @@
1/* Call a Lisp function interactively. 1/* Call a Lisp function interactively.
2 Copyright (C) 1985-1986, 1993-1995, 1997, 2000-2015 Free Software 2 Copyright (C) 1985-1986, 1993-1995, 1997, 2000-2016 Free Software
3 Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/callproc.c b/src/callproc.c
index bb21c35dccc..9ad7ef21e2f 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -1,6 +1,6 @@
1/* Synchronous subprocess invocation for GNU Emacs. 1/* Synchronous subprocess invocation for GNU Emacs.
2 2
3Copyright (C) 1985-1988, 1993-1995, 1999-2015 Free Software Foundation, 3Copyright (C) 1985-1988, 1993-1995, 1999-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 6a2983ef018..348215e532a 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -1,6 +1,6 @@
1/* GNU Emacs case conversion functions. 1/* GNU Emacs case conversion functions.
2 2
3Copyright (C) 1985, 1994, 1997-1999, 2001-2015 Free Software Foundation, 3Copyright (C) 1985, 1994, 1997-1999, 2001-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/casetab.c b/src/casetab.c
index 28da8850ec5..8327fbd4f12 100644
--- a/src/casetab.c
+++ b/src/casetab.c
@@ -1,5 +1,5 @@
1/* GNU Emacs routines to deal with case tables. 1/* GNU Emacs routines to deal with case tables.
2 Copyright (C) 1993-1994, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1993-1994, 2001-2016 Free Software Foundation, Inc.
3 3
4Author: Howard Gayle 4Author: Howard Gayle
5 5
diff --git a/src/category.c b/src/category.c
index 5c7cf0795d3..61502f85a0d 100644
--- a/src/category.c
+++ b/src/category.c
@@ -1,6 +1,6 @@
1/* GNU Emacs routines to deal with category tables. 1/* GNU Emacs routines to deal with category tables.
2 2
3Copyright (C) 1998, 2001-2015 Free Software Foundation, Inc. 3Copyright (C) 1998, 2001-2016 Free Software Foundation, Inc.
4Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
5 2005, 2006, 2007, 2008, 2009, 2010, 2011 5 2005, 2006, 2007, 2008, 2009, 2010, 2011
6 National Institute of Advanced Industrial Science and Technology (AIST) 6 National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/ccl.c b/src/ccl.c
index 9792717378d..8cfd9b5c8ee 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1,5 +1,5 @@
1/* CCL (Code Conversion Language) interpreter. 1/* CCL (Code Conversion Language) interpreter.
2 Copyright (C) 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 2001-2016 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005, 2006, 2007, 2008, 2009, 2010, 2011 4 2005, 2006, 2007, 2008, 2009, 2010, 2011
5 National Institute of Advanced Industrial Science and Technology (AIST) 5 National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/character.c b/src/character.c
index bc2fa4a12da..48187480df1 100644
--- a/src/character.c
+++ b/src/character.c
@@ -1,6 +1,6 @@
1/* Basic character support. 1/* Basic character support.
2 2
3Copyright (C) 2001-2015 Free Software Foundation, Inc. 3Copyright (C) 2001-2016 Free Software Foundation, Inc.
4Copyright (C) 1995, 1997, 1998, 2001 Electrotechnical Laboratory, JAPAN. 4Copyright (C) 1995, 1997, 1998, 2001 Electrotechnical Laboratory, JAPAN.
5 Licensed to the Free Software Foundation. 5 Licensed to the Free Software Foundation.
6Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 6Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
diff --git a/src/character.h b/src/character.h
index 871c1c3de95..440e78147d1 100644
--- a/src/character.h
+++ b/src/character.h
@@ -135,14 +135,12 @@ enum
135 do { \ 135 do { \
136 Lisp_Object tmp = XCAR (x); \ 136 Lisp_Object tmp = XCAR (x); \
137 CHECK_CHARACTER (tmp); \ 137 CHECK_CHARACTER (tmp); \
138 XSETCAR ((x), tmp); \
139 } while (false) 138 } while (false)
140 139
141#define CHECK_CHARACTER_CDR(x) \ 140#define CHECK_CHARACTER_CDR(x) \
142 do { \ 141 do { \
143 Lisp_Object tmp = XCDR (x); \ 142 Lisp_Object tmp = XCDR (x); \
144 CHECK_CHARACTER (tmp); \ 143 CHECK_CHARACTER (tmp); \
145 XSETCDR ((x), tmp); \
146 } while (false) 144 } while (false)
147 145
148/* Nonzero iff C is a character of code less than 0x100. */ 146/* Nonzero iff C is a character of code less than 0x100. */
diff --git a/src/charset.c b/src/charset.c
index 04e81bb0ff5..48e476813be 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1,6 +1,6 @@
1/* Basic character set support. 1/* Basic character set support.
2 2
3Copyright (C) 2001-2015 Free Software Foundation, Inc. 3Copyright (C) 2001-2016 Free Software Foundation, Inc.
4 4
5Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 5Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
6 2005, 2006, 2007, 2008, 2009, 2010, 2011 6 2005, 2006, 2007, 2008, 2009, 2010, 2011
diff --git a/src/charset.h b/src/charset.h
index d2daf2b7e29..a5c453262ae 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -1,5 +1,5 @@
1/* Header for charset handler. 1/* Header for charset handler.
2 Copyright (C) 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 2001-2016 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005, 2006, 2007, 2008, 2009, 2010, 2011 4 2005, 2006, 2007, 2008, 2009, 2010, 2011
5 National Institute of Advanced Industrial Science and Technology (AIST) 5 National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/cm.c b/src/cm.c
index f0aa56d6c2a..ec1545da2de 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -1,5 +1,5 @@
1/* Cursor motion subroutines for GNU Emacs. 1/* Cursor motion subroutines for GNU Emacs.
2 Copyright (C) 1985, 1995, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1995, 2001-2016 Free Software Foundation, Inc.
3 based primarily on public domain code written by Chris Torek 3 based primarily on public domain code written by Chris Torek
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/cm.h b/src/cm.h
index 1ade6d1782a..c109c473f8d 100644
--- a/src/cm.h
+++ b/src/cm.h
@@ -1,5 +1,5 @@
1/* Cursor motion calculation definitions for GNU Emacs 1/* Cursor motion calculation definitions for GNU Emacs
2 Copyright (C) 1985, 1989, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1989, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/cmds.c b/src/cmds.c
index 650b4628c32..34500031ba5 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -1,6 +1,6 @@
1/* Simple built-in editing commands. 1/* Simple built-in editing commands.
2 2
3Copyright (C) 1985, 1993-1998, 2001-2015 Free Software Foundation, Inc. 3Copyright (C) 1985, 1993-1998, 2001-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/coding.c b/src/coding.c
index 85b97ce6174..3bee16c4f0c 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1,5 +1,5 @@
1/* Coding system handler (conversion, detection, etc). 1/* Coding system handler (conversion, detection, etc).
2 Copyright (C) 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 2001-2016 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005, 2006, 2007, 2008, 2009, 2010, 2011 4 2005, 2006, 2007, 2008, 2009, 2010, 2011
5 National Institute of Advanced Industrial Science and Technology (AIST) 5 National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/coding.h b/src/coding.h
index 2bf51c48883..ea0cdd5329e 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -1,5 +1,5 @@
1/* Header for coding system handler. 1/* Header for coding system handler.
2 Copyright (C) 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 2001-2016 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005, 2006, 2007, 2008, 2009, 2010, 2011 4 2005, 2006, 2007, 2008, 2009, 2010, 2011
5 National Institute of Advanced Industrial Science and Technology (AIST) 5 National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/commands.h b/src/commands.h
index e9383341cc9..36ac00fba85 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -1,5 +1,5 @@
1/* Definitions needed by most editing commands. 1/* Definitions needed by most editing commands.
2 Copyright (C) 1985, 1994, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1994, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/composite.c b/src/composite.c
index 0f729bc5460..43c909fe98f 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1,5 +1,5 @@
1/* Composite sequence support. 1/* Composite sequence support.
2 Copyright (C) 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 2001-2016 Free Software Foundation, Inc.
3 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 3 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
4 National Institute of Advanced Industrial Science and Technology (AIST) 4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H14PRO021 5 Registration Number H14PRO021
diff --git a/src/composite.h b/src/composite.h
index fb9f9eb8655..1423feb92b2 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -1,5 +1,5 @@
1/* Header for composite sequence handler. 1/* Header for composite sequence handler.
2 Copyright (C) 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 2001-2016 Free Software Foundation, Inc.
3 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 3 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
4 National Institute of Advanced Industrial Science and Technology (AIST) 4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H14PRO021 5 Registration Number H14PRO021
diff --git a/src/conf_post.h b/src/conf_post.h
index b629e8d3df7..98ff12e5a53 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -1,6 +1,6 @@
1/* conf_post.h --- configure.ac includes this via AH_BOTTOM 1/* conf_post.h --- configure.ac includes this via AH_BOTTOM
2 2
3Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2015 Free Software 3Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2016 Free Software
4Foundation, Inc. 4Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/cygw32.c b/src/cygw32.c
index 03739b1ad23..422b04d5b9c 100644
--- a/src/cygw32.c
+++ b/src/cygw32.c
@@ -1,5 +1,5 @@
1/* Cygwin support routines. 1/* Cygwin support routines.
2 Copyright (C) 2011-2015 Free Software Foundation, Inc. 2 Copyright (C) 2011-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/cygw32.h b/src/cygw32.h
index e14e3d13b8c..58d8cd4a08e 100644
--- a/src/cygw32.h
+++ b/src/cygw32.h
@@ -1,5 +1,5 @@
1/* Header for Cygwin support routines. 1/* Header for Cygwin support routines.
2 Copyright (C) 2011-2015 Free Software Foundation, Inc. 2 Copyright (C) 2011-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/data.c b/src/data.c
index 1e9cc814f00..07f87241917 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1,5 +1,5 @@
1/* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter. 1/* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter.
2 Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2015 Free Software 2 Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2016 Free Software
3 Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/dbusbind.c b/src/dbusbind.c
index ce0465dcb8b..5148c3267dc 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -1,5 +1,5 @@
1/* Elisp bindings for D-Bus. 1/* Elisp bindings for D-Bus.
2 Copyright (C) 2007-2015 Free Software Foundation, Inc. 2 Copyright (C) 2007-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/decompress.c b/src/decompress.c
index d0c0018eb26..8fb71b0379f 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -1,5 +1,5 @@
1/* Interface to zlib. 1/* Interface to zlib.
2 Copyright (C) 2013-2015 Free Software Foundation, Inc. 2 Copyright (C) 2013-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/deps.mk b/src/deps.mk
index 23789384fdb..0295e705a9c 100644
--- a/src/deps.mk
+++ b/src/deps.mk
@@ -1,6 +1,6 @@
1### deps.mk --- src/Makefile fragment for GNU Emacs 1### deps.mk --- src/Makefile fragment for GNU Emacs
2 2
3## Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2015 Free Software 3## Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2016 Free Software
4## Foundation, Inc. 4## Foundation, Inc.
5 5
6## This file is part of GNU Emacs. 6## This file is part of GNU Emacs.
diff --git a/src/dired.c b/src/dired.c
index 6c34dfdfcb0..97fefaefffd 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -1,5 +1,5 @@
1/* Lisp functions for making directory listings. 1/* Lisp functions for making directory listings.
2 Copyright (C) 1985-1986, 1993-1994, 1999-2015 Free Software 2 Copyright (C) 1985-1986, 1993-1994, 1999-2016 Free Software
3 Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/dispextern.h b/src/dispextern.h
index e44b70bf562..bb876f5af70 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1,6 +1,6 @@
1/* Interface definitions for display code. 1/* Interface definitions for display code.
2 2
3Copyright (C) 1985, 1993-1994, 1997-2015 Free Software Foundation, Inc. 3Copyright (C) 1985, 1993-1994, 1997-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/dispnew.c b/src/dispnew.c
index 1d30eee2082..8d671f82e47 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -1,6 +1,6 @@
1/* Updating of data structures for redisplay. 1/* Updating of data structures for redisplay.
2 2
3Copyright (C) 1985-1988, 1993-1995, 1997-2015 Free Software Foundation, 3Copyright (C) 1985-1988, 1993-1995, 1997-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/disptab.h b/src/disptab.h
index 3a319c4d217..211b649398a 100644
--- a/src/disptab.h
+++ b/src/disptab.h
@@ -1,5 +1,5 @@
1/* Things for GLYPHS and glyph tables. 1/* Things for GLYPHS and glyph tables.
2 Copyright (C) 1993, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1993, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/doc.c b/src/doc.c
index 6c2a3e52a2e..a9273f05809 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -1,6 +1,6 @@
1/* Record indices of function doc strings stored in a file. -*- coding: utf-8 -*- 1/* Record indices of function doc strings stored in a file. -*- coding: utf-8 -*-
2 2
3Copyright (C) 1985-1986, 1993-1995, 1997-2015 Free Software Foundation, 3Copyright (C) 1985-1986, 1993-1995, 1997-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/doprnt.c b/src/doprnt.c
index 55f249f5d72..b0b92bf7ba7 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -1,7 +1,7 @@
1/* Output like sprintf to a buffer of specified size. -*- coding: utf-8 -*- 1/* Output like sprintf to a buffer of specified size. -*- coding: utf-8 -*-
2 Also takes args differently: pass one pointer to the end 2 Also takes args differently: pass one pointer to the end
3 of the format string in addition to the format string itself. 3 of the format string in addition to the format string itself.
4 Copyright (C) 1985, 2001-2015 Free Software Foundation, Inc. 4 Copyright (C) 1985, 2001-2016 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
diff --git a/src/dosfns.c b/src/dosfns.c
index e506e9fbe14..f507f4121ec 100644
--- a/src/dosfns.c
+++ b/src/dosfns.c
@@ -1,6 +1,6 @@
1/* MS-DOS specific Lisp utilities. Coded by Manabu Higashida, 1991. 1/* MS-DOS specific Lisp utilities. Coded by Manabu Higashida, 1991.
2 Major changes May-July 1993 Morten Welinder (only 10% original code left) 2 Major changes May-July 1993 Morten Welinder (only 10% original code left)
3 Copyright (C) 1991, 1993, 1996-1998, 2001-2015 Free Software 3 Copyright (C) 1991, 1993, 1996-1998, 2001-2016 Free Software
4 Foundation, Inc. 4 Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/dosfns.h b/src/dosfns.h
index 1c0d2f755f2..fa45d710a68 100644
--- a/src/dosfns.h
+++ b/src/dosfns.h
@@ -2,7 +2,7 @@
2 Coded by Manabu Higashida, 1991. 2 Coded by Manabu Higashida, 1991.
3 Modified by Morten Welinder, 1993-1994. 3 Modified by Morten Welinder, 1993-1994.
4 4
5Copyright (C) 1991, 1994-1995, 1997, 1999, 2001-2015 Free Software 5Copyright (C) 1991, 1994-1995, 1997, 1999, 2001-2016 Free Software
6Foundation, Inc. 6Foundation, Inc.
7 7
8This file is part of GNU Emacs. 8This file is part of GNU Emacs.
diff --git a/src/dynlib.c b/src/dynlib.c
index 190f183fa61..c4647e6fc1f 100644
--- a/src/dynlib.c
+++ b/src/dynlib.c
@@ -1,6 +1,6 @@
1/* Portable API for dynamic loading. 1/* Portable API for dynamic loading.
2 2
3Copyright 2015 Free Software Foundation, Inc. 3Copyright 2015-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/dynlib.h b/src/dynlib.h
index 1c19b5db8ac..33b6d60d474 100644
--- a/src/dynlib.h
+++ b/src/dynlib.h
@@ -1,6 +1,6 @@
1/* Portable API for dynamic loading. 1/* Portable API for dynamic loading.
2 2
3Copyright 2015 Free Software Foundation, Inc. 3Copyright 2015-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/editfns.c b/src/editfns.c
index 316d9408065..bd70f0a6859 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1,6 +1,6 @@
1/* Lisp functions pertaining to editing. -*- coding: utf-8 -*- 1/* Lisp functions pertaining to editing. -*- coding: utf-8 -*-
2 2
3Copyright (C) 1985-1987, 1989, 1993-2015 Free Software Foundation, Inc. 3Copyright (C) 1985-1987, 1989, 1993-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/emacs-icon.h b/src/emacs-icon.h
index ed4e8709901..2f0806c607f 100644
--- a/src/emacs-icon.h
+++ b/src/emacs-icon.h
@@ -1,7 +1,7 @@
1/* XPM */ 1/* XPM */
2/* Emacs icon 2/* Emacs icon
3 3
4Copyright (C) 2008-2015 Free Software Foundation, Inc. 4Copyright (C) 2008-2016 Free Software Foundation, Inc.
5 5
6Author: Kentaro Ohkouchi <nanasess@fsm.ne.jp> 6Author: Kentaro Ohkouchi <nanasess@fsm.ne.jp>
7 7
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 881ee3119de..b5e044e758f 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -1,6 +1,6 @@
1/* emacs-module.c - Module loading and runtime implementation 1/* emacs-module.c - Module loading and runtime implementation
2 2
3Copyright (C) 2015 Free Software Foundation, Inc. 3Copyright (C) 2015-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -65,6 +65,12 @@ enum
65 && INTPTR_MAX == EMACS_INT_MAX) 65 && INTPTR_MAX == EMACS_INT_MAX)
66 }; 66 };
67 67
68/* Function prototype for module user-pointer finalizers. These
69 should not throw C++ exceptions, so emacs-module.h declares the
70 corresponding interfaces with EMACS_NOEXCEPT. There is only C code
71 in this module, though, so this constraint is not enforced here. */
72typedef void (*emacs_finalizer_function) (void *);
73
68 74
69/* Private runtime and environment members. */ 75/* Private runtime and environment members. */
70 76
diff --git a/src/emacs-module.h b/src/emacs-module.h
index a3aa5017a4e..575966ea7b5 100644
--- a/src/emacs-module.h
+++ b/src/emacs-module.h
@@ -1,6 +1,6 @@
1/* emacs-module.h - GNU Emacs module API. 1/* emacs-module.h - GNU Emacs module API.
2 2
3Copyright (C) 2015 Free Software Foundation, Inc. 3Copyright (C) 2015-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -26,19 +26,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26 26
27#if defined __cplusplus && __cplusplus >= 201103L 27#if defined __cplusplus && __cplusplus >= 201103L
28# define EMACS_NOEXCEPT noexcept 28# define EMACS_NOEXCEPT noexcept
29
30/* Function prototype for module user-pointer finalizers.
31
32 NOTE: C++11 15.4: An exception-specification shall not appear in a
33 typedef declaration or alias-declaration.
34
35*/
36void emacs_dummy_finalizer_function (void *) noexcept;
37typedef decltype(emacs_dummy_finalizer_function) *emacs_finalizer_function;
38
39#else 29#else
40# define EMACS_NOEXCEPT 30# define EMACS_NOEXCEPT
41typedef void (*emacs_finalizer_function) (void *);
42#endif 31#endif
43 32
44#ifdef __cplusplus 33#ifdef __cplusplus
@@ -184,17 +173,17 @@ struct emacs_env_25
184 173
185 /* Embedded pointer type. */ 174 /* Embedded pointer type. */
186 emacs_value (*make_user_ptr) (emacs_env *env, 175 emacs_value (*make_user_ptr) (emacs_env *env,
187 emacs_finalizer_function fin, 176 void (*fin) (void *) EMACS_NOEXCEPT,
188 void *ptr); 177 void *ptr);
189 178
190 void *(*get_user_ptr) (emacs_env *env, emacs_value uptr); 179 void *(*get_user_ptr) (emacs_env *env, emacs_value uptr);
191 void (*set_user_ptr) (emacs_env *env, emacs_value uptr, void *ptr); 180 void (*set_user_ptr) (emacs_env *env, emacs_value uptr, void *ptr);
192 181
193 emacs_finalizer_function (*get_user_finalizer) (emacs_env *env, 182 void (*(*get_user_finalizer) (emacs_env *env, emacs_value uptr))
194 emacs_value uptr); 183 (void *) EMACS_NOEXCEPT;
195 void (*set_user_finalizer) (emacs_env *env, 184 void (*set_user_finalizer) (emacs_env *env,
196 emacs_value uptr, 185 emacs_value uptr,
197 emacs_finalizer_function fin); 186 void (*fin) (void *) EMACS_NOEXCEPT);
198 187
199 /* Vector functions. */ 188 /* Vector functions. */
200 emacs_value (*vec_get) (emacs_env *env, emacs_value vec, ptrdiff_t i); 189 emacs_value (*vec_get) (emacs_env *env, emacs_value vec, ptrdiff_t i);
diff --git a/src/emacs.c b/src/emacs.c
index d13413d880b..aaf058e4a80 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1,6 +1,6 @@
1/* Fully extensible Emacs, running on Unix, intended for GNU. 1/* Fully extensible Emacs, running on Unix, intended for GNU.
2 2
3Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2015 Free Software 3Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2016 Free Software
4Foundation, Inc. 4Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c
index abec78fb073..cdcaf803ba5 100644
--- a/src/emacsgtkfixed.c
+++ b/src/emacsgtkfixed.c
@@ -1,7 +1,7 @@
1/* A Gtk Widget that inherits GtkFixed, but can be shrunk. 1/* A Gtk Widget that inherits GtkFixed, but can be shrunk.
2This file is only use when compiling with Gtk+ 3. 2This file is only use when compiling with Gtk+ 3.
3 3
4Copyright (C) 2011-2015 Free Software Foundation, Inc. 4Copyright (C) 2011-2016 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
diff --git a/src/emacsgtkfixed.h b/src/emacsgtkfixed.h
index a969a6d265b..73280b83e57 100644
--- a/src/emacsgtkfixed.h
+++ b/src/emacsgtkfixed.h
@@ -1,7 +1,7 @@
1/* A Gtk Widget that inherits GtkFixed, but can be shrunk. 1/* A Gtk Widget that inherits GtkFixed, but can be shrunk.
2This file is only use when compiling with Gtk+ 3. 2This file is only use when compiling with Gtk+ 3.
3 3
4Copyright (C) 2011-2015 Free Software Foundation, Inc. 4Copyright (C) 2011-2016 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
diff --git a/src/epaths.in b/src/epaths.in
index 66718fd8f74..5b7a2bb58ad 100644
--- a/src/epaths.in
+++ b/src/epaths.in
@@ -1,6 +1,6 @@
1/* Hey Emacs, this is -*- C -*- code! */ 1/* Hey Emacs, this is -*- C -*- code! */
2/* 2/*
3Copyright (C) 1993, 1995, 1997, 1999, 2001-2015 Free Software 3Copyright (C) 1993, 1995, 1997, 1999, 2001-2016 Free Software
4Foundation, Inc. 4Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/eval.c b/src/eval.c
index bd0cf68369c..6c912bc4762 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1,6 +1,6 @@
1/* Evaluator for GNU Emacs Lisp interpreter. 1/* Evaluator for GNU Emacs Lisp interpreter.
2 2
3Copyright (C) 1985-1987, 1993-1995, 1999-2015 Free Software Foundation, 3Copyright (C) 1985-1987, 1993-1995, 1999-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/fileio.c b/src/fileio.c
index e18ddb1a7aa..f185f38bd01 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1,6 +1,6 @@
1/* File IO for GNU Emacs. 1/* File IO for GNU Emacs.
2 2
3Copyright (C) 1985-1988, 1993-2015 Free Software Foundation, Inc. 3Copyright (C) 1985-1988, 1993-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/filelock.c b/src/filelock.c
index 7f9b6e7f8e8..1b32b931107 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -1,6 +1,6 @@
1/* Lock files for editing. 1/* Lock files for editing.
2 2
3Copyright (C) 1985-1987, 1993-1994, 1996, 1998-2015 Free Software 3Copyright (C) 1985-1987, 1993-1994, 1996, 1998-2016 Free Software
4Foundation, Inc. 4Foundation, Inc.
5 5
6Author: Richard King 6Author: Richard King
diff --git a/src/firstfile.c b/src/firstfile.c
index aa587924505..68effeb1106 100644
--- a/src/firstfile.c
+++ b/src/firstfile.c
@@ -1,5 +1,5 @@
1/* Mark beginning of data space to dump as pure, for GNU Emacs. 1/* Mark beginning of data space to dump as pure, for GNU Emacs.
2 Copyright (C) 1997, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1997, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/floatfns.c b/src/floatfns.c
index 46eb85ff8ca..cf485b6fcea 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -1,6 +1,6 @@
1/* Primitive operations on floating point for GNU Emacs Lisp interpreter. 1/* Primitive operations on floating point for GNU Emacs Lisp interpreter.
2 2
3Copyright (C) 1988, 1993-1994, 1999, 2001-2015 Free Software Foundation, 3Copyright (C) 1988, 1993-1994, 1999, 2001-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6Author: Wolfgang Rupprecht 6Author: Wolfgang Rupprecht
diff --git a/src/fns.c b/src/fns.c
index 4c13290158a..977229b97b7 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1,6 +1,6 @@
1/* Random utility Lisp functions. 1/* Random utility Lisp functions.
2 2
3Copyright (C) 1985-1987, 1993-1995, 1997-2015 Free Software Foundation, 3Copyright (C) 1985-1987, 1993-1995, 1997-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/font.c b/src/font.c
index 6fa599524c9..039493bcbea 100644
--- a/src/font.c
+++ b/src/font.c
@@ -1,6 +1,6 @@
1/* font.c -- "Font" primitives. 1/* font.c -- "Font" primitives.
2 2
3Copyright (C) 2006-2015 Free Software Foundation, Inc. 3Copyright (C) 2006-2016 Free Software Foundation, Inc.
4Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 4Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
5 National Institute of Advanced Industrial Science and Technology (AIST) 5 National Institute of Advanced Industrial Science and Technology (AIST)
6 Registration Number H13PRO009 6 Registration Number H13PRO009
diff --git a/src/font.h b/src/font.h
index 3f4ccb106c2..36fe51ad319 100644
--- a/src/font.h
+++ b/src/font.h
@@ -1,5 +1,5 @@
1/* font.h -- Interface definition for font handling. 1/* font.h -- Interface definition for font handling.
2 Copyright (C) 2006-2015 Free Software Foundation, Inc. 2 Copyright (C) 2006-2016 Free Software Foundation, Inc.
3 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 3 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
4 National Institute of Advanced Industrial Science and Technology (AIST) 4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H13PRO009 5 Registration Number H13PRO009
diff --git a/src/fontset.c b/src/fontset.c
index 0f89b71ff68..2bc9bb1fcd9 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1,6 +1,6 @@
1/* Fontset handler. 1/* Fontset handler.
2 2
3Copyright (C) 2001-2015 Free Software Foundation, Inc. 3Copyright (C) 2001-2016 Free Software Foundation, Inc.
4Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
5 2005, 2006, 2007, 2008, 2009, 2010, 2011 5 2005, 2006, 2007, 2008, 2009, 2010, 2011
6 National Institute of Advanced Industrial Science and Technology (AIST) 6 National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/fontset.h b/src/fontset.h
index aa69051fc05..048a7d463f7 100644
--- a/src/fontset.h
+++ b/src/fontset.h
@@ -1,5 +1,5 @@
1/* Header for fontset handler. 1/* Header for fontset handler.
2 Copyright (C) 1998, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1998, 2001-2016 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005, 2006, 2007, 2008, 2009, 2010, 2011 4 2005, 2006, 2007, 2008, 2009, 2010, 2011
5 National Institute of Advanced Industrial Science and Technology (AIST) 5 National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/frame.c b/src/frame.c
index 4897052e1f9..8c86afe4efb 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1,6 +1,6 @@
1/* Generic frame functions. 1/* Generic frame functions.
2 2
3Copyright (C) 1993-1995, 1997, 1999-2015 Free Software Foundation, Inc. 3Copyright (C) 1993-1995, 1997, 1999-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/frame.h b/src/frame.h
index e7d3aab119a..71dab4b1cb1 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1,5 +1,5 @@
1/* Define frame-object for GNU Emacs. 1/* Define frame-object for GNU Emacs.
2 Copyright (C) 1993-1994, 1999-2015 Free Software Foundation, Inc. 2 Copyright (C) 1993-1994, 1999-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/fringe.c b/src/fringe.c
index 632fa0b25d4..597c666d3bc 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -1,5 +1,5 @@
1/* Fringe handling (split from xdisp.c). 1/* Fringe handling (split from xdisp.c).
2 Copyright (C) 1985-1988, 1993-1995, 1997-2015 Free Software 2 Copyright (C) 1985-1988, 1993-1995, 1997-2016 Free Software
3 Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/ftcrfont.c b/src/ftcrfont.c
index 4326b775c8f..f7b1e7d26a6 100644
--- a/src/ftcrfont.c
+++ b/src/ftcrfont.c
@@ -1,5 +1,5 @@
1/* ftcrfont.c -- FreeType font driver on cairo. 1/* ftcrfont.c -- FreeType font driver on cairo.
2 Copyright (C) 2015 Free Software Foundation, Inc. 2 Copyright (C) 2015-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/ftfont.c b/src/ftfont.c
index c10f4f90c73..505d508d2e0 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -1,5 +1,5 @@
1/* ftfont.c -- FreeType font driver. 1/* ftfont.c -- FreeType font driver.
2 Copyright (C) 2006-2015 Free Software Foundation, Inc. 2 Copyright (C) 2006-2016 Free Software Foundation, Inc.
3 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 3 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
4 National Institute of Advanced Industrial Science and Technology (AIST) 4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H13PRO009 5 Registration Number H13PRO009
diff --git a/src/ftxfont.c b/src/ftxfont.c
index 99b06f2b49c..adf0d29f8ca 100644
--- a/src/ftxfont.c
+++ b/src/ftxfont.c
@@ -1,5 +1,5 @@
1/* ftxfont.c -- FreeType font driver on X (without using XFT). 1/* ftxfont.c -- FreeType font driver on X (without using XFT).
2 Copyright (C) 2006-2015 Free Software Foundation, Inc. 2 Copyright (C) 2006-2016 Free Software Foundation, Inc.
3 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 3 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
4 National Institute of Advanced Industrial Science and Technology (AIST) 4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H13PRO009 5 Registration Number H13PRO009
diff --git a/src/getpagesize.h b/src/getpagesize.h
index 75dd99f4c27..e46415344e8 100644
--- a/src/getpagesize.h
+++ b/src/getpagesize.h
@@ -1,5 +1,5 @@
1/* Emulate getpagesize on systems that lack it. 1/* Emulate getpagesize on systems that lack it.
2 Copyright (C) 1986, 1992, 1995, 2001-2015 Free Software Foundation, 2 Copyright (C) 1986, 1992, 1995, 2001-2016 Free Software Foundation,
3 Inc. 3 Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/gfilenotify.c b/src/gfilenotify.c
index 8660f415e2f..62b4efb0a3d 100644
--- a/src/gfilenotify.c
+++ b/src/gfilenotify.c
@@ -1,5 +1,5 @@
1/* Filesystem notifications support with glib API. 1/* Filesystem notifications support with glib API.
2 Copyright (C) 2013-2015 Free Software Foundation, Inc. 2 Copyright (C) 2013-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/gmalloc.c b/src/gmalloc.c
index 90a52a1c728..00b83641319 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -1,5 +1,5 @@
1/* Declarations for `malloc' and friends. 1/* Declarations for `malloc' and friends.
2 Copyright (C) 1990-1993, 1995-1996, 1999, 2002-2007, 2013-2015 Free 2 Copyright (C) 1990-1993, 1995-1996, 1999, 2002-2007, 2013-2016 Free
3 Software Foundation, Inc. 3 Software Foundation, Inc.
4 Written May 1989 by Mike Haertel. 4 Written May 1989 by Mike Haertel.
5 5
diff --git a/src/gnutls.c b/src/gnutls.c
index 0c69b0001ee..a1d058fcd48 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -1,5 +1,5 @@
1/* GnuTLS glue for GNU Emacs. 1/* GnuTLS glue for GNU Emacs.
2 Copyright (C) 2010-2015 Free Software Foundation, Inc. 2 Copyright (C) 2010-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/gnutls.h b/src/gnutls.h
index 9c804b8bd59..c4fe738bfa0 100644
--- a/src/gnutls.h
+++ b/src/gnutls.h
@@ -1,5 +1,5 @@
1/* GnuTLS glue for GNU Emacs. 1/* GnuTLS glue for GNU Emacs.
2 Copyright (C) 2010-2015 Free Software Foundation, Inc. 2 Copyright (C) 2010-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 90683eba7b8..768df342983 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1,6 +1,6 @@
1/* Functions for creating and updating GTK widgets. 1/* Functions for creating and updating GTK widgets.
2 2
3Copyright (C) 2003-2015 Free Software Foundation, Inc. 3Copyright (C) 2003-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -4084,31 +4084,11 @@ xg_page_setup_dialog (void)
4084Lisp_Object 4084Lisp_Object
4085xg_get_page_setup (void) 4085xg_get_page_setup (void)
4086{ 4086{
4087 Lisp_Object result, orientation_symbol;
4088 GtkPageOrientation orientation; 4087 GtkPageOrientation orientation;
4088 Lisp_Object orientation_symbol;
4089 4089
4090 if (page_setup == NULL) 4090 if (page_setup == NULL)
4091 page_setup = gtk_page_setup_new (); 4091 page_setup = gtk_page_setup_new ();
4092 result = list4 (Fcons (Qleft_margin,
4093 make_float (gtk_page_setup_get_left_margin (page_setup,
4094 GTK_UNIT_POINTS))),
4095 Fcons (Qright_margin,
4096 make_float (gtk_page_setup_get_right_margin (page_setup,
4097 GTK_UNIT_POINTS))),
4098 Fcons (Qtop_margin,
4099 make_float (gtk_page_setup_get_top_margin (page_setup,
4100 GTK_UNIT_POINTS))),
4101 Fcons (Qbottom_margin,
4102 make_float (gtk_page_setup_get_bottom_margin (page_setup,
4103 GTK_UNIT_POINTS))));
4104 result = Fcons (Fcons (Qheight,
4105 make_float (gtk_page_setup_get_page_height (page_setup,
4106 GTK_UNIT_POINTS))),
4107 result);
4108 result = Fcons (Fcons (Qwidth,
4109 make_float (gtk_page_setup_get_page_width (page_setup,
4110 GTK_UNIT_POINTS))),
4111 result);
4112 orientation = gtk_page_setup_get_orientation (page_setup); 4092 orientation = gtk_page_setup_get_orientation (page_setup);
4113 if (orientation == GTK_PAGE_ORIENTATION_PORTRAIT) 4093 if (orientation == GTK_PAGE_ORIENTATION_PORTRAIT)
4114 orientation_symbol = Qportrait; 4094 orientation_symbol = Qportrait;
@@ -4118,9 +4098,24 @@ xg_get_page_setup (void)
4118 orientation_symbol = Qreverse_portrait; 4098 orientation_symbol = Qreverse_portrait;
4119 else if (orientation == GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE) 4099 else if (orientation == GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE)
4120 orientation_symbol = Qreverse_landscape; 4100 orientation_symbol = Qreverse_landscape;
4121 result = Fcons (Fcons (Qorientation, orientation_symbol), result);
4122 4101
4123 return result; 4102 return listn (CONSTYPE_HEAP, 7,
4103 Fcons (Qorientation, orientation_symbol),
4104#define MAKE_FLOAT_PAGE_SETUP(f) make_float (f (page_setup, GTK_UNIT_POINTS))
4105 Fcons (Qwidth,
4106 MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_page_width)),
4107 Fcons (Qheight,
4108 MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_page_height)),
4109 Fcons (Qleft_margin,
4110 MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_left_margin)),
4111 Fcons (Qright_margin,
4112 MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_right_margin)),
4113 Fcons (Qtop_margin,
4114 MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_top_margin)),
4115 Fcons (Qbottom_margin,
4116 MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_bottom_margin))
4117#undef MAKE_FLOAT_PAGE_SETUP
4118 );
4124} 4119}
4125 4120
4126static void 4121static void
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 0dbb4a1cdc6..ff22e3c2210 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -1,6 +1,6 @@
1/* Definitions and headers for GTK widgets. 1/* Definitions and headers for GTK widgets.
2 2
3Copyright (C) 2003-2015 Free Software Foundation, Inc. 3Copyright (C) 2003-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/image.c b/src/image.c
index 544435eac0b..8bb5ff77b22 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1,6 +1,6 @@
1/* Functions for image support on window system. 1/* Functions for image support on window system.
2 2
3Copyright (C) 1989, 1992-2015 Free Software Foundation, Inc. 3Copyright (C) 1989, 1992-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/indent.c b/src/indent.c
index 33bf424b344..ee2e9c6fb71 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1,5 +1,5 @@
1/* Indentation functions. 1/* Indentation functions.
2 Copyright (C) 1985-1988, 1993-1995, 1998, 2000-2015 Free Software 2 Copyright (C) 1985-1988, 1993-1995, 1998, 2000-2016 Free Software
3 Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -2130,6 +2130,15 @@ whether or not it is currently displayed in some window. */)
2130 && it.method == GET_FROM_BUFFER 2130 && it.method == GET_FROM_BUFFER
2131 && it.c == '\n') 2131 && it.c == '\n')
2132 it_overshoot_count = 1; 2132 it_overshoot_count = 1;
2133 else if (it_overshoot_count == 1 && it.vpos == 0
2134 && it.current_x < it.last_visible_x)
2135 {
2136 /* If we came to the same screen line as the one where
2137 we started, we didn't overshoot the line, and won't
2138 need to backtrack after all. This happens, for
2139 example, when PT is in the middle of a composition. */
2140 it_overshoot_count = 0;
2141 }
2133 else if (disp_string_at_start_p && it.vpos > 0) 2142 else if (disp_string_at_start_p && it.vpos > 0)
2134 { 2143 {
2135 /* This is the case of a display string that spans 2144 /* This is the case of a display string that spans
diff --git a/src/indent.h b/src/indent.h
index 037fd744521..804c47d8293 100644
--- a/src/indent.h
+++ b/src/indent.h
@@ -1,5 +1,5 @@
1/* Definitions for interface to indent.c 1/* Definitions for interface to indent.c
2 Copyright (C) 1985-1986, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1985-1986, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/inotify.c b/src/inotify.c
index 6577ee28cd1..e0619e584f7 100644
--- a/src/inotify.c
+++ b/src/inotify.c
@@ -1,6 +1,6 @@
1/* Inotify support for Emacs 1/* Inotify support for Emacs
2 2
3Copyright (C) 2012-2015 Free Software Foundation, Inc. 3Copyright (C) 2012-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/insdel.c b/src/insdel.c
index bb3171b14ce..f0a4dcd784e 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1,5 +1,5 @@
1/* Buffer insertion/deletion and gap motion for GNU Emacs. 1/* Buffer insertion/deletion and gap motion for GNU Emacs.
2 Copyright (C) 1985-1986, 1993-1995, 1997-2015 Free Software 2 Copyright (C) 1985-1986, 1993-1995, 1997-2016 Free Software
3 Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/intervals.c b/src/intervals.c
index c272bae027d..29cc403933c 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1,5 +1,5 @@
1/* Code for doing intervals. 1/* Code for doing intervals.
2 Copyright (C) 1993-1995, 1997-1998, 2001-2015 Free Software 2 Copyright (C) 1993-1995, 1997-1998, 2001-2016 Free Software
3 Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/intervals.h b/src/intervals.h
index 96e82055e9c..2b68d4ef9d6 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -1,5 +1,5 @@
1/* Definitions and global variables for intervals. 1/* Definitions and global variables for intervals.
2 Copyright (C) 1993-1994, 2000-2015 Free Software Foundation, Inc. 2 Copyright (C) 1993-1994, 2000-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/keyboard.c b/src/keyboard.c
index eb2c7563afd..c3aa76af518 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1,6 +1,6 @@
1/* Keyboard and mouse input; editor command loop. 1/* Keyboard and mouse input; editor command loop.
2 2
3Copyright (C) 1985-1989, 1993-1997, 1999-2015 Free Software Foundation, 3Copyright (C) 1985-1989, 1993-1997, 1999-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
@@ -7124,6 +7124,9 @@ struct user_signal_info
7124/* List of user signals. */ 7124/* List of user signals. */
7125static struct user_signal_info *user_signals = NULL; 7125static struct user_signal_info *user_signals = NULL;
7126 7126
7127/* Function called when handling user signals. */
7128void (*handle_user_signal_hook) (int);
7129
7127void 7130void
7128add_user_signal (int sig, const char *name) 7131add_user_signal (int sig, const char *name)
7129{ 7132{
@@ -7172,6 +7175,8 @@ handle_user_signal (int sig)
7172 } 7175 }
7173 7176
7174 p->npending++; 7177 p->npending++;
7178 if (handle_user_signal_hook)
7179 (*handle_user_signal_hook) (sig);
7175#ifdef USABLE_SIGIO 7180#ifdef USABLE_SIGIO
7176 if (interrupt_input) 7181 if (interrupt_input)
7177 handle_input_available_signal (sig); 7182 handle_input_available_signal (sig);
diff --git a/src/keyboard.h b/src/keyboard.h
index 890d24eb2d9..55667bfb17c 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -1,5 +1,5 @@
1/* Declarations useful when processing input. 1/* Declarations useful when processing input.
2 Copyright (C) 1985-1987, 1993, 2001-2015 Free Software Foundation, 2 Copyright (C) 1985-1987, 1993, 2001-2016 Free Software Foundation,
3 Inc. 3 Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -415,6 +415,8 @@ extern void unuse_menu_items (void);
415#define EVENT_HEAD_KIND(event_head) \ 415#define EVENT_HEAD_KIND(event_head) \
416 (Fget ((event_head), Qevent_kind)) 416 (Fget ((event_head), Qevent_kind))
417 417
418extern void (*handle_user_signal_hook) (int);
419
418/* True while doing kbd input. */ 420/* True while doing kbd input. */
419extern bool waiting_for_input; 421extern bool waiting_for_input;
420 422
diff --git a/src/keymap.c b/src/keymap.c
index 67a4a1075d9..7928e62ea44 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1,5 +1,5 @@
1/* Manipulation of keymaps 1/* Manipulation of keymaps
2 Copyright (C) 1985-1988, 1993-1995, 1998-2015 Free Software 2 Copyright (C) 1985-1988, 1993-1995, 1998-2016 Free Software
3 Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/keymap.h b/src/keymap.h
index e7a3b0a2436..009aa01ee30 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -1,5 +1,5 @@
1/* Functions to manipulate keymaps. 1/* Functions to manipulate keymaps.
2 Copyright (C) 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/kqueue.c b/src/kqueue.c
index e0ee5fb9d7b..a69d06da3ae 100644
--- a/src/kqueue.c
+++ b/src/kqueue.c
@@ -1,5 +1,6 @@
1/* Filesystem notifications support with kqueue API. 1/* Filesystem notifications support with kqueue API.
2 Copyright (C) 2015 Free Software Foundation, Inc. 2
3Copyright (C) 2015-2016 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/lastfile.c b/src/lastfile.c
index 1c8e1f33b5c..2d0bcc76b8f 100644
--- a/src/lastfile.c
+++ b/src/lastfile.c
@@ -1,5 +1,5 @@
1/* Mark end of data space to dump as pure, for GNU Emacs. 1/* Mark end of data space to dump as pure, for GNU Emacs.
2 Copyright (C) 1985, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1985, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/lisp.h b/src/lisp.h
index ff88605fc9f..02b8078a9fd 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1,6 +1,6 @@
1/* Fundamental definitions for GNU Emacs Lisp interpreter. -*- coding: utf-8 -*- 1/* Fundamental definitions for GNU Emacs Lisp interpreter. -*- coding: utf-8 -*-
2 2
3Copyright (C) 1985-1987, 1993-1995, 1997-2015 Free Software Foundation, 3Copyright (C) 1985-1987, 1993-1995, 1997-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
@@ -1325,7 +1325,7 @@ STRING_MULTIBYTE (Lisp_Object str)
1325/* Mark STR as a unibyte string. */ 1325/* Mark STR as a unibyte string. */
1326#define STRING_SET_UNIBYTE(STR) \ 1326#define STRING_SET_UNIBYTE(STR) \
1327 do { \ 1327 do { \
1328 if (EQ (STR, empty_multibyte_string)) \ 1328 if (XSTRING (STR)->size == 0) \
1329 (STR) = empty_unibyte_string; \ 1329 (STR) = empty_unibyte_string; \
1330 else \ 1330 else \
1331 XSTRING (STR)->size_byte = -1; \ 1331 XSTRING (STR)->size_byte = -1; \
@@ -1335,7 +1335,7 @@ STRING_MULTIBYTE (Lisp_Object str)
1335 ASCII characters in advance. */ 1335 ASCII characters in advance. */
1336#define STRING_SET_MULTIBYTE(STR) \ 1336#define STRING_SET_MULTIBYTE(STR) \
1337 do { \ 1337 do { \
1338 if (EQ (STR, empty_unibyte_string)) \ 1338 if (XSTRING (STR)->size == 0) \
1339 (STR) = empty_multibyte_string; \ 1339 (STR) = empty_multibyte_string; \
1340 else \ 1340 else \
1341 XSTRING (STR)->size_byte = XSTRING (STR)->size; \ 1341 XSTRING (STR)->size_byte = XSTRING (STR)->size; \
@@ -3927,7 +3927,7 @@ extern bool let_shadows_global_binding_p (Lisp_Object symbol);
3927 3927
3928#ifdef HAVE_MODULES 3928#ifdef HAVE_MODULES
3929/* Defined in alloc.c. */ 3929/* Defined in alloc.c. */
3930extern Lisp_Object make_user_ptr (void (*finalizer) (void*), void *p); 3930extern Lisp_Object make_user_ptr (void (*finalizer) (void *), void *p);
3931 3931
3932/* Defined in emacs-module.c. */ 3932/* Defined in emacs-module.c. */
3933extern void module_init (void); 3933extern void module_init (void);
diff --git a/src/lread.c b/src/lread.c
index 74a5fdfe67b..25e3ff01d47 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1,6 +1,6 @@
1/* Lisp parsing and input streams. 1/* Lisp parsing and input streams.
2 2
3Copyright (C) 1985-1989, 1993-1995, 1997-2015 Free Software Foundation, 3Copyright (C) 1985-1989, 1993-1995, 1997-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
@@ -3720,7 +3720,11 @@ static size_t oblookup_last_bucket_number;
3720Lisp_Object 3720Lisp_Object
3721check_obarray (Lisp_Object obarray) 3721check_obarray (Lisp_Object obarray)
3722{ 3722{
3723 if (!VECTORP (obarray) || ASIZE (obarray) == 0) 3723 /* We don't want to signal a wrong-type-argument error when we are
3724 shutting down due to a fatal error, and we don't want to hit
3725 assertions in VECTORP and ASIZE if the fatal error was during GC. */
3726 if (!fatal_error_in_progress
3727 && (!VECTORP (obarray) || ASIZE (obarray) == 0))
3724 { 3728 {
3725 /* If Vobarray is now invalid, force it to be valid. */ 3729 /* If Vobarray is now invalid, force it to be valid. */
3726 if (EQ (Vobarray, obarray)) Vobarray = initial_obarray; 3730 if (EQ (Vobarray, obarray)) Vobarray = initial_obarray;
diff --git a/src/macfont.h b/src/macfont.h
index cab57372abb..587f10a0ce0 100644
--- a/src/macfont.h
+++ b/src/macfont.h
@@ -1,5 +1,5 @@
1/* Interface definition for Mac OSX Core text font backend. 1/* Interface definition for Mac OSX Core text font backend.
2 Copyright (C) 2009-2015 Free Software Foundation, Inc. 2 Copyright (C) 2009-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/macfont.m b/src/macfont.m
index 3023fbea78c..45830e0ff8a 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -1,5 +1,5 @@
1/* Font driver on Mac OSX Core text. 1/* Font driver on Mac OSX Core text.
2 Copyright (C) 2009-2015 Free Software Foundation, Inc. 2 Copyright (C) 2009-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/macros.c b/src/macros.c
index 7c6ab2efc30..289f22bcd41 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -1,6 +1,6 @@
1/* Keyboard macros. 1/* Keyboard macros.
2 2
3Copyright (C) 1985-1986, 1993, 2000-2015 Free Software Foundation, Inc. 3Copyright (C) 1985-1986, 1993, 2000-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/macros.h b/src/macros.h
index 46150ad73ae..3a0c57e0469 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -1,5 +1,5 @@
1/* Definitions for keyboard macro interpretation in GNU Emacs. 1/* Definitions for keyboard macro interpretation in GNU Emacs.
2 Copyright (C) 1985, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1985, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/marker.c b/src/marker.c
index 73928ba194f..9f53e9a34ec 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -1,5 +1,5 @@
1/* Markers: examining, setting and deleting. 1/* Markers: examining, setting and deleting.
2 Copyright (C) 1985, 1997-1998, 2001-2015 Free Software Foundation, 2 Copyright (C) 1985, 1997-1998, 2001-2016 Free Software Foundation,
3 Inc. 3 Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/menu.c b/src/menu.c
index 74df43f6ce9..caae228a259 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1,6 +1,6 @@
1/* Platform-independent code for terminal communications. 1/* Platform-independent code for terminal communications.
2 2
3Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2015 Free Software 3Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2016 Free Software
4Foundation, Inc. 4Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/menu.h b/src/menu.h
index e89e93ec8eb..95d2fe5e037 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -1,5 +1,5 @@
1/* Functions to manipulate menus. 1/* Functions to manipulate menus.
2 Copyright (C) 2008-2015 Free Software Foundation, Inc. 2 Copyright (C) 2008-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/minibuf.c b/src/minibuf.c
index 727a70b166f..180668f042d 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1,6 +1,6 @@
1/* Minibuffer input and completion. 1/* Minibuffer input and completion.
2 2
3Copyright (C) 1985-1986, 1993-2015 Free Software Foundation, Inc. 3Copyright (C) 1985-1986, 1993-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/msdos.c b/src/msdos.c
index 8b05b34795d..b378cc260a6 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1,6 +1,6 @@
1/* MS-DOS specific C utilities. -*- coding: cp850 -*- 1/* MS-DOS specific C utilities. -*- coding: cp850 -*-
2 2
3Copyright (C) 1993-1997, 1999-2015 Free Software Foundation, Inc. 3Copyright (C) 1993-1997, 1999-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/msdos.h b/src/msdos.h
index 1e37599d75f..691822f3127 100644
--- a/src/msdos.h
+++ b/src/msdos.h
@@ -1,5 +1,5 @@
1/* MS-DOS specific C utilities, interface. 1/* MS-DOS specific C utilities, interface.
2 Copyright (C) 1993, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1993, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/nsfns.m b/src/nsfns.m
index 5fa68c0a15c..eda94c430fd 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1,6 +1,6 @@
1/* Functions for the NeXT/Open/GNUstep and MacOSX window system. 1/* Functions for the NeXT/Open/GNUstep and MacOSX window system.
2 2
3Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2015 Free Software 3Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2016 Free Software
4Foundation, Inc. 4Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/nsfont.m b/src/nsfont.m
index 3d278c0f2fb..b46680b87ce 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -1,6 +1,6 @@
1/* Font back-end driver for the NeXT/Open/GNUstep and MacOSX window system. 1/* Font back-end driver for the NeXT/Open/GNUstep and MacOSX window system.
2 See font.h 2 See font.h
3 Copyright (C) 2006-2015 Free Software Foundation, Inc. 3 Copyright (C) 2006-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/nsgui.h b/src/nsgui.h
index 498eb7f87f5..cc2e45e3da7 100644
--- a/src/nsgui.h
+++ b/src/nsgui.h
@@ -1,5 +1,5 @@
1/* Definitions and headers for communication on the NeXT/Open/GNUstep API. 1/* Definitions and headers for communication on the NeXT/Open/GNUstep API.
2 Copyright (C) 1995, 2005, 2008-2015 Free Software Foundation, Inc. 2 Copyright (C) 1995, 2005, 2008-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/nsimage.m b/src/nsimage.m
index fad2538a0cb..b87144870db 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -1,5 +1,5 @@
1/* Image support for the NeXT/Open/GNUstep and MacOSX window system. 1/* Image support for the NeXT/Open/GNUstep and MacOSX window system.
2 Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2015 Free Software 2 Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2016 Free Software
3 Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/nsmenu.m b/src/nsmenu.m
index 3cb61e50f7f..c6d683536ba 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -1,5 +1,5 @@
1/* NeXT/Open/GNUstep and MacOSX Cocoa menu and toolbar module. 1/* NeXT/Open/GNUstep and MacOSX Cocoa menu and toolbar module.
2 Copyright (C) 2007-2015 Free Software Foundation, Inc. 2 Copyright (C) 2007-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/nsselect.m b/src/nsselect.m
index 5579cc5a767..463f02bf5ef 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -1,5 +1,5 @@
1/* NeXT/Open/GNUstep / MacOSX Cocoa selection processing for emacs. 1/* NeXT/Open/GNUstep / MacOSX Cocoa selection processing for emacs.
2 Copyright (C) 1993-1994, 2005-2006, 2008-2015 Free Software 2 Copyright (C) 1993-1994, 2005-2006, 2008-2016 Free Software
3 Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/nsterm.h b/src/nsterm.h
index 7e6e8efc478..6ca584e6774 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -1,5 +1,5 @@
1/* Definitions and headers for communication with NeXT/Open/GNUstep API. 1/* Definitions and headers for communication with NeXT/Open/GNUstep API.
2 Copyright (C) 1989, 1993, 2005, 2008-2015 Free Software Foundation, 2 Copyright (C) 1989, 1993, 2005, 2008-2016 Free Software Foundation,
3 Inc. 3 Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/nsterm.m b/src/nsterm.m
index 36e08c60575..b270e0e58b5 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1,6 +1,6 @@
1/* NeXT/Open/GNUstep / MacOSX communication module. -*- coding: utf-8 -*- 1/* NeXT/Open/GNUstep / MacOSX communication module. -*- coding: utf-8 -*-
2 2
3Copyright (C) 1989, 1993-1994, 2005-2006, 2008-2015 Free Software 3Copyright (C) 1989, 1993-1994, 2005-2006, 2008-2016 Free Software
4Foundation, Inc. 4Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
@@ -1150,9 +1150,11 @@ ns_clip_to_row (struct window *w, struct glyph_row *row,
1150{ 1150{
1151 // Number of currently active bell:s. 1151 // Number of currently active bell:s.
1152 unsigned int nestCount; 1152 unsigned int nestCount;
1153 bool isAttached;
1153} 1154}
1154- (void)show:(NSView *)view; 1155- (void)show:(NSView *)view;
1155- (void)hide; 1156- (void)hide;
1157- (void)remove;
1156@end 1158@end
1157 1159
1158@implementation EmacsBell 1160@implementation EmacsBell
@@ -1162,6 +1164,7 @@ ns_clip_to_row (struct window *w, struct glyph_row *row,
1162 if ((self = [super init])) 1164 if ((self = [super init]))
1163 { 1165 {
1164 nestCount = 0; 1166 nestCount = 0;
1167 isAttached = false;
1165 self.image = [NSImage imageNamed:NSImageNameCaution]; 1168 self.image = [NSImage imageNamed:NSImageNameCaution];
1166 } 1169 }
1167 return self; 1170 return self;
@@ -1183,6 +1186,7 @@ ns_clip_to_row (struct window *w, struct glyph_row *row,
1183 [self setFrameOrigin:pos]; 1186 [self setFrameOrigin:pos];
1184 [self setFrameSize:self.image.size]; 1187 [self setFrameSize:self.image.size];
1185 1188
1189 isAttached = true;
1186 [[[view window] contentView] addSubview:self 1190 [[[view window] contentView] addSubview:self
1187 positioned:NSWindowAbove 1191 positioned:NSWindowAbove
1188 relativeTo:nil]; 1192 relativeTo:nil];
@@ -1199,17 +1203,31 @@ ns_clip_to_row (struct window *w, struct glyph_row *row,
1199 // Note: Trace output from this method isn't shown, reason unknown. 1203 // Note: Trace output from this method isn't shown, reason unknown.
1200 // NSTRACE ("[EmacsBell hide]"); 1204 // NSTRACE ("[EmacsBell hide]");
1201 1205
1202 --nestCount; 1206 if (nestCount > 0)
1207 --nestCount;
1203 1208
1204 // Remove the image once the last bell became inactive. 1209 // Remove the image once the last bell became inactive.
1205 if (nestCount == 0) 1210 if (nestCount == 0)
1206 { 1211 {
1212 [self remove];
1213 }
1214}
1215
1216
1217-(void)remove
1218{
1219 if (isAttached)
1220 {
1207 [self removeFromSuperview]; 1221 [self removeFromSuperview];
1222 isAttached = false;
1208 } 1223 }
1209} 1224}
1210 1225
1211@end 1226@end
1212 1227
1228
1229static EmacsBell * bell_view = nil;
1230
1213static void 1231static void
1214ns_ring_bell (struct frame *f) 1232ns_ring_bell (struct frame *f)
1215/* -------------------------------------------------------------------------- 1233/* --------------------------------------------------------------------------
@@ -1222,7 +1240,6 @@ ns_ring_bell (struct frame *f)
1222 struct frame *frame = SELECTED_FRAME (); 1240 struct frame *frame = SELECTED_FRAME ();
1223 NSView *view; 1241 NSView *view;
1224 1242
1225 static EmacsBell * bell_view = nil;
1226 if (bell_view == nil) 1243 if (bell_view == nil)
1227 { 1244 {
1228 bell_view = [[EmacsBell alloc] init]; 1245 bell_view = [[EmacsBell alloc] init];
@@ -1246,6 +1263,18 @@ ns_ring_bell (struct frame *f)
1246} 1263}
1247 1264
1248 1265
1266static void hide_bell ()
1267/* --------------------------------------------------------------------------
1268 Ensure the bell is hidden.
1269 -------------------------------------------------------------------------- */
1270{
1271 if (bell_view != nil)
1272 {
1273 [bell_view remove];
1274 }
1275}
1276
1277
1249/* ========================================================================== 1278/* ==========================================================================
1250 1279
1251 Frame / window manager related functions 1280 Frame / window manager related functions
@@ -2328,6 +2357,8 @@ ns_copy_bits (struct frame *f, NSRect src, NSRect dest)
2328{ 2357{
2329 if (FRAME_NS_VIEW (f)) 2358 if (FRAME_NS_VIEW (f))
2330 { 2359 {
2360 hide_bell(); // Ensure the bell image isn't scrolled.
2361
2331 ns_focus (f, &dest, 1); 2362 ns_focus (f, &dest, 1);
2332 [FRAME_NS_VIEW (f) scrollRect: src 2363 [FRAME_NS_VIEW (f) scrollRect: src
2333 by: NSMakeSize (dest.origin.x - src.origin.x, 2364 by: NSMakeSize (dest.origin.x - src.origin.x,
diff --git a/src/print.c b/src/print.c
index 420e6f55b4c..269d8f250e2 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1,6 +1,6 @@
1/* Lisp object printing and output streams. 1/* Lisp object printing and output streams.
2 2
3Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2015 Free Software 3Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2016 Free Software
4Foundation, Inc. 4Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
@@ -200,6 +200,13 @@ printchar_to_stream (unsigned int ch, FILE *stream)
200{ 200{
201 Lisp_Object dv IF_LINT (= Qnil); 201 Lisp_Object dv IF_LINT (= Qnil);
202 ptrdiff_t i = 0, n = 1; 202 ptrdiff_t i = 0, n = 1;
203 Lisp_Object coding_system = Vlocale_coding_system;
204 bool encode_p = false;
205
206 if (!NILP (Vcoding_system_for_write))
207 coding_system = Vcoding_system_for_write;
208 if (!NILP (coding_system))
209 encode_p = true;
203 210
204 if (CHAR_VALID_P (ch) && DISP_TABLE_P (Vstandard_display_table)) 211 if (CHAR_VALID_P (ch) && DISP_TABLE_P (Vstandard_display_table))
205 { 212 {
@@ -228,8 +235,11 @@ printchar_to_stream (unsigned int ch, FILE *stream)
228 unsigned char mbstr[MAX_MULTIBYTE_LENGTH]; 235 unsigned char mbstr[MAX_MULTIBYTE_LENGTH];
229 int len = CHAR_STRING (ch, mbstr); 236 int len = CHAR_STRING (ch, mbstr);
230 Lisp_Object encoded_ch = 237 Lisp_Object encoded_ch =
231 ENCODE_SYSTEM (make_multibyte_string ((char *) mbstr, 1, len)); 238 make_multibyte_string ((char *) mbstr, 1, len);
232 239
240 if (encode_p)
241 encoded_ch = code_convert_string_norecord (encoded_ch,
242 coding_system, true);
233 fwrite (SSDATA (encoded_ch), 1, SBYTES (encoded_ch), stream); 243 fwrite (SSDATA (encoded_ch), 1, SBYTES (encoded_ch), stream);
234#ifdef WINDOWSNT 244#ifdef WINDOWSNT
235 if (print_output_debug_flag && stream == stderr) 245 if (print_output_debug_flag && stream == stderr)
diff --git a/src/process.c b/src/process.c
index ed1d59d01b0..e1ebdff7430 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1,6 +1,6 @@
1/* Asynchronous subprocess control for GNU Emacs. 1/* Asynchronous subprocess control for GNU Emacs.
2 2
3Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2015 Free Software 3Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2016 Free Software
4Foundation, Inc. 4Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/process.h b/src/process.h
index 9ee5a05ebd2..8d9f8f4c072 100644
--- a/src/process.h
+++ b/src/process.h
@@ -1,5 +1,5 @@
1/* Definitions for asynchronous process control in GNU Emacs. 1/* Definitions for asynchronous process control in GNU Emacs.
2 Copyright (C) 1985, 1994, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1994, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/profiler.c b/src/profiler.c
index efdb1d9fe14..95f84fdbf24 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -1,6 +1,6 @@
1/* Profiler implementation. 1/* Profiler implementation.
2 2
3Copyright (C) 2012-2015 Free Software Foundation, Inc. 3Copyright (C) 2012-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/puresize.h b/src/puresize.h
index 96ddcde24a6..bcb5a9ca828 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -1,5 +1,5 @@
1/* How much read-only Lisp storage a dumped Emacs needs. 1/* How much read-only Lisp storage a dumped Emacs needs.
2 Copyright (C) 1993, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1993, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/ralloc.c b/src/ralloc.c
index fb5087d4068..12d2fa9ab50 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -1,5 +1,5 @@
1/* Block-relocating memory allocator. 1/* Block-relocating memory allocator.
2 Copyright (C) 1993, 1995, 2000-2015 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1995, 2000-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/regex.c b/src/regex.c
index 4e00fd15dc9..dd3f2b3cd67 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -2,7 +2,7 @@
2 0.12. (Implements POSIX draft P1003.2/D11.2, except for some of the 2 0.12. (Implements POSIX draft P1003.2/D11.2, except for some of the
3 internationalization features.) 3 internationalization features.)
4 4
5 Copyright (C) 1993-2015 Free Software Foundation, Inc. 5 Copyright (C) 1993-2016 Free Software Foundation, Inc.
6 6
7 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
diff --git a/src/regex.h b/src/regex.h
index eaa7729a5fb..817167a07ca 100644
--- a/src/regex.h
+++ b/src/regex.h
@@ -1,7 +1,7 @@
1/* Definitions for data structures and routines for the regular 1/* Definitions for data structures and routines for the regular
2 expression library, version 0.12. 2 expression library, version 0.12.
3 3
4 Copyright (C) 1985, 1989-1993, 1995, 2000-2015 Free Software 4 Copyright (C) 1985, 1989-1993, 1995, 2000-2016 Free Software
5 Foundation, Inc. 5 Foundation, Inc.
6 6
7 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
diff --git a/src/region-cache.c b/src/region-cache.c
index 1383acd9256..4ce7de832e2 100644
--- a/src/region-cache.c
+++ b/src/region-cache.c
@@ -1,6 +1,6 @@
1/* Caching facts about regions of the buffer, for optimization. 1/* Caching facts about regions of the buffer, for optimization.
2 2
3Copyright (C) 1985-1989, 1993, 1995, 2001-2015 Free Software Foundation, 3Copyright (C) 1985-1989, 1993, 1995, 2001-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/region-cache.h b/src/region-cache.h
index 2814df47c23..0c8861f1f36 100644
--- a/src/region-cache.h
+++ b/src/region-cache.h
@@ -1,6 +1,6 @@
1/* Header file: Caching facts about regions of the buffer, for optimization. 1/* Header file: Caching facts about regions of the buffer, for optimization.
2 2
3Copyright (C) 1985-1986, 1993, 1995, 2001-2015 Free Software Foundation, 3Copyright (C) 1985-1986, 1993, 1995, 2001-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/scroll.c b/src/scroll.c
index 2534ab051e3..517cc686bb5 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -1,6 +1,6 @@
1/* Calculate what line insertion or deletion to do, and do it 1/* Calculate what line insertion or deletion to do, and do it
2 2
3Copyright (C) 1985-1986, 1990, 1993-1994, 2001-2015 Free Software 3Copyright (C) 1985-1986, 1990, 1993-1994, 2001-2016 Free Software
4Foundation, Inc. 4Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/search.c b/src/search.c
index e39ba3dbf07..68b01219863 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1,6 +1,6 @@
1/* String search routines for GNU Emacs. 1/* String search routines for GNU Emacs.
2 2
3Copyright (C) 1985-1987, 1993-1994, 1997-1999, 2001-2015 Free Software 3Copyright (C) 1985-1987, 1993-1994, 1997-1999, 2001-2016 Free Software
4Foundation, Inc. 4Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/sheap.c b/src/sheap.c
index df33353e69a..1451eca8ce7 100644
--- a/src/sheap.c
+++ b/src/sheap.c
@@ -1,7 +1,7 @@
1/* simulate `sbrk' with an array in .bss, for `unexec' support for Cygwin; 1/* simulate `sbrk' with an array in .bss, for `unexec' support for Cygwin;
2 complete rewrite of xemacs Cygwin `unexec' code 2 complete rewrite of xemacs Cygwin `unexec' code
3 3
4 Copyright (C) 2004-2015 Free Software Foundation, Inc. 4 Copyright (C) 2004-2016 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
diff --git a/src/sound.c b/src/sound.c
index 09ab48c58e1..42f1fca2e20 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -1,6 +1,6 @@
1/* sound.c -- sound support. 1/* sound.c -- sound support.
2 2
3Copyright (C) 1998-1999, 2001-2015 Free Software Foundation, Inc. 3Copyright (C) 1998-1999, 2001-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/syntax.c b/src/syntax.c
index 2acbd413858..db5a99d4cdf 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1,5 +1,5 @@
1/* GNU Emacs routines to deal with syntax tables; also word and list parsing. 1/* GNU Emacs routines to deal with syntax tables; also word and list parsing.
2 Copyright (C) 1985, 1987, 1993-1995, 1997-1999, 2001-2015 Free 2 Copyright (C) 1985, 1987, 1993-1995, 1997-1999, 2001-2016 Free
3 Software Foundation, Inc. 3 Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/syntax.h b/src/syntax.h
index eb154e088c9..c3575d4a9b4 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -1,6 +1,6 @@
1/* Declarations having to do with GNU Emacs syntax tables. 1/* Declarations having to do with GNU Emacs syntax tables.
2 2
3Copyright (C) 1985, 1993-1994, 1997-1998, 2001-2015 Free Software 3Copyright (C) 1985, 1993-1994, 1997-1998, 2001-2016 Free Software
4Foundation, Inc. 4Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/sysdep.c b/src/sysdep.c
index a29155c144a..e73acec733e 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1,5 +1,5 @@
1/* Interfaces to system-dependent kernel and library entries. 1/* Interfaces to system-dependent kernel and library entries.
2 Copyright (C) 1985-1988, 1993-1995, 1999-2015 Free Software 2 Copyright (C) 1985-1988, 1993-1995, 1999-2016 Free Software
3 Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/sysselect.h b/src/sysselect.h
index d6c5d1c7148..b625a6582f9 100644
--- a/src/sysselect.h
+++ b/src/sysselect.h
@@ -1,5 +1,5 @@
1/* sysselect.h - System-dependent definitions for the select function. 1/* sysselect.h - System-dependent definitions for the select function.
2 Copyright (C) 1995, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1995, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/syssignal.h b/src/syssignal.h
index ec6099408c4..df4b1405015 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -1,6 +1,6 @@
1/* syssignal.h - System-dependent definitions for signals. 1/* syssignal.h - System-dependent definitions for signals.
2 2
3Copyright (C) 1993, 1999, 2001-2015 Free Software Foundation, Inc. 3Copyright (C) 1993, 1999, 2001-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/sysstdio.h b/src/sysstdio.h
index 166823049d2..e1416b658e2 100644
--- a/src/sysstdio.h
+++ b/src/sysstdio.h
@@ -1,6 +1,6 @@
1/* Standard I/O for Emacs. 1/* Standard I/O for Emacs.
2 2
3Copyright 2013-2015 Free Software Foundation, Inc. 3Copyright 2013-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/systime.h b/src/systime.h
index a7c182a283d..04c83ff247a 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -1,5 +1,5 @@
1/* systime.h - System-dependent definitions for time manipulations. 1/* systime.h - System-dependent definitions for time manipulations.
2 Copyright (C) 1993-1994, 2002-2015 Free Software Foundation, Inc. 2 Copyright (C) 1993-1994, 2002-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/systty.h b/src/systty.h
index 1022455c588..116af97bce3 100644
--- a/src/systty.h
+++ b/src/systty.h
@@ -1,5 +1,5 @@
1/* systty.h - System-dependent definitions for terminals. 1/* systty.h - System-dependent definitions for terminals.
2 Copyright (C) 1993-1994, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1993-1994, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/syswait.h b/src/syswait.h
index 58918222e5e..ca672d1679e 100644
--- a/src/syswait.h
+++ b/src/syswait.h
@@ -1,5 +1,5 @@
1/* Define wait system call interface for Emacs. 1/* Define wait system call interface for Emacs.
2 Copyright (C) 1993-1995, 2000-2015 Free Software Foundation, Inc. 2 Copyright (C) 1993-1995, 2000-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/term.c b/src/term.c
index 6ab611d51e2..993928eefde 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1,5 +1,5 @@
1/* Terminal control module for terminals described by TERMCAP 1/* Terminal control module for terminals described by TERMCAP
2 Copyright (C) 1985-1987, 1993-1995, 1998, 2000-2015 Free Software 2 Copyright (C) 1985-1987, 1993-1995, 1998, 2000-2016 Free Software
3 Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/termcap.c b/src/termcap.c
index 394b4056eb3..3ecf19ff786 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -1,5 +1,5 @@
1/* Work-alike for termcap, plus extra features. 1/* Work-alike for termcap, plus extra features.
2 Copyright (C) 1985-1986, 1993-1995, 2000-2008, 2011, 2013-2015 Free 2 Copyright (C) 1985-1986, 1993-1995, 2000-2008, 2011, 2013-2016 Free
3 Software Foundation, Inc. 3 Software Foundation, Inc.
4 4
5This program is free software; you can redistribute it and/or modify 5This program is free software; you can redistribute it and/or modify
diff --git a/src/termchar.h b/src/termchar.h
index 06c042797b6..d816da283c3 100644
--- a/src/termchar.h
+++ b/src/termchar.h
@@ -1,5 +1,5 @@
1/* Flags and parameters describing terminal's characteristics. 1/* Flags and parameters describing terminal's characteristics.
2 Copyright (C) 1985-1986, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1985-1986, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/termhooks.h b/src/termhooks.h
index 8bde9877c33..29223757621 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -1,6 +1,6 @@
1/* Parameters and display hooks for terminal devices. 1/* Parameters and display hooks for terminal devices.
2 2
3Copyright (C) 1985-1986, 1993-1994, 2001-2015 Free Software Foundation, 3Copyright (C) 1985-1986, 1993-1994, 2001-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/terminal.c b/src/terminal.c
index 27594e52a74..a5579677c4c 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -1,5 +1,5 @@
1/* Functions related to terminal devices. 1/* Functions related to terminal devices.
2 Copyright (C) 2005-2015 Free Software Foundation, Inc. 2 Copyright (C) 2005-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/terminfo.c b/src/terminfo.c
index c4538419bab..b8b5f9756c0 100644
--- a/src/terminfo.c
+++ b/src/terminfo.c
@@ -1,5 +1,5 @@
1/* Interface from Emacs to terminfo. 1/* Interface from Emacs to terminfo.
2 Copyright (C) 1985-1986, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1985-1986, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/termopts.h b/src/termopts.h
index c5cd56316ce..7cffa16d610 100644
--- a/src/termopts.h
+++ b/src/termopts.h
@@ -1,5 +1,5 @@
1/* Flags and parameters describing user options for handling the terminal. 1/* Flags and parameters describing user options for handling the terminal.
2 Copyright (C) 1985-1986, 1990, 2001-2015 Free Software Foundation, 2 Copyright (C) 1985-1986, 1990, 2001-2016 Free Software Foundation,
3 Inc. 3 Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/textprop.c b/src/textprop.c
index 1995ff65ce0..70091b939a2 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -1,5 +1,5 @@
1/* Interface code for dealing with text properties. 1/* Interface code for dealing with text properties.
2 Copyright (C) 1993-1995, 1997, 1999-2015 Free Software Foundation, 2 Copyright (C) 1993-1995, 1997, 1999-2016 Free Software Foundation,
3 Inc. 3 Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/tparam.c b/src/tparam.c
index 3a64059e0eb..d3ae4910b56 100644
--- a/src/tparam.c
+++ b/src/tparam.c
@@ -1,5 +1,5 @@
1/* Merge parameters into a termcap entry string. 1/* Merge parameters into a termcap entry string.
2 Copyright (C) 1985, 1987, 1993, 1995, 2000-2008, 2013-2015 Free 2 Copyright (C) 1985, 1987, 1993, 1995, 2000-2008, 2013-2016 Free
3 Software Foundation, Inc. 3 Software Foundation, Inc.
4 4
5This program is free software; you can redistribute it and/or modify 5This program is free software; you can redistribute it and/or modify
diff --git a/src/tparam.h b/src/tparam.h
index b391e89094f..ab82e5b53e7 100644
--- a/src/tparam.h
+++ b/src/tparam.h
@@ -1,6 +1,6 @@
1/* Interface definitions for termcap entries. 1/* Interface definitions for termcap entries.
2 2
3Copyright (C) 2011-2015 Free Software Foundation, Inc. 3Copyright (C) 2011-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/undo.c b/src/undo.c
index 1cc6de48393..1cc9c988d97 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -1,5 +1,5 @@
1/* undo handling for GNU Emacs. 1/* undo handling for GNU Emacs.
2 Copyright (C) 1990, 1993-1994, 2000-2015 Free Software Foundation, 2 Copyright (C) 1990, 1993-1994, 2000-2016 Free Software Foundation,
3 Inc. 3 Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/unexaix.c b/src/unexaix.c
index af114e4427d..eb51d287bf1 100644
--- a/src/unexaix.c
+++ b/src/unexaix.c
@@ -1,5 +1,5 @@
1/* Dump an executable image. 1/* Dump an executable image.
2 Copyright (C) 1985-1988, 1999, 2001-2015 Free Software Foundation, 2 Copyright (C) 1985-1988, 1999, 2001-2016 Free Software Foundation,
3 Inc. 3 Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/unexcoff.c b/src/unexcoff.c
index 3f6549003a5..cc0df306525 100644
--- a/src/unexcoff.c
+++ b/src/unexcoff.c
@@ -1,4 +1,4 @@
1/* Copyright (C) 1985-1988, 1992-1994, 2001-2015 Free Software 1/* Copyright (C) 1985-1988, 1992-1994, 2001-2016 Free Software
2 * Foundation, Inc. 2 * Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
diff --git a/src/unexcw.c b/src/unexcw.c
index 9583598a1cd..febe939d9d3 100644
--- a/src/unexcw.c
+++ b/src/unexcw.c
@@ -1,7 +1,7 @@
1/* unexec() support for Cygwin; 1/* unexec() support for Cygwin;
2 complete rewrite of xemacs Cygwin unexec() code 2 complete rewrite of xemacs Cygwin unexec() code
3 3
4 Copyright (C) 2004-2015 Free Software Foundation, Inc. 4 Copyright (C) 2004-2016 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
diff --git a/src/unexelf.c b/src/unexelf.c
index 03e6dafe8ee..e90199472ed 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -1,4 +1,4 @@
1/* Copyright (C) 1985-1988, 1990, 1992, 1999-2015 Free Software 1/* Copyright (C) 1985-1988, 1990, 1992, 1999-2016 Free Software
2 Foundation, Inc. 2 Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 319ec7956e5..bfb8bd4ea58 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -1,5 +1,5 @@
1/* Dump Emacs in Mach-O format for use on Mac OS X. 1/* Dump Emacs in Mach-O format for use on Mac OS X.
2 Copyright (C) 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/unexw32.c b/src/unexw32.c
index 322d60d062f..460a39eb185 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -1,5 +1,5 @@
1/* unexec for GNU Emacs on Windows NT. 1/* unexec for GNU Emacs on Windows NT.
2 Copyright (C) 1994, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1994, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/vm-limit.c b/src/vm-limit.c
index 503aaaebf8a..0c6dbddc4f2 100644
--- a/src/vm-limit.c
+++ b/src/vm-limit.c
@@ -1,5 +1,5 @@
1/* Functions for memory limit warnings. 1/* Functions for memory limit warnings.
2 Copyright (C) 1990, 1992, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1990, 1992, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w16select.c b/src/w16select.c
index 70b9dd01f09..48bb813ce35 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -1,6 +1,6 @@
1/* 16-bit Windows Selection processing for emacs on MS-Windows 1/* 16-bit Windows Selection processing for emacs on MS-Windows
2 2
3Copyright (C) 1996-1997, 2001-2015 Free Software Foundation, Inc. 3Copyright (C) 1996-1997, 2001-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/w32.c b/src/w32.c
index 9b1d94de786..4770718f5e3 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -1,6 +1,6 @@
1/* Utility and Unix shadow routines for GNU Emacs on the Microsoft Windows API. 1/* Utility and Unix shadow routines for GNU Emacs on the Microsoft Windows API.
2 2
3Copyright (C) 1994-1995, 2000-2015 Free Software Foundation, Inc. 3Copyright (C) 1994-1995, 2000-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -1513,7 +1513,7 @@ codepage_for_filenames (CPINFO *cp_info)
1513 1513
1514 if (NILP (current_encoding)) 1514 if (NILP (current_encoding))
1515 { 1515 {
1516 char *cpname = SDATA (SYMBOL_NAME (current_encoding)); 1516 char *cpname = SSDATA (SYMBOL_NAME (current_encoding));
1517 char *cp = NULL, *end; 1517 char *cp = NULL, *end;
1518 int cpnum; 1518 int cpnum;
1519 1519
@@ -2165,11 +2165,11 @@ unixtodos_filename (register char *p)
2165 (From msdos.c...probably should figure out a way to share it, 2165 (From msdos.c...probably should figure out a way to share it,
2166 although this code isn't going to ever change.) */ 2166 although this code isn't going to ever change.) */
2167static int 2167static int
2168crlf_to_lf (register int n, register unsigned char *buf) 2168crlf_to_lf (register int n, register char *buf)
2169{ 2169{
2170 unsigned char *np = buf; 2170 unsigned char *np = (unsigned char *)buf;
2171 unsigned char *startp = buf; 2171 unsigned char *startp = np;
2172 unsigned char *endp = buf + n; 2172 char *endp = buf + n;
2173 2173
2174 if (n == 0) 2174 if (n == 0)
2175 return n; 2175 return n;
@@ -2386,7 +2386,7 @@ ansi_encode_filename (Lisp_Object filename)
2386 { 2386 {
2387 char shortname[MAX_PATH]; 2387 char shortname[MAX_PATH];
2388 2388
2389 if (w32_get_short_filename (SDATA (filename), shortname, MAX_PATH)) 2389 if (w32_get_short_filename (SSDATA (filename), shortname, MAX_PATH))
2390 { 2390 {
2391 dostounix_filename (shortname); 2391 dostounix_filename (shortname);
2392 encoded_filename = build_string (shortname); 2392 encoded_filename = build_string (shortname);
@@ -3210,7 +3210,8 @@ map_w32_filename (const char * name, const char ** pPath)
3210 return shortname; 3210 return shortname;
3211 } 3211 }
3212 3212
3213 if (is_fat_volume (name, (const char **)&path)) /* truncate to 8.3 */ 3213 if (!fatal_error_in_progress /* disable fancy processing during crash */
3214 && is_fat_volume (name, (const char **)&path)) /* truncate to 8.3 */
3214 { 3215 {
3215 register int left = 8; /* maximum number of chars in part */ 3216 register int left = 8; /* maximum number of chars in part */
3216 register int extn = 0; /* extension added? */ 3217 register int extn = 0; /* extension added? */
@@ -7495,7 +7496,7 @@ socket_to_fd (SOCKET s)
7495 though the socket wasn't really a kernel handle, 7496 though the socket wasn't really a kernel handle,
7496 because a real handle has the same value. So 7497 because a real handle has the same value. So
7497 test whether the new handle really is a socket. */ 7498 test whether the new handle really is a socket. */
7498 long nonblocking = 0; 7499 unsigned long nonblocking = 0;
7499 if (pfn_ioctlsocket ((SOCKET) new_s, FIONBIO, &nonblocking) == 0) 7500 if (pfn_ioctlsocket ((SOCKET) new_s, FIONBIO, &nonblocking) == 0)
7500 { 7501 {
7501 pfn_closesocket (s); 7502 pfn_closesocket (s);
@@ -8520,7 +8521,7 @@ sys_write (int fd, const void * buffer, unsigned int count)
8520 int nbytes = count; 8521 int nbytes = count;
8521 8522
8522 SAFE_NALLOCA (tmpbuf, 2, count); 8523 SAFE_NALLOCA (tmpbuf, 2, count);
8523 dst = tmpbuf; 8524 dst = (unsigned char *)tmpbuf;
8524 8525
8525 while (1) 8526 while (1)
8526 { 8527 {
@@ -9062,8 +9063,8 @@ check_windows_init_file (void)
9062 if (fd < 0) 9063 if (fd < 0)
9063 { 9064 {
9064 Lisp_Object load_path_print = Fprin1_to_string (Vload_path, Qnil); 9065 Lisp_Object load_path_print = Fprin1_to_string (Vload_path, Qnil);
9065 char *init_file_name = SDATA (init_file); 9066 char *init_file_name = SSDATA (init_file);
9066 char *load_path = SDATA (load_path_print); 9067 char *load_path = SSDATA (load_path_print);
9067 char *buffer = alloca (1024 9068 char *buffer = alloca (1024
9068 + strlen (init_file_name) 9069 + strlen (init_file_name)
9069 + strlen (load_path)); 9070 + strlen (load_path));
diff --git a/src/w32.h b/src/w32.h
index 1efd562eadb..501056d38c6 100644
--- a/src/w32.h
+++ b/src/w32.h
@@ -2,7 +2,7 @@
2#define EMACS_W32_H 2#define EMACS_W32_H
3 3
4/* Support routines for the NT version of Emacs. 4/* Support routines for the NT version of Emacs.
5 Copyright (C) 1994, 2001-2015 Free Software Foundation, Inc. 5 Copyright (C) 1994, 2001-2016 Free Software Foundation, Inc.
6 6
7This file is part of GNU Emacs. 7This file is part of GNU Emacs.
8 8
diff --git a/src/w32common.h b/src/w32common.h
index 9aba2d88169..4fbeab55028 100644
--- a/src/w32common.h
+++ b/src/w32common.h
@@ -1,5 +1,5 @@
1/* Common functions for Microsoft Windows builds of Emacs 1/* Common functions for Microsoft Windows builds of Emacs
2 Copyright (C) 2012-2015 Free Software Foundation, Inc. 2 Copyright (C) 2012-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32console.c b/src/w32console.c
index 7fffabf3853..6277f131b50 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -1,5 +1,5 @@
1/* Terminal hooks for GNU Emacs on the Microsoft Windows API. 1/* Terminal hooks for GNU Emacs on the Microsoft Windows API.
2 Copyright (C) 1992, 1999, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1992, 1999, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32fns.c b/src/w32fns.c
index c1d9bff98ab..f3806a992a0 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1,6 +1,6 @@
1/* Graphical user interface functions for the Microsoft Windows API. 1/* Graphical user interface functions for the Microsoft Windows API.
2 2
3Copyright (C) 1989, 1992-2015 Free Software Foundation, Inc. 3Copyright (C) 1989, 1992-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/w32font.c b/src/w32font.c
index 2b6f6109454..0c3efe2ef2e 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -1,5 +1,5 @@
1/* Font backend for the Microsoft Windows API. 1/* Font backend for the Microsoft Windows API.
2 Copyright (C) 2007-2015 Free Software Foundation, Inc. 2 Copyright (C) 2007-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32font.h b/src/w32font.h
index 6365cb3fa23..a3fd357287b 100644
--- a/src/w32font.h
+++ b/src/w32font.h
@@ -1,5 +1,5 @@
1/* Shared GDI and Uniscribe Font backend declarations for the Windows API. 1/* Shared GDI and Uniscribe Font backend declarations for the Windows API.
2 Copyright (C) 2007-2015 Free Software Foundation, Inc. 2 Copyright (C) 2007-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32gui.h b/src/w32gui.h
index c90404bbc2d..ff7af87cf5d 100644
--- a/src/w32gui.h
+++ b/src/w32gui.h
@@ -1,5 +1,5 @@
1/* Definitions and headers for communication on the Microsoft Windows API. 1/* Definitions and headers for communication on the Microsoft Windows API.
2 Copyright (C) 1995, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1995, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32heap.c b/src/w32heap.c
index a74e7adc5ff..54646bfbe3e 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -1,5 +1,5 @@
1/* Heap management routines for GNU Emacs on the Microsoft Windows API. 1/* Heap management routines for GNU Emacs on the Microsoft Windows API.
2 Copyright (C) 1994, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1994, 2001-2016 Free Software Foundation, Inc.
3 3
4 This file is part of GNU Emacs. 4 This file is part of GNU Emacs.
5 5
diff --git a/src/w32heap.h b/src/w32heap.h
index b5eb3ffa854..c569033eef4 100644
--- a/src/w32heap.h
+++ b/src/w32heap.h
@@ -1,5 +1,5 @@
1/* Heap management routines (including unexec) for GNU Emacs on Windows NT. 1/* Heap management routines (including unexec) for GNU Emacs on Windows NT.
2 Copyright (C) 1994, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1994, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32inevt.c b/src/w32inevt.c
index db2e2189952..54b0b13f54e 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -1,5 +1,5 @@
1/* Input event support for Emacs on the Microsoft Windows API. 1/* Input event support for Emacs on the Microsoft Windows API.
2 Copyright (C) 1992-1993, 1995, 2001-2015 Free Software Foundation, 2 Copyright (C) 1992-1993, 1995, 2001-2016 Free Software Foundation,
3 Inc. 3 Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/w32inevt.h b/src/w32inevt.h
index 4677c3eb5f8..b23c78726cd 100644
--- a/src/w32inevt.h
+++ b/src/w32inevt.h
@@ -1,5 +1,5 @@
1/* Input routines for GNU Emacs on the Microsoft Windows API. 1/* Input routines for GNU Emacs on the Microsoft Windows API.
2 Copyright (C) 1995, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1995, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32menu.c b/src/w32menu.c
index 964b965fac1..d8c3dc1c94e 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -1,5 +1,5 @@
1/* Menu support for GNU Emacs on the Microsoft Windows API. 1/* Menu support for GNU Emacs on the Microsoft Windows API.
2 Copyright (C) 1986, 1988, 1993-1994, 1996, 1998-1999, 2001-2015 Free 2 Copyright (C) 1986, 1988, 1993-1994, 1996, 1998-1999, 2001-2016 Free
3 Software Foundation, Inc. 3 Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/w32notify.c b/src/w32notify.c
index de27ab89b51..576cf844dab 100644
--- a/src/w32notify.c
+++ b/src/w32notify.c
@@ -1,5 +1,5 @@
1/* Filesystem notifications support for GNU Emacs on the Microsoft Windows API. 1/* Filesystem notifications support for GNU Emacs on the Microsoft Windows API.
2 Copyright (C) 2012-2015 Free Software Foundation, Inc. 2 Copyright (C) 2012-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32proc.c b/src/w32proc.c
index a4e14965c87..a65f085fb3d 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -1,6 +1,6 @@
1/* Process support for GNU Emacs on the Microsoft Windows API. 1/* Process support for GNU Emacs on the Microsoft Windows API.
2 2
3Copyright (C) 1992, 1995, 1999-2015 Free Software Foundation, Inc. 3Copyright (C) 1992, 1995, 1999-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/w32reg.c b/src/w32reg.c
index a4ce2187043..7d1ccf843a4 100644
--- a/src/w32reg.c
+++ b/src/w32reg.c
@@ -1,5 +1,5 @@
1/* Emulate the X Resource Manager through the registry. 1/* Emulate the X Resource Manager through the registry.
2 Copyright (C) 1990, 1993-1994, 2001-2015 Free Software Foundation, 2 Copyright (C) 1990, 1993-1994, 2001-2016 Free Software Foundation,
3 Inc. 3 Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/w32select.c b/src/w32select.c
index 3962ac6cbed..ce4ed691859 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -1,6 +1,6 @@
1/* Selection processing for Emacs on the Microsoft Windows API. 1/* Selection processing for Emacs on the Microsoft Windows API.
2 2
3Copyright (C) 1993-1994, 2001-2015 Free Software Foundation, Inc. 3Copyright (C) 1993-1994, 2001-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/w32select.h b/src/w32select.h
index 0fa9f18a23d..8216380d91a 100644
--- a/src/w32select.h
+++ b/src/w32select.h
@@ -1,6 +1,6 @@
1/* Selection processing for Emacs on the Microsoft W32 API. 1/* Selection processing for Emacs on the Microsoft W32 API.
2 2
3Copyright (C) 1993-1994, 2001-2015 Free Software Foundation, Inc. 3Copyright (C) 1993-1994, 2001-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/w32term.c b/src/w32term.c
index 60d64f7fd0f..54fd2953d76 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1,6 +1,6 @@
1/* Implementation of GUI terminal on the Microsoft Windows API. 1/* Implementation of GUI terminal on the Microsoft Windows API.
2 2
3Copyright (C) 1989, 1993-2015 Free Software Foundation, Inc. 3Copyright (C) 1989, 1993-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/w32term.h b/src/w32term.h
index 3377b53608e..50906241f98 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -1,5 +1,5 @@
1/* Definitions and headers for communication on the Microsoft Windows API. 1/* Definitions and headers for communication on the Microsoft Windows API.
2 Copyright (C) 1995, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1995, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index a8b5932f73a..c5ba87bf7b4 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -1,5 +1,5 @@
1/* Font backend for the Microsoft W32 Uniscribe API. 1/* Font backend for the Microsoft W32 Uniscribe API.
2 Copyright (C) 2008-2015 Free Software Foundation, Inc. 2 Copyright (C) 2008-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32xfns.c b/src/w32xfns.c
index 48da14dc8e3..29636d1de80 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -1,5 +1,5 @@
1/* Functions taken directly from X sources for use with the Microsoft Windows API. 1/* Functions taken directly from X sources for use with the Microsoft Windows API.
2 Copyright (C) 1989, 1992-1995, 1999, 2001-2015 Free Software 2 Copyright (C) 1989, 1992-1995, 1999, 2001-2016 Free Software
3 Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/widget.c b/src/widget.c
index d0c3e60cfa6..a71de90ed34 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -1,5 +1,5 @@
1/* The emacs frame widget. 1/* The emacs frame widget.
2 Copyright (C) 1992-1993, 2000-2015 Free Software Foundation, Inc. 2 Copyright (C) 1992-1993, 2000-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/widget.h b/src/widget.h
index e2e19b0d40f..13eb9e7dd59 100644
--- a/src/widget.h
+++ b/src/widget.h
@@ -1,5 +1,5 @@
1/* The emacs frame widget public header file. 1/* The emacs frame widget public header file.
2 Copyright (C) 1993, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1993, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/widgetprv.h b/src/widgetprv.h
index dc0124887ad..24e8378fbcd 100644
--- a/src/widgetprv.h
+++ b/src/widgetprv.h
@@ -1,5 +1,5 @@
1/* The emacs frame widget private header file. 1/* The emacs frame widget private header file.
2 Copyright (C) 1993, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1993, 2001-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/window.c b/src/window.c
index 9f6b489e74a..bb414e7d311 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1,6 +1,6 @@
1/* Window creation, deletion and examination for GNU Emacs. 1/* Window creation, deletion and examination for GNU Emacs.
2 Does not include redisplay. 2 Does not include redisplay.
3 Copyright (C) 1985-1987, 1993-1998, 2000-2015 Free Software 3 Copyright (C) 1985-1987, 1993-1998, 2000-2016 Free Software
4 Foundation, Inc. 4 Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/window.h b/src/window.h
index 135f5de7d8a..c29207d6356 100644
--- a/src/window.h
+++ b/src/window.h
@@ -1,5 +1,5 @@
1/* Window definitions for GNU Emacs. 1/* Window definitions for GNU Emacs.
2 Copyright (C) 1985-1986, 1993, 1995, 1997-2015 Free Software 2 Copyright (C) 1985-1986, 1993, 1995, 1997-2016 Free Software
3 Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/xdisp.c b/src/xdisp.c
index 37dc6047e58..d730a0bf1b6 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1,6 +1,6 @@
1/* Display generation from window structure and buffer text. 1/* Display generation from window structure and buffer text.
2 2
3Copyright (C) 1985-1988, 1993-1995, 1997-2015 Free Software Foundation, 3Copyright (C) 1985-1988, 1993-1995, 1997-2016 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
@@ -4583,11 +4583,15 @@ setup_for_ellipsis (struct it *it, int len)
4583 it->current.dpvec_index = 0; 4583 it->current.dpvec_index = 0;
4584 it->dpvec_face_id = -1; 4584 it->dpvec_face_id = -1;
4585 4585
4586 /* Remember the current face id in case glyphs specify faces. 4586 /* Use IT->saved_face_id for the ellipsis, so that it has the same
4587 IT's face is restored in set_iterator_to_next. 4587 face as the preceding text. IT->saved_face_id was set in
4588 saved_face_id was set to preceding char's face in handle_stop. */ 4588 handle_stop to the face of the preceding character, and will be
4589 if (it->saved_face_id < 0 || it->saved_face_id != it->face_id) 4589 different from IT->face_id only if the invisible text skipped in
4590 it->saved_face_id = it->face_id = DEFAULT_FACE_ID; 4590 handle_invisible_prop has some non-default face on its first
4591 character. We thus ignore the face of the invisible text when we
4592 display the ellipsis. IT's face is restored in set_iterator_to_next. */
4593 if (it->saved_face_id >= 0)
4594 it->face_id = it->saved_face_id;
4591 4595
4592 /* If the ellipsis represents buffer text, it means we advanced in 4596 /* If the ellipsis represents buffer text, it means we advanced in
4593 the buffer, so we should no longer ignore overlay strings. */ 4597 the buffer, so we should no longer ignore overlay strings. */
@@ -10206,7 +10210,16 @@ message_to_stderr (Lisp_Object m)
10206 } 10210 }
10207 if (STRINGP (m)) 10211 if (STRINGP (m))
10208 { 10212 {
10209 Lisp_Object s = ENCODE_SYSTEM (m); 10213 Lisp_Object coding_system = Vlocale_coding_system;
10214 Lisp_Object s;
10215
10216 if (!NILP (Vcoding_system_for_write))
10217 coding_system = Vcoding_system_for_write;
10218 if (!NILP (coding_system))
10219 s = code_convert_string_norecord (m, coding_system, true);
10220 else
10221 s = m;
10222
10210 fwrite (SDATA (s), SBYTES (s), 1, stderr); 10223 fwrite (SDATA (s), SBYTES (s), 1, stderr);
10211 } 10224 }
10212 if (!cursor_in_echo_area) 10225 if (!cursor_in_echo_area)
diff --git a/src/xfaces.c b/src/xfaces.c
index 6bbd5417155..0bf4f0cefd6 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -1,6 +1,6 @@
1/* xfaces.c -- "Face" primitives. 1/* xfaces.c -- "Face" primitives.
2 2
3Copyright (C) 1993-1994, 1998-2015 Free Software Foundation, Inc. 3Copyright (C) 1993-1994, 1998-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/xfns.c b/src/xfns.c
index 3f95f7b79fb..aad9680c4df 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1,6 +1,6 @@
1/* Functions for the X window system. 1/* Functions for the X window system.
2 2
3Copyright (C) 1989, 1992-2015 Free Software Foundation, Inc. 3Copyright (C) 1989, 1992-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -6564,31 +6564,27 @@ present and mapped to the usual X keysyms. */)
6564DEFUN ("x-export-frames", Fx_export_frames, Sx_export_frames, 0, 2, 0, 6564DEFUN ("x-export-frames", Fx_export_frames, Sx_export_frames, 0, 2, 0,
6565 doc: /* Return image data of FRAMES in TYPE format. 6565 doc: /* Return image data of FRAMES in TYPE format.
6566FRAMES should be nil (the selected frame), a frame, or a list of 6566FRAMES should be nil (the selected frame), a frame, or a list of
6567frames (each of which corresponds to one page). Optional arg TYPE 6567frames (each of which corresponds to one page). Each frame should be
6568should be either `pdf' (default), `png', `postscript', or `svg'. 6568visible. Optional arg TYPE should be either `pdf' (default), `png',
6569Supported types are determined by the compile-time configuration of 6569`postscript', or `svg'. Supported types are determined by the
6570cairo. */) 6570compile-time configuration of cairo. */)
6571 (Lisp_Object frames, Lisp_Object type) 6571 (Lisp_Object frames, Lisp_Object type)
6572{ 6572{
6573 Lisp_Object result, rest, tmp; 6573 Lisp_Object rest, tmp;
6574 cairo_surface_type_t surface_type; 6574 cairo_surface_type_t surface_type;
6575 6575
6576 if (NILP (frames))
6577 frames = selected_frame;
6578 if (!CONSP (frames)) 6576 if (!CONSP (frames))
6579 frames = list1 (frames); 6577 frames = list1 (frames);
6580 6578
6581 tmp = Qnil; 6579 tmp = Qnil;
6582 for (rest = frames; CONSP (rest); rest = XCDR (rest)) 6580 for (rest = frames; CONSP (rest); rest = XCDR (rest))
6583 { 6581 {
6584 struct frame *f = XFRAME (XCAR (rest)); 6582 struct frame *f = decode_window_system_frame (XCAR (rest));
6585
6586 if (! FRAME_LIVE_P (f) || ! FRAME_X_P (f) || ! FRAME_LIVE_P (f))
6587 error ("Invalid frame");
6588
6589 Lisp_Object frame; 6583 Lisp_Object frame;
6590 6584
6591 XSETFRAME (frame, f); 6585 XSETFRAME (frame, f);
6586 if (!FRAME_VISIBLE_P (f))
6587 error ("Frames to be exported must be visible.");
6592 tmp = Fcons (frame, tmp); 6588 tmp = Fcons (frame, tmp);
6593 } 6589 }
6594 frames = Fnreverse (tmp); 6590 frames = Fnreverse (tmp);
@@ -6624,9 +6620,7 @@ cairo. */)
6624#endif 6620#endif
6625 error ("Unsupported export type"); 6621 error ("Unsupported export type");
6626 6622
6627 result = x_cr_export_frames (frames, surface_type); 6623 return x_cr_export_frames (frames, surface_type);
6628
6629 return result;
6630} 6624}
6631 6625
6632#ifdef USE_GTK 6626#ifdef USE_GTK
@@ -6654,8 +6648,12 @@ The return value is an alist containing the following keys:
6654 on, in points. 6648 on, in points.
6655 6649
6656The paper width can be obtained as the sum of width, left-margin, and 6650The paper width can be obtained as the sum of width, left-margin, and
6657right-margin values. Likewise, the paper height is the sum of height, 6651right-margin values if the page orientation is `portrait' or
6658top-margin, and bottom-margin values. */) 6652`reverse-portrait'. Otherwise, it is the sum of width, top-margin,
6653and bottom-margin values. Likewise, the paper height is the sum of
6654height, top-margin, and bottom-margin values if the page orientation
6655is `portrait' or `reverse-portrait'. Otherwise, it is the sum of
6656height, left-margin, and right-margin values. */)
6659 (void) 6657 (void)
6660{ 6658{
6661 Lisp_Object result; 6659 Lisp_Object result;
@@ -6675,29 +6673,29 @@ visible. */)
6675 (Lisp_Object frames) 6673 (Lisp_Object frames)
6676{ 6674{
6677 Lisp_Object rest, tmp; 6675 Lisp_Object rest, tmp;
6676 int count;
6678 6677
6679 if (NILP (frames))
6680 frames = selected_frame;
6681 if (!CONSP (frames)) 6678 if (!CONSP (frames))
6682 frames = list1 (frames); 6679 frames = list1 (frames);
6683 6680
6684 tmp = Qnil; 6681 tmp = Qnil;
6685 for (rest = frames; CONSP (rest); rest = XCDR (rest)) 6682 for (rest = frames; CONSP (rest); rest = XCDR (rest))
6686 { 6683 {
6687 struct frame *f = XFRAME (XCAR (rest)); 6684 struct frame *f = decode_window_system_frame (XCAR (rest));
6688 if (! FRAME_LIVE_P (f) || ! FRAME_X_P (f) || ! FRAME_LIVE_P (f))
6689 error ("Invalid frame");
6690 Lisp_Object frame; 6685 Lisp_Object frame;
6691 6686
6692 XSETFRAME (frame, f); 6687 XSETFRAME (frame, f);
6693 if (!EQ (Fframe_visible_p (frame), Qt)) 6688 if (!FRAME_VISIBLE_P (f))
6694 error ("Frames to be printed must be visible."); 6689 error ("Frames to be printed must be visible.");
6695 tmp = Fcons (frame, tmp); 6690 tmp = Fcons (frame, tmp);
6696 } 6691 }
6697 frames = Fnreverse (tmp); 6692 frames = Fnreverse (tmp);
6698 6693
6699 /* Make sure the current matrices are up-to-date. */ 6694 /* Make sure the current matrices are up-to-date. */
6700 Fredisplay (Qt); 6695 count = SPECPDL_INDEX ();
6696 specbind (Qredisplay_dont_pause, Qt);
6697 redisplay_preserve_echo_area (32);
6698 unbind_to (count, Qnil);
6701 6699
6702 block_input (); 6700 block_input ();
6703 xg_print_frames_dialog (frames); 6701 xg_print_frames_dialog (frames);
diff --git a/src/xfont.c b/src/xfont.c
index 671b1050c9c..15a4b746bc4 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -1,5 +1,5 @@
1/* xfont.c -- X core font driver. 1/* xfont.c -- X core font driver.
2 Copyright (C) 2006-2015 Free Software Foundation, Inc. 2 Copyright (C) 2006-2016 Free Software Foundation, Inc.
3 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 3 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
4 National Institute of Advanced Industrial Science and Technology (AIST) 4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H13PRO009 5 Registration Number H13PRO009
diff --git a/src/xftfont.c b/src/xftfont.c
index 956231ee422..110f99a9be9 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -1,5 +1,5 @@
1/* xftfont.c -- XFT font driver. 1/* xftfont.c -- XFT font driver.
2 Copyright (C) 2006-2015 Free Software Foundation, Inc. 2 Copyright (C) 2006-2016 Free Software Foundation, Inc.
3 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 3 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
4 National Institute of Advanced Industrial Science and Technology (AIST) 4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H13PRO009 5 Registration Number H13PRO009
diff --git a/src/xgselect.c b/src/xgselect.c
index 55e1ffcabff..a61d46b958b 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -1,6 +1,6 @@
1/* Function for handling the GLib event loop. 1/* Function for handling the GLib event loop.
2 2
3Copyright (C) 2009-2015 Free Software Foundation, Inc. 3Copyright (C) 2009-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/xgselect.h b/src/xgselect.h
index 524fff7d352..fc976ca937c 100644
--- a/src/xgselect.h
+++ b/src/xgselect.h
@@ -1,6 +1,6 @@
1/* Header for xg_select. 1/* Header for xg_select.
2 2
3Copyright (C) 2009-2015 Free Software Foundation, Inc. 3Copyright (C) 2009-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/xmenu.c b/src/xmenu.c
index be6e41de63e..1047b19680e 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1,6 +1,6 @@
1/* X Communication module for terminals which understand the X protocol. 1/* X Communication module for terminals which understand the X protocol.
2 2
3Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2015 Free Software 3Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2016 Free Software
4Foundation, Inc. 4Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/xml.c b/src/xml.c
index fc77f22b862..6c47a9da9f8 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -1,5 +1,5 @@
1/* Interface to libxml2. 1/* Interface to libxml2.
2 Copyright (C) 2010-2015 Free Software Foundation, Inc. 2 Copyright (C) 2010-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/xrdb.c b/src/xrdb.c
index 10bc76986e6..865acc94217 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -1,5 +1,5 @@
1/* Deal with the X Resource Manager. 1/* Deal with the X Resource Manager.
2 Copyright (C) 1990, 1993-1994, 2000-2015 Free Software Foundation, 2 Copyright (C) 1990, 1993-1994, 2000-2016 Free Software Foundation,
3 Inc. 3 Inc.
4 4
5Author: Joseph Arceneaux 5Author: Joseph Arceneaux
diff --git a/src/xselect.c b/src/xselect.c
index 41bd2bc40de..23b735ed89f 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1,5 +1,5 @@
1/* X Selection processing for Emacs. 1/* X Selection processing for Emacs.
2 Copyright (C) 1993-1997, 2000-2015 Free Software Foundation, Inc. 2 Copyright (C) 1993-1997, 2000-2016 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/xsettings.c b/src/xsettings.c
index f6a8bfdebd9..28075b5e8a2 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -1,6 +1,6 @@
1/* Functions for handling font and other changes dynamically. 1/* Functions for handling font and other changes dynamically.
2 2
3Copyright (C) 2009-2015 Free Software Foundation, Inc. 3Copyright (C) 2009-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/xsettings.h b/src/xsettings.h
index 71b71d6e922..74e28b42960 100644
--- a/src/xsettings.h
+++ b/src/xsettings.h
@@ -1,6 +1,6 @@
1/* Functions for handle font changes dynamically. 1/* Functions for handle font changes dynamically.
2 2
3Copyright (C) 2009-2015 Free Software Foundation, Inc. 3Copyright (C) 2009-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 8c4a6d3462c..76414496770 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -1,7 +1,7 @@
1/* Session management module for systems which understand the X Session 1/* Session management module for systems which understand the X Session
2 management protocol. 2 management protocol.
3 3
4Copyright (C) 2002-2015 Free Software Foundation, Inc. 4Copyright (C) 2002-2016 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
diff --git a/src/xterm.c b/src/xterm.c
index acb6566d51d..5a6d643bad4 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1,6 +1,6 @@
1/* X Communication module for terminals which understand the X protocol. 1/* X Communication module for terminals which understand the X protocol.
2 2
3Copyright (C) 1989, 1993-2015 Free Software Foundation, Inc. 3Copyright (C) 1989, 1993-2016 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -569,7 +569,8 @@ x_cr_export_frames (Lisp_Object frames, cairo_surface_type_t surface_type)
569 Lisp_Object acc = Qnil; 569 Lisp_Object acc = Qnil;
570 int count = SPECPDL_INDEX (); 570 int count = SPECPDL_INDEX ();
571 571
572 Fredisplay (Qt); 572 specbind (Qredisplay_dont_pause, Qt);
573 redisplay_preserve_echo_area (31);
573 574
574 f = XFRAME (XCAR (frames)); 575 f = XFRAME (XCAR (frames));
575 frames = XCDR (frames); 576 frames = XCDR (frames);
@@ -611,24 +612,18 @@ x_cr_export_frames (Lisp_Object frames, cairo_surface_type_t surface_type)
611 cr = cairo_create (surface); 612 cr = cairo_create (surface);
612 cairo_surface_destroy (surface); 613 cairo_surface_destroy (surface);
613 record_unwind_protect (x_cr_destroy, make_save_ptr (cr)); 614 record_unwind_protect (x_cr_destroy, make_save_ptr (cr));
614 unblock_input ();
615 615
616 while (1) 616 while (1)
617 { 617 {
618 QUIT;
619
620 block_input ();
621 x_free_cr_resources (f); 618 x_free_cr_resources (f);
622 FRAME_CR_CONTEXT (f) = cr; 619 FRAME_CR_CONTEXT (f) = cr;
623 x_clear_area (f, 0, 0, width, height); 620 x_clear_area (f, 0, 0, width, height);
624 expose_frame (f, 0, 0, width, height); 621 expose_frame (f, 0, 0, width, height);
625 FRAME_CR_CONTEXT (f) = NULL; 622 FRAME_CR_CONTEXT (f) = NULL;
626 unblock_input ();
627 623
628 if (NILP (frames)) 624 if (NILP (frames))
629 break; 625 break;
630 626
631 block_input ();
632 cairo_surface_show_page (surface); 627 cairo_surface_show_page (surface);
633 f = XFRAME (XCAR (frames)); 628 f = XFRAME (XCAR (frames));
634 frames = XCDR (frames); 629 frames = XCDR (frames);
@@ -636,18 +631,21 @@ x_cr_export_frames (Lisp_Object frames, cairo_surface_type_t surface_type)
636 height = FRAME_PIXEL_HEIGHT (f); 631 height = FRAME_PIXEL_HEIGHT (f);
637 if (surface_set_size_func) 632 if (surface_set_size_func)
638 (*surface_set_size_func) (surface, width, height); 633 (*surface_set_size_func) (surface, width, height);
634
639 unblock_input (); 635 unblock_input ();
636 QUIT;
637 block_input ();
640 } 638 }
641 639
642#ifdef CAIRO_HAS_PNG_FUNCTIONS 640#ifdef CAIRO_HAS_PNG_FUNCTIONS
643 if (surface_type == CAIRO_SURFACE_TYPE_IMAGE) 641 if (surface_type == CAIRO_SURFACE_TYPE_IMAGE)
644 { 642 {
645 block_input ();
646 cairo_surface_flush (surface); 643 cairo_surface_flush (surface);
647 cairo_surface_write_to_png_stream (surface, x_cr_accumulate_data, &acc); 644 cairo_surface_write_to_png_stream (surface, x_cr_accumulate_data, &acc);
648 unblock_input ();
649 } 645 }
650#endif 646#endif
647 unblock_input ();
648
651 unbind_to (count, Qnil); 649 unbind_to (count, Qnil);
652 650
653 return CALLN (Fapply, intern ("concat"), Fnreverse (acc)); 651 return CALLN (Fapply, intern ("concat"), Fnreverse (acc));
diff --git a/src/xterm.h b/src/xterm.h
index 192839b059e..3a78292907a 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -1,5 +1,5 @@
1/* Definitions and headers for communication with X protocol. 1/* Definitions and headers for communication with X protocol.
2 Copyright (C) 1989, 1993-1994, 1998-2015 Free Software Foundation, 2 Copyright (C) 1989, 1993-1994, 1998-2016 Free Software Foundation,
3 Inc. 3 Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.