summaryrefslogtreecommitdiff
path: root/src/lread.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Introduce 'effective_load_path'AndreaCorallo2020-02-291-1/+23
| | |
* | | * Keep comp-subr-list into pure spaceAndreaCorallo2020-02-291-1/+1
| | | | | | | | | | | | Sad pure space is not effective nowdays but anyway... should go there.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-03-011-18/+5
|\| |
| * | Make 'load-dangerous-libraries' obsolete (Bug#37819)Stefan Kangas2020-03-011-18/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When 'load-dangerous-libraries' was t, Emacs allowed loading .elc files compiled by XEmacs. This patch removes the support for that use case, and declares the variable obsolete. * lisp/subr.el (load-dangerous-libraries): Declare obsolete. * src/lread.c (Fload): Ignore its value, and thereby refuse to load files byte compiled by XEmacs. (syms_of_lread): Update doc string of 'bytecomp-version-regexp' to not refer to it. * doc/emacs/building.texi (Lisp Libraries): Remove its documentation.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-02-211-0/+18
|\| |
| * | Improve C-h C-h bug fixPaul Eggert2020-02-161-4/+7
| | | | | | | | | | | | | | | | | | * src/lread.c (read1): Guard against two 'struct Lisp_Vector *' pointers differing only in their most significant bit. Problem reported by Pip Cet (Bug#39529#22).
| * | * src/lread.c (read1): Fix int/Lisp_Object mix up.Glenn Morris2020-02-161-1/+1
| | | | | | | | | | | | Found by --enable-check-lisp-object-type.
| * | Fix C-h C-h bug due to mutating a hash keyPaul Eggert2020-02-151-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem reported by Federico Tedin (Bug#39529). The problem was that dumping uses a hash table based on 'equal' when purecopying compiled objects, but then modifies the compiled objects while they are keys in the table. This no-no was uncovered by the sxhash fixes in 2020-01-07T19:23:11Z!eggert@cs.ucla.edu. Eli Zaretski pinpointed the patch that triggered the bug. * src/lread.c (read1): When reading a compiled object, replace its docstring with a unique negative integer instead of with 0, so that purecopy doesn’t unify it with some other compiled object that happens to have the same Lisp code.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-02-141-89/+13
|\| |
| * | * src/lread.c: Remove old-style backquotes supportStefan Monnier2020-02-141-89/+13
| | | | | | | | | | | | | | | | | | | | | (new_backquote_flag): Delete variable. (load_error_old_style_backquotes): Delete function. (force_new_style_backquotes): Delete variable. (read_internal_start): Don't obey it any more.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-02-041-3/+3
|\| |
| * | Revert the --with-install-srcdir patchPaul Eggert2020-01-271-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, update description of debuginfo and sources to match Debian and Red Hat more accurately, and move this sad tale from INSTALL to etc/PROBLEMS which is a better home for it. * Makefile.in (emacs_srcdir, install-c-src): * configure.ac (emacs_srcdir, --with-install-srcdir): * src/epaths.in (PATH_EMACS_SOURCE): * src/lread.c (emacs-source-directory): Remove. All uses removed. * lisp/emacs-lisp/find-func.el (find-function-C-source): Do not worry about compressed C sources. * src/lread.c: Do not include <dosname.h>.
| * | Install C source code for C-h f etc.Paul Eggert2020-01-241-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this change, on typical GNU/Linux distributions like Debian, the first button of ‘C-h f car RET’ does not work because the source code for ‘car’ is not installed (Bug#37527). Fix this by installing the (compressed) C source code alongside the (compressed) Lisp source code that is already installed. This adds about 3 MB (about 2%) to the size of the installed files on my platform. * Makefile.in (emacs_srcdir): New macro. (epaths-force): Substitute PATH_EMACS_SOURCE. (install-c-src): New rule, that installs a copy of the C source code if emacs_srcdir says to. (install-arch-indep): Depend on it. * configure.ac (emacs_srcdir): New var. Add support for --disable-install-srcdir. * lisp/emacs-lisp/find-func.el (find-function-C-source-directory): Look in emacs-source-directory first. (find-function-C-source): Also look for gzipped source files. * lisp/startup.el (normal-top-level): Also recode emacs-source-directory. * src/epaths.in (PATH_EMACS_SOURCE): New macro. * src/lread.c: Include dosname.h, for IS_ABSOLUTE_FILE_NAME. (syms_of_lread): New var emacs-source-directory.
| * | Work better if stat etc. are interruptedPaul Eggert2020-01-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quit or retry if fstat, lstat, stat or openat fail with EINTR. This should fix some bugs on platforms where accessing files via NFS can fail that way (Bug#9256). * src/dired.c (file_attributes): * src/fileio.c (file_directory_p) [O_PATH]: Use emacs_openat instead of openat. * src/dired.c (file_attributes): Use emacs_fstatat instead of fstatat. * src/fileio.c (barf_or_query_if_file_exists, Frename_file): * src/filelock.c (rename_lock_file): Use emacs_fstatat instead of lstat. * src/fileio.c (file_directory_p, Ffile_regular_p, Ffile_modes) (Ffile_newer_than_file_p, Fverify_visited_file_modtime) (Fset_visited_file_modtime, auto_save_1): * src/lread.c (Fload): * src/sysdep.c (get_current_dir_name_or_unreachable): Use emacs_fstatat instead of stat. * src/sysdep.c (emacs_fstatat, emacs_openat): New functions. (emacs_open): Redo in terms of emacs_open.
| * | Merge from origin/emacs-27Glenn Morris2020-01-171-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4df0c1c6c4 (origin/emacs-27) ; * src/lread.c (force_new_style_backquo... 069741b2f7 ; * etc/NEWS: Mention latest changes in checkdoc. (Bug#38... a785be29bf Fix wording and punctuation of a recent commit 0d3d3be35c Merge branch 'emacs-27' of git.savannah.gnu.org:/srv/git/e... 5da372e17e ; Minor edit in anti.texi # Conflicts: # etc/NEWS
| | * ; * src/lread.c (force_new_style_backquotes): Fix reference.Simen Heggestøyl2020-01-171-1/+1
| | |
* | | make standard emacs compilable againAndrea Corallo2020-01-011-2/+3
| | |
* | | mitigate ifdef proliferationAndrea Corallo2020-01-011-17/+15
| | |
* | | some style fixesAndrea Corallo2020-01-011-1/+1
| | |
* | | reworking relocation mechanism to use one single tableAndrea Corallo2020-01-011-0/+3
| | |
* | | let intern_c_string works creating with non-pure stringsAndrea Corallo2020-01-011-4/+8
| | |
* | | revert unnecessary modificationsAndrea Corallo2020-01-011-7/+4
| | |
* | | rename HAVE_LIBGCCJIT -> HAVE_NATIVE_COMPAndrea Corallo2020-01-011-3/+3
| | |
* | | better messaging when load native elispAndrea Corallo2020-01-011-0/+2
| | |
* | | move away from modulesAndrea Corallo2020-01-011-14/+31
| | |
* | | fix intern_c_string_1Andrea Corallo2020-01-011-1/+1
| | |
* | | Add native compiler comp.cAndrea Corallo2020-01-011-4/+7
|/ /
* | Merge from origin/emacs-27Paul Eggert2020-01-011-1/+1
|\| | | | | | | | | | | | | | | | | | | | | 186152ba40 Pacify gcc -Wunused-function on Ubuntu 18.04.3 4cd143aded Fix copyright years by hand 365e01cc9f Update copyright year to 2020 cd2c156163 ; * etc/NEWS: Make the description of XDG fallback more ac... # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex
| * Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | | | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* | Support .dylib suffix for modules on macOS (Bug#36226).Philipp Stephani2019-12-251-1/+16
|/ | | | | | | | | | | | | | | | On macOS, shared libraries typically have the suffix .dylib. This commit switches the module suffix to .dylib on Darwin to account for that. To also support the .so suffix, introduce the concept of a secondary module suffix. * configure.ac: Switch MODULES_SUFFIX to .dylib for Darwin, introduce MODULES_SECONDARY_SUFFIX. * src/lread.c (Fload, syms_of_lread): Also use MODULES_SECONDARY_SUFFIX if defined. * test/src/emacs-module-tests.el (module-darwin-secondary-suffix): New unit test.
* * src/lread.c (syms_of_lread): Doc fix.Juanma Barranquero2019-11-301-2/+2
|
* Stop signaling an error when reading "smart quotes" in symbolsNoam Postavsky2019-11-281-7/+0
| | | | | | | | | | | Revert commits from 2018-01-28 "Fix round tripping of read->print for symbols with strange quotes", and 2017-07-22 "Signal error for symbol names with strange quotes (Bug#2967)". * etc/NEWS: Remove corresponding entries. * src/character.c (confusable_symbol_character_p): * test/src/lread-tests.el (lread-tests--old-style-backquotes): Remove. * src/lread.c (read1): Don't signal error on confusable character. * src/print.c (print_object): Don't escape confusable characters.
* Clarify message about newer source fileLars Ingebrigtsen2019-10-141-1/+1
| | | | | * src/lread.c (Fload): Mention which file was actually used instead of just saying that the .el is newer than the .elc (bug#10637).
* Feval_buffer doc string lexical-binding clarificationLars Ingebrigtsen2019-10-071-0/+6
| | | | | * src/lread.c (Feval_buffer): Mention that the lexical-binding variable is ignored in the doc string (bug#20139).
* Remove support for destructive splicing in elispStefan Kangas2019-09-261-3/+0
| | | | | | | | | | * src/lread.c (read1): Don't handle destructive splicing in backquote expressions (e.g. ",.<identifier>"). (Bug#19790) (syms_of_lread): Remove Qcomma_dot. * src/print.c (print_object): Don't check for Qcomma_dot. * test/src/eval-tests.el (eval-tests-19790-backquote-comma-dot-substitution): New test. * etc/NEWS: Announce it.
* Revert too-picky file-access testsPaul Eggert2019-09-211-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Problem reported by Andreas Schwab (Bug#37475). * doc/lispref/files.texi (Writing to Files) (Testing Accessibility, Kinds of Files): Document that accessibility and file-type predicates return nil if there is trouble determining accessibility or type. * etc/NEWS: Adjust, and list the affected primitives. * src/callproc.c (init_callproc): Go back to Ffile_exists_p. * src/fileio.c (PICKY_EACCES, file_test_errno): Remove. All uses removed. (Ffile_name_case_insensitive_p, Ffile_exists_p, Ffile_symlink_p) (Ffile_directory_p, Ffile_regular_p): Document that these functions return nil if there is trouble. (Ffile_name_case_insensitive_p, check_file_access) (Ffile_writable_p, Ffile_symlink_p, Ffile_directory_p) (Ffile_accessible_directory_p, Ffile_regular_p) * src/lread.c (Fload): Go back to treating trouble in determining the answer as if the file were missing. * src/fileio.c (Ffile_newer_than_file_p): Use file_attribute_errno not file_test_errno, since returning nil is not appropriate when there are two files to test; e.g., in the rare cases where both file timestamps have overflowed then neither t nor nil is correct.
* Omit some overenthusiastic file-truename callsPaul Eggert2019-09-181-8/+3
| | | | | | | | | | | | | | | | | Problem reported by Tino Calancha (Bug#37445). * src/emacs.c (init_cmdargs): Call file-truename only if needed, i.e., if invocation-directory ends in "/i386/" on WINDOWSNT. * src/lread.c (readevalloop): If the sourcename is not absolute, make it absolute. There is no need to convert non-absolute files into truenames, since absolute files are not converted into truenames. (init_lread): Do not convert source-directory into a truename at startup. There is no need to do so in a dumped Emacs since an absolute file name suffices. The source directory might not even exist any more, or might have been replaced by an interloper who takes advantage of the truename calculation. (syms_of_lread): Remove Qfile_truename; no longer needed.
* Fix loading .elc files on MS-WindowsEli Zaretskii2019-09-181-3/+4
| | | | | * src/lread.c (Fload): Don't clobber 'found' if the .el file was not found, as it is used by WINDOWSNT later on.
* Out-of-datedness .elc check is merely a file testPaul Eggert2019-09-181-1/+1
| | | | | | | * src/fileio.c (file_test_errno): Now extern. * src/lread.c (Fload): Use file_test_errno instead, since this is really just a file test (the attributes are not given to the user).
* Improve reporting of I/O, access errorsPaul Eggert2019-09-171-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signal an error for file-oriented errors that are not tame errors like ENOENT and ENOTDIR (Bug#37389). Do this for primitives exposed to Lisp; the lower level internal C API merely makes errno values available to higher-level C code. * doc/lispref/files.texi (Testing Accessibility) (File Attributes, Extended Attributes): Do not say that the functions return nil when the return value cannot be determined. * etc/NEWS: Mention the change. * src/dired.c (Ffile_attributes): Fix doc string confusion about opening a file vs getting its attributes. (file_attributes): Signal serious errors. * src/fileio.c (check_existing, check_executable) (check_writable): Remove. All callers changed to use check_file_access or file_access_p. (file_access_p, file_metadata_errno, file_attribute_errno) (file_test_errno, check_file_access, check_emacs_readlinkat): New functions. * src/fileio.c (Ffile_executable_p, Ffile_readable_p) (Ffile_name_case_insensitive_p, Frename_file, Ffile_exists_p): (Ffile_symlink_p, Ffile_directory_p) (Ffile_accessible_directory_p, Ffile_regular_p) (Ffile_selinux_context, Ffile_acl, Ffile_modes) (Ffile_newer_than_file_p, Fset_visited_file_modtime) (Ffile_system_info): * src/filelock.c (unlock_file, Ffile_locked_p): * src/lread.c (Fload): Signal serious errors. * src/fileio.c (Ffile_writable_p): Remove unnecessary CHECK_STRING. (emacs_readlinkat): Now static. * src/filelock.c (current_lock_owner, lock_if_free): Return a positive errno on error, and the negative of the old old value on success. All callers changed. * src/lread.c (openp): Propagate serious errno values to caller.
* Give a better error message when reading invalid "\unicode" escapes.Lars Ingebrigtsen2019-08-231-1/+2
| | | | | * src/lread.c (read_escape): Give a clearer error message on Unicode escape sequences (bug#36988).
* Don’t hard-loop on cycles in ‘read’ etc.Paul Eggert2019-08-211-34/+34
| | | | | | | | | | | | | | | Problem for ‘read’ reported by Pip Cet in: https://lists.gnu.org/r/emacs-devel/2019-08/msg00316.html * src/fns.c (Frequire): Protect against circular current-load-list. * src/lread.c (Fget_load_suffixes): Protect against circular load-suffixes or load-file-rep-suffixes. (Fload): Protect against circular loads-in-progress. (openp): Protect against circular PATH and SUFFIXES. (build_load_history): Protect against circular load-history or current-load-list. (readevalloop_eager_expand_eval): Protect against circular SUBFORMS. (read1): Protect against circular data. * test/src/lread-tests.el (lread-circular-hash): New test.
* Mention what effect nil has as the prompt for read-event/char/etcLars Ingebrigtsen2019-08-151-0/+12
| | | | | | | | | * doc/lispref/commands.texi (Reading One Event): Mention that "" has the same effect as nil as a prompt. * src/lread.c (Fread_event, Fread_char_exclusive, Fread_char): Mention what happens when PROMPT is nil/"" in the doc string (bug#15012).
* Fix Fload infile problemPaul Eggert2019-07-311-9/+8
| | | | | * src/lread.c (Fload): Close window of vulnerability where the wrong stream could have been closed.
* * src/lread.c (close_infile_unwind): Remove leftover debug codeStefan Monnier2019-07-311-1/+0
|
* * src/lread.c (infile): Set/reset it like a dynamically scoped variableStefan Monnier2019-07-311-6/+11
| | | | | | | | | | | | | | | | | | | I've seen segfaults where `infile` is nil when we get to readbyte_from_file, presumably because Fload set it to NULL (via close_infile_unwind) just before returning to its caller which was probably itself within another read/load and for some reason readevalloop didn't get to re-set `infile` like it used to do at every iteration. I was not able to really track down the bug, but the way `infile` was set/reset seemed fragile and managing it like a standard dynamically-scoped var seems both safer (and more efficient since we don't need readevalloop to constantly re-set it). (readchar): Assert that `infile` is set if using a function the depends on it. (readbyte_from_file): Assert that `infile` is set. (close_infile_unwind): Reset `infile` to its previous value rather than to NULL. (Fload): Remember the previous value of `infile` before chaning it. (readevalloop): Don't set `infile` any more.
* Simplify hashfn/cmpfn calling conventionPaul Eggert2019-07-201-2/+1
| | | | | | | | | | | | | | | | * src/fns.c (cmpfn_eql, cmpfn_equal, cmpfn_user_defined) (hashfn_eq, hashfn_equal, hashfn_eql, hashfn_user_defined): * src/profiler.c (cmpfn_profiler, hashfn_profiler): Use new calling convention where the return value is a fixnum instead of EMACS_UINT. While we’re at it, put the hash table at the end, since that’s a bit simpler and generates better code (at least on the x86-64). All callers changed. * src/fns.c (hash_lookup): Store fixnum rather than EMACS_UINT. All callers changed. (hash_put): Take a fixnum rather than an EMACS_UINT. All callers changed. Remove unnecessary eassert (XUFIXNUM does it). * src/lisp.h (struct hash_table_test): Adjust signatures of cmpfn and hashfn.
* Do not alter match data in Fcapitalize etc.Paul Eggert2019-07-091-0/+11
| | | | | | | | | | | | | Without this patch, (capitalize "x") can alter the match data, which is not what users expect. Problem found by running morse-tests-unnato-region in a stripped-down Emacs. Perhaps ‘load’ should also save and restore the match data? That would be a simpler fix, though arguably incompatible. * src/lread.c (save_match_data_load): New function. * src/chartab.c (uniprop_table): * src/doc.c (reread_doc_file): * src/eval.c (Fautoload_do_load): * src/fns.c (Frequire): Use it.
* Use fewer locks when accessing stdioPaul Eggert2019-07-081-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c, src/bidi.c, src/emacs-module.c, src/pdumper.c: * src/regex-emacs.c, src/unexhp9k800.c, src/unexmacosx.c: * src/widget.c, src/xdisp.c, src/xselect.c, src/xterm.c: Include sysstdio.h instead of stdio.h, to avoid locking stdio streams in many cases. * src/alloc.c (test_setjmp): * src/bidi.c (bidi_dump_cached_states): * src/cm.c (calccost): * src/dispnew.c (init_display_interactive): * src/emacs.c (main): * src/image.c (convert_mono_to_color_image): * src/minibuf.c (read_minibuf_noninteractive): * src/nsfont.m (ns_descriptor_to_entity) (ns_dump_glyphstring): * src/nsterm.h (NSTRACE_MSG_NO_DASHES): * src/nsterm.m (ns_mouse_position) (sendEvent:, keyDown:, performDragOperation:): * src/pdumper.c (dump_fingerprint, print_paths_to_root_1): * src/print.c (debug_print): * src/regex-emacs.c (debug_putchar, print_fastmap) (print_partial_compiled_pattern, print_compiled_pattern) (print_double_string, regex_compile): * src/term.c (vfatal): * src/unexhp9k800.c (read_header): * src/unexmacosx.c (unexec_error): * src/widget.c (EmacsFrameInitialize): * src/xdisp.c (message_to_stderr, vmessage, dump_glyph_row) (Fdump_glyph_matrix, Fdump_frame_glyph_matrix, dump_glyph_string): * src/xfaces.c (Fdump_colors, Fdump_face): * src/xselect.c (x_clipboard_manager_error_2): * src/xterm.c (x_initialize): * src/xwidget.c (WEBKIT_FN_INIT): Prefer unlocked calls like fputs to locked calls like fprintf. * src/charset.c (read_hex): * src/cm.c (cmputc, cmcheckmagic): * src/dispnew.c (update_frame, update_frame_with_menu) (update_frame_1, Fsend_string_to_terminal, Fding) (bitch_at_user): * src/emacs.c (main, Fdump_emacs): * src/emacs-module.c (module_abort): * src/fileio.c (Fdo_auto_save): * src/image.c (slurp_file) (png_read_from_file, png_load_body, our_stdio_fill_input_buffer): * src/keyboard.c (record_char, kbd_buffer_get_event) (handle_interrupt): * src/lread.c (readbyte_from_stdio, read1): * src/minibuf.c (read_minibuf_noninteractive): * src/print.c (printchar_to_stream, strout) (Fredirect_debugging_output): * src/sysdep.c (reset_sys_modes, close_output_streams) (procfs_ttyname, procfs_get_total_memory): * src/term.c (tty_ring_bell, tty_send_additional_strings) (tty_set_terminal_modes, tty_reset_terminal_modes) (tty_update_end, tty_clear_end_of_line, tty_write_glyphs) (tty_write_glyphs_with_face, tty_insert_glyphs) (tty_menu_activate): * src/xfaces.c (Fx_load_color_file): Simplify by using ordinary calls like putc to explicitly-unlocked calls like putc_unlocked, since the ordinary calls are now unlocked anyway. * src/emacs.c (main, Fdump_emacs): * src/pdumper.c (Fdump_emacs_portable): Coalesce adjacent printfs. * src/nsterm.h: Include sysstdio.h as this file’s macros rely on it. * src/regex-emacs.c (print_compiled_pattern): Omit redundant fflush. * src/sysstdio.h: Include unlocked-io.h. (clearerr_unlocked, feof_unlocked, ferror_unlocked) (fflush_unlocked, fgets_unlocked, fputc_unlocked) (fputs_unlocked, fread_unlocked, fwrite_unlocked) (getc_unlocked, getchar_unlocked, putc_unlocked) (putchar_unlocked): Remove these macros; now done by unlocked-io.h. * src/xwidget.c: Include sysstdio.h.
* Merge from origin/emacs-26Glenn Morris2019-07-061-1/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | 1e6d8e0 (origin/emacs-26) ; * doc/emacs/killing.texi (Secondary Selec... e2344a7 * lisp/svg.el, lisp/progmodes/ada-mode.el: Fix bug#36360. ff738ab Minor copyedit of "Font Lock" in user manual faf99dc Improve description of image descriptors 21351cc ; * src/lread.c (Fread): Make the comment wording more accurate. d176090 Improve documentation of secondary selections 8910fe1 * src/fns.c (Fmapconcat): Doc fix. (Bug#36418) # Conflicts: # lisp/svg.el