summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-02-24 22:41:40 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2012-02-24 22:41:40 -0800
commita89654f8f34114db543cb91363e8fded6d73e986 (patch)
tree5ac508597ef2aa460308b4b26c244779e48cdb40 /src
parent6e6c82a4e687708d5a7a3887f92db45bd74da276 (diff)
parent67b0de11479247cb8bd8491e10e0b464046f18be (diff)
downloademacs-a89654f8f34114db543cb91363e8fded6d73e986.tar.gz
Merge from trunk.
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit8
-rw-r--r--src/ChangeLog127
-rw-r--r--src/ChangeLog.102
-rw-r--r--src/ChangeLog.116
-rw-r--r--src/ChangeLog.711
-rw-r--r--src/buffer.c6
-rw-r--r--src/eval.c49
-rw-r--r--src/fileio.c102
-rw-r--r--src/gnutls.c29
-rw-r--r--src/gtkutil.c5
-rw-r--r--src/image.c2
-rw-r--r--src/keyboard.c60
-rw-r--r--src/keymap.c10
-rw-r--r--src/lisp.h32
-rw-r--r--src/mem-limits.h2
-rw-r--r--src/nsselect.m114
-rw-r--r--src/syntax.c21
-rw-r--r--src/w16select.c19
-rw-r--r--src/w32select.c19
-rw-r--r--src/window.c15
-rw-r--r--src/window.h4
-rw-r--r--src/xdisp.c5
-rw-r--r--src/xfns.c42
-rw-r--r--src/xselect.c47
-rw-r--r--src/xterm.c26
25 files changed, 571 insertions, 192 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index fc8eab6d1df..7cd828733b1 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -254,8 +254,8 @@ define pitx
while ($i < $it->sp && $i < 4)
set $e = $it->stack[$i]
printf "stack[%d]: ", $i
- pitmethod $e->method
- printf "[%d]", $e->position.charpos
+ pitmethod $e.method
+ printf "[%d]", $e.position.charpos
printf "\n"
set $i = $i + 1
end
@@ -1259,7 +1259,9 @@ end
define xreload
set $tagmask = (((long)1 << gdb_gctypebits) - 1)
- set $valmask = gdb_use_lsb ? ~($tagmask) : ((long)1 << gdb_valbits) - 1
+ # The consing_since_gc business widens the 1 to EMACS_INT,
+ # a symbol not directly visible to GDB.
+ set $valmask = gdb_use_lsb ? ~($tagmask) : ((consing_since_gc - consing_since_gc + 1) << gdb_valbits) - 1
end
document xreload
When starting Emacs a second time in the same gdb session under
diff --git a/src/ChangeLog b/src/ChangeLog
index 79bcf192eb7..71ddf053dac 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,4 @@
-2012-02-10 Paul Eggert <eggert@cs.ucla.edu>
+2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
Fix integer width and related bugs (Bug#9874).
* alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
@@ -788,6 +788,126 @@
rather than rolling our own approximation.
(SCROLL_BAR_VEC_SIZE): Remove; not used.
+2012-02-25 Chong Yidong <cyd@gnu.org>
+
+ * xselect.c (Fx_selection_exists_p): Doc fix.
+ (x_clipboard_manager_save_all): Print an informative message
+ before saving to clipboard manager.
+
+2012-02-24 Chong Yidong <cyd@gnu.org>
+
+ * keyboard.c (process_special_events): Handle all X selection
+ requests in kbd_buffer, not just the next one (Bug#8869).
+
+2012-02-23 Chong Yidong <cyd@gnu.org>
+
+ * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
+ call when setting menu-bar-lines and tool-bar-lines parameters.
+ (unwind_create_frame_1): New helper function.
+
+ * window.c (inhibit_window_configuration_change_hook): New var.
+ (run_window_configuration_change_hook): Obey it.
+ (syms_of_window): Initialize it.
+
+2012-02-22 Chong Yidong <cyd@gnu.org>
+
+ * xterm.c (x_draw_image_relief): Add missing type check for
+ Vtool_bar_button_margin (Bug#10743).
+
+2012-02-21 Chong Yidong <cyd@gnu.org>
+
+ * fileio.c (Vfile_name_handler_alist): Doc fix.
+
+ * buffer.c (Fget_file_buffer): Protect against invalid file
+ handler return value.
+
+2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
+ when computing $valmask.
+
+ Fix crash due to non-contiguous EMACS_INT (Bug#10780).
+ * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
+ (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
+ It's useless in that case, and it can cause problems on hosts
+ that allocate halves of EMACS_INT values separately.
+ Reported by Dan HorĂ¡k. Diagnosed by Andreas Schwab in
+ <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
+ * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
+ UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
+ it avoids undefined behavior on hosts where shifting right by more
+ than the word width has undefined behavior.
+
+2012-02-19 Chong Yidong <cyd@gnu.org>
+
+ * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
+ (Funhandled_file_name_directory, Ffile_name_as_directory)
+ (Fdirectory_file_name, Fexpand_file_name)
+ (Fsubstitute_in_file_name): Protect against invalid file handler
+ return values (Bug#10845).
+
+2012-02-18 Eli Zaretskii <eliz@gnu.org>
+
+ * .gdbinit (pitx): Fix incorrect references to fields of the
+ iterator stack.
+
+2012-02-17 Chong Yidong <cyd@gnu.org>
+
+ * syntax.c (Fscan_lists): Doc fix (Bug#10833).
+
+2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
+ <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
+
+2012-02-15 Chong Yidong <cyd@gnu.org>
+
+ * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
+ marked as special. Also, starting docstrings with * is obsolete.
+
+2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
+
+ * gnutls.c (emacs_gnutls_write): Fix last change.
+
+2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * gnutls.c (emacs_gnutls_write): Set errno appropriately for
+ send_process.
+
+2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * keymap.c (Fsingle_key_description): Handle char ranges.
+
+2012-02-12 Chong Yidong <cyd@gnu.org>
+
+ * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
+ as that creates a dangerous corner case.
+
+ * window.c (Fdelete_window_internal): Invalidate the mouse
+ highlight (Bug#9904).
+
+2012-02-12 Glenn Morris <rgm@gnu.org>
+
+ * xselect.c (Fx_own_selection_internal)
+ (Fx_get_selection_internal, Fx_disown_selection_internal)
+ (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
+ * nsselect.m (Fx_own_selection_internal)
+ (Fx_disown_selection_internal, Fx_selection_exists_p)
+ (Fx_selection_owner_p, Fx_get_selection_internal):
+ Sync docs and argument specs with the xselect.c versions.
+
+2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
+
+2012-02-11 Eli Zaretskii <eliz@gnu.org>
+
+ * w32select.c (Fx_selection_exists_p): Sync doc string and
+ argument list with xselect.c. (Bug#10783)
+
+ * w16select.c (Fx_selection_exists_p): Sync doc string and
+ argument list with xselect.c. (Bug#10783)
+
2012-02-10 Glenn Morris <rgm@gnu.org>
* fns.c (Fsecure_hash): Doc fix.
@@ -7440,7 +7560,7 @@
conversion specifiers. For example, use "...%"pI"d..." rather
than "...%"pEd"...".
(pEd): Remove. All uses replaced with similar uses of pI.
- * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
+ * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
* alloc.c (check_pure_size): Don't overflow by converting size to int.
* bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
* data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
@@ -8422,8 +8542,7 @@
Without this change, on typical 64-bit hosts error ("...%d...", N)
was used to print both 32- and 64-bit integers N, which relied on
undefined behavior.
- * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
- New macro.
+ * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
* lisp.h (error, verror): Mark as printf-like functions.
* eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
Report overflow in size calculations when allocating printf buffer.
diff --git a/src/ChangeLog.10 b/src/ChangeLog.10
index 5baeb877939..10de7e53794 100644
--- a/src/ChangeLog.10
+++ b/src/ChangeLog.10
@@ -20972,7 +20972,7 @@
2002-12-30 Richard Dawe <rich@phekda.freeserve.co.uk>
- * src/config.in (!HAVE_SIZE_T): Fix order of arguments in
+ * config.in (!HAVE_SIZE_T): Fix order of arguments in
type definition of size_t.
2003-01-02 Steven Tamm <steventamm@mac.com>
diff --git a/src/ChangeLog.11 b/src/ChangeLog.11
index e8bfd964312..2e5404779b1 100644
--- a/src/ChangeLog.11
+++ b/src/ChangeLog.11
@@ -533,8 +533,8 @@
* deps.mk (getloadavg.o): Remove; gnulib now does this.
* lisp.h (getloadavg) [!defined HAVE_GETLOADAVG]: Remove; gnulib
now does this.
- * src/s/freebsd.h (HAVE_GETLOADAVG): Remove; gnulib now does this.
- * src/s/netbsd.h (HAVE_GETLOADAVG): Likewise.
+ * s/freebsd.h (HAVE_GETLOADAVG): Remove; gnulib now does this.
+ * s/netbsd.h (HAVE_GETLOADAVG): Likewise.
* config.in: Regenerate.
2011-02-15 Eli Zaretskii <eliz@gnu.org>
@@ -12539,7 +12539,7 @@
2009-06-23 Jim Meyering <meyering@redhat.com>
- * src/ftfont.c (setup_otf_gstring, ftfont_shape_by_flt):
+ * ftfont.c (setup_otf_gstring, ftfont_shape_by_flt):
Use xmalloc and xrealloc (not malloc and realloc), so subsequent heap
pointer dereferences are guaranteed to be valid.
diff --git a/src/ChangeLog.7 b/src/ChangeLog.7
index 891c1ca081a..0952826e8c6 100644
--- a/src/ChangeLog.7
+++ b/src/ChangeLog.7
@@ -331,7 +331,7 @@
1998-07-30 Paul Eggert <eggert@twinsun.com>
- * src/Makefile.in (widget.o, xfns.o, xmenu.o):
+ * Makefile.in (widget.o, xfns.o, xmenu.o):
Prepend $(srcdir)/ to rule dependencies outside this dir.
1998-07-29 Kenichi Handa <handa@etl.go.jp>
@@ -4884,14 +4884,13 @@
The new GNU C library strftime needs the underlying host's
strftime for locale dependent formats.
- * configure.in (AC_CHECK_FUNCS): Add strftime.
- * src/config.in (HAVE_STRFTIME): New undef.
- * src/editfns.c (emacs_strftime): New decl.
+ * config.in (HAVE_STRFTIME): New undef.
+ * editfns.c (emacs_strftime): New decl.
(Fformat_time_string): Doc fix: %b, %h, %B, %a, %A, and %p depend on
locale; don't use actual chars to describe %n and %t.
- * src/Makefile.in (strftime.o):
- * src/makefile.nt ($(BLD)\strftime.obj):
+ * Makefile.in (strftime.o):
+ * makefile.nt ($(BLD)\strftime.obj):
No need to compile with -Dstrftime=emacs_strftime any more.
1997-11-22 Richard Stallman <rms@gnu.org>
diff --git a/src/buffer.c b/src/buffer.c
index 22ae522523a..acee3c45158 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -272,7 +272,11 @@ See also `find-buffer-visiting'. */)
call the corresponding file handler. */
handler = Ffind_file_name_handler (filename, Qget_file_buffer);
if (!NILP (handler))
- return call2 (handler, Qget_file_buffer, filename);
+ {
+ Lisp_Object handled_buf = call2 (handler, Qget_file_buffer,
+ filename);
+ return BUFFERP (handled_buf) ? handled_buf : Qnil;
+ }
for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
{
diff --git a/src/eval.c b/src/eval.c
index ed3c811f28a..7f3bf6a866f 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -752,17 +752,15 @@ The return value is BASE-VARIABLE. */)
DEFUN ("defvar", Fdefvar, Sdefvar, 1, UNEVALLED, 0,
doc: /* Define SYMBOL as a variable, and return SYMBOL.
-You are not required to define a variable in order to use it,
-but the definition can supply documentation and an initial value
-in a way that tags can recognize.
-
-INITVALUE is evaluated, and used to set SYMBOL, only if SYMBOL's value is void.
-If SYMBOL is buffer-local, its default value is what is set;
- buffer-local values are not affected.
-INITVALUE and DOCSTRING are optional.
-If DOCSTRING starts with *, this variable is identified as a user option.
- This means that M-x set-variable recognizes it.
- See also `user-variable-p'.
+You are not required to define a variable in order to use it, but
+defining it lets you supply an initial value and documentation, which
+can be referred to by the Emacs help facilities and other programming
+tools. The `defvar' form also declares the variable as \"special\",
+so that it is always dynamically bound even if `lexical-binding' is t.
+
+The optional argument INITVALUE is evaluated, and used to set SYMBOL,
+only if SYMBOL's value is void. If SYMBOL is buffer-local, its
+default value is what is set; buffer-local values are not affected.
If INITVALUE is missing, SYMBOL's value is not set.
If SYMBOL has a local binding, then this form affects the local
@@ -771,6 +769,13 @@ load a file defining variables, with this form or with `defconst' or
`defcustom', you should always load that file _outside_ any bindings
for these variables. \(`defconst' and `defcustom' behave similarly in
this respect.)
+
+The optional argument DOCSTRING is a documentation string for the
+variable.
+
+To define a user option, use `defcustom' instead of `defvar'.
+The function `user-variable-p' also identifies a variable as a user
+option if its DOCSTRING starts with *, but this behavior is obsolete.
usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
(Lisp_Object args)
{
@@ -845,15 +850,19 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
DEFUN ("defconst", Fdefconst, Sdefconst, 2, UNEVALLED, 0,
doc: /* Define SYMBOL as a constant variable.
-The intent is that neither programs nor users should ever change this value.
-Always sets the value of SYMBOL to the result of evalling INITVALUE.
-If SYMBOL is buffer-local, its default value is what is set;
- buffer-local values are not affected.
-DOCSTRING is optional.
-
-If SYMBOL has a local binding, then this form sets the local binding's
-value. However, you should normally not make local bindings for
-variables defined with this form.
+This declares that neither programs nor users should ever change the
+value. This constancy is not actually enforced by Emacs Lisp, but
+SYMBOL is marked as a special variable so that it is never lexically
+bound.
+
+The `defconst' form always sets the value of SYMBOL to the result of
+evalling INITVALUE. If SYMBOL is buffer-local, its default value is
+what is set; buffer-local values are not affected. If SYMBOL has a
+local binding, then this form sets the local binding's value.
+However, you should normally not make local bindings for variables
+defined with this form.
+
+The optional DOCSTRING specifies the variable's documentation string.
usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */)
(Lisp_Object args)
{
diff --git a/src/fileio.c b/src/fileio.c
index 5216135f000..b5a4aac6217 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -328,7 +328,11 @@ Given a Unix syntax file name, returns a string ending in slash. */)
call the corresponding file handler. */
handler = Ffind_file_name_handler (filename, Qfile_name_directory);
if (!NILP (handler))
- return call2 (handler, Qfile_name_directory, filename);
+ {
+ Lisp_Object handled_name = call2 (handler, Qfile_name_directory,
+ filename);
+ return STRINGP (handled_name) ? handled_name : Qnil;
+ }
filename = FILE_SYSTEM_CASE (filename);
#ifdef DOS_NT
@@ -397,7 +401,13 @@ or the entire name if it contains no slash. */)
call the corresponding file handler. */
handler = Ffind_file_name_handler (filename, Qfile_name_nondirectory);
if (!NILP (handler))
- return call2 (handler, Qfile_name_nondirectory, filename);
+ {
+ Lisp_Object handled_name = call2 (handler, Qfile_name_nondirectory,
+ filename);
+ if (STRINGP (handled_name))
+ return handled_name;
+ error ("Invalid handler in `file-name-handler-alist'");
+ }
beg = SSDATA (filename);
end = p = beg + SBYTES (filename);
@@ -434,7 +444,11 @@ get a current directory to run processes in. */)
call the corresponding file handler. */
handler = Ffind_file_name_handler (filename, Qunhandled_file_name_directory);
if (!NILP (handler))
- return call2 (handler, Qunhandled_file_name_directory, filename);
+ {
+ Lisp_Object handled_name = call2 (handler, Qunhandled_file_name_directory,
+ filename);
+ return STRINGP (handled_name) ? handled_name : Qnil;
+ }
return Ffile_name_directory (filename);
}
@@ -488,7 +502,13 @@ For a Unix-syntax file name, just appends a slash. */)
call the corresponding file handler. */
handler = Ffind_file_name_handler (file, Qfile_name_as_directory);
if (!NILP (handler))
- return call2 (handler, Qfile_name_as_directory, file);
+ {
+ Lisp_Object handled_name = call2 (handler, Qfile_name_as_directory,
+ file);
+ if (STRINGP (handled_name))
+ return handled_name;
+ error ("Invalid handler in `file-name-handler-alist'");
+ }
buf = (char *) alloca (SBYTES (file) + 10);
file_name_as_directory (buf, SSDATA (file));
@@ -547,7 +567,13 @@ In Unix-syntax, this function just removes the final slash. */)
call the corresponding file handler. */
handler = Ffind_file_name_handler (directory, Qdirectory_file_name);
if (!NILP (handler))
- return call2 (handler, Qdirectory_file_name, directory);
+ {
+ Lisp_Object handled_name = call2 (handler, Qdirectory_file_name,
+ directory);
+ if (STRINGP (handled_name))
+ return handled_name;
+ error ("Invalid handler in `file-name-handler-alist'");
+ }
buf = (char *) alloca (SBYTES (directory) + 20);
directory_file_name (SSDATA (directory), buf);
@@ -747,7 +773,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
int is_escaped = 0;
#endif /* DOS_NT */
ptrdiff_t length;
- Lisp_Object handler, result;
+ Lisp_Object handler, result, handled_name;
int multibyte;
Lisp_Object hdir;
@@ -757,7 +783,14 @@ filesystem tree, not (expand-file-name ".." dirname). */)
call the corresponding file handler. */
handler = Ffind_file_name_handler (name, Qexpand_file_name);
if (!NILP (handler))
- return call3 (handler, Qexpand_file_name, name, default_directory);
+ {
+ handled_name = call3 (handler, Qexpand_file_name,
+ name, default_directory);
+ if (STRINGP (handled_name))
+ return handled_name;
+ error ("Invalid handler in `file-name-handler-alist'");
+ }
+
/* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted. */
if (NILP (default_directory))
@@ -783,7 +816,13 @@ filesystem tree, not (expand-file-name ".." dirname). */)
{
handler = Ffind_file_name_handler (default_directory, Qexpand_file_name);
if (!NILP (handler))
- return call3 (handler, Qexpand_file_name, name, default_directory);
+ {
+ handled_name = call3 (handler, Qexpand_file_name,
+ name, default_directory);
+ if (STRINGP (handled_name))
+ return handled_name;
+ error ("Invalid handler in `file-name-handler-alist'");
+ }
}
{
@@ -1284,7 +1323,13 @@ filesystem tree, not (expand-file-name ".." dirname). */)
to be expanded again. */
handler = Ffind_file_name_handler (result, Qexpand_file_name);
if (!NILP (handler))
- return call3 (handler, Qexpand_file_name, result, default_directory);
+ {
+ handled_name = call3 (handler, Qexpand_file_name,
+ result, default_directory);
+ if (STRINGP (handled_name))
+ return handled_name;
+ error ("Invalid handler in `file-name-handler-alist'");
+ }
return result;
}
@@ -1537,7 +1582,13 @@ those `/' is discarded. */)
call the corresponding file handler. */
handler = Ffind_file_name_handler (filename, Qsubstitute_in_file_name);
if (!NILP (handler))
- return call2 (handler, Qsubstitute_in_file_name, filename);
+ {
+ Lisp_Object handled_name = call2 (handler, Qsubstitute_in_file_name,
+ filename);
+ if (STRINGP (handled_name))
+ return handled_name;
+ error ("Invalid handler in `file-name-handler-alist'");
+ }
/* Always work on a copy of the string, in case GC happens during
decode of environment variables, causing the original Lisp_String
@@ -5596,18 +5647,25 @@ of file names regardless of the current language environment. */);
make_pure_c_string ("Cannot set file date"));
DEFVAR_LISP ("file-name-handler-alist", Vfile_name_handler_alist,
- doc: /* *Alist of elements (REGEXP . HANDLER) for file names handled specially.
-If a file name matches REGEXP, then all I/O on that file is done by calling
-HANDLER.
-
-The first argument given to HANDLER is the name of the I/O primitive
-to be handled; the remaining arguments are the arguments that were
-passed to that primitive. For example, if you do
- (file-exists-p FILENAME)
-and FILENAME is handled by HANDLER, then HANDLER is called like this:
- (funcall HANDLER 'file-exists-p FILENAME)
-The function `find-file-name-handler' checks this list for a handler
-for its argument. */);
+ doc: /* Alist of elements (REGEXP . HANDLER) for file names handled specially.
+If a file name matches REGEXP, all I/O on that file is done by calling
+HANDLER. If a file name matches more than one handler, the handler
+whose match starts last in the file name gets precedence. The
+function `find-file-name-handler' checks this list for a handler for
+its argument.
+
+HANDLER should be a function. The first argument given to it is the
+name of the I/O primitive to be handled; the remaining arguments are
+the arguments that were passed to that primitive. For example, if you
+do (file-exists-p FILENAME) and FILENAME is handled by HANDLER, then
+HANDLER is called like this:
+
+ (funcall HANDLER 'file-exists-p FILENAME)
+
+Note that HANDLER must be able to handle all I/O primitives; if it has
+nothing special to do for a primitive, it should reinvoke the
+primitive to handle the operation \"the usual way\".
+See Info node `(elisp)Magic File Names' for more details. */);
Vfile_name_handler_alist = Qnil;
DEFVAR_LISP ("set-auto-coding-function",
diff --git a/src/gnutls.c b/src/gnutls.c
index a4eeb50bd74..99fc5c10e2b 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -345,15 +345,16 @@ emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, ptrdiff_t nbyte)
ptrdiff_t bytes_written;
gnutls_session_t state = proc->gnutls_state;
- if (proc->gnutls_initstage != GNUTLS_STAGE_READY) {
+ if (proc->gnutls_initstage != GNUTLS_STAGE_READY)
+ {
#ifdef EWOULDBLOCK
- errno = EWOULDBLOCK;
+ errno = EWOULDBLOCK;
#endif
#ifdef EAGAIN
- errno = EAGAIN;
+ errno = EAGAIN;
#endif
- return 0;
- }
+ return 0;
+ }
bytes_written = 0;
@@ -363,10 +364,24 @@ emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, ptrdiff_t nbyte)
if (rtnval < 0)
{
- if (rtnval == GNUTLS_E_AGAIN || rtnval == GNUTLS_E_INTERRUPTED)
+ if (rtnval == GNUTLS_E_INTERRUPTED)
continue;
else
- break;
+ {
+ /* If we get GNUTLS_E_AGAIN, then set errno
+ appropriately so that send_process retries the
+ correct way instead of erroring out. */
+ if (rtnval == GNUTLS_E_AGAIN)
+ {
+#ifdef EWOULDBLOCK
+ errno = EWOULDBLOCK;
+#endif
+#ifdef EAGAIN
+ errno = EAGAIN;
+#endif
+ }
+ break;
+ }
}
buf += rtnval;
diff --git a/src/gtkutil.c b/src/gtkutil.c
index d5e890d7207..433cd8aa412 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1741,8 +1741,9 @@ xg_toggle_notify_cb (GObject *gobject, GParamSpec *arg1, gpointer user_data)
PROMPT is a prompt to show to the user. May not be NULL.
DEFAULT_FILENAME is a default selection to be displayed. May be NULL.
If MUSTMATCH_P is non-zero, the returned file name must be an existing
- file. *FUNC is set to a function that can be used to retrieve the
- selected file name from the returned widget.
+ file. (Actually, this only has cosmetic effects, the user can
+ still enter a non-existing file.) *FUNC is set to a function that
+ can be used to retrieve the selected file name from the returned widget.
Returns the created widget. */
diff --git a/src/image.c b/src/image.c
index c8d6be3a354..a3b64b74997 100644
--- a/src/image.c
+++ b/src/image.c
@@ -975,7 +975,7 @@ or omitted means use the selected frame. */)
static void free_image (struct frame *f, struct image *img);
-#define MAX_IMAGE_SIZE 6.0
+#define MAX_IMAGE_SIZE 10.0
/* Allocate and return a new image structure for image specification
SPEC. SPEC has a hash value of HASH. */
diff --git a/src/keyboard.c b/src/keyboard.c
index 09743be6c3c..eb9152f2c6c 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4154,29 +4154,55 @@ kbd_buffer_get_event (KBOARD **kbp,
static void
process_special_events (void)
{
- while (kbd_fetch_ptr != kbd_store_ptr)
- {
- struct input_event *event;
+ struct input_event *event;
- event = ((kbd_fetch_ptr < kbd_buffer + KBD_BUFFER_SIZE)
- ? kbd_fetch_ptr
- : kbd_buffer);
-
- last_event_timestamp = event->timestamp;
+ for (event = kbd_fetch_ptr; event != kbd_store_ptr; ++event)
+ {
+ if (event == kbd_buffer + KBD_BUFFER_SIZE)
+ {
+ event = kbd_buffer;
+ if (event == kbd_store_ptr)
+ break;
+ }
- /* These two kinds of events get special handling
- and don't actually appear to the command loop. */
+ /* If we find a stored X selection request, handle it now. */
if (event->kind == SELECTION_REQUEST_EVENT
|| event->kind == SELECTION_CLEAR_EVENT)
{
#ifdef HAVE_X11
- struct input_event copy;
- /* Remove it from the buffer before processing it,
- since otherwise swallow_events called recursively could see it
- and process it again. */
- copy = *event;
- kbd_fetch_ptr = event + 1;
+ /* Remove the event from the fifo buffer before processing;
+ otherwise swallow_events called recursively could see it
+ and process it again. To do this, we move the events
+ between kbd_fetch_ptr and EVENT one slot to the right,
+ cyclically. */
+
+ struct input_event copy = *event;
+ struct input_event *beg
+ = (kbd_fetch_ptr == kbd_buffer + KBD_BUFFER_SIZE)
+ ? kbd_buffer : kbd_fetch_ptr;
+
+ if (event > beg)
+ memmove (beg + 1, beg, (event - beg) * sizeof (struct input_event));
+ else if (event < beg)
+ {
+ if (event > kbd_buffer)
+ memmove (kbd_buffer + 1, kbd_buffer,
+ (event - kbd_buffer) * sizeof (struct input_event));
+ *kbd_buffer = *(kbd_buffer + KBD_BUFFER_SIZE - 1);
+ if (beg < kbd_buffer + KBD_BUFFER_SIZE - 1)
+ memmove (beg + 1, beg,
+ (kbd_buffer + KBD_BUFFER_SIZE - 1 - beg)
+ * sizeof (struct input_event));
+ }
+
+ if (kbd_fetch_ptr == kbd_buffer + KBD_BUFFER_SIZE)
+ kbd_fetch_ptr = kbd_buffer + 1;
+ else
+ kbd_fetch_ptr++;
+
+ /* X wants last_event_timestamp for selection ownership. */
+ last_event_timestamp = copy.timestamp;
input_pending = readable_events (0);
x_handle_selection_event (&copy);
#else
@@ -4185,8 +4211,6 @@ process_special_events (void)
abort ();
#endif
}
- else
- break;
}
}
diff --git a/src/keymap.c b/src/keymap.c
index cc4419a4d2f..328e6d8ed23 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -2288,9 +2288,15 @@ around function keys and event symbols. */)
if (CONSP (key) && lucid_event_type_list_p (key))
key = Fevent_convert_list (key);
+ if (CONSP (key) && INTEGERP (XCAR (key)) && INTEGERP (XCDR (key)))
+ /* An interval from a map-char-table. */
+ return concat3 (Fsingle_key_description (XCAR (key), no_angles),
+ build_string (".."),
+ Fsingle_key_description (XCDR (key), no_angles));
+
key = EVENT_HEAD (key);
- if (INTEGERP (key)) /* Normal character */
+ if (INTEGERP (key)) /* Normal character. */
{
char tem[KEY_DESCRIPTION_SIZE], *p;
@@ -2298,7 +2304,7 @@ around function keys and event symbols. */)
*p = 0;
return make_specified_string (tem, -1, p - tem, 1);
}
- else if (SYMBOLP (key)) /* Function key or event-symbol */
+ else if (SYMBOLP (key)) /* Function key or event-symbol. */
{
if (NILP (no_angles))
{
diff --git a/src/lisp.h b/src/lisp.h
index cc82edb2f5f..8c274cddb56 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -168,6 +168,10 @@ extern int suppress_checking EXTERNALLY_VISIBLE;
#define GCTYPEBITS 3
#endif
+#ifndef VALBITS
+#define VALBITS (BITS_PER_EMACS_INT - GCTYPEBITS)
+#endif
+
#ifndef NO_DECL_ALIGN
# ifndef DECL_ALIGN
# if HAVE_ATTRIBUTE_ALIGNED
@@ -191,7 +195,28 @@ extern int suppress_checking EXTERNALLY_VISIBLE;
|| defined DARWIN_OS || defined __sun)
/* We also need to be able to specify mult-of-8 alignment on static vars. */
# if defined DECL_ALIGN
-# define USE_LSB_TAG
+/* On hosts where VALBITS is greater than the pointer width in bits,
+ USE_LSB_TAG is:
+
+ a. unnecessary, because the top bits of an EMACS_INT are unused,
+
+ b. slower, because it typically requires extra masking, and
+
+ c. harmful, because it can create Lisp_Object values that are so scrambled
+ that mark_maybe_object cannot decipher them. mark_maybe_object assumes
+ that EMACS_INT values are contiguous, but a host where EMACS_INT is
+ wider than a pointer might allocate the top half of an EMACS_INT in
+ (say) a 32-bit word on the stack, putting the bottom half in a 32-bit
+ register that is saved elsewhere in a jmp_buf. When this happens,
+ since USE_LSB_TAG is not defined the bottom half alone is a valid
+ pointer that mark_maybe_pointer can follow; but if USE_LSB_TAG were
+ defined, the bottom half would not be a valid pointer and neither
+ mark_maybe_object nor mark_maybe_pointer would follow it.
+
+ So, define USE_LSB_TAG only on hosts where it might be useful. */
+# if UINTPTR_MAX >> VALBITS != 0
+# define USE_LSB_TAG
+# endif
# endif
#endif
@@ -309,11 +334,6 @@ enum Lisp_Fwd_Type
Lisp_Fwd_Kboard_Obj, /* Fwd to a Lisp_Object field of kboards. */
};
-/* These values are overridden by the m- file on some machines. */
-#ifndef VALBITS
-#define VALBITS (BITS_PER_EMACS_INT - GCTYPEBITS)
-#endif
-
#ifdef USE_LISP_UNION_TYPE
#ifndef WORDS_BIGENDIAN
diff --git a/src/mem-limits.h b/src/mem-limits.h
index 472e591b38d..244592a9768 100644
--- a/src/mem-limits.h
+++ b/src/mem-limits.h
@@ -34,7 +34,7 @@ extern int etext;
#endif
extern char *start_of_data (void);
-#if defined USE_LSB_TAG
+#if defined USE_LSB_TAG || UINTPTR_MAX >> VALBITS == 0
#define EXCEEDS_LISP_PTR(ptr) 0
#elif defined DATA_SEG_BITS
#define EXCEEDS_LISP_PTR(ptr) \
diff --git a/src/nsselect.m b/src/nsselect.m
index 5741236c987..6352d882b7a 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -336,12 +336,18 @@ ns_string_to_pasteboard (id pb, Lisp_Object str)
DEFUN ("x-own-selection-internal", Fx_own_selection_internal,
- Sx_own_selection_internal, 2, 2, 0,
- doc: /* Assert a selection.
-SELECTION-NAME is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
+ Sx_own_selection_internal, 2, 3, 0,
+ doc: /* Assert an X selection of type SELECTION and value VALUE.
+SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
+\(Those are literal upper-case symbol names, since that's what X expects.)
VALUE is typically a string, or a cons of two markers, but may be
-anything that the functions on `selection-converter-alist' know about. */)
- (Lisp_Object selection_name, Lisp_Object selection_value)
+anything that the functions on `selection-converter-alist' know about.
+
+FRAME should be a frame that should own the selection. If omitted or
+nil, it defaults to the selected frame.
+
+On Nextstep, FRAME is unused. */)
+ (Lisp_Object selection, Lisp_Object value, Lisp_Object frame)
{
id pb;
Lisp_Object old_value, new_value;
@@ -351,15 +357,15 @@ anything that the functions on `selection-converter-alist' know about. */)
check_ns ();
- CHECK_SYMBOL (selection_name);
- if (NILP (selection_value))
- error ("selection-value may not be nil.");
- pb = ns_symbol_to_pb (selection_name);
+ CHECK_SYMBOL (selection);
+ if (NILP (value))
+ error ("selection value may not be nil.");
+ pb = ns_symbol_to_pb (selection);
if (pb == nil) return Qnil;
ns_declare_pasteboard (pb);
- old_value = assq_no_quit (selection_name, Vselection_alist);
- new_value = Fcons (selection_name, Fcons (selection_value, Qnil));
+ old_value = assq_no_quit (selection, Vselection_alist);
+ new_value = Fcons (selection, Fcons (value, Qnil));
if (NILP (old_value))
Vselection_alist = Fcons (new_value, Vselection_alist);
@@ -369,7 +375,7 @@ anything that the functions on `selection-converter-alist' know about. */)
/* We only support copy of text. */
type = NSStringPboardType;
target_symbol = ns_string_to_symbol (type);
- data = ns_get_local_selection (selection_name, target_symbol);
+ data = ns_get_local_selection (selection, target_symbol);
if (!NILP (data))
{
if (STRINGP (data))
@@ -380,37 +386,53 @@ anything that the functions on `selection-converter-alist' know about. */)
if (!EQ (Vns_sent_selection_hooks, Qunbound))
{
for (rest = Vns_sent_selection_hooks; CONSP (rest); rest = Fcdr (rest))
- call3 (Fcar (rest), selection_name, target_symbol, successful_p);
+ call3 (Fcar (rest), selection, target_symbol, successful_p);
}
- return selection_value;
+ return value;
}
DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal,
- Sx_disown_selection_internal, 1, 2, 0,
- doc: /* If we own the selection SELECTION, disown it. */)
- (Lisp_Object selection_name, Lisp_Object time)
+ Sx_disown_selection_internal, 1, 3, 0,
+ doc: /* If we own the selection SELECTION, disown it.
+Disowning it means there is no such selection.
+
+Sets the last-change time for the selection to TIME-OBJECT (by default
+the time of the last event).
+
+TERMINAL should be a terminal object or a frame specifying the X
+server to query. If omitted or nil, that stands for the selected
+frame's display, or the first available X display.
+
+On Nextstep, the TIME-OBJECT and TERMINAL arguments are unused.
+On MS-DOS, all this does is return non-nil if we own the selection. */)
+ (Lisp_Object selection, Lisp_Object time_object, Lisp_Object terminal)
{
id pb;
check_ns ();
- CHECK_SYMBOL (selection_name);
- if (NILP (assq_no_quit (selection_name, Vselection_alist))) return Qnil;
+ CHECK_SYMBOL (selection);
+ if (NILP (assq_no_quit (selection, Vselection_alist))) return Qnil;
- pb = ns_symbol_to_pb (selection_name);
+ pb = ns_symbol_to_pb (selection);
if (pb != nil) ns_undeclare_pasteboard (pb);
return Qt;
}
DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p,
- 0, 1, 0, doc: /* Whether there is an owner for the given selection.
-The arg should be the name of the selection in question, typically one of
-the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
-\(Those are literal upper-case symbol names.)
-For convenience, the symbol nil is the same as `PRIMARY',
-and t is the same as `SECONDARY'.) */)
- (Lisp_Object selection)
+ 0, 2, 0, doc: /* Whether there is an owner for the given X selection.
+SELECTION should be the name of the selection in question, typically
+one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. (X expects
+these literal upper-case names.) The symbol nil is the same as
+`PRIMARY', and t is the same as `SECONDARY'.
+
+TERMINAL should be a terminal object or a frame specifying the X
+server to query. If omitted or nil, that stands for the selected
+frame's display, or the first available X display.
+
+On Nextstep, TERMINAL is unused. */)
+ (Lisp_Object selection, Lisp_Object terminal)
{
id pb;
NSArray *types;
@@ -428,14 +450,20 @@ and t is the same as `SECONDARY'.) */)
DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p,
- 0, 1, 0,
- doc: /* Whether the current Emacs process owns the given selection.
+ 0, 2, 0,
+ doc: /* Whether the current Emacs process owns the given X Selection.
The arg should be the name of the selection in question, typically one of
the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
-\(Those are literal upper-case symbol names.)
+\(Those are literal upper-case symbol names, since that's what X expects.)
For convenience, the symbol nil is the same as `PRIMARY',
-and t is the same as `SECONDARY'.) */)
- (Lisp_Object selection)
+and t is the same as `SECONDARY'.
+
+TERMINAL should be a terminal object or a frame specifying the X
+server to query. If omitted or nil, that stands for the selected
+frame's display, or the first available X display.
+
+On Nextstep, TERMINAL is unused. */)
+ (Lisp_Object selection, Lisp_Object terminal)
{
check_ns ();
CHECK_SYMBOL (selection);
@@ -446,12 +474,22 @@ and t is the same as `SECONDARY'.) */)
DEFUN ("x-get-selection-internal", Fx_get_selection_internal,
- Sx_get_selection_internal, 2, 2, 0,
- doc: /* Return text selected from some pasteboard.
-SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
-\(Those are literal upper-case symbol names.)
-TYPE is the type of data desired, typically `STRING'. */)
- (Lisp_Object selection_name, Lisp_Object target_type)
+ Sx_get_selection_internal, 2, 4, 0,
+ doc: /* Return text selected from some X window.
+SELECTION-SYMBOL is typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
+\(Those are literal upper-case symbol names, since that's what X expects.)
+TARGET-TYPE is the type of data desired, typically `STRING'.
+
+TIME-STAMP is the time to use in the XConvertSelection call for foreign
+selections. If omitted, defaults to the time for the last event.
+
+TERMINAL should be a terminal object or a frame specifying the X
+server to query. If omitted or nil, that stands for the selected
+frame's display, or the first available X display.
+
+On Nextstep, TIME-STAMP and TERMINAL are unused. */)
+ (Lisp_Object selection_name, Lisp_Object target_type,
+ Lisp_Object time_stamp, Lisp_Object terminal)
{
Lisp_Object val;
diff --git a/src/syntax.c b/src/syntax.c
index a802360582b..70e66ba1871 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2846,18 +2846,23 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf
DEFUN ("scan-lists", Fscan_lists, Sscan_lists, 3, 3, 0,
doc: /* Scan from character number FROM by COUNT lists.
-Returns the character number of the position thus found.
+Scan forward if COUNT is positive, backward if COUNT is negative.
+Return the character number of the position thus found.
+
+A \"list", in this context, refers to a balanced parenthetical
+grouping, as determined by the syntax table.
-If DEPTH is nonzero, paren depth begins counting from that value,
-only places where the depth in parentheses becomes zero
-are candidates for stopping; COUNT such places are counted.
-Thus, a positive value for DEPTH means go out levels.
+If DEPTH is nonzero, treat that as the nesting depth of the starting
+point (i.e. the starting point is DEPTH parentheses deep). This
+function scans over parentheses until the depth goes to zero COUNT
+times. Hence, positive DEPTH moves out that number of levels of
+parentheses, while negative DEPTH moves to a deeper level.
Comments are ignored if `parse-sexp-ignore-comments' is non-nil.
-If the beginning or end of (the accessible part of) the buffer is reached
-and the depth is wrong, an error is signaled.
-If the depth is right but the count is not used up, nil is returned. */)
+If we reach the beginning or end of the accessible part of the buffer
+before we have scanned over COUNT lists, return nil if the depth at
+that point is zero, and signal a error if the depth is nonzero. */)
(Lisp_Object from, Lisp_Object count, Lisp_Object depth)
{
CHECK_NUMBER (from);
diff --git a/src/w16select.c b/src/w16select.c
index 185bf252895..03f63bedf0d 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -637,14 +637,17 @@ DEFUN ("w16-get-clipboard-data", Fw16_get_clipboard_data, Sw16_get_clipboard_dat
/* Support checking for a clipboard selection. */
DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p,
- 0, 1, 0,
- doc: /* Whether there is an owner for the given X Selection.
-The arg should be the name of the selection in question, typically one of
-the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
-\(Those are literal upper-case symbol names, since that's what X expects.)
-For convenience, the symbol nil is the same as `PRIMARY',
-and t is the same as `SECONDARY'. */)
- (Lisp_Object selection)
+ 0, 2, 0,
+ doc: /* Whether there is an owner for the given X selection.
+SELECTION should be the name of the selection in question, typically
+one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. (X expects
+these literal upper-case names.) The symbol nil is the same as
+`PRIMARY', and t is the same as `SECONDARY'.
+
+TERMINAL should be a terminal object or a frame specifying the X
+server to query. If omitted or nil, that stands for the selected
+frame's display, or the first available X display. */)
+ (Lisp_Object selection, Lisp_Object terminal)
{
CHECK_SYMBOL (selection);
diff --git a/src/w32select.c b/src/w32select.c
index c60376b3a91..699c72b71a8 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -1009,14 +1009,17 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
/* Support checking for a clipboard selection. */
DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p,
- 0, 1, 0,
- doc: /* Whether there is an owner for the given X Selection.
-The arg should be the name of the selection in question, typically one of
-the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
-\(Those are literal upper-case symbol names, since that's what X expects.)
-For convenience, the symbol nil is the same as `PRIMARY',
-and t is the same as `SECONDARY'. */)
- (Lisp_Object selection)
+ 0, 2, 0,
+ doc: /* Whether there is an owner for the given X selection.
+SELECTION should be the name of the selection in question, typically
+one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. (X expects
+these literal upper-case names.) The symbol nil is the same as
+`PRIMARY', and t is the same as `SECONDARY'.
+
+TERMINAL should be a terminal object or a frame specifying the X
+server to query. If omitted or nil, that stands for the selected
+frame's display, or the first available X display. */)
+ (Lisp_Object selection, Lisp_Object terminal)
{
CHECK_SYMBOL (selection);
diff --git a/src/window.c b/src/window.c
index a0b11e0e320..af70890d4e4 100644
--- a/src/window.c
+++ b/src/window.c
@@ -122,6 +122,9 @@ static int window_initialized;
/* Hook to run when window config changes. */
static Lisp_Object Qwindow_configuration_change_hook;
+/* If non-nil, run_window_configuration_change_hook does nothing. */
+Lisp_Object inhibit_window_configuration_change_hook;
+
/* Used by the function window_scroll_pixel_based */
static int window_scroll_pixel_based_preserve_x;
static int window_scroll_pixel_based_preserve_y;
@@ -2895,7 +2898,7 @@ run_window_configuration_change_hook (struct frame *f)
= Fdefault_value (Qwindow_configuration_change_hook);
XSETFRAME (frame, f);
- if (NILP (Vrun_hooks))
+ if (NILP (Vrun_hooks) || !NILP (inhibit_window_configuration_change_hook))
return;
/* Use the right buffer. Matters when running the local hooks. */
@@ -3887,10 +3890,18 @@ Signal an error when WINDOW is the only window on its frame. */)
&& EQ (r->new_total, (horflag ? r->total_cols : r->total_lines)))
/* We can delete WINDOW now. */
{
+ Mouse_HLInfo *hlinfo;
+
/* Block input. */
BLOCK_INPUT;
window_resize_apply (p, horflag);
+ /* If this window is referred to by the dpyinfo's mouse
+ highlight, invalidate that slot to be safe (Bug#9904). */
+ hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
+ if (EQ (hlinfo->mouse_face_window, window))
+ hlinfo->mouse_face_window = Qnil;
+
windows_or_buffers_changed++;
Vwindow_list = Qnil;
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
@@ -6518,6 +6529,8 @@ syms_of_window (void)
window_scroll_preserve_hpos = -1;
window_scroll_preserve_vpos = -1;
+ inhibit_window_configuration_change_hook = Qnil;
+
DEFVAR_LISP ("temp-buffer-show-function", Vtemp_buffer_show_function,
doc: /* Non-nil means call as function to display a help buffer.
The function is called with one argument, the buffer to be displayed.
diff --git a/src/window.h b/src/window.h
index ea127ca95a8..f4a5f52b9a5 100644
--- a/src/window.h
+++ b/src/window.h
@@ -810,6 +810,10 @@ extern Lisp_Object Vmouse_window;
extern Lisp_Object Vmouse_event;
+/* If non-nil, run_window_configuration_change_hook does nothing. */
+
+extern Lisp_Object inhibit_window_configuration_change_hook;
+
EXFUN (Fnext_window, 3);
EXFUN (Fselect_window, 2);
EXFUN (Fset_window_buffer, 3);
diff --git a/src/xdisp.c b/src/xdisp.c
index 3dac7ae011e..caf977633d8 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2753,9 +2753,12 @@ init_iterator (struct it *it, struct window *w,
if (charpos >= BUF_BEG (current_buffer))
{
it->end_charpos = ZV;
- it->face_id = -1;
IT_CHARPOS (*it) = charpos;
+ /* We will rely on `reseat' to set this up properly, via
+ handle_face_prop. */
+ it->face_id = it->base_face_id;
+
/* Compute byte position if not specified. */
if (bytepos < charpos)
IT_BYTEPOS (*it) = CHAR_TO_BYTE (charpos);
diff --git a/src/xfns.c b/src/xfns.c
index b0cef7221f8..4cf4a059a67 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2949,6 +2949,12 @@ unwind_create_frame (Lisp_Object frame)
return Qnil;
}
+static Lisp_Object
+unwind_create_frame_1 (Lisp_Object val)
+{
+ inhibit_window_configuration_change_hook = val;
+ return Qnil;
+}
static void
x_default_font_parameter (struct frame *f, Lisp_Object parms)
@@ -3321,17 +3327,31 @@ This function is an internal primitive--use `make-frame' instead. */)
happen. */
init_frame_faces (f);
- /* The X resources controlling the menu-bar and tool-bar are
- processed specially at startup, and reflected in the mode
- variables; ignore them here. */
- x_default_parameter (f, parms, Qmenu_bar_lines,
- NILP (Vmenu_bar_mode)
- ? make_number (0) : make_number (1),
- NULL, NULL, RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qtool_bar_lines,
- NILP (Vtool_bar_mode)
- ? make_number (0) : make_number (1),
- NULL, NULL, RES_TYPE_NUMBER);
+ /* Set the menu-bar-lines and tool-bar-lines parameters. We don't
+ look up the X resources controlling the menu-bar and tool-bar
+ here; they are processed specially at startup, and reflected in
+ the values of the mode variables.
+
+ Avoid calling window-configuration-change-hook; otherwise we
+ could get an infloop in next_frame since the frame is not yet in
+ Vframe_list. */
+ {
+ ptrdiff_t count2 = SPECPDL_INDEX ();
+ record_unwind_protect (unwind_create_frame_1,
+ inhibit_window_configuration_change_hook);
+ inhibit_window_configuration_change_hook = Qt;
+
+ x_default_parameter (f, parms, Qmenu_bar_lines,
+ NILP (Vmenu_bar_mode)
+ ? make_number (0) : make_number (1),
+ NULL, NULL, RES_TYPE_NUMBER);
+ x_default_parameter (f, parms, Qtool_bar_lines,
+ NILP (Vtool_bar_mode)
+ ? make_number (0) : make_number (1),
+ NULL, NULL, RES_TYPE_NUMBER);
+
+ unbind_to (count2, Qnil);
+ }
x_default_parameter (f, parms, Qbuffer_predicate, Qnil,
"bufferPredicate", "BufferPredicate",
diff --git a/src/xselect.c b/src/xselect.c
index f7b65809443..290f4d7eb4d 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1981,7 +1981,9 @@ VALUE is typically a string, or a cons of two markers, but may be
anything that the functions on `selection-converter-alist' know about.
FRAME should be a frame that should own the selection. If omitted or
-nil, it defaults to the selected frame. */)
+nil, it defaults to the selected frame.
+
+On Nextstep, FRAME is unused. */)
(Lisp_Object selection, Lisp_Object value, Lisp_Object frame)
{
if (NILP (frame)) frame = selected_frame;
@@ -2002,15 +2004,18 @@ nil, it defaults to the selected frame. */)
DEFUN ("x-get-selection-internal", Fx_get_selection_internal,
Sx_get_selection_internal, 2, 4, 0,
doc: /* Return text selected from some X window.
-SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
+SELECTION-SYMBOL is typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
\(Those are literal upper-case symbol names, since that's what X expects.)
-TYPE is the type of data desired, typically `STRING'.
-TIME_STAMP is the time to use in the XConvertSelection call for foreign
+TARGET-TYPE is the type of data desired, typically `STRING'.
+
+TIME-STAMP is the time to use in the XConvertSelection call for foreign
selections. If omitted, defaults to the time for the last event.
TERMINAL should be a terminal object or a frame specifying the X
server to query. If omitted or nil, that stands for the selected
-frame's display, or the first available X display. */)
+frame's display, or the first available X display.
+
+On Nextstep, TIME-STAMP and TERMINAL are unused. */)
(Lisp_Object selection_symbol, Lisp_Object target_type,
Lisp_Object time_stamp, Lisp_Object terminal)
{
@@ -2051,9 +2056,15 @@ DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal,
doc: /* If we own the selection SELECTION, disown it.
Disowning it means there is no such selection.
+Sets the last-change time for the selection to TIME-OBJECT (by default
+the time of the last event).
+
TERMINAL should be a terminal object or a frame specifying the X
server to query. If omitted or nil, that stands for the selected
-frame's display, or the first available X display. */)
+frame's display, or the first available X display.
+
+On Nextstep, the TIME-OBJECT and TERMINAL arguments are unused.
+On MS-DOS, all this does is return non-nil if we own the selection. */)
(Lisp_Object selection, Lisp_Object time_object, Lisp_Object terminal)
{
Time timestamp;
@@ -2109,7 +2120,9 @@ and t is the same as `SECONDARY'.
TERMINAL should be a terminal object or a frame specifying the X
server to query. If omitted or nil, that stands for the selected
-frame's display, or the first available X display. */)
+frame's display, or the first available X display.
+
+On Nextstep, TERMINAL is unused. */)
(Lisp_Object selection, Lisp_Object terminal)
{
struct frame *f = frame_for_x_selection (terminal);
@@ -2128,13 +2141,15 @@ DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p,
0, 2, 0,
doc: /* Whether there is an owner for the given X selection.
SELECTION should be the name of the selection in question, typically
-one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. (X expects
-these literal upper-case names.) The symbol nil is the same as
-`PRIMARY', and t is the same as `SECONDARY'.
+one of the symbols `PRIMARY', `SECONDARY', `CLIPBOARD', or
+`CLIPBOARD_MANAGER' (X expects these literal upper-case names.) The
+symbol nil is the same as `PRIMARY', and t is the same as `SECONDARY'.
TERMINAL should be a terminal object or a frame specifying the X
server to query. If omitted or nil, that stands for the selected
-frame's display, or the first available X display. */)
+frame's display, or the first available X display.
+
+On Nextstep, TERMINAL is unused. */)
(Lisp_Object selection, Lisp_Object terminal)
{
Window owner;
@@ -2257,8 +2272,14 @@ x_clipboard_manager_save_all (void)
local_frame = XCAR (XCDR (XCDR (XCDR (local_selection))));
if (FRAME_LIVE_P (XFRAME (local_frame)))
- internal_condition_case_1 (x_clipboard_manager_save, local_frame,
- Qt, x_clipboard_manager_error_2);
+ {
+ Lisp_Object args[1];
+ args[0] = build_string ("Saving clipboard to X clipboard manager...");
+ Fmessage (1, args);
+
+ internal_condition_case_1 (x_clipboard_manager_save, local_frame,
+ Qt, x_clipboard_manager_error_2);
+ }
}
}
diff --git a/src/xterm.c b/src/xterm.c
index 6b19533e97c..88cd0bf4091 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2292,7 +2292,8 @@ x_draw_image_foreground (struct glyph_string *s)
static void
x_draw_image_relief (struct glyph_string *s)
{
- int x0, y0, x1, y1, thick, raised_p, extra;
+ int x0, y0, x1, y1, thick, raised_p;
+ int extra_x, extra_y;
XRectangle r;
int x = s->x;
int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
@@ -2323,13 +2324,24 @@ x_draw_image_relief (struct glyph_string *s)
raised_p = s->img->relief > 0;
}
- extra = s->face->id == TOOL_BAR_FACE_ID
- ? XINT (Vtool_bar_button_margin) : 0;
+ extra_x = extra_y = 0;
+ if (s->face->id == TOOL_BAR_FACE_ID)
+ {
+ if (CONSP (Vtool_bar_button_margin)
+ && INTEGERP (XCAR (Vtool_bar_button_margin))
+ && INTEGERP (XCDR (Vtool_bar_button_margin)))
+ {
+ extra_x = XINT (XCAR (Vtool_bar_button_margin));
+ extra_y = XINT (XCDR (Vtool_bar_button_margin));
+ }
+ else if (INTEGERP (Vtool_bar_button_margin))
+ extra_x = extra_y = XINT (Vtool_bar_button_margin);
+ }
- x0 = x - thick - extra;
- y0 = y - thick - extra;
- x1 = x + s->slice.width + thick - 1 + extra;
- y1 = y + s->slice.height + thick - 1 + extra;
+ x0 = x - thick - extra_x;
+ y0 = y - thick - extra_y;
+ x1 = x + s->slice.width + thick - 1 + extra_x;
+ y1 = y + s->slice.height + thick - 1 + extra_y;
x_setup_relief_colors (s);
get_glyph_string_clip_rect (s, &r);