Commit 3ebf0630 authored by Paul Eggert's avatar Paul Eggert

Prefer 'Qfoo' to 'intern ("foo")'

* buffer.c (syms_of_buffer):
* bytecode.c (exec_byte_code):
* callint.c (Fcall_interactively):
* callproc.c (create_temp_file):
* charset.c (define_charset_internal):
* coding.c (syms_of_coding):
* editfns.c (syms_of_editfns):
* emacs.c (main):
* fns.c (syms_of_fns):
* frame.c (delete_frame, Fframe_parameters):
* keyboard.c (syms_of_keyboard):
* keymap.c (syms_of_keymap):
* minibuf.c (read_minibuf, syms_of_minibuf):
* nsfns.m (ns_cursor_type_to_lisp):
* textprop.c (syms_of_textprop):
* xdisp.c (Fformat_mode_line, syms_of_xdisp):
* xfns.c (x_create_tip_frame, Fx_select_font):
* xml.c (parse_region):
Prefer constants like 'Qfoo' to calls like 'intern ("foo")'.
* buffer.c (syms_of_buffer): OK to do (put 'erase-buffer 'disabled
t) here now ...
(keys_of_buffer): ... instead of here.
* ftfont.c (syms_of_ftfont): Move DEFSYM of Qmono from here ...
* xfns.c (syms_of_xfns): ... to here, since ftfont.c is more
optional than xfns.c.
parent 066b17df
2015-02-21 Paul Eggert <eggert@cs.ucla.edu>
Prefer 'Qfoo' to 'intern ("foo")'
* buffer.c (syms_of_buffer):
* bytecode.c (exec_byte_code):
* callint.c (Fcall_interactively):
* callproc.c (create_temp_file):
* charset.c (define_charset_internal):
* coding.c (syms_of_coding):
* editfns.c (syms_of_editfns):
* emacs.c (main):
* fns.c (syms_of_fns):
* frame.c (delete_frame, Fframe_parameters):
* keyboard.c (syms_of_keyboard):
* keymap.c (syms_of_keymap):
* minibuf.c (read_minibuf, syms_of_minibuf):
* nsfns.m (ns_cursor_type_to_lisp):
* textprop.c (syms_of_textprop):
* xdisp.c (Fformat_mode_line, syms_of_xdisp):
* xfns.c (x_create_tip_frame, Fx_select_font):
* xml.c (parse_region):
Prefer constants like 'Qfoo' to calls like 'intern ("foo")'.
* buffer.c (syms_of_buffer): OK to do (put 'erase-buffer 'disabled
t) here now ...
(keys_of_buffer): ... instead of here.
* ftfont.c (syms_of_ftfont): Move DEFSYM of Qmono from here ...
* xfns.c (syms_of_xfns): ... to here, since ftfont.c is more
optional than xfns.c.
2015-02-20 Jan Djärv <jan.h.d@swipnet.se>
* emacs.c (terminate_due_to_signal): Move totally_unblock_input after
......
......@@ -5408,7 +5408,7 @@ syms_of_buffer (void)
DEFSYM (Qoverwrite_mode, "overwrite-mode");
Fput (Qoverwrite_mode, Qchoice,
list3 (Qnil, intern ("overwrite-mode-textual"),
intern ("overwrite-mode-binary")));
Qoverwrite_mode_binary));
Fput (Qprotected_field, Qerror_conditions,
listn (CONSTYPE_PURE, 2, Qprotected_field, Qerror));
......@@ -6326,6 +6326,8 @@ Functions running this hook are, `get-buffer-create',
defsubr (&Soverlay_get);
defsubr (&Soverlay_put);
defsubr (&Srestore_buffer_modified_p);
Fput (intern_c_string ("erase-buffer"), Qdisabled, Qt);
}
void
......@@ -6333,8 +6335,4 @@ keys_of_buffer (void)
{
initial_define_key (control_x_map, 'b', "switch-to-buffer");
initial_define_key (control_x_map, 'k', "kill-buffer");
/* This must not be in syms_of_buffer, because Qdisabled is not
initialized when that function gets called. */
Fput (intern_c_string ("erase-buffer"), Qdisabled, Qt);
}
......@@ -1945,10 +1945,10 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
/* Actually this is Bstack_ref with offset 0, but we use Bdup
for that instead. */
/* CASE (Bstack_ref): */
call3 (intern ("error"),
build_string ("Invalid byte opcode: op=%s, ptr=%d"),
make_number (op),
make_number ((stack.pc - 1) - stack.byte_string_start));
call3 (Qerror,
build_string ("Invalid byte opcode: op=%s, ptr=%d"),
make_number (op),
make_number ((stack.pc - 1) - stack.byte_string_start));
/* Handy byte-codes for lexical binding. */
CASE (Bstack_ref1):
......
......@@ -615,9 +615,9 @@ invoke it. If KEYS is omitted or nil, the return value of
{
Lisp_Object tem2;
teml = Fget (teml, intern ("event-symbol-elements"));
teml = Fget (teml, Qevent_symbol_elements);
/* Ignore first element, which is the base key. */
tem2 = Fmemq (intern ("down"), Fcdr (teml));
tem2 = Fmemq (Qdown, Fcdr (teml));
if (! NILP (tem2))
up_event = Fread_event (Qnil, Qnil, Qnil);
}
......@@ -647,9 +647,9 @@ invoke it. If KEYS is omitted or nil, the return value of
{
Lisp_Object tem2;
teml = Fget (teml, intern ("event-symbol-elements"));
teml = Fget (teml, Qevent_symbol_elements);
/* Ignore first element, which is the base key. */
tem2 = Fmemq (intern ("down"), Fcdr (teml));
tem2 = Fmemq (Qdown, Fcdr (teml));
if (! NILP (tem2))
up_event = Fread_event (Qnil, Qnil, Qnil);
}
......
......@@ -1020,7 +1020,7 @@ create_temp_file (ptrdiff_t nargs, Lisp_Object *args,
specbind (intern ("coding-system-for-write"), val);
/* POSIX lets mk[s]temp use "."; don't invoke jka-compr if we
happen to get a ".Z" suffix. */
specbind (intern ("file-name-handler-alist"), Qnil);
specbind (Qfile_name_handler_alist, Qnil);
write_region (start, end, filename_string, Qnil, Qlambda, Qnil, Qnil, fd);
unbind_to (count1, Qnil);
......
......@@ -1268,7 +1268,7 @@ define_charset_internal (Lisp_Object name,
args[charset_arg_plist] =
listn (CONSTYPE_HEAP, 14,
intern_c_string (":name"),
QCname,
args[charset_arg_name],
intern_c_string (":dimension"),
args[charset_arg_dimension],
......@@ -1278,7 +1278,7 @@ define_charset_internal (Lisp_Object name,
args[charset_arg_iso_final],
intern_c_string (":emacs-mule-id"),
args[charset_arg_emacs_mule_id],
intern_c_string (":ascii-compatible-p"),
QCascii_compatible_p,
args[charset_arg_ascii_compatible_p],
intern_c_string (":code-offset"),
args[charset_arg_code_offset]);
......
......@@ -11281,15 +11281,15 @@ internal character representation. */);
Lisp_Object plist[] =
{
intern_c_string (":name"),
QCname,
args[coding_arg_name] = Qno_conversion,
intern_c_string (":mnemonic"),
QCmnemonic,
args[coding_arg_mnemonic] = make_number ('='),
intern_c_string (":coding-type"),
args[coding_arg_coding_type] = Qraw_text,
intern_c_string (":ascii-compatible-p"),
QCascii_compatible_p,
args[coding_arg_ascii_compatible_p] = Qt,
intern_c_string (":default-char"),
QCdefault_char,
args[coding_arg_default_char] = make_number (0),
intern_c_string (":for-unibyte"),
args[coding_arg_for_unibyte] = Qt,
......
......@@ -4973,8 +4973,7 @@ of the buffer being accessed. */);
/* Do this here, because init_buffer_once is too early--it won't work. */
Fset_buffer (Vprin1_to_string_buffer);
/* Make sure buffer-access-fontify-functions is nil in this buffer. */
Fset (Fmake_local_variable (intern_c_string ("buffer-access-fontify-functions")),
Qnil);
Fset (Fmake_local_variable (Qbuffer_access_fontify_functions), Qnil);
Fset_buffer (obuf);
}
......
......@@ -1570,13 +1570,11 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
if (filename_from_ansi (file, file_utf8) == 0)
file = file_utf8;
#endif
Vtop_level = list2 (intern_c_string ("load"),
build_unibyte_string (file));
Vtop_level = list2 (Qload, build_unibyte_string (file));
}
/* Unless next switch is -nl, load "loadup.el" first thing. */
if (! no_loadup)
Vtop_level = list2 (intern_c_string ("load"),
build_string ("loadup.el"));
Vtop_level = list2 (Qload, build_string ("loadup.el"));
}
/* Set up for profiling. This is known to work on FreeBSD,
......
......@@ -5093,7 +5093,7 @@ syms_of_fns (void)
DEFVAR_LISP ("features", Vfeatures,
doc: /* A list of symbols which are the features of the executing Emacs.
Used by `featurep' and `require', and altered by `provide'. */);
Vfeatures = list1 (intern_c_string ("emacs"));
Vfeatures = list1 (Qemacs);
DEFSYM (Qsubfeatures, "subfeatures");
DEFSYM (Qfuncall, "funcall");
......
......@@ -1544,7 +1544,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
}
}
is_tooltip_frame = !NILP (Fframe_parameter (frame, intern ("tooltip")));
is_tooltip_frame = !NILP (Fframe_parameter (frame, Qtooltip));
/* Run `delete-frame-functions' unless FORCE is `noelisp' or
frame is a tooltip. FORCE is set to `noelisp' when handling
......@@ -2533,7 +2533,7 @@ If FRAME is omitted or nil, return information on the currently selected frame.
else
store_in_alist (&alist, Qbackground_color,
tty_color_name (f, FRAME_BACKGROUND_PIXEL (f)));
store_in_alist (&alist, intern ("font"),
store_in_alist (&alist, Qfont,
build_string (FRAME_MSDOS_P (f)
? "ms-dos"
: FRAME_W32_P (f) ? "w32term"
......
......@@ -2659,7 +2659,6 @@ syms_of_ftfont (void)
DEFSYM (Qmonospace, "monospace");
DEFSYM (Qsans_serif, "sans-serif");
DEFSYM (Qserif, "serif");
DEFSYM (Qmono, "mono");
DEFSYM (Qsans, "sans");
DEFSYM (Qsans__serif, "sans serif");
......
......@@ -11598,7 +11598,7 @@ and the minor mode maps regardless of `overriding-local-map'. */);
DEFVAR_LISP ("special-event-map", Vspecial_event_map,
doc: /* Keymap defining bindings for special events to execute at low level. */);
Vspecial_event_map = list1 (intern_c_string ("keymap"));
Vspecial_event_map = list1 (Qkeymap);
DEFVAR_LISP ("track-mouse", do_mouse_tracking,
doc: /* Non-nil means generate motion events for mouse motion. */);
......
......@@ -3730,8 +3730,8 @@ be preferred. */);
staticpro (&Vmouse_events);
Vmouse_events = listn (CONSTYPE_PURE, 9,
Qmenu_bar,
intern_c_string ("tool-bar"),
intern_c_string ("header-line"),
Qtool_bar,
Qheader_line,
Qmode_line,
intern_c_string ("mouse-1"),
intern_c_string ("mouse-2"),
......
......@@ -395,7 +395,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
Lisp_Object dummy, frame;
specbind (Qminibuffer_default, defalt);
specbind (intern ("inhibit-read-only"), Qnil);
specbind (Qinhibit_read_only, Qnil);
/* If Vminibuffer_completing_file_name is `lambda' on entry, it was t
in previous recursive minibuffer, but was not set explicitly
......@@ -2070,9 +2070,7 @@ with completion; they always discard text properties. */);
doc: /* Text properties that are added to minibuffer prompts.
These are in addition to the basic `field' property, and stickiness
properties. */);
/* We use `intern' here instead of Qread_only to avoid
initialization-order problems. */
Vminibuffer_prompt_properties = list2 (intern_c_string ("read-only"), Qt);
Vminibuffer_prompt_properties = list2 (Qread_only, Qt);
DEFVAR_LISP ("read-hide-char", Vread_hide_char,
doc: /* Whether to hide input characters in noninteractive mode.
......
......@@ -849,9 +849,9 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
switch (arg)
{
case FILLED_BOX_CURSOR: return Qbox;
case HOLLOW_BOX_CURSOR: return intern ("hollow");
case HBAR_CURSOR: return intern ("hbar");
case BAR_CURSOR: return intern ("bar");
case HOLLOW_BOX_CURSOR: return Qhollow;
case HBAR_CURSOR: return Qhbar;
case BAR_CURSOR: return Qbar;
case NO_CURSOR:
default: return intern ("no");
}
......
......@@ -2356,8 +2356,7 @@ inherits it if NONSTICKINESS is nil. The `front-sticky' and
/* Text properties `syntax-table'and `display' should be nonsticky
by default. */
Vtext_property_default_nonsticky
= list2 (Fcons (intern_c_string ("syntax-table"), Qt),
Fcons (intern_c_string ("display"), Qt));
= list2 (Fcons (Qsyntax_table, Qt), Fcons (Qdisplay, Qt));
staticpro (&interval_insert_behind_hooks);
staticpro (&interval_insert_in_front_hooks);
......
......@@ -22656,7 +22656,7 @@ are the selected window and the WINDOW's buffer). */)
else
{
mode_line_string_list = Fnreverse (mode_line_string_list);
str = Fmapconcat (intern ("identity"), mode_line_string_list,
str = Fmapconcat (Qidentity, mode_line_string_list,
empty_unibyte_string);
}
......@@ -30491,8 +30491,7 @@ syms_of_xdisp (void)
DEFSYM (Qinhibit_free_realized_faces, "inhibit-free-realized-faces");
list_of_error = list1 (list2 (intern_c_string ("error"),
intern_c_string ("void-variable")));
list_of_error = list1 (list2 (Qerror, Qvoid_variable));
staticpro (&list_of_error);
/* Values of those variables at last redisplay are stored as
......
......@@ -5185,7 +5185,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
Lisp_Object disptype;
if (FRAME_DISPLAY_INFO (f)->n_planes == 1)
disptype = intern ("mono");
disptype = Qmono;
else if (FRAME_DISPLAY_INFO (f)->visual->class == GrayScale
|| FRAME_DISPLAY_INFO (f)->visual->class == StaticGray)
disptype = intern ("grayscale");
......@@ -6007,7 +6007,7 @@ nil, it defaults to the selected frame. */)
GCPRO2 (font_param, font);
XSETFONT (font, FRAME_FONT (f));
font_param = Ffont_get (font, intern (":name"));
font_param = Ffont_get (font, QCname);
if (STRINGP (font_param))
default_name = xlispstrdup (font_param);
else
......@@ -6194,6 +6194,7 @@ syms_of_xfns (void)
DEFSYM (Qcompound_text, "compound-text");
DEFSYM (Qcancel_timer, "cancel-timer");
DEFSYM (Qfont_param, "font-parameter");
DEFSYM (Qmono, "mono");
Fput (Qundefined_color, Qerror_conditions,
listn (CONSTYPE_PURE, 2, Qundefined_color, Qerror));
......
......@@ -237,8 +237,7 @@ parse_region (Lisp_Object start, Lisp_Object end, Lisp_Object base_url,
if (node != NULL)
result = make_dom (node);
} else
result = Fcons (intern ("top"),
Fcons (Qnil, Fnreverse (Fcons (r, result))));
result = Fcons (Qtop, Fcons (Qnil, Fnreverse (Fcons (r, result))));
xmlFreeDoc (doc);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment