summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorK. Handa <handa@gnu.org>2015-09-27 17:06:12 +0900
committerK. Handa <handa@gnu.org>2015-09-27 17:06:12 +0900
commit52beda922d2cb523a03661bf74b8678c8b45e440 (patch)
tree04617b37298746a61d5324a5b35c9b71f439d762 /src
parent94ed5167557112fb00eeca05e62589db744206de (diff)
parent1ac5a9c20cb22efb398fa18781c6b932dd4e54df (diff)
downloademacs-52beda922d2cb523a03661bf74b8678c8b45e440.tar.gz
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'src')
-rw-r--r--src/README13
-rw-r--r--src/buffer.c16
-rw-r--r--src/bytecode.c4
-rw-r--r--src/callproc.c4
-rw-r--r--src/category.c4
-rw-r--r--src/chartab.c2
-rw-r--r--src/cmds.c2
-rw-r--r--src/coding.c9
-rw-r--r--src/data.c9
-rw-r--r--src/dbusbind.c10
-rw-r--r--src/dispextern.h4
-rw-r--r--src/dispnew.c4
-rw-r--r--src/doc.c2
-rw-r--r--src/doprnt.c2
-rw-r--r--src/editfns.c6
-rw-r--r--src/eval.c41
-rw-r--r--src/fileio.c34
-rw-r--r--src/floatfns.c8
-rw-r--r--src/fns.c24
-rw-r--r--src/font.c115
-rw-r--r--src/fontset.c95
-rw-r--r--src/frame.c7
-rw-r--r--src/frame.h7
-rw-r--r--src/gfilenotify.c92
-rw-r--r--src/image.c40
-rw-r--r--src/indent.c38
-rw-r--r--src/inotify.c49
-rw-r--r--src/keyboard.c4
-rw-r--r--src/keymap.c6
-rw-r--r--src/lisp.h10
-rw-r--r--src/lread.c2
-rw-r--r--src/macfont.m8
-rw-r--r--src/menu.c4
-rw-r--r--src/minibuf.c4
-rw-r--r--src/nsfns.m8
-rw-r--r--src/nsselect.m6
-rw-r--r--src/nsterm.m10
-rw-r--r--src/print.c4
-rw-r--r--src/process.c44
-rw-r--r--src/process.h20
-rw-r--r--src/search.c2
-rw-r--r--src/syntax.c141
-rw-r--r--src/syntax.h33
-rw-r--r--src/term.c7
-rw-r--r--src/termhooks.h6
-rw-r--r--src/terminal.c65
-rw-r--r--src/textprop.c2
-rw-r--r--src/vm-limit.c18
-rw-r--r--src/w16select.c2
-rw-r--r--src/w32fns.c12
-rw-r--r--src/w32notify.c39
-rw-r--r--src/window.c22
-rw-r--r--src/xdisp.c141
-rw-r--r--src/xfaces.c64
-rw-r--r--src/xfns.c14
-rw-r--r--src/xselect.c16
-rw-r--r--src/xterm.c11
57 files changed, 865 insertions, 501 deletions
diff --git a/src/README b/src/README
index ef08d14d075..adc782c10fc 100644
--- a/src/README
+++ b/src/README
@@ -4,16 +4,15 @@ See the end of the file for license conditions.
This directory contains the source files for the C component of GNU Emacs.
Nothing in this directory is needed for using Emacs once it is built
-and installed, if the dumped Emacs (on Unix systems) is copied elsewhere.
+and installed, if the dumped Emacs is copied elsewhere.
See the files ../README and then ../INSTALL for installation instructions.
-Under GNU and Unix systems, the file `Makefile.in' is used as a
-template by the script `../configure' to produce `Makefile'. This
-is the file which actually controls the compilation of Emacs.
-All of this should work transparently to the user; you should only
-need to run `../configure', and then type `make'.
-
+The file 'Makefile.in' is used as a template by the script
+'../configure' to produce 'Makefile'. This is the file which actually
+controls the compilation of Emacs C source files. All of this should
+work transparently; you should only need to change to the parent
+directory, run './configure', and then run 'make'.
This file is part of GNU Emacs.
diff --git a/src/buffer.c b/src/buffer.c
index 33f7996a8c1..530fe114cc8 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1042,7 +1042,7 @@ DEFUN ("generate-new-buffer-name", Fgenerate_new_buffer_name,
doc: /* Return a string that is the name of no existing buffer based on NAME.
If there is no live buffer named NAME, then return NAME.
Otherwise modify name by appending `<NUMBER>', incrementing NUMBER
-\(starting at 2) until an unused name is found, and then return that name.
+(starting at 2) until an unused name is found, and then return that name.
Optional second argument IGNORE specifies a name that is okay to use (if
it is in the sequence to be tried) even if a buffer with that name exists.
@@ -1385,7 +1385,7 @@ DEFUN ("buffer-chars-modified-tick", Fbuffer_chars_modified_tick,
Sbuffer_chars_modified_tick, 0, 1, 0,
doc: /* Return BUFFER's character-change tick counter.
Each buffer has a character-change tick counter, which is set to the
-value of the buffer's tick counter \(see `buffer-modified-tick'), each
+value of the buffer's tick counter (see `buffer-modified-tick'), each
time text in that buffer is inserted or deleted. By comparing the
values returned by two individual calls of `buffer-chars-modified-tick',
you can tell whether a character change occurred in that buffer in
@@ -3791,10 +3791,10 @@ If omitted, BUFFER defaults to the current buffer.
BEG and END may be integers or markers.
The fourth arg FRONT-ADVANCE, if non-nil, makes the marker
for the front of the overlay advance when text is inserted there
-\(which means the text *is not* included in the overlay).
+(which means the text *is not* included in the overlay).
The fifth arg REAR-ADVANCE, if non-nil, makes the marker
for the rear of the overlay advance when text is inserted there
-\(which means the text *is* included in the overlay). */)
+(which means the text *is* included in the overlay). */)
(Lisp_Object beg, Lisp_Object end, Lisp_Object buffer,
Lisp_Object front_advance, Lisp_Object rear_advance)
{
@@ -6014,7 +6014,7 @@ between 0.0 and 1.0, inclusive. */);
doc: /* List of functions to call before each text change.
Two arguments are passed to each function: the positions of
the beginning and end of the range of old text to be changed.
-\(For an insertion, the beginning and end are at the same place.)
+(For an insertion, the beginning and end are at the same place.)
No information is given about the length of the text after the change.
Buffer changes made while executing the `before-change-functions'
@@ -6031,7 +6031,7 @@ from happening repeatedly and making Emacs nonfunctional. */);
Three arguments are passed to each function: the positions of
the beginning and end of the range of changed text,
and the length in chars of the pre-change text replaced by that range.
-\(For an insertion, the pre-change length is zero;
+(For an insertion, the pre-change length is zero;
for a deletion, that length is the number of chars deleted,
and the post-change beginning and end are at the same place.)
@@ -6076,7 +6076,7 @@ was modified between BEG and END. PROPERTY is the property name,
and VALUE is the old value.
An entry (apply FUN-NAME . ARGS) means undo the change with
-\(apply FUN-NAME ARGS).
+(apply FUN-NAME ARGS).
An entry (apply DELTA BEG END FUN-NAME . ARGS) supports selective undo
in the active region. BEG and END is the range affected by this entry
@@ -6236,7 +6236,7 @@ to the default frame line height. A value of nil means add no extra space. */)
doc: /* Non-nil means show a cursor in non-selected windows.
If nil, only shows a cursor in the selected window.
If t, displays a cursor related to the usual cursor type
-\(a solid box becomes hollow, a bar becomes a narrower bar).
+(a solid box becomes hollow, a bar becomes a narrower bar).
You can also specify the cursor type as in the `cursor-type' variable.
Use Custom to set this variable and update the display." */);
diff --git a/src/bytecode.c b/src/bytecode.c
index 86d44aba46b..864db1a0bed 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -2000,9 +2000,9 @@ syms_of_bytecode (void)
DEFVAR_LISP ("byte-code-meter", Vbyte_code_meter,
doc: /* A vector of vectors which holds a histogram of byte-code usage.
-\(aref (aref byte-code-meter 0) CODE) indicates how many times the byte
+(aref (aref byte-code-meter 0) CODE) indicates how many times the byte
opcode CODE has been executed.
-\(aref (aref byte-code-meter CODE1) CODE2), where CODE1 is not 0,
+(aref (aref byte-code-meter CODE1) CODE2), where CODE1 is not 0,
indicates how many times the byte opcodes CODE1 and CODE2 have been
executed in succession. */);
diff --git a/src/callproc.c b/src/callproc.c
index 39f0eb6265e..e38844e2da6 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -226,7 +226,7 @@ The program's input comes from file INFILE (nil means `/dev/null').
Insert output in DESTINATION before point; t means current buffer; nil for DESTINATION
means discard it; 0 means discard and don't wait; and `(:file FILE)', where
FILE is a file name string, means that it should be written to that file
- \(if the file already exists it is overwritten).
+ (if the file already exists it is overwritten).
DESTINATION can also have the form (REAL-BUFFER STDERR-FILE); in that case,
REAL-BUFFER says what to do with standard output, as above,
while STDERR-FILE says what to do with standard error in the child.
@@ -1462,7 +1462,7 @@ This function searches `process-environment' for VARIABLE.
If optional parameter ENV is a list, then search this list instead of
`process-environment', and return t when encountering a negative entry
-\(an entry for a variable with no value). */)
+(an entry for a variable with no value). */)
(Lisp_Object variable, Lisp_Object env)
{
char *value;
diff --git a/src/category.c b/src/category.c
index bb4a75d3a4d..400116f6e03 100644
--- a/src/category.c
+++ b/src/category.c
@@ -464,7 +464,7 @@ Emacs treats a sequence of word constituent characters as a single
word (i.e. finds no word boundary between them) only if they belong to
the same script. But, exceptions are allowed in the following cases.
-\(1) The case that characters are in different scripts is controlled
+(1) The case that characters are in different scripts is controlled
by the variable `word-combining-categories'.
Emacs finds no word boundary between characters of different scripts
@@ -478,7 +478,7 @@ For instance, to tell that Han characters followed by Hiragana
characters can form a single word, the element `(?C . ?H)' should be
in this list.
-\(2) The case that character are in the same script is controlled by
+(2) The case that character are in the same script is controlled by
the variable `word-separating-categories'.
Emacs finds a word boundary between characters of the same script
diff --git a/src/chartab.c b/src/chartab.c
index bd14c4d172b..274bb60727c 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -534,7 +534,7 @@ DEFUN ("char-table-parent", Fchar_table_parent, Schar_table_parent,
The value is either nil or another char-table.
If CHAR-TABLE holds nil for a given character,
then the actual applicable value is inherited from the parent char-table
-\(or from its parents, if necessary). */)
+(or from its parents, if necessary). */)
(Lisp_Object char_table)
{
CHECK_CHAR_TABLE (char_table);
diff --git a/src/cmds.c b/src/cmds.c
index a975a8ed4e0..7a575ae7348 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -108,7 +108,7 @@ right or to the left on the screen. This is in contrast with
DEFUN ("forward-line", Fforward_line, Sforward_line, 0, 1, "^p",
doc: /* Move N lines forward (backward if N is negative).
Precisely, if point is on line I, move to the start of line I + N
-\("start of line" in the logical order).
+("start of line" in the logical order).
If there isn't room, go as far as possible (no error).
Returns the count of lines left to move. If moving forward,
diff --git a/src/coding.c b/src/coding.c
index 1544f319b00..3fc6fb684c6 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -4295,6 +4295,9 @@ encode_invocation_designation (struct charset *charset,
else
ENCODE_LOCKING_SHIFT_3;
break;
+
+ default:
+ break;
}
}
@@ -7292,6 +7295,8 @@ produce_annotation (struct coding_system *coding, ptrdiff_t pos)
case CODING_ANNOTATE_CHARSET_MASK:
produce_charset (coding, charbuf, pos);
break;
+ default:
+ break;
}
charbuf += len;
}
@@ -9795,7 +9800,7 @@ DEFUN ("find-operation-coding-system", Ffind_operation_coding_system,
doc: /* Choose a coding system for an operation based on the target name.
The value names a pair of coding systems: (DECODING-SYSTEM . ENCODING-SYSTEM).
DECODING-SYSTEM is the coding system to use for decoding
-\(in case OPERATION does decoding), and ENCODING-SYSTEM is the coding system
+(in case OPERATION does decoding), and ENCODING-SYSTEM is the coding system
for encoding (in case OPERATION does encoding).
The first argument OPERATION specifies an I/O primitive:
@@ -11170,7 +11175,7 @@ the cdr part is used for encoding a text to be sent to a process. */);
Table of extra Latin codes in the range 128..159 (inclusive).
This is a vector of length 256.
If Nth element is non-nil, the existence of code N in a file
-\(or output of subprocess) doesn't prevent it to be detected as
+(or output of subprocess) doesn't prevent it to be detected as
a coding system of ISO 2022 variant which has a flag
`accept-latin-extra-code' t (e.g. iso-latin-1) on reading a file
or reading output of a subprocess.
diff --git a/src/data.c b/src/data.c
index 88c5a309859..eda611055d8 100644
--- a/src/data.c
+++ b/src/data.c
@@ -226,8 +226,9 @@ for example, (type-of 1) returns `integer'. */)
return Qfloat;
case Lisp_Misc_Finalizer:
return Qfinalizer;
+ default:
+ emacs_abort ();
}
- emacs_abort ();
case Lisp_Vectorlike:
if (WINDOW_CONFIGURATIONP (object))
@@ -790,7 +791,7 @@ SUBR must be a built-in function. */)
DEFUN ("interactive-form", Finteractive_form, Sinteractive_form, 1, 1, 0,
doc: /* Return the interactive form of CMD or nil if none.
If CMD is not a command, the return value is nil.
-Value, if non-nil, is a list \(interactive SPEC). */)
+Value, if non-nil, is a list (interactive SPEC). */)
(Lisp_Object cmd)
{
Lisp_Object fun = indirect_function (cmd); /* Check cycles. */
@@ -1659,8 +1660,8 @@ DEFUN ("make-local-variable", Fmake_local_variable, Smake_local_variable,
1, 1, "vMake Local Variable: ",
doc: /* Make VARIABLE have a separate value in the current buffer.
Other buffers will continue to share a common default value.
-\(The buffer-local value of VARIABLE starts out as the same value
-VARIABLE previously had. If VARIABLE was void, it remains void.\)
+(The buffer-local value of VARIABLE starts out as the same value
+VARIABLE previously had. If VARIABLE was void, it remains void.)
Return VARIABLE.
If the variable is already arranged to become local when set,
diff --git a/src/dbusbind.c b/src/dbusbind.c
index e5318fd51a1..181c7d016fd 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -1233,20 +1233,20 @@ This is an internal function, it shall not be used outside dbus.el.
The following usages are expected:
`dbus-call-method', `dbus-call-method-asynchronously':
- \(dbus-message-internal
+ (dbus-message-internal
dbus-message-type-method-call BUS SERVICE PATH INTERFACE METHOD HANDLER
&optional :timeout TIMEOUT &rest ARGS)
`dbus-send-signal':
- \(dbus-message-internal
+ (dbus-message-internal
dbus-message-type-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS)
`dbus-method-return-internal':
- \(dbus-message-internal
+ (dbus-message-internal
dbus-message-type-method-return BUS SERVICE SERIAL &rest ARGS)
`dbus-method-error-internal':
- \(dbus-message-internal
+ (dbus-message-internal
dbus-message-type-error BUS SERVICE SERIAL &rest ARGS)
usage: (dbus-message-internal &rest REST) */)
@@ -1796,7 +1796,7 @@ string which denotes a D-Bus interface, and MEMBER, also a string, is
either a method, a signal or a property INTERFACE is offering. All
arguments but BUS must not be nil.
-The value in the hash table is a list of quadruple lists \((UNAME
+The value in the hash table is a list of quadruple lists ((UNAME
SERVICE PATH OBJECT [RULE]) ...). SERVICE is the service name as
registered, UNAME is the corresponding unique name. In case of
registered methods and properties, UNAME is nil. PATH is the object
diff --git a/src/dispextern.h b/src/dispextern.h
index e5adeab0dc0..e44b70bf562 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2378,10 +2378,6 @@ struct it
struct it_slice slice;
ptrdiff_t image_id;
} image;
- /* method == GET_FROM_COMPOSITION */
- struct {
- Lisp_Object object;
- } comp;
/* method == GET_FROM_STRETCH */
struct {
Lisp_Object object;
diff --git a/src/dispnew.c b/src/dispnew.c
index 18afe50dd9b..00d086e4161 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -3004,7 +3004,7 @@ redraw_frame (struct frame *f)
clear_frame (f);
clear_current_matrices (f);
update_end (f);
- windows_or_buffers_changed = 13;
+ fset_redisplay (f);
/* Mark all windows as inaccurate, so that every window will have
its redisplay done. */
mark_window_display_accurate (FRAME_ROOT_WINDOW (f), 0);
@@ -5665,7 +5665,7 @@ DEFUN ("sleep-for", Fsleep_for, Ssleep_for, 1, 2, 0,
SECONDS may be a floating-point value, meaning that you can wait for a
fraction of a second. Optional second arg MILLISECONDS specifies an
additional wait period, in milliseconds; this is for backwards compatibility.
-\(Not all operating systems support waiting for a fraction of a second.) */)
+(Not all operating systems support waiting for a fraction of a second.) */)
(Lisp_Object seconds, Lisp_Object milliseconds)
{
double duration = extract_float (seconds);
diff --git a/src/doc.c b/src/doc.c
index b6963d2ab0b..68d4367182d 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -716,7 +716,7 @@ is not on any keys.
Each substring of the form \\=\\{MAPVAR} is replaced by a summary of
the value of MAPVAR as a keymap. This summary is similar to the one
produced by `describe-bindings'. The summary ends in two newlines
-\(used by the helper function `help-make-xrefs' to find the end of the
+(used by the helper function `help-make-xrefs' to find the end of the
summary).
Each substring of the form \\=\\<MAPVAR> specifies the use of MAPVAR
diff --git a/src/doprnt.c b/src/doprnt.c
index 7c5a6afb94b..51f8fd72ba0 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -1,4 +1,4 @@
-/* Output like sprintf to a buffer of specified size.
+/* Output like sprintf to a buffer of specified size. -*- coding: utf-8 -*-
Also takes args differently: pass one pointer to the end
of the format string in addition to the format string itself.
Copyright (C) 1985, 2001-2015 Free Software Foundation, Inc.
diff --git a/src/editfns.c b/src/editfns.c
index 831edb4c171..12e5ca8c001 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1,4 +1,4 @@
-/* Lisp functions pertaining to editing.
+/* Lisp functions pertaining to editing. -*- coding: utf-8 -*-
Copyright (C) 1985-1987, 1989, 1993-2015 Free Software Foundation, Inc.
@@ -3627,7 +3627,7 @@ save_restriction_restore (Lisp_Object data)
DEFUN ("save-restriction", Fsave_restriction, Ssave_restriction, 0, UNEVALLED, 0,
doc: /* Execute BODY, saving and restoring current buffer's restrictions.
The buffer's restrictions make parts of the beginning and end invisible.
-\(They are set up with `narrow-to-region' and eliminated with `widen'.)
+(They are set up with `narrow-to-region' and eliminated with `widen'.)
This special form, `save-restriction', saves the current buffer's restrictions
when it is entered, and restores them when it is exited.
So any `narrow-to-region' within BODY lasts only until the end of the form.
@@ -4154,7 +4154,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
|| conversion == 'X'))
error ("Invalid format operation %%%c",
STRING_CHAR ((unsigned char *) format - 1));
- else if (! (INTEGERP (args[n]) || FLOATP (args[n])))
+ else if (! NUMBERP (args[n]))
error ("Format specifier doesn't match argument type");
else
{
diff --git a/src/eval.c b/src/eval.c
index 77d435acbe6..ac98ca11bd4 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -596,6 +596,11 @@ The return value is BASE-VARIABLE. */)
error ("Cannot make an internal variable an alias");
case SYMBOL_LOCALIZED:
error ("Don't know how to make a localized variable an alias");
+ case SYMBOL_PLAINVAL:
+ case SYMBOL_VARALIAS:
+ break;
+ default:
+ emacs_abort ();
}
/* http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg00834.html
@@ -640,6 +645,17 @@ default_toplevel_binding (Lisp_Object symbol)
if (EQ (specpdl_symbol (pdl), symbol))
binding = pdl;
break;
+
+ case SPECPDL_UNWIND:
+ case SPECPDL_UNWIND_PTR:
+ case SPECPDL_UNWIND_INT:
+ case SPECPDL_UNWIND_VOID:
+ case SPECPDL_BACKTRACE:
+ case SPECPDL_LET_LOCAL:
+ break;
+
+ default:
+ emacs_abort ();
}
}
return binding;
@@ -689,7 +705,7 @@ If SYMBOL has a local binding, then this form affects the local
binding. This is usually not what you want. Thus, if you need to
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
+for these variables. (`defconst' and `defcustom' behave similarly in
this respect.)
The optional argument DOCSTRING is a documentation string for the
@@ -1172,7 +1188,7 @@ suppresses the debugger).
When a handler handles an error, control returns to the `condition-case'
and it executes the handler's BODY...
with VAR bound to (ERROR-SYMBOL . SIGNAL-DATA) from the error.
-\(If VAR is nil, the handler can't access that information.)
+(If VAR is nil, the handler can't access that information.)
Then the value of the last BODY form is returned from the `condition-case'
expression.
@@ -2350,7 +2366,7 @@ may be nil, a function, or a list of functions. Call each
function in order with arguments ARGS, stopping at the first
one that returns nil, and return nil. Otherwise (if all functions
return non-nil, or if there are no functions to call), return non-nil
-\(do not rely on the precise return value in this case).
+(do not rely on the precise return value in this case).
Do not use `make-local-variable' to make a hook variable buffer-local.
Instead, use `add-hook' and specify t for the LOCAL argument.
@@ -3462,6 +3478,17 @@ NFRAMES and BASE specify the activation frame to use, as in `backtrace-frame'.
else
result = Fcons (Fcons (sym, val), result);
}
+ break;
+
+ case SPECPDL_UNWIND:
+ case SPECPDL_UNWIND_PTR:
+ case SPECPDL_UNWIND_INT:
+ case SPECPDL_UNWIND_VOID:
+ case SPECPDL_BACKTRACE:
+ break;
+
+ default:
+ emacs_abort ();
}
}
}
@@ -3504,6 +3531,14 @@ mark_specpdl (void)
mark_object (specpdl_symbol (pdl));
mark_object (specpdl_old_value (pdl));
break;
+
+ case SPECPDL_UNWIND_PTR:
+ case SPECPDL_UNWIND_INT:
+ case SPECPDL_UNWIND_VOID:
+ break;
+
+ default:
+ emacs_abort ();
}
}
}
diff --git a/src/fileio.c b/src/fileio.c
index d4341f8fa59..e4b255a53ac 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -210,6 +210,22 @@ report_file_error (char const *string, Lisp_Object name)
report_file_errno (string, name, errno);
}
+/* Like report_file_error, but reports a file-notify-error instead. */
+
+void
+report_file_notify_error (const char *string, Lisp_Object name)
+{
+ Lisp_Object data = CONSP (name) || NILP (name) ? name : list1 (name);
+ synchronize_system_messages_locale ();
+ char *str = strerror (errno);
+ Lisp_Object errstring
+ = code_convert_string_norecord (build_unibyte_string (str),
+ Vlocale_coding_system, 0);
+ Lisp_Object errdata = Fcons (errstring, data);
+
+ xsignal (Qfile_notify_error, Fcons (build_string (string), errdata));
+}
+
void
close_file_unwind (int fd)
{
@@ -435,7 +451,7 @@ DEFUN ("unhandled-file-name-directory", Funhandled_file_name_directory,
A `directly usable' directory name is one that may be used without the
intervention of any file handler.
If FILENAME is a directly usable file itself, return
-\(file-name-directory FILENAME).
+(file-name-directory FILENAME).
If FILENAME refers to a file which is not accessible from a local process,
then this should return nil.
The `call-process' and `start-process' functions use this function to
@@ -726,7 +742,7 @@ DEFUN ("make-temp-name", Fmake_temp_name, Smake_temp_name, 1, 1, 0,
doc: /* Generate temporary file name (string) starting with PREFIX (a string).
The Emacs process number forms part of the result, so there is no
danger of generating a name being used by another Emacs process
-\(so long as only a single host can access the containing directory...).
+(so long as only a single host can access the containing directory...).
This function tries to choose a name that has no existing file.
For this to work, PREFIX should be an absolute file name.
@@ -742,7 +758,7 @@ normally use `make-temp-file' instead. */)
DEFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0,
doc: /* Convert filename NAME to absolute, and canonicalize it.
Second arg DEFAULT-DIRECTORY is directory to start with if NAME is relative
-\(does not start with slash or tilde); both the directory name and
+(does not start with slash or tilde); both the directory name and
a directory's file name are accepted. If DEFAULT-DIRECTORY is nil or
missing, the current buffer's value of `default-directory' is used.
NAME should be a string that is a valid file name for the underlying
@@ -760,8 +776,8 @@ See also the function `substitute-in-file-name'.
For technical reasons, this function can return correct but
non-intuitive results for the root directory; for instance,
-\(expand-file-name ".." "/") returns "/..". For this reason, use
-\(directory-file-name (file-name-directory dirname)) to traverse a
+(expand-file-name ".." "/") returns "/..". For this reason, use
+(directory-file-name (file-name-directory dirname)) to traverse a
filesystem tree, not (expand-file-name ".." dirname). */)
(Lisp_Object name, Lisp_Object default_directory)
{
@@ -1444,7 +1460,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
DEAFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0,
"Convert FILENAME to absolute, and canonicalize it.\n\
Second arg DEFAULT is directory to start with if FILENAME is relative\n\
-\(does not start with slash); if DEFAULT is nil or missing,\n\
+(does not start with slash); if DEFAULT is nil or missing,\n\
the current buffer's value of default-directory is used.\n\
Filenames containing `.' or `..' as components are simplified;\n\
initial `~/' expands to your home directory.\n\
@@ -2453,7 +2469,7 @@ Use `file-symlink-p' to test for such links. */)
DEFUN ("file-executable-p", Ffile_executable_p, Sfile_executable_p, 1, 1, 0,
doc: /* Return t if FILENAME can be executed by you.
For a directory, this means you can access files in that directory.
-\(It is generally better to use `file-accessible-directory-p' for that
+(It is generally better to use `file-accessible-directory-p' for that
purpose, though.) */)
(Lisp_Object filename)
{
@@ -5290,8 +5306,8 @@ DEFUN ("set-visited-file-modtime", Fset_visited_file_modtime,
Useful if the buffer was not read from the file normally
or if the file itself has been changed for some known benign reason.
An argument specifies the modification time value to use
-\(instead of that of the visited file), in the form of a list
-\(HIGH LOW USEC PSEC) or an integer flag as returned by
+(instead of that of the visited file), in the form of a list
+(HIGH LOW USEC PSEC) or an integer flag as returned by
`visited-file-modtime'. */)
(Lisp_Object time_flag)
{
diff --git a/src/floatfns.c b/src/floatfns.c
index 63d35b8ad6b..46eb85ff8ca 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -170,7 +170,7 @@ Cause an error if X1 or X2 is not a float. */)
DEFUN ("frexp", Ffrexp, Sfrexp, 1, 1, 0,
doc: /* Get significand and exponent of a floating point number.
Breaks the floating point number X into its binary significand SGNFCAND
-\(a floating point value between 0.5 (included) and 1.0 (excluded))
+(a floating point value between 0.5 (included) and 1.0 (excluded))
and an integral exponent EXP for 2, such that:
X = SGNFCAND * 2^EXP
@@ -454,7 +454,7 @@ With optional DIVISOR, return the nearest integer to ARG/DIVISOR.
Rounding a value equidistant between two integers may choose the
integer closer to zero, or it may prefer an even integer, depending on
-your machine. For example, \(round 2.5\) can return 3 on some
+your machine. For example, (round 2.5) can return 3 on some
systems, but 2 on others. */)
(Lisp_Object arg, Lisp_Object divisor)
{
@@ -491,7 +491,7 @@ fmod_float (Lisp_Object x, Lisp_Object y)
DEFUN ("fceiling", Ffceiling, Sfceiling, 1, 1, 0,
doc: /* Return the smallest integer no less than ARG, as a float.
-\(Round toward +inf.\) */)
+(Round toward +inf.) */)
(Lisp_Object arg)
{
double d = extract_float (arg);
@@ -501,7 +501,7 @@ DEFUN ("fceiling", Ffceiling, Sfceiling, 1, 1, 0,
DEFUN ("ffloor", Fffloor, Sffloor, 1, 1, 0,
doc: /* Return the largest integer no greater than ARG, as a float.
-\(Round towards -inf.\) */)
+(Round towards -inf.) */)
(Lisp_Object arg)
{
double d = extract_float (arg);
diff --git a/src/fns.c b/src/fns.c
index aa917ac6ec9..b31bd817c44 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -224,7 +224,7 @@ DEFUN ("compare-strings", Fcompare_strings, Scompare_strings, 6, 7, 0,
The arguments START1, END1, START2, and END2, if non-nil, are
positions specifying which parts of STR1 or STR2 to compare. In
string STR1, compare the part between START1 (inclusive) and END1
-\(exclusive). If START1 is nil, it defaults to 0, the beginning of
+(exclusive). If START1 is nil, it defaults to 0, the beginning of
the string; if END1 is nil, it defaults to the length of the string.
Likewise, in string STR2, compare the part between START2 and END2.
Like in `substring', negative values are counted from the end.
@@ -347,8 +347,8 @@ This function obeys the conventions for collation order in your
locale settings. For example, punctuation and whitespace characters
might be considered less significant for sorting:
-\(sort '\("11" "12" "1 1" "1 2" "1.1" "1.2") \\='string-collate-lessp)
- => \("11" "1 1" "1.1" "12" "1 2" "1.2")
+(sort '("11" "12" "1 1" "1 2" "1.1" "1.2") \\='string-collate-lessp)
+ => ("11" "1 1" "1.1" "12" "1 2" "1.2")
The optional argument LOCALE, a string, overrides the setting of your
current locale identifier for collation. The value is system
@@ -393,7 +393,7 @@ settings. For example, characters with different coding points but
the same meaning might be considered as equal, like different grave
accent Unicode characters:
-\(string-collate-equalp \(string ?\\uFF40) \(string ?\\u1FEF))
+(string-collate-equalp (string ?\\uFF40) (string ?\\u1FEF))
=> t
The optional argument LOCALE, a string, overrides the setting of your
@@ -1026,7 +1026,7 @@ to a multibyte character. In this case, the returned string is a
newly created string with no text properties. If STRING is multibyte
or entirely ASCII, it is returned unchanged. In particular, when
STRING is unibyte and entirely ASCII, the returned string is unibyte.
-\(When the characters are all ASCII, Emacs primitives will treat the
+(When the characters are all ASCII, Emacs primitives will treat the
string the same way whether it is unibyte or multibyte.) */)
(Lisp_Object string)
{
@@ -1225,14 +1225,14 @@ validate_subarray (Lisp_Object array, Lisp_Object from, Lisp_Object to,
DEFUN ("substring", Fsubstring, Ssubstring, 1, 3, 0,
doc: /* Return a new string whose contents are a substring of STRING.
The returned string consists of the characters between index FROM
-\(inclusive) and index TO (exclusive) of STRING. FROM and TO are
+(inclusive) and index TO (exclusive) of STRING. FROM and TO are
zero-indexed: 0 means the first character of STRING. Negative values
are counted from the end of STRING. If TO is nil, the substring runs
to the end of STRING.
The STRING argument may also be a vector. In that case, the return
value is a new vector that contains the elements between index FROM
-\(inclusive) and index TO (exclusive) of that vector argument.
+(inclusive) and index TO (exclusive) of that vector argument.
With one argument, just copy STRING (with properties, if any). */)
(Lisp_Object string, Lisp_Object from, Lisp_Object to)
@@ -2051,7 +2051,7 @@ merge (Lisp_Object org_l1, Lisp_Object org_l2, Lisp_Object pred)
DEFUN ("plist-get", Fplist_get, Splist_get, 2, 2, 0,
doc: /* Extract a value from a property list.
PLIST is a property list, which is a list of the form
-\(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value
+(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value
corresponding to the given PROP, or nil if PROP is not one of the
properties on the list. This function never signals an error. */)
(Lisp_Object plist, Lisp_Object prop)
@@ -2086,7 +2086,7 @@ This is the last value stored with `(put SYMBOL PROPNAME VALUE)'. */)
DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0,
doc: /* Change value in PLIST of PROP to VAL.
PLIST is a property list, which is a list of the form
-\(PROP1 VALUE1 PROP2 VALUE2 ...). PROP is a symbol and VAL is any object.
+(PROP1 VALUE1 PROP2 VALUE2 ...). PROP is a symbol and VAL is any object.
If PROP is already a property on the list, its value is set to VAL,
otherwise the new PROP VAL pair is added. The new plist is returned;
use `(setq x (plist-put x prop val))' to be sure to use the new value.
@@ -2130,7 +2130,7 @@ It can be retrieved with `(get SYMBOL PROPNAME)'. */)
DEFUN ("lax-plist-get", Flax_plist_get, Slax_plist_get, 2, 2, 0,
doc: /* Extract a value from a property list, comparing with `equal'.
PLIST is a property list, which is a list of the form
-\(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value
+(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value
corresponding to the given PROP, or nil if PROP is not
one of the properties on the list. */)
(Lisp_Object plist, Lisp_Object prop)
@@ -2155,7 +2155,7 @@ one of the properties on the list. */)
DEFUN ("lax-plist-put", Flax_plist_put, Slax_plist_put, 3, 3, 0,
doc: /* Change value in PLIST of PROP to VAL, comparing with `equal'.
PLIST is a property list, which is a list of the form
-\(PROP1 VALUE1 PROP2 VALUE2 ...). PROP and VAL are any objects.
+(PROP1 VALUE1 PROP2 VALUE2 ...). PROP and VAL are any objects.
If PROP is already a property on the list, its value is set to VAL,
otherwise the new PROP VAL pair is added. The new plist is returned;
use `(setq x (lax-plist-put x prop val))' to be sure to use the new value.
@@ -2867,7 +2867,7 @@ The normal messages at start and end of loading FILENAME are suppressed. */)
DEFUN ("plist-member", Fplist_member, Splist_member, 2, 2, 0,
doc: /* Return non-nil if PLIST has the property PROP.
PLIST is a property list, which is a list of the form
-\(PROP1 VALUE1 PROP2 VALUE2 ...\). PROP is a symbol.
+(PROP1 VALUE1 PROP2 VALUE2 ...). PROP is a symbol.
Unlike `plist-get', this allows you to distinguish between a missing
property and a property with the value nil.
The value is actually the tail of PLIST whose car is PROP. */)
diff --git a/src/font.c b/src/font.c
index 50b966ec83e..ce144e78a08 100644
--- a/src/font.c
+++ b/src/font.c
@@ -4068,7 +4068,7 @@ DEFUN ("font-face-attributes", Ffont_face_attributes, Sfont_face_attributes, 1,
FONT is a font name, a font-spec, a font-entity, or a font-object.
The return value is a list of the form
-\(:family FAMILY :height HEIGHT :weight WEIGHT :slant SLANT :width WIDTH)
+(:family FAMILY :height HEIGHT :weight WEIGHT :slant SLANT :width WIDTH)
where FAMILY, HEIGHT, WEIGHT, SLANT, and WIDTH are face attribute values
compatible with `set-face-attribute'. Some of these key-attribute pairs
@@ -4472,6 +4472,106 @@ where
return val;
}
+/* Return a description of the font at POSITION in the current buffer.
+ If the 2nd optional arg CH is non-nil, it is a character to check
+ the font instead of the character at POSITION.
+
+ For a graphical display, return a cons (FONT-OBJECT . GLYPH-CODE).
+ FONT-OBJECT is the font for the character at POSITION in the current
+ buffer. This is computed from all the text properties and overlays
+ that apply to POSITION. POSITION may be nil, in which case,
+ FONT-SPEC is the font for displaying the character CH with the
+ default face. GLYPH-CODE is the glyph code in the font to use for
+ the character.
+
+ For a text terminal, return a nonnegative integer glyph code for
+ the character, or a negative integer if the character is not
+ displayable. Terminal glyph codes are system-dependent integers
+ that represent displayable characters: for example, on a Linux x86
+ console they represent VGA code points.
+
+ It returns nil in the following cases:
+
+ (1) The window system doesn't have a font for the character (thus
+ it is displayed by an empty box).
+
+ (2) The character code is invalid.
+
+ (3) If POSITION is not nil, and the current buffer is not displayed
+ in any window.
+
+ (4) For a text terminal, the terminal does not report glyph codes.
+
+ In addition, the returned font name may not take into account of
+ such redisplay engine hooks as what used in jit-lock-mode if
+ POSITION is currently not visible. */
+
+
+DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
+ doc: /* For internal use only. */)
+ (Lisp_Object position, Lisp_Object ch)
+{
+ ptrdiff_t pos, pos_byte, dummy;
+ int face_id;
+ int c;
+ struct frame *f;
+
+ if (NILP (position))
+ {
+ CHECK_CHARACTER (ch);
+ c = XINT (ch);
+ f = XFRAME (selected_frame);
+ face_id = lookup_basic_face (f, DEFAULT_FACE_ID);
+ pos = -1;
+ }
+ else
+ {
+ Lisp_Object window;
+ struct window *w;
+
+ CHECK_NUMBER_COERCE_MARKER (position);
+ if (! (BEGV <= XINT (position) && XINT (position) < ZV))
+ args_out_of_range_3 (position, make_number (BEGV), make_number (ZV));
+ pos = XINT (position);
+ pos_byte = CHAR_TO_BYTE (pos);
+ if (NILP (ch))
+ c = FETCH_CHAR (pos_byte);
+ else
+ {
+ CHECK_NATNUM (ch);
+ c = XINT (ch);
+ }
+ window = Fget_buffer_window (Fcurrent_buffer (), Qnil);
+ if (NILP (window))
+ return Qnil;
+ w = XWINDOW (window);
+ f = XFRAME (w->frame);
+ face_id = face_at_buffer_position (w, pos, &dummy,
+ pos + 100, false, -1);
+ }
+ if (! CHAR_VALID_P (c))
+ return Qnil;
+
+ if (! FRAME_WINDOW_P (f))
+ return terminal_glyph_code (FRAME_TERMINAL (f), c);
+
+ /* We need the basic faces to be valid below, so recompute them if
+ some code just happened to clear the face cache. */
+ if (FRAME_FACE_CACHE (f)->used == 0)
+ recompute_basic_faces (f);
+
+ face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil);
+ struct face *face = FACE_FROM_ID (f, face_id);
+ if (! face->font)
+ return Qnil;
+ unsigned code = face->font->driver->encode_char (face->font, c);
+ if (code == FONT_INVALID_CODE)
+ return Qnil;
+ Lisp_Object font_object;
+ XSETFONT (font_object, face->font);
+ return Fcons (font_object, INTEGER_TO_CONS (code));
+}
+
#if 0
DEFUN ("font-drive-otf", Ffont_drive_otf, Sfont_drive_otf, 6, 6, 0,
@@ -4649,15 +4749,15 @@ ASCENT, DESCENT, SPACE-WIDTH, AVERAGE-WIDTH are metrics of the font in
pixels.
CAPABILITY is a list whose first element is a symbol representing the
-font format \(x, opentype, truetype, type1, pcf, or bdf) and the
+font format (x, opentype, truetype, type1, pcf, or bdf) and the
remaining elements describe the details of the font capability.
If the font is OpenType font, the form of the list is
- \(opentype GSUB GPOS)
+ (opentype GSUB GPOS)
where GSUB shows which "GSUB" features the font supports, and GPOS
shows which "GPOS" features the font supports. Both GSUB and GPOS are
lists of the format:
- \((SCRIPT (LANGSYS FEATURE ...) ...) ...)
+ ((SCRIPT (LANGSYS FEATURE ...) ...) ...)
If the font is not OpenType font, currently the length of the form is
one.
@@ -4943,11 +5043,11 @@ where
as follows:
If the font is OpenType font, the form of the list is
- \(opentype GSUB GPOS)
+ (opentype GSUB GPOS)
where GSUB shows which "GSUB" features the font supports, and GPOS
shows which "GPOS" features the font supports. Both GSUB and GPOS are
lists of the form:
- \((SCRIPT (LANGSYS FEATURE ...) ...) ...)
+ ((SCRIPT (LANGSYS FEATURE ...) ...) ...)
where
SCRIPT is a symbol representing OpenType script tag.
@@ -5229,6 +5329,7 @@ syms_of_font (void)
defsubr (&Sclear_font_cache);
defsubr (&Sfont_shape_gstring);
defsubr (&Sfont_variation_glyphs);
+ defsubr (&Sinternal_char_font);
#if 0
defsubr (&Sfont_drive_otf);
defsubr (&Sfont_otf_alternates);
@@ -5258,7 +5359,7 @@ where ENCODING is a charset or a char-table,
and REPERTORY is a charset, a char-table, or nil.
If ENCODING and REPERTORY are the same, the element can have the form
-\(REGEXP . ENCODING).
+(REGEXP . ENCODING).
ENCODING is for converting a character to a glyph code of the font.
If ENCODING is a charset, encoding a character by the charset gives
diff --git a/src/fontset.c b/src/fontset.c
index 50fcc648548..e735989bcbf 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1787,100 +1787,6 @@ update_auto_fontset_alist (Lisp_Object font_object, Lisp_Object fontset)
}
-/* Return a cons (FONT-OBJECT . GLYPH-CODE).
- FONT-OBJECT is the font for the character at POSITION in the current
- buffer. This is computed from all the text properties and overlays
- that apply to POSITION. POSITION may be nil, in which case,
- FONT-SPEC is the font for displaying the character CH with the
- default face.
-
- GLYPH-CODE is the glyph code in the font to use for the character.
-
- If the 2nd optional arg CH is non-nil, it is a character to check
- the font instead of the character at POSITION.
-
- It returns nil in the following cases:
-
- (1) The window system doesn't have a font for the character (thus
- it is displayed by an empty box).
-
- (2) The character code is invalid.
-
- (3) If POSITION is not nil, and the current buffer is not displayed
- in any window.
-
- In addition, the returned font name may not take into account of
- such redisplay engine hooks as what used in jit-lock-mode if
- POSITION is currently not visible. */
-
-
-DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
- doc: /* For internal use only. */)
- (Lisp_Object position, Lisp_Object ch)
-{
- ptrdiff_t pos, pos_byte, dummy;
- int face_id;
- int c;
- struct frame *f;
- struct face *face;
-
- if (NILP (position))
- {
- CHECK_CHARACTER (ch);
- c = XINT (ch);
- f = XFRAME (selected_frame);
- face_id = lookup_basic_face (f, DEFAULT_FACE_ID);
- pos = -1;
- }
- else
- {
- Lisp_Object window;
- struct window *w;
-
- CHECK_NUMBER_COERCE_MARKER (position);
- if (! (BEGV <= XINT (position) && XINT (position) < ZV))
- args_out_of_range_3 (position, make_number (BEGV), make_number (ZV));
- pos = XINT (position);
- pos_byte = CHAR_TO_BYTE (pos);
- if (NILP (ch))
- c = FETCH_CHAR (pos_byte);
- else
- {
- CHECK_NATNUM (ch);
- c = XINT (ch);
- }
- window = Fget_buffer_window (Fcurrent_buffer (), Qnil);
- if (NILP (window))
- return Qnil;
- w = XWINDOW (window);
- f = XFRAME (w->frame);
- face_id = face_at_buffer_position (w, pos, &dummy,
- pos + 100, false, -1);
- }
- if (! CHAR_VALID_P (c))
- return Qnil;
- if (!FRAME_WINDOW_P (f))
- return Qnil;
- /* We need the basic faces to be valid below, so recompute them if
- some code just happened to clear the face cache. */
- if (FRAME_FACE_CACHE (f)->used == 0)
- recompute_basic_faces (f);
- face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil);
- face = FACE_FROM_ID (f, face_id);
- if (face->font)
- {
- unsigned code = face->font->driver->encode_char (face->font, c);
- Lisp_Object font_object;
-
- if (code == FONT_INVALID_CODE)
- return Qnil;
- XSETFONT (font_object, face->font);
- return Fcons (font_object, INTEGER_TO_CONS (code));
- }
- return Qnil;
-}
-
-
DEFUN ("fontset-info", Ffontset_info, Sfontset_info, 1, 2, 0,
doc: /* Return information about a fontset FONTSET on frame FRAME.
@@ -2247,7 +2153,6 @@ at the vertical center of lines. */);
defsubr (&Squery_fontset);
defsubr (&Snew_fontset);
defsubr (&Sset_fontset_font);
- defsubr (&Sinternal_char_font);
defsubr (&Sfontset_info);
defsubr (&Sfontset_font);
defsubr (&Sfontset_list);
diff --git a/src/frame.c b/src/frame.c
index 6debcb8e7bc..121c55fdb20 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -634,7 +634,6 @@ make_frame (bool mini_p)
f->garbaged = true;
f->can_x_set_window_size = false;
f->after_make_frame = false;
- f->tool_bar_redisplayed_once = false;
f->column_width = 1; /* !FRAME_WINDOW_P value. */
f->line_height = 1; /* !FRAME_WINDOW_P value. */
#ifdef HAVE_WINDOW_SYSTEM
@@ -3540,7 +3539,8 @@ x_set_screen_gamma (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
(f, bgcolor, Qnil);
}
- Fclear_face_cache (Qnil);
+ clear_face_cache (true);
+ windows_or_buffers_changed = 70;
}
@@ -3634,7 +3634,6 @@ x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
#endif
/* Recalculate toolbar height. */
f->n_tool_bar_rows = 0;
- f->tool_bar_redisplayed_once = false;
/* Ensure we redraw it. */
clear_current_matrices (f);
@@ -5177,7 +5176,7 @@ keep it unchanged if this option is either t or a list containing
`vertical-scroll-bars'.
The default value is \\='(tool-bar-lines) on Lucid, Motif and Windows
-\(which means that adding/removing a tool bar does not change the frame
+(which means that adding/removing a tool bar does not change the frame
height), nil on all other window systems including GTK+ (which means
that changing any of the parameters listed above may change the size of
the frame), and t otherwise (which means the frame size never changes
diff --git a/src/frame.h b/src/frame.h
index 8ee37dfd695..af0dadb3d99 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -335,9 +335,8 @@ struct frame
/* Set to true after this frame was made by `make-frame'. */
bool_bf after_make_frame : 1;
- /* True means tool bar has been redisplayed at least once in current
- session. */
- bool_bf tool_bar_redisplayed_once : 1;
+ /* Non-zero if this frame's faces need to be recomputed. */
+ bool_bf face_change : 1;
/* Bitfield area ends here. */
@@ -618,7 +617,7 @@ fset_desired_tool_bar_string (struct frame *f, Lisp_Object val)
}
#endif /* HAVE_WINDOW_SYSTEM && !USE_GTK && !HAVE_NS */
-#define NUMVAL(X) ((INTEGERP (X) || FLOATP (X)) ? XFLOATINT (X) : -1)
+#define NUMVAL(X) (NUMBERP (X) ? XFLOATINT (X) : -1)
INLINE double
default_pixels_per_inch_x (void)
diff --git a/src/gfilenotify.c b/src/gfilenotify.c
index 5c6ebe65d87..8b6b0a0cd2d 100644
--- a/src/gfilenotify.c
+++ b/src/gfilenotify.c
@@ -29,6 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "process.h"
+/* This is a list, elements are triples (DESCRIPTOR FILE FLAGS CALLBACK) */
static Lisp_Object watch_list;
/* This is the callback function for arriving signals from
@@ -41,7 +42,7 @@ dir_monitor_callback (GFileMonitor *monitor,
GFileMonitorEvent event_type,
gpointer user_data)
{
- Lisp_Object symbol, monitor_object, watch_object;
+ Lisp_Object symbol, monitor_object, watch_object, flags;
char *name = g_file_get_parse_name (file);
char *oname = other_file ? g_file_get_parse_name (other_file) : NULL;
@@ -83,20 +84,36 @@ dir_monitor_callback (GFileMonitor *monitor,
if (CONSP (watch_object))
{
- /* Construct an event. */
struct input_event event;
Lisp_Object otail = oname ? list1 (build_string (oname)) : Qnil;
- EVENT_INIT (event);
- event.kind = FILE_NOTIFY_EVENT;
- event.frame_or_window = Qnil;
- event.arg = list2 (Fcons (monitor_object,
- Fcons (symbol,
- Fcons (build_string (name),
- otail))),
- XCDR (watch_object));
-
- /* Store it into the input event queue. */
- kbd_buffer_store_event (&event);
+
+ /* Check, whether event_type is expected. */
+ flags = XCAR (XCDR (XCDR (watch_object)));
+ if ((!NILP (Fmember (Qchange, flags)) &&
+ !NILP (Fmember (symbol, list5 (Qchanged, Qchanges_done_hint,
+ Qdeleted, Qcreated, Qmoved)))) ||
+ (!NILP (Fmember (Qattribute_change, flags)) &&
+ ((EQ (symbol, Qattribute_changed)))))
+ {
+ /* Construct an event. */
+ EVENT_INIT (event);
+ event.kind = FILE_NOTIFY_EVENT;
+ event.frame_or_window = Qnil;
+ event.arg = list2 (Fcons (monitor_object,
+ Fcons (symbol,
+ Fcons (build_string (name),
+ otail))),
+ XCAR (XCDR (XCDR (XCDR (watch_object)))));
+
+ /* Store it into the input event queue. */
+ kbd_buffer_store_event (&event);
+ // XD_DEBUG_MESSAGE ("%s", XD_OBJECT_TO_STRING (event.arg));
+ }
+
+ /* Cancel monitor if file or directory is deleted. */
+ if (!NILP (Fmember (symbol, list2 (Qdeleted, Qmoved))) &&
+ !g_file_monitor_is_cancelled (monitor))
+ g_file_monitor_cancel (monitor);
}
/* Cleanup. */
@@ -119,9 +136,13 @@ watched for some reason, this function signals a `file-notify-error' error.
FLAGS is a list of conditions to set what will be watched for. It can
include the following symbols:
- `watch-mounts' -- watch for mount events
- `send-moved' -- pair `deleted' and `created' events caused by file
- renames and send a single `renamed' event instead
+ `change' -- watch for file changes
+ `attribute-change' -- watch for file attributes changes, like
+ permissions or modification time
+ `watch-mounts' -- watch for mount events
+ `send-moved' -- pair `deleted' and `created' events caused by
+ file renames and send a single `renamed' event
+ instead
When any event happens, Emacs will call the CALLBACK function passing
it a single argument EVENT, which is of the form
@@ -194,11 +215,15 @@ will be reported only in case of the `moved' event. */)
file);
}
+ /* The default rate limit is 800 msec. We adapt this. */
+ g_file_monitor_set_rate_limit (monitor, 100);
+
+ /* Subscribe to the "changed" signal. */
g_signal_connect (monitor, "changed",
(GCallback) dir_monitor_callback, NULL);
/* Store watch object in watch list. */
- watch_object = Fcons (watch_descriptor, callback);
+ watch_object = list4 (watch_descriptor, file, flags, callback);
watch_list = Fcons (watch_object, watch_list);
return watch_descriptor;
@@ -218,11 +243,12 @@ WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'. */)
eassert (INTEGERP (watch_descriptor));
GFileMonitor *monitor = XINTPTR (watch_descriptor);
- if (!g_file_monitor_cancel (monitor))
- xsignal2 (Qfile_notify_error, build_string ("Could not rm watch"),
- watch_descriptor);
+ if (!g_file_monitor_is_cancelled (monitor) &&
+ !g_file_monitor_cancel (monitor))
+ xsignal2 (Qfile_notify_error, build_string ("Could not rm watch"),
+ watch_descriptor);
- /* Remove watch descriptor from watch list. */
+ /* Remove watch descriptor from watch list. */
watch_list = Fdelq (watch_object, watch_list);
/* Cleanup. */
@@ -231,6 +257,27 @@ WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'. */)
return Qt;
}
+DEFUN ("gfile-valid-p", Fgfile_valid_p, Sgfile_valid_p, 1, 1, 0,
+ doc: /* "Check a watch specified by its WATCH-DESCRIPTOR.
+
+WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'.
+
+A watch can become invalid if the file or directory it watches is
+deleted, or if the watcher thread exits abnormally for any other
+reason. Removing the watch by calling `gfile-rm-watch' also makes it
+invalid. */)
+ (Lisp_Object watch_descriptor)
+{
+ Lisp_Object watch_object = Fassoc (watch_descriptor, watch_list);
+ if (NILP (watch_object))
+ return Qnil;
+ else
+ {
+ GFileMonitor *monitor = XINTPTR (watch_descriptor);
+ return g_file_monitor_is_cancelled (monitor) ? Qnil : Qt;
+ }
+}
+
void
globals_of_gfilenotify (void)
@@ -246,8 +293,11 @@ syms_of_gfilenotify (void)
{
defsubr (&Sgfile_add_watch);
defsubr (&Sgfile_rm_watch);
+ defsubr (&Sgfile_valid_p);
/* Filter objects. */
+ DEFSYM (Qchange, "change");
+ DEFSYM (Qattribute_change, "attribute-change");
DEFSYM (Qwatch_mounts, "watch-mounts"); /* G_FILE_MONITOR_WATCH_MOUNTS */
DEFSYM (Qsend_moved, "send-moved"); /* G_FILE_MONITOR_SEND_MOVED */
diff --git a/src/image.c b/src/image.c
index 85cf801f6a9..b586c5341d7 100644
--- a/src/image.c
+++ b/src/image.c
@@ -797,7 +797,7 @@ parse_image_spec (Lisp_Object spec, struct image_keyword *keywords,
return 0;
case IMAGE_NUMBER_VALUE:
- if (!INTEGERP (value) && !FLOATP (value))
+ if (! NUMBERP (value))
return 0;
break;
@@ -7499,6 +7499,12 @@ gif_image_p (Lisp_Object object)
# define GIFLIB_MAJOR 4
# endif
+/* GifErrorString is declared to return char const * when GIFLIB_MAJOR
+ and GIFLIB_MINOR indicate 5.1 or later. Do not bother using it in
+ earlier releases, where either it returns char * or GIFLIB_MINOR
+ may be incorrect. */
+# define HAVE_GIFERRORSTRING (5 < GIFLIB_MAJOR + (1 <= GIFLIB_MINOR))
+
# ifdef WINDOWSNT
/* GIF library details. */
@@ -7514,7 +7520,9 @@ DEF_DLL_FN (GifFileType *, DGifOpenFileName, (const char *));
# else
DEF_DLL_FN (GifFileType *, DGifOpen, (void *, InputFunc, int *));
DEF_DLL_FN (GifFileType *, DGifOpenFileName, (const char *, int *));
-DEF_DLL_FN (char *, GifErrorString, (int));
+# endif
+# if HAVE_GIFERRORSTRING
+DEF_DLL_FN (char const *, GifErrorString, (int));
# endif
static bool
@@ -7529,7 +7537,7 @@ init_gif_functions (void)
LOAD_DLL_FN (library, DGifSlurp);
LOAD_DLL_FN (library, DGifOpen);
LOAD_DLL_FN (library, DGifOpenFileName);
-# if GIFLIB_MAJOR >= 5
+# if HAVE_GIFERRORSTRING
LOAD_DLL_FN (library, GifErrorString);
# endif
return 1;
@@ -7641,20 +7649,19 @@ gif_load (struct frame *f, struct image *img)
/* Open the GIF file. */
#if GIFLIB_MAJOR < 5
gif = DGifOpenFileName (SSDATA (encoded_file));
- if (gif == NULL)
- {
- image_error ("Cannot open `%s'", file);
- return 0;
- }
#else
gif = DGifOpenFileName (SSDATA (encoded_file), &gif_err);
+#endif
if (gif == NULL)
{
+#if HAVE_GIFERRORSTRING
image_error ("Cannot open `%s': %s",
file, build_string (GifErrorString (gif_err)));
+#else
+ image_error ("Cannot open `%s'", file);
+#endif
return 0;
}
-#endif
}
else
{
@@ -7672,20 +7679,19 @@ gif_load (struct frame *f, struct image *img)
#if GIFLIB_MAJOR < 5
gif = DGifOpen (&memsrc, gif_read_from_memory);
- if (!gif)
- {
- image_error ("Cannot open memory source `%s'", img->spec);
- return 0;
- }
#else
gif = DGifOpen (&memsrc, gif_read_from_memory, &gif_err);
+#endif
if (!gif)
{
+#if HAVE_GIFERRORSTRING
image_error ("Cannot open memory source `%s': %s",
img->spec, build_string (GifErrorString (gif_err)));
+#else
+ image_error ("Cannot open memory source `%s'", img->spec);
+#endif
return 0;
}
-#endif
}
/* Before reading entire contents, check the declared image size. */
@@ -7980,8 +7986,8 @@ gif_load (struct frame *f, struct image *img)
if (gif_close (gif, &gif_err) == GIF_ERROR)
{
-#if 5 <= GIFLIB_MAJOR
- char *error_text = GifErrorString (gif_err);
+#if HAVE_GIFERRORSTRING
+ char const *error_text = GifErrorString (gif_err);
if (error_text)
image_error ("Error closing `%s': %s",
diff --git a/src/indent.c b/src/indent.c
index 7e8f0a573a3..584f2179bc5 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -485,7 +485,9 @@ check_display_width (ptrdiff_t pos, ptrdiff_t col, ptrdiff_t *endpos)
: MOST_POSITIVE_FIXNUM);
if ((prop = Fplist_get (plist, QCwidth),
- RANGED_INTEGERP (0, prop, INT_MAX)))
+ RANGED_INTEGERP (0, prop, INT_MAX))
+ || (prop = Fplist_get (plist, QCrelative_width),
+ RANGED_INTEGERP (0, prop, INT_MAX)))
width = XINT (prop);
else if (FLOATP (prop) && 0 <= XFLOAT_DATA (prop)
&& XFLOAT_DATA (prop) <= INT_MAX)
@@ -504,6 +506,18 @@ check_display_width (ptrdiff_t pos, ptrdiff_t col, ptrdiff_t *endpos)
*endpos = OVERLAY_POSITION (OVERLAY_END (overlay));
else
get_property_and_range (pos, Qdisplay, &val, &start, endpos, Qnil);
+
+ /* For :relative-width, we need to multiply by the column
+ width of the character at POS, if it is greater than 1. */
+ if (!NILP (Fplist_get (plist, QCrelative_width))
+ && !NILP (BVAR (current_buffer, enable_multibyte_characters)))
+ {
+ int b, wd;
+ unsigned char *p = BYTE_POS_ADDR (CHAR_TO_BYTE (pos));
+
+ MULTIBYTE_BYTES_WIDTH (p, buffer_display_table (), b, wd);
+ width *= wd;
+ }
return width;
}
}
@@ -2195,7 +2209,27 @@ whether or not it is currently displayed in some window. */)
was originally hscrolled, the goal column is interpreted as
an addition to the hscroll amount. */
if (lcols_given)
- move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
+ {
+ move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
+ /* If we find ourselves in the middle of an overlay string
+ which includes a newline after current string position,
+ we need to move by lines until we get out of the string,
+ and then reposition point at the requested X coordinate;
+ if we don't, the cursor will be placed just after the
+ string, which might not be the requested column. */
+ if (nlines > 0 && it.area == TEXT_AREA)
+ {
+ while (it.method == GET_FROM_STRING
+ && !it.string_from_display_prop_p
+ && memchr (SSDATA (it.string) + IT_STRING_BYTEPOS (it),
+ '\n',
+ SBYTES (it.string) - IT_STRING_BYTEPOS (it)))
+ {
+ move_it_by_lines (&it, 1);
+ move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
+ }
+ }
+ }
SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
bidi_unshelve_cache (itdata, 0);
diff --git a/src/inotify.c b/src/inotify.c
index eddad73e8f7..be8c1dd7553 100644
--- a/src/inotify.c
+++ b/src/inotify.c
@@ -29,6 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "frame.h" /* Required for termhooks.h. */
#include "termhooks.h"
+#include <errno.h>
#include <sys/inotify.h>
#include <sys/ioctl.h>
@@ -129,17 +130,14 @@ inotify_callback (int fd, void *_)
to_read = 0;
if (ioctl (fd, FIONREAD, &to_read) == -1)
- xsignal1
- (Qfile_notify_error,
- build_string ("Error while trying to retrieve file system events"));
+ report_file_notify_error ("Error while retrieving file system events",
+ Qnil);
buffer = xmalloc (to_read);
n = read (fd, buffer, to_read);
if (n < 0)
{
xfree (buffer);
- xsignal1
- (Qfile_notify_error,
- build_string ("Error while trying to read file system events"));
+ report_file_notify_error ("Error while reading file system events", Qnil);
}
EVENT_INIT (event);
@@ -215,7 +213,10 @@ symbol_to_inotifymask (Lisp_Object symb)
else if (EQ (symb, Qt) || EQ (symb, Qall_events))
return IN_ALL_EVENTS;
else
- xsignal2 (Qfile_notify_error, build_string ("Unknown aspect"), symb);
+ {
+ errno = EINVAL;
+ report_file_notify_error ("Unknown aspect", symb);
+ }
}
static uint32_t
@@ -307,9 +308,7 @@ is managed internally and there is no corresponding inotify_init. Use
{
inotifyfd = inotify_init1 (IN_NONBLOCK|IN_CLOEXEC);
if (inotifyfd < 0)
- xsignal1
- (Qfile_notify_error,
- build_string ("File watching feature (inotify) is not available"));
+ report_file_notify_error ("File watching is not available", Qnil);
watch_list = Qnil;
add_read_fd (inotifyfd, &inotify_callback, NULL);
}
@@ -318,17 +317,16 @@ is managed internally and there is no corresponding inotify_init. Use
encoded_file_name = ENCODE_FILE (file_name);
watchdesc = inotify_add_watch (inotifyfd, SSDATA (encoded_file_name), mask);
if (watchdesc == -1)
- xsignal2 (Qfile_notify_error,
- build_string ("Could not add watch for file"), file_name);
+ report_file_notify_error ("Could not add watch for file", file_name);
watch_descriptor = make_watch_descriptor (watchdesc);
- /* Delete existing watch object. */
+ /* Delete existing watch object. */
watch_object = Fassoc (watch_descriptor, watch_list);
if (!NILP (watch_object))
watch_list = Fdelete (watch_object, watch_list);
- /* Store watch object in watch list. */
+ /* Store watch object in watch list. */
watch_object = Fcons (watch_descriptor, callback);
watch_list = Fcons (watch_object, watch_list);
@@ -348,15 +346,14 @@ See inotify_rm_watch(2) for more information.
int wd = XINT (watch_descriptor);
if (inotify_rm_watch (inotifyfd, wd) == -1)
- xsignal2 (Qfile_notify_error,
- build_string ("Could not rm watch"), watch_descriptor);
+ report_file_notify_error ("Could not rm watch", watch_descriptor);
- /* Remove watch descriptor from watch list. */
+ /* Remove watch descriptor from watch list. */
watch_object = Fassoc (watch_descriptor, watch_list);
if (!NILP (watch_object))
watch_list = Fdelete (watch_object, watch_list);
- /* Cleanup if no more files are watched. */
+ /* Cleanup if no more files are watched. */
if (NILP (watch_list))
{
emacs_close (inotifyfd);
@@ -367,6 +364,21 @@ See inotify_rm_watch(2) for more information.
return Qt;
}
+DEFUN ("inotify-valid-p", Finotify_valid_p, Sinotify_valid_p, 1, 1, 0,
+ doc: /* "Check a watch specified by its WATCH-DESCRIPTOR.
+
+WATCH-DESCRIPTOR should be an object returned by `inotify-add-watch'.
+
+A watch can become invalid if the file or directory it watches is
+deleted, or if the watcher thread exits abnormally for any other
+reason. Removing the watch by calling `inotify-rm-watch' also makes
+it invalid. */)
+ (Lisp_Object watch_descriptor)
+{
+ Lisp_Object watch_object = Fassoc (watch_descriptor, watch_list);
+ return NILP (watch_object) ? Qnil : Qt;
+}
+
void
syms_of_inotify (void)
{
@@ -401,6 +413,7 @@ syms_of_inotify (void)
defsubr (&Sinotify_add_watch);
defsubr (&Sinotify_rm_watch);
+ defsubr (&Sinotify_valid_p);
staticpro (&watch_list);
diff --git a/src/keyboard.c b/src/keyboard.c
index ccd340557dd..966af69c97b 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -11332,7 +11332,7 @@ See Info node `(elisp)Multiple Terminals'. */);
DEFVAR_BOOL ("cannot-suspend", cannot_suspend,
doc: /* Non-nil means to always spawn a subshell instead of suspending.
-\(Even if the operating system has support for stopping a process.\) */);
+(Even if the operating system has support for stopping a process.) */);
cannot_suspend = false;
DEFVAR_BOOL ("menu-prompting", menu_prompting,
@@ -11538,7 +11538,7 @@ immediately after running `post-command-hook'. */);
DEFVAR_LISP ("input-method-function", Vinput_method_function,
doc: /* If non-nil, the function that implements the current input method.
It's called with one argument, a printing character that was just read.
-\(That means a character with code 040...0176.)
+(That means a character with code 040...0176.)
Typically this function uses `read-event' to read additional events.
When it does so, it should first bind `input-method-function' to nil
so it will not be called recursively.
diff --git a/src/keymap.c b/src/keymap.c
index 3668d4b24e2..6a8d129ce2b 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1687,7 +1687,7 @@ DEFUN ("global-key-binding", Fglobal_key_binding, Sglobal_key_binding, 1, 2, 0,
KEYS is a string or vector, a sequence of keystrokes.
The binding is probably a symbol with a function definition.
This function's return values are the same as those of `lookup-key'
-\(which see).
+(which see).
If optional argument ACCEPT-DEFAULT is non-nil, recognize default
bindings; see the description of `lookup-key' for more details about this. */)
@@ -2492,7 +2492,7 @@ If FIRSTONLY is the symbol `non-ascii', return the first binding found,
no matter what it is.
If FIRSTONLY has another non-nil value, prefer bindings
that use the modifier key specified in `where-is-preferred-modifier'
-\(or their meta variants) and entirely reject menu bindings.
+(or their meta variants) and entirely reject menu bindings.
If optional 4th arg NOINDIRECT is non-nil, don't extract the commands inside
menu-items. This makes it possible to search for a menu-item itself.
@@ -2723,7 +2723,7 @@ looked up in BUFFER.
The optional argument PREFIX, if non-nil, should be a key sequence;
then we display only bindings that start with that prefix.
The optional argument MENUS, if non-nil, says to mention menu bindings.
-\(Ordinarily these are omitted from the output.) */)
+(Ordinarily these are omitted from the output.) */)
(Lisp_Object buffer, Lisp_Object prefix, Lisp_Object menus)
{
Lisp_Object outbuf, shadow;
diff --git a/src/lisp.h b/src/lisp.h
index d2d385605ce..2d6661787cf 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1,4 +1,4 @@
-/* Fundamental definitions for GNU Emacs Lisp interpreter.
+/* Fundamental definitions for GNU Emacs Lisp interpreter. -*- coding: utf-8 -*-
Copyright (C) 1985-1987, 1993-1995, 1997-2015 Free Software Foundation,
Inc.
@@ -2736,7 +2736,7 @@ XFLOATINT (Lisp_Object n)
INLINE void
CHECK_NUMBER_OR_FLOAT (Lisp_Object x)
{
- CHECK_TYPE (FLOATP (x) || INTEGERP (x), Qnumberp, x);
+ CHECK_TYPE (NUMBERP (x), Qnumberp, x);
}
#define CHECK_NUMBER_OR_FLOAT_COERCE_MARKER(x) \
@@ -2744,7 +2744,7 @@ CHECK_NUMBER_OR_FLOAT (Lisp_Object x)
if (MARKERP (x)) \
XSETFASTINT (x, marker_position (x)); \
else \
- CHECK_TYPE (INTEGERP (x) || FLOATP (x), Qnumber_or_marker_p, x); \
+ CHECK_TYPE (NUMBERP (x), Qnumber_or_marker_p, x); \
} while (false)
/* Since we can't assign directly to the CAR or CDR fields of a cons
@@ -3840,6 +3840,7 @@ extern void fclose_unwind (void *);
extern void restore_point_unwind (Lisp_Object);
extern _Noreturn void report_file_errno (const char *, Lisp_Object, int);
extern _Noreturn void report_file_error (const char *, Lisp_Object);
+extern _Noreturn void report_file_notify_error (const char *, Lisp_Object);
extern bool internal_delete_file (Lisp_Object);
extern Lisp_Object emacs_readlinkat (int, const char *);
extern bool file_directory_p (const char *);
@@ -4352,12 +4353,13 @@ INLINE ptrdiff_t
lisp_word_count (ptrdiff_t nbytes)
{
if (-1 >> 1 == -1)
- switch (word_size)
+ switch (word_size + 0)
{
case 2: return nbytes >> 1;
case 4: return nbytes >> 2;
case 8: return nbytes >> 3;
case 16: return nbytes >> 4;
+ default: break;
}
return nbytes / word_size - (nbytes % word_size < 0);
}
diff --git a/src/lread.c b/src/lread.c
index 6099545a808..bceec4bb644 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4512,7 +4512,7 @@ customize `jka-compr-load-suffixes' rather than the present variable. */);
Each element looks like (REGEXP-OR-FEATURE FUNCS...).
REGEXP-OR-FEATURE is either a regular expression to match file names, or
-a symbol \(a feature name).
+a symbol (a feature name).
When `load' is run and the file-name argument matches an element's
REGEXP-OR-FEATURE, or when `provide' is run and provides the symbol
diff --git a/src/macfont.m b/src/macfont.m
index 23d272c9129..97a255bf018 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -945,13 +945,7 @@ macfont_set_family_cache (Lisp_Object symbol, CFStringRef string)
Lisp_Object value;
if (!HASH_TABLE_P (macfont_family_cache))
- {
- Lisp_Object args[2];
-
- args[0] = QCtest;
- args[1] = Qeq;
- macfont_family_cache = Fmake_hash_table (2, args);
- }
+ macfont_family_cache = CALLN (Fmake_hash_table, QCtest, Qeq);
h = XHASH_TABLE (macfont_family_cache);
i = hash_lookup (h, symbol, &hash);
diff --git a/src/menu.c b/src/menu.c
index e36fe260f24..dc82809629a 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1129,7 +1129,7 @@ If POSITION is t, it means to use the current mouse position.
MENU is a specifier for a menu. For the simplest case, MENU is a keymap.
The menu items come from key bindings that have a menu string as well as
a definition; actually, the "definition" in such a key binding looks like
-\(STRING . REAL-DEFINITION). To give the menu a title, put a string into
+(STRING . REAL-DEFINITION). To give the menu a title, put a string into
the keymap as a top-level element.
If REAL-DEFINITION is nil, that puts a nonselectable string in the menu.
@@ -1491,7 +1491,7 @@ The return value is VALUE from the chosen item.
An ITEM may also be just a string--that makes a nonselectable item.
An ITEM may also be nil--that means to put all preceding items
on the left of the dialog box and all following items on the right.
-\(By default, approximately half appear on each side.)
+(By default, approximately half appear on each side.)
If HEADER is non-nil, the frame title for the box is "Information",
otherwise it is "Question".
diff --git a/src/minibuf.c b/src/minibuf.c
index cf0cbca77c1..4e5c17d074c 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -916,7 +916,7 @@ INITIAL-CONTENTS argument in more detail. It is only relevant when
studying existing code, or when HIST is a cons. If non-nil,
INITIAL-CONTENTS is a string to be inserted into the minibuffer before
reading input. Normally, point is put at the end of that string.
-However, if INITIAL-CONTENTS is \(STRING . POSITION), the initial
+However, if INITIAL-CONTENTS is (STRING . POSITION), the initial
input is STRING, but point is placed at _one-indexed_ position
POSITION in the minibuffer. Any integer value less than or equal to
one puts point at the beginning of the string. *Note* that this
@@ -996,7 +996,7 @@ DEFUN ("read-no-blanks-input", Fread_no_blanks_input, Sread_no_blanks_input, 1,
Prompt with PROMPT. Whitespace terminates the input. If INITIAL is
non-nil, it should be a string, which is used as initial input, with
point positioned at the end, so that SPACE will accept the input.
-\(Actually, INITIAL can also be a cons of a string and an integer.
+(Actually, INITIAL can also be a cons of a string and an integer.
Such values are treated as in `read-from-minibuffer', but are normally
not useful in this function.)
Third arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits
diff --git a/src/nsfns.m b/src/nsfns.m
index 89b9f7c4b62..ad71a508248 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1009,7 +1009,7 @@ unwind_create_frame (Lisp_Object frame)
x_free_frame_resources (f);
free_glyphs (f);
-#ifdef GLYPH_DEBUG
+#if defined GLYPH_DEBUG && defined ENABLE_CHECKING
/* Check that reference counts are indeed correct. */
eassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount);
#endif
@@ -1639,7 +1639,7 @@ DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
doc: /* Return the "vendor ID" string of Nextstep display server TERMINAL.
-\(Labeling every distributor as a "vendor" embodies the false assumption
+(Labeling every distributor as a "vendor" embodies the false assumption
that operating systems cannot be developed and distributed noncommercially.)
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
@@ -1816,7 +1816,7 @@ DISPLAY is the name of the display to connect to.
Optional second arg XRM-STRING is a string of resources in xrdb format.
If the optional third arg MUST-SUCCEED is non-nil,
terminate Emacs if we can't open the connection.
-\(In the Nextstep version, the last two arguments are currently ignored.) */)
+(In the Nextstep version, the last two arguments are currently ignored.) */)
(Lisp_Object display, Lisp_Object resource_string, Lisp_Object must_succeed)
{
struct ns_display_info *dpyinfo;
@@ -2289,7 +2289,7 @@ x_get_focus_frame (struct frame *frame)
DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
doc: /* Internal function called by `color-defined-p', which see.
-\(Note that the Nextstep version of this function ignores FRAME.) */)
+(Note that the Nextstep version of this function ignores FRAME.) */)
(Lisp_Object color, Lisp_Object frame)
{
NSColor * col;
diff --git a/src/nsselect.m b/src/nsselect.m
index 918fb55fb22..5579cc5a767 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -316,7 +316,7 @@ DEFUN ("ns-own-selection-internal", Fns_own_selection_internal,
Sns_own_selection_internal, 2, 2, 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.)
+(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, Lisp_Object value)
@@ -414,7 +414,7 @@ DEFUN ("ns-selection-owner-p", Fns_selection_owner_p, Sns_selection_owner_p,
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, since that's what X expects.)
+(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)
@@ -433,7 +433,7 @@ DEFUN ("ns-get-selection", Fns_get_selection,
Sns_get_selection, 2, 2, 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.)
+(Those are literal upper-case symbol names, since that's what X expects.)
TARGET-TYPE is the type of data desired, typically `STRING'. */)
(Lisp_Object selection_name, Lisp_Object target_type)
{
diff --git a/src/nsterm.m b/src/nsterm.m
index 2806f31155d..a5bf06a70af 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1,4 +1,4 @@
-/* NeXT/Open/GNUstep / MacOSX communication module.
+/* NeXT/Open/GNUstep / MacOSX communication module. -*- coding: utf-8 -*-
Copyright (C) 1989, 1993-1994, 2005-2006, 2008-2015 Free Software
Foundation, Inc.
@@ -440,10 +440,7 @@ append2 (Lisp_Object list, Lisp_Object item)
Utility to append to a list
-------------------------------------------------------------------------- */
{
- Lisp_Object array[2];
- array[0] = list;
- array[1] = list1 (item);
- return Fnconc (2, &array[0]);
+ return CALLN (Fnconc, list, list1 (item));
}
@@ -1333,6 +1330,7 @@ x_set_window_size (struct frame *f,
int tb = FRAME_EXTERNAL_TOOL_BAR (f);
int pixelwidth, pixelheight;
int rows, cols;
+ int orig_height = wr.size.height;
NSTRACE (x_set_window_size);
@@ -1386,7 +1384,7 @@ x_set_window_size (struct frame *f,
if (f->output_data.ns->zooming)
f->output_data.ns->zooming = 0;
else
- wr.origin.y += FRAME_PIXEL_HEIGHT (f) - pixelheight;
+ wr.origin.y += orig_height - wr.size.height;
[view setRows: rows andColumns: cols];
[window setFrame: wr display: YES];
diff --git a/src/print.c b/src/print.c
index 94f3fcd7db1..3c3dca77000 100644
--- a/src/print.c
+++ b/src/print.c
@@ -2198,7 +2198,7 @@ Also print formfeeds as `\\f'. */);
DEFVAR_BOOL ("print-escape-nonascii", print_escape_nonascii,
doc: /* Non-nil means print unibyte non-ASCII chars in strings as \\OOO.
-\(OOO is the octal representation of the character code.)
+(OOO is the octal representation of the character code.)
Only single-byte characters are affected, and only in `prin1'.
When the output goes in a multibyte buffer, this feature is
enabled regardless of the value of the variable. */);
@@ -2206,7 +2206,7 @@ enabled regardless of the value of the variable. */);
DEFVAR_BOOL ("print-escape-multibyte", print_escape_multibyte,
doc: /* Non-nil means print multibyte characters in strings as \\xXXXX.
-\(XXXX is the hex representation of the character code.)
+(XXXX is the hex representation of the character code.)
This affects only `prin1'. */);
print_escape_multibyte = 0;
diff --git a/src/process.c b/src/process.c
index f4613be28ed..42dd17c57e0 100644
--- a/src/process.c
+++ b/src/process.c
@@ -957,7 +957,7 @@ DEFUN ("process-command", Fprocess_command, Sprocess_command, 1, 1, 0,
This is a list of strings, the first string being the program executed
and the rest of the strings being the arguments given to it.
For a network or serial process, this is nil (process is running) or t
-\(process is stopped). */)
+(process is stopped). */)
(register Lisp_Object process)
{
CHECK_PROCESS (process);
@@ -2674,7 +2674,7 @@ is not given or nil, 1 stopbit is used.
:flowcontrol FLOWCONTROL -- FLOWCONTROL determines the type of
flowcontrol to be used, which is either nil (don't use flowcontrol),
the symbol `hw' (use RTS/CTS hardware flowcontrol), or the symbol `sw'
-\(use XON/XOFF software flowcontrol). If FLOWCONTROL is not given, no
+(use XON/XOFF software flowcontrol). If FLOWCONTROL is not given, no
flowcontrol is used.
`serial-process-configure' is called by `make-serial-process' for the
@@ -2682,12 +2682,12 @@ initial configuration of the serial port.
Examples:
-\(serial-process-configure :process "/dev/ttyS0" :speed 1200)
+(serial-process-configure :process "/dev/ttyS0" :speed 1200)
-\(serial-process-configure
+(serial-process-configure
:buffer "COM1" :stopbits 1 :parity \\='odd :flowcontrol \\='hw)
-\(serial-process-configure :port "\\\\.\\COM13" :bytesize 7)
+(serial-process-configure :port "\\\\.\\COM13" :bytesize 7)
usage: (serial-process-configure &rest ARGS) */)
(ptrdiff_t nargs, Lisp_Object *args)
@@ -2781,13 +2781,13 @@ is available via the function `process-contact'.
Examples:
-\(make-serial-process :port "/dev/ttyS0" :speed 9600)
+(make-serial-process :port "/dev/ttyS0" :speed 9600)
-\(make-serial-process :port "COM1" :speed 115200 :stopbits 2)
+(make-serial-process :port "COM1" :speed 115200 :stopbits 2)
-\(make-serial-process :port "\\\\.\\COM13" :speed 1200 :bytesize 7 :parity \\='odd)
+(make-serial-process :port "\\\\.\\COM13" :speed 1200 :bytesize 7 :parity \\='odd)
-\(make-serial-process :port "/dev/tty.BlueConsole-SPP-1" :speed nil)
+(make-serial-process :port "/dev/tty.BlueConsole-SPP-1" :speed nil)
usage: (make-serial-process &rest ARGS) */)
(ptrdiff_t nargs, Lisp_Object *args)
@@ -5031,12 +5031,18 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
for (channel = 0; channel <= max_input_desc; ++channel)
{
struct fd_callback_data *d = &fd_callback_info[channel];
- if (d->func
- && ((d->condition & FOR_READ
- && FD_ISSET (channel, &Available))
- || (d->condition & FOR_WRITE
- && FD_ISSET (channel, &write_mask))))
- d->func (channel, d->data);
+ if (d->func)
+ {
+ if (d->condition & FOR_READ
+ && FD_ISSET (channel, &Available))
+ {
+ d->func (channel, d->data);
+ FD_CLR (channel, &Available);
+ }
+ else if (d->condition & FOR_WRITE
+ && FD_ISSET (channel, &write_mask))
+ d->func (channel, d->data);
+ }
}
for (channel = 0; channel <= max_process_desc; channel++)
@@ -6269,7 +6275,7 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
{
Lisp_Object process_number
= string_to_number (SSDATA (process), 10, 1);
- if (INTEGERP (process_number) || FLOATP (process_number))
+ if (NUMBERP (process_number))
tem = process_number;
}
process = tem;
@@ -6694,10 +6700,12 @@ status_notify (struct Lisp_Process *deleting_process,
p->update_tick = p->tick;
/* Now output the message suitably. */
exec_sentinel (proc, msg);
+ if (BUFFERP (p->buffer))
+ /* In case it uses %s in mode-line-format. */
+ bset_update_mode_line (XBUFFER (p->buffer));
}
} /* end for */
- update_mode_lines = 24; /* In case buffers use %s in mode-line-format. */
return got_some_output;
}
@@ -7294,7 +7302,7 @@ DEFUN ("process-attributes", Fprocess_attributes,
Value is an alist where each element is a cons cell of the form
- \(KEY . VALUE)
+ (KEY . VALUE)
If this functionality is unsupported, the value is nil.
diff --git a/src/process.h b/src/process.h
index e889055dc23..24bad45a24b 100644
--- a/src/process.h
+++ b/src/process.h
@@ -43,25 +43,25 @@ struct Lisp_Process
/* Name of subprocess terminal. */
Lisp_Object tty_name;
- /* Name of this process */
+ /* Name of this process. */
Lisp_Object name;
/* List of command arguments that this process was run with.
- Is set to t for a stopped network process; nil otherwise. */
+ Is set to t for a stopped network process; nil otherwise. */
Lisp_Object command;
/* (funcall FILTER PROC STRING) (if FILTER is non-nil)
- to dispose of a bunch of chars from the process all at once */
+ to dispose of a bunch of chars from the process all at once. */
Lisp_Object filter;
- /* (funcall SENTINEL PROCESS) when process state changes */
+ /* (funcall SENTINEL PROCESS) when process state changes. */
Lisp_Object sentinel;
/* (funcall LOG SERVER CLIENT MESSAGE) when a server process
accepts a connection from a client. */
Lisp_Object log;
- /* Buffer that output is going to */
+ /* Buffer that output is going to. */
Lisp_Object buffer;
/* t if this is a real child process. For a network or serial
@@ -73,10 +73,10 @@ struct Lisp_Process
/* Plist for programs to keep per-process state information, parameters, etc. */
Lisp_Object plist;
- /* Symbol indicating the type of process: real, network, serial */
+ /* Symbol indicating the type of process: real, network, serial. */
Lisp_Object type;
- /* Marker set to end of last buffer-inserted output from this process */
+ /* Marker set to end of last buffer-inserted output from this process. */
Lisp_Object mark;
/* Symbol indicating status of process.
@@ -98,7 +98,7 @@ struct Lisp_Process
/* Working buffer for encoding. */
Lisp_Object encoding_buf;
- /* Queue for storing waiting writes */
+ /* Queue for storing waiting writes. */
Lisp_Object write_queue;
#ifdef HAVE_GNUTLS
@@ -116,9 +116,9 @@ struct Lisp_Process
A value 0 is used for pseudo-processes such as network or serial
connections. */
pid_t pid;
- /* Descriptor by which we read from this process */
+ /* Descriptor by which we read from this process. */
int infd;
- /* Descriptor by which we write to this process */
+ /* Descriptor by which we write to this process. */
int outfd;
/* Descriptors that were created for this process and that need
closing. Unused entries are negative. */
diff --git a/src/search.c b/src/search.c
index 106a462f804..8c9714eb6fa 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2784,7 +2784,7 @@ if the last match was on a buffer; integers or nil if a string was matched.
Use `set-match-data' to reinstate the data in this list.
If INTEGERS (the optional first argument) is non-nil, always use
-integers \(rather than markers) to represent buffer positions. In
+integers (rather than markers) to represent buffer positions. In
this case, and if the last match was in a buffer, the buffer will get
stored as one additional element at the end of the list.
diff --git a/src/syntax.c b/src/syntax.c
index dc82210e79d..cacdf18c2a2 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -181,6 +181,7 @@ static void scan_sexps_forward (struct lisp_parse_state *,
ptrdiff_t, ptrdiff_t, ptrdiff_t, EMACS_INT,
bool, Lisp_Object, int);
static bool in_classes (int, Lisp_Object);
+static void parse_sexp_propertize (ptrdiff_t charpos);
/* This setter is used only in this file, so it can be private. */
static void
@@ -246,8 +247,15 @@ SETUP_SYNTAX_TABLE (ptrdiff_t from, ptrdiff_t count)
gl_state.object = Qnil;
gl_state.offset = 0;
if (parse_sexp_lookup_properties)
- if (count > 0 || from > BEGV)
- update_syntax_table (count > 0 ? from : from - 1, count, 1, Qnil);
+ {
+ if (count > 0)
+ update_syntax_table_forward (from, true, Qnil);
+ else if (from > BEGV)
+ {
+ update_syntax_table (from - 1, count, true, Qnil);
+ parse_sexp_propertize (from - 1);
+ }
+ }
}
/* Same as above, but in OBJECT. If OBJECT is nil, use current buffer.
@@ -313,7 +321,7 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, bool init,
{
Lisp_Object tmp_table;
int cnt = 0;
- bool invalidate = 1;
+ bool invalidate = true;
INTERVAL i;
if (init)
@@ -323,7 +331,7 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, bool init,
gl_state.stop = gl_state.e_property;
i = interval_of (charpos, object);
gl_state.backward_i = gl_state.forward_i = i;
- invalidate = 0;
+ invalidate = false;
if (!i)
return;
/* interval_of updates only ->position of the return value, so
@@ -359,7 +367,7 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, bool init,
i = update_interval (i, charpos);
if (INTERVAL_LAST_POS (i) != gl_state.b_property)
{
- invalidate = 0;
+ invalidate = false;
gl_state.forward_i = i;
gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset;
}
@@ -372,7 +380,7 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, bool init,
i = update_interval (i, charpos);
if (i->position != gl_state.e_property)
{
- invalidate = 0;
+ invalidate = false;
gl_state.backward_i = i;
gl_state.b_property = i->position - gl_state.offset;
}
@@ -460,14 +468,69 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, bool init,
}
eassert (i == NULL); /* This property goes to the end. */
if (count > 0)
- gl_state.e_property = gl_state.stop;
+ {
+ gl_state.e_property = gl_state.stop;
+ gl_state.forward_i = i;
+ }
else
gl_state.b_property = gl_state.start;
}
+
+static void
+parse_sexp_propertize (ptrdiff_t charpos)
+{
+ EMACS_INT zv = ZV;
+ if (syntax_propertize__done <= charpos
+ && syntax_propertize__done < zv)
+ {
+ EMACS_INT modiffs = CHARS_MODIFF;
+ safe_call1 (Qinternal__syntax_propertize,
+ make_number (min (zv, 1 + charpos)));
+ if (modiffs != CHARS_MODIFF)
+ error ("parse-sexp-propertize-function modified the buffer!");
+ if (syntax_propertize__done <= charpos
+ && syntax_propertize__done < zv)
+ error ("parse-sexp-propertize-function did not move"
+ " syntax-propertize--done");
+ SETUP_SYNTAX_TABLE (charpos, 1);
+ }
+ else if (gl_state.e_property > syntax_propertize__done)
+ {
+ gl_state.e_property = syntax_propertize__done;
+ gl_state.e_property_truncated = true;
+ }
+ else if (gl_state.e_property_truncated
+ && gl_state.e_property < syntax_propertize__done)
+ { /* When moving backward, e_property might be set without resetting
+ e_property_truncated, so the e_property_truncated flag may
+ occasionally be left raised spuriously. This should be rare. */
+ gl_state.e_property_truncated = false;
+ update_syntax_table_forward (charpos, false, Qnil);
+ }
+}
+
+void
+update_syntax_table_forward (ptrdiff_t charpos, bool init,
+ Lisp_Object object)
+{
+ if (gl_state.e_property_truncated)
+ {
+ eassert (NILP (object));
+ eassert (charpos >= gl_state.e_property);
+ parse_sexp_propertize (charpos);
+ }
+ else
+ {
+ update_syntax_table (charpos, 1, init, object);
+ if (gl_state.e_property > syntax_propertize__done
+ && NILP (object))
+ parse_sexp_propertize (charpos);
+ }
+}
/* Returns true if char at CHARPOS is quoted.
Global syntax-table data should be set up already to be good at CHARPOS
- or after. On return global syntax data is good for lookup at CHARPOS. */
+ or after. On return global syntax data is good for lookup at CHARPOS. */
static bool
char_quoted (ptrdiff_t charpos, ptrdiff_t bytepos)
@@ -628,7 +691,7 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
OFROM[I] is position of the earliest comment-starter seen
which is I+2X quotes from the comment-end.
PARITY is current parity of quotes from the comment end. */
- int string_style = -1; /* Presumed outside of any string. */
+ int string_style = -1; /* Presumed outside of any string. */
bool string_lossage = 0;
/* Not a real lossage: indicates that we have passed a matching comment
starter plus a non-matching comment-ender, meaning that any matching
@@ -645,7 +708,7 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
ptrdiff_t defun_start = 0;
ptrdiff_t defun_start_byte = 0;
enum syntaxcode code;
- ptrdiff_t nesting = 1; /* current comment nesting */
+ ptrdiff_t nesting = 1; /* Current comment nesting. */
int c;
int syntax = 0;
@@ -876,7 +939,7 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
is nested, so we need to try again from within the
surrounding comment. Example: { a (* " *) */
{
- /* FIXME: We should advance by one or two chars. */
+ /* FIXME: We should advance by one or two chars. */
defun_start = state.comstr_start + 2;
defun_start_byte = CHAR_TO_BYTE (defun_start);
}
@@ -1042,7 +1105,7 @@ DEFUN ("string-to-syntax", Fstring_to_syntax, Sstring_to_syntax, 1, 1, 0,
doc: /* Convert a syntax descriptor STRING into a raw syntax descriptor.
STRING should be a string of the form allowed as argument of
`modify-syntax-entry'. The return value is a raw syntax descriptor: a
-cons cell \(CODE . MATCHING-CHAR) which can be used, for example, as
+cons cell (CODE . MATCHING-CHAR) which can be used, for example, as
the value of a `syntax-table' text property. */)
(Lisp_Object string)
{
@@ -2288,13 +2351,13 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
&& SYNTAX_FLAGS_COMMENT_STYLE (syntax, 0) == style
&& (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ?
(nesting > 0 && --nesting == 0) : nesting < 0))
- /* we have encountered a comment end of the same style
+ /* We have encountered a comment end of the same style
as the comment sequence which began this comment
- section */
+ section. */
break;
if (code == Scomment_fence
&& style == ST_COMMENT_STYLE)
- /* we have encountered a comment end of the same style
+ /* We have encountered a comment end of the same style
as the comment sequence which began this comment
section. */
break;
@@ -2302,8 +2365,8 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
&& code == Scomment
&& SYNTAX_FLAGS_COMMENT_NESTED (syntax)
&& SYNTAX_FLAGS_COMMENT_STYLE (syntax, 0) == style)
- /* we have encountered a nested comment of the same style
- as the comment sequence which began this comment section */
+ /* We have encountered a nested comment of the same style
+ as the comment sequence which began this comment section. */
nesting++;
INC_BOTH (from, from_byte);
UPDATE_SYNTAX_TABLE_FORWARD (from);
@@ -2319,9 +2382,8 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
? nesting > 0 : nesting < 0))
{
if (--nesting <= 0)
- /* we have encountered a comment end of the same style
- as the comment sequence which began this comment
- section */
+ /* We have encountered a comment end of the same style
+ as the comment sequence which began this comment section. */
break;
else
{
@@ -2338,9 +2400,8 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
&& SYNTAX_FLAGS_COMSTART_SECOND (other_syntax))
&& (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ||
SYNTAX_FLAGS_COMMENT_NESTED (other_syntax)))
- /* we have encountered a nested comment of the same style
- as the comment sequence which began this comment
- section */
+ /* We have encountered a nested comment of the same style
+ as the comment sequence which began this comment section. */
{
INC_BOTH (from, from_byte);
UPDATE_SYNTAX_TABLE_FORWARD (from);
@@ -2584,9 +2645,9 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag)
bool quoted;
bool mathexit = 0;
enum syntaxcode code;
- EMACS_INT min_depth = depth; /* Err out if depth gets less than this. */
- int comstyle = 0; /* style of comment encountered */
- bool comnested = 0; /* whether the comment is nestable or not */
+ EMACS_INT min_depth = depth; /* Err out if depth gets less than this. */
+ int comstyle = 0; /* Style of comment encountered. */
+ bool comnested = 0; /* Whether the comment is nestable or not. */
ptrdiff_t temp_pos;
EMACS_INT last_good = from;
bool found;
@@ -2630,11 +2691,11 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag)
SYNTAX_FLAGS_COMSTART_SECOND (other_syntax))
&& parse_sexp_ignore_comments)
{
- /* we have encountered a comment start sequence and we
+ /* We have encountered a comment start sequence and we
are ignoring all text inside comments. We must record
the comment style this sequence begins so that later,
only a comment end of the same style actually ends
- the comment section */
+ the comment section. */
code = Scomment;
comstyle = SYNTAX_FLAGS_COMMENT_STYLE (other_syntax, syntax);
comnested |= SYNTAX_FLAGS_COMMENT_NESTED (other_syntax);
@@ -2652,7 +2713,7 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag)
if (from == stop)
goto lose;
INC_BOTH (from, from_byte);
- /* treat following character as a word constituent */
+ /* Treat following character as a word constituent. */
case Sword:
case Ssymbol:
if (depth || !sexpflag) break;
@@ -2745,12 +2806,8 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag)
: c_code == Sstring_fence)
break;
- switch (c_code)
- {
- case Scharquote:
- case Sescape:
- INC_BOTH (from, from_byte);
- }
+ if (c_code == Scharquote || c_code == Sescape)
+ INC_BOTH (from, from_byte);
INC_BOTH (from, from_byte);
}
INC_BOTH (from, from_byte);
@@ -3365,11 +3422,16 @@ do { prev_from = from; \
case Sstring_fence:
if (!nofence) goto string_end;
break;
+
case Scharquote:
case Sescape:
INC_FROM;
startquotedinstring:
if (from >= end) goto endquoted;
+ break;
+
+ default:
+ break;
}
INC_FROM;
}
@@ -3457,7 +3519,7 @@ Sixth arg COMMENTSTOP non-nil means stop at the start of a comment.
target = XINT (targetdepth);
}
else
- target = TYPE_MINIMUM (EMACS_INT); /* We won't reach this depth */
+ target = TYPE_MINIMUM (EMACS_INT); /* We won't reach this depth. */
validate_region (&from, &to);
scan_sexps_forward (&state, XINT (from), CHAR_TO_BYTE (XINT (from)),
@@ -3588,7 +3650,7 @@ syms_of_syntax (void)
staticpro (&gl_state.current_syntax_table);
staticpro (&gl_state.old_prop);
- /* Defined in regex.c */
+ /* Defined in regex.c. */
staticpro (&re_match_object);
DEFSYM (Qscan_error, "scan-error");
@@ -3606,6 +3668,11 @@ Otherwise, that text property is simply ignored.
See the info node `(elisp)Syntax Properties' for a description of the
`syntax-table' property. */);
+ DEFVAR_INT ("syntax-propertize--done", syntax_propertize__done,
+ doc: /* Position up to which syntax-table properties have been set. */);
+ syntax_propertize__done = -1;
+ DEFSYM (Qinternal__syntax_propertize, "internal--syntax-propertize");
+
words_include_escapes = 0;
DEFVAR_BOOL ("words-include-escapes", words_include_escapes,
doc: /* Non-nil means `forward-word', etc., should treat escape chars part of words. */);
diff --git a/src/syntax.h b/src/syntax.h
index bfcb87168ba..34b652ba9c8 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
INLINE_HEADER_BEGIN
extern void update_syntax_table (ptrdiff_t, EMACS_INT, bool, Lisp_Object);
+extern void update_syntax_table_forward (ptrdiff_t, bool, Lisp_Object);
/* The standard syntax table is stored where it will automatically
be used in all new buffers. */
@@ -52,30 +53,32 @@ enum syntaxcode
other side by any char with the same syntaxcode. */
Sstring_fence, /* Starts/ends string which is delimited on the
other side by any char with the same syntaxcode. */
- Smax /* Upper bound on codes that are meaningful */
+ Smax /* Upper bound on codes that are meaningful. */
};
struct gl_state_s
{
- Lisp_Object object; /* The object we are scanning. */
- ptrdiff_t start; /* Where to stop. */
- ptrdiff_t stop; /* Where to stop. */
+ Lisp_Object object; /* The object we are scanning. */
+ ptrdiff_t start; /* Where to stop. */
+ ptrdiff_t stop; /* Where to stop. */
bool use_global; /* Whether to use global_code
- or c_s_t. */
- Lisp_Object global_code; /* Syntax code of current char. */
- Lisp_Object current_syntax_table; /* Syntax table for current pos. */
- Lisp_Object old_prop; /* Syntax-table prop at prev pos. */
- ptrdiff_t b_property; /* First index where c_s_t is valid. */
+ or c_s_t. */
+ Lisp_Object global_code; /* Syntax code of current char. */
+ Lisp_Object current_syntax_table; /* Syntax table for current pos. */
+ Lisp_Object old_prop; /* Syntax-table prop at prev pos. */
+ ptrdiff_t b_property; /* First index where c_s_t is valid. */
ptrdiff_t e_property; /* First index where c_s_t is
- not valid. */
- INTERVAL forward_i; /* Where to start lookup on forward */
+ not valid. */
+ bool e_property_truncated; /* true if e_property if was truncated
+ by parse_sexp_propertize_done. */
+ INTERVAL forward_i; /* Where to start lookup on forward. */
INTERVAL backward_i; /* or backward movement. The
data in c_s_t is valid
between these intervals,
and possibly at the
intervals too, depending
- on: */
+ on: */
/* Offset for positions specified to UPDATE_SYNTAX_TABLE. */
ptrdiff_t offset;
};
@@ -171,9 +174,10 @@ SYNTAX_TABLE_BYTE_TO_CHAR (ptrdiff_t bytepos)
INLINE void
UPDATE_SYNTAX_TABLE_FORWARD (ptrdiff_t charpos)
-{
+{ /* Performs just-in-time syntax-propertization. */
if (parse_sexp_lookup_properties && charpos >= gl_state.e_property)
- update_syntax_table (charpos + gl_state.offset, 1, false, gl_state.object);
+ update_syntax_table_forward (charpos + gl_state.offset,
+ false, gl_state.object);
}
/* Make syntax table state (gl_state) good for CHARPOS, assuming it is
@@ -201,6 +205,7 @@ INLINE void
SETUP_BUFFER_SYNTAX_TABLE (void)
{
gl_state.use_global = false;
+ gl_state.e_property_truncated = false;
gl_state.current_syntax_table = BVAR (current_buffer, syntax_table);
}
diff --git a/src/term.c b/src/term.c
index 8ebb620dd9b..5acc47395db 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3117,6 +3117,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
Lisp_Object selectface;
int first_item = 0;
int col, row;
+ Lisp_Object prev_inhibit_redisplay = Vinhibit_redisplay;
USE_SAFE_ALLOCA;
/* Don't allow non-positive x0 and y0, lest the menu will wrap
@@ -3159,6 +3160,11 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
buffers_num_deleted = 1;
}
+ /* Inhibit redisplay for as long as the menu is active, to avoid
+ messing the screen if some timer calls sit-for or a similar
+ function. */
+ Vinhibit_redisplay = Qt;
+
/* Force update of the current frame, so that the desired and the
current matrices are identical. */
update_frame_with_menu (sf, -1, -1);
@@ -3349,6 +3355,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
if (!kbd_buffer_events_waiting ())
clear_input_pending ();
SAFE_FREE ();
+ Vinhibit_redisplay = prev_inhibit_redisplay;
return result;
}
diff --git a/src/termhooks.h b/src/termhooks.h
index 168bc3510fa..88c62df7205 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -383,6 +383,11 @@ struct terminal
the selection-values. */
Lisp_Object Vselection_alist;
+ /* If a char-table, this maps characters to terminal glyph codes.
+ If t, the mapping is not available. If nil, it is not known
+ whether the mapping is available. */
+ Lisp_Object glyph_code_table;
+
/* All fields before `next_terminal' should be Lisp_Object and are traced
by the GC. All fields afterwards are ignored by the GC. */
@@ -690,6 +695,7 @@ extern struct terminal *get_named_terminal (const char *);
extern struct terminal *create_terminal (enum output_method,
struct redisplay_interface *);
extern void delete_terminal (struct terminal *);
+extern Lisp_Object terminal_glyph_code (struct terminal *, int);
/* The initial terminal device, created by initial_term_init. */
extern struct terminal *initial_terminal;
diff --git a/src/terminal.c b/src/terminal.c
index b48d0623e12..80c6aa20bee 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -28,6 +28,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "coding.h"
#include "keyboard.h"
+#if HAVE_STRUCT_UNIPAIR_UNICODE
+# include <errno.h>
+# include <linux/kd.h>
+# include <sys/ioctl.h>
+#endif
+
/* Chain of all terminals currently in use. */
struct terminal *terminal_list;
@@ -526,6 +532,65 @@ selected frame's terminal). */)
return store_terminal_param (decode_live_terminal (terminal), parameter, value);
}
+#if HAVE_STRUCT_UNIPAIR_UNICODE
+
+/* Compute the glyph code table for T. */
+
+static void
+calculate_glyph_code_table (struct terminal *t)
+{
+ Lisp_Object glyphtab = Qt;
+ enum { initial_unipairs = 1000 };
+ int entry_ct = initial_unipairs;
+ struct unipair unipair_buffer[initial_unipairs];
+ struct unipair *entries = unipair_buffer;
+ struct unipair *alloced = 0;
+
+ while (true)
+ {
+ int fd = fileno (t->display_info.tty->output);
+ struct unimapdesc unimapdesc = { entry_ct, entries };
+ if (ioctl (fd, GIO_UNIMAP, &unimapdesc) == 0)
+ {
+ glyphtab = Fmake_char_table (Qnil, make_number (-1));
+ for (int i = 0; i < unimapdesc.entry_ct; i++)
+ char_table_set (glyphtab, entries[i].unicode,
+ make_number (entries[i].fontpos));
+ break;
+ }
+ if (errno != ENOMEM)
+ break;
+ entry_ct = unimapdesc.entry_ct;
+ entries = alloced = xrealloc (alloced, entry_ct * sizeof *alloced);
+ }
+
+ xfree (alloced);
+ t->glyph_code_table = glyphtab;
+}
+#endif
+
+/* Return the glyph code in T of character CH, or -1 if CH does not
+ have a font position in T, or nil if T does not report glyph codes. */
+
+Lisp_Object
+terminal_glyph_code (struct terminal *t, int ch)
+{
+#if HAVE_STRUCT_UNIPAIR_UNICODE
+ if (t->type == output_termcap)
+ {
+ /* As a hack, recompute the table when CH is the maximum
+ character. */
+ if (NILP (t->glyph_code_table) || ch == MAX_CHAR)
+ calculate_glyph_code_table (t);
+
+ if (! EQ (t->glyph_code_table, Qt))
+ return char_table_ref (t->glyph_code_table, ch);
+ }
+#endif
+
+ return Qnil;
+}
+
/* Initial frame has no device-dependent output data, but has
face cache which should be freed when the frame is deleted. */
diff --git a/src/textprop.c b/src/textprop.c
index 3f7c8d10639..6758d4dfee2 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -1494,7 +1494,7 @@ DEFUN ("remove-text-properties", Fremove_text_properties,
doc: /* Remove some properties from text from START to END.
The third argument PROPERTIES is a property list
whose property names specify the properties to remove.
-\(The values stored in PROPERTIES are ignored.)
+(The values stored in PROPERTIES are ignored.)
If the optional fourth argument OBJECT is a buffer (or nil, which means
the current buffer), START and END are buffer positions (integers or
markers). If OBJECT is a string, START and END are 0-based indices into it.
diff --git a/src/vm-limit.c b/src/vm-limit.c
index ab102e32623..503aaaebf8a 100644
--- a/src/vm-limit.c
+++ b/src/vm-limit.c
@@ -170,19 +170,13 @@ check_memory_limits (void)
if (new_warnlevel > warnlevel || new_warnlevel == warned_95)
{
warnlevel = new_warnlevel;
- switch (warnlevel)
+ static char const *const warn_diagnostic[] =
{
- case warned_75:
- (*warn_function) ("Warning: past 75% of memory limit");
- break;
-
- case warned_85:
- (*warn_function) ("Warning: past 85% of memory limit");
- break;
-
- case warned_95:
- (*warn_function) ("Warning: past 95% of memory limit");
- }
+ "Warning: past 75% of memory limit",
+ "Warning: past 85% of memory limit",
+ "Warning: past 95% of memory limit"
+ };
+ warn_function (warn_diagnostic[warnlevel - 1]);
}
/* Handle going down in usage levels, with some hysteresis. */
else
diff --git a/src/w16select.c b/src/w16select.c
index 96f8437b4b1..70b9dd01f09 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -686,7 +686,7 @@ For MS-Windows and MS-DOS:
When sending or receiving text via selection and clipboard, the text
is encoded or decoded by this coding system. The default value is
the current system default encoding on 9x/Me, `utf-16le-dos'
-\(Unicode) on NT/W2K/XP, and `iso-latin-1-dos' on MS-DOS.
+(Unicode) on NT/W2K/XP, and `iso-latin-1-dos' on MS-DOS.
For X Windows:
When sending text via selection and clipboard, if the target
diff --git a/src/w32fns.c b/src/w32fns.c
index d8e22e2aa9c..99fd3ba33fd 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1763,10 +1763,8 @@ x_change_tool_bar_height (struct frame *f, int height)
f->n_tool_bar_rows = 0;
adjust_frame_size (f, -1, -1,
- ((!f->tool_bar_redisplayed_once
- && (NILP (fullscreen =
- get_frame_param (f, Qfullscreen))
- || EQ (fullscreen, Qfullwidth))) ? 1
+ ((NILP (fullscreen = get_frame_param (f, Qfullscreen))
+ || EQ (fullscreen, Qfullwidth)) ? 1
: (old_height == 0 || height == 0) ? 2
: 4),
false, Qtool_bar_lines);
@@ -5307,7 +5305,7 @@ x_get_focus_frame (struct frame *frame)
DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
doc: /* Internal function called by `color-defined-p', which see.
-\(Note that the Nextstep version of this function ignores FRAME.) */)
+(Note that the Nextstep version of this function ignores FRAME.) */)
(Lisp_Object color, Lisp_Object frame)
{
XColor foo;
@@ -5449,7 +5447,7 @@ If omitted or nil, that stands for the selected frame's display. */)
DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
doc: /* Return the "vendor ID" string of the GUI software on TERMINAL.
-\(Labeling every distributor as a "vendor" embodies the false assumption
+(Labeling every distributor as a "vendor" embodies the false assumption
that operating systems cannot be developed and distributed noncommercially.)
For GNU and Unix systems, this queries the X server software; for
@@ -5852,7 +5850,7 @@ DISPLAY is the name of the display to connect to.
Optional second arg XRM-STRING is a string of resources in xrdb format.
If the optional third arg MUST-SUCCEED is non-nil,
terminate Emacs if we can't open the connection.
-\(In the Nextstep version, the last two arguments are currently ignored.) */)
+(In the Nextstep version, the last two arguments are currently ignored.) */)
(Lisp_Object display, Lisp_Object xrm_string, Lisp_Object must_succeed)
{
unsigned char *xrm_option;
diff --git a/src/w32notify.c b/src/w32notify.c
index ab6cd12ab93..e822d950263 100644
--- a/src/w32notify.c
+++ b/src/w32notify.c
@@ -528,8 +528,8 @@ generate notifications correctly, though. */)
|| (w32_major_version == 5 && w32_major_version < 1))
{
errno = ENOSYS;
- report_file_error ("Watching filesystem events is not supported",
- Qnil);
+ report_file_notify_error ("Watching filesystem events is not supported",
+ Qnil);
}
/* filenotify.el always passes us a directory, either the parent
@@ -573,11 +573,11 @@ generate notifications correctly, though. */)
Vlocale_coding_system, 0);
else
lisp_errstr = build_string (errstr);
- report_file_error ("Cannot watch file",
- Fcons (lisp_errstr, Fcons (file, Qnil)));
+ report_file_notify_error ("Cannot watch file",
+ Fcons (lisp_errstr, Fcons (file, Qnil)));
}
else
- report_file_error ("Cannot watch file", Fcons (file, Qnil));
+ report_file_notify_error ("Cannot watch file", Fcons (file, Qnil));
}
/* Store watch object in watch list. */
watch_descriptor = make_pointer_integer (dirwatch);
@@ -611,8 +611,8 @@ WATCH-DESCRIPTOR should be an object returned by `w32notify-add-watch'. */)
}
if (status == -1)
- report_file_error ("Invalid watch descriptor", Fcons (watch_descriptor,
- Qnil));
+ report_file_notify_error ("Invalid watch descriptor",
+ Fcons (watch_descriptor, Qnil));
return Qnil;
}
@@ -628,6 +628,30 @@ w32_get_watch_object (void *desc)
return NILP (watch_list) ? Qnil : assoc_no_quit (descriptor, watch_list);
}
+DEFUN ("w32notify-valid-p", Fw32notify_valid_p, Sw32notify_valid_p, 1, 1, 0,
+ doc: /* "Check a watch specified by its WATCH-DESCRIPTOR for validity.
+
+WATCH-DESCRIPTOR should be an object returned by `w32notify-add-watch'.
+
+A watch can become invalid if the directory it watches is deleted, or if
+the watcher thread exits abnormally for any other reason. Removing the
+watch by calling `w32notify-rm-watch' also makes it invalid. */)
+ (Lisp_Object watch_descriptor)
+{
+ Lisp_Object watch_object = Fassoc (watch_descriptor, watch_list);
+
+ if (!NILP (watch_object))
+ {
+ struct notification *dirwatch =
+ (struct notification *)XINTPTR (watch_descriptor);
+ if (w32_valid_pointer_p (dirwatch, sizeof(struct notification))
+ && dirwatch->dir != NULL)
+ return Qt;
+ }
+
+ return Qnil;
+}
+
void
globals_of_w32notify (void)
{
@@ -648,6 +672,7 @@ syms_of_w32notify (void)
defsubr (&Sw32notify_add_watch);
defsubr (&Sw32notify_rm_watch);
+ defsubr (&Sw32notify_valid_p);
staticpro (&watch_list);
diff --git a/src/window.c b/src/window.c
index f6fe0cdb059..42a2ca68f14 100644
--- a/src/window.c
+++ b/src/window.c
@@ -641,7 +641,7 @@ DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combinatio
WINDOW must be a valid window used in horizontal or vertical combination.
If the return value is nil, child windows of WINDOW can be recombined with
WINDOW's siblings. A return value of t means that child windows of
-WINDOW are never \(re-)combined with WINDOW's siblings. */)
+WINDOW are never (re-)combined with WINDOW's siblings. */)
(Lisp_Object window)
{
struct window *w;
@@ -658,7 +658,7 @@ DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_windo
WINDOW must be a valid window used in horizontal or vertical combination.
If LIMIT is nil, child windows of WINDOW can be recombined with WINDOW's
siblings. LIMIT t means that child windows of WINDOW are never
-\(re-)combined with WINDOW's siblings. Other values are reserved for
+(re-)combined with WINDOW's siblings. Other values are reserved for
future use. */)
(Lisp_Object window, Lisp_Object limit)
{
@@ -1291,10 +1291,18 @@ window_relative_x_coord (struct window *w, enum window_part part, int x)
+ window_box_width (w, RIGHT_MARGIN_AREA)
+ ((WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w))
? WINDOW_RIGHT_FRINGE_WIDTH (w) : 0));
- }
- /* ON_SCROLL_BAR, ON_NOTHING, and ON_VERTICAL_BORDER: */
- return 0;
+ case ON_NOTHING:
+ case ON_VERTICAL_BORDER:
+ case ON_VERTICAL_SCROLL_BAR:
+ case ON_HORIZONTAL_SCROLL_BAR:
+ case ON_RIGHT_DIVIDER:
+ case ON_BOTTOM_DIVIDER:
+ return 0;
+
+ default:
+ emacs_abort ();
+ }
}
@@ -1304,7 +1312,7 @@ DEFUN ("coordinates-in-window-p", Fcoordinates_in_window_p,
WINDOW must be a live window and defaults to the selected one.
COORDINATES is a cons of the form (X . Y), X and Y being distances
measured in characters from the upper-left corner of the frame.
-\(0 . 0) denotes the character in the upper left corner of the
+(0 . 0) denotes the character in the upper left corner of the
frame.
If COORDINATES are in the text portion of WINDOW,
the coordinates relative to the window are returned.
@@ -1688,7 +1696,7 @@ of the window. The remaining elements are omitted if the character after
POS is fully visible; otherwise, RTOP and RBOT are the number of pixels
off-window at the top and bottom of the screen line ("row") containing
POS, ROWH is the visible height of that row, and VPOS is the row number
-\(zero-based). */)
+(zero-based). */)
(Lisp_Object pos, Lisp_Object window, Lisp_Object partially)
{
struct window *w;
diff --git a/src/xdisp.c b/src/xdisp.c
index 82931b88e1c..2c38aa9ccff 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -768,7 +768,7 @@ static void push_it (struct it *, struct text_pos *);
static void iterate_out_of_display_property (struct it *);
static void pop_it (struct it *);
static void redisplay_internal (void);
-static bool echo_area_display (bool);
+static void echo_area_display (bool);
static void redisplay_windows (Lisp_Object);
static void redisplay_window (Lisp_Object, bool);
static Lisp_Object redisplay_window_error (Lisp_Object);
@@ -2661,10 +2661,18 @@ init_iterator (struct it *it, struct window *w,
free realized faces now because they depend on face definitions
that might have changed. Don't free faces while there might be
desired matrices pending which reference these faces. */
- if (face_change && !inhibit_free_realized_faces)
+ if (!inhibit_free_realized_faces)
{
- face_change = false;
- free_all_realized_faces (Qnil);
+ if (face_change)
+ {
+ face_change = false;
+ free_all_realized_faces (Qnil);
+ }
+ else if (XFRAME (w->frame)->face_change)
+ {
+ XFRAME (w->frame)->face_change = 0;
+ free_all_realized_faces (w->frame);
+ }
}
/* Perhaps remap BASE_FACE_ID to a user-specified alternative. */
@@ -4014,21 +4022,26 @@ face_before_or_after_it_pos (struct it *it, bool before_p)
/* With bidi iteration, the character before the current
in the visual order cannot be found by simple
iteration, because "reverse" reordering is not
- supported. Instead, we need to use the move_it_*
- family of functions. */
+ supported. Instead, we need to start from the string
+ beginning and go all the way to the current string
+ position, remembering the previous position. */
/* Ignore face changes before the first visible
character on this display line. */
if (it->current_x <= it->first_visible_x)
return it->face_id;
SAVE_IT (it_copy, *it, it_copy_data);
- /* Implementation note: Since move_it_in_display_line
- works in the iterator geometry, and thinks the first
- character is always the leftmost, even in R2L lines,
- we don't need to distinguish between the R2L and L2R
- cases here. */
- move_it_in_display_line (&it_copy, SCHARS (it_copy.string),
- it_copy.current_x - 1, MOVE_TO_X);
- charpos = IT_STRING_CHARPOS (it_copy);
+ IT_STRING_CHARPOS (it_copy) = 0;
+ bidi_init_it (0, 0, FRAME_WINDOW_P (it_copy.f), &it_copy.bidi_it);
+
+ do
+ {
+ charpos = IT_STRING_CHARPOS (it_copy);
+ if (charpos >= SCHARS (it->string))
+ break;
+ bidi_move_to_visually_next (&it_copy.bidi_it);
+ }
+ while (IT_STRING_CHARPOS (it_copy) != IT_STRING_CHARPOS (*it));
+
RESTORE_IT (it, it, it_copy_data);
}
else
@@ -4108,11 +4121,15 @@ face_before_or_after_it_pos (struct it *it, bool before_p)
{
if (before_p)
{
+ int current_x;
+
/* With bidi iteration, the character before the current
in the visual order cannot be found by simple
iteration, because "reverse" reordering is not
supported. Instead, we need to use the move_it_*
- family of functions. */
+ family of functions, and move to the previous
+ character starting from the beginning of the visual
+ line. */
/* Ignore face changes before the first visible
character on this display line. */
if (it->current_x <= it->first_visible_x)
@@ -4123,8 +4140,9 @@ face_before_or_after_it_pos (struct it *it, bool before_p)
character is always the leftmost, even in R2L lines,
we don't need to distinguish between the R2L and L2R
cases here. */
- move_it_in_display_line (&it_copy, ZV,
- it_copy.current_x - 1, MOVE_TO_X);
+ current_x = it_copy.current_x;
+ move_it_vertically_backward (&it_copy, 0);
+ move_it_in_display_line (&it_copy, ZV, current_x - 1, MOVE_TO_X);
pos = it_copy.current.pos;
RESTORE_IT (it, it, it_copy_data);
}
@@ -5895,6 +5913,13 @@ push_it (struct it *it, struct text_pos *position)
case GET_FROM_STRETCH:
p->u.stretch.object = it->object;
break;
+ case GET_FROM_BUFFER:
+ case GET_FROM_DISPLAY_VECTOR:
+ case GET_FROM_STRING:
+ case GET_FROM_C_STRING:
+ break;
+ default:
+ emacs_abort ();
}
p->position = position ? *position : it->position;
p->current = it->current;
@@ -6017,6 +6042,11 @@ pop_it (struct it *it)
it->method = GET_FROM_BUFFER;
it->object = it->w->contents;
}
+ break;
+ case GET_FROM_C_STRING:
+ break;
+ default:
+ emacs_abort ();
}
it->end_charpos = p->end_charpos;
it->string_nchars = p->string_nchars;
@@ -11119,11 +11149,10 @@ clear_garbaged_frames (void)
}
-/* Redisplay the echo area of the selected frame. If UPDATE_FRAME_P,
- update selected_frame. Value is true if the mini-windows height
- has been changed. */
+/* Redisplay the echo area of the selected frame. If UPDATE_FRAME_P, update
+ selected_frame. */
-static bool
+static void
echo_area_display (bool update_frame_p)
{
Lisp_Object mini_window;
@@ -11138,14 +11167,14 @@ echo_area_display (bool update_frame_p)
/* Don't display if frame is invisible or not yet initialized. */
if (!FRAME_VISIBLE_P (f) || !f->glyphs_initialized_p)
- return false;
+ return;
#ifdef HAVE_WINDOW_SYSTEM
/* When Emacs starts, selected_frame may be the initial terminal
frame. If we let this through, a message would be displayed on
the terminal. */
if (FRAME_INITIAL_P (XFRAME (selected_frame)))
- return false;
+ return;
#endif /* HAVE_WINDOW_SYSTEM */
/* Redraw garbaged frames. */
@@ -11183,7 +11212,7 @@ echo_area_display (bool update_frame_p)
pending input. */
ptrdiff_t count = SPECPDL_INDEX ();
specbind (Qredisplay_dont_pause, Qt);
- windows_or_buffers_changed = 44;
+ fset_redisplay (f);
redisplay_internal ();
unbind_to (count, Qnil);
}
@@ -11219,7 +11248,16 @@ echo_area_display (bool update_frame_p)
if (EQ (mini_window, selected_window))
CHARPOS (this_line_start_pos) = 0;
- return window_height_changed_p;
+ if (window_height_changed_p)
+ {
+ fset_redisplay (f);
+
+ /* If window configuration was changed, frames may have been
+ marked garbaged. Clear them or we will experience
+ surprises wrt scrolling.
+ FIXME: How/why/when? */
+ clear_garbaged_frames ();
+ }
}
/* True if W's buffer was changed but not saved. */
@@ -13445,7 +13483,7 @@ redisplay_internal (void)
echo-area doesn't show through. */
&& !MINI_WINDOW_P (XWINDOW (selected_window))))
{
- bool window_height_changed_p = echo_area_display (false);
+ echo_area_display (false);
if (message_cleared_p)
update_miniwindow_p = true;
@@ -13458,16 +13496,6 @@ redisplay_internal (void)
the echo area. */
if (!display_last_displayed_message_p)
message_cleared_p = false;
-
- if (window_height_changed_p)
- {
- windows_or_buffers_changed = 50;
-
- /* If window configuration was changed, frames may have been
- marked garbaged. Clear them or we will experience
- surprises wrt scrolling. */
- clear_garbaged_frames ();
- }
}
else if (EQ (selected_window, minibuf_window)
&& (current_buffer->clip_changed || window_outdated (w))
@@ -13521,6 +13549,7 @@ redisplay_internal (void)
&& FRAME_VISIBLE_P (XFRAME (w->frame))
&& !FRAME_OBSCURED_P (XFRAME (w->frame))
&& !XFRAME (w->frame)->cursor_type_changed
+ && !XFRAME (w->frame)->face_change
/* Make sure recorded data applies to current buffer, etc. */
&& this_line_buffer == current_buffer
&& match_p
@@ -13737,18 +13766,6 @@ redisplay_internal (void)
continue;
retry_frame:
-
-#if defined (HAVE_WINDOW_SYSTEM) && !defined (USE_GTK) && !defined (HAVE_NS)
- /* Redisplay internal tool bar if this is the first time so we
- can adjust the frame height right now, if necessary. */
- if (!f->tool_bar_redisplayed_once)
- {
- if (redisplay_tool_bar (f))
- adjust_frame_glyphs (f);
- f->tool_bar_redisplayed_once = true;
- }
-#endif
-
if (FRAME_WINDOW_P (f) || FRAME_TERMCAP_P (f) || f == sf)
{
bool gcscrollbars
@@ -15879,6 +15896,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p)
&& REDISPLAY_SOME_P ()
&& !w->redisplay
&& !w->update_mode_line
+ && !f->face_change
&& !f->redisplay
&& !buffer->text->redisplay
&& BUF_PT (buffer) == w->last_point)
@@ -21040,7 +21058,7 @@ window-specific overlays, which can affect the results.
Strong directional characters `L', `R', and `AL' can have their
intrinsic directionality overridden by directional override
-control characters RLO \(u+202e) and LRO \(u+202d). See the
+control characters RLO (u+202e) and LRO (u+202d). See the
function `get-char-code-property' for a way to inquire about
the `bidi-class' property of a character. */)
(Lisp_Object from, Lisp_Object to, Lisp_Object object)
@@ -24065,7 +24083,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
prop = Qnil;
}
- if (INTEGERP (prop) || FLOATP (prop))
+ if (NUMBERP (prop))
{
int base_unit = (width_p
? FRAME_COLUMN_WIDTH (it->f)
@@ -24117,7 +24135,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
car = Qnil;
}
- if (INTEGERP (car) || FLOATP (car))
+ if (NUMBERP (car))
{
double fact;
pixels = XFLOATINT (car);
@@ -25948,9 +25966,7 @@ produce_stretch_glyph (struct it *it)
zero_width_ok_p = true;
width = (int)tem;
}
-#ifdef HAVE_WINDOW_SYSTEM
- else if (FRAME_WINDOW_P (it->f)
- && (prop = Fplist_get (plist, QCrelative_width), NUMVAL (prop) > 0))
+ else if (prop = Fplist_get (plist, QCrelative_width), NUMVAL (prop) > 0)
{
/* Relative width `:relative-width FACTOR' specified and valid.
Compute the width of the characters having the `glyph'
@@ -25970,10 +25986,9 @@ produce_stretch_glyph (struct it *it)
it2.glyph_row = NULL;
it2.what = IT_CHARACTER;
- x_produce_glyphs (&it2);
+ PRODUCE_GLYPHS (&it2);
width = NUMVAL (prop) * it2.pixel_width;
}
-#endif /* HAVE_WINDOW_SYSTEM */
else if ((prop = Fplist_get (plist, QCalign_to), !NILP (prop))
&& calc_pixel_width_or_height (&tem, it, prop, font, true,
&align_to))
@@ -29064,7 +29079,7 @@ on_hot_spot_p (Lisp_Object hot_spot, int x, int y)
Lisp_Object lr, lx0, ly0;
if (CONSP (circ)
&& CONSP (XCAR (circ))
- && (lr = XCDR (circ), INTEGERP (lr) || FLOATP (lr))
+ && (lr = XCDR (circ), NUMBERP (lr))
&& (lx0 = XCAR (XCAR (circ)), INTEGERP (lx0))
&& (ly0 = XCDR (XCAR (circ)), INTEGERP (ly0)))
{
@@ -30996,18 +31011,18 @@ This variable is not guaranteed to be accurate except while processing
DEFVAR_LISP ("frame-title-format", Vframe_title_format,
doc: /* Template for displaying the title bar of visible frames.
-\(Assuming the window manager supports this feature.)
+(Assuming the window manager supports this feature.)
This variable has the same structure as `mode-line-format', except that
the %c and %l constructs are ignored. It is used only on frames for
-which no explicit name has been set \(see `modify-frame-parameters'). */);
+which no explicit name has been set (see `modify-frame-parameters'). */);
DEFVAR_LISP ("icon-title-format", Vicon_title_format,
doc: /* Template for displaying the title bar of an iconified frame.
-\(Assuming the window manager supports this feature.)
+(Assuming the window manager supports this feature.)
This variable has the same structure as `mode-line-format' (which see),
and is used only on frames for which no explicit name has been set
-\(see `modify-frame-parameters'). */);
+(see `modify-frame-parameters'). */);
Vicon_title_format
= Vframe_title_format
= listn (CONSTYPE_PURE, 3,
@@ -31066,9 +31081,9 @@ A positive number means delay autoselection by that many seconds: a
window is autoselected only after the mouse has remained in that
window for the duration of the delay.
A negative number has a similar effect, but causes windows to be
-autoselected only after the mouse has stopped moving. \(Because of
+autoselected only after the mouse has stopped moving. (Because of
the way Emacs compares mouse events, you will occasionally wait twice
-that time before the window gets selected.\)
+that time before the window gets selected.)
Any other value means to autoselect window instantaneously when the
mouse pointer enters it.
diff --git a/src/xfaces.c b/src/xfaces.c
index 03032496381..40713f167ff 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -687,7 +687,6 @@ clear_face_cache (bool clear_fonts_p)
#endif /* HAVE_WINDOW_SYSTEM */
}
-
DEFUN ("clear-face-cache", Fclear_face_cache, Sclear_face_cache, 0, 1, 0,
doc: /* Clear face caches on all frames.
Optional THOROUGHLY non-nil means try to free unused fonts, too. */)
@@ -709,10 +708,10 @@ Optional THOROUGHLY non-nil means try to free unused fonts, too. */)
DEFUN ("bitmap-spec-p", Fbitmap_spec_p, Sbitmap_spec_p, 1, 1, 0,
doc: /* Value is non-nil if OBJECT is a valid bitmap specification.
A bitmap specification is either a string, a file name, or a list
-\(WIDTH HEIGHT DATA) where WIDTH is the pixel width of the bitmap,
+(WIDTH HEIGHT DATA) where WIDTH is the pixel width of the bitmap,
HEIGHT is its height, and DATA is a string containing the bits of
the pixmap. Bits are stored row by row, each row occupies
-\(WIDTH + 7)/8 bytes. */)
+(WIDTH + 7)/8 bytes. */)
(Lisp_Object object)
{
bool pixmap_p = false;
@@ -1669,8 +1668,7 @@ check_lface_attrs (Lisp_Object attrs[LFACE_VECTOR_SIZE])
|| SYMBOLP (attrs[LFACE_SWIDTH_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_HEIGHT_INDEX])
- || INTEGERP (attrs[LFACE_HEIGHT_INDEX])
- || FLOATP (attrs[LFACE_HEIGHT_INDEX])
+ || NUMBERP (attrs[LFACE_HEIGHT_INDEX])
|| FUNCTIONP (attrs[LFACE_HEIGHT_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_WEIGHT_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_WEIGHT_INDEX])
@@ -2529,7 +2527,10 @@ Value is a vector of face attributes. */)
free realized faces. */
if (NILP (Fget (face, Qface_no_inherit)))
{
- face_change = true;
+ if (f)
+ f->face_change = 1;
+ else
+ face_change = true;
windows_or_buffers_changed = 54;
}
@@ -2577,6 +2578,7 @@ The value is TO. */)
(Lisp_Object from, Lisp_Object to, Lisp_Object frame, Lisp_Object new_frame)
{
Lisp_Object lface, copy;
+ struct frame *f;
CHECK_SYMBOL (from);
CHECK_SYMBOL (to);
@@ -2587,6 +2589,7 @@ The value is TO. */)
strings etc. because 20.2 didn't do it either. */
lface = lface_from_face_name (NULL, from, true);
copy = Finternal_make_lisp_face (to, Qnil);
+ f = NULL;
}
else
{
@@ -2597,6 +2600,7 @@ The value is TO. */)
CHECK_LIVE_FRAME (new_frame);
lface = lface_from_face_name (XFRAME (frame), from, true);
copy = Finternal_make_lisp_face (to, new_frame);
+ f = XFRAME (new_frame);
}
vcopy (copy, 0, XVECTOR (lface)->contents, LFACE_VECTOR_SIZE);
@@ -2608,7 +2612,10 @@ The value is TO. */)
free realized faces. */
if (NILP (Fget (to, Qface_no_inherit)))
{
- face_change = true;
+ if (f)
+ f->face_change = 1;
+ else
+ face_change = true;
windows_or_buffers_changed = 55;
}
@@ -2631,6 +2638,7 @@ FRAME 0 means change the face on all frames, and change the default
/* Set one of enum font_property_index (> 0) if ATTR is one of
font-related attributes other than QCfont and QCfontset. */
enum font_property_index prop_index = 0;
+ struct frame *f;
CHECK_SYMBOL (face);
CHECK_SYMBOL (attr);
@@ -2651,6 +2659,7 @@ FRAME 0 means change the face on all frames, and change the default
/* Set lface to the Lisp attribute vector of FACE. */
if (EQ (frame, Qt))
{
+ f = NULL;
lface = lface_from_face_name (NULL, face, true);
/* When updating face-new-frame-defaults, we put :ignore-defface
@@ -2666,9 +2675,10 @@ FRAME 0 means change the face on all frames, and change the default
{
if (NILP (frame))
frame = selected_frame;
+ f = XFRAME (frame);
CHECK_LIVE_FRAME (frame);
- lface = lface_from_face_name (XFRAME (frame), face, false);
+ lface = lface_from_face_name (f, face, false);
/* If a frame-local face doesn't exist yet, create one. */
if (NILP (lface))
@@ -2990,11 +3000,11 @@ FRAME 0 means change the face on all frames, and change the default
else if (EQ (attr, QCfont))
{
#ifdef HAVE_WINDOW_SYSTEM
- if (EQ (frame, Qt) || FRAME_WINDOW_P (XFRAME (frame)))
+ if (EQ (frame, Qt) || FRAME_WINDOW_P (f))
{
if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
{
- struct frame *f;
+ struct frame *f1;
old_value = LFACE_FONT (lface);
if (! FONTP (value))
@@ -3014,28 +3024,29 @@ FRAME 0 means change the face on all frames, and change the default
signal_error ("Invalid font or font-spec", value);
}
if (EQ (frame, Qt))
- f = XFRAME (selected_frame);
+ f1 = XFRAME (selected_frame);
else
- f = XFRAME (frame);
+ f1 = XFRAME (frame);
/* FIXME:
If frame is t, and selected frame is a tty frame, the font
can't be realized. An improvement would be to loop over frames
for a non-tty frame and use that. See discussion in Bug#18573.
For a daemon, frame may be an initial frame (Bug#18869). */
- if (FRAME_WINDOW_P (f))
+ if (FRAME_WINDOW_P (f1))
{
if (! FONT_OBJECT_P (value))
{
Lisp_Object *attrs = XVECTOR (lface)->contents;
Lisp_Object font_object;
- font_object = font_load_for_lface (f, attrs, value);
+ font_object = font_load_for_lface (f1, attrs, value);
if (NILP (font_object))
signal_error ("Font not available", value);
value = font_object;
}
- set_lface_from_font (f, lface, value, true);
+ set_lface_from_font (f1, lface, value, true);
+ f1->face_change = 1;
}
}
else
@@ -3046,7 +3057,7 @@ FRAME 0 means change the face on all frames, and change the default
else if (EQ (attr, QCfontset))
{
#ifdef HAVE_WINDOW_SYSTEM
- if (EQ (frame, Qt) || FRAME_WINDOW_P (XFRAME (frame)))
+ if (EQ (frame, Qt) || FRAME_WINDOW_P (f))
{
Lisp_Object tmp;
@@ -3108,7 +3119,7 @@ FRAME 0 means change the face on all frames, and change the default
&& NILP (Fget (face, Qface_no_inherit))
&& NILP (Fequal (old_value, value)))
{
- face_change = true;
+ f->face_change = true;
windows_or_buffers_changed = 56;
}
@@ -3281,7 +3292,7 @@ update_face_from_frame_parameter (struct frame *f, Lisp_Object param,
if (!NILP (face)
&& NILP (Fget (face, Qface_no_inherit)))
{
- face_change = true;
+ f->face_change = true;
windows_or_buffers_changed = 57;
}
}
@@ -4186,7 +4197,7 @@ free_realized_faces (struct face_cache *c)
if (WINDOWP (f->root_window))
{
clear_current_matrices (f);
- windows_or_buffers_changed = 58;
+ fset_redisplay (f);
}
unblock_input ();
@@ -4206,6 +4217,7 @@ free_all_realized_faces (Lisp_Object frame)
Lisp_Object rest;
FOR_EACH_FRAME (rest, frame)
free_realized_faces (FRAME_FACE_CACHE (XFRAME (frame)));
+ windows_or_buffers_changed = 58;
}
else
free_realized_faces (FRAME_FACE_CACHE (XFRAME (frame)));
@@ -4631,8 +4643,8 @@ DEFUN ("face-attributes-as-vector", Fface_attributes_as_vector,
that a face containing all the attributes in ATTRS, when merged with the
default face for display, can be represented in a way that's
- \(1) different in appearance than the default face, and
- \(2) `close in spirit' to what the attributes specify, if not exact. */
+ (1) different in appearance than the default face, and
+ (2) `close in spirit' to what the attributes specify, if not exact. */
static bool
x_supports_face_attributes_p (struct frame *f,
@@ -4731,8 +4743,8 @@ x_supports_face_attributes_p (struct frame *f,
that a face containing all the attributes in ATTRS, when merged
with the default face for display, can be represented in a way that's
- \(1) different in appearance than the default face, and
- \(2) `close in spirit' to what the attributes specify, if not exact.
+ (1) different in appearance than the default face, and
+ (2) `close in spirit' to what the attributes specify, if not exact.
Point (2) implies that a `:weight black' attribute will be satisfied
by any terminal that can display bold, and a `:foreground "yellow"' as
@@ -4914,8 +4926,8 @@ The definition of `supported' is somewhat heuristic, but basically means
that a face containing all the attributes in ATTRIBUTES, when merged
with the default face for display, can be represented in a way that's
- \(1) different in appearance than the default face, and
- \(2) `close in spirit' to what the attributes specify, if not exact.
+ (1) different in appearance than the default face, and
+ (2) `close in spirit' to what the attributes specify, if not exact.
Point (2) implies that a `:weight black' attribute will be satisfied by
any display that can display bold, and a `:foreground \"yellow\"' as long
@@ -6521,7 +6533,7 @@ changing this variable for it to take effect. */);
Each element is a cons (FONT-PATTERN . RESCALE-RATIO), where
FONT-PATTERN is a font-spec or a regular expression matching a font name, and
RESCALE-RATIO is a floating point number to specify how much larger
-\(or smaller) font we should use. For instance, if a face requests
+(or smaller) font we should use. For instance, if a face requests
a font of 10 point, we actually use a font of 10 * RESCALE-RATIO point. */);
Vface_font_rescale_alist = Qnil;
diff --git a/src/xfns.c b/src/xfns.c
index 0079e7b4357..d6a3d76e948 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1189,10 +1189,8 @@ x_change_tool_bar_height (struct frame *f, int height)
f->n_tool_bar_rows = 0;
adjust_frame_size (f, -1, -1,
- ((!f->tool_bar_redisplayed_once
- && (NILP (fullscreen =
- get_frame_param (f, Qfullscreen))
- || EQ (fullscreen, Qfullwidth))) ? 1
+ ((NILP (fullscreen = get_frame_param (f, Qfullscreen))
+ || EQ (fullscreen, Qfullwidth)) ? 1
: (old_height == 0 || height == 0) ? 2
: 4),
false, Qtool_bar_lines);
@@ -3446,8 +3444,8 @@ x_focus_frame (struct frame *f)
DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
- doc: /* Internal function called by `color-defined-p', which see
-.\(Note that the Nextstep version of this function ignores FRAME.) */)
+ doc: /* Internal function called by `color-defined-p', which see.
+(Note that the Nextstep version of this function ignores FRAME.) */)
(Lisp_Object color, Lisp_Object frame)
{
XColor foo;
@@ -3614,7 +3612,7 @@ If omitted or nil, that stands for the selected frame's display. */)
DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
doc: /* Return the "vendor ID" string of the GUI software on TERMINAL.
-\(Labeling every distributor as a "vendor" embodies the false assumption
+(Labeling every distributor as a "vendor" embodies the false assumption
that operating systems cannot be developed and distributed noncommercially.)
The optional argument TERMINAL specifies which display to ask about.
@@ -4712,7 +4710,7 @@ DISPLAY is the name of the display to connect to.
Optional second arg XRM-STRING is a string of resources in xrdb format.
If the optional third arg MUST-SUCCEED is non-nil,
terminate Emacs if we can't open the connection.
-\(In the Nextstep version, the last two arguments are currently ignored.) */)
+(In the Nextstep version, the last two arguments are currently ignored.) */)
(Lisp_Object display, Lisp_Object xrm_string, Lisp_Object must_succeed)
{
char *xrm_option;
diff --git a/src/xselect.c b/src/xselect.c
index 94a5584214f..9aaa10c6efa 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1915,7 +1915,7 @@ DEFUN ("x-own-selection-internal", Fx_own_selection_internal,
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.)
+(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.
@@ -1944,7 +1944,7 @@ 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-SYMBOL is typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
-\(Those are literal upper-case symbol names, since that's what X expects.)
+(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
@@ -2048,7 +2048,7 @@ DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p,
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, since that's what X expects.)
+(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'.
@@ -2271,7 +2271,7 @@ x_fill_property_data (Display *dpy, Lisp_Object data, void *ret, int format)
{
Lisp_Object o = XCAR (iter);
- if (INTEGERP (o) || FLOATP (o) || CONSP (o))
+ if (NUMBERP (o) || CONSP (o))
{
if (CONSP (o)
&& RANGED_INTEGERP (X_LONG_MIN >> 16, XCAR (o), X_LONG_MAX >> 16)
@@ -2547,7 +2547,7 @@ x_send_client_event (Lisp_Object display, Lisp_Object dest, Lisp_Object from,
else
error ("DEST as a string must be one of PointerWindow or InputFocus");
}
- else if (INTEGERP (dest) || FLOATP (dest) || CONSP (dest))
+ else if (NUMBERP (dest) || CONSP (dest))
CONS_TO_INTEGER (dest, Window, wdest);
else
error ("DEST must be a frame, nil, string, number or cons");
@@ -2623,7 +2623,7 @@ and the local selection value (whatever was given to
`x-own-selection-internal').
The function should return the value to send to the X server
-\(typically a string). A return value of nil
+(typically a string). A return value of nil
means that the conversion could not be done.
A return value which is the symbol `NULL'
means that a side-effect was executed,
@@ -2632,10 +2632,10 @@ and there is no meaningful selection value. */);
DEFVAR_LISP ("x-lost-selection-functions", Vx_lost_selection_functions,
doc: /* A list of functions to be called when Emacs loses an X selection.
-\(This happens when some other X client makes its own selection
+(This happens when some other X client makes its own selection
or when a Lisp program explicitly clears the selection.)
The functions are called with one argument, the selection type
-\(a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'). */);
+(a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'). */);
Vx_lost_selection_functions = Qnil;
DEFVAR_LISP ("x-sent-selection-functions", Vx_sent_selection_functions,
diff --git a/src/xterm.c b/src/xterm.c
index 9ee76e967e1..dd54552510c 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -575,7 +575,7 @@ x_cr_export_frames (Lisp_Object frames, cairo_surface_type_t surface_type)
cairo_t *cr;
int width, height;
void (*surface_set_size_func) (cairo_surface_t *, double, double) = NULL;
- Lisp_Object acc = Qnil, args[2];
+ Lisp_Object acc = Qnil;
int count = SPECPDL_INDEX ();
Fredisplay (Qt);
@@ -659,9 +659,7 @@ x_cr_export_frames (Lisp_Object frames, cairo_surface_type_t surface_type)
#endif
unbind_to (count, Qnil);
- args[0] = intern ("concat");
- args[1] = Fnreverse (acc);
- return Fapply (2, args);
+ return CALLN (Fapply, intern ("concat"), Fnreverse (acc));
}
#endif /* USE_CAIRO */
@@ -5407,6 +5405,8 @@ xg_scroll_callback (GtkRange *range,
? scroll_bar_after_handle : scroll_bar_below_handle);
bar->dragging = -1;
break;
+ default:
+ break;
}
if (part != scroll_bar_nowhere)
@@ -10193,6 +10193,9 @@ x_check_fullscreen (struct frame *f)
case FULLSCREEN_HEIGHT:
lval = Qfullheight;
height = x_display_pixel_height (dpyinfo);
+ break;
+ default:
+ emacs_abort ();
}
frame_size_history_add