+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
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));
defsubr (&Soverlay_get);
defsubr (&Soverlay_put);
defsubr (&Srestore_buffer_modified_p);
+
+ Fput (intern_c_string ("erase-buffer"), Qdisabled, Qt);
}
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);
}
/* 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):
{
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);
}
{
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);
}
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);
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],
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]);
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,
/* 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);
}
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,
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");
}
}
- 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
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"
DEFSYM (Qmonospace, "monospace");
DEFSYM (Qsans_serif, "sans-serif");
DEFSYM (Qserif, "serif");
- DEFSYM (Qmono, "mono");
DEFSYM (Qsans, "sans");
DEFSYM (Qsans__serif, "sans serif");
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. */);
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"),
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
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.
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");
}
/* 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);
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);
}
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
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");
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
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));
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);
}