| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The specpdl_ref type is just an alias for ptrdiff_t; the compiled code
remains the same. All operations on specpdl_ref (arithmetic,
comparison etc) now go through inline functions.
The bulk of the change is almost completely mechanical. It is done to
prepare for a type-safe representation and subsequent performance
improvement.
* src/lisp.h (specpdl_ref, specpdl_count_to_ref, specpdl_ref_to_count)
(specpdl_ref_eq, specpdl_ref_lt, specpdl_ref_valid_p)
(make_invalid_specpdl_ref, specpdl_ref_add, specpdl_ref_to_ptr): New.
(SPECPDL_INDEX, struct handler, USE_SAFE_ALLOCA, safe_free)
(safe_free_unbind_to):
* src/alloc.c (run_finalizer_function, inhibit_garbage_collection)
(garbage_collect, Fgarbage_collect, which_symbols):
* src/bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start):
* src/buffer.c (Fkill_buffer, Fset_buffer_major_mode, Fmove_overlay)
(Fdelete_overlay):
* src/bytecode.c (exec_byte_code):
* src/callint.c (Ffuncall_interactively, Fcall_interactively):
* src/callproc.c (Fcall_process, call_process, create_temp_file)
(Fcall_process_region):
* src/charset.c (load_charset_map_from_file):
* src/coding.c (decode_coding_gap, decode_coding_object)
(encode_coding_object, Fread_coding_system):
* src/comp.c (emit_static_object, helper_unbind_n, load_comp_unit):
* src/composite.c (update_compositions, autocmp_chars):
* src/cygw32.c (conv_filename_to_w32_unicode)
(conv_filename_from_w32_unicode):
* src/data.c (notify_variable_watchers):
* src/decompress.c (Fzlib_decompress_region):
* src/dired.c (directory_files_internal, file_name_completion)
(file_attributes):
* src/dispnew.c (Fredisplay):
* src/doc.c (get_doc_string, Fsnarf_documentation):
* src/editfns.c (Fsave_excursion, Fsave_current_buffer)
(Freplace_buffer_contents, Fsubst_char_in_region, Fsave_restriction)
(styled_format):
* src/emacs-module.c (Fmodule_load, funcall_module):
* src/emacs.c (init_cmdargs, Fdump_emacs):
* src/eval.c (call_debugger, do_debug_on_call, FletX, Flet)
(Ffuncall_with_delayed_message, Funwind_protect)
(internal_lisp_condition_case, signal_or_quit)
(load_with_autoload_queue, Feval, grow_specpdl_allocation)
(record_in_backtrace, eval_sub, Ffuncall, apply_lambda)
(funcall_lambda, clear_unwind_protect, set_unwind_protect)
(set_unwind_protect_ptr, unbind_to, Fbacktrace_eval):
* src/fileio.c (Fmake_temp_file_internal, Fcopy_file, Frename_file)
(Finsert_file_contents, write_region, Fdo_auto_save):
* src/fns.c (Fyes_or_no_p, Frequire, hash_table_user_defined_call):
* src/fringe.c (update_window_fringes):
* src/gtkutil.c (xg_dialog_run):
* src/haiku_io.c (c_specpdl_idx_from_cxx):
* src/haiku_support.cc (be_popup_file_dialog):
* src/haiku_support.h (c_specpdl_idx_from_cxx):
* src/haikufns.c (haiku_create_frame, haiku_create_tip_frame)
(haiku_hide_tip, Fx_show_tip, Fhaiku_read_file_name):
* src/haikumenu.c (haiku_popup_dialog, set_frame_menubar):
* src/image.c (slurp_file):
* src/indent.c (line_number_display_width, Fvertical_motion):
* src/insdel.c (signal_before_change, signal_after_change)
(Fcombine_after_change_execute):
* src/intervals.c (get_local_map):
* src/json.c (lisp_to_json_nonscalar_1, Fjson_serialize, Fjson_insert)
(Fjson_parse_string, Fjson_parse_buffer):
* src/keyboard.c (recursive_edit_1, Frecursive_edit, cmd_error)
(Finternal_track_mouse, command_loop_1, read_menu_command)
(safe_run_hooks, read_event_from_main_queue, read_char, timer_check_2)
(menu_item_eval_property, read_key_sequence, read_key_sequence_vs)
(Fsuspend_emacs):
* src/keymap.c (Fcurrent_active_maps, Fdescribe_vector)
(Fhelp__describe_vector):
* src/lread.c (Fload, save_match_data_load, readevalloop)
(Feval_buffer, Feval_region, grow_read_buffer, read_integer, read1):
* src/macros.c (Fexecute_kbd_macro):
* src/menu.c (x_popup_menu_1):
* src/minibuf.c (read_minibuf, set_minibuffer_mode)
(read_minibuf_unwind, Fread_string, Fread_buffer):
* src/nsfns.m (Fx_create_frame, Fx_show_tip):
* src/nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
* src/pdumper.c (Fdump_emacs_portable):
* src/pgtkfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip)
(Fx_show_tip, Fpgtk_print_frames_dialog, Fx_file_dialog, Fx_select_font):
* src/pgtkmenu.c (set_frame_menubar, create_and_show_popup_menu)
(pgtk_menu_show, create_and_show_dialog, pgtk_dialog_show)
(pgtk_popup_dialog):
* src/pgtkterm.c (pgtk_cr_export_frames):
* src/print.c (PRINTPREPARE, temp_output_buffer_setup)
(Fprin1_to_string, print_vectorlike):
* src/process.c (Fmake_process, create_process, Fmake_pipe_process)
(Fmake_serial_process, connect_network_socket, Fmake_network_process)
(network_interface_info, server_accept_connection)
(wait_reading_process_output, read_process_output, exec_sentinel):
* src/regex-emacs.c (re_match_2_internal):
* src/search.c (looking_at_1, fast_looking_at, search_buffer_re):
* src/sound.c (Fplay_sound_internal):
* src/sysdep.c (system_process_attributes):
* src/term.c (tty_menu_show):
* src/textprop.c (Fnext_single_char_property_change)
(Fprevious_single_char_property_change, add_text_properties_1)
(set_text_properties, set_text_properties_1, Fremove_text_properties)
(Fremove_list_of_text_properties):
* src/thread.c (Fmutex_lock, invoke_thread_function):
* src/undo.c (truncate_undo_list):
* src/w32fns.c (Fx_create_frame, w32_create_tip_frame, w32_hide_tip)
(Fx_show_tip, Fx_file_dialog):
* src/w32font.c (Fx_select_font):
* src/w32menu.c (set_frame_menubar):
* src/window.c (window_list, next_window, window_list_1)
(run_window_configuration_change_hook, Frun_window_scroll_functions)
(run_window_change_functions, set_window_buffer)
(temp_output_buffer_show, window_scroll, scroll_command)
(Fscroll_other_window, Fscroll_other_window_down):
* src/xdisp.c (safe__call, handle_fontified_prop, handle_face_prop)
(handle_single_display_spec, Fbuffer_text_pixel_size)
(message_dolog, with_echo_area_buffer, setup_echo_area_for_printing)
(display_echo_area, set_message, clear_message, echo_area_display)
(gui_consider_frame_title, prepare_menu_bars, update_menu_bar)
(update_tab_bar, update_tool_bar, redisplay_internal)
(redisplay_preserve_echo_area, run_window_scroll_functions)
(redisplay_window, extend_face_to_end_of_line)
(display_count_lines_logically, display_count_lines_visually)
(display_mode_lines, display_mode_line, Fformat_mode_line)
(decode_mode_spec):
* src/xfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip)
(Fx_show_tip, Fx_file_dialog, Fx_select_font, Fx_print_frames_dialog):
* src/xmenu.c (set_frame_menubar, create_and_show_popup_menu)
(x_menu_show, create_and_show_dialog, x_dialog_show)
(xw_popup_dialog):
* src/xselect.c (x_get_local_selection, x_reply_selection_request)
(x_handle_selection_request, wait_for_property_change):
* src/xterm.c (x_cr_export_frames, x_connection_closed):
Replace ptrdiff_t with specpdl_ref for referencing specpdl and use the
corresponding functions instead of direct arithmetic.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rework the code we have in Fdefalias that tries to keep track
of definitions so as to be able to undo them later.
We used to store in `load-history` when an autoload is redefined as
a non-autoload and in the `autoload` symbol property we used to store
the autoload data that used to be used before it got overriden.
Instead, store the history of the function definition of
a symbol in its `function-history` symbol property.
To make this list cheap in the default case, the latest value is not stored
in the list (since it's in the `symbol-function`) and neither is the first
file. So if there's only been a single definition (the most common case),
the list is empty and the property is just not present at all.
The patch also gets rid of the `autoload` vs `defun` distinction in
`load-history` which seems unnecessary (a significant part of the
motivation for this patch was to get rid of the special handling of
autoloads in this part of the code).
* src/data.c (add_to_function_history): New function.
(defalias): Use it. Don't add the `t` entries for autoloads and always
use `defun` regardless of the kind of definition.
Change `Vautoload_queue` to only hold the function
symbols since the rest is now available from `function-history`.
* src/eval.c (un_autoload): Adjust accordingly.
* src/lread.c (load-history): Udate docstring.
* lisp/loadhist.el (loadhist-unload-filename): New var.
(unload-feature): Bind it.
(loadhist-unload-element): Document its availability.
(loadhist--restore-autoload): Delete var.
(loadhist--unload-function): Delete function.
(loadhist-unload-element): Delete the `t` and `autoload` methods.
Rewrite the `defun` method using `function-history`.
* lisp/help-fns.el: Require `seq`.
(help-fns--autoloaded-p): Rewrite.
(help-fns-function-description-header): Adjust call accordingly.
* doc/lispref/loading.texi (Where Defined): Remove `autoload` and `t`
entries from `load-history` since we don't generate them any more.
Document the `function-history` which replaces the `autoload` property.
(Unloading): Adjust symbol property name accordingly.
* test/lisp/loadhist-resources/loadhist--bar.el:
* test/lisp/loadhist-resources/loadhist--foo.el: New files.
* test/lisp/loadhist-tests.el (loadhist-tests-unload-feature-nested)
(loadhist-tests-unload-feature-notnested): New tests.
|
|
|
|
|
|
|
| |
This reverts commit 701ec0bda2b15fc97af6ca68fb842fb1ec9aac35.
This change broke display of `C-q-' when doing the `C-q' command,
so it has to be fixed a different way.
|
|
|
|
|
|
|
|
| |
* src/keyboard.c (read_char): Don't touch the echo area if
Vecho_keystrokes is nil.
* src/lread.c (read_filtered_event): Bind echo_keystrokes to nil
to avoid outputting prefixes we're not going to act on anyway
(bug#19718).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid making a copy (in the interpreter C stack frame) of the bytecode
string by making sure it won't be moved by the GC. This is done by
reallocating it to the heap normally only used for large strings,
which isn't compacted.
This requires that we retain an explicit reference to the bytecode
string object (`bytestr`) lest it be GCed away should all other
references vanish during execution. We allocate an extra stack slot
for that, as we already do for the constant vector object.
* src/alloc.c (allocate_string_data): Add `immovable` argument.
(resize_string_data, make_clear_multibyte_string): Use it.
(pin_string): New.
* src/pdumper.c (dump_string): Fix incorrect comment.
Update hash for Lisp_String (only comments changed, not contents).
* src/lread.c (read1):
* src/alloc.c (Fmake_byte_code, purecopy):
* src/bytecode.c (Fbyte_code): Pin bytecode on object creation.
(exec_byte_code): Don't copy bytecode. Retain `bytestr` explicitly.
* src/lisp.h (Lisp_String): Explain special size_byte values.
(string_immovable_p): New.
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are remnants of the old way of determining byte compiler warning
positions.
* src/lread.c (read_internal_start, read1): Remove initializations amd
manipulations of these variables.
(syms_of_lread): Remove the declarations of the variables.
* lisp/emacs-list/bytecomp.el (compile-defun, byte-compile-from-buffer):
Remove bindings of the variables.
|
|
|
|
|
| |
* src/lread.c (syms_of_lread): Revert the other bits related to
reverting `byte-compile-from-buffer'/`load-read-file'.
|
|\ |
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
1. Check the type (symbol with position) of the argument given to the native
compiled version of SYMBOL_WITH_POS_SYM.
2. Handle infinite recursion caused by circular lists, etc., in
macroexp-strip-symbol-positions by using hash tables.
3. Read byte compiled functions without giving symbols positions.
* lisp/emacs-lisp/comp.el (comp-finalize-relocs): Add symbol-with-pos-p into
the list of relocated symbols.
* lisp/emacs-lisp/macroexp.el (macroexp--ssp-conses-seen)
(macroexp--ssp-vectors-seen, macroexp--ssp-records-seen): Renamed, and
animated as hash tables.
(macroexp--strip-s-p-2): Optionally tests for the presence of an argument in
one of the above hash tables, so as to handle otherwise infinite recursion.
(byte-compile-strip-s-p-1): Add a condition-case to handle infinite recursion
caused by circular lists etc., using the above hash tables as required.
* src/comp.c (comp_t): New element symbol_with_pos_sym.
(emit_SYMBOL_WITH_POS_SYM): Amend just to call the new SYMBOL_WITH_POS_SYM.
(emit_CHECK_SYMBOL_WITH_POS, define_SYMBOL_WITH_POS_SYM): New functions.
(Fcomp__init_ctxt): Register an emitter for Qsymbol_with_pos_p.
(Fcomp__compile_ctxt_to_file): Call define_SYMBOL_WITH_POS_SYM.
(syms_of_comp): Define Qsymbol_with_pos_p.
* src/data.c (syms_of_data): Define a new error symbol Qrecursion_error, an
error category for the new error symbols Qexcessive_variable_binding and
Qexcessive_lisp_nesting.
* src/eval.c (grow_specpdl): Change the signal_error call to an xsignal0 call
using the new error symbol Qexcessive_variable_binding.
(eval_sub, Ffuncall): Change the `error' calls to xsignal using the new error
symbol Qexcessive_lisp_nesting.
* src/lread.c (read1): When reading a compiled function, read the components
of the vector without giving its symbols a position.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The position return by read-positioning-symbols is now the position in the
buffer, rather than the offset from the start of a form, enabling warning
positions in other parts of the buffer to be output.
* src/lisp.h (lisp_h_EQ): Add XLI casts so that it compiles cleanly.
* src/data.c (Fremove_pos_from_symbol): New DEFUN.
* src/lread.c (readchar_count): renamed to readchar_offset.
(read_internal_start) Initialize readchar_offset to the buffer's point when
STREAM is a buffer.
* lisp/emacs-lisp/bytecomp.el (byte-compile-warning-prefix): Amend to use
OFFSET as a buffer position, not an offset from the start of a form.
(byte-compile-warn): Remove symbol positions from any shape of ARGS, not just
a symbol with position.
* lisp/emacs-lisp/cconv.c (cconv-convert): In the :unused case, position the
new IGNORE symbol with the VAR it has replaced.
* lisp/emacs-lisp/macroexp.el (macroexp--warn-wrap, macroexp-warn-and-return):
Add an extra position parameter to each.
* lisp/emacs-lisp/bindat.el (bindat-type), lisp/emacs-lisp/byte-run.el
(defmacro, defun), lisp/emacs-lisp/cconv.el (cconv--convert-func-body)
(cconv-convert), lisp/emacs-lisp/cl-generic.el (cl-defmethod),
lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet, cl-defstruct),
lisp/emacs-lisp/easy-mmode.el (define-minor-mode),
lisp/emacs-lisp/eieio-core.el (eieio-oref, eieio-oref-default)
(eieio-oset-default), lisp/emacs-lisp/eieio.el (defclass),
lisp/emacs-lisp/gv.el (gv-ref), lisp/emacs-lisp/macroexp.el
(macroexp-macroexpand, macroexp--unfold-lambda, macroexp--expand-all),
lisp/emacs-lisp/pcase.el (pcase-compile-patterns, pcase--u1): Add an extra
position argument to each call of macroexp-warn-and-return.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This branch is intended to generate correct position information in warning
and error messages from the byte compiler, and is intended thereby to fix bugs
It introduces a new mechanism, the symbol with position. This is taken over
from the previous git branch scratch/accurate-warning-pos which was abandoned
for being too slow. The main difference in the current branch is that the
symbol `nil' is never given a position, thus speeding up NILP markedly.
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-optimize-form-code-walker, byte-optimize-let-form, byte-optimize-while)
(byte-optimize-apply): Use byte-compile-warn-x in place of byte-compile-warn.
* lisp/emacs-lisp/bytecomp.el (byte-compile--form-stack): New variable.
(byte-compile-strip-s-p-1, byte-compile-strip-symbol-positions): New
functions.
(byte-compile-recurse-toplevel, byte-compile-initial-macro-environment)
(byte-compile-preprocess, byte-compile-macroexpand-declare-function): Bind
print-symbols-bare to non-nil.
(byte-compile--first-symbol, byte-compile--warning-source-offset): New
functions.
(byte-compile-warning-prefix): Modify to output two sets of position
information, the old (incorrect) set and the new set.
(byte-compile-warn): Strip positions from symbols before outputting.
(byte-compile-warn-x): New function which outputs a correct position supplied
in an argument.
(byte-compile-warn-obsolete, byte-compile-emit-callargs-warn)
(byte-compile-format-warn, byte-compile-nogroup-warn)
(byte-compile-arglist-warn, byte-compile-docstring-length-warn)
(byte-compile-warn-about-unresolved-functions, byte-compile-file)
(byte-compile--check-prefixed-var, byte-compile--declare-var)
(byte-compile-file-form-defvar-function, byte-compile-file-form-defmumble)
(byte-compile-check-lambda-list, byte-compile--warn-lexical-dynamic)
(byte-compile-lambda, byte-compile-form, byte-compile-normal-call)
(byte-compile-check-variable, byte-compile-free-vars-warn)
(byte-compile-subr-wrong-args, byte-compile-fset, byte-compile-set-default)
(byte-compile-condition-case, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-make-variable-buffer-local, byte-compile-define-symbol-prop)
(byte-compile-define-keymap): Replace byte-compile-warn with
byte-compile-warn-x.
(byte-compile-file, compile-defun): Bind symbols-with-pos-enabled to non-nil.
(compile-defun, byte-compile-from-buffer): Use `read-positioning-symbols'
rather than plain `read'.
(byte-compile-toplevel-file-form, byte-compile-form): Dynamically bind
byte-compile--form-stack.
(byte-compile-file-form-autoload, byte-compile-file-form-defvar)
(byte-compile-file-form-make-obsolete, byte-compile-lambda)
(byte-compile-push-constant, byte-compile-cond-jump-table)
(byte-compile-define-keymap, byte-compile-annotate-call-tree):
Strip positions from symbols where they are unwanted.
(byte-compile-file-form-defvar): Strip positions from symbols using
`bare-symbol'.
(byte-compile-file-form-defmumble): New variable bare-name, a version of name
without its position.
(byte-compile-lambda): Similarly, new variable bare-arglist.
(byte-compile-free-vars-warn): New argument arg supplying position information
to byte-compile-warn-x.
(byte-compile-push-constant): Manipulation of symbol positions.
(display-call-tree): Strip positions from symbols.
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use)
(cconv--analyze-function, cconv-analyze-form): Replace use of
byte-compile-warn with byte-compile-warn-x.
* lisp/emacs-lisp/cl-generic.el (cl-defmethod): New variable org-name which
will supply position information to a new macroexp-warn-and-return.
* lisp/emacs-lisp/cl-macs.el (cl-macs--strip-s-p-1)
(cl-macs--strip-symbol-positions): New functions to strip positions from
symbols in an expression. These duplicaate similarly named functions in
bytecomp.el.
* lisp/emacs-lisp/macroexpand.el (macroexp--warn-wrap): Calls
byte-compile-warn-x in place of byte-compile-warn.
(macroexp-warn-and-return): Commented out new position parameter _arg.
* src/.gdbinit: Add in code to handle symbols with position.
* src/alloc.c (XPNTR, set_symbol_name, valid_lisp_object_p, purecopy)
(mark_char_table, mark_object, survives_gc_p, symbol_uses_obj): Use
BARE_SYMBOL_P and XBARE_SYMBOL in place of the former SYMBOLP and XSYMBOL.
(build_symbol_with_pos): New function.
(Fgarbage_collect): Bind Qsymbols_with_pos_enabled to nil around the call to
garbage_collect.
* src/data.c (Ftype_of): Add case for PVEC_SYMBOL_WITH_POS.
(Fbare_symbol_p, Fsymbol_with_pos_p, Fbare_symbol, Fsymbol_with_pos_pos)
(Fposition_symbol): New functions.
(symbols_with_pos_enabled): New boolean variable.
* src/fns.c (internal_equal, hash_lookup): Handle symbols with position.
* src/keyboard.c (recursive_edit_1): Bind Qsymbols_with_pos_enabled and
Qprint_symbols_bare to nil.
* src/lisp.h (lisp_h_PSEUDOVECTORP): New macro.
(lisp_h_BASE_EQ): New name for the former lisp_h_EQ.
(lisp_h_EQ): Extended to handle symbols with position.
(lisp_h_NILP): Now uses BASE_EQ rather than EQ.
(lisp_h_SYMBOL_WITH_POS_P, lisp_h_BARE_SYMBOL_P): New macros.
(lisp_h_SYMBOLP): Redefined to handle symbols with position.
(BARE_SYMBOL_P, BASE_EQ): New macros.
(SYMBOLP (macro)): Removed.
(SYMBOLP (function), XSYMBOL, make_lisp_symbol, builtin_lisp_symbol)
(c_symbol_p): Moved to later in file.
(struct Lisp_Symbol_With_Pos): New data type.
(pvec_type): PVEC_SYMBOL_WITH_POS: New type code.
(PSEUDOVECTORP): Redefined to use the lisp_h_PSEUDOVECTORP.
(BARE_SYMBOL_P, SYMBOL_WITH_POS_P, SYMBOLP, XSYMBOL_WITH_POS, XBARE_SYMBOL)
(XSYMBOL, make_lisp_symbol, builtin_lisp_symbol, c_symbol_p, CHECK_SYMBOL)
(BASE_EQ): New functions, or functions moved from earlier in the file.
(SYMBOL_WITH_POS_SYM, SYMBOL_WITH_POS_POS): New INLINE functions.
* src/lread.c (read0, read1, read_list, read_vector, read_internal_start)
(list2): Add a new bool parameter locate_syms.
(Fread_positioning_symbols): New function.
(Fread_from_string, read_internal_start, read0, read1, read_list): Pass around
suitable values for locate_syms.
(read1): Build symbols with position when locate_syms is true.
* src/print.c (print_vectorlike): Add handling for PVEC_SYMBOL_WITH_POS.
(print_object): Replace EQ with BASE_EQ.
(print_symbols_bare): New boolean variable.
|
| |/
|/|
| |
| |
| |
| |
| | |
* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Use
load-read-function.
* src/lread.c (syms_of_lread): Adjust doc string (bug#33723).
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.
# Conflicts:
# etc/NEWS
# etc/refcards/ru-refcard.tex
# lib/cdefs.h
# lisp/erc/erc-dcc.el
# lisp/erc/erc-imenu.el
# lisp/erc/erc-replace.el
# lisp/image-dired.el
# lisp/progmodes/xref.el
# m4/alloca.m4
# m4/byteswap.m4
# m4/errno_h.m4
# m4/getopt.m4
# m4/gnulib-common.m4
# m4/inttypes.m4
# m4/stddef_h.m4
# m4/stdint.m4
# m4/sys_socket_h.m4
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Since the location of those files changes between build time and
installation time, this requires to tweak the file name used in those
(#$ . NNN) references during the dump so they don't hardcode the build
directory. We do it in the same way as was already done for those
same file names in `load-history`, except we convert them back to
absolute file names more lazily (i.e. when fetching the actual
docstring rather than at startup), which requires remembering the
`lisp-dir` computed at startup in the new `lisp-directory` variable.
* src/Makefile.in ($(etc)/DOC): Don't scan Lisp files any more.
* src/lread.c (Fload): Use relative file names for `load-file-name`
when preloading for the dump, like we already did for `current-load-list`.
(read_list): Don't zero-out dynamic docstring references during the
preload since they won't be filled later by Snarf-documentation any more.
(read1): Remove the hash-hack for doc references that were zeroed.
* lisp/startup.el (lisp-directory): New variable.
(command-line): Set it.
* src/doc.c (get_doc_string): Use `lisp-directory` for dynamic
docstring references using relative file names.
(syms_of_doc): Add `Qlisp_directory`.
* lib-src/make-docfile.c (scan_file): Don't handle `.el` or `.elc`
files any more.
(IS_SLASH): Remove macro, not used any more.
(skip_white, read_lisp_symbol, search_lisp_doc_at_eol)
(scan_lisp_file): Remove functions, not used any more.
* doc/lispref/loading.texi (Library Search): Mention `lisp-directory`.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This predicate can be used for discriminating between lexically and
dynamically bound variables during macro-expansion (only).
It is restricted to internal use for the time being.
* lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
Use macroexpand--all-toplevel.
* lisp/emacs-lisp/macroexp.el (macroexp-dynamic-variable-p): New.
(macroexp--expand-all): Maintain macroexp--dynvars.
(macroexpand-all): Rebind macroexp--dynvars.
(macroexpand--all-toplevel): New.
(internal-macroexpand-for-load): Use macroexpand--all-toplevel.
* src/eval.c (eval_sub): Transfer defvar declarations from
Vinternal_interpreter_environment into macroexp--dynvars during
lazy macro-expansion.
* src/lread.c (readevalloop): Rebind macroexp--dynvars around
read-and-evaluate operations.
(syms_of_lread): Define macroexp--dynvars.
* test/lisp/emacs-lisp/macroexp-resources/vk.el: New file.
* test/lisp/emacs-lisp/macroexp-tests.el (macroexp-tests--run-emacs)
(macroexp-tests--eval-in-subprocess)
(macroexp-tests--byte-compile-in-subprocess)
(macroexp--tests-dynamic-variable-p): Add tests.
|
|\| |
| |/
|/|
| |
| |
| |
| |
| |
| |
| | |
9c222b9c1a Port to C compilers that lack size-0 arrays
fed35a8951 Port emacsclient to Solaris 10
f35d6a9c73 * CONTRIBUTE: Improve commit message instructions
e0ee1d003a Work around IBM XL C compiler bug
6b99b6eb8b * admin/make-tarball.txt: Various clarifications.
bbf4140091 * admin/diff-tar-files: Don't assume .tar.gz.
0a50ad11db * lisp/tab-bar.el (tab-bar-close-other-tabs): Fix regression.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The C standard does not allow size-zero arrays, so redo struct
Lisp_Subr to not use size-zero arrays when native compilation is
not being used. Formerly, the code was using size-zero arrays (a
GNU C extension) to avoid using memory unnecessarily when
HAVE_NATIVE_COMP is not defined. Replace this hack with the
more-traditional hack of putting the relevant members inside
‘#ifdef HAVE_NATIVE_COMP’.
* src/alloc.c (cleanup_vector, mark_object):
* src/comp.c (make_subr):
* src/data.c (Fsubr_native_lambda_list, Fsubr_native_comp_unit):
* src/eval.c (init_eval_once, funcall_lambda):
* src/lisp.h (SUBR_NATIVE_COMPILEDP, SUBR_NATIVE_COMPILED_DYNP)
(SUBR_TYPE):
* src/lread.c (Fload):
Conditionally compile with ‘#ifdef HAVE_NATIVE_COMP’ instead of
with ‘if (NATIVE_COMP_FLAG)’. Redo members like native_comp_u[0]
to be plain native_comp_u. Put all uses of these members inside
‘#ifdef HAVE_NATIVE_COMP’.
* src/lisp.h (struct Lisp_Subr): Members native_comp_u,
native_c_name, lambda_list, type are now all ifdeffed out if
HAVE_NATIVE_COMP is not defined, instead of being size-zero
arrays. All uses changed.
* src/pdumper.c (dump_subr, dump_cold_native_subr)
(dump_do_dump_relocation):
* src/comp.h (NATIVE_COMP_FLAG): Remove; no longer needed.
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
| |
* src/lread.c (Fload): Adjust callers.
* src/lread.c (safe_to_load_version): Check lseek errors
(Bug#48940).
Copyright-paperwork-exempt: yes
|
|
|
|
|
|
|
| |
* src/lread.c (read1): Minor stylistic fixes of the last change,
including the wording of the comment.
* doc/lispref/symbols.texi (Shorthands): Fix wording and typos.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This includes symbols used for arithmetic functions such as -, /=,
etc. Using "-" or "/=" is still possible but doing so won't shadow
those functions.
* doc/lispref/symbols.texi (Shorthand, Exceptions): New
subsubsection.
* src/lread.c (read1): Exempt punctionation-only symbols from
oblookup_considering_shorthand.
* test/lisp/progmodes/elisp-mode-tests.el
(elisp-dont-shadow-punctuation-only-symbols): Tweak test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new name fits better in the family of variables that affect
the Lisp reader.
Suggested-by: Po Lu <luangruo@yahoo.com>
* doc/lispref/symbols.texi (Shorthands): Mention read-symbol-shorthands
* lisp/shorthands.el (hack-read-symbol-shorthands)
(hack-read-symbol-shorthands)
(shorthands-font-lock-shorthands): Use read-symbol-shorthands
* lisp/progmodes/elisp-mode.el (elisp--completion-local-symbols)
(elisp--completion-local-symbols)
(elisp-shorthands): Use read-symbol-shorthands
* src/lread.c:
(syms_of_lread): Define Vread_symbol_shorthands
(oblookup_considering_shorthand): Use Vread_symbol_shorthands.
* test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-read-buffer):
(elisp-shorthand-read-from-string): Use read-symbol-shorthands
* test/lisp/progmodes/elisp-mode-resources/simple-shorthand-test.el
Use new symbol name read-symbol-shorthands.
|
|
|
|
|
|
|
|
| |
* src/lread.c (oblookup_considering_shorthand): Now static. Move
prototype to where it belongs.
(read1, Fintern, Fintern_soft, Funintern)
(oblookup_considering_shorthand, syms_of_lread): Fix style of
braces and indentation, comments, and doc strings.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/lread.c (read1): Add skip_shorthand variable. Add a '#_'
case. If skip_shorthand call oblookup instead of
oblookup_considering_shorthand.
* test/lisp/progmodes/elisp-mode-tests.el
(elisp-shorthand-escape): New test.
* test/lisp/progmodes/elisp-resources/simple-shorthand-test.el
(#_f-test4---): New fixture function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of referencing obarray directly, that function has to consider
a collection of completions which includes the shorthand versions of
some of the symbols. That collection changes from buffer to buffer,
depending on the choice of elisp-shorthands.
To make this process efficient, and avoid needless recalculation of
the above collection, a new obarray-specific cache was invented. The
Elisp variable obarray-cache is immediately nullified if something
touches the obarray.
* lisp/progmodes/elisp-mode.el : New helper.
(elisp-completion-at-point): Use new helpers.
(elisp--completion-local-symbols)
(elisp--fboundp-considering-shorthands)
(elisp--bboundp-considering-shorthands): New helpers
* src/lread.c (intern_driver): Nullify Qobarray_cache.
(syms_of_lread): Add Qobarray_cache.
* test/lisp/progmodes/elisp-mode-tests.el
(elisp-shorthand-completion-at-point): New test.
* test/lisp/progmodes/elisp-resources/simple-shorthand-test.el
(f-test-complete-me): New fixture.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This simplification in requirements makes for more complex C code but
that code is much less wasteful in Lisp strings than the previous
implementation.
* src/lread.c (read1): Rework.
(Fintern): Rework.
(Fintern_soft): Rework.
(Funintern): Rework.
(oblookup_considering_shorthand): Rewrite.
* test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-read-buffer)
(elisp-shorthand-read-from-string): Use new format of
elisp-shorthands.
* test/lisp/progmodes/elisp-resources/simple-shorthand-test.el (f-test)
(f-test2, f-test3): Use new form of elisp-shorthands.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It passes the tests designed for the previous Elisp implementation.
Likely, this isn't the final form of the implementation. For one, the
reader is much slower and allocates a Lisp string for every atom read,
regardless if its already interned or not. This has the potential to
be catastrophic in terms of GC.
Also rename the main variable to elisp-shorthands, from the
repetitive shorthand-shorthands.
For some reason, I had to put 'hack-elisp-shorthands' and
'load-with-shorthands-and-code-conversion', the new source-file
loading functions, in lisp/international/mule.el.
Otherwise, lisp/loadup.el wouldn't see them, for some reason that I
didn't investigate. This should probably be fixed.
* lisp/shorthand.el: Remove.
* test/lisp/shorthand-tests.el: Remove.
* src/lread.c:
(read1, Fintern, Fintern_soft, Funintern): Use
oblookup_considering_shorthand.
(oblookup_considering_shorthand): New helper.
(syms_of_lread): Declare elisp-shorthands.
* lisp/progmodes/elisp-mode.el (elisp-shorthands):
Put a safe-local-variable spec.
* test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-read-buffer)
(elisp-shorthand-read-from-string)
(elisp-shorthand-byte-compile-a-file)
(elisp-shorthand-load-a-file): New tests.
* test/lisp/progmodes/elisp-resources/simple-shorthand-test.el: New file
* lisp/loadup.el (load-source-file-function): Set to
load-with-shorthands-and-code-conversion.
* lisp/international/mule.el (hack-elisp-shorthands): Move here.
(load-with-shorthands-and-code-conversion): And here.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The reader has an extra 1-char unread buffer that was incorrectly
initialised to 0, which means that the first character read would
always be NUL. As this is often the code that looks for the
lexical-binding cookie, the first loaded source module would be
treated as dynamically bound. During bootstrapping this is loadup.el
and so its local variables got dumped into the global environment.
* src/lread.c (unread_char): Initialise to empty.
(Fload): Initialise here too just in case.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile.in (ns_applibexecdir):
(ns_applibdir):
(ns_appdir): New variables.
(.PHONY): Include new rule.
(epaths-force-ns-self-contained): Remove the app bundle directory from
all paths.
* configure.ac (NS_SELF_CONTAINED): Set the default site-lisp
directory instead of hard-coding it in the ObjC code, and use the new
epaths generating make rule.
* src/callproc.c (init_callproc_1):
(init_callproc): Remove all the NS specific code as the special cases
are now handled by decode_env_path.
* src/emacs.c (load_pdump):
(decode_env_path): Use ns_relocate to find the correct directory after
relocation.
* src/lread.c (load_path_default): Remove all the NS specific code as
the special cases are now handled by decode_env_path.
* src/nsterm.h: Update function definitions.
* src/nsterm.m (ns_etc_directory):
(ns_exec_path):
(ns_load_path): Remove functions that are no longer needed.
(ns_relocate): New function to calculate paths within the NS app
bundle.
* nextstep/Makefile.in (ns_applibexecdir): New variable, and update
anything relying on the libexec location.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Numbers with a trailing dot and an exponent were incorrectly read as
integers (with the exponent ignored) instead of the floats they should
be. For example, 1.e6 was read as the integer 1, not 1000000.0 as
every sane person would agree was meant. (Bug#48678)
Numbers with a trailing dot but no exponent are still read as
integers.
* src/lread.c (string_to_number): Fix float lexing.
* test/src/lread-tests.el (lread-float): Add test.
* doc/lispref/numbers.texi (Float Basics): Clarify syntax.
|
|
|
|
|
|
| |
* src/lread.c (openp): Use faccessat to check that a file exists
before opening it on Windows (bug#41646). This speeds up
searching for files.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/comp.c (Fcomp_el_to_eln_filename): Rename comp-eln-load-path →
native-comp-eln-load-path.
* src/lread.c (maybe_swap_for_eln): Likewise.
* lisp/startup.el (native-comp-eln-load-path)
(normal-top-level): Likewise.
* lisp/emacs-lisp/comp.el (comp-spill-lap-function, comp-final)
(comp-eln-load-path-eff, comp-trampoline-compile)
(comp-clean-up-stale-eln, comp-run-async-workers)
(comp-lookup-eln, batch-byte-native-compile-for-bootstrap): Likewise.
|
|
|
|
|
|
|
|
|
| |
* src/lread.c (maybe_swap_for_eln): Rename
comp-warning-on-missing-source →
native-comp-warning-on-missing-source.
* src/comp.c (syms_of_comp): Likewise.
* lisp/emacs-lisp/comp.el (native-comp-warning-on-missing-source):
Likewise.
|
|
|
|
|
|
|
|
|
| |
* src/comp.c (fixup_eln_load_path): Account the fact that the
file can be dumped in the 'preloaded' subfolder.
* lisp/loadup.el: Likewise.
* src/lread.c (maybe_swap_for_eln1): New function.
(maybe_swap_for_eln): Handle 'preloaded' subfolder.
* src/Makefile.in (LISP_PRELOADED): Export preloaded files.
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp.el (comp-warning-on-missing-source): New
customize.
* src/lread.c (maybe_swap_for_eln): Issue a warning when eln
look-up fails due to missing .el source file.
* src/comp.c (syms_of_comp): Define
'Qcomp_warning_on_missing_source'.
|
|
|
|
|
|
|
|
|
|
|
| |
* src/comp.c (maybe_defer_native_compilation): Check if the file
is registered in 'V_comp_no_native_file_h'.
(syms_of_comp): 'V_comp_no_native_file_h' new global.
* src/lread.c (maybe_swap_for_eln): Register files in
'V_comp_no_native_file_h'.
* lisp/faces.el (tty-run-terminal-initialization): Do not
explicitly load .elc file to not exclude .eln being loaded in
place.
|
|
|
|
|
| |
* src/lread.c (maybe_swap_for_eln): Add file timestamp check.
(openp): Update 'maybe_swap_for_eln' call sites.
|
| |
|
|
|
|
|
|
|
|
|
| |
* src/comp.c (Fcomp_el_to_eln_rel_filename): New function.
(Fcomp_el_to_eln_filename): Make use of.
(syms_of_comp): Register 'Scomp_el_to_eln_rel_filename'.
* src/lread.c (maybe_swap_for_eln): Make use of
'Fcomp_el_to_eln_rel_filename' to hash prevent unnecessary
multiple hashing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/lread.c (Fload): Do not load native code when `load' is
explicitly called on a .elc file.
(Flocate_file_internal): Update 'openp' call sites.
(maybe_swap_for_eln): Add new 'no_native' parameter.
(openp): Likewise + update 'maybe_swap_for_eln' and 'openp' call
sites.
* src/lisp.h: Update 'openp' signature.
* src/w32proc.c (sys_spawnve): Update 'openp' call sites.
* src/w32.c (check_windows_init_file): Likewise.
* src/sound.c (Fplay_sound_internal): Likewise.
* src/process.c (Fmake_process): Likewise.
* src/image.c (image_create_bitmap_from_file)
(image_find_image_fd): Likewise.
* src/emacs.c (set_invocation_vars): Likewise.
* src/charset.c (load_charset_map_from_file): Likewise.
* src/callproc.c (call_process): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp.el (comp-speed, comp-debug, comp-verbose)
(comp-always-compile, comp-deferred-compilation-deny-list)
(comp-bootstrap-deny-list, comp-never-optimize-functions)
(comp-async-jobs-number, comp-async-cu-done-hook)
(comp-async-all-done-hook, comp-async-env-modifier-form)
(comp-pass, comp-native-compiling, comp-post-pass-hooks)
(comp-known-predicate-p, comp-pred-to-cstr)
(comp-symbol-values-optimizable, comp-limple-assignments)
(comp-limple-calls, comp-limple-branches, comp-block)
(comp-vec--verify-idx, comp-vec-aref, comp-vec-append)
(comp-vec-prepend, comp-block-preds)
(comp-ensure-native-compiler, comp-log, comp-log-func)
(comp-loop-insn-in-block, comp-byte-frame-size)
(comp-add-func-to-ctxt, comp-spill-lap-function, comp-spill-lap)
(comp-lap-fall-through-p, comp-new-frame, comp-emit-set-call)
(comp-copy-slot, comp-latch-make-fill, comp-emit-cond-jump)
(comp-body-eff, comp-op-case, comp-prepare-args-for-top-level)
(comp-limplify-top-level, comp-negate-arithm-cmp-fun)
(comp-emit-assume, comp-cond-cstrs-target-mvar)
(comp-function-foldable-p, comp-function-call-maybe-fold)
(comp-form-tco-call-seq, comp-clean-up-stale-eln)
(comp-delete-or-replace-file, comp--native-compile)
(native--compile-async, native-compile)
(batch-byte-native-compile-for-bootstrap): Fix typos, wording, and
punctuation in doc strings.
* lisp/loadup.el: Fix typos.
* src/lread.c (syms_of_lread): Doc fix.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
* src/lread.c (syms_of_lread): Note that it's obsolete in the doc
string (because we can't mark it as obsolete "properly" yet,
because that leads to compilation warnings when somebody
(let (values) ... values).
|
| |
| |
| |
| |
| |
| | |
* src/lread.c (Fread_char, Fread_event, Fread_char_exclusive):
Call cancel_echoing to make sure the prompt is not obscured by
keystrokes echo. (Bug#46243)
|
| |
| |
| |
| |
| |
| |
| | |
* src/lread.c (invalid_syntax_lisp): Instead of putting the
line/column in a string, signal an error containing the numbers as
data. This allows for easier post-processing and is how other
similar errors (like (forward-sexp 1)) do it.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* src/lisp.h: Add count_lines prototype.
* src/lread.c (invalid_syntax_lisp): New function (bug#36970).
(invalid_syntax): Extend function to take a readcharfun parameter.
(read_emacs_mule_char, character_name_to_code): Pass in.
(read_escape, invalid_radix_integer, read1): Ditto.
* src/xdisp.c (count_lines): Add a more succinct shim over
display_count_lines.
|