------------------------------------------------------------ revno: 117994 committer: Paul Eggert branch nick: trunk timestamp: Tue 2014-09-30 20:28:16 -0700 message: 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. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-09-30 19:10:37 +0000 +++ doc/lispref/ChangeLog 2014-10-01 03:28:16 +0000 @@ -1,3 +1,9 @@ +2014-10-01 Paul Eggert + + Use AUTO_CONS instead of SCOPED_CONS, etc. + * internals.texi (Stack-allocated Objects): + Adjust to match the revised, less error-prone macros. + 2014-09-30 Paul Eggert * internals.texi (Stack-allocated Objects): Further improvements. === modified file 'doc/lispref/internals.texi' --- doc/lispref/internals.texi 2014-09-30 19:10:37 +0000 +++ doc/lispref/internals.texi 2014-10-01 03:28:16 +0000 @@ -548,35 +548,12 @@ never be made visible to user Lisp code. Currently, cons cells and strings can be allocated this way. This -is implemented by C macros like @code{scoped_cons} and -@code{SCOPED_STRING} that return a @code{Lisp_Object} with block +is implemented by C macros like @code{AUTO_CONS} and +@code{AUTO_STRING} that define a named @code{Lisp_Object} with block lifetime. These objects are not freed by the garbage collector; instead, they have automatic storage duration, i.e., they are allocated like local variables and are automatically freed at the end -of execution of the C block where the object was allocated. C blocks -include compound statements (i.e., inside @samp{@{} and @samp{@}}), -along with selection and iteration statements and their immediate -substatements. For example: - -@example -/* Erroneous code. */ -Lisp_Object x; -if (foo) - x = SCOPED_STRING ("prefix"); -else - x = bar; -return concat2 (x, baz); -@end example - -@noindent -This has undefined behavior because the @code{if} statement is a -block, so @code{x} is used after the corresponding object has been -freed. Better would be: - -@example -Lisp_Object x = foo ? SCOPED_STRING ("prefix") : bar; -return concat2 (x, baz); -@end example +of execution of the C block that defined the object. For performance reasons, stack-allocated strings are limited to @acronym{ASCII} characters, and many of these strings are immutable, === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-01 02:25:40 +0000 +++ src/ChangeLog 2014-10-01 03:28:16 +0000 @@ -1,5 +1,21 @@ 2014-10-01 Paul Eggert + Use AUTO_CONS instead of SCOPED_CONS, etc. + * frame.h (AUTO_FRAME_ARG): Rename from FRAME_PARAMETER. + * 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. + * frame.h (AUTO_FRAME_ARG): + * 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. + * lisp.h (STACK_CONS, AUTO_CONS_EXPR): New internal macros. + * dispnew.c (adjust_decode_mode_spec_buffer): Prefer ptrdiff_t to ssize_t since we're not using ssize_t-related syscalls here. === modified file 'src/buffer.c' --- src/buffer.c 2014-09-30 02:43:23 +0000 +++ src/buffer.c 2014-10-01 03:28:16 +0000 @@ -1552,10 +1552,11 @@ return notsogood; else { - buf = Fget_buffer (SCOPED_STRING ("*scratch*")); + AUTO_STRING (scratch, "*scratch*"); + buf = Fget_buffer (scratch); if (NILP (buf)) { - buf = Fget_buffer_create (SCOPED_STRING ("*scratch*")); + buf = Fget_buffer_create (scratch); Fset_buffer_major_mode (buf); } return buf; @@ -1575,10 +1576,11 @@ if (candidate_buffer (buf, buffer)) return buf; - buf = Fget_buffer (SCOPED_STRING ("*scratch*")); + AUTO_STRING (scratch, "*scratch*"); + buf = Fget_buffer (scratch); if (NILP (buf)) { - buf = Fget_buffer_create (SCOPED_STRING ("*scratch*")); + buf = Fget_buffer_create (scratch); Fset_buffer_major_mode (buf); } @@ -5289,7 +5291,8 @@ (void) initialized; #endif /* USE_MMAP_FOR_BUFFERS */ - Fset_buffer (Fget_buffer_create (SCOPED_STRING ("*scratch*"))); + AUTO_STRING (scratch, "*scratch*"); + Fset_buffer (Fget_buffer_create (scratch)); if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters))) Fset_buffer_multibyte (Qnil); @@ -5326,9 +5329,12 @@ However, it is not necessary to turn / into /:/. So avoid doing that. */ && strcmp ("/", SSDATA (BVAR (current_buffer, directory)))) - bset_directory - (current_buffer, - concat2 (SCOPED_STRING ("/:"), BVAR (current_buffer, directory))); + { + AUTO_STRING (slash_colon, "/:"); + bset_directory (current_buffer, + concat2 (slash_colon, + BVAR (current_buffer, directory))); + } temp = get_minibuffer (0); bset_directory (XBUFFER (temp), BVAR (current_buffer, directory)); === modified file 'src/charset.c' --- src/charset.c 2014-09-30 02:43:23 +0000 +++ src/charset.c 2014-10-01 03:28:16 +0000 @@ -485,14 +485,12 @@ unsigned max_code = CHARSET_MAX_CODE (charset); int fd; FILE *fp; - Lisp_Object suffixes; struct charset_map_entries *head, *entries; int n_entries; - ptrdiff_t count; - - suffixes = scoped_list2 (SCOPED_STRING (".map"), SCOPED_STRING (".TXT")); - - count = SPECPDL_INDEX (); + AUTO_STRING (map, ".map"); + AUTO_STRING (txt, ".txt"); + AUTO_LIST2 (suffixes, map, txt); + ptrdiff_t count = SPECPDL_INDEX (); record_unwind_protect_nothing (); specbind (Qfile_name_handler_alist, Qnil); fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil, false); === modified file 'src/chartab.c' --- src/chartab.c 2014-09-30 02:43:23 +0000 +++ src/chartab.c 2014-10-01 03:28:16 +0000 @@ -1302,8 +1302,8 @@ { struct gcpro gcpro1; GCPRO1 (val); - result = Fload (concat2 (SCOPED_STRING ("international/"), table), - Qt, Qt, Qt, Qt); + AUTO_STRING (intl, "international/"); + result = Fload (concat2 (intl, table), Qt, Qt, Qt, Qt); UNGCPRO; if (NILP (result)) return Qnil; === modified file 'src/data.c' --- src/data.c 2014-09-30 02:43:23 +0000 +++ src/data.c 2014-10-01 03:28:16 +0000 @@ -979,14 +979,15 @@ { ptrdiff_t i = 0, len = XINT (Flength (choice)); Lisp_Object obj, *args; - Lisp_Object should_be_specified = SCOPED_STRING (" should be specified"); - Lisp_Object or = SCOPED_STRING (" or "); - Lisp_Object comma = SCOPED_STRING (", "); + AUTO_STRING (one_of, "One of "); + AUTO_STRING (comma, ", "); + AUTO_STRING (or, " or "); + AUTO_STRING (should_be_specified, " should be specified"); USE_SAFE_ALLOCA; SAFE_ALLOCA_LISP (args, len * 2 + 1); - args[i++] = SCOPED_STRING ("One of "); + args[i++] = one_of; for (obj = choice; !NILP (obj); obj = XCDR (obj)) { @@ -1006,11 +1007,13 @@ static void wrong_range (Lisp_Object min, Lisp_Object max, Lisp_Object wrong) { - xsignal2 (Qerror, Fconcat (4, ((Lisp_Object []) - { SCOPED_STRING ("Value should be from "), - Fnumber_to_string (min), - SCOPED_STRING (" to "), - Fnumber_to_string (max) })), wrong); + AUTO_STRING (value_should_be_from, "Value should be from "); + AUTO_STRING (to, " to "); + xsignal2 (Qerror, + Fconcat (4, ((Lisp_Object []) + {value_should_be_from, Fnumber_to_string (min), + to, Fnumber_to_string (max)})), + wrong); } /* Store NEWVAL into SYMBOL, where VALCONTENTS is found in the value cell === modified file 'src/dispnew.c' --- src/dispnew.c 2014-10-01 02:25:40 +0000 +++ src/dispnew.c 2014-10-01 03:28:16 +0000 @@ -6100,15 +6100,12 @@ (*initial_terminal->delete_terminal_hook) (initial_terminal); /* Update frame parameters to reflect the new type. */ - Fmodify_frame_parameters - (selected_frame, FRAME_PARAMETER (Qtty_type, - Ftty_type (selected_frame))); - if (t->display_info.tty->name) - Fmodify_frame_parameters - (selected_frame, - FRAME_PARAMETER (Qtty, build_string (t->display_info.tty->name))); - else - Fmodify_frame_parameters (selected_frame, FRAME_PARAMETER (Qtty, Qnil)); + AUTO_FRAME_ARG (tty_type_arg, Qtty_type, Ftty_type (selected_frame)); + Fmodify_frame_parameters (selected_frame, tty_type_arg); + AUTO_FRAME_ARG (tty_arg, Qtty, (t->display_info.tty->name + ? build_string (t->display_info.tty->name) + : Qnil)); + Fmodify_frame_parameters (selected_frame, tty_arg); } { === modified file 'src/doc.c' --- src/doc.c 2014-09-30 02:43:23 +0000 +++ src/doc.c 2014-10-01 03:28:16 +0000 @@ -146,8 +146,9 @@ if (fd < 0) { SAFE_FREE (); - return concat3 (SCOPED_STRING ("Cannot open doc string file \""), - file, SCOPED_STRING ("\"\n")); + AUTO_STRING (cannot_open, "Cannot open doc string file \""); + AUTO_STRING (quote_nl, "\"\n"); + return concat3 (cannot_open, file, quote_nl); } } count = SPECPDL_INDEX (); === modified file 'src/editfns.c' --- src/editfns.c 2014-09-30 02:43:23 +0000 +++ src/editfns.c 2014-10-01 03:28:16 +0000 @@ -4362,7 +4362,8 @@ Lisp_Object format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1) { - return Fformat (3, (Lisp_Object []) { SCOPED_STRING (string1), arg0, arg1 }); + AUTO_STRING (format, string1); + return Fformat (3, (Lisp_Object []) {format, arg0, arg1}); } DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0, === modified file 'src/emacs.c' --- src/emacs.c 2014-09-30 02:43:23 +0000 +++ src/emacs.c 2014-10-01 03:28:16 +0000 @@ -400,6 +400,7 @@ Lisp_Object name, dir, handler; ptrdiff_t count = SPECPDL_INDEX (); Lisp_Object raw_name; + AUTO_STRING (slash_colon, "/:"); initial_argv = argv; initial_argc = argc; @@ -423,7 +424,7 @@ if it would otherwise be treated as magic. */ handler = Ffind_file_name_handler (raw_name, Qt); if (! NILP (handler)) - raw_name = concat2 (SCOPED_STRING ("/:"), raw_name); + raw_name = concat2 (slash_colon, raw_name); Vinvocation_name = Ffile_name_nondirectory (raw_name); Vinvocation_directory = Ffile_name_directory (raw_name); @@ -441,7 +442,7 @@ if it would otherwise be treated as magic. */ handler = Ffind_file_name_handler (found, Qt); if (! NILP (handler)) - found = concat2 (SCOPED_STRING ("/:"), found); + found = concat2 (slash_colon, found); Vinvocation_directory = Ffile_name_directory (found); } } @@ -2323,7 +2324,10 @@ } if (! NILP (tem)) - element = concat2 (SCOPED_STRING ("/:"), element); + { + AUTO_STRING (slash_colon, "/:"); + element = concat2 (slash_colon, element); + } } /* !NILP (element) */ lpath = Fcons (element, lpath); === modified file 'src/fileio.c' --- src/fileio.c 2014-09-30 02:43:23 +0000 +++ src/fileio.c 2014-10-01 03:28:16 +0000 @@ -1111,7 +1111,8 @@ name = make_specified_string (nm, -1, p - nm, multibyte); temp[0] = DRIVE_LETTER (drive); - name = concat2 (SCOPED_STRING (temp), name); + AUTO_STRING (drive_prefix, temp); + name = concat2 (drive_prefix, name); } #ifdef WINDOWSNT if (!NILP (Vw32_downcase_file_names)) @@ -5419,10 +5420,10 @@ ring_bell (XFRAME (selected_frame)); + AUTO_STRING (format, "Auto-saving %s: %s"); msg = Fformat (3, ((Lisp_Object []) - { SCOPED_STRING ("Auto-saving %s: %s"), - BVAR (current_buffer, name), - Ferror_message_string (error_val) })); + {format, BVAR (current_buffer, name), + Ferror_message_string (error_val)})); GCPRO1 (msg); for (i = 0; i < 3; ++i) === modified file 'src/fns.c' --- src/fns.c 2014-09-30 02:43:23 +0000 +++ src/fns.c 2014-10-01 03:28:16 +0000 @@ -2725,8 +2725,8 @@ return obj; } - prompt = Fconcat (2, ((Lisp_Object []) - { prompt, SCOPED_STRING ("(yes or no) ") })); + AUTO_STRING (yes_or_no, "(yes or no) "); + prompt = Fconcat (2, (Lisp_Object []) {prompt, yes_or_no}); GCPRO1 (prompt); while (1) === modified file 'src/font.c' --- src/font.c 2014-09-30 02:43:23 +0000 +++ src/font.c 2014-10-01 03:28:16 +0000 @@ -1187,13 +1187,22 @@ { val = prop[XLFD_ENCODING_INDEX]; if (! NILP (val)) - val = concat2 (SCOPED_STRING ("*-"), SYMBOL_NAME (val)); + { + AUTO_STRING (stardash, "*-"); + val = concat2 (stardash, SYMBOL_NAME (val)); + } } else if (NILP (prop[XLFD_ENCODING_INDEX])) - val = concat2 (SYMBOL_NAME (val), SCOPED_STRING ("-*")); + { + AUTO_STRING (dashstar, "-*"); + val = concat2 (SYMBOL_NAME (val), dashstar); + } else - val = concat3 (SYMBOL_NAME (val), SCOPED_STRING ("-"), - SYMBOL_NAME (prop[XLFD_ENCODING_INDEX])); + { + AUTO_STRING (dash, "-"); + val = concat3 (SYMBOL_NAME (val), dash, + SYMBOL_NAME (prop[XLFD_ENCODING_INDEX])); + } if (! NILP (val)) ASET (font, FONT_REGISTRY_INDEX, Fintern (val, Qnil)); @@ -1789,10 +1798,8 @@ p1 = strchr (p0, '-'); if (! p1) { - if (SDATA (registry)[len - 1] == '*') - registry = concat2 (registry, SCOPED_STRING ("-*")); - else - registry = concat2 (registry, SCOPED_STRING ("*-*")); + AUTO_STRING (extra, ("*-*" + (len && p0[len - 1] == '*'))); + registry = concat2 (registry, extra); } registry = Fdowncase (registry); ASET (font_spec, FONT_REGISTRY_INDEX, Fintern (registry, Qnil)); @@ -5019,7 +5026,7 @@ if (FONTP (arg)) { Lisp_Object tail, elt; - Lisp_Object equalstr = SCOPED_STRING ("="); + AUTO_STRING (equalstr, "="); val = Ffont_xlfd_name (arg, Qt); for (tail = AREF (arg, FONT_EXTRA_INDEX); CONSP (tail); @@ -5052,8 +5059,11 @@ { val = Ffont_xlfd_name (result, Qt); if (! FONT_SPEC_P (result)) - val = concat3 (SYMBOL_NAME (AREF (result, FONT_TYPE_INDEX)), - SCOPED_STRING (":"), val); + { + AUTO_STRING (colon, ":"); + val = concat3 (SYMBOL_NAME (AREF (result, FONT_TYPE_INDEX)), + colon, val); + } result = val; } else if (CONSP (result)) === modified file 'src/fontset.c' --- src/fontset.c 2014-09-30 02:43:23 +0000 +++ src/fontset.c 2014-10-01 03:28:16 +0000 @@ -1462,8 +1462,8 @@ registry = AREF (font_spec, FONT_REGISTRY_INDEX); if (! NILP (registry)) registry = Fdowncase (SYMBOL_NAME (registry)); - encoding = find_font_encoding (concat3 (family, SCOPED_STRING ("-"), - registry)); + AUTO_STRING (dash, "-"); + encoding = find_font_encoding (concat3 (family, dash, registry)); if (NILP (encoding)) encoding = Qascii; @@ -1575,7 +1575,7 @@ if (ascii_changed) { - Lisp_Object tail, fr, alist; + Lisp_Object tail, fr; int fontset_id = XINT (FONTSET_ID (fontset)); set_fontset_ascii (fontset, fontname); @@ -1598,8 +1598,8 @@ if (! NILP (font_object)) { update_auto_fontset_alist (font_object, fontset); - alist = FRAME_PARAMETER (Qfont, Fcons (name, font_object)); - Fmodify_frame_parameters (fr, alist); + AUTO_FRAME_ARG (arg, Qfont, Fcons (name, font_object)); + Fmodify_frame_parameters (fr, arg); } } } === modified file 'src/frame.c' --- src/frame.c 2014-09-30 15:20:03 +0000 +++ src/frame.c 2014-10-01 03:28:16 +0000 @@ -4148,9 +4148,9 @@ { if (attribute && dpyinfo) { - tem = display_x_get_resource - (dpyinfo, SCOPED_STRING (attribute), - SCOPED_STRING (class), Qnil, Qnil); + AUTO_STRING (at, attribute); + AUTO_STRING (cl, class); + tem = display_x_get_resource (dpyinfo, at, cl, Qnil, Qnil); if (NILP (tem)) return Qunbound; @@ -4260,7 +4260,8 @@ tem = x_frame_get_arg (f, alist, prop, xprop, xclass, type); if (EQ (tem, Qunbound)) tem = deflt; - x_set_frame_parameters (f, FRAME_PARAMETER (prop, tem)); + AUTO_FRAME_ARG (arg, prop, tem); + x_set_frame_parameters (f, arg); return tem; } === modified file 'src/frame.h' --- src/frame.h 2014-09-21 22:49:24 +0000 +++ src/frame.h 2014-10-01 03:28:16 +0000 @@ -1062,8 +1062,8 @@ /* Handy macro to construct an argument to Fmodify_frame_parameters. */ -#define FRAME_PARAMETER(parameter, value) \ - scoped_list1 (scoped_cons (parameter, value)) +#define AUTO_FRAME_ARG(name, parameter, value) \ + AUTO_LIST1 (name, AUTO_CONS_EXPR (parameter, value)) /* False means there are no visible garbaged frames. */ extern bool frame_garbaged; === modified file 'src/keyboard.c' --- src/keyboard.c 2014-09-30 02:43:23 +0000 +++ src/keyboard.c 2014-10-01 03:28:16 +0000 @@ -551,6 +551,7 @@ /* Replace a dash from echo_dash with a space, otherwise add a space at the end as a separator between keys. */ + AUTO_STRING (space, " "); if (STRINGP (echo_string) && SCHARS (echo_string) > 1) { Lisp_Object last_char, prev_char, idx; @@ -566,10 +567,10 @@ if (XINT (last_char) == '-' && XINT (prev_char) != ' ') Faset (echo_string, idx, make_number (' ')); else - echo_string = concat2 (echo_string, SCOPED_STRING (" ")); + echo_string = concat2 (echo_string, space); } else if (STRINGP (echo_string) && SCHARS (echo_string) > 0) - echo_string = concat2 (echo_string, SCOPED_STRING (" ")); + echo_string = concat2 (echo_string, space); kset_echo_string (current_kboard, @@ -630,9 +631,9 @@ /* Put a dash at the end of the buffer temporarily, but make it go away when the next character is added. */ - kset_echo_string - (current_kboard, - concat2 (KVAR (current_kboard, echo_string), SCOPED_STRING ("-"))); + AUTO_STRING (dash, "-"); + kset_echo_string (current_kboard, + concat2 (KVAR (current_kboard, echo_string), dash)); echo_now (); } @@ -1890,13 +1891,11 @@ static Lisp_Object safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args) { - Lisp_Object hook, fun; - eassert (nargs == 2); - hook = args[0]; - fun = args[1]; - Fmessage (4, ((Lisp_Object []) - { SCOPED_STRING ("Error in %s (%S): %S"), hook, fun, error })); + AUTO_STRING (format, "Error in %s (%S): %S"); + Lisp_Object hook = args[0]; + Lisp_Object fun = args[1]; + Fmessage (4, (Lisp_Object []) {format, hook, fun, error}); if (SYMBOLP (hook)) { @@ -7885,12 +7884,12 @@ { /* This is a command. See if there is an equivalent key binding. */ Lisp_Object keyeq = AREF (item_properties, ITEM_PROPERTY_KEYEQ); + AUTO_STRING (space_space, " "); /* The previous code preferred :key-sequence to :keys, so we preserve this behavior. */ if (STRINGP (keyeq) && !CONSP (keyhint)) - keyeq = concat2 (SCOPED_STRING (" "), - Fsubstitute_command_keys (keyeq)); + keyeq = concat2 (space_space, Fsubstitute_command_keys (keyeq)); else { Lisp_Object prefix = keyeq; @@ -7933,7 +7932,7 @@ if (STRINGP (XCDR (prefix))) tem = concat2 (tem, XCDR (prefix)); } - keyeq = concat2 (SCOPED_STRING (" "), tem); + keyeq = concat2 (space_space, tem); } else keyeq = Qnil; @@ -8637,10 +8636,14 @@ /* Insert button prefix. */ Lisp_Object selected = AREF (item_properties, ITEM_PROPERTY_SELECTED); + AUTO_STRING (radio_yes, "(*) "); + AUTO_STRING (radio_no , "( ) "); + AUTO_STRING (check_yes, "[X] "); + AUTO_STRING (check_no , "[ ] "); if (EQ (tem, QCradio)) - tem = SCOPED_STRING (NILP (selected) ? "(*) " : "( ) "); + tem = NILP (selected) ? radio_yes : radio_no; else - tem = SCOPED_STRING (NILP (selected) ? "[X] " : "[ ] "); + tem = NILP (selected) ? check_yes : check_no; s = concat2 (tem, s); } === modified file 'src/keymap.c' --- src/keymap.c 2014-09-30 02:43:23 +0000 +++ src/keymap.c 2014-10-01 03:28:16 +0000 @@ -1299,7 +1299,8 @@ static Lisp_Object append_key (Lisp_Object key_sequence, Lisp_Object key) { - return Fvconcat (2, ((Lisp_Object []) { key_sequence, scoped_list1 (key) })); + AUTO_LIST1 (key_list, key); + return Fvconcat (2, ((Lisp_Object []) { key_sequence, key_list })); } /* Given a event type C which is a symbol, @@ -1338,7 +1339,8 @@ *p = 0; c = reorder_modifiers (c); - keystring = concat2 (SCOPED_STRING (new_mods), XCDR (assoc)); + AUTO_STRING (new_modstring, new_mods); + keystring = concat2 (new_modstring, XCDR (assoc)); error ("To bind the key %s, use [?%s], not [%s]", SDATA (SYMBOL_NAME (c)), SDATA (keystring), @@ -2242,9 +2244,12 @@ if (CONSP (key) && INTEGERP (XCAR (key)) && INTEGERP (XCDR (key))) /* An interval from a map-char-table. */ - return concat3 (Fsingle_key_description (XCAR (key), no_angles), - SCOPED_STRING (".."), - Fsingle_key_description (XCDR (key), no_angles)); + { + AUTO_STRING (dotdot, ".."); + return concat3 (Fsingle_key_description (XCAR (key), no_angles), + dotdot, + Fsingle_key_description (XCDR (key), no_angles)); + } key = EVENT_HEAD (key); @@ -3439,9 +3444,9 @@ /* Call Fkey_description first, to avoid GC bug for the other string. */ if (!NILP (prefix) && XFASTINT (Flength (prefix)) > 0) { - Lisp_Object tem; - tem = Fkey_description (prefix, Qnil); - elt_prefix = concat2 (tem, SCOPED_STRING (" ")); + Lisp_Object tem = Fkey_description (prefix, Qnil); + AUTO_STRING (space, " "); + elt_prefix = concat2 (tem, space); } prefix = Qnil; } === modified file 'src/lisp.h' --- src/lisp.h 2014-09-30 02:43:23 +0000 +++ src/lisp.h 2014-10-01 03:28:16 +0000 @@ -4625,24 +4625,36 @@ && alignof (union Aligned_String) % GCALIGNMENT == 0) }; -/* Build a stack-based Lisp cons or short list if possible, a GC-based - one otherwise. The resulting object should not be modified or made - visible to user code. */ - -#define scoped_cons(a, b) \ - (USE_STACK_CONS \ - ? make_lisp_ptr (&(union Aligned_Cons) { { a, { b } } }.s, Lisp_Cons) \ - : Fcons (a, b)) -#define scoped_list1(a) \ - (USE_STACK_CONS ? scoped_cons (a, Qnil) : list1 (a)) -#define scoped_list2(a, b) \ - (USE_STACK_CONS ? scoped_cons (a, scoped_list1 (b)) : list2 (a,b)) -#define scoped_list3(a, b, c) \ - (USE_STACK_CONS ? scoped_cons (a, scoped_list2 (b, c)) : list3 (a, b, c)) -#define scoped_list4(a, b, c, d) \ - (USE_STACK_CONS \ - ? scoped_cons (a, scoped_list3 (b, c, d)) : \ - list4 (a, b, c, d)) +/* Auxiliary macros used for auto allocation of Lisp objects. Please + use these only in macros like AUTO_CONS that declare a local + variable whose lifetime will be clear to the programmer. */ +#define STACK_CONS(a, b) \ + make_lisp_ptr (&(union Aligned_Cons) { { a, { b } } }.s, Lisp_Cons) +#define AUTO_CONS_EXPR(a, b) \ + (USE_STACK_CONS ? STACK_CONS (a, b) : Fcons (a, b)) + +/* Declare NAME as an auto Lisp cons or short list if possible, a + GC-based one otherwise. This is in the sense of the C keyword + 'auto'; i.e., the object has the lifetime of the containing block. + The resulting object should not be made visible to user Lisp code. */ + +#define AUTO_CONS(name, a, b) Lisp_Object name = AUTO_CONS_EXPR (a, b) +#define AUTO_LIST1(name, a) \ + Lisp_Object name = (USE_STACK_CONS ? STACK_CONS (a, Qnil) : list1 (a)) +#define AUTO_LIST2(name, a, b) \ + Lisp_Object name = (USE_STACK_CONS \ + ? STACK_CONS (a, STACK_CONS (b, Qnil)) \ + : list2 (a, b)) +#define AUTO_LIST3(name, a, b, c) \ + Lisp_Object name = (USE_STACK_CONS \ + ? STACK_CONS (a, STACK_CONS (b, STACK_CONS (c, Qnil))) \ + : list3 (a, b, c)) +#define AUTO_LIST4(name, a, b, c, d) \ + Lisp_Object name \ + = (USE_STACK_CONS \ + ? STACK_CONS (a, STACK_CONS (b, STACK_CONS (c, \ + STACK_CONS (d, Qnil)))) \ + : list4 (a, b, c, d)) /* Check whether stack-allocated strings are ASCII-only. */ @@ -4652,18 +4664,19 @@ # define verify_ascii(str) (str) #endif -/* Build a stack-based Lisp string from STR if possible, a GC-based - one if not. STR is not necessarily copied and should contain only - ASCII characters. The resulting Lisp string should not be modified - or made visible to user code. */ +/* Declare NAME as an auto Lisp string if possible, a GC-based one if not. + Take its value from STR. STR is not necessarily copied and should + contain only ASCII characters. The resulting Lisp string should + not be modified or made visible to user code. */ -#define SCOPED_STRING(str) \ - (USE_STACK_STRING \ - ? (make_lisp_ptr \ - ((&(union Aligned_String) \ - { { strlen (str), -1, 0, (unsigned char *) verify_ascii (str) } }.s), \ - Lisp_String)) \ - : build_string (verify_ascii (str))) +#define AUTO_STRING(name, str) \ + Lisp_Object name = \ + (USE_STACK_STRING \ + ? (make_lisp_ptr \ + ((&(union Aligned_String) \ + {{strlen (str), -1, 0, (unsigned char *) verify_ascii (str)}}.s), \ + Lisp_String)) \ + : build_string (verify_ascii (str))) /* Loop over all tails of a list, checking for cycles. FIXME: Make tortoise and n internal declarations. === modified file 'src/lread.c' --- src/lread.c 2014-09-30 02:43:23 +0000 +++ src/lread.c 2014-10-01 03:28:16 +0000 @@ -969,9 +969,10 @@ load_warn_old_style_backquotes (Lisp_Object file) { if (!NILP (Vold_style_backquotes)) - Fmessage (2, ((Lisp_Object []) - { SCOPED_STRING ("Loading `%s': old-style backquotes detected!"), - file })); + { + AUTO_STRING (format, "Loading `%s': old-style backquotes detected!"); + Fmessage (2, (Lisp_Object []) {format, file}); + } } DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0, @@ -2888,11 +2889,8 @@ if (c == '=') { /* Make a placeholder for #n# to use temporarily. */ - Lisp_Object placeholder; - Lisp_Object cell; - - placeholder = scoped_cons (Qnil, Qnil); - cell = Fcons (make_number (n), placeholder); + AUTO_CONS (placeholder, Qnil, Qnil); + Lisp_Object cell = Fcons (make_number (n), placeholder); read_objects = Fcons (cell, read_objects); /* Read the object itself. */ @@ -3371,7 +3369,7 @@ substitute_in_interval contains part of the logic. */ INTERVAL root_interval = string_intervals (subtree); - Lisp_Object arg = scoped_cons (object, placeholder); + AUTO_CONS (arg, object, placeholder); traverse_intervals_noorder (root_interval, &substitute_in_interval, arg); @@ -3678,8 +3676,10 @@ in the installed Lisp directory. We don't use Fexpand_file_name because that would make the directory absolute now. */ - elt = concat2 (SCOPED_STRING ("../lisp/"), - Ffile_name_nondirectory (elt)); + { + AUTO_STRING (dotdotlisp, "../lisp/"); + elt = concat2 (dotdotlisp, Ffile_name_nondirectory (elt)); + } } else if (EQ (elt, Vload_file_name) && ! NILP (elt) === modified file 'src/menu.c' --- src/menu.c 2014-09-30 02:43:23 +0000 +++ src/menu.c 2014-10-01 03:28:16 +0000 @@ -389,8 +389,11 @@ { if (!submenu && SREF (tem, 0) != '\0' && SREF (tem, 0) != '-') - ASET (menu_items, idx + MENU_ITEMS_ITEM_NAME, - concat2 (SCOPED_STRING (" "), tem)); + { + AUTO_STRING (spaces, " "); + ASET (menu_items, idx + MENU_ITEMS_ITEM_NAME, + concat2 (spaces, tem)); + } idx += MENU_ITEMS_ITEM_LENGTH; } } @@ -409,14 +412,20 @@ prefix = " "; if (prefix) - item_string = concat2 (SCOPED_STRING (prefix), item_string); + { + AUTO_STRING (prefix_obj, prefix); + item_string = concat2 (prefix_obj, item_string); + } } if ((FRAME_TERMCAP_P (XFRAME (Vmenu_updating_frame)) || FRAME_MSDOS_P (XFRAME (Vmenu_updating_frame))) && !NILP (map)) /* Indicate visually that this is a submenu. */ - item_string = concat2 (item_string, SCOPED_STRING (" >")); + { + AUTO_STRING (space_gt, " >"); + item_string = concat2 (item_string, space_gt); + } push_menu_item (item_string, enabled, key, AREF (item_properties, ITEM_PROPERTY_DEF), === modified file 'src/minibuf.c' --- src/minibuf.c 2014-09-30 02:43:23 +0000 +++ src/minibuf.c 2014-10-01 03:28:16 +0000 @@ -1157,9 +1157,10 @@ STRING_MULTIBYTE (prompt)); } + AUTO_STRING (format, "%s (default %s): "); prompt = Fformat (3, ((Lisp_Object []) - { SCOPED_STRING ("%s (default %s): "), - prompt, CONSP (def) ? XCAR (def) : def })); + {format, prompt, + CONSP (def) ? XCAR (def) : def})); } result = Fcompleting_read (prompt, intern ("internal-complete-buffer"), === modified file 'src/process.c' --- src/process.c 2014-09-30 02:43:23 +0000 +++ src/process.c 2014-10-01 03:28:16 +0000 @@ -596,7 +596,7 @@ Lisp_Object symbol; int code; bool coredump; - Lisp_Object string, string2; + Lisp_Object string; decode_status (status, &symbol, &code, &coredump); @@ -620,8 +620,8 @@ if (c1 != c2) Faset (string, make_number (0), make_number (c2)); } - string2 = SCOPED_STRING (coredump ? " (core dumped)\n" : "\n"); - return concat2 (string, string2); + AUTO_STRING (suffix, coredump ? " (core dumped)\n" : "\n"); + return concat2 (string, suffix); } else if (EQ (symbol, Qexit)) { @@ -629,17 +629,17 @@ return build_string (code == 0 ? "deleted\n" : "connection broken by remote peer\n"); if (code == 0) return build_string ("finished\n"); + AUTO_STRING (prefix, "exited abnormally with code "); string = Fnumber_to_string (make_number (code)); - string2 = SCOPED_STRING (coredump ? " (core dumped)\n" : "\n"); - return concat3 (SCOPED_STRING ("exited abnormally with code "), - string, string2); + AUTO_STRING (suffix, coredump ? " (core dumped)\n" : "\n"); + return concat3 (prefix, string, suffix); } else if (EQ (symbol, Qfailed)) { + AUTO_STRING (prefix, "failed with code "); string = Fnumber_to_string (make_number (code)); - string2 = SCOPED_STRING ("\n"); - return concat3 (SCOPED_STRING ("failed with code "), - string, string2); + AUTO_STRING (suffix, "\n"); + return concat3 (prefix, string, suffix); } else return Fcopy_sequence (Fsymbol_name (symbol)); @@ -1327,7 +1327,8 @@ else return Qnil; - args[0] = SCOPED_STRING (format); + AUTO_STRING (format_obj, format); + args[0] = format_obj; for (i = 0; i < nargs; i++) { @@ -1346,8 +1347,10 @@ } if (CONSP (address)) - return Fformat (2, ((Lisp_Object []) - { SCOPED_STRING (""), Fcar (address) })); + { + AUTO_STRING (format, ""); + return Fformat (2, (Lisp_Object []) {format, Fcar (address)}); + } return Qnil; } @@ -4062,12 +4065,13 @@ { unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr; + AUTO_STRING (ipv4_format, "%d.%d.%d.%d"); host = Fformat (5, ((Lisp_Object []) - { SCOPED_STRING ("%d.%d.%d.%d"), make_number (ip[0]), + { ipv4_format, make_number (ip[0]), make_number (ip[1]), make_number (ip[2]), make_number (ip[3]) })); service = make_number (ntohs (saddr.in.sin_port)); - caller = Fformat (3, ((Lisp_Object []) - { SCOPED_STRING (" <%s:%d>"), host, service })); + AUTO_STRING (caller_format, " <%s:%d>"); + caller = Fformat (3, (Lisp_Object []) {caller_format, host, service}); } break; @@ -4078,13 +4082,14 @@ uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr; int i; - args[0] = SCOPED_STRING ("%x:%x:%x:%x:%x:%x:%x:%x"); + AUTO_STRING (ipv6_format, "%x:%x:%x:%x:%x:%x:%x:%x"); + args[0] = ipv6_format; for (i = 0; i < 8; i++) args[i + 1] = make_number (ntohs (ip6[i])); host = Fformat (9, args); service = make_number (ntohs (saddr.in.sin_port)); - caller = Fformat (3, ((Lisp_Object []) - { SCOPED_STRING (" <[%s]:%d>"), host, service })); + AUTO_STRING (caller_format, " <[%s]:%d>"); + caller = Fformat (3, (Lisp_Object []) {caller_format, host, service}); } break; #endif @@ -4094,8 +4099,9 @@ #endif default: caller = Fnumber_to_string (make_number (connect_counter)); - caller = concat3 - (SCOPED_STRING (" <"), caller, SCOPED_STRING (">")); + AUTO_STRING (space_lessthan, " <"); + AUTO_STRING (greaterthan, ">"); + caller = concat3 (space_lessthan, caller, greaterthan); break; } @@ -4192,16 +4198,18 @@ p->inherit_coding_system_flag = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag); + AUTO_STRING (dash, "-"); + AUTO_STRING (nl, "\n"); + Lisp_Object host_string = STRINGP (host) ? host : dash; + if (!NILP (ps->log)) - call3 (ps->log, server, proc, - concat3 (SCOPED_STRING ("accept from "), - (STRINGP (host) ? host : SCOPED_STRING ("-")), - SCOPED_STRING ("\n"))); + { + AUTO_STRING (accept_from, "accept from "); + call3 (ps->log, server, proc, concat3 (accept_from, host_string, nl)); + } - exec_sentinel (proc, - concat3 (SCOPED_STRING ("open from "), - (STRINGP (host) ? host : SCOPED_STRING ("-")), - SCOPED_STRING ("\n"))); + AUTO_STRING (open_from, "open from "); + exec_sentinel (proc, concat3 (open_from, host_string, nl)); } /* This variable is different from waiting_for_input in keyboard.c. === modified file 'src/textprop.c' --- src/textprop.c 2014-09-29 06:44:31 +0000 +++ src/textprop.c 2014-10-01 03:28:16 +0000 @@ -1320,7 +1320,8 @@ (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object) { - Fadd_text_properties (start, end, scoped_list2 (property, value), object); + AUTO_LIST2 (properties, property, value); + Fadd_text_properties (start, end, properties, object); return Qnil; } @@ -1361,7 +1362,8 @@ (Lisp_Object start, Lisp_Object end, Lisp_Object face, Lisp_Object append, Lisp_Object object) { - add_text_properties_1 (start, end, scoped_list2 (Qface, face), object, + AUTO_LIST2 (properties, Qface, face); + add_text_properties_1 (start, end, properties, object, (NILP (append) ? TEXT_PROPERTY_PREPEND : TEXT_PROPERTY_APPEND)); === modified file 'src/xdisp.c' --- src/xdisp.c 2014-09-30 23:19:31 +0000 +++ src/xdisp.c 2014-10-01 03:28:16 +0000 @@ -12070,7 +12070,7 @@ (f, Fmake_string (make_number (size_needed), make_number (' '))); else { - Lisp_Object props = scoped_list4 (Qdisplay, Qnil, Qmenu_item, Qnil); + AUTO_LIST4 (props, Qdisplay, Qnil, Qmenu_item, Qnil); struct gcpro gcpro1; GCPRO1 (props); Fremove_text_properties (make_number (0), make_number (size), @@ -12186,9 +12186,8 @@ the start of this item's properties in the tool-bar items vector. */ image = Fcons (Qimage, plist); - Lisp_Object props - = scoped_list4 (Qdisplay, image, Qmenu_item, - make_number (i * TOOL_BAR_ITEM_NSLOTS)); + AUTO_LIST4 (props, Qdisplay, image, Qmenu_item, + make_number (i * TOOL_BAR_ITEM_NSLOTS)); struct gcpro gcpro1; GCPRO1 (props); @@ -20966,7 +20965,8 @@ the previous non-empty line. */ if (pos >= ZV && pos > BEGV) DEC_BOTH (pos, bytepos); - if (fast_looking_at (SCOPED_STRING ("[\f\t ]*\n"), + AUTO_STRING (trailing_white_space, "[\f\t ]*\n"); + if (fast_looking_at (trailing_white_space, pos, bytepos, ZV, ZV_BYTE, Qnil) > 0) { while ((c = FETCH_BYTE (bytepos)) == '\n' === modified file 'src/xfaces.c' --- src/xfaces.c 2014-09-18 11:34:24 +0000 +++ src/xfaces.c 2014-10-01 03:28:16 +0000 @@ -3398,7 +3398,8 @@ ASET (lface, LFACE_FONT_INDEX, font); } f->default_face_done_p = 0; - Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qfont, font)); + AUTO_FRAME_ARG (arg, Qfont, font); + Fmodify_frame_parameters (frame, arg); } } @@ -3787,18 +3788,23 @@ && newface->font) { Lisp_Object name = newface->font->props[FONT_NAME_INDEX]; - Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qfont, name)); + AUTO_FRAME_ARG (arg, Qfont, name); + Fmodify_frame_parameters (frame, arg); } if (STRINGP (gvec[LFACE_FOREGROUND_INDEX])) - Fmodify_frame_parameters - (frame, FRAME_PARAMETER (Qforeground_color, - gvec[LFACE_FOREGROUND_INDEX])); + { + AUTO_FRAME_ARG (arg, Qforeground_color, + gvec[LFACE_FOREGROUND_INDEX]); + Fmodify_frame_parameters (frame, arg); + } if (STRINGP (gvec[LFACE_BACKGROUND_INDEX])) - Fmodify_frame_parameters - (frame, FRAME_PARAMETER (Qbackground_color, - gvec[LFACE_BACKGROUND_INDEX])); + { + AUTO_FRAME_ARG (arg, Qbackground_color, + gvec[LFACE_BACKGROUND_INDEX]); + Fmodify_frame_parameters (frame, arg); + } } } === modified file 'src/xfns.c' --- src/xfns.c 2014-09-30 02:43:23 +0000 +++ src/xfns.c 2014-10-01 03:28:16 +0000 @@ -1569,11 +1569,14 @@ /* See if an X resource for the scroll bar color has been specified. */ - tem = display_x_get_resource - (dpyinfo, SCOPED_STRING (foreground_p ? "foreground" : "background"), - empty_unibyte_string, - SCOPED_STRING ("verticalScrollBar"), - empty_unibyte_string); + AUTO_STRING (foreground, "foreground"); + AUTO_STRING (background, "foreground"); + AUTO_STRING (verticalScrollBar, "verticalScrollBar"); + tem = (display_x_get_resource + (dpyinfo, foreground_p ? foreground : background, + empty_unibyte_string, + verticalScrollBar, + empty_unibyte_string)); if (!STRINGP (tem)) { /* If nothing has been specified, scroll bars will use a @@ -1591,7 +1594,8 @@ #endif /* not USE_TOOLKIT_SCROLL_BARS */ } - x_set_frame_parameters (f, FRAME_PARAMETER (prop, tem)); + AUTO_FRAME_ARG (arg, prop, tem); + x_set_frame_parameters (f, arg); return tem; } @@ -2843,7 +2847,8 @@ { /* Remember the explicit font parameter, so we can re-apply it after we've applied the `default' face settings. */ - x_set_frame_parameters (f, FRAME_PARAMETER (Qfont_param, font_param)); + AUTO_FRAME_ARG (arg, Qfont_param, font_param); + x_set_frame_parameters (f, arg); } /* This call will make X resources override any system font setting. */ @@ -4272,9 +4277,10 @@ Screen *screen = dpyinfo->screen; /* See if a visual is specified. */ - Lisp_Object value = display_x_get_resource - (dpyinfo, SCOPED_STRING ("visualClass"), - SCOPED_STRING ("VisualClass"), Qnil, Qnil); + AUTO_STRING (visualClass, "visualClass"); + AUTO_STRING (VisualClass, "VisualClass"); + Lisp_Object value = display_x_get_resource (dpyinfo, visualClass, + VisualClass, Qnil, Qnil); if (STRINGP (value)) { @@ -5033,7 +5039,10 @@ /* Add `tooltip' frame parameter's default value. */ if (NILP (Fframe_parameter (frame, Qtooltip))) - Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qtooltip, Qt)); + { + AUTO_FRAME_ARG (arg, Qtooltip, Qt); + Fmodify_frame_parameters (frame, arg); + } /* FIXME - can this be done in a similar way to normal frames? http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00641.html */ @@ -5051,8 +5060,10 @@ disptype = intern ("color"); if (NILP (Fframe_parameter (frame, Qdisplay_type))) - Fmodify_frame_parameters - (frame, FRAME_PARAMETER (Qdisplay_type, disptype)); + { + AUTO_FRAME_ARG (arg, Qdisplay_type, disptype); + Fmodify_frame_parameters (frame, arg); + } } /* Set up faces after all frame parameters are known. This call @@ -5071,7 +5082,10 @@ call2 (Qface_set_after_frame_default, frame, Qnil); if (!EQ (bg, Fframe_parameter (frame, Qbackground_color))) - Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qbackground_color, bg)); + { + AUTO_FRAME_ARG (arg, Qbackground_color, bg); + Fmodify_frame_parameters (frame, arg); + } } f->no_split = 1; === modified file 'src/xselect.c' --- src/xselect.c 2014-09-30 02:43:23 +0000 +++ src/xselect.c 2014-10-01 03:28:16 +0000 @@ -2159,10 +2159,9 @@ static Lisp_Object x_clipboard_manager_error_1 (Lisp_Object err) { - Fmessage (2, ((Lisp_Object []) - { SCOPED_STRING ("X clipboard manager error: %s\n\ -If the problem persists, set `x-select-enable-clipboard-manager' to nil."), - CAR (CDR (err)) })); + AUTO_STRING (format, "X clipboard manager error: %s\n\ +If the problem persists, set `x-select-enable-clipboard-manager' to nil."); + Fmessage (2, (Lisp_Object []) {format, CAR (CDR (err))}); return Qnil; } @@ -2229,9 +2228,8 @@ local_frame = XCAR (XCDR (XCDR (XCDR (local_selection)))); if (FRAME_LIVE_P (XFRAME (local_frame))) { - Fmessage (1, ((Lisp_Object []) - { SCOPED_STRING - ("Saving clipboard to X clipboard manager...") })); + AUTO_STRING (saving, "Saving clipboard to X clipboard manager..."); + Fmessage (1, &saving); internal_condition_case_1 (x_clipboard_manager_save, local_frame, Qt, x_clipboard_manager_error_2); } === modified file 'src/xterm.c' --- src/xterm.c 2014-09-30 15:31:18 +0000 +++ src/xterm.c 2014-10-01 03:28:16 +0000 @@ -10935,10 +10935,11 @@ { if (dpyinfo->visual->class == PseudoColor) { - Lisp_Object value; - value = display_x_get_resource - (dpyinfo, SCOPED_STRING ("privateColormap"), - SCOPED_STRING ("PrivateColormap"), Qnil, Qnil); + AUTO_STRING (privateColormap, "privateColormap"); + AUTO_STRING (PrivateColormap, "PrivateColormap"); + Lisp_Object value + = display_x_get_resource (dpyinfo, privateColormap, + PrivateColormap, Qnil, Qnil); if (STRINGP (value) && (!strcmp (SSDATA (value), "true") || !strcmp (SSDATA (value), "on"))) @@ -11142,9 +11143,10 @@ /* See if we should run in synchronous mode. This is useful for debugging X code. */ { - Lisp_Object value = display_x_get_resource - (dpyinfo, SCOPED_STRING ("synchronous"), - SCOPED_STRING ("Synchronous"), Qnil, Qnil); + AUTO_STRING (synchronous, "synchronous"); + AUTO_STRING (Synchronous, "Synchronous"); + Lisp_Object value = display_x_get_resource (dpyinfo, synchronous, + Synchronous, Qnil, Qnil); if (STRINGP (value) && (!strcmp (SSDATA (value), "true") || !strcmp (SSDATA (value), "on"))) @@ -11152,9 +11154,10 @@ } { - Lisp_Object value = display_x_get_resource - (dpyinfo, SCOPED_STRING ("useXIM"), - SCOPED_STRING ("UseXIM"), Qnil, Qnil); + AUTO_STRING (useXIM, "useXIM"); + AUTO_STRING (UseXIM, "UseXIM"); + Lisp_Object value = display_x_get_resource (dpyinfo, useXIM, UseXIM, + Qnil, Qnil); #ifdef USE_XIM if (STRINGP (value) && (!strcmp (SSDATA (value), "false") ------------------------------------------------------------ revno: 117993 committer: Paul Eggert branch nick: trunk timestamp: Tue 2014-09-30 19:25:40 -0700 message: * dispnew.c (adjust_decode_mode_spec_buffer): Prefer ptrdiff_t to ssize_t since we're not using ssize_t-related syscalls here. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-30 23:19:31 +0000 +++ src/ChangeLog 2014-10-01 02:25:40 +0000 @@ -1,3 +1,8 @@ +2014-10-01 Paul Eggert + + * dispnew.c (adjust_decode_mode_spec_buffer): Prefer ptrdiff_t + to ssize_t since we're not using ssize_t-related syscalls here. + 2014-09-30 Eli Zaretskii * w32fns.c (w32_createwindow): Accept an additional argument, an === modified file 'src/dispnew.c' --- src/dispnew.c 2014-09-30 23:19:31 +0000 +++ src/dispnew.c 2014-10-01 02:25:40 +0000 @@ -2137,7 +2137,7 @@ static void adjust_decode_mode_spec_buffer (struct frame *f) { - ssize_t frame_message_buf_size = FRAME_MESSAGE_BUF_SIZE (f); + ptrdiff_t frame_message_buf_size = FRAME_MESSAGE_BUF_SIZE (f); eassert (frame_message_buf_size >= 0); f->decode_mode_spec_buffer = xrealloc (f->decode_mode_spec_buffer, ------------------------------------------------------------ revno: 117992 [merge] committer: Stefan Monnier branch nick: trunk timestamp: Tue 2014-09-30 19:19:31 -0400 message: Merge from emacs-24 diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2014-09-30 05:49:54 +0000 +++ etc/ChangeLog 2014-09-30 23:19:31 +0000 @@ -1,3 +1,17 @@ +2014-09-30 Bill Wohler + + Release MH-E version 8.6 + + * NEWS, MH-E-NEWS: Update for MH-E release 8.6. + +2014-09-30 Fabrice Niessen + + * themes/leuven-theme.el: Updates. + +2014-09-30 Stefan Monnier + + * package-keyring.gpg: New file. + 2014-09-30 Paul Eggert * TODO: Remove char/unsigned char, long long, IRIX unexelf.c. === modified file 'etc/charsets/README' --- etc/charsets/README 2014-01-01 07:43:34 +0000 +++ etc/charsets/README 2014-09-27 09:36:08 +0000 @@ -38,5 +38,5 @@ (2) Source of mapping files All mapping files are generated automatically from data files freely -available on the Internet (e.g. glibc/localedata/charmaps"). See the +available on the Internet (e.g. glibc/localedata/charmaps). See the file ../../admin/charsets/mapfiles/README for the detail. === added file 'etc/package-keyring.gpg' Binary files etc/package-keyring.gpg 1970-01-01 00:00:00 +0000 and etc/package-keyring.gpg 2014-09-24 14:28:27 +0000 differ === modified file 'etc/themes/leuven-theme.el' --- etc/themes/leuven-theme.el 2014-01-16 20:18:55 +0000 +++ etc/themes/leuven-theme.el 2014-09-29 12:30:16 +0000 @@ -4,7 +4,7 @@ ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")> ;; URL: https://github.com/fniessen/emacs-leuven-theme -;; Version: 20140113.1205 +;; Version: 20140929.1232 ;; Keywords: color theme ;; This file is part of GNU Emacs. @@ -24,7 +24,7 @@ ;;; Commentary: -;; This Org-enhancing color theme "leuven" ROCKS! +;; This elegant Org-enhancing color theme "leuven" ROCKS! ;; ... and not just for Org mode. ;; ;; To use it, put the following in your Emacs configuration file: @@ -46,18 +46,26 @@ (cancel '(:slant italic :strike-through t :foreground "gray55")) (clock-line '(:box (:line-width 1 :color "#335EA8") :foreground "black" :background "#EEC900")) (code-block '(:foreground "#000088" :background "#FFFFE0")) - (code-inline '(:foreground "#007300" :background "#EBF5EB")) + (code-inline '(:foreground "#006400" :background "#FDFFF7")) (column '(:height 1.0 :weight normal :slant normal :underline nil :strike-through nil :foreground "#E6AD4F" :background "#FFF2DE")) (diff-added '(:foreground "#008000" :background "#DDFFDD")) + (diff-changed '(:foreground "#0000FF" :background "#DDDDFF")) + (diff-header '(:foreground "#800000" :background "#FFFFAF")) (diff-hunk-header '(:foreground "#990099" :background "#FFEEFF")) (diff-none '(:foreground "gray33")) (diff-removed '(:foreground "#A60000" :background "#FFDDDD")) (directory '(:weight bold :foreground "blue" :background "#FFFFD2")) - (highlight-line '(:background "#FEFCAE")) ; #F5F5F5 or #CCDEED - (link '(:underline t :foreground "#006DAF")) - (mail-header-name '(:weight bold :foreground "black")) + (highlight-line '(:background "#FFFFD7")) ; #F5F5F5 + (highlight-line-gnus '(:background "#DAEAFC")) ; defined in `gnus-leuven.el' + (link '(:weight normal :underline t :foreground "#006DAF")) + (mail-header-name '(:family "Sans Serif" :weight normal :foreground "#A3A3A2")) + (mail-header-other '(:family "Sans Serif" :slant normal :foreground "#666666")) + (mail-read '(:weight normal :foreground "#86878B")) + (mail-ticked '(:weight bold :background "#FBE6EF")) + (mail-to '(:family "Sans Serif" :underline nil :foreground "#006DAF")) + (mail-unread '(:weight bold :foreground "black")) (marked-line '(:weight bold :foreground "white" :background "red")) - (match '(:background "#FBE448")) + (match '(:weight bold :background "#FBE448")) ; occur patterns (ol1 '(:height 1.3 :weight bold :overline "#A7A7A7" :foreground "#3C3C3C" :background "#F0F0F0")) (ol2 '(:height 1.0 :weight bold :overline "#123555" :foreground "#123555" :background "#E5F4FB")) (ol3 '(:height 1.0 :weight bold :foreground "#005522" :background "#EFFFEF")) @@ -66,12 +74,14 @@ (ol6 '(:height 1.0 :weight bold :slant italic :foreground "#0077CC")) (ol7 '(:height 1.0 :weight bold :slant italic :foreground "#2EAE2C")) (ol8 '(:height 1.0 :weight bold :slant italic :foreground "#FD8008")) - (region '(:background "#ADD6FF")) ; #CCCCCC + (paren-matched '(:background "#99CCFF")) + (paren-unmatched '(:underline "red" :foreground nil :background "#FFDCDC")) + (region '(:background "#ABDFFA")) (shadow '(:foreground "#7F7F7F")) - (string '(:foreground "#036A07")) ; #D0372D or #23238E or #20590C - (subject '(:weight bold :foreground "#CF5D60")) + (string '(:foreground "#008000")) ; or #D0372D + (subject '(:family "Sans Serif" :weight bold :foreground "black")) (symlink '(:foreground "deep sky blue")) - (volatile-highlight '(:background "#FBE448")) + (volatile-highlight '(:underline nil :background "#FFF876")) (vc-branch '(:box (:line-width 1 :color "#00CC33") :foreground "black" :background "#AAFFAA"))) (custom-theme-set-faces @@ -84,19 +94,19 @@ `(cursor ((,class (:background "#0FB300")))) ;; Highlighting faces - `(fringe ((,class (:foreground "#F7A421" :background "#F2F2F2")))) + `(fringe ((,class (:foreground "#9B9B9B" :background "#EDEDED")))) `(highlight ((,class ,volatile-highlight))) `(region ((,class ,region))) `(secondary-selection ((,class ,match))) ; used by Org-mode for highlighting matched entries and keywords - `(isearch ((,class (:weight bold :foreground "#00AA00" :background "#99FF99")))) + `(isearch ((,class (:weight bold :underline "#FF9632" :foreground nil :background "#FDBD33")))) `(isearch-fail ((,class (:weight bold :foreground "black" :background "#FF9999")))) - `(lazy-highlight ((,class (:weight bold :foreground "#990099" :background "#FF66FF")))) - `(trailing-whitespace ((,class (:background "#F6EBFE")))) + `(lazy-highlight ((,class (:underline "#FF9632" :background "#FFFF00")))) ; isearch others + `(trailing-whitespace ((,class (:background "#FFFF57")))) `(whitespace-hspace ((,class (:foreground "#D2D2D2")))) - `(whitespace-indentation ((,class (:foreground "firebrick" :background "yellow")))) + `(whitespace-indentation ((,class (:foreground "#A1A1A1" :background "white")))) `(whitespace-line ((,class (:foreground "#CC0000" :background "#FFFF88")))) - `(whitespace-tab ((,class (:foreground "lightgray" :background "beige")))) - `(whitespace-trailing ((,class (:weight bold :foreground "yellow" :background "red1")))) + `(whitespace-tab ((,class (:foreground "#A1A1A1" :background "white")))) + `(whitespace-trailing ((,class (:foreground "#B3B3B3" :background "#FFFF57")))) ;; Mode line faces `(mode-line ((,class (:box (:line-width 1 :color "#1A2F54") :foreground "#85CEEB" :background "#335EA8")))) @@ -118,8 +128,8 @@ `(font-lock-comment-delimiter-face ((,class (:foreground "#8D8D84")))) ; #696969 `(font-lock-comment-face ((,class (:slant italic :foreground "#8D8D84")))) ; #696969 `(font-lock-constant-face ((,class (:foreground "#D0372D")))) - `(font-lock-doc-face ((,class (:foreground "#008000")))) - `(font-lock-doc-string-face ((,class (:foreground "#008000")))) + `(font-lock-doc-face ((,class (:foreground "#036A07")))) + ;; `(font-lock-doc-string-face ((,class (:foreground "#008000")))) ; XEmacs only, but is used for HTML exports from org2html (and not interactively) `(font-lock-function-name-face ((,class (:weight normal :foreground "#006699")))) `(font-lock-keyword-face ((,class (:bold nil :foreground "#0000FF")))) ; #3654DC `(font-lock-preprocessor-face ((,class (:foreground "#808080")))) @@ -131,12 +141,13 @@ `(font-lock-warning-face ((,class (:weight bold :foreground "red")))) ;; Button and link faces - `(link ((,class (:underline t :foreground "#8AC6F2")))) + `(link ((,class ,link))) `(link-visited ((,class (:underline t :foreground "#E5786D")))) `(button ((,class (:underline t :foreground "#006DAF")))) `(header-line ((,class (:weight bold :underline "black" :overline "black" :foreground "black" :background "#FFFF88")))) ;; Gnus faces + `(gnus-button ((,class (:weight normal)))) `(gnus-cite-attribution-face ((,class (:foreground "#5050B0")))) `(gnus-cite-face-1 ((,class (:foreground "#5050B0")))) `(gnus-cite-face-10 ((,class (:foreground "#990000")))) @@ -155,7 +166,7 @@ `(gnus-group-mail-2 ((,class (:weight bold :foreground "#FF0066")))) `(gnus-group-mail-2-empty ((,class (:foreground "#660066")))) `(gnus-group-mail-3 ((,class (:weight bold :foreground "black")))) - `(gnus-group-mail-3-empty ((,class (:foreground "#808080")))) + `(gnus-group-mail-3-empty ((,class ,mail-read))) `(gnus-group-mail-low ((,class ,cancel))) `(gnus-group-mail-low-empty ((,class ,cancel))) `(gnus-group-news-1 ((,class (:weight bold :foreground "#FF50B0")))) @@ -170,8 +181,8 @@ `(gnus-group-news-5-empty ((,class (:foreground "#000099")))) `(gnus-group-news-6 ((,class (:weight bold :foreground "gray50")))) `(gnus-group-news-6-empty ((,class (:foreground "#808080")))) - `(gnus-header-content ((,class (:family "Sans Serif" :foreground "#3399CC")))) - `(gnus-header-from ((,class (:family "Sans Serif" :foreground "blue")))) + `(gnus-header-content ((,class ,mail-header-other))) + `(gnus-header-from ((,class (:family "Sans Serif" :foreground "black")))) `(gnus-header-name ((,class ,mail-header-name))) `(gnus-header-newsgroups ((,class (:family "Sans Serif" :foreground "#3399CC")))) `(gnus-header-subject ((,class ,subject))) @@ -179,50 +190,51 @@ `(gnus-picon-xbm ((,class (:foreground "yellow" :background "white")))) `(gnus-server-closed ((,class (:slant italic :foreground "blue" :background "white")))) `(gnus-server-denied ((,class (:weight bold :foreground "red" :background "white")))) - `(gnus-server-opened ((,class (:foreground "white" :background "#83B869")))) - `(gnus-signature ((,class (:slant italic :foreground "#7F7F7F")))) + `(gnus-server-opened ((,class (:family "Sans Serif" :foreground "white" :foreground "#466BD7")))) + `(gnus-signature ((,class (:slant italic :foreground "#8B8D8E")))) `(gnus-splash ((,class (:foreground "#FF8C00")))) `(gnus-summary-cancelled ((,class ,cancel))) `(gnus-summary-high-ancient ((,class (:weight normal :foreground "#808080" :background "#FFFFE6")))) - `(gnus-summary-high-read ((,class (:weight normal :foreground "#808080" :background "#FFFFE6")))) - `(gnus-summary-high-ticked ((,class (:weight normal :foreground "black" :background "#E7AEB0")))) - `(gnus-summary-high-unread ((,class (:weight normal :foreground "black" :background "#FFFFCC")))) + `(gnus-summary-high-read ((,class (:weight normal :foreground "#999999" :background "#FFFFE6")))) + `(gnus-summary-high-ticked ((,class ,mail-ticked))) + `(gnus-summary-high-unread ((,class (:weight bold :foreground "black" :background "#FFFFCC")))) `(gnus-summary-low-ancient ((,class (:slant italic :foreground "gray55")))) - `(gnus-summary-low-read ((,class (:slant italic :foreground "gray55" :background "#E0E0E0")))) - `(gnus-summary-low-ticked ((,class (:slant italic :foreground "black" :background "#E7AEB0")))) + `(gnus-summary-low-read ((,class (:slant italic :foreground "#999999" :background "#E0E0E0")))) + `(gnus-summary-low-ticked ((,class ,mail-ticked))) `(gnus-summary-low-unread ((,class (:slant italic :foreground "black")))) - `(gnus-summary-normal-ancient ((,class (:foreground "#808080")))) - `(gnus-summary-normal-read ((,class (:foreground "#808080")))) - `(gnus-summary-normal-ticked ((,class (:foreground "black" :background "#E7AEB0")))) - `(gnus-summary-normal-unread ((,class (:foreground "black")))) - `(gnus-summary-selected ((,class (:underline t :foreground "black" :background "#FFD0D0")))) + `(gnus-summary-normal-ancient ((,class ,mail-read))) + `(gnus-summary-normal-read ((,class ,mail-read))) + `(gnus-summary-normal-ticked ((,class ,mail-ticked))) + `(gnus-summary-normal-unread ((,class ,mail-unread))) + `(gnus-summary-selected ((,class (:foreground "white" :background "#008CD7")))) `(gnus-x-face ((,class (:foreground "black" :background "white")))) ;; Message faces `(message-header-name ((,class ,mail-header-name))) - `(message-header-cc ((,class (:family "Sans Serif" :foreground "blue")))) - `(message-header-other ((,class (:family "Sans Serif" :foreground "#3399CC")))) + `(message-header-cc ((,class ,mail-to))) + `(message-header-other ((,class ,mail-header-other))) `(message-header-subject ((,class ,subject))) - `(message-header-to ((,class (:family "Sans Serif" :foreground "blue")))) + `(message-header-to ((,class ,mail-to))) `(message-cited-text ((,class (:foreground "#5050B0")))) - `(message-separator ((,class (:family "Sans Serif" :weight bold :foreground "red")))) + `(message-separator ((,class (:family "Sans Serif" :weight normal :foreground "#BDC2C6")))) `(message-header-newsgroups ((,class (:family "Sans Serif" :foreground "#3399CC")))) - `(message-header-xheader ((,class (:family "Sans Serif" :foreground "#3399CC")))) + `(message-header-xheader ((,class ,mail-header-other))) `(message-mml ((,class (:foreground "forest green")))) ;; Diff `(diff-added ((,class ,diff-added))) - `(diff-changed ((,class (:foreground "blue" :background "#DDDDFF")))) + `(diff-changed ((,class ,diff-changed))) `(diff-context ((,class ,diff-none))) - `(diff-file-header ((,class (:foreground "#0000CC" :background "#EAF2F5")))) + `(diff-file-header ((,class ,diff-header))) `(diff-file1-hunk-header ((,class (:foreground "dark magenta" :background "#EAF2F5")))) `(diff-file2-hunk-header ((,class (:foreground "#2B7E2A" :background "#EAF2F5")))) - `(diff-header ((,class (:foreground "#999999" :background "#EAF2F5")))) + `(diff-function ((,class (:foreground "darkgray")))) + `(diff-header ((,class ,diff-header))) `(diff-hunk-header ((,class ,diff-hunk-header))) - `(diff-index ((,class (:foreground "#4183C4" :background "#EAF2F5")))) ; my foreground is NOT applied!? - `(diff-indicator-added ((,class (:foreground "#008000" :background "#AAFFAA")))) - `(diff-indicator-changed ((,class (:foreground "black" :background "#AAAAFF")))) - `(diff-indicator-removed ((,class (:foreground "#A60000" :background "#FFAAAA")))) + `(diff-index ((,class ,diff-header))) + `(diff-indicator-added ((,class (:background "#AAFFAA")))) + `(diff-indicator-changed ((,class (:background "#8080FF")))) + `(diff-indicator-removed ((,class (:background "#FFBBBB")))) `(diff-refine-change ((,class (:background "#DDDDFF")))) `(diff-removed ((,class ,diff-removed))) @@ -241,8 +253,11 @@ `(ediff-odd-diff-B ((,class (:foreground "black" :background "light grey")))) ;; Flyspell +;; (when (version< emacs-version "24.XXX") `(flyspell-duplicate ((,class (:underline "#008000" :inherit nil)))) `(flyspell-incorrect ((,class (:underline "red" :inherit nil)))) +;; `(flyspell-duplicate ((,class (:underline (:style wave :color "#008000") :inherit nil)))) +;; `(flyspell-incorrect ((,class (:underline (:style wave :color "red") :inherit nil)))) ;; ;; Semantic faces ;; `(semantic-decoration-on-includes ((,class (:underline ,cham-4)))) @@ -257,13 +272,19 @@ `(Info-title-2-face ((,class ,ol2))) `(Info-title-3-face ((,class ,ol3))) `(Info-title-4-face ((,class ,ol4))) + `(ac-completion-face ((,class (:underline nil :foreground "#C0C0C0")))) ; like Google `(ace-jump-face-foreground ((,class (:foreground "black" :background "#FBE448")))) + `(auto-dim-other-buffers-face ((,class (:background "#F7F7F7")))) `(bbdb-company ((,class (:slant italic :foreground "steel blue")))) `(bbdb-field-name ((,class (:weight bold :foreground "steel blue")))) `(bbdb-field-value ((,class (:foreground "steel blue")))) `(bbdb-name ((,class (:underline t :foreground "#FF6633")))) + `(bmkp-light-autonamed ((,class (:background "#C2DDFD")))) + `(bmkp-light-fringe-autonamed ((,class (:background "#90AFD5")))) + `(bmkp-light-fringe-non-autonamed ((,class (:background "#D5FFD5")))) + `(bmkp-light-non-autonamed ((,class (:background "#C4FFC4")))) `(browse-kill-ring-separator-face ((,class (:weight bold :foreground "slate gray")))) - `(calendar-today ((,class (:weight bold :foreground "#4F4A3D" :background "#FFFABE")))) + `(calendar-today ((,class (:weight bold :foreground "#4F4A3D" :background "#FFFFCC")))) `(cfw:face-annotation ((,class (:foreground "green" :background "red")))) `(cfw:face-day-title ((,class (:foreground "#C9C9C9")))) `(cfw:face-default-content ((,class (:foreground "#2952A3")))) @@ -277,8 +298,8 @@ `(cfw:face-select ((,class (:foreground "#4A95EB" :background "#EDF1FA")))) `(cfw:face-sunday ((,class (:foreground "#4E4E4E" :background "white" :weight bold)))) `(cfw:face-title ((,class (:height 2.0 :foreground "#676767" :weight bold :inherit variable-pitch)))) - `(cfw:face-today ((,class (:foreground "#4F4A3D" :background "#FFFABE")))) - `(cfw:face-today-title ((,class (:foreground "#4A95EB" :background "#FFFABE")))) + `(cfw:face-today ((,class (:foreground "#4F4A3D" :background "#FFFFCC")))) + `(cfw:face-today-title ((,class (:foreground "#4A95EB" :background "#FFFFCC")))) `(cfw:face-toolbar ((,class (:background "white")))) `(cfw:face-toolbar-button-off ((,class (:foreground "#CFCFCF" :background "white")))) `(cfw:face-toolbar-button-on ((,class (:foreground "#5E5E5E" :background "#F6F6F6")))) @@ -290,8 +311,13 @@ `(circe-originator-face ((,class (:foreground "blue")))) `(circe-prompt-face ((,class (:foreground "red")))) `(circe-server-face ((,class (:foreground "#99CAE5")))) - `(comint-highlight-input ((,class (:weight bold :foreground "#0000FF")))) - `(comint-highlight-prompt ((,class (:weight bold :foreground "black" :background "gold")))) + `(comint-highlight-input ((,class (:weight bold :foreground "#0000FF" :inherit nil)))) + ;; `(comint-highlight-prompt ((,class (:weight bold :foreground "black" :background "gold")))) + `(comint-highlight-prompt ((,class (:weight bold :foreground "#0000FF" :inherit nil)))) + `(company-preview-common ((,class (:foreground "#C0C0C0" :background "#FFFFD7")))) ; same background as highlight-line + `(company-tooltip-annotation ((,class (:foreground "#999999" :background "cornsilk")))) + `(company-tooltip-common ((,class (:weight bold :inherit company-tooltip)))) + `(company-tooltip-common-selection ((,class (:weight bold :inherit company-tooltip-selection)))) `(compare-windows ((,class (:background "#FFFF00")))) `(compilation-error ((,class (:weight bold :foreground "red")))) `(compilation-info ((,class (:weight bold :foreground "#2A489E")))) ; used for grep @@ -322,25 +348,31 @@ `(custom-variable-button ((,class (:weight bold :underline t)))) `(custom-variable-tag ((,class (:family "Sans Serif" :height 1.2 :weight bold :foreground "blue1")))) `(custom-visibility ((,class ,link))) + `(diff-hl-change ((,class (:foreground "blue3" :inherit diff-changed)))) + `(diff-hl-delete ((,class (:foreground "red3" :inherit diff-removed)))) + `(diff-hl-dired-change ((,class (:background "#FFA335" :foreground "black" :weight bold)))) + `(diff-hl-dired-unknown ((,class (:foreground "white" :background "#3F3BB4")))) + `(diff-hl-insert ((,class (:foreground "green4" :inherit diff-added)))) + `(diff-hl-unknown ((,class (:foreground "white" :background "#3F3BB4")))) `(diary-face ((,class (:foreground "#87C9FC")))) `(dircolors-face-asm ((,class (:foreground "black")))) `(dircolors-face-backup ((,class (:foreground "black")))) `(dircolors-face-compress ((,class (:foreground "red")))) `(dircolors-face-dir ((,class ,directory))) `(dircolors-face-doc ((,class (:foreground "black")))) - `(dircolors-face-dos ((,class (:foreground "green3")))) + `(dircolors-face-dos ((,class (:foreground "ForestGreen")))) `(dircolors-face-emacs ((,class (:foreground "black")))) - `(dircolors-face-exec ((,class (:foreground "green3")))) + `(dircolors-face-exec ((,class (:foreground "ForestGreen")))) `(dircolors-face-html ((,class (:foreground "black")))) - `(dircolors-face-img ((,class (:foreground "black")))) + `(dircolors-face-img ((,class (:foreground "magenta3")))) `(dircolors-face-lang ((,class (:foreground "black")))) `(dircolors-face-lang-interface ((,class (:foreground "black")))) `(dircolors-face-make ((,class (:foreground "black")))) `(dircolors-face-objet ((,class (:foreground "black")))) - `(dircolors-face-package ((,class (:foreground "red")))) + `(dircolors-face-package ((,class (:foreground "black")))) `(dircolors-face-paddb ((,class (:foreground "black")))) `(dircolors-face-ps ((,class (:foreground "black")))) - `(dircolors-face-sound ((,class (:foreground "black")))) + `(dircolors-face-sound ((,class (:foreground "DeepSkyBlue")))) `(dircolors-face-tar ((,class (:foreground "red")))) `(dircolors-face-text ((,class (:foreground "black")))) `(dircolors-face-yacc ((,class (:foreground "black")))) @@ -355,9 +387,9 @@ `(diredp-dir-heading ((,class ,directory))) `(diredp-dir-priv ((,class ,directory))) `(diredp-exec-priv ((,class (:background "#03C03C")))) - `(diredp-executable-tag ((,class (:foreground "green3" :background "white")))) + `(diredp-executable-tag ((,class (:foreground "ForestGreen" :background "white")))) `(diredp-file-name ((,class (:foreground "black")))) - `(diredp-file-suffix ((,class (:foreground "#008000")))) + `(diredp-file-suffix ((,class (:foreground "#C0C0C0")))) `(diredp-flag-mark-line ((,class ,marked-line))) `(diredp-ignored-file-name ((,class ,shadow))) `(diredp-read-priv ((,class (:background "#0A99FF")))) @@ -389,14 +421,18 @@ `(helm-ff-symlink ((,class ,symlink))) `(helm-file-name ((,class (:foreground "blue")))) `(helm-gentoo-match-face ((,class (:foreground "red")))) + `(helm-grep-match ((,class ,match))) `(helm-grep-running ((,class (:weight bold :foreground "white")))) `(helm-grep-lineno ((,class ,shadow))) `(helm-isearch-match ((,class (:background "#CCFFCC")))) `(helm-match ((,class ,match))) `(helm-moccur-buffer ((,class (:foreground "#0066CC")))) - `(helm-selection ((,class ,highlight-line))) + `(helm-selection ((,class ,volatile-highlight))) `(helm-selection-line ((,class ,volatile-highlight))) `(helm-source-header ((,class (:family "Sans Serif" :height 1.3 :weight bold :foreground "white" :background "#2F69BF")))) + `(helm-swoop-target-line-face ((,class ,volatile-highlight))) + `(helm-swoop-target-line-block-face ((,class (:background "#CCCC00" :foreground "#222222")))) + `(helm-swoop-target-word-face ((,class (:weight bold :foreground nil :background "#FDBD33")))) `(helm-visible-mark ((,class ,marked-line))) `(helm-w3m-bookmarks-face ((,class (:underline t :foreground "cyan1")))) `(highlight-symbol-face ((,class (:background "#FFFFA0")))) @@ -424,7 +460,7 @@ `(info-xref ((,class (:underline t :foreground "#006DAF")))) ; unvisited cross-references `(info-xref-visited ((,class (:underline t :foreground "magenta4")))) ; previously visited cross-references `(light-symbol-face ((,class (:background "#FFFFA0")))) - `(linum ((,class (:foreground "#AFAFAF" :background "white")))) + `(linum ((,class (:foreground "#9A9A9A" :background "#EDEDED")))) `(log-view-file ((,class (:foreground "#0000CC" :background "#EAF2F5")))) `(lui-button-face ((,class ,link))) `(lui-highlight-face ((,class (:box '(:line-width 1 :color "#CC0000") :foreground "#CC0000" :background "#FFFF88")))) ; my nickname @@ -440,7 +476,7 @@ `(magit-item-mark ((,class ,marked-line))) `(magit-log-head-label ((,class (:box (:line-width 1 :color "blue" :style nil))))) `(magit-log-tag-label ((,class (:box (:line-width 1 :color "#00CC00" :style nil))))) - `(magit-section-title ((,class (:family "Sans Serif" :height 1.8 :weight bold :foreground "cornflower blue")))) + `(magit-section-title ((,class (:family "Sans Serif" :height 1.8 :weight bold :foreground "cornflower blue" :inherit nil)))) `(makefile-space-face ((,class (:background "hot pink")))) `(makefile-targets ((,class (:weight bold :foreground "blue")))) `(match ((,class ,match))) @@ -459,23 +495,22 @@ `(nxml-processing-instruction-target-face ((,class (:foreground "purple1")))) `(nxml-tag-delimiter-face ((,class (:foreground "blue")))) `(nxml-tag-slash-face ((,class (:foreground "blue")))) - `(org-agenda-block-count ((,class (:weight bold :foreground "blue")))) + `(org-agenda-block-count ((,class (:weight bold :foreground "#A5A5A5")))) `(org-agenda-calendar-event ((,class (:weight bold :foreground "#3774CC" :background "#A8C5EF")))) `(org-agenda-calendar-sexp ((,class (:foreground "#777777" :background "#E4EBFE")))) - `(org-agenda-clocking ((,class ,clock-line))) + `(org-agenda-clocking ((,class (:foreground "black" :background "#EEC900")))) `(org-agenda-column-dateline ((,class ,column))) `(org-agenda-current-time ((,class (:underline t :foreground "#1662AF")))) `(org-agenda-date ((,class (:height 1.6 :weight bold :foreground "#1662AF")))) - `(org-agenda-date-today ((,class (:height 1.6 :weight bold :foreground "#4F4A3D" :background "#FFFABE")))) + `(org-agenda-date-today ((,class (:height 1.6 :weight bold :foreground "#4F4A3D" :background "#FFFFCC")))) `(org-agenda-date-weekend ((,class (:height 1.6 :weight bold :foreground "#4E4E4E")))) `(org-agenda-diary ((,class (:weight bold :foreground "green4" :background "light blue")))) `(org-agenda-dimmed-todo-face ((,class (:foreground "gold2")))) - `(org-agenda-done ((,class (:foreground "#555555" :background "#EEEEEE")))) + `(org-agenda-done ((,class (:foreground "#555555")))) `(org-agenda-filter-category ((,class (:weight bold :foreground "orange")))) `(org-agenda-filter-tags ((,class (:weight bold :foreground "orange")))) `(org-agenda-restriction-lock ((,class (:background "#E77D63")))) - ;; `(org-agenda-structure ((,class (:height 1.6 :weight bold :box (:line-width 1 :color "#999999") :foreground "#666666" :background "#CCCCCC")))) - `(org-agenda-structure ((,class (:height 1.6 :bold nil :foreground "#999999")))) + `(org-agenda-structure ((,class (:height 1.6 :weight bold :foreground "#1F8DD6")))) `(org-archived ((,class (:foreground "gray70")))) `(org-beamer-tag ((,class (:box (:line-width 1 :color "#FABC18") :foreground "#2C2C2C" :background "#FFF8D0")))) `(org-block ((,class ,code-block))) @@ -488,7 +523,7 @@ `(org-column ((,class ,column))) `(org-column-title ((,class ,column))) `(org-date ((,class (:underline t :foreground "#00459E")))) - `(org-default ((,class (:foreground "#333333")))) + `(org-default ((,class (:foreground "#333333" :background "#FFFFFF")))) `(org-dim ((,class (:foreground "#AAAAAA")))) `(org-document-info ((,class (:foreground "#484848")))) `(org-document-info-keyword ((,class (:foreground "#008ED1" :background "#EAEAFF")))) @@ -499,10 +534,10 @@ `(org-example ((,class (:foreground "blue" :background "#EAFFEA")))) `(org-footnote ((,class (:underline t :foreground "#008ED1")))) `(org-formula ((,class (:foreground "chocolate1")))) - `(org-headline-done ((,class (:height 1.0 :weight normal :foreground "#999999")))) + `(org-headline-done ((,class (:height 1.0 :weight normal :strike-through t :foreground "#ADADAD")))) `(org-hide ((,class (:foreground "#E2E2E2")))) `(org-inlinetask ((,class (:box (:line-width 1 :color "#EBEBEB") :foreground "#777777" :background "#FFFFD6")))) - `(org-latex-and-related ((,class ,code-block))) + `(org-latex-and-related ((,class (:foreground "#336699" :background "white")))) `(org-level-1 ((,class ,ol1))) `(org-level-2 ((,class ,ol2))) `(org-level-3 ((,class ,ol3))) @@ -513,6 +548,7 @@ `(org-level-8 ((,class ,ol8))) `(org-link ((,class ,link))) `(org-list-dt ((,class (:weight bold :foreground "#335EA8")))) + `(org-macro ((,class (:foreground "white" :background "#EDB802")))) `(org-meta-line ((,class (:slant normal :foreground "#008ED1" :background "#EAEAFF")))) `(org-mode-line-clock ((,class ,clock-line))) `(org-mode-line-clock-overrun ((,class (:weight bold :box (:line-width 1 :color "#335EA8") :foreground "white" :background "#FF4040")))) @@ -520,12 +556,12 @@ `(org-property-value ((,class (:foreground "#00A000")))) `(org-quote ((,class (:slant italic :foreground "dim gray" :background "#FFFFE0")))) `(org-scheduled ((,class (:foreground "#333333")))) - `(org-scheduled-previously ((,class (:weight bold :foreground "#373737")))) - `(org-scheduled-today ((,class (:foreground "#4F4A3D" :background "#FFFABE")))) + `(org-scheduled-previously ((,class (:foreground "#F22659")))) + `(org-scheduled-today ((,class (:weight bold :foreground "#4F4A3D" :background "#FFFFCC")))) `(org-sexp-date ((,class (:foreground "#3774CC")))) `(org-special-keyword ((,class (:weight bold :foreground "#00BB00" :background "#EAFFEA")))) `(org-table ((,class (:foreground "dark green" :background "#EAFFEA")))) - `(org-tag ((,class (:weight normal :slant italic :foreground "#9A9FA4" :background "#F3F3F3")))) + `(org-tag ((,class (:weight normal :slant italic :foreground "#9A9FA4" :background "white")))) `(org-target ((,class ,link))) `(org-time-grid ((,class (:foreground "#CFCFCF")))) `(org-todo ((,class (:weight bold :box (:line-width 1 :color "#D8ABA7") :foreground "#D8ABA7" :background "#FFE6E4")))) @@ -544,9 +580,25 @@ `(pabbrev-debug-display-label-face ((,class (:background "chartreuse")))) `(pabbrev-suggestions-face ((,class (:weight bold :foreground "white" :background "red")))) `(pabbrev-suggestions-label-face ((,class (:weight bold :foreground "white" :background "purple")))) - `(paren-face-match ((,class (:foreground "#E2464C" :background "#FFE182")))) - `(paren-face-mismatch ((,class (:weight bold :foreground "white" :background "#FF3F3F")))) - `(paren-face-no-match ((,class (:weight bold :foreground "white" :background "#FF3F3F")))) + `(paren-face-match ((,class ,paren-matched))) + `(paren-face-mismatch ((,class ,paren-unmatched))) + `(paren-face-no-match ((,class ,paren-unmatched))) + `(persp-selected-face ((,class (:weight bold :foreground "#EEF5FE")))) + `(powerline-active1 ((,class (:background "grey22" :inherit mode-line)))) + `(powerline-active2 ((,class (:background "#4070B6" :inherit mode-line)))) + `(powerline-inactive1 ((,class (:background "#686868" :inherit mode-line-inactive)))) + `(powerline-inactive2 ((,class (:background "#A9A9A9" :inherit mode-line-inactive)))) + `(rainbow-delimiters-depth-1-face ((,class (:foreground "#707183")))) + `(rainbow-delimiters-depth-2-face ((,class (:foreground "#7388D6")))) + `(rainbow-delimiters-depth-3-face ((,class (:foreground "#909183")))) + `(rainbow-delimiters-depth-4-face ((,class (:foreground "#709870")))) + `(rainbow-delimiters-depth-5-face ((,class (:foreground "#907373")))) + `(rainbow-delimiters-depth-6-face ((,class (:foreground "#6276BA")))) + `(rainbow-delimiters-depth-7-face ((,class (:foreground "#858580")))) + `(rainbow-delimiters-depth-8-face ((,class (:foreground "#80A880")))) + `(rainbow-delimiters-depth-9-face ((,class (:foreground "#887070")))) + `(rainbow-delimiters-mismatched-face ((,class ,paren-unmatched))) + `(rainbow-delimiters-unmatched-face ((,class ,paren-unmatched))) `(recover-this-file ((,class (:weight bold :background "#FF3F3F")))) `(rng-error ((,class (:weight bold :foreground "red" :background "#FBE3E4")))) `(sh-heredoc ((,class (:foreground "blue" :background "#EEF5FE")))) @@ -556,9 +608,9 @@ `(shell-output-2-face ((,class (:foreground "blue")))) `(shell-output-3-face ((,class (:foreground "purple")))) `(shell-output-face ((,class (:foreground "black")))) - `(shell-prompt-face ((,class (:weight bold :foreground "yellow")))) - `(show-paren-match ((,class (:foreground "#E2464C" :background "#FFFF00")))) - `(show-paren-mismatch ((,class (:weight bold :foreground "white" :background "#FF3F3F")))) + ;; `(shell-prompt-face ((,class (:weight bold :foreground "yellow")))) + `(show-paren-match ((,class ,paren-matched))) + `(show-paren-mismatch ((,class ,paren-unmatched))) `(sml-modeline-end-face ((,class (:background "#6BADF6")))) ; #335EA8 `(sml-modeline-vis-face ((,class (:background "#1979CA")))) `(speedbar-button-face ((,class (:foreground "green4")))) @@ -625,10 +677,13 @@ `(yas/field-highlight-face ((,class (:background "DarkSeaGreen1")))) )) -(custom-theme-set-variables - 'leuven - '(ansi-color-names-vector ["#242424" "#E5786D" "#95E454" "#CAE682" - "#8AC6F2" "#333366" "#CCAA8F" "#F6F3E8"])) +(custom-theme-set-variables 'leuven + '(ansi-color-faces-vector + [default default default italic underline success warning error]) + '(ansi-color-names-vector + ["black" "red3" "ForestGreen" "yellow3" "blue" "magenta3" "DeepSkyBlue" "gray50"]) + ; colors used in Shell mode + ) ;;;###autoload (when (and (boundp 'custom-theme-load-path) === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-30 17:52:11 +0000 +++ lisp/ChangeLog 2014-09-30 23:19:31 +0000 @@ -1,3 +1,15 @@ +2014-09-30 Leonardo Nobrega (tiny change) + + * progmodes/python.el (python-fill-paren): Don't inf-loop at EOB + (bug#18462). + +2014-09-30 Stefan Monnier + + * emacs-lisp/package.el (package-check-signature): Default to nil if + GPG is not available. + (package-refresh-contents): Don't mess with the keyring if we won't + check the signatures anyway. + 2014-09-30 Stefan Monnier * ses.el (ses--row, ses--col): New dyn-scoped vars, to replace row&col. === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2014-09-03 04:21:40 +0000 +++ lisp/emacs-lisp/package.el 2014-09-30 23:19:31 +0000 @@ -289,7 +289,9 @@ :group 'package :version "24.1") -(defcustom package-check-signature 'allow-unsigned +(defcustom package-check-signature + (if (progn (require 'epg-config) (executable-find epg-gpg-program)) + 'allow-unsigned) "Non-nil means to check package signatures when installing. The value `allow-unsigned' means to still install a package even if it is unsigned. @@ -1314,12 +1316,12 @@ (make-directory package-user-dir t)) (let ((default-keyring (expand-file-name "package-keyring.gpg" data-directory))) - (if (file-exists-p default-keyring) - (condition-case-unless-debug error - (progn - (epg-check-configuration (epg-configuration)) - (package-import-keyring default-keyring)) - (error (message "Cannot import default keyring: %S" (cdr error)))))) + (when (and package-check-signature (file-exists-p default-keyring)) + (condition-case-unless-debug error + (progn + (epg-check-configuration (epg-configuration)) + (package-import-keyring default-keyring)) + (error (message "Cannot import default keyring: %S" (cdr error)))))) (dolist (archive package-archives) (condition-case-unless-debug nil (package--download-one-archive archive "archive-contents") === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2014-09-26 13:05:28 +0000 +++ lisp/erc/ChangeLog 2014-09-30 23:19:31 +0000 @@ -1,3 +1,11 @@ +2014-09-30 Stefan Monnier + + * erc-track.el (erc-modified-channels-display): Update all mode lines + if needed (bug#18510). Remove call to erc-modified-channels-object + where we ignored the return value. + (erc-modified-channels-update): Don't force-mode-line-update here + any more. + 2014-09-26 Kelvin White * erc.el (erc-format-nick): Fix code regression - Bug #18551 @@ -12,7 +20,7 @@ (erc-cmd-SV, erc-ctcp-query-VERSION, erc-version, erc-version-string): Change version string. -2014-08-13 Kelvin White +2014-08-13 Kelvin White * erc.el (erc-send-input): Disable display commands in current buffer (erc-format-target-and/or-network): Fix cases when buffer name is set === modified file 'lisp/erc/erc-track.el' --- lisp/erc/erc-track.el 2014-02-10 01:34:22 +0000 +++ lisp/erc/erc-track.el 2014-09-24 17:31:59 +0000 @@ -767,8 +767,7 @@ (erc-modified-channels-remove-buffer buffer)))) erc-modified-channels-alist) (when removed-channel - (erc-modified-channels-display) - (force-mode-line-update t))) + (erc-modified-channels-display))) (remove-hook 'post-command-hook 'erc-modified-channels-update))) (defvar erc-track-mouse-face (if (featurep 'xemacs) @@ -825,43 +824,45 @@ ((eq 'importance erc-track-switch-direction) (erc-track-sort-by-importance))) (run-hooks 'erc-track-list-changed-hook) - (unless (eq erc-track-position-in-mode-line nil) - (if (null erc-modified-channels-alist) - (setq erc-modified-channels-object (erc-modified-channels-object nil)) - ;; erc-modified-channels-alist contains all the data we need. To - ;; better understand what is going on, we split things up into - ;; four lists: BUFFERS, COUNTS, SHORT-NAMES, and FACES. These - ;; four lists we use to create a new - ;; `erc-modified-channels-object' using - ;; `erc-make-mode-line-buffer-name'. - (let* ((buffers (mapcar 'car erc-modified-channels-alist)) - (counts (mapcar 'cadr erc-modified-channels-alist)) - (faces (mapcar 'cddr erc-modified-channels-alist)) - (long-names (mapcar #'(lambda (buf) - (or (buffer-name buf) - "")) - buffers)) - (short-names (if (functionp erc-track-shorten-function) - (funcall erc-track-shorten-function - long-names) - long-names)) - strings) - (while buffers - (when (car short-names) - (setq strings (cons (erc-make-mode-line-buffer-name - (car short-names) - (car buffers) - (car faces) - (car counts)) - strings))) - (setq short-names (cdr short-names) - buffers (cdr buffers) - counts (cdr counts) - faces (cdr faces))) - (when (featurep 'xemacs) - (erc-modified-channels-object nil)) - (setq erc-modified-channels-object - (erc-modified-channels-object strings)))))) + (when erc-track-position-in-mode-line + (let* ((oldobject erc-modified-channels-object) + (strings + (when erc-modified-channels-alist + ;; erc-modified-channels-alist contains all the data we need. To + ;; better understand what is going on, we split things up into + ;; four lists: BUFFERS, COUNTS, SHORT-NAMES, and FACES. These + ;; four lists we use to create a new + ;; `erc-modified-channels-object' using + ;; `erc-make-mode-line-buffer-name'. + (let* ((buffers (mapcar 'car erc-modified-channels-alist)) + (counts (mapcar 'cadr erc-modified-channels-alist)) + (faces (mapcar 'cddr erc-modified-channels-alist)) + (long-names (mapcar #'(lambda (buf) + (or (buffer-name buf) + "")) + buffers)) + (short-names (if (functionp erc-track-shorten-function) + (funcall erc-track-shorten-function + long-names) + long-names)) + strings) + (while buffers + (when (car short-names) + (setq strings (cons (erc-make-mode-line-buffer-name + (car short-names) + (car buffers) + (car faces) + (car counts)) + strings))) + (setq short-names (cdr short-names) + buffers (cdr buffers) + counts (cdr counts) + faces (cdr faces))) + strings))) + (newobject (erc-modified-channels-object strings))) + (unless (equal oldobject newobject) + (setq erc-modified-channels-object newobject) + (force-mode-line-update t))))) (defun erc-modified-channels-remove-buffer (buffer) "Remove BUFFER from `erc-modified-channels-alist'." === modified file 'lisp/mh-e/ChangeLog' --- lisp/mh-e/ChangeLog 2014-09-30 05:06:42 +0000 +++ lisp/mh-e/ChangeLog 2014-09-30 23:19:31 +0000 @@ -9,8 +9,8 @@ * mh-comp.el (mh-insert-x-face): Ensure that mh-x-face-file is a string before trying to use it (closes SF #474). (mh-bare-components): New function to create a temporary initial - components file; replaces mh-find-components. Improve the temp - folder and file names as per a suggestion from Bill Wohler. Also + components file; replaces mh-find-components. Improve the temp + folder and file names as per a suggestion from Bill Wohler. Also address XEmacs compatibility issues: use mm-make-temp-file instead of make-temp-file, and only pass one argument to delete-directory. (mh-edit-again, mh-send-sub): Use mh-bare-components instead of === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2014-09-29 18:14:08 +0000 +++ lisp/progmodes/python.el 2014-09-30 23:19:31 +0000 @@ -3300,7 +3300,8 @@ (end-of-line) (when (not (python-syntax-context 'paren)) (skip-syntax-backward "^)"))) - (while (python-syntax-context 'paren) + (while (and (python-syntax-context 'paren) + (not (eobp))) (goto-char (1+ (point-marker)))) (point-marker))) (let ((paragraph-start "\f\\|[ \t]*$") @@ -3311,7 +3312,8 @@ (while (not (eobp)) (forward-line 1) (python-indent-line) - (goto-char (line-end-position)))) t) + (goto-char (line-end-position)))) + t) ;;; Skeletons === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-30 20:17:36 +0000 +++ src/ChangeLog 2014-09-30 23:19:31 +0000 @@ -1,3 +1,43 @@ +2014-09-30 Eli Zaretskii + + * w32fns.c (w32_createwindow): Accept an additional argument, an + array of 2 values specifying the coordinates of the frame's + top-left corner. Use these values instead of calling x_get_arg, + which can cons Lisp objects, and therefore cannot be called except + from the main thread. Remove redundant tests for the default + values. + (my_create_window): Move the calculation of the coordinates of the + frame's top-left edge here. Pass them to the input thread via the + second parameter of the WM_EMACS_CREATEWINDOW message. See + http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00892.html + for the details. + +2014-09-30 Eli Zaretskii + + * xdisp.c (cursor_row_fully_visible_p): Update commentary. + (redisplay_window): Treat the frame's frozen_window_starts flag + the same way as the optional_new_start flag for the window: only + obey it if the glyph row showing point will be fully visible. + Likewise when the window start is in a continuation line. If, + after trying everything under the 'force_start' label, point is + still not fully visible, give up and scroll the window. Add + debugging traces. (Bug#18545) + + * window.c (Frecenter): Set the window's redisplay flag. + +2014-09-30 Eli Zaretskii + + * w32term.c (w32_read_socket): Don't use frame dimensions for + resizing if GetClientRect returned an empty (0, 0, 0, 0) + rectangle. Check the return value of GetClientRect, and don't use + the results if it didn't succeed. + + * dispnew.c (change_frame_size_1): Recompute the frame dimensions + in columns and lines after correcting the pixel dimensions in + check_frame_size. + (adjust_decode_mode_spec_buffer): Add assertion to avoid passing + negative values to xrealloc. (Bug#18528) + 2014-09-30 Paul Eggert * alloc.c: Remove now-unnecessary check. === modified file 'src/dispnew.c' --- src/dispnew.c 2014-09-18 11:34:24 +0000 +++ src/dispnew.c 2014-09-30 23:19:31 +0000 @@ -2137,8 +2137,11 @@ static void adjust_decode_mode_spec_buffer (struct frame *f) { + ssize_t frame_message_buf_size = FRAME_MESSAGE_BUF_SIZE (f); + + eassert (frame_message_buf_size >= 0); f->decode_mode_spec_buffer = xrealloc (f->decode_mode_spec_buffer, - FRAME_MESSAGE_BUF_SIZE (f) + 1); + frame_message_buf_size + 1); } === modified file 'src/w32fns.c' --- src/w32fns.c 2014-09-25 09:34:53 +0000 +++ src/w32fns.c 2014-09-30 23:19:31 +0000 @@ -1956,13 +1956,12 @@ } static void -w32_createwindow (struct frame *f) +w32_createwindow (struct frame *f, int *coords) { HWND hwnd; RECT rect; - Lisp_Object top = Qunbound; - Lisp_Object left = Qunbound; - struct w32_display_info *dpyinfo = &one_w32_display_info; + int top; + int left; rect.left = rect.top = 0; rect.right = FRAME_PIXEL_WIDTH (f); @@ -1977,25 +1976,21 @@ if (f->size_hint_flags & USPosition || f->size_hint_flags & PPosition) { - XSETINT (left, f->left_pos); - XSETINT (top, f->top_pos); + left = f->left_pos; + top = f->top_pos; } - else if (EQ (left, Qunbound) && EQ (top, Qunbound)) + else { - /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero - for anything that is not a number and is not Qunbound. */ - left = x_get_arg (dpyinfo, Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); - top = x_get_arg (dpyinfo, Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); + left = coords[0]; + top = coords[1]; } FRAME_W32_WINDOW (f) = hwnd = CreateWindow (EMACS_CLASS, f->namebuf, f->output_data.w32->dwStyle | WS_CLIPCHILDREN, - EQ (left, Qunbound) ? CW_USEDEFAULT : XINT (left), - EQ (top, Qunbound) ? CW_USEDEFAULT : XINT (top), - rect.right - rect.left, - rect.bottom - rect.top, + left, top, + rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, hinst, @@ -2516,7 +2511,8 @@ the patch for XP is not publicly available until XP SP3, and older versions will never be patched. */ CoInitialize (NULL); - w32_createwindow ((struct frame *) msg.wParam); + w32_createwindow ((struct frame *) msg.wParam, + (int *) msg.lParam); if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0)) emacs_abort (); break; @@ -4136,8 +4132,25 @@ my_create_window (struct frame * f) { MSG msg; - - if (!PostThreadMessage (dwWindowsThreadId, WM_EMACS_CREATEWINDOW, (WPARAM)f, 0)) + static int coords[2]; + Lisp_Object left, top; + struct w32_display_info *dpyinfo = &one_w32_display_info; + + /* When called with RES_TYPE_NUMBER, x_get_arg will return zero for + anything that is not a number and is not Qunbound. */ + left = x_get_arg (dpyinfo, Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); + top = x_get_arg (dpyinfo, Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); + if (EQ (left, Qunbound)) + coords[0] = CW_USEDEFAULT; + else + coords[0] = XINT (left); + if (EQ (top, Qunbound)) + coords[1] = CW_USEDEFAULT; + else + coords[1] = XINT (top); + + if (!PostThreadMessage (dwWindowsThreadId, WM_EMACS_CREATEWINDOW, + (WPARAM)f, (LPARAM)coords)) emacs_abort (); GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); } === modified file 'src/w32term.c' --- src/w32term.c 2014-09-24 10:06:53 +0000 +++ src/w32term.c 2014-09-30 23:19:31 +0000 @@ -5144,30 +5144,38 @@ RECT rect; int rows, columns, width, height, text_width, text_height; - GetClientRect (msg.msg.hwnd, &rect); - - height = rect.bottom - rect.top; - width = rect.right - rect.left; - text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, width); - text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, height); - /* rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height); */ - /* columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width); */ - - /* TODO: Clip size to the screen dimensions. */ - - /* Even if the number of character rows and columns has - not changed, the font size may have changed, so we need - to check the pixel dimensions as well. */ - - if (width != FRAME_PIXEL_WIDTH (f) - || height != FRAME_PIXEL_HEIGHT (f) - || text_width != FRAME_TEXT_WIDTH (f) - || text_height != FRAME_TEXT_HEIGHT (f)) + if (GetClientRect (msg.msg.hwnd, &rect) + /* GetClientRect evidently returns (0, 0, 0, 0) if + called on a minimized frame. Such "dimensions" + aren't useful anyway. */ + && !(rect.bottom == 0 + && rect.top == 0 + && rect.left == 0 + && rect.right == 0)) { - change_frame_size (f, text_width, text_height, 0, 1, 0, 1); - SET_FRAME_GARBAGED (f); - cancel_mouse_face (f); - f->win_gravity = NorthWestGravity; + height = rect.bottom - rect.top; + width = rect.right - rect.left; + text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, width); + text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, height); + /* rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height); */ + /* columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width); */ + + /* TODO: Clip size to the screen dimensions. */ + + /* Even if the number of character rows and columns + has not changed, the font size may have changed, + so we need to check the pixel dimensions as well. */ + + if (width != FRAME_PIXEL_WIDTH (f) + || height != FRAME_PIXEL_HEIGHT (f) + || text_width != FRAME_TEXT_WIDTH (f) + || text_height != FRAME_TEXT_HEIGHT (f)) + { + change_frame_size (f, text_width, text_height, 0, 1, 0, 1); + SET_FRAME_GARBAGED (f); + cancel_mouse_face (f); + f->win_gravity = NorthWestGravity; + } } } === modified file 'src/window.c' --- src/window.c 2014-09-25 07:01:35 +0000 +++ src/window.c 2014-09-30 23:19:31 +0000 @@ -5914,6 +5914,8 @@ w->start_at_line_beg = (bytepos == BEGV_BYTE || FETCH_BYTE (bytepos - 1) == '\n'); + wset_redisplay (w); + return Qnil; } === modified file 'src/xdisp.c' --- src/xdisp.c 2014-09-30 02:43:23 +0000 +++ src/xdisp.c 2014-09-30 23:19:31 +0000 @@ -15002,6 +15002,10 @@ If FORCE_P is non-zero, return 0 even if partial visible cursor row is higher than window. + If CURRENT_MATRIX_P is non-zero, use the information from the + window's current glyph matrix; otherwise use the desired glyph + matrix. + A value of 0 means the caller should do scrolling as if point had gone off the screen. */ @@ -16175,26 +16179,48 @@ /* If someone specified a new starting point but did not insist, check whether it can be used. */ - if (w->optional_new_start + if ((w->optional_new_start || window_frozen_p (w)) && CHARPOS (startp) >= BEGV && CHARPOS (startp) <= ZV) { + ptrdiff_t it_charpos; + w->optional_new_start = 0; start_display (&it, w, startp); move_it_to (&it, PT, 0, it.last_visible_y, -1, MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y); - if (IT_CHARPOS (it) == PT) - w->force_start = 1; - /* IT may overshoot PT if text at PT is invisible. */ - else if (IT_CHARPOS (it) > PT && CHARPOS (startp) <= PT) - w->force_start = 1; + /* Record IT's position now, since line_bottom_y might change + that. */ + it_charpos = IT_CHARPOS (it); + /* Make sure we set the force_start flag only if the cursor row + will be fully visible. Otherwise, the code under force_start + label below will try to move point back into view, which is + not what the code which sets optional_new_start wants. */ + if ((it.current_y == 0 || line_bottom_y (&it) < it.last_visible_y) + && !w->force_start) + { + if (it_charpos == PT) + w->force_start = 1; + /* IT may overshoot PT if text at PT is invisible. */ + else if (it_charpos > PT && CHARPOS (startp) <= PT) + w->force_start = 1; +#ifdef GLYPH_DEBUG + if (w->force_start) + { + if (window_frozen_p (w)) + debug_method_add (w, "set force_start from frozen window start"); + else + debug_method_add (w, "set force_start from optional_new_start"); + } +#endif + } } force_start: /* Handle case where place to start displaying has been specified, unless the specified location is outside the accessible range. */ - if (w->force_start || window_frozen_p (w)) + if (w->force_start) { /* We set this later on if we have to adjust point. */ int new_vpos = -1; @@ -16239,7 +16265,7 @@ goto need_larger_matrices; } - if (w->cursor.vpos < 0 && !window_frozen_p (w)) + if (w->cursor.vpos < 0) { /* If point does not appear, try to move point so it does appear. The desired matrix has been built above, so we @@ -16332,6 +16358,11 @@ } */ } + if (w->cursor.vpos < 0 || !cursor_row_fully_visible_p (w, 0, 0)) + { + clear_glyph_matrix (w->desired_matrix); + goto try_to_scroll; + } #ifdef GLYPH_DEBUG debug_method_add (w, "forced window start"); @@ -16396,7 +16427,8 @@ || CHARPOS (startp) == BEGV || !window_outdated (w))) { - int d1, d2, d3, d4, d5, d6; + int d1, d2, d5, d6; + int rtop, rbot; /* If first window line is a continuation line, and window start is inside the modified region, but the first change is before @@ -16421,14 +16453,20 @@ && compute_window_start_on_continuation_line (w) /* It doesn't make sense to force the window start like we do at label force_start if it is already known that point - will not be visible in the resulting window, because + will not be fully visible in the resulting window, because doing so will move point from its correct position instead of scrolling the window to bring point into view. See bug#9324. */ - && pos_visible_p (w, PT, &d1, &d2, &d3, &d4, &d5, &d6)) + && pos_visible_p (w, PT, &d1, &d2, &rtop, &rbot, &d5, &d6) + /* A very tall row could need more than the window height, + in which case we accept that it is partially visible. */ + && (rtop != 0) == (rbot != 0)) { w->force_start = 1; SET_TEXT_POS_FROM_MARKER (startp, w->start); +#ifdef GLYPH_DEBUG + debug_method_add (w, "recomputed window start in continuation line"); +#endif goto force_start; } ------------------------------------------------------------ revno: 117991 author: Paul Eggert committer: Paul Eggert branch nick: trunk timestamp: Tue 2014-09-30 13:17:36 -0700 message: * alloc.c: Remove now-unnecessary check. Suggested by Dmitry Antipov in: http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00891.html diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-30 15:31:18 +0000 +++ src/ChangeLog 2014-09-30 20:17:36 +0000 @@ -1,5 +1,9 @@ 2014-09-30 Paul Eggert + * alloc.c: Remove now-unnecessary check. + Suggested by Dmitry Antipov in: + http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00891.html + * xterm.c (x_term_init): Allocate temps on stack, not on heap. * frame.c (x_set_frame_parameters): Port --enable-gcc-warnings === modified file 'src/alloc.c' --- src/alloc.c 2014-09-29 06:44:31 +0000 +++ src/alloc.c 2014-09-30 20:17:36 +0000 @@ -69,12 +69,6 @@ static bool valgrind_p; #endif -#if USE_STACK_LISP_OBJECTS -# if GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS -# error "Stack-allocated Lisp objects are not compatible with GCPROs" -# endif -#endif - /* GC_CHECK_MARKED_OBJECTS means do sanity checks on allocated objects. Doable only if GC_MARK_STACK. */ #if ! GC_MARK_STACK ------------------------------------------------------------ revno: 117990 committer: Paul Eggert branch nick: trunk timestamp: Tue 2014-09-30 12:10:37 -0700 message: * internals.texi (Stack-allocated Objects): Further improvements. Give an example of misuse. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-09-30 16:21:22 +0000 +++ doc/lispref/ChangeLog 2014-09-30 19:10:37 +0000 @@ -1,3 +1,8 @@ +2014-09-30 Paul Eggert + + * internals.texi (Stack-allocated Objects): Further improvements. + Give an example of misuse. + 2014-09-30 Eli Zaretskii * internals.texi (Stack-allocated Objects): Minor improvements of === modified file 'doc/lispref/internals.texi' --- doc/lispref/internals.texi 2014-09-30 16:21:22 +0000 +++ doc/lispref/internals.texi 2014-09-30 19:10:37 +0000 @@ -537,25 +537,50 @@ @cindex Lisp objects, stack-allocated The garbage collector described above is used to manage data visible from Lisp programs, as well as most of the data internally used by the -Lisp interpreter. But sometimes it may be useful to allocate -temporary internal (i.e.@: not visible for a Lisp program) objects -using the C stack of the interpreter. Currently, only cons cells and -strings can be allocated that way. Stack-allocated strings are -limited to @acronym{ASCII} characters only, and should be treated as -immutable (calling @code{ASET} on them produces undefined behavior). - - In C, this is implemented as special macros which expand into a -@code{Lisp_Object} with block-scoped semantics and lifetime (see the -code around @code{USE_STACK_LISP_OBJECTS} in @file{src/lisp.h}). This -means that these objects are not freed by the garbage collector; -instead, they are allocated like local variables in C and -automatically freed when execution goes out of the scope where the -object was allocated. Thus, allocating and freeing these objects is -faster than when using heap memory to allocate and the garbage -collector to free their memory. Note that using such objects out of -their scope will result in undefined behavior, so code using them -should be well thought out and carefully debugged by using the -@code{GC_CHECK_MARKED_OBJECTS} feature (see @file{src/alloc.c}). +Lisp interpreter. Sometimes it may be useful to allocate temporary +internal objects using the C stack of the interpreter. This can help +performance, as stack allocation is typically faster than using heap +memory to allocate and the garbage collector to free. The downside is +that using such objects after they are freed results in undefined +behavior, so uses should be well thought out and carefully debugged by +using the @code{GC_CHECK_MARKED_OBJECTS} feature (see +@file{src/alloc.c}). In particular, stack-allocated objects should +never be made visible to user Lisp code. + + Currently, cons cells and strings can be allocated this way. This +is implemented by C macros like @code{scoped_cons} and +@code{SCOPED_STRING} that return a @code{Lisp_Object} with block +lifetime. These objects are not freed by the garbage collector; +instead, they have automatic storage duration, i.e., they are +allocated like local variables and are automatically freed at the end +of execution of the C block where the object was allocated. C blocks +include compound statements (i.e., inside @samp{@{} and @samp{@}}), +along with selection and iteration statements and their immediate +substatements. For example: + +@example +/* Erroneous code. */ +Lisp_Object x; +if (foo) + x = SCOPED_STRING ("prefix"); +else + x = bar; +return concat2 (x, baz); +@end example + +@noindent +This has undefined behavior because the @code{if} statement is a +block, so @code{x} is used after the corresponding object has been +freed. Better would be: + +@example +Lisp_Object x = foo ? SCOPED_STRING ("prefix") : bar; +return concat2 (x, baz); +@end example + + For performance reasons, stack-allocated strings are limited to +@acronym{ASCII} characters, and many of these strings are immutable, +i.e., calling @code{ASET} on them produces undefined behavior. @node Memory Usage @section Memory Usage ------------------------------------------------------------ revno: 117989 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18191 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2014-09-30 13:52:11 -0400 message: * lisp/ses.el (ses--row, ses--col): New dyn-scoped vars, to replace row&col. (ses-center, ses-center-span): Use them. (ses-print-cell): Bind them while calling the printer. (row, col, maxrow, maxcol): Don't declare as dynamically scoped. (ses-dorange): Revert last change. (ses-calculate-cell): Don't bind row&col dynamically while evaluating the formula. (ses-set-cell): Avoid `eval'. (ses--time-check): Rename it from ses-time-check and turn it into a macro. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-30 15:33:03 +0000 +++ lisp/ChangeLog 2014-09-30 17:52:11 +0000 @@ -1,13 +1,24 @@ 2014-09-30 Stefan Monnier + * ses.el (ses--row, ses--col): New dyn-scoped vars, to replace row&col. + (ses-center, ses-center-span): Use them. + (ses-print-cell): Bind them while calling the printer. + (row, col, maxrow, maxcol): Don't declare as dynamically scoped. + (ses-dorange): Revert last change. + (ses-calculate-cell): Don't bind row&col dynamically while evaluating + the formula. + (ses-set-cell): Avoid `eval'. + (ses--time-check): Rename it from ses-time-check and turn it into + a macro. + * ses.el (ses-setup): Don't assume modifying the iteration var of dotimes affects the iteration (bug#18191). 2014-09-30 Vincent Belaïche - * ses.el (ses-calculate-cell): bind row and col dynamically to + * ses.el (ses-calculate-cell): Bind row and col dynamically to their values with 'cl-progv'. - (ses-dorange): bind row, col, maxrow and maxcol dynamically to + (ses-dorange): Bind row, col, maxrow and maxcol dynamically to their values with 'cl-progv', also use non-interned symbols for row, minrow, maxrow, mincol and maxcol. (maxrow maxcol): New defvar, to make the compiler happy. === modified file 'lisp/ses.el' --- lisp/ses.el 2014-09-30 15:33:03 +0000 +++ lisp/ses.el 2014-09-30 17:52:11 +0000 @@ -561,7 +561,7 @@ ;;To save time later, we also calculate the total width of each line in the ;;print area (excluding the terminating newline) (setq ses--col-widths widths - ses--linewidth (apply '+ -1 (mapcar '1+ widths)) + ses--linewidth (apply #'+ -1 (mapcar #'1+ widths)) ses--blank-line (concat (make-string ses--linewidth ?\s) "\n")) t) @@ -573,7 +573,7 @@ (dotimes (x ses--numcols) (aset printers x (ses-safe-printer (aref printers x)))) (setq ses--col-printers printers) - (mapc 'ses-printer-record printers) + (mapc #'ses-printer-record printers) t) (defmacro ses-default-printer (def) @@ -592,37 +592,29 @@ t) (defmacro ses-dorange (curcell &rest body) - "Execute BODY repeatedly, with the variables `row', `col', -`maxrow' and `maxcol' dynamically scoped to each cell in the -range specified by CURCELL." + "Execute BODY repeatedly, with the variables `row' and `col' set to each +cell in the range specified by CURCELL. The range is available in the +variables `minrow', `maxrow', `mincol', and `maxcol'." (declare (indent defun) (debug (form body))) (let ((cur (make-symbol "cur")) (min (make-symbol "min")) (max (make-symbol "max")) (r (make-symbol "r")) - (c (make-symbol "c")) - (row (make-symbol "row")) - ;; The range is available in the variables `minrow', `maxrow', - ;; `mincol', and `maxcol'. - (minrow (make-symbol "minrow")) - (mincol (make-symbol "mincol")) - (maxrow (make-symbol "maxrow")) - (maxcol (make-symbol "maxcol")) ) + (c (make-symbol "c"))) `(let* ((,cur ,curcell) (,min (ses-sym-rowcol (if (consp ,cur) (car ,cur) ,cur))) (,max (ses-sym-rowcol (if (consp ,cur) (cdr ,cur) ,cur)))) - (let ((,minrow (car ,min)) - (,maxrow (car ,max)) - (,mincol (cdr ,min)) - (,maxcol (cdr ,max)) - ,row) - (if (or (> ,minrow ,maxrow) (> ,mincol ,maxcol)) + (let ((minrow (car ,min)) + (maxrow (car ,max)) + (mincol (cdr ,min)) + (maxcol (cdr ,max))) + (if (or (> minrow maxrow) (> mincol maxcol)) (error "Empty range")) - (dotimes (,r (- ,maxrow ,minrow -1)) - (setq ,row (+ ,r ,minrow)) - (dotimes (,c (- ,maxcol ,mincol -1)) - (cl-progv '(row col maxrow maxcol) (list ,row (+ ,c ,mincol) ,maxrow ,maxcol) - ,@body))))))) + (dotimes (,r (- maxrow minrow -1)) + (let ((row (+ ,r minrow))) + (dotimes (,c (- maxcol mincol -1)) + (let ((col (+ ,c mincol))) + ,@body)))))))) ;;Support for coverage testing. (defmacro 1value (form) @@ -787,13 +779,12 @@ (setq ses--header-hscroll -1)) ;;Split this code off into a function to avoid coverage-testing difficulties -(defun ses-time-check (format arg) +(defmacro ses--time-check (format &rest args) "If `ses-start-time' is more than a second ago, call `message' with FORMAT -and (eval ARG) and reset `ses-start-time' to the current time." - (when (> (- (float-time) ses-start-time) 1.0) - (message format (eval arg)) - (setq ses-start-time (float-time))) - nil) +and ARGS and reset `ses-start-time' to the current time." + `(when (> (- (float-time) ses-start-time) 1.0) + (message ,format ,@args) + (setq ses-start-time (float-time)))) ;;---------------------------------------------------------------------------- @@ -809,7 +800,8 @@ (val ,val)) (let* ((cell (ses-get-cell row col)) (change - ,(let ((field (eval field t))) + ,(let ((field (progn (cl-assert (eq (car field) 'quote)) + (cadr field)))) (if (eq field 'value) `(ses-set-with-undo (ses-cell-symbol cell) val) ;; (let* ((slots (get 'ses-cell 'cl-struct-slots)) @@ -946,9 +938,7 @@ (setq formula (ses-safe-formula (cadr formula))) (ses-set-cell row col 'formula formula)) (condition-case sig - (setq newval (cl-progv '(row col) - (list row col) - (eval formula))) + (setq newval (eval formula t)) (error ;; Variable `sig' can't be nil. (nconc sig (list (ses-cell-symbol cell))) @@ -1140,6 +1130,9 @@ ((memq 'needrange args) (error "Need a range")))) +(defvar ses--row) +(defvar ses--col) + (defun ses-print-cell (row col) "Format and print the value of cell (ROW,COL) to the print area. Use the cell's printer function. If the cell's new print form is too wide, @@ -1167,10 +1160,13 @@ (ses-set-cell row col 'printer (setq printer (ses-safe-printer (cadr printer))))) ;; Print the value. - (setq text (ses-call-printer (or printer - (ses-col-printer col) - ses--default-printer) - value)) + (setq text + (let ((ses--row row) + (ses--col col)) + (ses-call-printer (or printer + (ses-col-printer col) + ses--default-printer) + value))) (if (consp ses-call-printer-return) ;; Printer returned an error. (setq sig ses-call-printer-return)))) @@ -1279,13 +1275,15 @@ (format (car printer) value) "")) (t - (setq value (funcall - (or (and (symbolp printer) - (let ((locprn (gethash printer ses--local-printer-hashmap))) - (and locprn - (ses--locprn-compiled locprn)))) - printer) - (or value ""))) + (setq value + (funcall + (or (and (symbolp printer) + (let ((locprn (gethash printer + ses--local-printer-hashmap))) + (and locprn + (ses--locprn-compiled locprn)))) + printer) + (or value ""))) (if (stringp value) value (or (stringp (car-safe value)) @@ -1411,8 +1409,8 @@ (with-temp-message " " (save-excursion (while ses--deferred-write - (ses-time-check "Writing... (%d cells left)" - '(length ses--deferred-write)) + (ses--time-check "Writing... (%d cells left)" + (length ses--deferred-write)) (setq rowcol (pop ses--deferred-write) row (car rowcol) col (cdr rowcol) @@ -1702,7 +1700,7 @@ (let (row col) (setq ses-start-time (float-time)) (while reform - (ses-time-check "Fixing ses-ranges... (%d left)" '(length reform)) + (ses--time-check "Fixing ses-ranges... (%d left)" (length reform)) (setq row (caar reform) col (cdar reform) reform (cdr reform)) @@ -1799,7 +1797,7 @@ (setq ses--data-marker (point-marker)) (forward-char (1- (length ses-print-data-boundary))) ;; Initialize printer and symbol lists. - (mapc 'ses-printer-record ses-standard-printer-functions) + (mapc #'ses-printer-record ses-standard-printer-functions) (setq ses--symbolic-formulas nil) ;; Load local printer definitions. @@ -1848,10 +1846,10 @@ (eq (car-safe head-row) 'ses-header-row) (= n4 ?\n)) (error "Invalid SES global parameters")) - (1value (eval widths)) - (1value (eval def-printer)) - (1value (eval printers)) - (1value (eval head-row))) + (1value (eval widths t)) + (1value (eval def-printer t)) + (1value (eval printers t)) + (1value (eval head-row t))) ;; Should be back at global-params. (forward-char 1) (or (looking-at-p ses-initial-global-parameters-re) @@ -1875,7 +1873,7 @@ (with-silent-modifications (ses-goto-data 0 0) ; Include marker between print-area and data-area. (set-text-properties (point) (point-max) nil) ; Delete garbage props. - (mapc 'delete-overlay (overlays-in (point-min) (point-max))) + (mapc #'delete-overlay (overlays-in (point-min) (point-max))) ;; The print area is read-only (except for our special commands) and ;; uses a special keymap. (put-text-property (point-min) (1- (point)) 'read-only 'ses) @@ -1925,7 +1923,7 @@ ;; Delete read-only, keymap, and intangible properties. (set-text-properties (point-min) (point-max) nil) ;; Delete overlay. - (mapc 'delete-overlay (overlays-in (point-min) (point-max))) + (mapc #'delete-overlay (overlays-in (point-min) (point-max))) (unless was-modified (restore-buffer-modified-p nil)))) @@ -2131,7 +2129,7 @@ (push (propertize (format " [row %d]" ses--header-row) 'display '((height (- 1)))) result)) - (setq ses--header-string (apply 'concat (nreverse result))))) + (setq ses--header-string (apply #'concat (nreverse result))))) ;;---------------------------------------------------------------------------- @@ -2186,10 +2184,10 @@ ;; These functions use the variables 'row' and 'col' that are dynamically bound ;; by ses-print-cell. We define these variables at compile-time to make the ;; compiler happy. -(defvar row) -(defvar col) -(defvar maxrow) -(defvar maxcol) +;; (defvar row) +;; (defvar col) +;; (defvar maxrow) +;; (defvar maxcol) (defun ses-recalculate-cell () "Recalculate and reprint the current cell or range. @@ -2218,7 +2216,7 @@ ;; First, recalculate all cells that don't refer to other cells and ;; produce a list of cells with references. (ses-dorange ses--curcell - (ses-time-check "Recalculating... %s" '(ses-cell-symbol row col)) + (ses--time-check "Recalculating... %s" (ses-cell-symbol row col)) (condition-case nil (progn ;; The t causes an error if the cell has references. If no @@ -2839,7 +2837,7 @@ ;;Avoid overflow situation (setq end (1- ses--data-marker))) (let* ((inhibit-point-motion-hooks t) - (x (mapconcat 'ses-copy-region-helper + (x (mapconcat #'ses-copy-region-helper (extract-rectangle beg (1- end)) "\n"))) (remove-text-properties 0 (length x) '(read-only t @@ -3144,7 +3142,7 @@ (push "\t" result)) ((< row maxrow) (push "\n" result)))) - (setq result (apply 'concat (nreverse result))) + (setq result (apply #'concat (nreverse result))) (kill-new result))) @@ -3617,7 +3615,7 @@ (setcdr (last result 2) nil) (setq result (cdr (nreverse result)))) (unless reorient-x - (setq result (mapcar 'nreverse result))) + (setq result (mapcar #'nreverse result))) (when transpose (let ((ret (mapcar (lambda (x) (list x)) (pop result))) iter) (while result @@ -3629,7 +3627,7 @@ (cl-flet ((vectorize-*1 (clean result) - (cons clean (cons (quote 'vec) (apply 'append result)))) + (cons clean (cons (quote 'vec) (apply #'append result)))) (vectorize-*2 (clean result) (cons clean (cons (quote 'vec) @@ -3637,7 +3635,7 @@ (cons clean (cons (quote 'vec) x))) result))))) (pcase vectorize - (`nil (cons clean (apply 'append result))) + (`nil (cons clean (apply #'append result))) (`*1 (vectorize-*1 clean result)) (`*2 (vectorize-*2 clean result)) (`* (funcall (if (cdr result) @@ -3655,13 +3653,13 @@ (defun ses+ (&rest args) "Compute the sum of the arguments, ignoring blanks." - (apply '+ (apply 'ses-delete-blanks args))) + (apply #'+ (apply #'ses-delete-blanks args))) (defun ses-average (list) "Computes the sum of the numbers in LIST, divided by their length. Blanks are ignored. Result is always floating-point, even if all args are integers." - (setq list (apply 'ses-delete-blanks list)) - (/ (float (apply '+ list)) (length list))) + (setq list (apply #'ses-delete-blanks list)) + (/ (float (apply #'+ list)) (length list))) (defmacro ses-select (fromrange test torange) "Select cells in FROMRANGE that are `equal' to TEST. @@ -3670,7 +3668,7 @@ either (ses-range BEG END) or (list ...). The TEST is evaluated." (setq fromrange (cdr (macroexpand fromrange)) torange (cdr (macroexpand torange)) - test (eval test)) + test (eval test t)) (or (= (length fromrange) (length torange)) (error "ses-select: Ranges not same length")) (let (result) @@ -3695,14 +3693,14 @@ FILL is the fill character for centering (default = space). SPAN indicates how many additional rightward columns to include in width (default = 0)." - (let ((printer (or (ses-col-printer col) ses--default-printer)) - (width (ses-col-width col)) + (let ((printer (or (ses-col-printer ses--col) ses--default-printer)) + (width (ses-col-width ses--col)) half) (or fill (setq fill ?\s)) (or span (setq span 0)) (setq value (ses-call-printer printer value)) (dotimes (x span) - (setq width (+ width 1 (ses-col-width (+ col span (- x)))))) + (setq width (+ width 1 (ses-col-width (+ ses--col span (- x)))))) ;; Set column width. (setq width (- width (string-width value))) (if (<= width 0) @@ -3715,11 +3713,11 @@ "Print VALUE, centered within the span that starts in the current column and continues until the next nonblank column. FILL specifies the fill character (default = space)." - (let ((end (1+ col))) + (let ((end (1+ ses--col))) (while (and (< end ses--numcols) - (memq (ses-cell-value row end) '(nil *skip*))) + (memq (ses-cell-value ses--row end) '(nil *skip*))) (setq end (1+ end))) - (ses-center value (- end col 1) fill))) + (ses-center value (- end ses--col 1) fill))) (defun ses-dashfill (value &optional span) "Print VALUE centered using dashes. ------------------------------------------------------------ revno: 117988 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2014-09-30 19:21:22 +0300 message: Fix last change in lispref. doc/lispref/internals.texi (Stack-allocated Objects): Minor improvements of the wording and the indexing. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-09-30 15:35:16 +0000 +++ doc/lispref/ChangeLog 2014-09-30 16:21:22 +0000 @@ -1,3 +1,8 @@ +2014-09-30 Eli Zaretskii + + * internals.texi (Stack-allocated Objects): Minor improvements of + the wording and the indexing. + 2014-09-30 Dmitry Antipov * internals.texi (Stack-allocated Objects): Describe this feature. === modified file 'doc/lispref/internals.texi' --- doc/lispref/internals.texi 2014-09-30 15:35:16 +0000 +++ doc/lispref/internals.texi 2014-09-30 16:21:22 +0000 @@ -533,27 +533,29 @@ @node Stack-allocated Objects @section Stack-allocated Objects -@cindex stack allocation overview +@cindex stack allocated Lisp objects +@cindex Lisp objects, stack-allocated The garbage collector described above is used to manage data visible -from Lisp program, as well as the most of data internally used by the -interpreter. But sometimes it may be useful to allocate temporary -internal (i.e. not visible for Lisp program) objects using C stack of -an interpreter. Currently conses and strings are the only objects which -can be allocated in that way. Strings are limited to ASCII characters -only and should be treated as immutable (calling @code{ASET} on them is -undefined). +from Lisp programs, as well as most of the data internally used by the +Lisp interpreter. But sometimes it may be useful to allocate +temporary internal (i.e.@: not visible for a Lisp program) objects +using the C stack of the interpreter. Currently, only cons cells and +strings can be allocated that way. Stack-allocated strings are +limited to @acronym{ASCII} characters only, and should be treated as +immutable (calling @code{ASET} on them produces undefined behavior). -@cindex stack allocation internals - In C, this is implemented as a special macros which expands to -a @code{Lisp_Object} with block-scoped semantics and lifetime (see -the code around @code{USE_STACK_LISP_OBJECTS} in @file{lisp.h}). This -means that these objects are not managed by the garbage collector; -instead, they are allocated like local variables in C and automatically -freed when an execution reaches an end of the corresponding scope. Thus, -allocation and freeing are faster than using garbage collector. But -remember that passing them out of their scope results in undefined -behavior. Think twice before using this feature and carefully debug -your code with @code{GC_CHECK_MARKED_OBJECTS} (see @file{alloc.c}). + In C, this is implemented as special macros which expand into a +@code{Lisp_Object} with block-scoped semantics and lifetime (see the +code around @code{USE_STACK_LISP_OBJECTS} in @file{src/lisp.h}). This +means that these objects are not freed by the garbage collector; +instead, they are allocated like local variables in C and +automatically freed when execution goes out of the scope where the +object was allocated. Thus, allocating and freeing these objects is +faster than when using heap memory to allocate and the garbage +collector to free their memory. Note that using such objects out of +their scope will result in undefined behavior, so code using them +should be well thought out and carefully debugged by using the +@code{GC_CHECK_MARKED_OBJECTS} feature (see @file{src/alloc.c}). @node Memory Usage @section Memory Usage ------------------------------------------------------------ revno: 117987 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2014-09-30 19:35:16 +0400 message: * internals.texi (Stack-allocated Objects): Describe this feature. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-09-15 00:43:29 +0000 +++ doc/lispref/ChangeLog 2014-09-30 15:35:16 +0000 @@ -1,3 +1,7 @@ +2014-09-30 Dmitry Antipov + + * internals.texi (Stack-allocated Objects): Describe this feature. + 2014-09-15 Daniel Colascione * text.texi (Registers): Make `insert-register' documentation === modified file 'doc/lispref/internals.texi' --- doc/lispref/internals.texi 2014-07-11 12:49:49 +0000 +++ doc/lispref/internals.texi 2014-09-30 15:35:16 +0000 @@ -14,6 +14,7 @@ * Building Emacs:: How the dumped Emacs is made. * Pure Storage:: Kludge to make preloaded Lisp functions shareable. * Garbage Collection:: Reclaiming space for Lisp objects no longer used. +* Stack-allocated Objects:: Temporary conses and strings on C stack. * Memory Usage:: Info about total size of Lisp objects made so far. * C Dialect:: What C variant Emacs is written in. * Writing Emacs Primitives:: Writing C code for Emacs. @@ -529,6 +530,31 @@ floating-point number. @end defvar +@node Stack-allocated Objects +@section Stack-allocated Objects + +@cindex stack allocation overview + The garbage collector described above is used to manage data visible +from Lisp program, as well as the most of data internally used by the +interpreter. But sometimes it may be useful to allocate temporary +internal (i.e. not visible for Lisp program) objects using C stack of +an interpreter. Currently conses and strings are the only objects which +can be allocated in that way. Strings are limited to ASCII characters +only and should be treated as immutable (calling @code{ASET} on them is +undefined). + +@cindex stack allocation internals + In C, this is implemented as a special macros which expands to +a @code{Lisp_Object} with block-scoped semantics and lifetime (see +the code around @code{USE_STACK_LISP_OBJECTS} in @file{lisp.h}). This +means that these objects are not managed by the garbage collector; +instead, they are allocated like local variables in C and automatically +freed when an execution reaches an end of the corresponding scope. Thus, +allocation and freeing are faster than using garbage collector. But +remember that passing them out of their scope results in undefined +behavior. Think twice before using this feature and carefully debug +your code with @code{GC_CHECK_MARKED_OBJECTS} (see @file{alloc.c}). + @node Memory Usage @section Memory Usage @cindex memory usage ------------------------------------------------------------ revno: 117986 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18191 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2014-09-30 11:33:03 -0400 message: * lisp/ses.el (ses-setup): Don't assume modifying the iteration var of dotimes affects the iteration. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-30 08:06:28 +0000 +++ lisp/ChangeLog 2014-09-30 15:33:03 +0000 @@ -1,3 +1,8 @@ +2014-09-30 Stefan Monnier + + * ses.el (ses-setup): Don't assume modifying the iteration var of + dotimes affects the iteration (bug#18191). + 2014-09-30 Vincent Belaïche * ses.el (ses-calculate-cell): bind row and col dynamically to === modified file 'lisp/ses.el' --- lisp/ses.el 2014-09-30 08:06:28 +0000 +++ lisp/ses.el 2014-09-30 15:33:03 +0000 @@ -1870,45 +1870,42 @@ `intangible' properties. Sets up highlighting for current cell." (interactive) (let ((end (point-min)) - (inhibit-read-only t) (inhibit-point-motion-hooks t) - (was-modified (buffer-modified-p)) pos sym) - (ses-goto-data 0 0) ; Include marker between print-area and data-area. - (set-text-properties (point) (point-max) nil) ; Delete garbage props. - (mapc 'delete-overlay (overlays-in (point-min) (point-max))) - ;; The print area is read-only (except for our special commands) and uses a - ;; special keymap. - (put-text-property (point-min) (1- (point)) 'read-only 'ses) - (put-text-property (point-min) (1- (point)) 'keymap 'ses-mode-print-map) - ;; For the beginning of the buffer, we want the read-only and keymap - ;; attributes to be inherited from the first character. - (put-text-property (point-min) (1+ (point-min)) 'front-sticky t) - ;; Create intangible properties, which also indicate which cell the text - ;; came from. - (dotimes-with-progress-reporter (row ses--numrows) "Finding cells..." - (dotimes (col ses--numcols) - (setq pos end - sym (ses-cell-symbol row col)) - ;; Include skipped cells following this one. - (while (and (< col (1- ses--numcols)) - (eq (ses-cell-value row (1+ col)) '*skip*)) - (setq end (+ end (ses-col-width col) 1) - col (1+ col))) - (setq end (save-excursion - (goto-char pos) - (move-to-column (+ (current-column) (- end pos) - (ses-col-width col))) - (if (eolp) - (+ end (ses-col-width col) 1) - (forward-char) - (point)))) - (put-text-property pos end 'intangible sym))) - ;; Adding these properties did not actually alter the text. - (unless was-modified - (restore-buffer-modified-p nil) - (buffer-disable-undo) - (buffer-enable-undo))) + (with-silent-modifications + (ses-goto-data 0 0) ; Include marker between print-area and data-area. + (set-text-properties (point) (point-max) nil) ; Delete garbage props. + (mapc 'delete-overlay (overlays-in (point-min) (point-max))) + ;; The print area is read-only (except for our special commands) and + ;; uses a special keymap. + (put-text-property (point-min) (1- (point)) 'read-only 'ses) + (put-text-property (point-min) (1- (point)) 'keymap 'ses-mode-print-map) + ;; For the beginning of the buffer, we want the read-only and keymap + ;; attributes to be inherited from the first character. + (put-text-property (point-min) (1+ (point-min)) 'front-sticky t) + ;; Create intangible properties, which also indicate which cell the text + ;; came from. + (dotimes-with-progress-reporter (row ses--numrows) "Finding cells..." + (dotimes (col ses--numcols) + (setq pos end + sym (ses-cell-symbol row col)) + (unless (eq (symbol-value sym) '*skip*) + ;; Include skipped cells following this one. + (while (and (< col (1- ses--numcols)) + (eq (ses-cell-value row (1+ col)) '*skip*)) + (setq end (+ end (ses-col-width col) 1) + ;; Beware: Modifying the iteration variable of `dotimes' + ;; may or may not affect the iteration! + col (1+ col))) + (setq end (save-excursion + (goto-char pos) + (move-to-column (+ (current-column) (- end pos) + (ses-col-width col))) + (if (eolp) + (+ end (ses-col-width col) 1) + (forward-char) + (point)))) + (put-text-property pos end 'intangible sym)))))) ;; Create the underlining overlay. It's impossible for (point) to be 2, ;; because column A must be at least 1 column wide. (setq ses--curcell-overlay (make-overlay (1+ (point-min)) (1+ (point-min)))) ------------------------------------------------------------ revno: 117985 author: Paul Eggert committer: Paul Eggert branch nick: trunk timestamp: Tue 2014-09-30 08:31:18 -0700 message: * xterm.c (x_term_init): Allocate temps on stack, not on heap. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-30 15:20:03 +0000 +++ src/ChangeLog 2014-09-30 15:31:18 +0000 @@ -1,5 +1,7 @@ 2014-09-30 Paul Eggert + * xterm.c (x_term_init): Allocate temps on stack, not on heap. + * frame.c (x_set_frame_parameters): Port --enable-gcc-warnings to Ubuntu 14.04.1 x86-64. === modified file 'src/xterm.c' --- src/xterm.c 2014-09-30 02:43:23 +0000 +++ src/xterm.c 2014-09-30 15:31:18 +0000 @@ -11062,11 +11062,11 @@ }; int i; - const int atom_count = ARRAYELTS (atom_refs); - /* 1 for _XSETTINGS_SN */ - const int total_atom_count = 1 + atom_count; - Atom *atoms_return = xmalloc (total_atom_count * sizeof *atoms_return); - char **atom_names = xmalloc (total_atom_count * sizeof *atom_names); + enum { atom_count = ARRAYELTS (atom_refs) }; + /* 1 for _XSETTINGS_SN. */ + enum { total_atom_count = 1 + atom_count }; + Atom atoms_return[total_atom_count]; + char *atom_names[total_atom_count]; static char const xsettings_fmt[] = "_XSETTINGS_S%d"; char xsettings_atom_name[sizeof xsettings_fmt - 2 + INT_STRLEN_BOUND (int)]; @@ -11074,7 +11074,7 @@ for (i = 0; i < atom_count; i++) atom_names[i] = (char *) atom_refs[i].name; - /* Build _XSETTINGS_SN atom name */ + /* Build _XSETTINGS_SN atom name. */ sprintf (xsettings_atom_name, xsettings_fmt, XScreenNumberOfScreen (dpyinfo->screen)); atom_names[i] = xsettings_atom_name; @@ -11085,11 +11085,8 @@ for (i = 0; i < atom_count; i++) *(Atom *) ((char *) dpyinfo + atom_refs[i].offset) = atoms_return[i]; - /* Manual copy of last atom */ + /* Manually copy last atom. */ dpyinfo->Xatom_xsettings_sel = atoms_return[i]; - - xfree (atom_names); - xfree (atoms_return); } dpyinfo->x_dnd_atoms_size = 8; ------------------------------------------------------------ revno: 117984 author: Paul Eggert committer: Paul Eggert branch nick: trunk timestamp: Tue 2014-09-30 08:20:03 -0700 message: * frame.c (x_set_frame_parameters): Port --enable-gcc-warnings to Ubuntu 14.04.1 x86-64. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-30 02:43:23 +0000 +++ src/ChangeLog 2014-09-30 15:20:03 +0000 @@ -1,5 +1,8 @@ 2014-09-30 Paul Eggert + * frame.c (x_set_frame_parameters): Port --enable-gcc-warnings + to Ubuntu 14.04.1 x86-64. + Simplify stack-allocated Lisp objects, and make them more portable. The build_local_string macro was used in two ways: (1) string literals for which scoped allocation suffices, and (2) file name === modified file 'src/frame.c' --- src/frame.c 2014-09-30 02:43:23 +0000 +++ src/frame.c 2014-09-30 15:20:03 +0000 @@ -2988,7 +2988,7 @@ /* If both of these parameters are present, it's more efficient to set them both at once. So we wait until we've looked at the entire list before we set them. */ - int width, height IF_LINT (= 0); + int width IF_LINT (= 0), height IF_LINT (= 0); bool width_change = 0, height_change = 0; /* Same here. */ ------------------------------------------------------------ revno: 117983 committer: Glenn Morris branch nick: trunk timestamp: Tue 2014-09-30 06:21:33 -0400 message: Auto-commit of loaddefs files. diff: === modified file 'lisp/mail/rmail.el' --- lisp/mail/rmail.el 2014-09-13 10:18:48 +0000 +++ lisp/mail/rmail.el 2014-09-30 10:21:33 +0000 @@ -4684,7 +4684,7 @@ ;;;*** -;;;### (autoloads nil "rmailmm" "rmailmm.el" "5d0f7ffd902384a3d1676a8f9268e348") +;;;### (autoloads nil "rmailmm" "rmailmm.el" "6446c799d49a6df8519b11bfe2e3cbea") ;;; Generated autoloads from rmailmm.el (autoload 'rmail-mime "rmailmm" "\ ------------------------------------------------------------ revno: 117982 committer: Vincent Bela?che branch nick: trunk timestamp: Tue 2014-09-30 10:06:28 +0200 message: * ses.el (ses-calculate-cell): bind row and col dynamically to their values with 'cl-progv'. (ses-dorange): bind row, col, maxrow and maxcol dynamically to their values with 'cl-progv', also use non-interned symbols for row, minrow, maxrow, mincol and maxcol. (maxrow maxcol): New defvar, to make the compiler happy. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-30 00:48:31 +0000 +++ lisp/ChangeLog 2014-09-30 08:06:28 +0000 @@ -1,3 +1,12 @@ +2014-09-30 Vincent Belaïche + + * ses.el (ses-calculate-cell): bind row and col dynamically to + their values with 'cl-progv'. + (ses-dorange): bind row, col, maxrow and maxcol dynamically to + their values with 'cl-progv', also use non-interned symbols for + row, minrow, maxrow, mincol and maxcol. + (maxrow maxcol): New defvar, to make the compiler happy. + 2014-09-30 Stefan Monnier * minibuffer.el (completion-at-point): Emit warning for ill-behaved === modified file 'lisp/ses.el' --- lisp/ses.el 2014-09-29 20:25:19 +0000 +++ lisp/ses.el 2014-09-30 08:06:28 +0000 @@ -592,30 +592,37 @@ t) (defmacro ses-dorange (curcell &rest body) - "Execute BODY repeatedly, with the variables `row' and `col' set to each -cell in the range specified by CURCELL. The range is available in the -variables `minrow', `maxrow', `mincol', and `maxcol'." + "Execute BODY repeatedly, with the variables `row', `col', +`maxrow' and `maxcol' dynamically scoped to each cell in the +range specified by CURCELL." (declare (indent defun) (debug (form body))) (let ((cur (make-symbol "cur")) (min (make-symbol "min")) (max (make-symbol "max")) (r (make-symbol "r")) - (c (make-symbol "c"))) + (c (make-symbol "c")) + (row (make-symbol "row")) + ;; The range is available in the variables `minrow', `maxrow', + ;; `mincol', and `maxcol'. + (minrow (make-symbol "minrow")) + (mincol (make-symbol "mincol")) + (maxrow (make-symbol "maxrow")) + (maxcol (make-symbol "maxcol")) ) `(let* ((,cur ,curcell) (,min (ses-sym-rowcol (if (consp ,cur) (car ,cur) ,cur))) (,max (ses-sym-rowcol (if (consp ,cur) (cdr ,cur) ,cur)))) - (let ((minrow (car ,min)) - (maxrow (car ,max)) - (mincol (cdr ,min)) - (maxcol (cdr ,max)) - row col) - (if (or (> minrow maxrow) (> mincol maxcol)) + (let ((,minrow (car ,min)) + (,maxrow (car ,max)) + (,mincol (cdr ,min)) + (,maxcol (cdr ,max)) + ,row) + (if (or (> ,minrow ,maxrow) (> ,mincol ,maxcol)) (error "Empty range")) - (dotimes (,r (- maxrow minrow -1)) - (setq row (+ ,r minrow)) - (dotimes (,c (- maxcol mincol -1)) - (setq col (+ ,c mincol)) - ,@body)))))) + (dotimes (,r (- ,maxrow ,minrow -1)) + (setq ,row (+ ,r ,minrow)) + (dotimes (,c (- ,maxcol ,mincol -1)) + (cl-progv '(row col maxrow maxcol) (list ,row (+ ,c ,mincol) ,maxrow ,maxcol) + ,@body))))))) ;;Support for coverage testing. (defmacro 1value (form) @@ -939,7 +946,9 @@ (setq formula (ses-safe-formula (cadr formula))) (ses-set-cell row col 'formula formula)) (condition-case sig - (setq newval (eval formula)) + (setq newval (cl-progv '(row col) + (list row col) + (eval formula))) (error ;; Variable `sig' can't be nil. (nconc sig (list (ses-cell-symbol cell))) @@ -2177,6 +2186,14 @@ (setq ses--Dijkstra-attempt-nb (1+ ses--Dijkstra-attempt-nb) ses--Dijkstra-weight-bound (* ses--numrows ses--numcols))) +;; These functions use the variables 'row' and 'col' that are dynamically bound +;; by ses-print-cell. We define these variables at compile-time to make the +;; compiler happy. +(defvar row) +(defvar col) +(defvar maxrow) +(defvar maxcol) + (defun ses-recalculate-cell () "Recalculate and reprint the current cell or range. @@ -3676,12 +3693,6 @@ ;; Standard print functions ;;---------------------------------------------------------------------------- -;; These functions use the variables 'row' and 'col' that are dynamically bound -;; by ses-print-cell. We define these variables at compile-time to make the -;; compiler happy. -(defvar row) -(defvar col) - (defun ses-center (value &optional span fill) "Print VALUE, centered within column. FILL is the fill character for centering (default = space). ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.