aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2012-09-11 17:18:45 +0200
committerJoakim Verona2012-09-11 17:18:45 +0200
commit0cc36550df4f355a1b46e944fc65e533ff0df90e (patch)
tree100e4130dffa88423b6430c2814f740007b72269
parentb035a30e5cd2f34fedc04c253eeb5a11afed8145 (diff)
parent96d0357142bf277e6eb4d957a59b2c655034e2b7 (diff)
downloademacs-0cc36550df4f355a1b46e944fc65e533ff0df90e.tar.gz
emacs-0cc36550df4f355a1b46e944fc65e533ff0df90e.zip
upstream
-rw-r--r--Makefile.in6
-rw-r--r--admin/CPP-DEFINES4
-rw-r--r--autogen/config.in6
-rw-r--r--doc/lispref/numbers.texi35
-rw-r--r--etc/NEWS19
-rw-r--r--lisp/gnus/gnus-notifications.el6
-rw-r--r--lisp/help-fns.el2
-rw-r--r--lisp/minibuffer.el6
-rw-r--r--lisp/progmodes/sql.el42
-rw-r--r--lisp/vc/diff-mode.el2
-rw-r--r--src/alloc.c2
-rw-r--r--src/buffer.c32
-rw-r--r--src/buffer.h5
-rw-r--r--src/data.c4
-rw-r--r--src/editfns.c6
-rw-r--r--src/insdel.c2
-rw-r--r--src/lisp.h3
-rw-r--r--src/lread.c2
-rw-r--r--src/marker.c8
-rw-r--r--src/minibuf.c2
-rw-r--r--src/nsterm.m9
-rw-r--r--src/print.c2
-rw-r--r--src/process.c4
-rw-r--r--src/w32term.c1
-rw-r--r--src/xterm.c1
25 files changed, 131 insertions, 80 deletions
diff --git a/Makefile.in b/Makefile.in
index 800f11669d6..6ed32491a66 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -433,7 +433,7 @@ write_subdir=if [ -f $${subdir}/subdirs.el ]; \
433### Install the executables that were compiled specifically for this machine. 433### Install the executables that were compiled specifically for this machine.
434### We do install-arch-indep first because the executable needs the 434### We do install-arch-indep first because the executable needs the
435### Lisp files and DOC file to work properly. 435### Lisp files and DOC file to work properly.
436install-arch-dep: install-arch-indep install-doc 436install-arch-dep: src install-arch-indep install-doc
437 umask 022; ${MKDIR_P} $(DESTDIR)${bindir} 437 umask 022; ${MKDIR_P} $(DESTDIR)${bindir}
438 cd lib-src && \ 438 cd lib-src && \
439 $(MAKE) install $(MFLAGS) prefix=${prefix} \ 439 $(MAKE) install $(MFLAGS) prefix=${prefix} \
@@ -502,7 +502,7 @@ set_installuser=for installuser in $${LOGNAME} $${USERNAME} $${USER} \
502## work correctly, and therefore no idea when tar can be replaced. 502## work correctly, and therefore no idea when tar can be replaced.
503## See also these comments from 2004 about cp -r working fine: 503## See also these comments from 2004 about cp -r working fine:
504## http://lists.gnu.org/archive/html/autoconf-patches/2004-11/msg00005.html 504## http://lists.gnu.org/archive/html/autoconf-patches/2004-11/msg00005.html
505install-arch-indep: install-info install-man ${INSTALL_ARCH_INDEP_EXTRA} 505install-arch-indep: lisp leim install-info install-man ${INSTALL_ARCH_INDEP_EXTRA}
506 umask 022 ; \ 506 umask 022 ; \
507 locallisppath='${locallisppath}'; \ 507 locallisppath='${locallisppath}'; \
508 IFS=:; \ 508 IFS=:; \
@@ -573,7 +573,7 @@ install-arch-indep: install-info install-man ${INSTALL_ARCH_INDEP_EXTRA}
573 573
574## Note that install-arch-indep deletes and recreates the entire 574## Note that install-arch-indep deletes and recreates the entire
575## installed etc/ directory, so we need it to run before this does. 575## installed etc/ directory, so we need it to run before this does.
576install-doc: install-arch-indep 576install-doc: src install-arch-indep
577 -unset CDPATH; \ 577 -unset CDPATH; \
578 umask 022; ${MKDIR_P} $(DESTDIR)${docdir} ; \ 578 umask 022; ${MKDIR_P} $(DESTDIR)${docdir} ; \
579 if [ `cd ./etc; /bin/pwd` != `cd $(DESTDIR)${docdir}; /bin/pwd` ]; \ 579 if [ `cd ./etc; /bin/pwd` != `cd $(DESTDIR)${docdir}; /bin/pwd` ]; \
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES
index b40ba78e20d..cf6ffee2c63 100644
--- a/admin/CPP-DEFINES
+++ b/admin/CPP-DEFINES
@@ -120,7 +120,6 @@ HAVE_ATTRIBUTE_ALIGNED
120HAVE_BDFFONT 120HAVE_BDFFONT
121HAVE_BOXES 121HAVE_BOXES
122HAVE_C99_STRTOLD 122HAVE_C99_STRTOLD
123HAVE_CBRT
124HAVE_CFMAKERAW 123HAVE_CFMAKERAW
125HAVE_CFSETSPEED 124HAVE_CFSETSPEED
126HAVE_CLOCK_GETTIME 125HAVE_CLOCK_GETTIME
@@ -251,7 +250,6 @@ HAVE_LIBXMU
251HAVE_LINUX_VERSION_H 250HAVE_LINUX_VERSION_H
252HAVE_LOCALTIME_R 251HAVE_LOCALTIME_R
253HAVE_LOCAL_SOCKETS 252HAVE_LOCAL_SOCKETS
254HAVE_LOGB
255HAVE_LONG_FILE_NAMES 253HAVE_LONG_FILE_NAMES
256HAVE_LONG_LONG_INT 254HAVE_LONG_LONG_INT
257HAVE_LRAND48 255HAVE_LRAND48
@@ -574,7 +572,6 @@ getpid
574isatty 572isatty
575kill 573kill
576link 574link
577logb
578lseek 575lseek
579mkdir 576mkdir
580mktemp 577mktemp
@@ -616,7 +613,6 @@ fopen
616getpid 613getpid
617index 614index
618isatty 615isatty
619logb
620lseek 616lseek
621mkdir 617mkdir
622mktemp 618mktemp
diff --git a/autogen/config.in b/autogen/config.in
index 10969fd99c2..99074bd1bc5 100644
--- a/autogen/config.in
+++ b/autogen/config.in
@@ -246,9 +246,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
246/* Define to 1 if strtold conforms to C99. */ 246/* Define to 1 if strtold conforms to C99. */
247#undef HAVE_C99_STRTOLD 247#undef HAVE_C99_STRTOLD
248 248
249/* Define to 1 if you have the `cbrt' function. */
250#undef HAVE_CBRT
251
252/* Define to 1 if you have the `cfmakeraw' function. */ 249/* Define to 1 if you have the `cfmakeraw' function. */
253#undef HAVE_CFMAKERAW 250#undef HAVE_CFMAKERAW
254 251
@@ -638,9 +635,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
638/* Define to 1 if you have the `localtime_r' function. */ 635/* Define to 1 if you have the `localtime_r' function. */
639#undef HAVE_LOCALTIME_R 636#undef HAVE_LOCALTIME_R
640 637
641/* Define to 1 if you have the `logb' function. */
642#undef HAVE_LOGB
643
644/* Define to 1 if you support file names longer than 14 characters. */ 638/* Define to 1 if you support file names longer than 14 characters. */
645#undef HAVE_LONG_FILE_NAMES 639#undef HAVE_LONG_FILE_NAMES
646 640
diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi
index 17f3ee099bd..7c9672a38c0 100644
--- a/doc/lispref/numbers.texi
+++ b/doc/lispref/numbers.texi
@@ -196,6 +196,14 @@ numerical functions return such values in cases where there is no
196correct answer. For example, @code{(/ 0.0 0.0)} returns a NaN. (NaN 196correct answer. For example, @code{(/ 0.0 0.0)} returns a NaN. (NaN
197values can also carry a sign, but for practical purposes there's no 197values can also carry a sign, but for practical purposes there's no
198significant difference between different NaN values in Emacs Lisp.) 198significant difference between different NaN values in Emacs Lisp.)
199
200When a function is documented to return a NaN, it returns an
201implementation-defined value when Emacs is running on one of the
202now-rare platforms that do not use @acronym{IEEE} floating point. For
203example, @code{(log -1.0)} typically returns a NaN, but on
204non-@acronym{IEEE} platforms it returns an implementation-defined
205value.
206
199Here are the read syntaxes for these special floating point values: 207Here are the read syntaxes for these special floating point values:
200 208
201@table @asis 209@table @asis
@@ -241,7 +249,7 @@ numbers.
241 249
242@defun logb number 250@defun logb number
243This function returns the binary exponent of @var{number}. More 251This function returns the binary exponent of @var{number}. More
244precisely, the value is the logarithm of @var{number} base 2, rounded 252precisely, the value is the logarithm of |@var{number}| base 2, rounded
245down to an integer. 253down to an integer.
246 254
247@example 255@example
@@ -694,7 +702,8 @@ arguments. It also permits floating point arguments; it rounds the
694quotient downward (towards minus infinity) to an integer, and uses that 702quotient downward (towards minus infinity) to an integer, and uses that
695quotient to compute the remainder. 703quotient to compute the remainder.
696 704
697An @code{arith-error} results if @var{divisor} is 0. 705If @var{divisor} is zero, @code{mod} signals an @code{arith-error}
706error if both arguments are integers, and returns a NaN otherwise.
698 707
699@example 708@example
700@group 709@group
@@ -1096,8 +1105,8 @@ pi/2
1096@tex 1105@tex
1097@math{\pi/2} 1106@math{\pi/2}
1098@end tex 1107@end tex
1099(inclusive) whose sine is @var{arg}; if, however, @var{arg} is out of 1108(inclusive) whose sine is @var{arg}. If @var{arg} is out of range
1100range (outside [@minus{}1, 1]), it signals a @code{domain-error} error. 1109(outside [@minus{}1, 1]), @code{asin} returns a NaN.
1101@end defun 1110@end defun
1102 1111
1103@defun acos arg 1112@defun acos arg
@@ -1108,8 +1117,8 @@ pi
1108@tex 1117@tex
1109@math{\pi} 1118@math{\pi}
1110@end tex 1119@end tex
1111(inclusive) whose cosine is @var{arg}; if, however, @var{arg} is out 1120(inclusive) whose cosine is @var{arg}. If @var{arg} is out of range
1112of range (outside [@minus{}1, 1]), it signals a @code{domain-error} error. 1121(outside [@minus{}1, 1]), @code{acos} returns a NaN.
1113@end defun 1122@end defun
1114 1123
1115@defun atan y &optional x 1124@defun atan y &optional x
@@ -1141,8 +1150,8 @@ This is the exponential function; it returns @math{e} to the power
1141@defun log arg &optional base 1150@defun log arg &optional base
1142This function returns the logarithm of @var{arg}, with base 1151This function returns the logarithm of @var{arg}, with base
1143@var{base}. If you don't specify @var{base}, the natural base 1152@var{base}. If you don't specify @var{base}, the natural base
1144@math{e} is used. If @var{arg} is negative, it signals a 1153@math{e} is used. If @var{arg} or @var{base} is negative, @code{log}
1145@code{domain-error} error. 1154returns a NaN.
1146@end defun 1155@end defun
1147 1156
1148@ignore 1157@ignore
@@ -1160,21 +1169,21 @@ lose accuracy.
1160@end ignore 1169@end ignore
1161 1170
1162@defun log10 arg 1171@defun log10 arg
1163This function returns the logarithm of @var{arg}, with base 10. If 1172This function returns the logarithm of @var{arg}, with base 10:
1164@var{arg} is negative, it signals a @code{domain-error} error. 1173@code{(log10 @var{x})} @equiv{} @code{(log @var{x} 10)}.
1165@code{(log10 @var{x})} @equiv{} @code{(log @var{x} 10)}, at least
1166approximately.
1167@end defun 1174@end defun
1168 1175
1169@defun expt x y 1176@defun expt x y
1170This function returns @var{x} raised to power @var{y}. If both 1177This function returns @var{x} raised to power @var{y}. If both
1171arguments are integers and @var{y} is positive, the result is an 1178arguments are integers and @var{y} is positive, the result is an
1172integer; in this case, overflow causes truncation, so watch out. 1179integer; in this case, overflow causes truncation, so watch out.
1180If @var{x} is a finite negative number and @var{y} is a finite
1181non-integer, @code{expt} returns a NaN.
1173@end defun 1182@end defun
1174 1183
1175@defun sqrt arg 1184@defun sqrt arg
1176This returns the square root of @var{arg}. If @var{arg} is negative, 1185This returns the square root of @var{arg}. If @var{arg} is negative,
1177it signals a @code{domain-error} error. 1186@code{sqrt} returns a NaN.
1178@end defun 1187@end defun
1179 1188
1180In addition, Emacs defines the following common mathematical 1189In addition, Emacs defines the following common mathematical
diff --git a/etc/NEWS b/etc/NEWS
index 49860eab98a..af4bcf11dbb 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -344,6 +344,14 @@ python-describe-symbol | python-eldoc-at-point
344 344
345*** Accepts \r and \f as whitespace. 345*** Accepts \r and \f as whitespace.
346 346
347** SQL Mode
348
349*** DB2 added `sql-db2-escape-newlines'
350
351If non-nil, newlines sent to the command interpreter will be escaped
352by a backslash. The default does not escape the newlines and assumes
353that the sql statement will be terminated by a semicolon.
354
347** Diff mode 355** Diff mode
348 356
349Faces for changes now use the same diff color scheme as in modern VCSes 357Faces for changes now use the same diff color scheme as in modern VCSes
@@ -355,6 +363,9 @@ The variable `diff-use-changed-face' defines whether to use
355the face `diff-changed', or `diff-removed' and `diff-added' 363the face `diff-changed', or `diff-removed' and `diff-added'
356to highlight changes in context diffs. 364to highlight changes in context diffs.
357 365
366*** The new command `diff-remove-trailing-whitespace' fixes trailing
367whitespace problems introduced by the diff.
368
358** Ediff now uses the same color scheme as Diff mode 369** Ediff now uses the same color scheme as Diff mode
359on high color displays. 370on high color displays.
360 371
@@ -718,6 +729,14 @@ table, but with a different prefix.
718must be in the range 1000..9999. It now works with any year supported 729must be in the range 1000..9999. It now works with any year supported
719by the underlying C implementation. 730by the underlying C implementation.
720 731
732** Floating point
733
734*** When floating point functions such as `log' are given invalid
735arguments, e.g., (log -1.0), they now uniformly return special values
736such as NaNs instead of signaling errors. Previously, these functions
737returned NaNs on some platforms but signaled errors on others. The affected
738functions are acos, asin, tan, exp, expt, log, log10, sqrt, and mod.
739
721** New function file-name-base. 740** New function file-name-base.
722 741
723** New function `tty-top-frame' returns the topmost frame of a text terminal. 742** New function `tty-top-frame' returns the topmost frame of a text terminal.
diff --git a/lisp/gnus/gnus-notifications.el b/lisp/gnus/gnus-notifications.el
index f9c2d309a35..5104a56c6e7 100644
--- a/lisp/gnus/gnus-notifications.el
+++ b/lisp/gnus/gnus-notifications.el
@@ -166,8 +166,10 @@ This is typically a function to add in
166 (or (mail-fetch-field "From") ""))) 166 (or (mail-fetch-field "From") "")))
167 (address (cadr address-components))) 167 (address (cadr address-components)))
168 ;; Ignore mails from ourselves 168 ;; Ignore mails from ourselves
169 (unless (gnus-string-match-p gnus-ignored-from-addresses 169 (unless (and gnus-ignored-from-addresses
170 address) 170 address
171 (gnus-string-match-p gnus-ignored-from-addresses
172 address))
171 (let* ((photo-file (gnus-notifications-get-photo-file address)) 173 (let* ((photo-file (gnus-notifications-get-photo-file address))
172 (notification-id (gnus-notifications-notify 174 (notification-id (gnus-notifications-notify
173 (or (car address-components) address) 175 (or (car address-components) address)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 5791f1225c1..fa0484ff4e5 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -936,7 +936,7 @@ file-local variable.\n")
936 (princ " This variable is safe as a file local variable ") 936 (princ " This variable is safe as a file local variable ")
937 (princ "if its value\n satisfies the predicate ") 937 (princ "if its value\n satisfies the predicate ")
938 (princ (if (byte-code-function-p safe-var) 938 (princ (if (byte-code-function-p safe-var)
939 "which is byte-compiled expression.\n" 939 "which is a byte-compiled expression.\n"
940 (format "`%s'.\n" safe-var)))) 940 (format "`%s'.\n" safe-var))))
941 941
942 (if extra-line (terpri)) 942 (if extra-line (terpri))
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index a696fff7dc7..669ea58656d 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -211,10 +211,10 @@ case sensitive instead."
211 (complete-with-action action table string pred)))) 211 (complete-with-action action table string pred))))
212 212
213(defun completion-table-subvert (table s1 s2) 213(defun completion-table-subvert (table s1 s2)
214 "Completion table that replaces the prefix S1 with S2 in STRING. 214 "Return a completion table from TABLE with S1 replaced by S2.
215The result is a completion table which completes strings of the 215The result is a completion table which completes strings of the
216form (concat S1 S) in the same way as TABLE completes strings of 216form (concat S2 S) in the same way as TABLE completes strings of
217the form (concat S2 S)." 217the form (concat S1 S)."
218 (lambda (string pred action) 218 (lambda (string pred action)
219 (let* ((str (if (eq t (compare-strings string 0 (length s1) s1 nil nil 219 (let* ((str (if (eq t (compare-strings string 0 (length s1) s1 nil nil
220 completion-ignore-case)) 220 completion-ignore-case))
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 030cc02f3f4..f3ecbe3fc3d 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -4,7 +4,7 @@
4 4
5;; Author: Alex Schroeder <alex@gnu.org> 5;; Author: Alex Schroeder <alex@gnu.org>
6;; Maintainer: Michael Mauger <mmaug@yahoo.com> 6;; Maintainer: Michael Mauger <mmaug@yahoo.com>
7;; Version: 3.0 7;; Version: 3.1
8;; Keywords: comm languages processes 8;; Keywords: comm languages processes
9;; URL: http://savannah.gnu.org/projects/emacs/ 9;; URL: http://savannah.gnu.org/projects/emacs/
10 10
@@ -218,9 +218,12 @@
218;; Michael Mauger <mmaug@yahoo.com> -- improved product support 218;; Michael Mauger <mmaug@yahoo.com> -- improved product support
219;; Drew Adams <drew.adams@oracle.com> -- Emacs 20 support 219;; Drew Adams <drew.adams@oracle.com> -- Emacs 20 support
220;; Harald Maier <maierh@myself.com> -- sql-send-string 220;; Harald Maier <maierh@myself.com> -- sql-send-string
221;; Stefan Monnier <monnier@iro.umontreal.ca> -- font-lock corrections; code polish 221;; Stefan Monnier <monnier@iro.umontreal.ca> -- font-lock corrections;
222;; code polish
222;; Paul Sleigh <bat@flurf.net> -- MySQL keyword enhancement 223;; Paul Sleigh <bat@flurf.net> -- MySQL keyword enhancement
223;; Andrew Schein <andrew@andrewschein.com> -- sql-port bug 224;; Andrew Schein <andrew@andrewschein.com> -- sql-port bug
225;; Ian Bjorhovde <idbjorh@dataproxy.com> -- db2 escape newlines
226;; incorrectly enabled by default
224 227
225 228
226 229
@@ -879,6 +882,16 @@ In older versions of SQL*Plus, this was the SET SCAN OFF command."
879 :type 'boolean 882 :type 'boolean
880 :group 'SQL) 883 :group 'SQL)
881 884
885(defcustom sql-db2-escape-newlines nil
886 "Non-nil if newlines should be escaped by a backslash in DB2 SQLi.
887
888When non-nil, Emacs will automatically insert a space and
889backslash prior to every newline in multi-line SQL statements as
890they are submitted to an interactive DB2 session."
891 :version "24.3"
892 :type 'boolean
893 :group 'SQL)
894
882;; Customization for SQLite 895;; Customization for SQLite
883 896
884(defcustom sql-sqlite-program (or (executable-find "sqlite3") 897(defcustom sql-sqlite-program (or (executable-find "sqlite3")
@@ -3188,20 +3201,23 @@ Placeholders are words starting with an ampersand like &this."
3188 3201
3189;; Using DB2 interactively, newlines must be escaped with " \". 3202;; Using DB2 interactively, newlines must be escaped with " \".
3190;; The space before the backslash is relevant. 3203;; The space before the backslash is relevant.
3204
3191(defun sql-escape-newlines-filter (string) 3205(defun sql-escape-newlines-filter (string)
3192 "Escape newlines in STRING. 3206 "Escape newlines in STRING.
3193Every newline in STRING will be preceded with a space and a backslash." 3207Every newline in STRING will be preceded with a space and a backslash."
3194 (let ((result "") (start 0) mb me) 3208 (if (not sql-db2-escape-newlines)
3195 (while (string-match "\n" string start) 3209 string
3196 (setq mb (match-beginning 0) 3210 (let ((result "") (start 0) mb me)
3197 me (match-end 0) 3211 (while (string-match "\n" string start)
3198 result (concat result 3212 (setq mb (match-beginning 0)
3199 (substring string start mb) 3213 me (match-end 0)
3200 (if (and (> mb 1) 3214 result (concat result
3201 (string-equal " \\" (substring string (- mb 2) mb))) 3215 (substring string start mb)
3202 "" " \\\n")) 3216 (if (and (> mb 1)
3203 start me)) 3217 (string-equal " \\" (substring string (- mb 2) mb)))
3204 (concat result (substring string start)))) 3218 "" " \\\n"))
3219 start me))
3220 (concat result (substring string start)))))
3205 3221
3206 3222
3207 3223
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index c6a9371ea9a..11ec785b647 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -178,6 +178,8 @@ when editing big diffs)."
178 ["Unified -> Context" diff-unified->context 178 ["Unified -> Context" diff-unified->context
179 :help "Convert unified diffs to context diffs"] 179 :help "Convert unified diffs to context diffs"]
180 ;;["Fixup Headers" diff-fixup-modifs (not buffer-read-only)] 180 ;;["Fixup Headers" diff-fixup-modifs (not buffer-read-only)]
181 ["Remove trailing whitespace" diff-remove-trailing-whitespace
182 :help "Remove trailing whitespace problems introduced by the diff"]
181 ["Show trailing whitespace" whitespace-mode 183 ["Show trailing whitespace" whitespace-mode
182 :style toggle :selected (bound-and-true-p whitespace-mode) 184 :style toggle :selected (bound-and-true-p whitespace-mode)
183 :help "Show trailing whitespace in modified lines"] 185 :help "Show trailing whitespace in modified lines"]
diff --git a/src/alloc.c b/src/alloc.c
index 33dc68df48e..7bbc0abcd9a 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3682,7 +3682,7 @@ build_marker (struct buffer *buf, ptrdiff_t charpos, ptrdiff_t bytepos)
3682 struct Lisp_Marker *m; 3682 struct Lisp_Marker *m;
3683 3683
3684 /* No dead buffers here. */ 3684 /* No dead buffers here. */
3685 eassert (!NILP (BVAR (buf, name))); 3685 eassert (BUFFER_LIVE_P (buf));
3686 3686
3687 /* Every character is at least one byte. */ 3687 /* Every character is at least one byte. */
3688 eassert (charpos <= bytepos); 3688 eassert (charpos <= bytepos);
diff --git a/src/buffer.c b/src/buffer.c
index 3af45122a0d..d512547d34e 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -388,7 +388,7 @@ DEFUN ("buffer-live-p", Fbuffer_live_p, Sbuffer_live_p, 1, 1, 0,
388Value is nil if OBJECT is not a buffer or if it has been killed. */) 388Value is nil if OBJECT is not a buffer or if it has been killed. */)
389 (Lisp_Object object) 389 (Lisp_Object object)
390{ 390{
391 return ((BUFFERP (object) && ! NILP (BVAR (XBUFFER (object), name))) 391 return ((BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object)))
392 ? Qt : Qnil); 392 ? Qt : Qnil);
393} 393}
394 394
@@ -776,7 +776,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
776 base_buffer = Fget_buffer (base_buffer); 776 base_buffer = Fget_buffer (base_buffer);
777 if (NILP (base_buffer)) 777 if (NILP (base_buffer))
778 error ("No such buffer: `%s'", SDATA (tem)); 778 error ("No such buffer: `%s'", SDATA (tem));
779 if (NILP (BVAR (XBUFFER (base_buffer), name))) 779 if (!BUFFER_LIVE_P (XBUFFER (base_buffer)))
780 error ("Base buffer has been killed"); 780 error ("Base buffer has been killed");
781 781
782 if (SCHARS (name) == 0) 782 if (SCHARS (name) == 0)
@@ -1553,7 +1553,7 @@ exists, return the buffer `*scratch*' (creating it if necessary). */)
1553 { 1553 {
1554 buf = XCAR (tail); 1554 buf = XCAR (tail);
1555 if (BUFFERP (buf) && !EQ (buf, buffer) 1555 if (BUFFERP (buf) && !EQ (buf, buffer)
1556 && !NILP (BVAR (XBUFFER (buf), name)) 1556 && BUFFER_LIVE_P (XBUFFER (buf))
1557 && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ') 1557 && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ')
1558 /* If the frame has a buffer_predicate, disregard buffers that 1558 /* If the frame has a buffer_predicate, disregard buffers that
1559 don't fit the predicate. */ 1559 don't fit the predicate. */
@@ -1573,7 +1573,7 @@ exists, return the buffer `*scratch*' (creating it if necessary). */)
1573 { 1573 {
1574 buf = Fcdr (XCAR (tail)); 1574 buf = Fcdr (XCAR (tail));
1575 if (BUFFERP (buf) && !EQ (buf, buffer) 1575 if (BUFFERP (buf) && !EQ (buf, buffer)
1576 && !NILP (BVAR (XBUFFER (buf), name)) 1576 && BUFFER_LIVE_P (XBUFFER (buf))
1577 && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ') 1577 && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ')
1578 /* If the frame has a buffer_predicate, disregard buffers that 1578 /* If the frame has a buffer_predicate, disregard buffers that
1579 don't fit the predicate. */ 1579 don't fit the predicate. */
@@ -1615,7 +1615,7 @@ other_buffer_safely (Lisp_Object buffer)
1615 { 1615 {
1616 buf = Fcdr (XCAR (tail)); 1616 buf = Fcdr (XCAR (tail));
1617 if (BUFFERP (buf) && !EQ (buf, buffer) 1617 if (BUFFERP (buf) && !EQ (buf, buffer)
1618 && !NILP (BVAR (XBUFFER (buf), name)) 1618 && BUFFER_LIVE_P (XBUFFER (buf))
1619 && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ')) 1619 && (SREF (BVAR (XBUFFER (buf), name), 0) != ' '))
1620 return buf; 1620 return buf;
1621 } 1621 }
@@ -1734,7 +1734,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1734 b = XBUFFER (buffer); 1734 b = XBUFFER (buffer);
1735 1735
1736 /* Avoid trouble for buffer already dead. */ 1736 /* Avoid trouble for buffer already dead. */
1737 if (NILP (BVAR (b, name))) 1737 if (!BUFFER_LIVE_P (b))
1738 return Qnil; 1738 return Qnil;
1739 1739
1740 /* Query if the buffer is still modified. */ 1740 /* Query if the buffer is still modified. */
@@ -1770,7 +1770,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1770 } 1770 }
1771 1771
1772 /* If the hooks have killed the buffer, exit now. */ 1772 /* If the hooks have killed the buffer, exit now. */
1773 if (NILP (BVAR (b, name))) 1773 if (!BUFFER_LIVE_P (b))
1774 return Qt; 1774 return Qt;
1775 1775
1776 /* We have no more questions to ask. Verify that it is valid 1776 /* We have no more questions to ask. Verify that it is valid
@@ -1802,7 +1802,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1802 UNGCPRO; 1802 UNGCPRO;
1803 1803
1804 /* Exit if we now have killed the base buffer (Bug#11665). */ 1804 /* Exit if we now have killed the base buffer (Bug#11665). */
1805 if (NILP (BVAR (b, name))) 1805 if (!BUFFER_LIVE_P (b))
1806 return Qt; 1806 return Qt;
1807 } 1807 }
1808 1808
@@ -1813,7 +1813,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1813 replace_buffer_in_windows (buffer); 1813 replace_buffer_in_windows (buffer);
1814 1814
1815 /* Exit if replacing the buffer in windows has killed our buffer. */ 1815 /* Exit if replacing the buffer in windows has killed our buffer. */
1816 if (NILP (BVAR (b, name))) 1816 if (!BUFFER_LIVE_P (b))
1817 return Qt; 1817 return Qt;
1818 1818
1819 /* Make this buffer not be current. Exit if it is the sole visible 1819 /* Make this buffer not be current. Exit if it is the sole visible
@@ -1846,7 +1846,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1846 1846
1847 /* Killing buffer processes may run sentinels which may have killed 1847 /* Killing buffer processes may run sentinels which may have killed
1848 our buffer. */ 1848 our buffer. */
1849 if (NILP (BVAR (b, name))) 1849 if (!BUFFER_LIVE_P (b))
1850 return Qt; 1850 return Qt;
1851 1851
1852 /* These may run Lisp code and into infinite loops (if someone 1852 /* These may run Lisp code and into infinite loops (if someone
@@ -1878,7 +1878,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1878 } 1878 }
1879 1879
1880 /* Deleting an auto-save file could have killed our buffer. */ 1880 /* Deleting an auto-save file could have killed our buffer. */
1881 if (NILP (BVAR (b, name))) 1881 if (!BUFFER_LIVE_P (b))
1882 return Qt; 1882 return Qt;
1883 1883
1884 if (b->base_buffer) 1884 if (b->base_buffer)
@@ -2047,7 +2047,7 @@ the current buffer's major mode. */)
2047 2047
2048 CHECK_BUFFER (buffer); 2048 CHECK_BUFFER (buffer);
2049 2049
2050 if (NILP (BVAR (XBUFFER (buffer), name))) 2050 if (!BUFFER_LIVE_P (XBUFFER (buffer)))
2051 error ("Attempt to set major mode for a dead buffer"); 2051 error ("Attempt to set major mode for a dead buffer");
2052 2052
2053 if (strcmp (SSDATA (BVAR (XBUFFER (buffer), name)), "*scratch*") == 0) 2053 if (strcmp (SSDATA (BVAR (XBUFFER (buffer), name)), "*scratch*") == 0)
@@ -2183,7 +2183,7 @@ ends when the current command terminates. Use `switch-to-buffer' or
2183 buffer = Fget_buffer (buffer_or_name); 2183 buffer = Fget_buffer (buffer_or_name);
2184 if (NILP (buffer)) 2184 if (NILP (buffer))
2185 nsberror (buffer_or_name); 2185 nsberror (buffer_or_name);
2186 if (NILP (BVAR (XBUFFER (buffer), name))) 2186 if (!BUFFER_LIVE_P (XBUFFER (buffer)))
2187 error ("Selecting deleted buffer"); 2187 error ("Selecting deleted buffer");
2188 set_buffer_internal (XBUFFER (buffer)); 2188 set_buffer_internal (XBUFFER (buffer));
2189 return buffer; 2189 return buffer;
@@ -2194,7 +2194,7 @@ ends when the current command terminates. Use `switch-to-buffer' or
2194Lisp_Object 2194Lisp_Object
2195set_buffer_if_live (Lisp_Object buffer) 2195set_buffer_if_live (Lisp_Object buffer)
2196{ 2196{
2197 if (! NILP (BVAR (XBUFFER (buffer), name))) 2197 if (BUFFER_LIVE_P (XBUFFER (buffer)))
2198 set_buffer_internal (XBUFFER (buffer)); 2198 set_buffer_internal (XBUFFER (buffer));
2199 return Qnil; 2199 return Qnil;
2200} 2200}
@@ -2289,7 +2289,7 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
2289 CHECK_BUFFER (buffer); 2289 CHECK_BUFFER (buffer);
2290 other_buffer = XBUFFER (buffer); 2290 other_buffer = XBUFFER (buffer);
2291 2291
2292 if (NILP (BVAR (other_buffer, name))) 2292 if (!BUFFER_LIVE_P (other_buffer))
2293 error ("Cannot swap a dead buffer's text"); 2293 error ("Cannot swap a dead buffer's text");
2294 2294
2295 /* Actually, it probably works just fine. 2295 /* Actually, it probably works just fine.
@@ -2685,7 +2685,7 @@ current buffer is cleared. */)
2685 /* Copy this buffer's new multibyte status 2685 /* Copy this buffer's new multibyte status
2686 into all of its indirect buffers. */ 2686 into all of its indirect buffers. */
2687 FOR_EACH_BUFFER (other) 2687 FOR_EACH_BUFFER (other)
2688 if (other->base_buffer == current_buffer && !NILP (BVAR (other, name))) 2688 if (other->base_buffer == current_buffer && BUFFER_LIVE_P (other))
2689 { 2689 {
2690 BVAR (other, enable_multibyte_characters) 2690 BVAR (other, enable_multibyte_characters)
2691 = BVAR (current_buffer, enable_multibyte_characters); 2691 = BVAR (current_buffer, enable_multibyte_characters);
diff --git a/src/buffer.h b/src/buffer.h
index da40a7ce3d8..d18ef30ea38 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -959,7 +959,10 @@ bset_width_table (struct buffer *b, Lisp_Object val)
959 b->INTERNAL_FIELD (width_table) = val; 959 b->INTERNAL_FIELD (width_table) = val;
960} 960}
961 961
962 962/* Convenient check whether buffer B is live. */
963
964#define BUFFER_LIVE_P(b) (!NILP (BVAR (b, name)))
965
963/* Chain of all buffers, including killed ones. */ 966/* Chain of all buffers, including killed ones. */
964 967
965extern struct buffer *all_buffers; 968extern struct buffer *all_buffers;
diff --git a/src/data.c b/src/data.c
index a4cca0a3ee5..4678ac1208c 100644
--- a/src/data.c
+++ b/src/data.c
@@ -71,8 +71,8 @@ Lisp_Object Qchar_table_p, Qvector_or_char_table_p;
71Lisp_Object Qcdr; 71Lisp_Object Qcdr;
72static Lisp_Object Qad_advice_info, Qad_activate_internal; 72static Lisp_Object Qad_advice_info, Qad_activate_internal;
73 73
74Lisp_Object Qrange_error, Qdomain_error, Qsingularity_error; 74static Lisp_Object Qdomain_error, Qsingularity_error, Qunderflow_error;
75Lisp_Object Qoverflow_error, Qunderflow_error; 75Lisp_Object Qrange_error, Qoverflow_error;
76 76
77Lisp_Object Qfloatp; 77Lisp_Object Qfloatp;
78Lisp_Object Qnumberp, Qnumber_or_marker_p; 78Lisp_Object Qnumberp, Qnumber_or_marker_p;
diff --git a/src/editfns.c b/src/editfns.c
index 65baaf4e3f8..299cad07fd7 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2613,7 +2613,7 @@ They default to the values of (point-min) and (point-max) in BUFFER. */)
2613 if (NILP (buf)) 2613 if (NILP (buf))
2614 nsberror (buffer); 2614 nsberror (buffer);
2615 bp = XBUFFER (buf); 2615 bp = XBUFFER (buf);
2616 if (NILP (BVAR (bp, name))) 2616 if (!BUFFER_LIVE_P (bp))
2617 error ("Selecting deleted buffer"); 2617 error ("Selecting deleted buffer");
2618 2618
2619 if (NILP (start)) 2619 if (NILP (start))
@@ -2677,7 +2677,7 @@ determines whether case is significant or ignored. */)
2677 if (NILP (buf1)) 2677 if (NILP (buf1))
2678 nsberror (buffer1); 2678 nsberror (buffer1);
2679 bp1 = XBUFFER (buf1); 2679 bp1 = XBUFFER (buf1);
2680 if (NILP (BVAR (bp1, name))) 2680 if (!BUFFER_LIVE_P (bp1))
2681 error ("Selecting deleted buffer"); 2681 error ("Selecting deleted buffer");
2682 } 2682 }
2683 2683
@@ -2715,7 +2715,7 @@ determines whether case is significant or ignored. */)
2715 if (NILP (buf2)) 2715 if (NILP (buf2))
2716 nsberror (buffer2); 2716 nsberror (buffer2);
2717 bp2 = XBUFFER (buf2); 2717 bp2 = XBUFFER (buf2);
2718 if (NILP (BVAR (bp2, name))) 2718 if (!BUFFER_LIVE_P (bp2))
2719 error ("Selecting deleted buffer"); 2719 error ("Selecting deleted buffer");
2720 } 2720 }
2721 2721
diff --git a/src/insdel.c b/src/insdel.c
index 604a9bbf3df..b12a390633e 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -2107,7 +2107,7 @@ DEFUN ("combine-after-change-execute", Fcombine_after_change_execute,
2107 non-nil, and insertion calls a file handler (e.g. through 2107 non-nil, and insertion calls a file handler (e.g. through
2108 lock_file) which scribbles into a temp file -- cyd */ 2108 lock_file) which scribbles into a temp file -- cyd */
2109 if (!BUFFERP (combine_after_change_buffer) 2109 if (!BUFFERP (combine_after_change_buffer)
2110 || NILP (BVAR (XBUFFER (combine_after_change_buffer), name))) 2110 || !BUFFER_LIVE_P (XBUFFER (combine_after_change_buffer)))
2111 { 2111 {
2112 combine_after_change_list = Qnil; 2112 combine_after_change_list = Qnil;
2113 return Qnil; 2113 return Qnil;
diff --git a/src/lisp.h b/src/lisp.h
index 0470e452899..0163a9bcdbc 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2564,8 +2564,7 @@ extern Lisp_Object Qchar_table_p, Qvector_or_char_table_p;
2564 2564
2565extern Lisp_Object Qcdr; 2565extern Lisp_Object Qcdr;
2566 2566
2567extern Lisp_Object Qrange_error, Qdomain_error, Qsingularity_error; 2567extern Lisp_Object Qrange_error, Qoverflow_error;
2568extern Lisp_Object Qoverflow_error, Qunderflow_error;
2569 2568
2570extern Lisp_Object Qfloatp; 2569extern Lisp_Object Qfloatp;
2571extern Lisp_Object Qnumberp, Qnumber_or_marker_p; 2570extern Lisp_Object Qnumberp, Qnumber_or_marker_p;
diff --git a/src/lread.c b/src/lread.c
index 02b13affb6a..08a2e856c00 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1734,7 +1734,7 @@ readevalloop (Lisp_Object readcharfun,
1734 { 1734 {
1735 ptrdiff_t count1 = SPECPDL_INDEX (); 1735 ptrdiff_t count1 = SPECPDL_INDEX ();
1736 1736
1737 if (b != 0 && NILP (BVAR (b, name))) 1737 if (b != 0 && !BUFFER_LIVE_P (b))
1738 error ("Reading from killed buffer"); 1738 error ("Reading from killed buffer");
1739 1739
1740 if (!NILP (start)) 1740 if (!NILP (start))
diff --git a/src/marker.c b/src/marker.c
index de3c19c3bcb..bfbb161a71d 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -407,7 +407,7 @@ Returns nil if MARKER points into a dead buffer. */)
407 does not preserve the buffer from being GC'd (it's weak), so 407 does not preserve the buffer from being GC'd (it's weak), so
408 markers have to be unlinked from their buffer as soon as the buffer 408 markers have to be unlinked from their buffer as soon as the buffer
409 is killed. */ 409 is killed. */
410 eassert (!NILP (BVAR (XBUFFER (buf), name))); 410 eassert (BUFFER_LIVE_P (XBUFFER (buf)));
411 return buf; 411 return buf;
412 } 412 }
413 return Qnil; 413 return Qnil;
@@ -462,13 +462,13 @@ live_buffer (Lisp_Object buffer)
462 if (NILP (buffer)) 462 if (NILP (buffer))
463 { 463 {
464 b = current_buffer; 464 b = current_buffer;
465 eassert (!NILP (BVAR (b, name))); 465 eassert (BUFFER_LIVE_P (b));
466 } 466 }
467 else 467 else
468 { 468 {
469 CHECK_BUFFER (buffer); 469 CHECK_BUFFER (buffer);
470 b = XBUFFER (buffer); 470 b = XBUFFER (buffer);
471 if (NILP (BVAR (b, name))) 471 if (!BUFFER_LIVE_P (b))
472 b = NULL; 472 b = NULL;
473 } 473 }
474 return b; 474 return b;
@@ -595,7 +595,7 @@ unchain_marker (register struct Lisp_Marker *marker)
595 register struct Lisp_Marker *tail, **prev; 595 register struct Lisp_Marker *tail, **prev;
596 596
597 /* No dead buffers here. */ 597 /* No dead buffers here. */
598 eassert (!NILP (BVAR (b, name))); 598 eassert (BUFFER_LIVE_P (b));
599 599
600 marker->buffer = NULL; 600 marker->buffer = NULL;
601 prev = &BUF_MARKERS (b); 601 prev = &BUF_MARKERS (b);
diff --git a/src/minibuf.c b/src/minibuf.c
index 655a02f5eca..4ed480a8408 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -798,7 +798,7 @@ get_minibuffer (EMACS_INT depth)
798 Vminibuffer_list = nconc2 (Vminibuffer_list, tail); 798 Vminibuffer_list = nconc2 (Vminibuffer_list, tail);
799 } 799 }
800 buf = Fcar (tail); 800 buf = Fcar (tail);
801 if (NILP (buf) || NILP (BVAR (XBUFFER (buf), name))) 801 if (NILP (buf) || !BUFFER_LIVE_P (XBUFFER (buf)))
802 { 802 {
803 buf = Fget_buffer_create 803 buf = Fget_buffer_create
804 (make_formatted_string (name, " *Minibuf-%"pI"d*", depth)); 804 (make_formatted_string (name, " *Minibuf-%"pI"d*", depth));
diff --git a/src/nsterm.m b/src/nsterm.m
index 74a3d858710..798c9758376 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -627,6 +627,8 @@ ns_update_begin (struct frame *f)
627 -------------------------------------------------------------------------- */ 627 -------------------------------------------------------------------------- */
628{ 628{
629 NSView *view = FRAME_NS_VIEW (f); 629 NSView *view = FRAME_NS_VIEW (f);
630 NSRect r = [view frame];
631 NSBezierPath *bp = [NSBezierPath bezierPath];
630 NSTRACE (ns_update_begin); 632 NSTRACE (ns_update_begin);
631 633
632 ns_update_auto_hide_menu_bar (); 634 ns_update_auto_hide_menu_bar ();
@@ -634,6 +636,13 @@ ns_update_begin (struct frame *f)
634 ns_updating_frame = f; 636 ns_updating_frame = f;
635 [view lockFocus]; 637 [view lockFocus];
636 638
639 /* drawRect may have been called for say the minibuffer, and then clip path
640 is for the minibuffer. But the display engine may draw more because
641 we have set the frame as garbaged. So reset clip path to the whole
642 view. */
643 [bp appendBezierPathWithRect: r];
644 [bp setClip];
645
637#ifdef NS_IMPL_GNUSTEP 646#ifdef NS_IMPL_GNUSTEP
638 uRect = NSMakeRect (0, 0, 0, 0); 647 uRect = NSMakeRect (0, 0, 0, 0);
639#endif 648#endif
diff --git a/src/print.c b/src/print.c
index c1b60c97d9e..5643ff06774 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1882,7 +1882,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
1882 } 1882 }
1883 else if (BUFFERP (obj)) 1883 else if (BUFFERP (obj))
1884 { 1884 {
1885 if (NILP (BVAR (XBUFFER (obj), name))) 1885 if (!BUFFER_LIVE_P (XBUFFER (obj)))
1886 strout ("#<killed buffer>", -1, -1, printcharfun); 1886 strout ("#<killed buffer>", -1, -1, printcharfun);
1887 else if (escapeflag) 1887 else if (escapeflag)
1888 { 1888 {
diff --git a/src/process.c b/src/process.c
index 0cc9bc353a1..0ae68567d6b 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5298,7 +5298,7 @@ read_process_output (Lisp_Object proc, register int channel)
5298 } 5298 }
5299 5299
5300 /* If no filter, write into buffer if it isn't dead. */ 5300 /* If no filter, write into buffer if it isn't dead. */
5301 else if (!NILP (p->buffer) && !NILP (BVAR (XBUFFER (p->buffer), name))) 5301 else if (!NILP (p->buffer) && BUFFER_LIVE_P (XBUFFER (p->buffer)))
5302 { 5302 {
5303 Lisp_Object old_read_only; 5303 Lisp_Object old_read_only;
5304 ptrdiff_t old_begv, old_zv; 5304 ptrdiff_t old_begv, old_zv;
@@ -6722,7 +6722,7 @@ status_notify (struct Lisp_Process *deleting_process)
6722 6722
6723 /* Avoid error if buffer is deleted 6723 /* Avoid error if buffer is deleted
6724 (probably that's why the process is dead, too) */ 6724 (probably that's why the process is dead, too) */
6725 if (NILP (BVAR (XBUFFER (buffer), name))) 6725 if (!BUFFER_LIVE_P (XBUFFER (buffer)))
6726 continue; 6726 continue;
6727 Fset_buffer (buffer); 6727 Fset_buffer (buffer);
6728 6728
diff --git a/src/w32term.c b/src/w32term.c
index 571db3cbe8e..28c1c593cf6 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -2591,6 +2591,7 @@ x_draw_glyph_string (struct glyph_string *s)
2591 w32_set_clip_rectangle (next->hdc, NULL); 2591 w32_set_clip_rectangle (next->hdc, NULL);
2592 next->hl = save; 2592 next->hl = save;
2593 next->num_clips = 0; 2593 next->num_clips = 0;
2594 next->clip_head = s->next;
2594 } 2595 }
2595 } 2596 }
2596 } 2597 }
diff --git a/src/xterm.c b/src/xterm.c
index 4ce87142c1a..8a702800c38 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2984,6 +2984,7 @@ x_draw_glyph_string (struct glyph_string *s)
2984 XSetClipMask (next->display, next->gc, None); 2984 XSetClipMask (next->display, next->gc, None);
2985 next->hl = save; 2985 next->hl = save;
2986 next->num_clips = 0; 2986 next->num_clips = 0;
2987 next->clip_head = s->next;
2987 } 2988 }
2988 } 2989 }
2989 } 2990 }