summaryrefslogtreecommitdiff
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-09-30 20:28:16 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2014-09-30 20:28:16 -0700
commit27900ac72a8959291062eda9ef5eda9fc3f8595f (patch)
tree780e22aa62de9c01e3faf00e5c123b1dfb87ddd3 /src/keyboard.c
parentcebe0e68947ec46b44f5c3c9868814f8a5464173 (diff)
downloademacs-27900ac72a8959291062eda9ef5eda9fc3f8595f.tar.gz
Use AUTO_CONS instead of SCOPED_CONS, etc.
* doc/lispref/internals.texi (Stack-allocated Objects): Adjust to match the revised, less error-prone macros. * src/frame.h (AUTO_FRAME_ARG): Rename from FRAME_PARAMETER. * src/lisp.h (AUTO_CONS): Rename from scoped_cons. (AUTO_LIST1): Rename from scoped_list1. (AUTO_LIST2): Rename from scoped_list2. (AUTO_LIST3): Rename from scoped_list3. (AUTO_LIST4): Rename from scoped_list4. (AUTO_STRING): Rename from SCOPED_STRING. * src/frame.h (AUTO_FRAME_ARG): * src/lisp.h (AUTO_CONS, AUTO_LIST1, AUTO_LIST2, AUTO_LIST3) (AUTO_LIST4, AUTO_STRING): Prepend a new argument 'name'. Declare a variable instead of yielding a value. All uses changed. * src/lisp.h (STACK_CONS, AUTO_CONS_EXPR): New internal macros.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 37d33a6cdb0..8c030c7652c 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -551,6 +551,7 @@ echo_add_key (Lisp_Object c)
/* 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 @@ echo_add_key (Lisp_Object c)
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 @@ echo_dash (void)
/* 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 @@ safe_run_hooks_1 (ptrdiff_t nargs, Lisp_Object *args)
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 @@ parse_menu_item (Lisp_Object item, int inmenubar)
{ /* 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 @@ parse_menu_item (Lisp_Object item, int inmenubar)
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 @@ read_char_minibuf_menu_prompt (int commandflag,
/* 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);
}