aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2018-08-26 15:10:50 -0700
committerGlenn Morris2018-08-26 15:10:50 -0700
commit1afd313334c93cb5b0a7a378bd635a54dc1d6a9e (patch)
treecb95ad44d35f9b32a8acc8bb00b7291f38549c52
parent18d52b90a1692a47cea5b5e905a58a3b2c6c9a64 (diff)
parent54fb383af6f6af7b72c28f38b308d9b24d2af4f6 (diff)
downloademacs-1afd313334c93cb5b0a7a378bd635a54dc1d6a9e.tar.gz
emacs-1afd313334c93cb5b0a7a378bd635a54dc1d6a9e.zip
Merge from origin/emacs-26
54fb383 (origin/emacs-26) Fix detection of freed emacs_values (Bug#32... 769d0cd ; Fix out-of-tree build for mod-test.so 9a1329e Avoid crashes with very wide TTY frames on MS-Windows 9a613d3 Prevent `modify-file-local-variable-prop-line' from adding ex... 624e7dc Update GNOME bugtracker URLs 51ef6d5 Clarify in the Emacs manual that ChangeLog files are not used 6e08019 Recognize codepage 65001 as a valid encoding 1a350d7 ; * etc/NEWS: Fix format of first lines of some entries. 22d1f53 Avoid compilation warning in nt/addpm.c 7bc9ce7 Fix duplicate custom group names in bibtex.el a9cf938 Fix outdated text in the Calc manual Conflicts: etc/NEWS etc/PROBLEMS src/emacs-module.c src/gtkutil.c src/image.c src/xterm.c test/Makefile.in
-rw-r--r--doc/emacs/trouble.texi10
-rw-r--r--doc/misc/calc.texi13
-rw-r--r--etc/NEWS.2661
-rw-r--r--etc/PROBLEMS2
-rw-r--r--lisp/files-x.el4
-rw-r--r--lisp/international/mule-conf.el5
-rw-r--r--lisp/textmodes/bibtex.el2
-rw-r--r--nt/addpm.c7
-rw-r--r--src/emacs-module.c8
-rw-r--r--src/w32console.c30
-rw-r--r--test/Makefile.in4
-rw-r--r--test/data/emacs-module/mod-test.c19
-rw-r--r--test/src/emacs-module-tests.el3
13 files changed, 110 insertions, 58 deletions
diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi
index 37a73041676..bb05378f4c9 100644
--- a/doc/emacs/trouble.texi
+++ b/doc/emacs/trouble.texi
@@ -1162,11 +1162,11 @@ name that indicates whether it is the old version or your new changed
1162one. 1162one.
1163 1163
1164@item 1164@item
1165Write the change log entries for your changes. This is both to save us 1165Write the commit log entries for your changes. This is both to save us
1166the extra work of writing them, and to help explain your changes so we 1166the extra work of writing them, and to help explain your changes so we
1167can understand them. 1167can understand them.
1168 1168
1169The purpose of the change log is to show people where to find what was 1169The purpose of the commit log is to show people where to find what was
1170changed. So you need to be specific about what functions you changed; 1170changed. So you need to be specific about what functions you changed;
1171in large functions, it's often helpful to indicate where within the 1171in large functions, it's often helpful to indicate where within the
1172function the change was. 1172function the change was.
@@ -1177,9 +1177,9 @@ new function, all you need to say about it is that it is new. If you
1177feel that the purpose needs explaining, it probably does---but put the 1177feel that the purpose needs explaining, it probably does---but put the
1178explanation in comments in the code. It will be more useful there. 1178explanation in comments in the code. It will be more useful there.
1179 1179
1180Please look at the change log entries of recent commits to see what 1180Please look at the commit log entries of recent commits to see what
1181sorts of information to put in, and to learn the style that we use. Note that, 1181sorts of information to put in, and to learn the style that we use.
1182unlike some other projects, we do require change logs for 1182Note that, unlike some other projects, we do require commit logs for
1183documentation, i.e., Texinfo files. 1183documentation, i.e., Texinfo files.
1184@xref{Change Log}, 1184@xref{Change Log},
1185@ifset WWW_GNU_ORG 1185@ifset WWW_GNU_ORG
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi
index 98ef6daa2c1..02deee99e19 100644
--- a/doc/misc/calc.texi
+++ b/doc/misc/calc.texi
@@ -33275,19 +33275,18 @@ prefer them, or if you are calling these functions from regular Lisp.
33275 33275
33276The functions described here are scattered throughout the various 33276The functions described here are scattered throughout the various
33277Calc component files. Note that @file{calc.el} includes @code{autoload}s 33277Calc component files. Note that @file{calc.el} includes @code{autoload}s
33278for only a few component files; when Calc wants to call an advanced 33278for only a few component files; to get autoloads of the more advanced
33279function it calls @samp{(calc-extensions)} first; this function 33279function, one needs to load @file{calc-ext.el}, which in turn
33280autoloads @file{calc-ext.el}, which in turn autoloads all the functions 33280autoloads all the functions in the remaining component files.
33281in the remaining component files.
33282 33281
33283Because @code{defmath} itself uses the extensions, user-written code 33282Because @code{defmath} itself uses the extensions, user-written code
33284generally always executes with the extensions already loaded, so 33283generally always executes with the extensions already loaded, so
33285normally you can use any Calc function and be confident that it will 33284normally you can use any Calc function and be confident that it will
33286be autoloaded for you when necessary. If you are doing something 33285be autoloaded for you when necessary. If you are doing something
33287special, check carefully to make sure each function you are using is 33286special, check carefully to make sure each function you are using is
33288from @file{calc.el} or its components, and call @samp{(calc-extensions)} 33287from @file{calc.el} or its components, and use @w{@code{(require
33289before using any function based in @file{calc-ext.el} if you can't 33288'calc-ext)}} before using any function based in @file{calc-ext.el} if
33290prove this file will already be loaded. 33289you can't prove this file will already be loaded.
33291 33290
33292@menu 33291@menu
33293* Data Type Formats:: 33292* Data Type Formats::
diff --git a/etc/NEWS.26 b/etc/NEWS.26
index a766e96d2f4..e94bda549ab 100644
--- a/etc/NEWS.26
+++ b/etc/NEWS.26
@@ -19,7 +19,7 @@ with a prefix argument or by typing C-u C-h C-n.
19* Installation Changes in Emacs 26.2 19* Installation Changes in Emacs 26.2
20 20
21--- 21---
22** Building Emacs with the '--with-xwidgets' option now requires WebKit2 22** Building Emacs with the '--with-xwidgets' option now requires WebKit2.
23To build Emacs with xwidgets support, you will need to install the 23To build Emacs with xwidgets support, you will need to install the
24webkit2gtk-4.0 package; version 2.12 or later is required. 24webkit2gtk-4.0 package; version 2.12 or later is required.
25(This change was actually made in Emacs 26.1, but was not called out 25(This change was actually made in Emacs 26.1, but was not called out
@@ -132,17 +132,17 @@ now the default in developer builds. As before, use
132** When GCC warnings are enabled, '--enable-check-lisp-object-type' is 132** When GCC warnings are enabled, '--enable-check-lisp-object-type' is
133now enabled by default when configuring. 133now enabled by default when configuring.
134 134
135** The Emacs server now has socket-launching support. This allows 135** The Emacs server now has socket-launching support.
136socket based activation, where an external process like systemd can 136This allows socket based activation, where an external process like
137invoke the Emacs server process upon a socket connection event and 137systemd can invoke the Emacs server process upon a socket connection
138hand the socket over to Emacs. Emacs uses this socket to service 138event and hand the socket over to Emacs. Emacs uses this socket to
139emacsclient commands. This new functionality can be disabled with the 139service emacsclient commands. This new functionality can be disabled
140configure option '--disable-libsystemd'. 140with the configure option '--disable-libsystemd'.
141 141
142** A systemd user unit file is provided. Use it in the standard way: 142** A systemd user unit file is provided.
143'systemctl --user enable emacs'. 143Use it in the standard way: 'systemctl --user enable emacs'. (If your
144(If your Emacs is installed in a non-standard location, you may 144Emacs is installed in a non-standard location, you may need to copy
145need to copy the emacs.service file to eg ~/.config/systemd/user/) 145the emacs.service file to eg ~/.config/systemd/user/)
146 146
147** New configure option '--disable-build-details' attempts to build an 147** New configure option '--disable-build-details' attempts to build an
148Emacs that is more likely to be reproducible; that is, if you build 148Emacs that is more likely to be reproducible; that is, if you build
@@ -153,7 +153,6 @@ following variables nil: 'emacs-build-system', 'emacs-build-time',
153'erc-emacs-build-time'. 153'erc-emacs-build-time'.
154 154
155** Emacs can now be built with support for Little CMS. 155** Emacs can now be built with support for Little CMS.
156
157If the lcms2 library is installed, Emacs will enable features built on 156If the lcms2 library is installed, Emacs will enable features built on
158top of that library. The new configure option '--without-lcms2' can 157top of that library. The new configure option '--without-lcms2' can
159be used to build without lcms2 support even if it is installed. Emacs 158be used to build without lcms2 support even if it is installed. Emacs
@@ -196,9 +195,9 @@ The effect is similar to that of "toolBar" resource on the tool bar.
196 195
197* Changes in Emacs 26.1 196* Changes in Emacs 26.1
198 197
199** Option 'buffer-offer-save' can be set to new value, 'always'. When 198** Option 'buffer-offer-save' can be set to new value, 'always'.
200set to 'always', the command 'save-some-buffers' will always offer 199When set to 'always', the command 'save-some-buffers' will always
201this buffer for saving. 200offer this buffer for saving.
202 201
203** Security vulnerability related to Enriched Text mode is removed. 202** Security vulnerability related to Enriched Text mode is removed.
204 203
@@ -684,7 +683,7 @@ This can be customized via the 'info-menu' category in
684A new option 'ediff-show-ancestor' and a new toggle 683A new option 'ediff-show-ancestor' and a new toggle
685'ediff-toggle-show-ancestor'. 684'ediff-toggle-show-ancestor'.
686 685
687** TeX: Add luatex and xetex as alternatives to pdftex 686** TeX: Add luatex and xetex as alternatives to pdftex.
688 687
689** Electric-Buffer-menu 688** Electric-Buffer-menu
690 689
@@ -1088,7 +1087,6 @@ to a format suitable for reverse lookup zone files.
1088** Ispell 1087** Ispell
1089 1088
1090*** Enchant is now supported as a spell-checker. 1089*** Enchant is now supported as a spell-checker.
1091
1092Enchant is a meta-spell-checker that uses providers such as Hunspell 1090Enchant is a meta-spell-checker that uses providers such as Hunspell
1093to do the actual checking. With it, users can use spell-checkers not 1091to do the actual checking. With it, users can use spell-checkers not
1094directly supported by Emacs, such as Voikko, Hspell and AppleSpell, 1092directly supported by Emacs, such as Voikko, Hspell and AppleSpell,
@@ -1098,8 +1096,7 @@ configure different spelling-checkers for different languages.
1098 1096
1099** Flymake 1097** Flymake
1100 1098
1101*** Flymake has been completely redesigned 1099*** Flymake has been completely redesigned.
1102
1103Flymake now annotates arbitrary buffer regions, not just lines. It 1100Flymake now annotates arbitrary buffer regions, not just lines. It
1104supports arbitrary diagnostic types, not just errors and warnings (see 1101supports arbitrary diagnostic types, not just errors and warnings (see
1105variable 'flymake-diagnostic-types-alist'). 1102variable 'flymake-diagnostic-types-alist').
@@ -1115,7 +1112,6 @@ backend", which has been updated to benefit from the new UI features.
1115** Term 1112** Term
1116 1113
1117*** 'term-char-mode' now makes its buffer read-only. 1114*** 'term-char-mode' now makes its buffer read-only.
1118
1119The buffer is made read-only to prevent changes from being made by 1115The buffer is made read-only to prevent changes from being made by
1120anything other than the process filter; and movements of point away 1116anything other than the process filter; and movements of point away
1121from the process mark are counter-acted so that the cursor is in the 1117from the process mark are counter-acted so that the cursor is in the
@@ -1131,7 +1127,6 @@ the previous behavior.
1131** Xref 1127** Xref
1132 1128
1133*** When an *xref* buffer is needed, 'TAB' quits and jumps to an xref. 1129*** When an *xref* buffer is needed, 'TAB' quits and jumps to an xref.
1134
1135A new command 'xref-quit-and-goto-xref', bound to 'TAB' in *xref* 1130A new command 'xref-quit-and-goto-xref', bound to 'TAB' in *xref*
1136buffers, quits the window before jumping to the destination. In many 1131buffers, quits the window before jumping to the destination. In many
1137situations, the intended window configuration is restored, just as if 1132situations, the intended window configuration is restored, just as if
@@ -1227,11 +1222,11 @@ change FOO, respectively. The exhaustive list of removed variables is:
1227 1222
1228*** Many variables obsoleted in 22.1 referring to face symbols. 1223*** Many variables obsoleted in 22.1 referring to face symbols.
1229 1224
1230** The variable 'text-quoting-style' is now a customizable option. It 1225** The variable 'text-quoting-style' is now a customizable option.
1231controls whether to and how to translate ASCII quotes in messages and 1226It controls whether to and how to translate ASCII quotes in messages
1232help output. Its possible values and their semantics remain unchanged 1227and help output. Its possible values and their semantics remain
1233from Emacs 25. In particular, when this variable's value is 'grave', 1228unchanged from Emacs 25. In particular, when this variable's value is
1234all quotes in formats are output as-is. 1229'grave', all quotes in formats are output as-is.
1235 1230
1236** Functions like 'check-declare-file' and 'check-declare-directory' 1231** Functions like 'check-declare-file' and 'check-declare-directory'
1237now generate less chatter and more-compact diagnostics. The auxiliary 1232now generate less chatter and more-compact diagnostics. The auxiliary
@@ -1495,10 +1490,11 @@ to provide region boundaries (for rectangular regions more than one)
1495to an interactively callable function as a single argument instead of 1490to an interactively callable function as a single argument instead of
1496two separate arguments 'region-beginning' and 'region-end'. 1491two separate arguments 'region-beginning' and 'region-end'.
1497 1492
1498** 'parse-partial-sexp' state has a new element. Element 10 is 1493** 'parse-partial-sexp' state has a new element.
1499non-nil when the last character scanned might be the first character 1494Element 10 is non-nil when the last character scanned might be the
1500of a two character construct, i.e., a comment delimiter or escaped 1495first character of a two character construct, i.e., a comment
1501character. Its value is the syntax of that last character. 1496delimiter or escaped character. Its value is the syntax of that last
1497character.
1502 1498
1503** 'parse-partial-sexp's state, element 9, has now been confirmed as 1499** 'parse-partial-sexp's state, element 9, has now been confirmed as
1504permanent and documented, and may be used by Lisp programs. Its value 1500permanent and documented, and may be used by Lisp programs. Its value
@@ -1762,8 +1758,9 @@ the ELisp manual.
1762*** 'select-frame-by-name' now may return a frame on another display 1758*** 'select-frame-by-name' now may return a frame on another display
1763if it does not find a suitable one on the current display. 1759if it does not find a suitable one on the current display.
1764 1760
1765** 'tcl-auto-fill-mode' is now declared obsolete. Its functionality 1761** 'tcl-auto-fill-mode' is now declared obsolete.
1766can be replicated simply by setting 'comment-auto-fill-only-comments'. 1762Its functionality can be replicated simply by setting
1763'comment-auto-fill-only-comments'.
1767 1764
1768** New pcase pattern 'rx' to match against an rx-style regular expression. 1765** New pcase pattern 'rx' to match against an rx-style regular expression.
1769For details, see the doc string of 'rx--pcase-macroexpander'. 1766For details, see the doc string of 'rx--pcase-macroexpander'.
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index fe59b52c759..a1fae225742 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -1135,7 +1135,7 @@ is running. If gnome-settings-daemon is not running, Emacs receives
1135input through XIM without any problem. Furthermore, this seems only 1135input through XIM without any problem. Furthermore, this seems only
1136to happen in *.UTF-8 locales; zh_CN.GB2312 and zh_CN.GBK locales, for 1136to happen in *.UTF-8 locales; zh_CN.GB2312 and zh_CN.GBK locales, for
1137example, work fine. A bug report has been filed in the Gnome 1137example, work fine. A bug report has been filed in the Gnome
1138bugzilla: http://bugzilla.gnome.org/show_bug.cgi?id=357032 1138bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=357032
1139 1139
1140*** Gnome: GPaste clipboard manager causes erratic behavior of 'yank' 1140*** Gnome: GPaste clipboard manager causes erratic behavior of 'yank'
1141 1141
diff --git a/lisp/files-x.el b/lisp/files-x.el
index 2a52792222d..92532e85f4f 100644
--- a/lisp/files-x.el
+++ b/lisp/files-x.el
@@ -377,7 +377,9 @@ from the -*- line ignoring the input argument VALUE."
377 ((eq variable 'mode) (goto-char beg)) 377 ((eq variable 'mode) (goto-char beg))
378 ((null replaced-pos) (goto-char end)) 378 ((null replaced-pos) (goto-char end))
379 (replaced-pos (goto-char replaced-pos))) 379 (replaced-pos (goto-char replaced-pos)))
380 (if (and (not (eq (char-before) ?\;)) 380 (if (and (save-excursion
381 (skip-chars-backward " \t")
382 (not (eq (char-before) ?\;)))
381 (not (equal (point) (marker-position beg))) 383 (not (equal (point) (marker-position beg)))
382 ;; When existing `-*- -*-' is empty, beg > end. 384 ;; When existing `-*- -*-' is empty, beg > end.
383 (not (> (marker-position beg) (marker-position end)))) 385 (not (> (marker-position beg) (marker-position end))))
diff --git a/lisp/international/mule-conf.el b/lisp/international/mule-conf.el
index 3affeec03ea..b08150a1499 100644
--- a/lisp/international/mule-conf.el
+++ b/lisp/international/mule-conf.el
@@ -1304,6 +1304,11 @@ is treated as a character."
1304 :bom '(utf-8-with-signature . utf-8)) 1304 :bom '(utf-8-with-signature . utf-8))
1305 1305
1306(define-coding-system-alias 'mule-utf-8 'utf-8) 1306(define-coding-system-alias 'mule-utf-8 'utf-8)
1307;; See this page:
1308;; https://docs.microsoft.com/en-us/windows/desktop/intl/code-page-identifiers
1309;; Starting with Windows 10, people are trying to set their systems to
1310;; use UTF-8 , so we had better recognized this alias:
1311(define-coding-system-alias 'cp65001 'utf-8)
1307 1312
1308(define-coding-system 'utf-8-emacs 1313(define-coding-system 'utf-8-emacs
1309 "Support for all Emacs characters (including non-Unicode characters)." 1314 "Support for all Emacs characters (including non-Unicode characters)."
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 50a30cf6c36..6f6b06266ef 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -457,7 +457,7 @@ INIT is either the initial content of the field or a function,
457which is called to determine the initial content of the field. 457which is called to determine the initial content of the field.
458ALTERNATIVE if non-nil is an integer that numbers sets of 458ALTERNATIVE if non-nil is an integer that numbers sets of
459alternatives, starting from zero." 459alternatives, starting from zero."
460 :group 'BibTeX 460 :group 'bibtex
461 :version "26.1" ; add Conference 461 :version "26.1" ; add Conference
462 :type 'bibtex-entry-alist) 462 :type 'bibtex-entry-alist)
463(put 'bibtex-BibTeX-entry-alist 'risky-local-variable t) 463(put 'bibtex-BibTeX-entry-alist 'risky-local-variable t)
diff --git a/nt/addpm.c b/nt/addpm.c
index ec7d7ff52db..21320206d6e 100644
--- a/nt/addpm.c
+++ b/nt/addpm.c
@@ -38,9 +38,12 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
38#include <stdio.h> 38#include <stdio.h>
39#include <malloc.h> 39#include <malloc.h>
40 40
41/* MinGW64 barfs if _WIN32_IE is defined to anything below 0x500. */ 41/* MinGW64 barfs if _WIN32_IE is defined to anything below 0x0500. */
42#ifndef MINGW_W64 42#ifndef MINGW_W64
43#define _WIN32_IE 0x400 43# ifdef _WIN32_IE
44# undef _WIN32_IE
45# endif
46#define _WIN32_IE 0x0400
44#endif 47#endif
45/* Request C Object macros for COM interfaces. */ 48/* Request C Object macros for COM interfaces. */
46#define COBJMACROS 1 49#define COBJMACROS 1
diff --git a/src/emacs-module.c b/src/emacs-module.c
index e7ba17426bf..f2844c40d0f 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -344,20 +344,20 @@ module_free_global_ref (emacs_env *env, emacs_value ref)
344 Lisp_Object globals = global_env_private.values; 344 Lisp_Object globals = global_env_private.values;
345 Lisp_Object prev = Qnil; 345 Lisp_Object prev = Qnil;
346 ptrdiff_t count = 0; 346 ptrdiff_t count = 0;
347 for (Lisp_Object tail = global_env_private.values; CONSP (tail); 347 for (Lisp_Object tail = globals; CONSP (tail);
348 tail = XCDR (tail)) 348 tail = XCDR (tail))
349 { 349 {
350 emacs_value global = xmint_pointer (XCAR (globals)); 350 emacs_value global = xmint_pointer (XCAR (tail));
351 if (global == ref) 351 if (global == ref)
352 { 352 {
353 if (NILP (prev)) 353 if (NILP (prev))
354 global_env_private.values = XCDR (globals); 354 global_env_private.values = XCDR (globals);
355 else 355 else
356 XSETCDR (prev, XCDR (globals)); 356 XSETCDR (prev, XCDR (tail));
357 return; 357 return;
358 } 358 }
359 ++count; 359 ++count;
360 prev = globals; 360 prev = tail;
361 } 361 }
362 module_abort ("Global value was not found in list of %"pD"d globals", 362 module_abort ("Global value was not found in list of %"pD"d globals",
363 count); 363 count);
diff --git a/src/w32console.c b/src/w32console.c
index 6c3cf06bfd3..9f9db68f0ef 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -140,23 +140,36 @@ w32con_clear_frame (struct frame *f)
140} 140}
141 141
142 142
143static struct glyph glyph_base[256]; 143static struct glyph glyph_base[80];
144static struct glyph *glyphs = glyph_base;
145static size_t glyphs_len = ARRAYELTS (glyph_base);
144static BOOL ceol_initialized = FALSE; 146static BOOL ceol_initialized = FALSE;
145 147
146/* Clear from Cursor to end (what's "standout marker"?). */ 148/* Clear from Cursor to end (what's "standout marker"?). */
147static void 149static void
148w32con_clear_end_of_line (struct frame *f, int end) 150w32con_clear_end_of_line (struct frame *f, int end)
149{ 151{
152 /* Time to reallocate our "empty row"? With today's large screens,
153 it is not unthinkable to see TTY frames well in excess of
154 80-character width. */
155 if (end - cursor_coords.X > glyphs_len)
156 {
157 if (glyphs == glyph_base)
158 glyphs = NULL;
159 glyphs = xrealloc (glyphs, FRAME_COLS (f) * sizeof (struct glyph));
160 glyphs_len = FRAME_COLS (f);
161 ceol_initialized = FALSE;
162 }
150 if (!ceol_initialized) 163 if (!ceol_initialized)
151 { 164 {
152 int i; 165 int i;
153 for (i = 0; i < 256; i++) 166 for (i = 0; i < glyphs_len; i++)
154 { 167 {
155 memcpy (&glyph_base[i], &space_glyph, sizeof (struct glyph)); 168 memcpy (&glyphs[i], &space_glyph, sizeof (struct glyph));
156 } 169 }
157 ceol_initialized = TRUE; 170 ceol_initialized = TRUE;
158 } 171 }
159 w32con_write_glyphs (f, glyph_base, end - cursor_coords.X); /* fencepost ? */ 172 w32con_write_glyphs (f, glyphs, end - cursor_coords.X);
160} 173}
161 174
162/* Insert n lines at vpos. if n is negative delete -n lines. */ 175/* Insert n lines at vpos. if n is negative delete -n lines. */
@@ -772,6 +785,15 @@ initialize_w32_display (struct terminal *term, int *width, int *height)
772 *width = 1 + info.srWindow.Right - info.srWindow.Left; 785 *width = 1 + info.srWindow.Right - info.srWindow.Left;
773 } 786 }
774 787
788 /* Force reinitialization of the "empty row" buffer, in case they
789 dumped from a running session. */
790 if (glyphs != glyph_base)
791 {
792 glyphs = NULL;
793 glyphs_len = 0;
794 ceol_initialized = FALSE;
795 }
796
775 if (os_subtype == OS_NT) 797 if (os_subtype == OS_NT)
776 w32_console_unicode_input = 1; 798 w32_console_unicode_input = 1;
777 else 799 else
diff --git a/test/Makefile.in b/test/Makefile.in
index 0bc893bc0c6..a1f43882881 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -246,12 +246,14 @@ else
246FPIC_CFLAGS = -fPIC 246FPIC_CFLAGS = -fPIC
247endif 247endif
248 248
249# Note: emacs-module.h is generated from emacs-module.h.in, hence we
250# look in ../src, not $(srcdir)/../src.
249MODULE_CFLAGS = -I../src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \ 251MODULE_CFLAGS = -I../src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \
250 $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS) 252 $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS)
251 253
252test_module = $(test_module_dir)/mod-test${SO} 254test_module = $(test_module_dir)/mod-test${SO}
253src/emacs-module-tests.log: $(test_module) 255src/emacs-module-tests.log: $(test_module)
254$(test_module): $(test_module:${SO}=.c) $(srcdir)/../src/emacs-module.h 256$(test_module): $(test_module:${SO}=.c) ../src/emacs-module.h
255 $(AM_V_at)${MKDIR_P} $(dir $@) 257 $(AM_V_at)${MKDIR_P} $(dir $@)
256 $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \ 258 $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \
257 -o $@ $< 259 -o $@ $<
diff --git a/test/data/emacs-module/mod-test.c b/test/data/emacs-module/mod-test.c
index db05e90bc49..a9b459b4cc4 100644
--- a/test/data/emacs-module/mod-test.c
+++ b/test/data/emacs-module/mod-test.c
@@ -156,6 +156,24 @@ Fmod_test_globref_make (emacs_env *env, ptrdiff_t nargs, emacs_value args[],
156 return env->make_global_ref (env, lisp_str); 156 return env->make_global_ref (env, lisp_str);
157} 157}
158 158
159/* Create a few global references from arguments and free them. */
160static emacs_value
161Fmod_test_globref_free (emacs_env *env, ptrdiff_t nargs, emacs_value args[],
162 void *data)
163{
164 emacs_value refs[10];
165 for (int i = 0; i < 10; i++)
166 {
167 refs[i] = env->make_global_ref (env, args[i % nargs]);
168 }
169 for (int i = 0; i < 10; i++)
170 {
171 env->free_global_ref (env, refs[i]);
172 }
173 return env->intern (env, "ok");
174}
175
176
159 177
160/* Return a copy of the argument string where every 'a' is replaced 178/* Return a copy of the argument string where every 'a' is replaced
161 with 'b'. */ 179 with 'b'. */
@@ -339,6 +357,7 @@ emacs_module_init (struct emacs_runtime *ert)
339 DEFUN ("mod-test-non-local-exit-funcall", Fmod_test_non_local_exit_funcall, 357 DEFUN ("mod-test-non-local-exit-funcall", Fmod_test_non_local_exit_funcall,
340 1, 1, NULL, NULL); 358 1, 1, NULL, NULL);
341 DEFUN ("mod-test-globref-make", Fmod_test_globref_make, 0, 0, NULL, NULL); 359 DEFUN ("mod-test-globref-make", Fmod_test_globref_make, 0, 0, NULL, NULL);
360 DEFUN ("mod-test-globref-free", Fmod_test_globref_free, 4, 4, NULL, NULL);
342 DEFUN ("mod-test-string-a-to-b", Fmod_test_string_a_to_b, 1, 1, NULL, NULL); 361 DEFUN ("mod-test-string-a-to-b", Fmod_test_string_a_to_b, 1, 1, NULL, NULL);
343 DEFUN ("mod-test-userptr-make", Fmod_test_userptr_make, 1, 1, NULL, NULL); 362 DEFUN ("mod-test-userptr-make", Fmod_test_userptr_make, 1, 1, NULL, NULL);
344 DEFUN ("mod-test-userptr-get", Fmod_test_userptr_get, 1, 1, NULL, NULL); 363 DEFUN ("mod-test-userptr-get", Fmod_test_userptr_get, 1, 1, NULL, NULL);
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el
index 90cd37a98a5..c67190be5cb 100644
--- a/test/src/emacs-module-tests.el
+++ b/test/src/emacs-module-tests.el
@@ -148,6 +148,9 @@ changes."
148 (garbage-collect) ;; XXX: not enough to really test but it's something.. 148 (garbage-collect) ;; XXX: not enough to really test but it's something..
149 (should (string= ref-str mod-str)))) 149 (should (string= ref-str mod-str))))
150 150
151(ert-deftest mod-test-globref-free-test ()
152 (should (eq (mod-test-globref-free 1 'a "test" 'b) 'ok)))
153
151(ert-deftest mod-test-string-a-to-b-test () 154(ert-deftest mod-test-string-a-to-b-test ()
152 (should (string= (mod-test-string-a-to-b "aaa") "bbb"))) 155 (should (string= (mod-test-string-a-to-b "aaa") "bbb")))
153 156