diff options
| author | Paul Eggert | 2014-09-30 20:28:16 -0700 |
|---|---|---|
| committer | Paul Eggert | 2014-09-30 20:28:16 -0700 |
| commit | 27900ac72a8959291062eda9ef5eda9fc3f8595f (patch) | |
| tree | 780e22aa62de9c01e3faf00e5c123b1dfb87ddd3 /src | |
| parent | cebe0e68947ec46b44f5c3c9868814f8a5464173 (diff) | |
| download | emacs-27900ac72a8959291062eda9ef5eda9fc3f8595f.tar.gz emacs-27900ac72a8959291062eda9ef5eda9fc3f8595f.zip | |
Use AUTO_CONS instead of SCOPED_CONS, etc.
* doc/lispref/internals.texi (Stack-allocated Objects):
Adjust to match the revised, less error-prone macros.
* src/frame.h (AUTO_FRAME_ARG): Rename from FRAME_PARAMETER.
* src/lisp.h (AUTO_CONS): Rename from scoped_cons.
(AUTO_LIST1): Rename from scoped_list1.
(AUTO_LIST2): Rename from scoped_list2.
(AUTO_LIST3): Rename from scoped_list3.
(AUTO_LIST4): Rename from scoped_list4.
(AUTO_STRING): Rename from SCOPED_STRING.
* src/frame.h (AUTO_FRAME_ARG):
* src/lisp.h (AUTO_CONS, AUTO_LIST1, AUTO_LIST2, AUTO_LIST3)
(AUTO_LIST4, AUTO_STRING):
Prepend a new argument 'name'.
Declare a variable instead of yielding a value.
All uses changed.
* src/lisp.h (STACK_CONS, AUTO_CONS_EXPR): New internal macros.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 16 | ||||
| -rw-r--r-- | src/buffer.c | 22 | ||||
| -rw-r--r-- | src/charset.c | 10 | ||||
| -rw-r--r-- | src/chartab.c | 4 | ||||
| -rw-r--r-- | src/data.c | 21 | ||||
| -rw-r--r-- | src/dispnew.c | 15 | ||||
| -rw-r--r-- | src/doc.c | 5 | ||||
| -rw-r--r-- | src/editfns.c | 3 | ||||
| -rw-r--r-- | src/emacs.c | 10 | ||||
| -rw-r--r-- | src/fileio.c | 9 | ||||
| -rw-r--r-- | src/fns.c | 4 | ||||
| -rw-r--r-- | src/font.c | 32 | ||||
| -rw-r--r-- | src/fontset.c | 10 | ||||
| -rw-r--r-- | src/frame.c | 9 | ||||
| -rw-r--r-- | src/frame.h | 4 | ||||
| -rw-r--r-- | src/keyboard.c | 35 | ||||
| -rw-r--r-- | src/keymap.c | 21 | ||||
| -rw-r--r-- | src/lisp.h | 73 | ||||
| -rw-r--r-- | src/lread.c | 22 | ||||
| -rw-r--r-- | src/menu.c | 17 | ||||
| -rw-r--r-- | src/minibuf.c | 5 | ||||
| -rw-r--r-- | src/process.c | 66 | ||||
| -rw-r--r-- | src/textprop.c | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 10 | ||||
| -rw-r--r-- | src/xfaces.c | 22 | ||||
| -rw-r--r-- | src/xfns.c | 42 | ||||
| -rw-r--r-- | src/xselect.c | 12 | ||||
| -rw-r--r-- | src/xterm.c | 23 |
28 files changed, 314 insertions, 214 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index fec13318a1c..afaca432250 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,21 @@ | |||
| 1 | 2014-10-01 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2014-10-01 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Use AUTO_CONS instead of SCOPED_CONS, etc. | ||
| 4 | * frame.h (AUTO_FRAME_ARG): Rename from FRAME_PARAMETER. | ||
| 5 | * lisp.h (AUTO_CONS): Rename from scoped_cons. | ||
| 6 | (AUTO_LIST1): Rename from scoped_list1. | ||
| 7 | (AUTO_LIST2): Rename from scoped_list2. | ||
| 8 | (AUTO_LIST3): Rename from scoped_list3. | ||
| 9 | (AUTO_LIST4): Rename from scoped_list4. | ||
| 10 | (AUTO_STRING): Rename from SCOPED_STRING. | ||
| 11 | * frame.h (AUTO_FRAME_ARG): | ||
| 12 | * lisp.h (AUTO_CONS, AUTO_LIST1, AUTO_LIST2, AUTO_LIST3) | ||
| 13 | (AUTO_LIST4, AUTO_STRING): | ||
| 14 | Prepend a new argument 'name'. | ||
| 15 | Declare a variable instead of yielding a value. | ||
| 16 | All uses changed. | ||
| 17 | * lisp.h (STACK_CONS, AUTO_CONS_EXPR): New internal macros. | ||
| 18 | |||
| 3 | * dispnew.c (adjust_decode_mode_spec_buffer): Prefer ptrdiff_t | 19 | * dispnew.c (adjust_decode_mode_spec_buffer): Prefer ptrdiff_t |
| 4 | to ssize_t since we're not using ssize_t-related syscalls here. | 20 | to ssize_t since we're not using ssize_t-related syscalls here. |
| 5 | 21 | ||
diff --git a/src/buffer.c b/src/buffer.c index 9d376346a0a..b46993a3cdb 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1552,10 +1552,11 @@ exists, return the buffer `*scratch*' (creating it if necessary). */) | |||
| 1552 | return notsogood; | 1552 | return notsogood; |
| 1553 | else | 1553 | else |
| 1554 | { | 1554 | { |
| 1555 | buf = Fget_buffer (SCOPED_STRING ("*scratch*")); | 1555 | AUTO_STRING (scratch, "*scratch*"); |
| 1556 | buf = Fget_buffer (scratch); | ||
| 1556 | if (NILP (buf)) | 1557 | if (NILP (buf)) |
| 1557 | { | 1558 | { |
| 1558 | buf = Fget_buffer_create (SCOPED_STRING ("*scratch*")); | 1559 | buf = Fget_buffer_create (scratch); |
| 1559 | Fset_buffer_major_mode (buf); | 1560 | Fset_buffer_major_mode (buf); |
| 1560 | } | 1561 | } |
| 1561 | return buf; | 1562 | return buf; |
| @@ -1575,10 +1576,11 @@ other_buffer_safely (Lisp_Object buffer) | |||
| 1575 | if (candidate_buffer (buf, buffer)) | 1576 | if (candidate_buffer (buf, buffer)) |
| 1576 | return buf; | 1577 | return buf; |
| 1577 | 1578 | ||
| 1578 | buf = Fget_buffer (SCOPED_STRING ("*scratch*")); | 1579 | AUTO_STRING (scratch, "*scratch*"); |
| 1580 | buf = Fget_buffer (scratch); | ||
| 1579 | if (NILP (buf)) | 1581 | if (NILP (buf)) |
| 1580 | { | 1582 | { |
| 1581 | buf = Fget_buffer_create (SCOPED_STRING ("*scratch*")); | 1583 | buf = Fget_buffer_create (scratch); |
| 1582 | Fset_buffer_major_mode (buf); | 1584 | Fset_buffer_major_mode (buf); |
| 1583 | } | 1585 | } |
| 1584 | 1586 | ||
| @@ -5289,7 +5291,8 @@ init_buffer (int initialized) | |||
| 5289 | (void) initialized; | 5291 | (void) initialized; |
| 5290 | #endif /* USE_MMAP_FOR_BUFFERS */ | 5292 | #endif /* USE_MMAP_FOR_BUFFERS */ |
| 5291 | 5293 | ||
| 5292 | Fset_buffer (Fget_buffer_create (SCOPED_STRING ("*scratch*"))); | 5294 | AUTO_STRING (scratch, "*scratch*"); |
| 5295 | Fset_buffer (Fget_buffer_create (scratch)); | ||
| 5293 | if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters))) | 5296 | if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters))) |
| 5294 | Fset_buffer_multibyte (Qnil); | 5297 | Fset_buffer_multibyte (Qnil); |
| 5295 | 5298 | ||
| @@ -5326,9 +5329,12 @@ init_buffer (int initialized) | |||
| 5326 | However, it is not necessary to turn / into /:/. | 5329 | However, it is not necessary to turn / into /:/. |
| 5327 | So avoid doing that. */ | 5330 | So avoid doing that. */ |
| 5328 | && strcmp ("/", SSDATA (BVAR (current_buffer, directory)))) | 5331 | && strcmp ("/", SSDATA (BVAR (current_buffer, directory)))) |
| 5329 | bset_directory | 5332 | { |
| 5330 | (current_buffer, | 5333 | AUTO_STRING (slash_colon, "/:"); |
| 5331 | concat2 (SCOPED_STRING ("/:"), BVAR (current_buffer, directory))); | 5334 | bset_directory (current_buffer, |
| 5335 | concat2 (slash_colon, | ||
| 5336 | BVAR (current_buffer, directory))); | ||
| 5337 | } | ||
| 5332 | 5338 | ||
| 5333 | temp = get_minibuffer (0); | 5339 | temp = get_minibuffer (0); |
| 5334 | bset_directory (XBUFFER (temp), BVAR (current_buffer, directory)); | 5340 | bset_directory (XBUFFER (temp), BVAR (current_buffer, directory)); |
diff --git a/src/charset.c b/src/charset.c index dee67a30c2e..171a00f23d1 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -485,14 +485,12 @@ load_charset_map_from_file (struct charset *charset, Lisp_Object mapfile, | |||
| 485 | unsigned max_code = CHARSET_MAX_CODE (charset); | 485 | unsigned max_code = CHARSET_MAX_CODE (charset); |
| 486 | int fd; | 486 | int fd; |
| 487 | FILE *fp; | 487 | FILE *fp; |
| 488 | Lisp_Object suffixes; | ||
| 489 | struct charset_map_entries *head, *entries; | 488 | struct charset_map_entries *head, *entries; |
| 490 | int n_entries; | 489 | int n_entries; |
| 491 | ptrdiff_t count; | 490 | AUTO_STRING (map, ".map"); |
| 492 | 491 | AUTO_STRING (txt, ".txt"); | |
| 493 | suffixes = scoped_list2 (SCOPED_STRING (".map"), SCOPED_STRING (".TXT")); | 492 | AUTO_LIST2 (suffixes, map, txt); |
| 494 | 493 | ptrdiff_t count = SPECPDL_INDEX (); | |
| 495 | count = SPECPDL_INDEX (); | ||
| 496 | record_unwind_protect_nothing (); | 494 | record_unwind_protect_nothing (); |
| 497 | specbind (Qfile_name_handler_alist, Qnil); | 495 | specbind (Qfile_name_handler_alist, Qnil); |
| 498 | fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil, false); | 496 | fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil, false); |
diff --git a/src/chartab.c b/src/chartab.c index 35362e32a03..bfbbf798f0c 100644 --- a/src/chartab.c +++ b/src/chartab.c | |||
| @@ -1302,8 +1302,8 @@ uniprop_table (Lisp_Object prop) | |||
| 1302 | { | 1302 | { |
| 1303 | struct gcpro gcpro1; | 1303 | struct gcpro gcpro1; |
| 1304 | GCPRO1 (val); | 1304 | GCPRO1 (val); |
| 1305 | result = Fload (concat2 (SCOPED_STRING ("international/"), table), | 1305 | AUTO_STRING (intl, "international/"); |
| 1306 | Qt, Qt, Qt, Qt); | 1306 | result = Fload (concat2 (intl, table), Qt, Qt, Qt, Qt); |
| 1307 | UNGCPRO; | 1307 | UNGCPRO; |
| 1308 | if (NILP (result)) | 1308 | if (NILP (result)) |
| 1309 | return Qnil; | 1309 | return Qnil; |
diff --git a/src/data.c b/src/data.c index b71d88506d0..9977a3aaadd 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -979,14 +979,15 @@ wrong_choice (Lisp_Object choice, Lisp_Object wrong) | |||
| 979 | { | 979 | { |
| 980 | ptrdiff_t i = 0, len = XINT (Flength (choice)); | 980 | ptrdiff_t i = 0, len = XINT (Flength (choice)); |
| 981 | Lisp_Object obj, *args; | 981 | Lisp_Object obj, *args; |
| 982 | Lisp_Object should_be_specified = SCOPED_STRING (" should be specified"); | 982 | AUTO_STRING (one_of, "One of "); |
| 983 | Lisp_Object or = SCOPED_STRING (" or "); | 983 | AUTO_STRING (comma, ", "); |
| 984 | Lisp_Object comma = SCOPED_STRING (", "); | 984 | AUTO_STRING (or, " or "); |
| 985 | AUTO_STRING (should_be_specified, " should be specified"); | ||
| 985 | 986 | ||
| 986 | USE_SAFE_ALLOCA; | 987 | USE_SAFE_ALLOCA; |
| 987 | SAFE_ALLOCA_LISP (args, len * 2 + 1); | 988 | SAFE_ALLOCA_LISP (args, len * 2 + 1); |
| 988 | 989 | ||
| 989 | args[i++] = SCOPED_STRING ("One of "); | 990 | args[i++] = one_of; |
| 990 | 991 | ||
| 991 | for (obj = choice; !NILP (obj); obj = XCDR (obj)) | 992 | for (obj = choice; !NILP (obj); obj = XCDR (obj)) |
| 992 | { | 993 | { |
| @@ -1006,11 +1007,13 @@ wrong_choice (Lisp_Object choice, Lisp_Object wrong) | |||
| 1006 | static void | 1007 | static void |
| 1007 | wrong_range (Lisp_Object min, Lisp_Object max, Lisp_Object wrong) | 1008 | wrong_range (Lisp_Object min, Lisp_Object max, Lisp_Object wrong) |
| 1008 | { | 1009 | { |
| 1009 | xsignal2 (Qerror, Fconcat (4, ((Lisp_Object []) | 1010 | AUTO_STRING (value_should_be_from, "Value should be from "); |
| 1010 | { SCOPED_STRING ("Value should be from "), | 1011 | AUTO_STRING (to, " to "); |
| 1011 | Fnumber_to_string (min), | 1012 | xsignal2 (Qerror, |
| 1012 | SCOPED_STRING (" to "), | 1013 | Fconcat (4, ((Lisp_Object []) |
| 1013 | Fnumber_to_string (max) })), wrong); | 1014 | {value_should_be_from, Fnumber_to_string (min), |
| 1015 | to, Fnumber_to_string (max)})), | ||
| 1016 | wrong); | ||
| 1014 | } | 1017 | } |
| 1015 | 1018 | ||
| 1016 | /* Store NEWVAL into SYMBOL, where VALCONTENTS is found in the value cell | 1019 | /* Store NEWVAL into SYMBOL, where VALCONTENTS is found in the value cell |
diff --git a/src/dispnew.c b/src/dispnew.c index f40287cc3cb..5186c27ec7b 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -6100,15 +6100,12 @@ init_display (void) | |||
| 6100 | (*initial_terminal->delete_terminal_hook) (initial_terminal); | 6100 | (*initial_terminal->delete_terminal_hook) (initial_terminal); |
| 6101 | 6101 | ||
| 6102 | /* Update frame parameters to reflect the new type. */ | 6102 | /* Update frame parameters to reflect the new type. */ |
| 6103 | Fmodify_frame_parameters | 6103 | AUTO_FRAME_ARG (tty_type_arg, Qtty_type, Ftty_type (selected_frame)); |
| 6104 | (selected_frame, FRAME_PARAMETER (Qtty_type, | 6104 | Fmodify_frame_parameters (selected_frame, tty_type_arg); |
| 6105 | Ftty_type (selected_frame))); | 6105 | AUTO_FRAME_ARG (tty_arg, Qtty, (t->display_info.tty->name |
| 6106 | if (t->display_info.tty->name) | 6106 | ? build_string (t->display_info.tty->name) |
| 6107 | Fmodify_frame_parameters | 6107 | : Qnil)); |
| 6108 | (selected_frame, | 6108 | Fmodify_frame_parameters (selected_frame, tty_arg); |
| 6109 | FRAME_PARAMETER (Qtty, build_string (t->display_info.tty->name))); | ||
| 6110 | else | ||
| 6111 | Fmodify_frame_parameters (selected_frame, FRAME_PARAMETER (Qtty, Qnil)); | ||
| 6112 | } | 6109 | } |
| 6113 | 6110 | ||
| 6114 | { | 6111 | { |
| @@ -146,8 +146,9 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition) | |||
| 146 | if (fd < 0) | 146 | if (fd < 0) |
| 147 | { | 147 | { |
| 148 | SAFE_FREE (); | 148 | SAFE_FREE (); |
| 149 | return concat3 (SCOPED_STRING ("Cannot open doc string file \""), | 149 | AUTO_STRING (cannot_open, "Cannot open doc string file \""); |
| 150 | file, SCOPED_STRING ("\"\n")); | 150 | AUTO_STRING (quote_nl, "\"\n"); |
| 151 | return concat3 (cannot_open, file, quote_nl); | ||
| 151 | } | 152 | } |
| 152 | } | 153 | } |
| 153 | count = SPECPDL_INDEX (); | 154 | count = SPECPDL_INDEX (); |
diff --git a/src/editfns.c b/src/editfns.c index b8a0f6fe637..e7c960dfffe 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -4362,7 +4362,8 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 4362 | Lisp_Object | 4362 | Lisp_Object |
| 4363 | format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1) | 4363 | format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1) |
| 4364 | { | 4364 | { |
| 4365 | return Fformat (3, (Lisp_Object []) { SCOPED_STRING (string1), arg0, arg1 }); | 4365 | AUTO_STRING (format, string1); |
| 4366 | return Fformat (3, (Lisp_Object []) {format, arg0, arg1}); | ||
| 4366 | } | 4367 | } |
| 4367 | 4368 | ||
| 4368 | DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0, | 4369 | DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0, |
diff --git a/src/emacs.c b/src/emacs.c index 3c31827e994..60b67b5a902 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -400,6 +400,7 @@ init_cmdargs (int argc, char **argv, int skip_args, char *original_pwd) | |||
| 400 | Lisp_Object name, dir, handler; | 400 | Lisp_Object name, dir, handler; |
| 401 | ptrdiff_t count = SPECPDL_INDEX (); | 401 | ptrdiff_t count = SPECPDL_INDEX (); |
| 402 | Lisp_Object raw_name; | 402 | Lisp_Object raw_name; |
| 403 | AUTO_STRING (slash_colon, "/:"); | ||
| 403 | 404 | ||
| 404 | initial_argv = argv; | 405 | initial_argv = argv; |
| 405 | initial_argc = argc; | 406 | initial_argc = argc; |
| @@ -423,7 +424,7 @@ init_cmdargs (int argc, char **argv, int skip_args, char *original_pwd) | |||
| 423 | if it would otherwise be treated as magic. */ | 424 | if it would otherwise be treated as magic. */ |
| 424 | handler = Ffind_file_name_handler (raw_name, Qt); | 425 | handler = Ffind_file_name_handler (raw_name, Qt); |
| 425 | if (! NILP (handler)) | 426 | if (! NILP (handler)) |
| 426 | raw_name = concat2 (SCOPED_STRING ("/:"), raw_name); | 427 | raw_name = concat2 (slash_colon, raw_name); |
| 427 | 428 | ||
| 428 | Vinvocation_name = Ffile_name_nondirectory (raw_name); | 429 | Vinvocation_name = Ffile_name_nondirectory (raw_name); |
| 429 | Vinvocation_directory = Ffile_name_directory (raw_name); | 430 | Vinvocation_directory = Ffile_name_directory (raw_name); |
| @@ -441,7 +442,7 @@ init_cmdargs (int argc, char **argv, int skip_args, char *original_pwd) | |||
| 441 | if it would otherwise be treated as magic. */ | 442 | if it would otherwise be treated as magic. */ |
| 442 | handler = Ffind_file_name_handler (found, Qt); | 443 | handler = Ffind_file_name_handler (found, Qt); |
| 443 | if (! NILP (handler)) | 444 | if (! NILP (handler)) |
| 444 | found = concat2 (SCOPED_STRING ("/:"), found); | 445 | found = concat2 (slash_colon, found); |
| 445 | Vinvocation_directory = Ffile_name_directory (found); | 446 | Vinvocation_directory = Ffile_name_directory (found); |
| 446 | } | 447 | } |
| 447 | } | 448 | } |
| @@ -2323,7 +2324,10 @@ decode_env_path (const char *evarname, const char *defalt, bool empty) | |||
| 2323 | } | 2324 | } |
| 2324 | 2325 | ||
| 2325 | if (! NILP (tem)) | 2326 | if (! NILP (tem)) |
| 2326 | element = concat2 (SCOPED_STRING ("/:"), element); | 2327 | { |
| 2328 | AUTO_STRING (slash_colon, "/:"); | ||
| 2329 | element = concat2 (slash_colon, element); | ||
| 2330 | } | ||
| 2327 | } /* !NILP (element) */ | 2331 | } /* !NILP (element) */ |
| 2328 | 2332 | ||
| 2329 | lpath = Fcons (element, lpath); | 2333 | lpath = Fcons (element, lpath); |
diff --git a/src/fileio.c b/src/fileio.c index 2590942d42e..d73d2303711 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1111,7 +1111,8 @@ filesystem tree, not (expand-file-name ".." dirname). */) | |||
| 1111 | 1111 | ||
| 1112 | name = make_specified_string (nm, -1, p - nm, multibyte); | 1112 | name = make_specified_string (nm, -1, p - nm, multibyte); |
| 1113 | temp[0] = DRIVE_LETTER (drive); | 1113 | temp[0] = DRIVE_LETTER (drive); |
| 1114 | name = concat2 (SCOPED_STRING (temp), name); | 1114 | AUTO_STRING (drive_prefix, temp); |
| 1115 | name = concat2 (drive_prefix, name); | ||
| 1115 | } | 1116 | } |
| 1116 | #ifdef WINDOWSNT | 1117 | #ifdef WINDOWSNT |
| 1117 | if (!NILP (Vw32_downcase_file_names)) | 1118 | if (!NILP (Vw32_downcase_file_names)) |
| @@ -5419,10 +5420,10 @@ auto_save_error (Lisp_Object error_val) | |||
| 5419 | 5420 | ||
| 5420 | ring_bell (XFRAME (selected_frame)); | 5421 | ring_bell (XFRAME (selected_frame)); |
| 5421 | 5422 | ||
| 5423 | AUTO_STRING (format, "Auto-saving %s: %s"); | ||
| 5422 | msg = Fformat (3, ((Lisp_Object []) | 5424 | msg = Fformat (3, ((Lisp_Object []) |
| 5423 | { SCOPED_STRING ("Auto-saving %s: %s"), | 5425 | {format, BVAR (current_buffer, name), |
| 5424 | BVAR (current_buffer, name), | 5426 | Ferror_message_string (error_val)})); |
| 5425 | Ferror_message_string (error_val) })); | ||
| 5426 | GCPRO1 (msg); | 5427 | GCPRO1 (msg); |
| 5427 | 5428 | ||
| 5428 | for (i = 0; i < 3; ++i) | 5429 | for (i = 0; i < 3; ++i) |
| @@ -2725,8 +2725,8 @@ if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */) | |||
| 2725 | return obj; | 2725 | return obj; |
| 2726 | } | 2726 | } |
| 2727 | 2727 | ||
| 2728 | prompt = Fconcat (2, ((Lisp_Object []) | 2728 | AUTO_STRING (yes_or_no, "(yes or no) "); |
| 2729 | { prompt, SCOPED_STRING ("(yes or no) ") })); | 2729 | prompt = Fconcat (2, (Lisp_Object []) {prompt, yes_or_no}); |
| 2730 | GCPRO1 (prompt); | 2730 | GCPRO1 (prompt); |
| 2731 | 2731 | ||
| 2732 | while (1) | 2732 | while (1) |
diff --git a/src/font.c b/src/font.c index ef48bbdaea6..4d99087ef7d 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -1187,13 +1187,22 @@ font_parse_xlfd (char *name, ptrdiff_t len, Lisp_Object font) | |||
| 1187 | { | 1187 | { |
| 1188 | val = prop[XLFD_ENCODING_INDEX]; | 1188 | val = prop[XLFD_ENCODING_INDEX]; |
| 1189 | if (! NILP (val)) | 1189 | if (! NILP (val)) |
| 1190 | val = concat2 (SCOPED_STRING ("*-"), SYMBOL_NAME (val)); | 1190 | { |
| 1191 | AUTO_STRING (stardash, "*-"); | ||
| 1192 | val = concat2 (stardash, SYMBOL_NAME (val)); | ||
| 1193 | } | ||
| 1191 | } | 1194 | } |
| 1192 | else if (NILP (prop[XLFD_ENCODING_INDEX])) | 1195 | else if (NILP (prop[XLFD_ENCODING_INDEX])) |
| 1193 | val = concat2 (SYMBOL_NAME (val), SCOPED_STRING ("-*")); | 1196 | { |
| 1197 | AUTO_STRING (dashstar, "-*"); | ||
| 1198 | val = concat2 (SYMBOL_NAME (val), dashstar); | ||
| 1199 | } | ||
| 1194 | else | 1200 | else |
| 1195 | val = concat3 (SYMBOL_NAME (val), SCOPED_STRING ("-"), | 1201 | { |
| 1196 | SYMBOL_NAME (prop[XLFD_ENCODING_INDEX])); | 1202 | AUTO_STRING (dash, "-"); |
| 1203 | val = concat3 (SYMBOL_NAME (val), dash, | ||
| 1204 | SYMBOL_NAME (prop[XLFD_ENCODING_INDEX])); | ||
| 1205 | } | ||
| 1197 | if (! NILP (val)) | 1206 | if (! NILP (val)) |
| 1198 | ASET (font, FONT_REGISTRY_INDEX, Fintern (val, Qnil)); | 1207 | ASET (font, FONT_REGISTRY_INDEX, Fintern (val, Qnil)); |
| 1199 | 1208 | ||
| @@ -1789,10 +1798,8 @@ font_parse_family_registry (Lisp_Object family, Lisp_Object registry, Lisp_Objec | |||
| 1789 | p1 = strchr (p0, '-'); | 1798 | p1 = strchr (p0, '-'); |
| 1790 | if (! p1) | 1799 | if (! p1) |
| 1791 | { | 1800 | { |
| 1792 | if (SDATA (registry)[len - 1] == '*') | 1801 | AUTO_STRING (extra, ("*-*" + (len && p0[len - 1] == '*'))); |
| 1793 | registry = concat2 (registry, SCOPED_STRING ("-*")); | 1802 | registry = concat2 (registry, extra); |
| 1794 | else | ||
| 1795 | registry = concat2 (registry, SCOPED_STRING ("*-*")); | ||
| 1796 | } | 1803 | } |
| 1797 | registry = Fdowncase (registry); | 1804 | registry = Fdowncase (registry); |
| 1798 | ASET (font_spec, FONT_REGISTRY_INDEX, Fintern (registry, Qnil)); | 1805 | ASET (font_spec, FONT_REGISTRY_INDEX, Fintern (registry, Qnil)); |
| @@ -5019,7 +5026,7 @@ font_add_log (const char *action, Lisp_Object arg, Lisp_Object result) | |||
| 5019 | if (FONTP (arg)) | 5026 | if (FONTP (arg)) |
| 5020 | { | 5027 | { |
| 5021 | Lisp_Object tail, elt; | 5028 | Lisp_Object tail, elt; |
| 5022 | Lisp_Object equalstr = SCOPED_STRING ("="); | 5029 | AUTO_STRING (equalstr, "="); |
| 5023 | 5030 | ||
| 5024 | val = Ffont_xlfd_name (arg, Qt); | 5031 | val = Ffont_xlfd_name (arg, Qt); |
| 5025 | for (tail = AREF (arg, FONT_EXTRA_INDEX); CONSP (tail); | 5032 | for (tail = AREF (arg, FONT_EXTRA_INDEX); CONSP (tail); |
| @@ -5052,8 +5059,11 @@ font_add_log (const char *action, Lisp_Object arg, Lisp_Object result) | |||
| 5052 | { | 5059 | { |
| 5053 | val = Ffont_xlfd_name (result, Qt); | 5060 | val = Ffont_xlfd_name (result, Qt); |
| 5054 | if (! FONT_SPEC_P (result)) | 5061 | if (! FONT_SPEC_P (result)) |
| 5055 | val = concat3 (SYMBOL_NAME (AREF (result, FONT_TYPE_INDEX)), | 5062 | { |
| 5056 | SCOPED_STRING (":"), val); | 5063 | AUTO_STRING (colon, ":"); |
| 5064 | val = concat3 (SYMBOL_NAME (AREF (result, FONT_TYPE_INDEX)), | ||
| 5065 | colon, val); | ||
| 5066 | } | ||
| 5057 | result = val; | 5067 | result = val; |
| 5058 | } | 5068 | } |
| 5059 | else if (CONSP (result)) | 5069 | else if (CONSP (result)) |
diff --git a/src/fontset.c b/src/fontset.c index 1b750b05b7b..c415fdfa8fd 100644 --- a/src/fontset.c +++ b/src/fontset.c | |||
| @@ -1462,8 +1462,8 @@ appended. By default, FONT-SPEC overrides the previous settings. */) | |||
| 1462 | registry = AREF (font_spec, FONT_REGISTRY_INDEX); | 1462 | registry = AREF (font_spec, FONT_REGISTRY_INDEX); |
| 1463 | if (! NILP (registry)) | 1463 | if (! NILP (registry)) |
| 1464 | registry = Fdowncase (SYMBOL_NAME (registry)); | 1464 | registry = Fdowncase (SYMBOL_NAME (registry)); |
| 1465 | encoding = find_font_encoding (concat3 (family, SCOPED_STRING ("-"), | 1465 | AUTO_STRING (dash, "-"); |
| 1466 | registry)); | 1466 | encoding = find_font_encoding (concat3 (family, dash, registry)); |
| 1467 | if (NILP (encoding)) | 1467 | if (NILP (encoding)) |
| 1468 | encoding = Qascii; | 1468 | encoding = Qascii; |
| 1469 | 1469 | ||
| @@ -1575,7 +1575,7 @@ appended. By default, FONT-SPEC overrides the previous settings. */) | |||
| 1575 | 1575 | ||
| 1576 | if (ascii_changed) | 1576 | if (ascii_changed) |
| 1577 | { | 1577 | { |
| 1578 | Lisp_Object tail, fr, alist; | 1578 | Lisp_Object tail, fr; |
| 1579 | int fontset_id = XINT (FONTSET_ID (fontset)); | 1579 | int fontset_id = XINT (FONTSET_ID (fontset)); |
| 1580 | 1580 | ||
| 1581 | set_fontset_ascii (fontset, fontname); | 1581 | set_fontset_ascii (fontset, fontname); |
| @@ -1598,8 +1598,8 @@ appended. By default, FONT-SPEC overrides the previous settings. */) | |||
| 1598 | if (! NILP (font_object)) | 1598 | if (! NILP (font_object)) |
| 1599 | { | 1599 | { |
| 1600 | update_auto_fontset_alist (font_object, fontset); | 1600 | update_auto_fontset_alist (font_object, fontset); |
| 1601 | alist = FRAME_PARAMETER (Qfont, Fcons (name, font_object)); | 1601 | AUTO_FRAME_ARG (arg, Qfont, Fcons (name, font_object)); |
| 1602 | Fmodify_frame_parameters (fr, alist); | 1602 | Fmodify_frame_parameters (fr, arg); |
| 1603 | } | 1603 | } |
| 1604 | } | 1604 | } |
| 1605 | } | 1605 | } |
diff --git a/src/frame.c b/src/frame.c index 4b2ffd11e7a..d0527bf2a9c 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -4148,9 +4148,9 @@ x_get_arg (Display_Info *dpyinfo, Lisp_Object alist, Lisp_Object param, | |||
| 4148 | { | 4148 | { |
| 4149 | if (attribute && dpyinfo) | 4149 | if (attribute && dpyinfo) |
| 4150 | { | 4150 | { |
| 4151 | tem = display_x_get_resource | 4151 | AUTO_STRING (at, attribute); |
| 4152 | (dpyinfo, SCOPED_STRING (attribute), | 4152 | AUTO_STRING (cl, class); |
| 4153 | SCOPED_STRING (class), Qnil, Qnil); | 4153 | tem = display_x_get_resource (dpyinfo, at, cl, Qnil, Qnil); |
| 4154 | 4154 | ||
| 4155 | if (NILP (tem)) | 4155 | if (NILP (tem)) |
| 4156 | return Qunbound; | 4156 | return Qunbound; |
| @@ -4260,7 +4260,8 @@ x_default_parameter (struct frame *f, Lisp_Object alist, Lisp_Object prop, | |||
| 4260 | tem = x_frame_get_arg (f, alist, prop, xprop, xclass, type); | 4260 | tem = x_frame_get_arg (f, alist, prop, xprop, xclass, type); |
| 4261 | if (EQ (tem, Qunbound)) | 4261 | if (EQ (tem, Qunbound)) |
| 4262 | tem = deflt; | 4262 | tem = deflt; |
| 4263 | x_set_frame_parameters (f, FRAME_PARAMETER (prop, tem)); | 4263 | AUTO_FRAME_ARG (arg, prop, tem); |
| 4264 | x_set_frame_parameters (f, arg); | ||
| 4264 | return tem; | 4265 | return tem; |
| 4265 | } | 4266 | } |
| 4266 | 4267 | ||
diff --git a/src/frame.h b/src/frame.h index 94f080d3038..22f2fa7a24c 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -1062,8 +1062,8 @@ default_pixels_per_inch_y (void) | |||
| 1062 | 1062 | ||
| 1063 | /* Handy macro to construct an argument to Fmodify_frame_parameters. */ | 1063 | /* Handy macro to construct an argument to Fmodify_frame_parameters. */ |
| 1064 | 1064 | ||
| 1065 | #define FRAME_PARAMETER(parameter, value) \ | 1065 | #define AUTO_FRAME_ARG(name, parameter, value) \ |
| 1066 | scoped_list1 (scoped_cons (parameter, value)) | 1066 | AUTO_LIST1 (name, AUTO_CONS_EXPR (parameter, value)) |
| 1067 | 1067 | ||
| 1068 | /* False means there are no visible garbaged frames. */ | 1068 | /* False means there are no visible garbaged frames. */ |
| 1069 | extern bool frame_garbaged; | 1069 | extern bool frame_garbaged; |
diff --git a/src/keyboard.c b/src/keyboard.c index 37d33a6cdb0..8c030c7652c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -551,6 +551,7 @@ echo_add_key (Lisp_Object c) | |||
| 551 | 551 | ||
| 552 | /* Replace a dash from echo_dash with a space, otherwise add a space | 552 | /* Replace a dash from echo_dash with a space, otherwise add a space |
| 553 | at the end as a separator between keys. */ | 553 | at the end as a separator between keys. */ |
| 554 | AUTO_STRING (space, " "); | ||
| 554 | if (STRINGP (echo_string) && SCHARS (echo_string) > 1) | 555 | if (STRINGP (echo_string) && SCHARS (echo_string) > 1) |
| 555 | { | 556 | { |
| 556 | Lisp_Object last_char, prev_char, idx; | 557 | Lisp_Object last_char, prev_char, idx; |
| @@ -566,10 +567,10 @@ echo_add_key (Lisp_Object c) | |||
| 566 | if (XINT (last_char) == '-' && XINT (prev_char) != ' ') | 567 | if (XINT (last_char) == '-' && XINT (prev_char) != ' ') |
| 567 | Faset (echo_string, idx, make_number (' ')); | 568 | Faset (echo_string, idx, make_number (' ')); |
| 568 | else | 569 | else |
| 569 | echo_string = concat2 (echo_string, SCOPED_STRING (" ")); | 570 | echo_string = concat2 (echo_string, space); |
| 570 | } | 571 | } |
| 571 | else if (STRINGP (echo_string) && SCHARS (echo_string) > 0) | 572 | else if (STRINGP (echo_string) && SCHARS (echo_string) > 0) |
| 572 | echo_string = concat2 (echo_string, SCOPED_STRING (" ")); | 573 | echo_string = concat2 (echo_string, space); |
| 573 | 574 | ||
| 574 | kset_echo_string | 575 | kset_echo_string |
| 575 | (current_kboard, | 576 | (current_kboard, |
| @@ -630,9 +631,9 @@ echo_dash (void) | |||
| 630 | 631 | ||
| 631 | /* Put a dash at the end of the buffer temporarily, | 632 | /* Put a dash at the end of the buffer temporarily, |
| 632 | but make it go away when the next character is added. */ | 633 | but make it go away when the next character is added. */ |
| 633 | kset_echo_string | 634 | AUTO_STRING (dash, "-"); |
| 634 | (current_kboard, | 635 | kset_echo_string (current_kboard, |
| 635 | concat2 (KVAR (current_kboard, echo_string), SCOPED_STRING ("-"))); | 636 | concat2 (KVAR (current_kboard, echo_string), dash)); |
| 636 | echo_now (); | 637 | echo_now (); |
| 637 | } | 638 | } |
| 638 | 639 | ||
| @@ -1890,13 +1891,11 @@ safe_run_hooks_1 (ptrdiff_t nargs, Lisp_Object *args) | |||
| 1890 | static Lisp_Object | 1891 | static Lisp_Object |
| 1891 | safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args) | 1892 | safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args) |
| 1892 | { | 1893 | { |
| 1893 | Lisp_Object hook, fun; | ||
| 1894 | |||
| 1895 | eassert (nargs == 2); | 1894 | eassert (nargs == 2); |
| 1896 | hook = args[0]; | 1895 | AUTO_STRING (format, "Error in %s (%S): %S"); |
| 1897 | fun = args[1]; | 1896 | Lisp_Object hook = args[0]; |
| 1898 | Fmessage (4, ((Lisp_Object []) | 1897 | Lisp_Object fun = args[1]; |
| 1899 | { SCOPED_STRING ("Error in %s (%S): %S"), hook, fun, error })); | 1898 | Fmessage (4, (Lisp_Object []) {format, hook, fun, error}); |
| 1900 | 1899 | ||
| 1901 | if (SYMBOLP (hook)) | 1900 | if (SYMBOLP (hook)) |
| 1902 | { | 1901 | { |
| @@ -7885,12 +7884,12 @@ parse_menu_item (Lisp_Object item, int inmenubar) | |||
| 7885 | 7884 | ||
| 7886 | { /* This is a command. See if there is an equivalent key binding. */ | 7885 | { /* This is a command. See if there is an equivalent key binding. */ |
| 7887 | Lisp_Object keyeq = AREF (item_properties, ITEM_PROPERTY_KEYEQ); | 7886 | Lisp_Object keyeq = AREF (item_properties, ITEM_PROPERTY_KEYEQ); |
| 7887 | AUTO_STRING (space_space, " "); | ||
| 7888 | 7888 | ||
| 7889 | /* The previous code preferred :key-sequence to :keys, so we | 7889 | /* The previous code preferred :key-sequence to :keys, so we |
| 7890 | preserve this behavior. */ | 7890 | preserve this behavior. */ |
| 7891 | if (STRINGP (keyeq) && !CONSP (keyhint)) | 7891 | if (STRINGP (keyeq) && !CONSP (keyhint)) |
| 7892 | keyeq = concat2 (SCOPED_STRING (" "), | 7892 | keyeq = concat2 (space_space, Fsubstitute_command_keys (keyeq)); |
| 7893 | Fsubstitute_command_keys (keyeq)); | ||
| 7894 | else | 7893 | else |
| 7895 | { | 7894 | { |
| 7896 | Lisp_Object prefix = keyeq; | 7895 | Lisp_Object prefix = keyeq; |
| @@ -7933,7 +7932,7 @@ parse_menu_item (Lisp_Object item, int inmenubar) | |||
| 7933 | if (STRINGP (XCDR (prefix))) | 7932 | if (STRINGP (XCDR (prefix))) |
| 7934 | tem = concat2 (tem, XCDR (prefix)); | 7933 | tem = concat2 (tem, XCDR (prefix)); |
| 7935 | } | 7934 | } |
| 7936 | keyeq = concat2 (SCOPED_STRING (" "), tem); | 7935 | keyeq = concat2 (space_space, tem); |
| 7937 | } | 7936 | } |
| 7938 | else | 7937 | else |
| 7939 | keyeq = Qnil; | 7938 | keyeq = Qnil; |
| @@ -8637,10 +8636,14 @@ read_char_minibuf_menu_prompt (int commandflag, | |||
| 8637 | /* Insert button prefix. */ | 8636 | /* Insert button prefix. */ |
| 8638 | Lisp_Object selected | 8637 | Lisp_Object selected |
| 8639 | = AREF (item_properties, ITEM_PROPERTY_SELECTED); | 8638 | = AREF (item_properties, ITEM_PROPERTY_SELECTED); |
| 8639 | AUTO_STRING (radio_yes, "(*) "); | ||
| 8640 | AUTO_STRING (radio_no , "( ) "); | ||
| 8641 | AUTO_STRING (check_yes, "[X] "); | ||
| 8642 | AUTO_STRING (check_no , "[ ] "); | ||
| 8640 | if (EQ (tem, QCradio)) | 8643 | if (EQ (tem, QCradio)) |
| 8641 | tem = SCOPED_STRING (NILP (selected) ? "(*) " : "( ) "); | 8644 | tem = NILP (selected) ? radio_yes : radio_no; |
| 8642 | else | 8645 | else |
| 8643 | tem = SCOPED_STRING (NILP (selected) ? "[X] " : "[ ] "); | 8646 | tem = NILP (selected) ? check_yes : check_no; |
| 8644 | s = concat2 (tem, s); | 8647 | s = concat2 (tem, s); |
| 8645 | } | 8648 | } |
| 8646 | 8649 | ||
diff --git a/src/keymap.c b/src/keymap.c index 368903db5e6..fa2d4e942b8 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -1299,7 +1299,8 @@ define_as_prefix (Lisp_Object keymap, Lisp_Object c) | |||
| 1299 | static Lisp_Object | 1299 | static Lisp_Object |
| 1300 | append_key (Lisp_Object key_sequence, Lisp_Object key) | 1300 | append_key (Lisp_Object key_sequence, Lisp_Object key) |
| 1301 | { | 1301 | { |
| 1302 | return Fvconcat (2, ((Lisp_Object []) { key_sequence, scoped_list1 (key) })); | 1302 | AUTO_LIST1 (key_list, key); |
| 1303 | return Fvconcat (2, ((Lisp_Object []) { key_sequence, key_list })); | ||
| 1303 | } | 1304 | } |
| 1304 | 1305 | ||
| 1305 | /* Given a event type C which is a symbol, | 1306 | /* Given a event type C which is a symbol, |
| @@ -1338,7 +1339,8 @@ silly_event_symbol_error (Lisp_Object c) | |||
| 1338 | *p = 0; | 1339 | *p = 0; |
| 1339 | 1340 | ||
| 1340 | c = reorder_modifiers (c); | 1341 | c = reorder_modifiers (c); |
| 1341 | keystring = concat2 (SCOPED_STRING (new_mods), XCDR (assoc)); | 1342 | AUTO_STRING (new_modstring, new_mods); |
| 1343 | keystring = concat2 (new_modstring, XCDR (assoc)); | ||
| 1342 | 1344 | ||
| 1343 | error ("To bind the key %s, use [?%s], not [%s]", | 1345 | error ("To bind the key %s, use [?%s], not [%s]", |
| 1344 | SDATA (SYMBOL_NAME (c)), SDATA (keystring), | 1346 | SDATA (SYMBOL_NAME (c)), SDATA (keystring), |
| @@ -2242,9 +2244,12 @@ around function keys and event symbols. */) | |||
| 2242 | 2244 | ||
| 2243 | if (CONSP (key) && INTEGERP (XCAR (key)) && INTEGERP (XCDR (key))) | 2245 | if (CONSP (key) && INTEGERP (XCAR (key)) && INTEGERP (XCDR (key))) |
| 2244 | /* An interval from a map-char-table. */ | 2246 | /* An interval from a map-char-table. */ |
| 2245 | return concat3 (Fsingle_key_description (XCAR (key), no_angles), | 2247 | { |
| 2246 | SCOPED_STRING (".."), | 2248 | AUTO_STRING (dotdot, ".."); |
| 2247 | Fsingle_key_description (XCDR (key), no_angles)); | 2249 | return concat3 (Fsingle_key_description (XCAR (key), no_angles), |
| 2250 | dotdot, | ||
| 2251 | Fsingle_key_description (XCDR (key), no_angles)); | ||
| 2252 | } | ||
| 2248 | 2253 | ||
| 2249 | key = EVENT_HEAD (key); | 2254 | key = EVENT_HEAD (key); |
| 2250 | 2255 | ||
| @@ -3439,9 +3444,9 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, | |||
| 3439 | /* Call Fkey_description first, to avoid GC bug for the other string. */ | 3444 | /* Call Fkey_description first, to avoid GC bug for the other string. */ |
| 3440 | if (!NILP (prefix) && XFASTINT (Flength (prefix)) > 0) | 3445 | if (!NILP (prefix) && XFASTINT (Flength (prefix)) > 0) |
| 3441 | { | 3446 | { |
| 3442 | Lisp_Object tem; | 3447 | Lisp_Object tem = Fkey_description (prefix, Qnil); |
| 3443 | tem = Fkey_description (prefix, Qnil); | 3448 | AUTO_STRING (space, " "); |
| 3444 | elt_prefix = concat2 (tem, SCOPED_STRING (" ")); | 3449 | elt_prefix = concat2 (tem, space); |
| 3445 | } | 3450 | } |
| 3446 | prefix = Qnil; | 3451 | prefix = Qnil; |
| 3447 | } | 3452 | } |
diff --git a/src/lisp.h b/src/lisp.h index 27751af2f5b..aeb1a71e481 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -4625,24 +4625,36 @@ enum | |||
| 4625 | && alignof (union Aligned_String) % GCALIGNMENT == 0) | 4625 | && alignof (union Aligned_String) % GCALIGNMENT == 0) |
| 4626 | }; | 4626 | }; |
| 4627 | 4627 | ||
| 4628 | /* Build a stack-based Lisp cons or short list if possible, a GC-based | 4628 | /* Auxiliary macros used for auto allocation of Lisp objects. Please |
| 4629 | one otherwise. The resulting object should not be modified or made | 4629 | use these only in macros like AUTO_CONS that declare a local |
| 4630 | visible to user code. */ | 4630 | variable whose lifetime will be clear to the programmer. */ |
| 4631 | 4631 | #define STACK_CONS(a, b) \ | |
| 4632 | #define scoped_cons(a, b) \ | 4632 | make_lisp_ptr (&(union Aligned_Cons) { { a, { b } } }.s, Lisp_Cons) |
| 4633 | (USE_STACK_CONS \ | 4633 | #define AUTO_CONS_EXPR(a, b) \ |
| 4634 | ? make_lisp_ptr (&(union Aligned_Cons) { { a, { b } } }.s, Lisp_Cons) \ | 4634 | (USE_STACK_CONS ? STACK_CONS (a, b) : Fcons (a, b)) |
| 4635 | : Fcons (a, b)) | 4635 | |
| 4636 | #define scoped_list1(a) \ | 4636 | /* Declare NAME as an auto Lisp cons or short list if possible, a |
| 4637 | (USE_STACK_CONS ? scoped_cons (a, Qnil) : list1 (a)) | 4637 | GC-based one otherwise. This is in the sense of the C keyword |
| 4638 | #define scoped_list2(a, b) \ | 4638 | 'auto'; i.e., the object has the lifetime of the containing block. |
| 4639 | (USE_STACK_CONS ? scoped_cons (a, scoped_list1 (b)) : list2 (a,b)) | 4639 | The resulting object should not be made visible to user Lisp code. */ |
| 4640 | #define scoped_list3(a, b, c) \ | 4640 | |
| 4641 | (USE_STACK_CONS ? scoped_cons (a, scoped_list2 (b, c)) : list3 (a, b, c)) | 4641 | #define AUTO_CONS(name, a, b) Lisp_Object name = AUTO_CONS_EXPR (a, b) |
| 4642 | #define scoped_list4(a, b, c, d) \ | 4642 | #define AUTO_LIST1(name, a) \ |
| 4643 | (USE_STACK_CONS \ | 4643 | Lisp_Object name = (USE_STACK_CONS ? STACK_CONS (a, Qnil) : list1 (a)) |
| 4644 | ? scoped_cons (a, scoped_list3 (b, c, d)) : \ | 4644 | #define AUTO_LIST2(name, a, b) \ |
| 4645 | list4 (a, b, c, d)) | 4645 | Lisp_Object name = (USE_STACK_CONS \ |
| 4646 | ? STACK_CONS (a, STACK_CONS (b, Qnil)) \ | ||
| 4647 | : list2 (a, b)) | ||
| 4648 | #define AUTO_LIST3(name, a, b, c) \ | ||
| 4649 | Lisp_Object name = (USE_STACK_CONS \ | ||
| 4650 | ? STACK_CONS (a, STACK_CONS (b, STACK_CONS (c, Qnil))) \ | ||
| 4651 | : list3 (a, b, c)) | ||
| 4652 | #define AUTO_LIST4(name, a, b, c, d) \ | ||
| 4653 | Lisp_Object name \ | ||
| 4654 | = (USE_STACK_CONS \ | ||
| 4655 | ? STACK_CONS (a, STACK_CONS (b, STACK_CONS (c, \ | ||
| 4656 | STACK_CONS (d, Qnil)))) \ | ||
| 4657 | : list4 (a, b, c, d)) | ||
| 4646 | 4658 | ||
| 4647 | /* Check whether stack-allocated strings are ASCII-only. */ | 4659 | /* Check whether stack-allocated strings are ASCII-only. */ |
| 4648 | 4660 | ||
| @@ -4652,18 +4664,19 @@ extern const char *verify_ascii (const char *); | |||
| 4652 | # define verify_ascii(str) (str) | 4664 | # define verify_ascii(str) (str) |
| 4653 | #endif | 4665 | #endif |
| 4654 | 4666 | ||
| 4655 | /* Build a stack-based Lisp string from STR if possible, a GC-based | 4667 | /* Declare NAME as an auto Lisp string if possible, a GC-based one if not. |
| 4656 | one if not. STR is not necessarily copied and should contain only | 4668 | Take its value from STR. STR is not necessarily copied and should |
| 4657 | ASCII characters. The resulting Lisp string should not be modified | 4669 | contain only ASCII characters. The resulting Lisp string should |
| 4658 | or made visible to user code. */ | 4670 | not be modified or made visible to user code. */ |
| 4659 | 4671 | ||
| 4660 | #define SCOPED_STRING(str) \ | 4672 | #define AUTO_STRING(name, str) \ |
| 4661 | (USE_STACK_STRING \ | 4673 | Lisp_Object name = \ |
| 4662 | ? (make_lisp_ptr \ | 4674 | (USE_STACK_STRING \ |
| 4663 | ((&(union Aligned_String) \ | 4675 | ? (make_lisp_ptr \ |
| 4664 | { { strlen (str), -1, 0, (unsigned char *) verify_ascii (str) } }.s), \ | 4676 | ((&(union Aligned_String) \ |
| 4665 | Lisp_String)) \ | 4677 | {{strlen (str), -1, 0, (unsigned char *) verify_ascii (str)}}.s), \ |
| 4666 | : build_string (verify_ascii (str))) | 4678 | Lisp_String)) \ |
| 4679 | : build_string (verify_ascii (str))) | ||
| 4667 | 4680 | ||
| 4668 | /* Loop over all tails of a list, checking for cycles. | 4681 | /* Loop over all tails of a list, checking for cycles. |
| 4669 | FIXME: Make tortoise and n internal declarations. | 4682 | FIXME: Make tortoise and n internal declarations. |
diff --git a/src/lread.c b/src/lread.c index 799635e3c83..0e71b13c5c8 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -969,9 +969,10 @@ static void | |||
| 969 | load_warn_old_style_backquotes (Lisp_Object file) | 969 | load_warn_old_style_backquotes (Lisp_Object file) |
| 970 | { | 970 | { |
| 971 | if (!NILP (Vold_style_backquotes)) | 971 | if (!NILP (Vold_style_backquotes)) |
| 972 | Fmessage (2, ((Lisp_Object []) | 972 | { |
| 973 | { SCOPED_STRING ("Loading `%s': old-style backquotes detected!"), | 973 | AUTO_STRING (format, "Loading `%s': old-style backquotes detected!"); |
| 974 | file })); | 974 | Fmessage (2, (Lisp_Object []) {format, file}); |
| 975 | } | ||
| 975 | } | 976 | } |
| 976 | 977 | ||
| 977 | DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0, | 978 | DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0, |
| @@ -2888,11 +2889,8 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) | |||
| 2888 | if (c == '=') | 2889 | if (c == '=') |
| 2889 | { | 2890 | { |
| 2890 | /* Make a placeholder for #n# to use temporarily. */ | 2891 | /* Make a placeholder for #n# to use temporarily. */ |
| 2891 | Lisp_Object placeholder; | 2892 | AUTO_CONS (placeholder, Qnil, Qnil); |
| 2892 | Lisp_Object cell; | 2893 | Lisp_Object cell = Fcons (make_number (n), placeholder); |
| 2893 | |||
| 2894 | placeholder = scoped_cons (Qnil, Qnil); | ||
| 2895 | cell = Fcons (make_number (n), placeholder); | ||
| 2896 | read_objects = Fcons (cell, read_objects); | 2894 | read_objects = Fcons (cell, read_objects); |
| 2897 | 2895 | ||
| 2898 | /* Read the object itself. */ | 2896 | /* Read the object itself. */ |
| @@ -3371,7 +3369,7 @@ substitute_object_recurse (Lisp_Object object, Lisp_Object placeholder, Lisp_Obj | |||
| 3371 | substitute_in_interval contains part of the logic. */ | 3369 | substitute_in_interval contains part of the logic. */ |
| 3372 | 3370 | ||
| 3373 | INTERVAL root_interval = string_intervals (subtree); | 3371 | INTERVAL root_interval = string_intervals (subtree); |
| 3374 | Lisp_Object arg = scoped_cons (object, placeholder); | 3372 | AUTO_CONS (arg, object, placeholder); |
| 3375 | 3373 | ||
| 3376 | traverse_intervals_noorder (root_interval, | 3374 | traverse_intervals_noorder (root_interval, |
| 3377 | &substitute_in_interval, arg); | 3375 | &substitute_in_interval, arg); |
| @@ -3678,8 +3676,10 @@ read_list (bool flag, Lisp_Object readcharfun) | |||
| 3678 | in the installed Lisp directory. | 3676 | in the installed Lisp directory. |
| 3679 | We don't use Fexpand_file_name because that would make | 3677 | We don't use Fexpand_file_name because that would make |
| 3680 | the directory absolute now. */ | 3678 | the directory absolute now. */ |
| 3681 | elt = concat2 (SCOPED_STRING ("../lisp/"), | 3679 | { |
| 3682 | Ffile_name_nondirectory (elt)); | 3680 | AUTO_STRING (dotdotlisp, "../lisp/"); |
| 3681 | elt = concat2 (dotdotlisp, Ffile_name_nondirectory (elt)); | ||
| 3682 | } | ||
| 3683 | } | 3683 | } |
| 3684 | else if (EQ (elt, Vload_file_name) | 3684 | else if (EQ (elt, Vload_file_name) |
| 3685 | && ! NILP (elt) | 3685 | && ! NILP (elt) |
diff --git a/src/menu.c b/src/menu.c index e63b21f0e08..61163ae0216 100644 --- a/src/menu.c +++ b/src/menu.c | |||
| @@ -389,8 +389,11 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk | |||
| 389 | { | 389 | { |
| 390 | if (!submenu && SREF (tem, 0) != '\0' | 390 | if (!submenu && SREF (tem, 0) != '\0' |
| 391 | && SREF (tem, 0) != '-') | 391 | && SREF (tem, 0) != '-') |
| 392 | ASET (menu_items, idx + MENU_ITEMS_ITEM_NAME, | 392 | { |
| 393 | concat2 (SCOPED_STRING (" "), tem)); | 393 | AUTO_STRING (spaces, " "); |
| 394 | ASET (menu_items, idx + MENU_ITEMS_ITEM_NAME, | ||
| 395 | concat2 (spaces, tem)); | ||
| 396 | } | ||
| 394 | idx += MENU_ITEMS_ITEM_LENGTH; | 397 | idx += MENU_ITEMS_ITEM_LENGTH; |
| 395 | } | 398 | } |
| 396 | } | 399 | } |
| @@ -409,14 +412,20 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk | |||
| 409 | prefix = " "; | 412 | prefix = " "; |
| 410 | 413 | ||
| 411 | if (prefix) | 414 | if (prefix) |
| 412 | item_string = concat2 (SCOPED_STRING (prefix), item_string); | 415 | { |
| 416 | AUTO_STRING (prefix_obj, prefix); | ||
| 417 | item_string = concat2 (prefix_obj, item_string); | ||
| 418 | } | ||
| 413 | } | 419 | } |
| 414 | 420 | ||
| 415 | if ((FRAME_TERMCAP_P (XFRAME (Vmenu_updating_frame)) | 421 | if ((FRAME_TERMCAP_P (XFRAME (Vmenu_updating_frame)) |
| 416 | || FRAME_MSDOS_P (XFRAME (Vmenu_updating_frame))) | 422 | || FRAME_MSDOS_P (XFRAME (Vmenu_updating_frame))) |
| 417 | && !NILP (map)) | 423 | && !NILP (map)) |
| 418 | /* Indicate visually that this is a submenu. */ | 424 | /* Indicate visually that this is a submenu. */ |
| 419 | item_string = concat2 (item_string, SCOPED_STRING (" >")); | 425 | { |
| 426 | AUTO_STRING (space_gt, " >"); | ||
| 427 | item_string = concat2 (item_string, space_gt); | ||
| 428 | } | ||
| 420 | 429 | ||
| 421 | push_menu_item (item_string, enabled, key, | 430 | push_menu_item (item_string, enabled, key, |
| 422 | AREF (item_properties, ITEM_PROPERTY_DEF), | 431 | AREF (item_properties, ITEM_PROPERTY_DEF), |
diff --git a/src/minibuf.c b/src/minibuf.c index ea525ba0f25..0b455157d52 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -1157,9 +1157,10 @@ function, instead of the usual behavior. */) | |||
| 1157 | STRING_MULTIBYTE (prompt)); | 1157 | STRING_MULTIBYTE (prompt)); |
| 1158 | } | 1158 | } |
| 1159 | 1159 | ||
| 1160 | AUTO_STRING (format, "%s (default %s): "); | ||
| 1160 | prompt = Fformat (3, ((Lisp_Object []) | 1161 | prompt = Fformat (3, ((Lisp_Object []) |
| 1161 | { SCOPED_STRING ("%s (default %s): "), | 1162 | {format, prompt, |
| 1162 | prompt, CONSP (def) ? XCAR (def) : def })); | 1163 | CONSP (def) ? XCAR (def) : def})); |
| 1163 | } | 1164 | } |
| 1164 | 1165 | ||
| 1165 | result = Fcompleting_read (prompt, intern ("internal-complete-buffer"), | 1166 | result = Fcompleting_read (prompt, intern ("internal-complete-buffer"), |
diff --git a/src/process.c b/src/process.c index 6d059af9cc8..f767ae05e96 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -596,7 +596,7 @@ status_message (struct Lisp_Process *p) | |||
| 596 | Lisp_Object symbol; | 596 | Lisp_Object symbol; |
| 597 | int code; | 597 | int code; |
| 598 | bool coredump; | 598 | bool coredump; |
| 599 | Lisp_Object string, string2; | 599 | Lisp_Object string; |
| 600 | 600 | ||
| 601 | decode_status (status, &symbol, &code, &coredump); | 601 | decode_status (status, &symbol, &code, &coredump); |
| 602 | 602 | ||
| @@ -620,8 +620,8 @@ status_message (struct Lisp_Process *p) | |||
| 620 | if (c1 != c2) | 620 | if (c1 != c2) |
| 621 | Faset (string, make_number (0), make_number (c2)); | 621 | Faset (string, make_number (0), make_number (c2)); |
| 622 | } | 622 | } |
| 623 | string2 = SCOPED_STRING (coredump ? " (core dumped)\n" : "\n"); | 623 | AUTO_STRING (suffix, coredump ? " (core dumped)\n" : "\n"); |
| 624 | return concat2 (string, string2); | 624 | return concat2 (string, suffix); |
| 625 | } | 625 | } |
| 626 | else if (EQ (symbol, Qexit)) | 626 | else if (EQ (symbol, Qexit)) |
| 627 | { | 627 | { |
| @@ -629,17 +629,17 @@ status_message (struct Lisp_Process *p) | |||
| 629 | return build_string (code == 0 ? "deleted\n" : "connection broken by remote peer\n"); | 629 | return build_string (code == 0 ? "deleted\n" : "connection broken by remote peer\n"); |
| 630 | if (code == 0) | 630 | if (code == 0) |
| 631 | return build_string ("finished\n"); | 631 | return build_string ("finished\n"); |
| 632 | AUTO_STRING (prefix, "exited abnormally with code "); | ||
| 632 | string = Fnumber_to_string (make_number (code)); | 633 | string = Fnumber_to_string (make_number (code)); |
| 633 | string2 = SCOPED_STRING (coredump ? " (core dumped)\n" : "\n"); | 634 | AUTO_STRING (suffix, coredump ? " (core dumped)\n" : "\n"); |
| 634 | return concat3 (SCOPED_STRING ("exited abnormally with code "), | 635 | return concat3 (prefix, string, suffix); |
| 635 | string, string2); | ||
| 636 | } | 636 | } |
| 637 | else if (EQ (symbol, Qfailed)) | 637 | else if (EQ (symbol, Qfailed)) |
| 638 | { | 638 | { |
| 639 | AUTO_STRING (prefix, "failed with code "); | ||
| 639 | string = Fnumber_to_string (make_number (code)); | 640 | string = Fnumber_to_string (make_number (code)); |
| 640 | string2 = SCOPED_STRING ("\n"); | 641 | AUTO_STRING (suffix, "\n"); |
| 641 | return concat3 (SCOPED_STRING ("failed with code "), | 642 | return concat3 (prefix, string, suffix); |
| 642 | string, string2); | ||
| 643 | } | 643 | } |
| 644 | else | 644 | else |
| 645 | return Fcopy_sequence (Fsymbol_name (symbol)); | 645 | return Fcopy_sequence (Fsymbol_name (symbol)); |
| @@ -1327,7 +1327,8 @@ Returns nil if format of ADDRESS is invalid. */) | |||
| 1327 | else | 1327 | else |
| 1328 | return Qnil; | 1328 | return Qnil; |
| 1329 | 1329 | ||
| 1330 | args[0] = SCOPED_STRING (format); | 1330 | AUTO_STRING (format_obj, format); |
| 1331 | args[0] = format_obj; | ||
| 1331 | 1332 | ||
| 1332 | for (i = 0; i < nargs; i++) | 1333 | for (i = 0; i < nargs; i++) |
| 1333 | { | 1334 | { |
| @@ -1346,8 +1347,10 @@ Returns nil if format of ADDRESS is invalid. */) | |||
| 1346 | } | 1347 | } |
| 1347 | 1348 | ||
| 1348 | if (CONSP (address)) | 1349 | if (CONSP (address)) |
| 1349 | return Fformat (2, ((Lisp_Object []) | 1350 | { |
| 1350 | { SCOPED_STRING ("<Family %d>"), Fcar (address) })); | 1351 | AUTO_STRING (format, "<Family %d>"); |
| 1352 | return Fformat (2, (Lisp_Object []) {format, Fcar (address)}); | ||
| 1353 | } | ||
| 1351 | 1354 | ||
| 1352 | return Qnil; | 1355 | return Qnil; |
| 1353 | } | 1356 | } |
| @@ -4062,12 +4065,13 @@ server_accept_connection (Lisp_Object server, int channel) | |||
| 4062 | { | 4065 | { |
| 4063 | unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr; | 4066 | unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr; |
| 4064 | 4067 | ||
| 4068 | AUTO_STRING (ipv4_format, "%d.%d.%d.%d"); | ||
| 4065 | host = Fformat (5, ((Lisp_Object []) | 4069 | host = Fformat (5, ((Lisp_Object []) |
| 4066 | { SCOPED_STRING ("%d.%d.%d.%d"), make_number (ip[0]), | 4070 | { ipv4_format, make_number (ip[0]), |
| 4067 | make_number (ip[1]), make_number (ip[2]), make_number (ip[3]) })); | 4071 | make_number (ip[1]), make_number (ip[2]), make_number (ip[3]) })); |
| 4068 | service = make_number (ntohs (saddr.in.sin_port)); | 4072 | service = make_number (ntohs (saddr.in.sin_port)); |
| 4069 | caller = Fformat (3, ((Lisp_Object []) | 4073 | AUTO_STRING (caller_format, " <%s:%d>"); |
| 4070 | { SCOPED_STRING (" <%s:%d>"), host, service })); | 4074 | caller = Fformat (3, (Lisp_Object []) {caller_format, host, service}); |
| 4071 | } | 4075 | } |
| 4072 | break; | 4076 | break; |
| 4073 | 4077 | ||
| @@ -4078,13 +4082,14 @@ server_accept_connection (Lisp_Object server, int channel) | |||
| 4078 | uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr; | 4082 | uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr; |
| 4079 | int i; | 4083 | int i; |
| 4080 | 4084 | ||
| 4081 | args[0] = SCOPED_STRING ("%x:%x:%x:%x:%x:%x:%x:%x"); | 4085 | AUTO_STRING (ipv6_format, "%x:%x:%x:%x:%x:%x:%x:%x"); |
| 4086 | args[0] = ipv6_format; | ||
| 4082 | for (i = 0; i < 8; i++) | 4087 | for (i = 0; i < 8; i++) |
| 4083 | args[i + 1] = make_number (ntohs (ip6[i])); | 4088 | args[i + 1] = make_number (ntohs (ip6[i])); |
| 4084 | host = Fformat (9, args); | 4089 | host = Fformat (9, args); |
| 4085 | service = make_number (ntohs (saddr.in.sin_port)); | 4090 | service = make_number (ntohs (saddr.in.sin_port)); |
| 4086 | caller = Fformat (3, ((Lisp_Object []) | 4091 | AUTO_STRING (caller_format, " <[%s]:%d>"); |
| 4087 | { SCOPED_STRING (" <[%s]:%d>"), host, service })); | 4092 | caller = Fformat (3, (Lisp_Object []) {caller_format, host, service}); |
| 4088 | } | 4093 | } |
| 4089 | break; | 4094 | break; |
| 4090 | #endif | 4095 | #endif |
| @@ -4094,8 +4099,9 @@ server_accept_connection (Lisp_Object server, int channel) | |||
| 4094 | #endif | 4099 | #endif |
| 4095 | default: | 4100 | default: |
| 4096 | caller = Fnumber_to_string (make_number (connect_counter)); | 4101 | caller = Fnumber_to_string (make_number (connect_counter)); |
| 4097 | caller = concat3 | 4102 | AUTO_STRING (space_lessthan, " <"); |
| 4098 | (SCOPED_STRING (" <"), caller, SCOPED_STRING (">")); | 4103 | AUTO_STRING (greaterthan, ">"); |
| 4104 | caller = concat3 (space_lessthan, caller, greaterthan); | ||
| 4099 | break; | 4105 | break; |
| 4100 | } | 4106 | } |
| 4101 | 4107 | ||
| @@ -4192,16 +4198,18 @@ server_accept_connection (Lisp_Object server, int channel) | |||
| 4192 | p->inherit_coding_system_flag | 4198 | p->inherit_coding_system_flag |
| 4193 | = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag); | 4199 | = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag); |
| 4194 | 4200 | ||
| 4201 | AUTO_STRING (dash, "-"); | ||
| 4202 | AUTO_STRING (nl, "\n"); | ||
| 4203 | Lisp_Object host_string = STRINGP (host) ? host : dash; | ||
| 4204 | |||
| 4195 | if (!NILP (ps->log)) | 4205 | if (!NILP (ps->log)) |
| 4196 | call3 (ps->log, server, proc, | 4206 | { |
| 4197 | concat3 (SCOPED_STRING ("accept from "), | 4207 | AUTO_STRING (accept_from, "accept from "); |
| 4198 | (STRINGP (host) ? host : SCOPED_STRING ("-")), | 4208 | call3 (ps->log, server, proc, concat3 (accept_from, host_string, nl)); |
| 4199 | SCOPED_STRING ("\n"))); | 4209 | } |
| 4200 | 4210 | ||
| 4201 | exec_sentinel (proc, | 4211 | AUTO_STRING (open_from, "open from "); |
| 4202 | concat3 (SCOPED_STRING ("open from "), | 4212 | exec_sentinel (proc, concat3 (open_from, host_string, nl)); |
| 4203 | (STRINGP (host) ? host : SCOPED_STRING ("-")), | ||
| 4204 | SCOPED_STRING ("\n"))); | ||
| 4205 | } | 4213 | } |
| 4206 | 4214 | ||
| 4207 | /* This variable is different from waiting_for_input in keyboard.c. | 4215 | /* This variable is different from waiting_for_input in keyboard.c. |
diff --git a/src/textprop.c b/src/textprop.c index 146ee9e97d9..91ade8ae298 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -1320,7 +1320,8 @@ markers). If OBJECT is a string, START and END are 0-based indices into it. */ | |||
| 1320 | (Lisp_Object start, Lisp_Object end, Lisp_Object property, | 1320 | (Lisp_Object start, Lisp_Object end, Lisp_Object property, |
| 1321 | Lisp_Object value, Lisp_Object object) | 1321 | Lisp_Object value, Lisp_Object object) |
| 1322 | { | 1322 | { |
| 1323 | Fadd_text_properties (start, end, scoped_list2 (property, value), object); | 1323 | AUTO_LIST2 (properties, property, value); |
| 1324 | Fadd_text_properties (start, end, properties, object); | ||
| 1324 | return Qnil; | 1325 | return Qnil; |
| 1325 | } | 1326 | } |
| 1326 | 1327 | ||
| @@ -1361,7 +1362,8 @@ into it. */) | |||
| 1361 | (Lisp_Object start, Lisp_Object end, Lisp_Object face, | 1362 | (Lisp_Object start, Lisp_Object end, Lisp_Object face, |
| 1362 | Lisp_Object append, Lisp_Object object) | 1363 | Lisp_Object append, Lisp_Object object) |
| 1363 | { | 1364 | { |
| 1364 | add_text_properties_1 (start, end, scoped_list2 (Qface, face), object, | 1365 | AUTO_LIST2 (properties, Qface, face); |
| 1366 | add_text_properties_1 (start, end, properties, object, | ||
| 1365 | (NILP (append) | 1367 | (NILP (append) |
| 1366 | ? TEXT_PROPERTY_PREPEND | 1368 | ? TEXT_PROPERTY_PREPEND |
| 1367 | : TEXT_PROPERTY_APPEND)); | 1369 | : TEXT_PROPERTY_APPEND)); |
diff --git a/src/xdisp.c b/src/xdisp.c index c27f46677bb..8176d81cd6e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -12070,7 +12070,7 @@ build_desired_tool_bar_string (struct frame *f) | |||
| 12070 | (f, Fmake_string (make_number (size_needed), make_number (' '))); | 12070 | (f, Fmake_string (make_number (size_needed), make_number (' '))); |
| 12071 | else | 12071 | else |
| 12072 | { | 12072 | { |
| 12073 | Lisp_Object props = scoped_list4 (Qdisplay, Qnil, Qmenu_item, Qnil); | 12073 | AUTO_LIST4 (props, Qdisplay, Qnil, Qmenu_item, Qnil); |
| 12074 | struct gcpro gcpro1; | 12074 | struct gcpro gcpro1; |
| 12075 | GCPRO1 (props); | 12075 | GCPRO1 (props); |
| 12076 | Fremove_text_properties (make_number (0), make_number (size), | 12076 | Fremove_text_properties (make_number (0), make_number (size), |
| @@ -12186,9 +12186,8 @@ build_desired_tool_bar_string (struct frame *f) | |||
| 12186 | the start of this item's properties in the tool-bar items | 12186 | the start of this item's properties in the tool-bar items |
| 12187 | vector. */ | 12187 | vector. */ |
| 12188 | image = Fcons (Qimage, plist); | 12188 | image = Fcons (Qimage, plist); |
| 12189 | Lisp_Object props | 12189 | AUTO_LIST4 (props, Qdisplay, image, Qmenu_item, |
| 12190 | = scoped_list4 (Qdisplay, image, Qmenu_item, | 12190 | make_number (i * TOOL_BAR_ITEM_NSLOTS)); |
| 12191 | make_number (i * TOOL_BAR_ITEM_NSLOTS)); | ||
| 12192 | struct gcpro gcpro1; | 12191 | struct gcpro gcpro1; |
| 12193 | GCPRO1 (props); | 12192 | GCPRO1 (props); |
| 12194 | 12193 | ||
| @@ -20966,7 +20965,8 @@ See also `bidi-paragraph-direction'. */) | |||
| 20966 | the previous non-empty line. */ | 20965 | the previous non-empty line. */ |
| 20967 | if (pos >= ZV && pos > BEGV) | 20966 | if (pos >= ZV && pos > BEGV) |
| 20968 | DEC_BOTH (pos, bytepos); | 20967 | DEC_BOTH (pos, bytepos); |
| 20969 | if (fast_looking_at (SCOPED_STRING ("[\f\t ]*\n"), | 20968 | AUTO_STRING (trailing_white_space, "[\f\t ]*\n"); |
| 20969 | if (fast_looking_at (trailing_white_space, | ||
| 20970 | pos, bytepos, ZV, ZV_BYTE, Qnil) > 0) | 20970 | pos, bytepos, ZV, ZV_BYTE, Qnil) > 0) |
| 20971 | { | 20971 | { |
| 20972 | while ((c = FETCH_BYTE (bytepos)) == '\n' | 20972 | while ((c = FETCH_BYTE (bytepos)) == '\n' |
diff --git a/src/xfaces.c b/src/xfaces.c index f788c304bd8..73704bbba8e 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -3398,7 +3398,8 @@ set_font_frame_param (Lisp_Object frame, Lisp_Object lface) | |||
| 3398 | ASET (lface, LFACE_FONT_INDEX, font); | 3398 | ASET (lface, LFACE_FONT_INDEX, font); |
| 3399 | } | 3399 | } |
| 3400 | f->default_face_done_p = 0; | 3400 | f->default_face_done_p = 0; |
| 3401 | Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qfont, font)); | 3401 | AUTO_FRAME_ARG (arg, Qfont, font); |
| 3402 | Fmodify_frame_parameters (frame, arg); | ||
| 3402 | } | 3403 | } |
| 3403 | } | 3404 | } |
| 3404 | 3405 | ||
| @@ -3787,18 +3788,23 @@ Default face attributes override any local face attributes. */) | |||
| 3787 | && newface->font) | 3788 | && newface->font) |
| 3788 | { | 3789 | { |
| 3789 | Lisp_Object name = newface->font->props[FONT_NAME_INDEX]; | 3790 | Lisp_Object name = newface->font->props[FONT_NAME_INDEX]; |
| 3790 | Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qfont, name)); | 3791 | AUTO_FRAME_ARG (arg, Qfont, name); |
| 3792 | Fmodify_frame_parameters (frame, arg); | ||
| 3791 | } | 3793 | } |
| 3792 | 3794 | ||
| 3793 | if (STRINGP (gvec[LFACE_FOREGROUND_INDEX])) | 3795 | if (STRINGP (gvec[LFACE_FOREGROUND_INDEX])) |
| 3794 | Fmodify_frame_parameters | 3796 | { |
| 3795 | (frame, FRAME_PARAMETER (Qforeground_color, | 3797 | AUTO_FRAME_ARG (arg, Qforeground_color, |
| 3796 | gvec[LFACE_FOREGROUND_INDEX])); | 3798 | gvec[LFACE_FOREGROUND_INDEX]); |
| 3799 | Fmodify_frame_parameters (frame, arg); | ||
| 3800 | } | ||
| 3797 | 3801 | ||
| 3798 | if (STRINGP (gvec[LFACE_BACKGROUND_INDEX])) | 3802 | if (STRINGP (gvec[LFACE_BACKGROUND_INDEX])) |
| 3799 | Fmodify_frame_parameters | 3803 | { |
| 3800 | (frame, FRAME_PARAMETER (Qbackground_color, | 3804 | AUTO_FRAME_ARG (arg, Qbackground_color, |
| 3801 | gvec[LFACE_BACKGROUND_INDEX])); | 3805 | gvec[LFACE_BACKGROUND_INDEX]); |
| 3806 | Fmodify_frame_parameters (frame, arg); | ||
| 3807 | } | ||
| 3802 | } | 3808 | } |
| 3803 | } | 3809 | } |
| 3804 | 3810 | ||
diff --git a/src/xfns.c b/src/xfns.c index f474e88ba7e..81d7bac858b 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1569,11 +1569,14 @@ x_default_scroll_bar_color_parameter (struct frame *f, | |||
| 1569 | 1569 | ||
| 1570 | /* See if an X resource for the scroll bar color has been | 1570 | /* See if an X resource for the scroll bar color has been |
| 1571 | specified. */ | 1571 | specified. */ |
| 1572 | tem = display_x_get_resource | 1572 | AUTO_STRING (foreground, "foreground"); |
| 1573 | (dpyinfo, SCOPED_STRING (foreground_p ? "foreground" : "background"), | 1573 | AUTO_STRING (background, "foreground"); |
| 1574 | empty_unibyte_string, | 1574 | AUTO_STRING (verticalScrollBar, "verticalScrollBar"); |
| 1575 | SCOPED_STRING ("verticalScrollBar"), | 1575 | tem = (display_x_get_resource |
| 1576 | empty_unibyte_string); | 1576 | (dpyinfo, foreground_p ? foreground : background, |
| 1577 | empty_unibyte_string, | ||
| 1578 | verticalScrollBar, | ||
| 1579 | empty_unibyte_string)); | ||
| 1577 | if (!STRINGP (tem)) | 1580 | if (!STRINGP (tem)) |
| 1578 | { | 1581 | { |
| 1579 | /* If nothing has been specified, scroll bars will use a | 1582 | /* If nothing has been specified, scroll bars will use a |
| @@ -1591,7 +1594,8 @@ x_default_scroll_bar_color_parameter (struct frame *f, | |||
| 1591 | #endif /* not USE_TOOLKIT_SCROLL_BARS */ | 1594 | #endif /* not USE_TOOLKIT_SCROLL_BARS */ |
| 1592 | } | 1595 | } |
| 1593 | 1596 | ||
| 1594 | x_set_frame_parameters (f, FRAME_PARAMETER (prop, tem)); | 1597 | AUTO_FRAME_ARG (arg, prop, tem); |
| 1598 | x_set_frame_parameters (f, arg); | ||
| 1595 | return tem; | 1599 | return tem; |
| 1596 | } | 1600 | } |
| 1597 | 1601 | ||
| @@ -2843,7 +2847,8 @@ x_default_font_parameter (struct frame *f, Lisp_Object parms) | |||
| 2843 | { | 2847 | { |
| 2844 | /* Remember the explicit font parameter, so we can re-apply it after | 2848 | /* Remember the explicit font parameter, so we can re-apply it after |
| 2845 | we've applied the `default' face settings. */ | 2849 | we've applied the `default' face settings. */ |
| 2846 | x_set_frame_parameters (f, FRAME_PARAMETER (Qfont_param, font_param)); | 2850 | AUTO_FRAME_ARG (arg, Qfont_param, font_param); |
| 2851 | x_set_frame_parameters (f, arg); | ||
| 2847 | } | 2852 | } |
| 2848 | 2853 | ||
| 2849 | /* This call will make X resources override any system font setting. */ | 2854 | /* This call will make X resources override any system font setting. */ |
| @@ -4272,9 +4277,10 @@ select_visual (struct x_display_info *dpyinfo) | |||
| 4272 | Screen *screen = dpyinfo->screen; | 4277 | Screen *screen = dpyinfo->screen; |
| 4273 | 4278 | ||
| 4274 | /* See if a visual is specified. */ | 4279 | /* See if a visual is specified. */ |
| 4275 | Lisp_Object value = display_x_get_resource | 4280 | AUTO_STRING (visualClass, "visualClass"); |
| 4276 | (dpyinfo, SCOPED_STRING ("visualClass"), | 4281 | AUTO_STRING (VisualClass, "VisualClass"); |
| 4277 | SCOPED_STRING ("VisualClass"), Qnil, Qnil); | 4282 | Lisp_Object value = display_x_get_resource (dpyinfo, visualClass, |
| 4283 | VisualClass, Qnil, Qnil); | ||
| 4278 | 4284 | ||
| 4279 | if (STRINGP (value)) | 4285 | if (STRINGP (value)) |
| 4280 | { | 4286 | { |
| @@ -5033,7 +5039,10 @@ x_create_tip_frame (struct x_display_info *dpyinfo, | |||
| 5033 | 5039 | ||
| 5034 | /* Add `tooltip' frame parameter's default value. */ | 5040 | /* Add `tooltip' frame parameter's default value. */ |
| 5035 | if (NILP (Fframe_parameter (frame, Qtooltip))) | 5041 | if (NILP (Fframe_parameter (frame, Qtooltip))) |
| 5036 | Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qtooltip, Qt)); | 5042 | { |
| 5043 | AUTO_FRAME_ARG (arg, Qtooltip, Qt); | ||
| 5044 | Fmodify_frame_parameters (frame, arg); | ||
| 5045 | } | ||
| 5037 | 5046 | ||
| 5038 | /* FIXME - can this be done in a similar way to normal frames? | 5047 | /* FIXME - can this be done in a similar way to normal frames? |
| 5039 | http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00641.html */ | 5048 | http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00641.html */ |
| @@ -5051,8 +5060,10 @@ x_create_tip_frame (struct x_display_info *dpyinfo, | |||
| 5051 | disptype = intern ("color"); | 5060 | disptype = intern ("color"); |
| 5052 | 5061 | ||
| 5053 | if (NILP (Fframe_parameter (frame, Qdisplay_type))) | 5062 | if (NILP (Fframe_parameter (frame, Qdisplay_type))) |
| 5054 | Fmodify_frame_parameters | 5063 | { |
| 5055 | (frame, FRAME_PARAMETER (Qdisplay_type, disptype)); | 5064 | AUTO_FRAME_ARG (arg, Qdisplay_type, disptype); |
| 5065 | Fmodify_frame_parameters (frame, arg); | ||
| 5066 | } | ||
| 5056 | } | 5067 | } |
| 5057 | 5068 | ||
| 5058 | /* Set up faces after all frame parameters are known. This call | 5069 | /* Set up faces after all frame parameters are known. This call |
| @@ -5071,7 +5082,10 @@ x_create_tip_frame (struct x_display_info *dpyinfo, | |||
| 5071 | call2 (Qface_set_after_frame_default, frame, Qnil); | 5082 | call2 (Qface_set_after_frame_default, frame, Qnil); |
| 5072 | 5083 | ||
| 5073 | if (!EQ (bg, Fframe_parameter (frame, Qbackground_color))) | 5084 | if (!EQ (bg, Fframe_parameter (frame, Qbackground_color))) |
| 5074 | Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qbackground_color, bg)); | 5085 | { |
| 5086 | AUTO_FRAME_ARG (arg, Qbackground_color, bg); | ||
| 5087 | Fmodify_frame_parameters (frame, arg); | ||
| 5088 | } | ||
| 5075 | } | 5089 | } |
| 5076 | 5090 | ||
| 5077 | f->no_split = 1; | 5091 | f->no_split = 1; |
diff --git a/src/xselect.c b/src/xselect.c index d90d056e960..0e8a43717e0 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -2159,10 +2159,9 @@ x_clipboard_manager_save (Lisp_Object frame) | |||
| 2159 | static Lisp_Object | 2159 | static Lisp_Object |
| 2160 | x_clipboard_manager_error_1 (Lisp_Object err) | 2160 | x_clipboard_manager_error_1 (Lisp_Object err) |
| 2161 | { | 2161 | { |
| 2162 | Fmessage (2, ((Lisp_Object []) | 2162 | AUTO_STRING (format, "X clipboard manager error: %s\n\ |
| 2163 | { SCOPED_STRING ("X clipboard manager error: %s\n\ | 2163 | If the problem persists, set `x-select-enable-clipboard-manager' to nil."); |
| 2164 | If the problem persists, set `x-select-enable-clipboard-manager' to nil."), | 2164 | Fmessage (2, (Lisp_Object []) {format, CAR (CDR (err))}); |
| 2165 | CAR (CDR (err)) })); | ||
| 2166 | return Qnil; | 2165 | return Qnil; |
| 2167 | } | 2166 | } |
| 2168 | 2167 | ||
| @@ -2229,9 +2228,8 @@ x_clipboard_manager_save_all (void) | |||
| 2229 | local_frame = XCAR (XCDR (XCDR (XCDR (local_selection)))); | 2228 | local_frame = XCAR (XCDR (XCDR (XCDR (local_selection)))); |
| 2230 | if (FRAME_LIVE_P (XFRAME (local_frame))) | 2229 | if (FRAME_LIVE_P (XFRAME (local_frame))) |
| 2231 | { | 2230 | { |
| 2232 | Fmessage (1, ((Lisp_Object []) | 2231 | AUTO_STRING (saving, "Saving clipboard to X clipboard manager..."); |
| 2233 | { SCOPED_STRING | 2232 | Fmessage (1, &saving); |
| 2234 | ("Saving clipboard to X clipboard manager...") })); | ||
| 2235 | internal_condition_case_1 (x_clipboard_manager_save, local_frame, | 2233 | internal_condition_case_1 (x_clipboard_manager_save, local_frame, |
| 2236 | Qt, x_clipboard_manager_error_2); | 2234 | Qt, x_clipboard_manager_error_2); |
| 2237 | } | 2235 | } |
diff --git a/src/xterm.c b/src/xterm.c index f9d95984415..8546dc426d8 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -10935,10 +10935,11 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 10935 | { | 10935 | { |
| 10936 | if (dpyinfo->visual->class == PseudoColor) | 10936 | if (dpyinfo->visual->class == PseudoColor) |
| 10937 | { | 10937 | { |
| 10938 | Lisp_Object value; | 10938 | AUTO_STRING (privateColormap, "privateColormap"); |
| 10939 | value = display_x_get_resource | 10939 | AUTO_STRING (PrivateColormap, "PrivateColormap"); |
| 10940 | (dpyinfo, SCOPED_STRING ("privateColormap"), | 10940 | Lisp_Object value |
| 10941 | SCOPED_STRING ("PrivateColormap"), Qnil, Qnil); | 10941 | = display_x_get_resource (dpyinfo, privateColormap, |
| 10942 | PrivateColormap, Qnil, Qnil); | ||
| 10942 | if (STRINGP (value) | 10943 | if (STRINGP (value) |
| 10943 | && (!strcmp (SSDATA (value), "true") | 10944 | && (!strcmp (SSDATA (value), "true") |
| 10944 | || !strcmp (SSDATA (value), "on"))) | 10945 | || !strcmp (SSDATA (value), "on"))) |
| @@ -11142,9 +11143,10 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 11142 | /* See if we should run in synchronous mode. This is useful | 11143 | /* See if we should run in synchronous mode. This is useful |
| 11143 | for debugging X code. */ | 11144 | for debugging X code. */ |
| 11144 | { | 11145 | { |
| 11145 | Lisp_Object value = display_x_get_resource | 11146 | AUTO_STRING (synchronous, "synchronous"); |
| 11146 | (dpyinfo, SCOPED_STRING ("synchronous"), | 11147 | AUTO_STRING (Synchronous, "Synchronous"); |
| 11147 | SCOPED_STRING ("Synchronous"), Qnil, Qnil); | 11148 | Lisp_Object value = display_x_get_resource (dpyinfo, synchronous, |
| 11149 | Synchronous, Qnil, Qnil); | ||
| 11148 | if (STRINGP (value) | 11150 | if (STRINGP (value) |
| 11149 | && (!strcmp (SSDATA (value), "true") | 11151 | && (!strcmp (SSDATA (value), "true") |
| 11150 | || !strcmp (SSDATA (value), "on"))) | 11152 | || !strcmp (SSDATA (value), "on"))) |
| @@ -11152,9 +11154,10 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 11152 | } | 11154 | } |
| 11153 | 11155 | ||
| 11154 | { | 11156 | { |
| 11155 | Lisp_Object value = display_x_get_resource | 11157 | AUTO_STRING (useXIM, "useXIM"); |
| 11156 | (dpyinfo, SCOPED_STRING ("useXIM"), | 11158 | AUTO_STRING (UseXIM, "UseXIM"); |
| 11157 | SCOPED_STRING ("UseXIM"), Qnil, Qnil); | 11159 | Lisp_Object value = display_x_get_resource (dpyinfo, useXIM, UseXIM, |
| 11160 | Qnil, Qnil); | ||
| 11158 | #ifdef USE_XIM | 11161 | #ifdef USE_XIM |
| 11159 | if (STRINGP (value) | 11162 | if (STRINGP (value) |
| 11160 | && (!strcmp (SSDATA (value), "false") | 11163 | && (!strcmp (SSDATA (value), "false") |