diff options
| author | John Wiegley | 2016-01-11 22:48:07 -0800 |
|---|---|---|
| committer | John Wiegley | 2016-01-11 22:48:07 -0800 |
| commit | 9278e970c5319672a05c7bce6358af0e2794205b (patch) | |
| tree | b3a738be931667a47ecd86e36ad6a8359dcac037 /src | |
| parent | eb0643c74d391ac33168ba64351a2f318c850966 (diff) | |
| parent | 6ee327d8a10047c1717358cc179ed8d1fb3389eb (diff) | |
| download | emacs-9278e970c5319672a05c7bce6358af0e2794205b.tar.gz emacs-9278e970c5319672a05c7bce6358af0e2794205b.zip | |
Merge from origin/emacs-25
6ee327d Add handle_user_signal_hook
47580e0 Avoid writing to purespace
0588be7 Remove unused variable
89e7483 * configure.ac: Find libxml2 headers in Xcode SDK dir on Darwin.
3b95e9c Use posix_openpt instead of openpty on Darwin
86312ff Document support for ':documentation' in Lisp mode
c930e75b Document new features of TeX mode
7c83d84 Clarify docs of hscroll in RTL text
4c8f8db Fix rendering of HTML pages that use character composition
a8d37ca Avoid some compiler warnings in w32.c
ce106f3de Undo ill-advised change
be0bba4 Unbreak completion in python-mode buffers
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 13 | ||||
| -rw-r--r-- | src/character.h | 2 | ||||
| -rw-r--r-- | src/indent.c | 9 | ||||
| -rw-r--r-- | src/keyboard.c | 5 | ||||
| -rw-r--r-- | src/keyboard.h | 2 | ||||
| -rw-r--r-- | src/lisp.h | 4 | ||||
| -rw-r--r-- | src/w32.c | 20 |
7 files changed, 37 insertions, 18 deletions
diff --git a/src/alloc.c b/src/alloc.c index fe55cde49c9..49f5b7f18bc 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2119,8 +2119,11 @@ INIT must be an integer that represents a character. */) | |||
| 2119 | { | 2119 | { |
| 2120 | nbytes = XINT (length); | 2120 | nbytes = XINT (length); |
| 2121 | val = make_uninit_string (nbytes); | 2121 | val = make_uninit_string (nbytes); |
| 2122 | memset (SDATA (val), c, nbytes); | 2122 | if (nbytes) |
| 2123 | SDATA (val)[nbytes] = 0; | 2123 | { |
| 2124 | memset (SDATA (val), c, nbytes); | ||
| 2125 | SDATA (val)[nbytes] = 0; | ||
| 2126 | } | ||
| 2124 | } | 2127 | } |
| 2125 | else | 2128 | else |
| 2126 | { | 2129 | { |
| @@ -2145,7 +2148,8 @@ INIT must be an integer that represents a character. */) | |||
| 2145 | memcpy (p, beg, len); | 2148 | memcpy (p, beg, len); |
| 2146 | } | 2149 | } |
| 2147 | } | 2150 | } |
| 2148 | *p = 0; | 2151 | if (nbytes) |
| 2152 | *p = 0; | ||
| 2149 | } | 2153 | } |
| 2150 | 2154 | ||
| 2151 | return val; | 2155 | return val; |
| @@ -3188,7 +3192,8 @@ allocate_vector (EMACS_INT len) | |||
| 3188 | if (min ((nbytes_max - header_size) / word_size, MOST_POSITIVE_FIXNUM) < len) | 3192 | if (min ((nbytes_max - header_size) / word_size, MOST_POSITIVE_FIXNUM) < len) |
| 3189 | memory_full (SIZE_MAX); | 3193 | memory_full (SIZE_MAX); |
| 3190 | v = allocate_vectorlike (len); | 3194 | v = allocate_vectorlike (len); |
| 3191 | v->header.size = len; | 3195 | if (len) |
| 3196 | v->header.size = len; | ||
| 3192 | return v; | 3197 | return v; |
| 3193 | } | 3198 | } |
| 3194 | 3199 | ||
diff --git a/src/character.h b/src/character.h index 871c1c3de95..440e78147d1 100644 --- a/src/character.h +++ b/src/character.h | |||
| @@ -135,14 +135,12 @@ enum | |||
| 135 | do { \ | 135 | do { \ |
| 136 | Lisp_Object tmp = XCAR (x); \ | 136 | Lisp_Object tmp = XCAR (x); \ |
| 137 | CHECK_CHARACTER (tmp); \ | 137 | CHECK_CHARACTER (tmp); \ |
| 138 | XSETCAR ((x), tmp); \ | ||
| 139 | } while (false) | 138 | } while (false) |
| 140 | 139 | ||
| 141 | #define CHECK_CHARACTER_CDR(x) \ | 140 | #define CHECK_CHARACTER_CDR(x) \ |
| 142 | do { \ | 141 | do { \ |
| 143 | Lisp_Object tmp = XCDR (x); \ | 142 | Lisp_Object tmp = XCDR (x); \ |
| 144 | CHECK_CHARACTER (tmp); \ | 143 | CHECK_CHARACTER (tmp); \ |
| 145 | XSETCDR ((x), tmp); \ | ||
| 146 | } while (false) | 144 | } while (false) |
| 147 | 145 | ||
| 148 | /* Nonzero iff C is a character of code less than 0x100. */ | 146 | /* Nonzero iff C is a character of code less than 0x100. */ |
diff --git a/src/indent.c b/src/indent.c index 33bf424b344..ec38ea798c7 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -2130,6 +2130,15 @@ whether or not it is currently displayed in some window. */) | |||
| 2130 | && it.method == GET_FROM_BUFFER | 2130 | && it.method == GET_FROM_BUFFER |
| 2131 | && it.c == '\n') | 2131 | && it.c == '\n') |
| 2132 | it_overshoot_count = 1; | 2132 | it_overshoot_count = 1; |
| 2133 | else if (it_overshoot_count == 1 && it.vpos == 0 | ||
| 2134 | && it.current_x < it.last_visible_x) | ||
| 2135 | { | ||
| 2136 | /* If we came to the same screen line as the one where | ||
| 2137 | we started, we didn't overshoot the line, and won't | ||
| 2138 | need to backtrack after all. This happens, for | ||
| 2139 | example, when PT is in the middle of a composition. */ | ||
| 2140 | it_overshoot_count = 0; | ||
| 2141 | } | ||
| 2133 | else if (disp_string_at_start_p && it.vpos > 0) | 2142 | else if (disp_string_at_start_p && it.vpos > 0) |
| 2134 | { | 2143 | { |
| 2135 | /* This is the case of a display string that spans | 2144 | /* This is the case of a display string that spans |
diff --git a/src/keyboard.c b/src/keyboard.c index eb2c7563afd..8be1cd5c0fb 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -7124,6 +7124,9 @@ struct user_signal_info | |||
| 7124 | /* List of user signals. */ | 7124 | /* List of user signals. */ |
| 7125 | static struct user_signal_info *user_signals = NULL; | 7125 | static struct user_signal_info *user_signals = NULL; |
| 7126 | 7126 | ||
| 7127 | /* Function called when handling user signals. */ | ||
| 7128 | void (*handle_user_signal_hook) (int); | ||
| 7129 | |||
| 7127 | void | 7130 | void |
| 7128 | add_user_signal (int sig, const char *name) | 7131 | add_user_signal (int sig, const char *name) |
| 7129 | { | 7132 | { |
| @@ -7172,6 +7175,8 @@ handle_user_signal (int sig) | |||
| 7172 | } | 7175 | } |
| 7173 | 7176 | ||
| 7174 | p->npending++; | 7177 | p->npending++; |
| 7178 | if (handle_user_signal_hook) | ||
| 7179 | (*handle_user_signal_hook) (sig); | ||
| 7175 | #ifdef USABLE_SIGIO | 7180 | #ifdef USABLE_SIGIO |
| 7176 | if (interrupt_input) | 7181 | if (interrupt_input) |
| 7177 | handle_input_available_signal (sig); | 7182 | handle_input_available_signal (sig); |
diff --git a/src/keyboard.h b/src/keyboard.h index 890d24eb2d9..4558bd61414 100644 --- a/src/keyboard.h +++ b/src/keyboard.h | |||
| @@ -415,6 +415,8 @@ extern void unuse_menu_items (void); | |||
| 415 | #define EVENT_HEAD_KIND(event_head) \ | 415 | #define EVENT_HEAD_KIND(event_head) \ |
| 416 | (Fget ((event_head), Qevent_kind)) | 416 | (Fget ((event_head), Qevent_kind)) |
| 417 | 417 | ||
| 418 | extern void (*handle_user_signal_hook) (int); | ||
| 419 | |||
| 418 | /* True while doing kbd input. */ | 420 | /* True while doing kbd input. */ |
| 419 | extern bool waiting_for_input; | 421 | extern bool waiting_for_input; |
| 420 | 422 | ||
diff --git a/src/lisp.h b/src/lisp.h index ff88605fc9f..ce05b4dee49 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -1325,7 +1325,7 @@ STRING_MULTIBYTE (Lisp_Object str) | |||
| 1325 | /* Mark STR as a unibyte string. */ | 1325 | /* Mark STR as a unibyte string. */ |
| 1326 | #define STRING_SET_UNIBYTE(STR) \ | 1326 | #define STRING_SET_UNIBYTE(STR) \ |
| 1327 | do { \ | 1327 | do { \ |
| 1328 | if (EQ (STR, empty_multibyte_string)) \ | 1328 | if (XSTRING (STR)->size == 0) \ |
| 1329 | (STR) = empty_unibyte_string; \ | 1329 | (STR) = empty_unibyte_string; \ |
| 1330 | else \ | 1330 | else \ |
| 1331 | XSTRING (STR)->size_byte = -1; \ | 1331 | XSTRING (STR)->size_byte = -1; \ |
| @@ -1335,7 +1335,7 @@ STRING_MULTIBYTE (Lisp_Object str) | |||
| 1335 | ASCII characters in advance. */ | 1335 | ASCII characters in advance. */ |
| 1336 | #define STRING_SET_MULTIBYTE(STR) \ | 1336 | #define STRING_SET_MULTIBYTE(STR) \ |
| 1337 | do { \ | 1337 | do { \ |
| 1338 | if (EQ (STR, empty_unibyte_string)) \ | 1338 | if (XSTRING (STR)->size == 0) \ |
| 1339 | (STR) = empty_multibyte_string; \ | 1339 | (STR) = empty_multibyte_string; \ |
| 1340 | else \ | 1340 | else \ |
| 1341 | XSTRING (STR)->size_byte = XSTRING (STR)->size; \ | 1341 | XSTRING (STR)->size_byte = XSTRING (STR)->size; \ |
| @@ -1513,7 +1513,7 @@ codepage_for_filenames (CPINFO *cp_info) | |||
| 1513 | 1513 | ||
| 1514 | if (NILP (current_encoding)) | 1514 | if (NILP (current_encoding)) |
| 1515 | { | 1515 | { |
| 1516 | char *cpname = SDATA (SYMBOL_NAME (current_encoding)); | 1516 | char *cpname = SSDATA (SYMBOL_NAME (current_encoding)); |
| 1517 | char *cp = NULL, *end; | 1517 | char *cp = NULL, *end; |
| 1518 | int cpnum; | 1518 | int cpnum; |
| 1519 | 1519 | ||
| @@ -2165,11 +2165,11 @@ unixtodos_filename (register char *p) | |||
| 2165 | (From msdos.c...probably should figure out a way to share it, | 2165 | (From msdos.c...probably should figure out a way to share it, |
| 2166 | although this code isn't going to ever change.) */ | 2166 | although this code isn't going to ever change.) */ |
| 2167 | static int | 2167 | static int |
| 2168 | crlf_to_lf (register int n, register unsigned char *buf) | 2168 | crlf_to_lf (register int n, register char *buf) |
| 2169 | { | 2169 | { |
| 2170 | unsigned char *np = buf; | 2170 | unsigned char *np = (unsigned char *)buf; |
| 2171 | unsigned char *startp = buf; | 2171 | unsigned char *startp = np; |
| 2172 | unsigned char *endp = buf + n; | 2172 | char *endp = buf + n; |
| 2173 | 2173 | ||
| 2174 | if (n == 0) | 2174 | if (n == 0) |
| 2175 | return n; | 2175 | return n; |
| @@ -2386,7 +2386,7 @@ ansi_encode_filename (Lisp_Object filename) | |||
| 2386 | { | 2386 | { |
| 2387 | char shortname[MAX_PATH]; | 2387 | char shortname[MAX_PATH]; |
| 2388 | 2388 | ||
| 2389 | if (w32_get_short_filename (SDATA (filename), shortname, MAX_PATH)) | 2389 | if (w32_get_short_filename (SSDATA (filename), shortname, MAX_PATH)) |
| 2390 | { | 2390 | { |
| 2391 | dostounix_filename (shortname); | 2391 | dostounix_filename (shortname); |
| 2392 | encoded_filename = build_string (shortname); | 2392 | encoded_filename = build_string (shortname); |
| @@ -7495,7 +7495,7 @@ socket_to_fd (SOCKET s) | |||
| 7495 | though the socket wasn't really a kernel handle, | 7495 | though the socket wasn't really a kernel handle, |
| 7496 | because a real handle has the same value. So | 7496 | because a real handle has the same value. So |
| 7497 | test whether the new handle really is a socket. */ | 7497 | test whether the new handle really is a socket. */ |
| 7498 | long nonblocking = 0; | 7498 | unsigned long nonblocking = 0; |
| 7499 | if (pfn_ioctlsocket ((SOCKET) new_s, FIONBIO, &nonblocking) == 0) | 7499 | if (pfn_ioctlsocket ((SOCKET) new_s, FIONBIO, &nonblocking) == 0) |
| 7500 | { | 7500 | { |
| 7501 | pfn_closesocket (s); | 7501 | pfn_closesocket (s); |
| @@ -8520,7 +8520,7 @@ sys_write (int fd, const void * buffer, unsigned int count) | |||
| 8520 | int nbytes = count; | 8520 | int nbytes = count; |
| 8521 | 8521 | ||
| 8522 | SAFE_NALLOCA (tmpbuf, 2, count); | 8522 | SAFE_NALLOCA (tmpbuf, 2, count); |
| 8523 | dst = tmpbuf; | 8523 | dst = (unsigned char *)tmpbuf; |
| 8524 | 8524 | ||
| 8525 | while (1) | 8525 | while (1) |
| 8526 | { | 8526 | { |
| @@ -9062,8 +9062,8 @@ check_windows_init_file (void) | |||
| 9062 | if (fd < 0) | 9062 | if (fd < 0) |
| 9063 | { | 9063 | { |
| 9064 | Lisp_Object load_path_print = Fprin1_to_string (Vload_path, Qnil); | 9064 | Lisp_Object load_path_print = Fprin1_to_string (Vload_path, Qnil); |
| 9065 | char *init_file_name = SDATA (init_file); | 9065 | char *init_file_name = SSDATA (init_file); |
| 9066 | char *load_path = SDATA (load_path_print); | 9066 | char *load_path = SSDATA (load_path_print); |
| 9067 | char *buffer = alloca (1024 | 9067 | char *buffer = alloca (1024 |
| 9068 | + strlen (init_file_name) | 9068 | + strlen (init_file_name) |
| 9069 | + strlen (load_path)); | 9069 | + strlen (load_path)); |