aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Wiegley2016-01-11 22:48:07 -0800
committerJohn Wiegley2016-01-11 22:48:07 -0800
commit9278e970c5319672a05c7bce6358af0e2794205b (patch)
treeb3a738be931667a47ecd86e36ad6a8359dcac037
parenteb0643c74d391ac33168ba64351a2f318c850966 (diff)
parent6ee327d8a10047c1717358cc179ed8d1fb3389eb (diff)
downloademacs-9278e970c5319672a05c7bce6358af0e2794205b.tar.gz
emacs-9278e970c5319672a05c7bce6358af0e2794205b.zip
Merge from origin/emacs-25
6ee327d Add handle_user_signal_hook 47580e0 Avoid writing to purespace 0588be7 Remove unused variable 89e7483 * configure.ac: Find libxml2 headers in Xcode SDK dir on Darwin. 3b95e9c Use posix_openpt instead of openpty on Darwin 86312ff Document support for ':documentation' in Lisp mode c930e75b Document new features of TeX mode 7c83d84 Clarify docs of hscroll in RTL text 4c8f8db Fix rendering of HTML pages that use character composition a8d37ca Avoid some compiler warnings in w32.c ce106f3de Undo ill-advised change be0bba4 Unbreak completion in python-mode buffers
-rw-r--r--configure.ac23
-rw-r--r--doc/emacs/programs.texi18
-rw-r--r--doc/emacs/text.texi8
-rw-r--r--doc/lispref/windows.texi17
-rw-r--r--etc/NEWS7
-rw-r--r--lisp/emacs-lisp/lisp-mode.el9
-rw-r--r--lisp/international/mule-cmds.el2
-rw-r--r--lisp/progmodes/python.el4
-rw-r--r--lisp/progmodes/xref.el2
-rw-r--r--src/alloc.c13
-rw-r--r--src/character.h2
-rw-r--r--src/indent.c9
-rw-r--r--src/keyboard.c5
-rw-r--r--src/keyboard.h2
-rw-r--r--src/lisp.h4
-rw-r--r--src/w32.c20
16 files changed, 95 insertions, 50 deletions
diff --git a/configure.ac b/configure.ac
index 0aa863afe34..62bf9cff84a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3638,6 +3638,14 @@ if test "${with_xml2}" != "no"; then
3638 # Built-in libxml2 on OS X 10.8 lacks libxml-2.0.pc. 3638 # Built-in libxml2 on OS X 10.8 lacks libxml-2.0.pc.
3639 if test "${HAVE_LIBXML2}" != "yes" && test "$opsys" = "darwin"; then 3639 if test "${HAVE_LIBXML2}" != "yes" && test "$opsys" = "darwin"; then
3640 SAVE_CPPFLAGS="$CPPFLAGS" 3640 SAVE_CPPFLAGS="$CPPFLAGS"
3641 if test -z "$xcsdkdir" -a -n "$XCRUN" -a ! -d /usr/include; then
3642 dnl /usr/include is not found. Try Xcode SDK dir if it is sane.
3643 xcsdkdir=`$XCRUN --show-sdk-path 2>/dev/null`
3644 case $xcsdkdir in
3645 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
3646 xcsdkdir="" ;;
3647 esac
3648 fi
3641 CPPFLAGS="$CPPFLAGS -I$xcsdkdir/usr/include/libxml2" 3649 CPPFLAGS="$CPPFLAGS -I$xcsdkdir/usr/include/libxml2"
3642 AC_CHECK_HEADER(libxml/HTMLparser.h, 3650 AC_CHECK_HEADER(libxml/HTMLparser.h,
3643 [AC_CHECK_DECL(HTML_PARSE_RECOVER, HAVE_LIBXML2=yes, , 3651 [AC_CHECK_DECL(HTML_PARSE_RECOVER, HAVE_LIBXML2=yes, ,
@@ -4433,24 +4441,11 @@ case $opsys in
4433 AC_DEFINE(PTY_TTY_NAME_SPRINTF, []) 4441 AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
4434 ;; 4442 ;;
4435 4443
4436 dnl FIXME? Maybe use same as freebsd - see bug#12040.
4437 darwin )
4438 AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)])
4439 dnl Not used, because PTY_ITERATION is defined.
4440 AC_DEFINE(FIRST_PTY_LETTER, ['p'])
4441 dnl Note that openpty may fork via grantpt on Mac OS X 10.4/Darwin 8.
4442 dnl But we don't have to block SIGCHLD because it is blocked in the
4443 dnl implementation of grantpt.
4444 AC_DEFINE(PTY_OPEN, [ do { int slave; if (openpty (&fd, &slave, pty_name, NULL, NULL) == -1) fd = -1; else emacs_close (slave); } while (false)])
4445 AC_DEFINE(PTY_NAME_SPRINTF, [])
4446 AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
4447 ;;
4448
4449 gnu | openbsd ) 4444 gnu | openbsd )
4450 AC_DEFINE(FIRST_PTY_LETTER, ['p']) 4445 AC_DEFINE(FIRST_PTY_LETTER, ['p'])
4451 ;; 4446 ;;
4452 4447
4453 gnu-linux | gnu-kfreebsd | dragonfly | freebsd | netbsd | nacl ) 4448 gnu-linux | gnu-kfreebsd | dragonfly | freebsd | netbsd | darwin | nacl )
4454 dnl if HAVE_GRANTPT 4449 dnl if HAVE_GRANTPT
4455 if test "x$ac_cv_func_grantpt" = xyes; then 4450 if test "x$ac_cv_func_grantpt" = xyes; then
4456 AC_DEFINE(UNIX98_PTYS, 1, [Define if the system has Unix98 PTYs.]) 4451 AC_DEFINE(UNIX98_PTYS, 1, [Define if the system has Unix98 PTYs.])
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 8423b70203c..83695b12134 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -1530,14 +1530,16 @@ with the Foldout package (@pxref{Foldout}).
1530 Prettify Symbols mode is a buffer-local minor mode that replaces 1530 Prettify Symbols mode is a buffer-local minor mode that replaces
1531certain strings with more attractive versions for display purposes. 1531certain strings with more attractive versions for display purposes.
1532For example, in Emacs Lisp mode, it replaces the string @samp{lambda} 1532For example, in Emacs Lisp mode, it replaces the string @samp{lambda}
1533with the Greek lambda character @samp{λ}. You may wish to use this in 1533with the Greek lambda character @samp{λ}. In a @TeX{} buffer, it will
1534non-programming modes as well. You can customize the mode by adding 1534replace @samp{\alpha} @dots{} @samp{\omega} and other math macros with
1535more entries to @code{prettify-symbols-alist}. More elaborate 1535their Unicode characters. You may wish to use this in non-programming
1536customization is available via customizing 1536modes as well. You can customize the mode by adding more entries to
1537@code{prettify-symbols-compose-predicate} if its default value 1537@code{prettify-symbols-alist}. More elaborate customization is
1538@code{prettify-symbols-default-compose-p} is not appropriate. There 1538available via customizing @code{prettify-symbols-compose-predicate} if
1539is also a global version, @code{global-prettify-symbols-mode}, which 1539its default value @code{prettify-symbols-default-compose-p} is not
1540enables the mode in all buffers that support it. 1540appropriate. There is also a global version,
1541@code{global-prettify-symbols-mode}, which enables the mode in all
1542buffers that support it.
1541 1543
1542 The symbol at point can be shown in its original form. This is 1544 The symbol at point can be shown in its original form. This is
1543controlled by the variable @code{prettify-symbols-unprettify-at-point}: 1545controlled by the variable @code{prettify-symbols-unprettify-at-point}:
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
index bab660e1e10..3e8e0ace587 100644
--- a/doc/emacs/text.texi
+++ b/doc/emacs/text.texi
@@ -1717,6 +1717,7 @@ such as @code{"/tmp"}.
1717@vindex latex-run-command 1717@vindex latex-run-command
1718@vindex tex-dvi-view-command 1718@vindex tex-dvi-view-command
1719@vindex tex-dvi-print-command 1719@vindex tex-dvi-print-command
1720@vindex tex-print-file-extension
1720 The buffer's @TeX{} variant determines what shell command @kbd{C-c 1721 The buffer's @TeX{} variant determines what shell command @kbd{C-c
1721C-b} actually runs. In Plain @TeX{} mode, it is specified by the 1722C-b} actually runs. In Plain @TeX{} mode, it is specified by the
1722variable @code{tex-run-command}, which defaults to @code{"tex"}. In 1723variable @code{tex-run-command}, which defaults to @code{"tex"}. In
@@ -1725,7 +1726,12 @@ defaults to @code{"latex"}. The shell command that @kbd{C-c C-v} runs
1725to view the @file{.dvi} output is determined by the variable 1726to view the @file{.dvi} output is determined by the variable
1726@code{tex-dvi-view-command}, regardless of the @TeX{} variant. The 1727@code{tex-dvi-view-command}, regardless of the @TeX{} variant. The
1727shell command that @kbd{C-c C-p} runs to print the output is 1728shell command that @kbd{C-c C-p} runs to print the output is
1728determined by the variable @code{tex-dvi-print-command}. 1729determined by the variable @code{tex-dvi-print-command}. The variable
1730@code{tex-print-file-extension} can be set to the required file
1731extension for viewing and printing @TeX{}-compiled files. For
1732example, you can set it to @file{.pdf}, and update
1733@code{tex-dvi-view-command} and @code{tex-dvi-print-command}
1734accordingly.
1729 1735
1730 Normally, Emacs automatically appends the output file name to the 1736 Normally, Emacs automatically appends the output file name to the
1731shell command strings described in the preceding paragraph. For 1737shell command strings described in the preceding paragraph. For
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index e45201b0570..778e38bf251 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -3706,6 +3706,11 @@ The return value is the total amount of leftward horizontal scrolling in
3706effect after the change---just like the value returned by 3706effect after the change---just like the value returned by
3707@code{window-hscroll} (below). 3707@code{window-hscroll} (below).
3708 3708
3709Note that text in paragraphs whose base direction is right-to-left
3710(@pxref{Bidirectional Display}) moves in the opposite direction: e.g.,
3711it moves to the right when @code{scroll-left} is invoked with a
3712positive value of @var{count}.
3713
3709Once you scroll a window as far right as it can go, back to its normal 3714Once you scroll a window as far right as it can go, back to its normal
3710position where the total leftward scrolling is zero, attempts to scroll 3715position where the total leftward scrolling is zero, attempts to scroll
3711any farther right have no effect. 3716any farther right have no effect.
@@ -3727,8 +3732,9 @@ of scrolling, this works just like @code{scroll-left}.
3727@defun window-hscroll &optional window 3732@defun window-hscroll &optional window
3728This function returns the total leftward horizontal scrolling of 3733This function returns the total leftward horizontal scrolling of
3729@var{window}---the number of columns by which the text in @var{window} 3734@var{window}---the number of columns by which the text in @var{window}
3730is scrolled left past the left margin. The default for 3735is scrolled left past the left margin. (In right-to-left paragraphs,
3731@var{window} is the selected window. 3736the value is the total amount of the rightward scrolling instead.)
3737The default for @var{window} is the selected window.
3732 3738
3733The return value is never negative. It is zero when no horizontal 3739The return value is never negative. It is zero when no horizontal
3734scrolling has been done in @var{window} (which is usually the case). 3740scrolling has been done in @var{window} (which is usually the case).
@@ -3753,9 +3759,10 @@ scrolling has been done in @var{window} (which is usually the case).
3753@defun set-window-hscroll window columns 3759@defun set-window-hscroll window columns
3754This function sets horizontal scrolling of @var{window}. The value of 3760This function sets horizontal scrolling of @var{window}. The value of
3755@var{columns} specifies the amount of scrolling, in terms of columns 3761@var{columns} specifies the amount of scrolling, in terms of columns
3756from the left margin. The argument @var{columns} should be zero or 3762from the left margin (right margin in right-to-left paragraphs). The
3757positive; if not, it is taken as zero. Fractional values of 3763argument @var{columns} should be zero or positive; if not, it is taken
3758@var{columns} are not supported at present. 3764as zero. Fractional values of @var{columns} are not supported at
3765present.
3759 3766
3760Note that @code{set-window-hscroll} may appear not to work if you test 3767Note that @code{set-window-hscroll} may appear not to work if you test
3761it by evaluating a call with @kbd{M-:} in a simple way. What happens 3768it by evaluating a call with @kbd{M-:} in a simple way. What happens
diff --git a/etc/NEWS b/etc/NEWS
index 8907f7ad453..39fb3e19b5b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -706,7 +706,12 @@ respectively, `show-paren-when-point-inside-paren' or
706`show-paren-when-point-in-periphery'. 706`show-paren-when-point-in-periphery'.
707 707
708** Lisp mode 708** Lisp mode
709
710---
709*** Strings after `:documentation' are highlighted as docstrings. 711*** Strings after `:documentation' are highlighted as docstrings.
712This enhances Lisp mode fontification to handle documentation of the
713form `(:documentation "the doc string")' used in Common Lisp code for
714CLOS class and slot documentation.
710 715
711** Rectangle editing 716** Rectangle editing
712 717
@@ -953,9 +958,11 @@ name patterns (e.g. all "FOR_DOXYGEN_ONLY_*") to be excluded.
953 958
954** TeX mode 959** TeX mode
955 960
961+++
956*** New custom variable `tex-print-file-extension' to help users who 962*** New custom variable `tex-print-file-extension' to help users who
957use PDF instead of DVI. 963use PDF instead of DVI.
958 964
965+++
959*** TeX mode now supports Prettify Symbols mode. When enabling 966*** TeX mode now supports Prettify Symbols mode. When enabling
960`prettify-symbols-mode' in a tex-mode buffer, \alpha ... \omega, and 967`prettify-symbols-mode' in a tex-mode buffer, \alpha ... \omega, and
961many other math macros are displayed using unicode characters. 968many other math macros are displayed using unicode characters.
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 3448b72c3f1..e99f8a55ab1 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -488,6 +488,9 @@ This will generate compile-time constants from BINDINGS."
488 "Default expressions to highlight in Lisp modes.") 488 "Default expressions to highlight in Lisp modes.")
489 489
490(defun lisp-string-in-doc-position-p (listbeg startpos) 490(defun lisp-string-in-doc-position-p (listbeg startpos)
491 "Return true if a doc string may occur at STARTPOS inside a list.
492LISTBEG is the position of the start of the innermost list
493containing STARTPOS."
491 (let* ((firstsym (and listbeg 494 (let* ((firstsym (and listbeg
492 (save-excursion 495 (save-excursion
493 (goto-char listbeg) 496 (goto-char listbeg)
@@ -518,6 +521,9 @@ This will generate compile-time constants from BINDINGS."
518 (= (point) startpos)))))) 521 (= (point) startpos))))))
519 522
520(defun lisp-string-after-doc-keyword-p (listbeg startpos) 523(defun lisp-string-after-doc-keyword-p (listbeg startpos)
524 "Return true if `:documentation' symbol ends at STARTPOS inside a list.
525LISTBEG is the position of the start of the innermost list
526containing STARTPOS."
521 (and listbeg ; We are inside a Lisp form. 527 (and listbeg ; We are inside a Lisp form.
522 (save-excursion 528 (save-excursion
523 (goto-char startpos) 529 (goto-char startpos)
@@ -526,6 +532,9 @@ This will generate compile-time constants from BINDINGS."
526 (looking-at ":documentation\\_>")))))) 532 (looking-at ":documentation\\_>"))))))
527 533
528(defun lisp-font-lock-syntactic-face-function (state) 534(defun lisp-font-lock-syntactic-face-function (state)
535 "Return syntactic face function for the position represented by STATE.
536STATE is a `parse-partial-sexp' state, and the returned function is the
537Lisp font lock syntactic face function."
529 (if (nth 3 state) 538 (if (nth 3 state)
530 ;; This might be a (doc)string or a |...| symbol. 539 ;; This might be a (doc)string or a |...| symbol.
531 (let ((startpos (nth 8 state))) 540 (let ((startpos (nth 8 state)))
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 0904ff93e23..690ea6f7533 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -35,8 +35,6 @@
35(defvar dos-codepage) 35(defvar dos-codepage)
36(autoload 'widget-value "wid-edit") 36(autoload 'widget-value "wid-edit")
37 37
38(defvar mac-system-coding-system)
39
40;;; MULE related key bindings and menus. 38;;; MULE related key bindings and menus.
41 39
42(defvar mule-keymap 40(defvar mule-keymap
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 04542cdff3d..c9235129f98 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3569,7 +3569,9 @@ using that one instead of current buffer's process."
3569 (forward-char (length (match-string-no-properties 0))) 3569 (forward-char (length (match-string-no-properties 0)))
3570 (point)))) 3570 (point))))
3571 (end (point)) 3571 (end (point))
3572 (prompt-boundaries (python-util-comint-last-prompt)) 3572 (prompt-boundaries
3573 (with-current-buffer (process-buffer process)
3574 (python-util-comint-last-prompt)))
3573 (prompt 3575 (prompt
3574 (with-current-buffer (process-buffer process) 3576 (with-current-buffer (process-buffer process)
3575 (when prompt-boundaries 3577 (when prompt-boundaries
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index abb9cc6361d..00f348929ef 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -886,7 +886,7 @@ IGNORES is a list of glob patterns."
886 hits))) 886 hits)))
887 (unwind-protect 887 (unwind-protect
888 (cl-mapcan (lambda (hit) (xref--collect-matches hit regexp)) 888 (cl-mapcan (lambda (hit) (xref--collect-matches hit regexp))
889 hits) 889 (nreverse hits))
890 ;; TODO: Same as above. 890 ;; TODO: Same as above.
891 (mapc #'kill-buffer 891 (mapc #'kill-buffer
892 (cl-set-difference (buffer-list) orig-buffers))))) 892 (cl-set-difference (buffer-list) orig-buffers)))))
diff --git a/src/alloc.c b/src/alloc.c
index fe55cde49c9..49f5b7f18bc 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -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
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/indent.c b/src/indent.c
index 33bf424b344..ec38ea798c7 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -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/keyboard.c b/src/keyboard.c
index eb2c7563afd..8be1cd5c0fb 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -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..4558bd61414 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -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/lisp.h b/src/lisp.h
index ff88605fc9f..ce05b4dee49 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -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; \
diff --git a/src/w32.c b/src/w32.c
index 9b1d94de786..773290fc2f0 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -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);
@@ -7495,7 +7495,7 @@ socket_to_fd (SOCKET s)
7495 though the socket wasn't really a kernel handle, 7495 though the socket wasn't really a kernel handle,
7496 because a real handle has the same value. So 7496 because a real handle has the same value. So
7497 test whether the new handle really is a socket. */ 7497 test whether the new handle really is a socket. */
7498 long nonblocking = 0; 7498 unsigned long nonblocking = 0;
7499 if (pfn_ioctlsocket ((SOCKET) new_s, FIONBIO, &nonblocking) == 0) 7499 if (pfn_ioctlsocket ((SOCKET) new_s, FIONBIO, &nonblocking) == 0)
7500 { 7500 {
7501 pfn_closesocket (s); 7501 pfn_closesocket (s);
@@ -8520,7 +8520,7 @@ sys_write (int fd, const void * buffer, unsigned int count)
8520 int nbytes = count; 8520 int nbytes = count;
8521 8521
8522 SAFE_NALLOCA (tmpbuf, 2, count); 8522 SAFE_NALLOCA (tmpbuf, 2, count);
8523 dst = tmpbuf; 8523 dst = (unsigned char *)tmpbuf;
8524 8524
8525 while (1) 8525 while (1)
8526 { 8526 {
@@ -9062,8 +9062,8 @@ check_windows_init_file (void)
9062 if (fd < 0) 9062 if (fd < 0)
9063 { 9063 {
9064 Lisp_Object load_path_print = Fprin1_to_string (Vload_path, Qnil); 9064 Lisp_Object load_path_print = Fprin1_to_string (Vload_path, Qnil);
9065 char *init_file_name = SDATA (init_file); 9065 char *init_file_name = SSDATA (init_file);
9066 char *load_path = SDATA (load_path_print); 9066 char *load_path = SSDATA (load_path_print);
9067 char *buffer = alloca (1024 9067 char *buffer = alloca (1024
9068 + strlen (init_file_name) 9068 + strlen (init_file_name)
9069 + strlen (load_path)); 9069 + strlen (load_path));