aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVincent Belaïche2016-06-08 07:36:41 +0200
committerVincent Belaïche2016-06-08 07:36:41 +0200
commit3f4f21b406a56d504c03a9bab3ac0949d8774c17 (patch)
treef8cf3dced4ddc5982598e877d04c3ee158235556 /src
parent5484fc1d420feeb437916b116204220395c31583 (diff)
parent378f5776fce0b4d6df95aa65be2ef6276e7bc610 (diff)
downloademacs-3f4f21b406a56d504c03a9bab3ac0949d8774c17.tar.gz
emacs-3f4f21b406a56d504c03a9bab3ac0949d8774c17.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'src')
-rw-r--r--src/casefiddle.c22
-rw-r--r--src/conf_post.h14
-rw-r--r--src/fileio.c10
-rw-r--r--src/lisp.h4
-rw-r--r--src/nsfns.m2
-rw-r--r--src/search.c3
-rw-r--r--src/syntax.c61
7 files changed, 66 insertions, 50 deletions
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 34a65edd008..6114a6f7857 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -294,15 +294,31 @@ casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e)
294 } 294 }
295} 295}
296 296
297DEFUN ("upcase-region", Fupcase_region, Supcase_region, 2, 2, "r", 297DEFUN ("upcase-region", Fupcase_region, Supcase_region, 2, 3,
298 "(list (region-beginning) (region-end) (region-noncontiguous-p))",
298 doc: /* Convert the region to upper case. In programs, wants two arguments. 299 doc: /* Convert the region to upper case. In programs, wants two arguments.
299These arguments specify the starting and ending character numbers of 300These arguments specify the starting and ending character numbers of
300the region to operate on. When used as a command, the text between 301the region to operate on. When used as a command, the text between
301point and the mark is operated on. 302point and the mark is operated on.
302See also `capitalize-region'. */) 303See also `capitalize-region'. */)
303 (Lisp_Object beg, Lisp_Object end) 304 (Lisp_Object beg, Lisp_Object end, Lisp_Object region_noncontiguous_p)
304{ 305{
305 casify_region (CASE_UP, beg, end); 306 Lisp_Object bounds = Qnil;
307
308 if (!NILP (region_noncontiguous_p))
309 {
310 bounds = call1 (Fsymbol_value (intern ("region-extract-function")),
311 intern ("bounds"));
312
313 while (CONSP (bounds))
314 {
315 casify_region (CASE_UP, XCAR (XCAR (bounds)), XCDR (XCAR (bounds)));
316 bounds = XCDR (bounds);
317 }
318 }
319 else
320 casify_region (CASE_UP, beg, end);
321
306 return Qnil; 322 return Qnil;
307} 323}
308 324
diff --git a/src/conf_post.h b/src/conf_post.h
index bea2a8a587f..762aa7727fd 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -64,6 +64,15 @@ typedef bool bool_bf;
64 (4 < __GNUC__ + (8 <= __GNUC_MINOR__)) 64 (4 < __GNUC__ + (8 <= __GNUC_MINOR__))
65#endif 65#endif
66 66
67/* Simulate __has_builtin on compilers that lack it. It is used only
68 on arguments like __builtin_assume_aligned that are handled in this
69 simulation. */
70#ifndef __has_builtin
71# define __has_builtin(a) __has_builtin_##a
72# define __has_builtin___builtin_assume_aligned \
73 (4 < __GNUC__ + (7 <= __GNUC_MINOR__))
74#endif
75
67/* Simulate __has_feature on compilers that lack it. It is used only 76/* Simulate __has_feature on compilers that lack it. It is used only
68 to define ADDRESS_SANITIZER below. */ 77 to define ADDRESS_SANITIZER below. */
69#ifndef __has_feature 78#ifndef __has_feature
@@ -77,6 +86,11 @@ typedef bool bool_bf;
77# define ADDRESS_SANITIZER false 86# define ADDRESS_SANITIZER false
78#endif 87#endif
79 88
89/* Yield PTR, which must be aligned to ALIGNMENT. */
90#if ! __has_builtin (__builtin_assume_aligned)
91# define __builtin_assume_aligned(ptr, alignment, ...) ((void *) (ptr))
92#endif
93
80#ifdef DARWIN_OS 94#ifdef DARWIN_OS
81#ifdef emacs 95#ifdef emacs
82#define malloc unexec_malloc 96#define malloc unexec_malloc
diff --git a/src/fileio.c b/src/fileio.c
index 9da0bf0234b..5615639a5e1 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5387,14 +5387,8 @@ auto_save_error (Lisp_Object error_val)
5387 msg = CALLN (Fformat, format, BVAR (current_buffer, name), 5387 msg = CALLN (Fformat, format, BVAR (current_buffer, name),
5388 Ferror_message_string (error_val)); 5388 Ferror_message_string (error_val));
5389 5389
5390 for (i = 0; i < 3; ++i) 5390 call3 (intern ("display-warning"),
5391 { 5391 intern ("auto-save"), msg, intern ("error"));
5392 if (i == 0)
5393 message3 (msg);
5394 else
5395 message3_nolog (msg);
5396 Fsleep_for (make_number (1), Qnil);
5397 }
5398 5392
5399 return Qnil; 5393 return Qnil;
5400} 5394}
diff --git a/src/lisp.h b/src/lisp.h
index 1fc6130be0b..4042f4decb1 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -341,7 +341,9 @@ error !;
341 (struct Lisp_Symbol *) ((intptr_t) XLI (a) - Lisp_Symbol \ 341 (struct Lisp_Symbol *) ((intptr_t) XLI (a) - Lisp_Symbol \
342 + (char *) lispsym)) 342 + (char *) lispsym))
343# define lisp_h_XTYPE(a) ((enum Lisp_Type) (XLI (a) & ~VALMASK)) 343# define lisp_h_XTYPE(a) ((enum Lisp_Type) (XLI (a) & ~VALMASK))
344# define lisp_h_XUNTAG(a, type) ((void *) (intptr_t) (XLI (a) - (type))) 344# define lisp_h_XUNTAG(a, type) \
345 __builtin_assume_aligned ((void *) (intptr_t) (XLI (a) - (type)), \
346 GCALIGNMENT)
345#endif 347#endif
346 348
347/* When compiling via gcc -O0, define the key operations as macros, as 349/* When compiling via gcc -O0, define the key operations as macros, as
diff --git a/src/nsfns.m b/src/nsfns.m
index ea099081a7f..9bc6c1d3418 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -3125,7 +3125,7 @@ Example: Install an icon Gnus.tiff and execute the following code
3125 3125
3126 (setq ns-icon-type-alist 3126 (setq ns-icon-type-alist
3127 (append ns-icon-type-alist 3127 (append ns-icon-type-alist
3128 '((\"^\\\\*\\\\(Group\\\\*$\\\\|Summary \\\\|Article\\\\*$\\\\)\" 3128 \\='((\"^\\\\*\\\\(Group\\\\*$\\\\|Summary \\\\|Article\\\\*$\\\\)\"
3129 . \"Gnus\")))) 3129 . \"Gnus\"))))
3130 3130
3131When you miniaturize a Group, Summary or Article frame, Gnus.tiff will 3131When you miniaturize a Group, Summary or Article frame, Gnus.tiff will
diff --git a/src/search.c b/src/search.c
index f39df6784c3..7cb18a2059a 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2691,7 +2691,8 @@ since only regular expressions have distinguished subexpressions. */)
2691 2691
2692 if (case_action == all_caps) 2692 if (case_action == all_caps)
2693 Fupcase_region (make_number (search_regs.start[sub]), 2693 Fupcase_region (make_number (search_regs.start[sub]),
2694 make_number (newpoint)); 2694 make_number (newpoint),
2695 Qnil);
2695 else if (case_action == cap_initial) 2696 else if (case_action == cap_initial)
2696 Fupcase_initials_region (make_number (search_regs.start[sub]), 2697 Fupcase_initials_region (make_number (search_regs.start[sub]),
2697 make_number (newpoint)); 2698 make_number (newpoint));
diff --git a/src/syntax.c b/src/syntax.c
index 1c3f644aec5..78c7de9c65b 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2182,63 +2182,51 @@ skip_syntaxes (bool forwardp, Lisp_Object string, Lisp_Object lim)
2182 ptrdiff_t start_point = PT; 2182 ptrdiff_t start_point = PT;
2183 ptrdiff_t pos = PT; 2183 ptrdiff_t pos = PT;
2184 ptrdiff_t pos_byte = PT_BYTE; 2184 ptrdiff_t pos_byte = PT_BYTE;
2185 unsigned char *p = PT_ADDR, *endp, *stop; 2185 unsigned char *p, *endp, *stop;
2186
2187 if (forwardp)
2188 {
2189 endp = (XINT (lim) == GPT) ? GPT_ADDR : CHAR_POS_ADDR (XINT (lim));
2190 stop = (pos < GPT && GPT < XINT (lim)) ? GPT_ADDR : endp;
2191 }
2192 else
2193 {
2194 endp = CHAR_POS_ADDR (XINT (lim));
2195 stop = (pos >= GPT && GPT > XINT (lim)) ? GAP_END_ADDR : endp;
2196 }
2197 2186
2198 immediate_quit = 1; 2187 immediate_quit = 1;
2199 SETUP_SYNTAX_TABLE (pos, forwardp ? 1 : -1); 2188 SETUP_SYNTAX_TABLE (pos, forwardp ? 1 : -1);
2189
2200 if (forwardp) 2190 if (forwardp)
2201 { 2191 {
2202 if (multibyte) 2192 while (true)
2203 { 2193 {
2204 while (1) 2194 p = BYTE_POS_ADDR (pos_byte);
2195 endp = XINT (lim) == GPT ? GPT_ADDR : CHAR_POS_ADDR (XINT (lim));
2196 stop = pos < GPT && GPT < XINT (lim) ? GPT_ADDR : endp;
2197
2198 do
2205 { 2199 {
2206 int nbytes; 2200 int nbytes;
2207 2201
2208 if (p >= stop) 2202 if (p >= stop)
2209 { 2203 {
2210 if (p >= endp) 2204 if (p >= endp)
2211 break; 2205 goto done;
2212 p = GAP_END_ADDR; 2206 p = GAP_END_ADDR;
2213 stop = endp; 2207 stop = endp;
2214 } 2208 }
2215 c = STRING_CHAR_AND_LENGTH (p, nbytes); 2209 if (multibyte)
2210 c = STRING_CHAR_AND_LENGTH (p, nbytes);
2211 else
2212 c = *p, nbytes = 1;
2216 if (! fastmap[SYNTAX (c)]) 2213 if (! fastmap[SYNTAX (c)])
2217 break; 2214 goto done;
2218 p += nbytes, pos++, pos_byte += nbytes; 2215 p += nbytes, pos++, pos_byte += nbytes;
2219 UPDATE_SYNTAX_TABLE_FORWARD (pos);
2220 }
2221 }
2222 else
2223 {
2224 while (1)
2225 {
2226 if (p >= stop)
2227 {
2228 if (p >= endp)
2229 break;
2230 p = GAP_END_ADDR;
2231 stop = endp;
2232 }
2233 if (! fastmap[SYNTAX (*p)])
2234 break;
2235 p++, pos++, pos_byte++;
2236 UPDATE_SYNTAX_TABLE_FORWARD (pos);
2237 } 2216 }
2217 while (!parse_sexp_lookup_properties
2218 || pos < gl_state.e_property);
2219
2220 update_syntax_table_forward (pos + gl_state.offset,
2221 false, gl_state.object);
2238 } 2222 }
2239 } 2223 }
2240 else 2224 else
2241 { 2225 {
2226 p = BYTE_POS_ADDR (pos_byte);
2227 endp = CHAR_POS_ADDR (XINT (lim));
2228 stop = pos >= GPT && GPT > XINT (lim) ? GAP_END_ADDR : endp;
2229
2242 if (multibyte) 2230 if (multibyte)
2243 { 2231 {
2244 while (1) 2232 while (1)
@@ -2280,6 +2268,7 @@ skip_syntaxes (bool forwardp, Lisp_Object string, Lisp_Object lim)
2280 } 2268 }
2281 } 2269 }
2282 2270
2271 done:
2283 SET_PT_BOTH (pos, pos_byte); 2272 SET_PT_BOTH (pos, pos_byte);
2284 immediate_quit = 0; 2273 immediate_quit = 0;
2285 2274
@@ -3109,7 +3098,7 @@ but before count is used up, nil is returned. */)
3109DEFUN ("backward-prefix-chars", Fbackward_prefix_chars, Sbackward_prefix_chars, 3098DEFUN ("backward-prefix-chars", Fbackward_prefix_chars, Sbackward_prefix_chars,
3110 0, 0, 0, 3099 0, 0, 0,
3111 doc: /* Move point backward over any number of chars with prefix syntax. 3100 doc: /* Move point backward over any number of chars with prefix syntax.
3112This includes chars with expression prefix syntax class (') and those with 3101This includes chars with expression prefix syntax class (\\=') and those with
3113the prefix syntax flag (p). */) 3102the prefix syntax flag (p). */)
3114 (void) 3103 (void)
3115{ 3104{