aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Revert O_PATH change to fileio.cPaul Eggert2019-06-281-4/+0
| | | | | | | | | | | | | | | Ken Brown pointed out it wasn’t needed (Bug#36405#16): * src/fileio.c (O_PATH) [__CYGWIN__]: Remove #undef.
* | | Correct regexp matching of raw bytesMattias Engdegård2019-06-281-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make regexp matching of raw bytes work in all combination of unibyte and multibyte patterns and targets, as exact strings and in character alternatives (bug#3687). * src/regex-emacs.c (analyze_first): Include raw byte in fastmap when pattern is a multibyte exact string. Include leading byte in fastmap for raw bytes in character alternatives. (re_match_2_internal): Decrement the byte count by the number of bytes in the pattern character, not 1. * test/src/regex-emacs-tests.el (regexp-unibyte-unibyte) (regexp-multibyte-unibyte, regexp-unibyte-mutibyte) (regexp-multibyte-multibyte): New tests.
* | | More readable regexp debug outputMattias Engdegård2019-06-281-10/+22
| | | | | | | | | | | | | | | | | | | | | * src/regex-emacs.c (debug_putchar): New. (print_fastmap, print_partial_compiled_pattern, print_double_string) (regex_compile): Use debug_putchar. (re_match_2_internal): Add newline.
* | | Consistently use stderr for debug output in regexp codeMattias Engdegård2019-06-281-17/+18
| | | | | | | | | | | | | | | * src/regex-emacs.c (DEBUG_PRINT, print_fastmap, print_compiled_pattern) (print_double_string, regex_compile): Print to stderr instead of stdout.
* | | * src/xfaces.c (resolve_face_name): Simplify.Paul Eggert2019-06-271-1/+1
| | |
* | | Remove unnecessary tortoise checks.Pip Cet2019-06-272-11/+0
| | | | | | | | | | | | | | | | | | * src/fns.c (Fplist_get, Fplist_put, Flax_plist_get) (Flax_plist_put, Fplist_member): Remove unnecessary check. * src/json.c (lisp_to_json_toplevel_1): Remove unnecessary check.
* | | Work around Cygwin bug with O_PATHPaul Eggert2019-06-272-0/+8
| | | | | | | | | | | | | | | Problem reported by Ken Brown (Bug#36405). * src/dired.c, src/fileio.c (O_PATH) [__CYGWIN__]: Undef.
* | | Omit a few minor unnecessary range checksPaul Eggert2019-06-273-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on Pip Cet’s review (Bug#36370#19). * src/fileio.c (Fdo_auto_save): * src/image.c (lookup_image): * src/textprop.c (Fnext_single_char_property_change): Prefer XFIXNUM to XFIXNAT for clarity and consistency with neighboring code, and to avoid unnecessary range checks. * src/image.c (lookup_image): Omit unnecessary range checks.
* | | Improve XFIXNUM cleanup a bitPaul Eggert2019-06-273-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on Pip Cet’s review (Bug#36370#13). * src/ccl.c (Fccl_execute_on_string): Use clearer indexing. * src/dosfns.c (Fint86, Fdos_memput): Avoid runtime checks for negative fixnums when debugging. This restores the earlier machine code. * src/lisp.h (XFIXNUM, XUFIXNUM): Use eassert, not eassume. (XFIXNAT): At the start, merely eassert FIXNUMP rather than eassuming FIXNATP. At the end, eassume that the result is nonnegative. This restores help to the compiler that the previous patch mistakenly removed.
* | | Clean up use of XFIXNUM etc.Paul Eggert2019-06-2710-65/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few bits of the code were relying on the fact that XFIXNUM, XFIXNAT, and XUFIXNUM do something even with arguments that are not fixnums/fixnats. Separate these rare uses out into XFIXNUM_RAW and XUFIXNUM_RAW. Problem and original patch reported by Pip Cet (Bug#36370). * src/ccl.c (Fccl_execute_on_string): * src/fileio.c (Finsert_file_contents, a_write) (Fdo_auto_save): * src/process.c (conv_lisp_to_sockaddr): * src/textprop.c (Fnext_single_char_property_change) (Fprevious_single_char_property_change) (Fnext_property_change, Fnext_single_property_change) (Fprevious_property_change) (Fprevious_single_property_change): Don’t assume fixnums are nonnegative. * src/ccl.c (Fccl_execute_on_string): Fix range-checking bug if AREF (status, i) is out of int range. * src/data.c (arith_driver): Use XFIXNUM_RAW as we want efficient garbage if the value is not a fixnum. * src/dosfns.c (Fint86, Fdos_memput): Check that args are nonnegative. * src/image.c (lookup_image): Check that args are in range. * src/lisp.h (lisp_h_XHASH): Use XUFIXNUM_RAW, since this is for hashing. (lisp_h_XFIXNAT, XFIXNAT) [USE_LSB_TAG]: Remove macros. (lisp_h_XFIXNUM_RAW, XFIXNUM_RAW) [USE_LSB_TAG]: New macros, with the semantics of the old macros without _RAW. (XFIXNUM_RAW, XUFIXNUM_RAW): New inline functions, with the semantics of the old functions without _RAW. (FIXNUMP): Move definition up to avoid forward use. (XFIXNUM, XFIXNAT, XUFIXNUM): Use eassume to add a runtime check (when debugging) that the argument has the proper form. (XFIXNUM, XFIXNAT): Now inline functions only, since they refer to their arguments more than once now that they use eassume. * src/textprop.c (Fprevious_single_char_property_change): Avoid fixnum overflow with invalid input. (set_text_properties): Fix unlikely failure to validate arguments, by using EQ instead of XFIXNAT. * src/w32term.c (w32_draw_glyph_string): * src/xterm.c (x_draw_glyph_string): Treat negative minimums as 0 rather than as garbage patterns.
* | | Catch duplicate keywords in image specsPaul Eggert2019-06-271-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/image.c (struct image_keyword.count): Now bool, not int, since it is either 0 or 1. (parse_image_spec, xpm_image_p): Use bool for boolean. (parse_image_spec): Fix a bug introduced in 2011-09-21T17:41:20!eggert@cs.ucla.edu that reported only triplicate (or more) keywords, not duplicates.
* | | Fix invoking Emacs via a symlink on CygwinKen Brown2019-06-271-1/+1
| | | | | | | | | | | | * src/emacs.c (load_pdump) [CYGWIN]: Strip ".exe" suffix.
* | | Support invoking Emacs via a symlink on MS-WindowsEli Zaretskii2019-06-262-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | * src/w32.c (w32_my_exename): Resolve symlinks in the executable name, to support searching for the pdumper file when the executable is found via a symlink. * src/emacs.c (load_pdump): Add a comment about symlink resolution on Windows.
* | | Restrict indirect lookups in Fdocumentation_propertyLars Ingebrigtsen2019-06-261-3/+5
| | | | | | | | | | | | | | | * src/doc.c (Fdocumentation_property): Only look up indirect variables if we've been asked for the variable documentation.
* | | Fdocumentation_property: Return doc string for indirect variablesLars Ingebrigtsen2019-06-261-0/+12
| | | | | | | | | | | | | | | | | | * src/doc.c (Fdocumentation_property): When dealing with indirect variables (i.e., aliases), also check the symbol being pointed to for the doc string (bug #17180).
* | | Revert "* lisp/calc/calc-ext.el (math-scalarp): Fix typo"Stefan Monnier2019-06-262-24/+1
| | | | | | | | | | | | This reverts commit 698ff554ac2699ec48fefc85a1307cbc4a183b0d.
* | | * lisp/calc/calc-ext.el (math-scalarp): Fix typoStefan Monnier2019-06-262-1/+24
| | |
* | | Merge from emacs-26Noam Postavsky2019-06-253-11/+11
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | e62ad04963 Fix sgml-mode handling of quotes within parens (Bug#36347) 06b35b2f92 ; * lisp/frame.el: Enhance add-variable-watcher commentary. 572e34bb6f Rename 'make-symbolic-link' argument NEWNAME to LINKNAME 04477adedc Check that length of data returned by sysctl is non-zero 81535eeadb * test/lisp/progmodes/python-tests.el (python-virt-bin): D... 9d48979ca8 Fix Python tests depending on system-type fcf6cc3177 Fix problem with wdired test when symlinks cannot be created. 4701e0663e Improve wording of documentation of click events # Conflicts: # lisp/textmodes/sgml-mode.el # test/lisp/textmodes/sgml-mode-tests.el
| * | Rename 'make-symbolic-link' argument NEWNAME to LINKNAMEJuanma Barranquero2019-06-211-5/+5
| | | | | | | | | | | | | | | * src/fileio.c (Fmake_symbolic_link): Fix docstring. * doc/lispref/files.texi (Changing Files): Doc fix.
| * | Check that length of data returned by sysctl is non-zeroRobert Pluim2019-06-202-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The length of the data returned by sysctl can be zero, which was not checked for. This could cause crashes, e.g. when querying non-existent processes. (Bug#36279) * src/sysdep.c (list_system_processes) [DARWIN_OS || __FreeBSD__]: (system_process_attributes) [__FreeBSD__]: (system_process_attributes) [DARWIN_OS]: * src/filelock.c (get_boot_time) [CTL_KERN && KERN_BOOTTIME]: Check for zero length data returned by sysctl.
| * | Avoid assertion violation when comparing with main-threadEli Zaretskii2019-06-103-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/thread.c (unmark_main_thread): New function. * src/lisp.h (unmark_main_thread): Prototype it. * src/alloc.c (garbage_collect_1): Call it after sweeping. (Bug#33073) * test/src/thread-tests.el (threads-test-bug33073): New test.
* | | Don't bind search-spaces-regexp around possible autoload (Bug#35802)Noam Postavsky2019-06-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/isearch.el (isearch-search-fun-default): Move possible autoload trigger outside let-binding of search-spaces-regexp. * lisp/char-fold.el (char-fold-make-table): Remove no longer needed workaround. * lisp/info.el (Info-search-whitespace-regexp): * lisp/isearch.el (search-whitespace-regexp): * src/search.c (syms_of_search) <search-spaces-regexp>: Add warning about adding capturing groups to the value. * test/lisp/char-fold-tests.el: Remove, binding search-spaces-regexp to a different should be considered a bug.
* | | Prefer PATH_MAX to MAXPATHLENPaul Eggert2019-06-251-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PATH_MAX is standardized, MAXPATHLEN is not. Also, the Gnulib pathmax module fixes some rare bugs with PATH_MAX. So prefer PATH_MAX to MAXPATHLEN unless we know the latter is also correct (for some platform-specific code). * admin/merge-gnulib (GNULIB_MODULES): Add pathmax. This module was already present, as a dependency of canonicalize-lgpl, but now Emacs is using it directly. Sort. * lib-src/emacsclient.c: Include stdint.h, pathmax.h. (get_current_dir_name): Sync to current src/sysdep.c. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * src/sysdep.c: Include pathmax.h. (get_current_dir_name_or_unreachable): Use PATH_MAX instead of MAXPATHLEN.
* | | Avoid some strlen work, primarily via strnlenPaul Eggert2019-06-2511-29/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/merge-gnulib (GNULIB_MODULES): Add strnlen. * lib-src/etags.c (find_entries): * src/emacs.c (main): * src/nsmenu.m (parseKeyEquiv:): * src/nsterm.m (ns_xlfd_to_fontname): * src/term.c (vfatal): Prefer !*X to !strlen (X). * lib-src/etags.c (pfnote, add_regex): * lib-src/pop.c (pop_open): * lib-src/update-game-score.c (main): * lwlib/lwlib.c (lw_separator_p): * src/doprnt.c (doprnt): * src/emacs.c (main): * src/inotify.c (inotifyevent_to_event): * src/keyboard.c (menu_separator_name_p, parse_tool_bar_item): * src/sysdep.c (get_current_dir_name_or_unreachable): * src/xdisp.c (store_mode_line_string): Use strnlen to avoid unnecessary work with strlen. * lib-src/etags.c (Prolog_functions, prolog_pr) (Erlang_functions, erlang_func): Prefer ptrdiff_t to size_t when either will do. (prolog_pr, erlang_func): New arg LASTLEN, to avoid unnecessary strlen call. All callers changed. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib/strnlen.c, m4/strnlen.m4: New files, copied from Gnulib. * lwlib/lwlib.c (lw_separator_p): * src/json.c (json_has_prefix): Use strncmp to avoid unecessary work with strlen + memcmp. * src/process.c (set_socket_option): Use SBYTES instead of strlen.
* | | Make message_to_stderr do one single fwriteLars Ingebrigtsen2019-06-251-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/xdisp.c (message_to_stderr): When running as a batch process, the output from `message' goes to stderr, and has a newline appended. Rewrite the code so that only one fwrite is performed to enable messages that are shorter than PIPE_BUF (usually 4096 on modern operating systems) are written out as one chunk, as this will ensure that the messages are not interleaved with messages from other processes that are writing at the same time. This does not affect other stderr outputs, just the ones from `message'.
* | | Fix MS-Windows build as followup to pdumper executable lookupEli Zaretskii2019-06-243-1/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32.c (w32_my_exename): New function. * src/w32.h (w32_my_exename): Add prototype. * src/emacs.c (load_pdump_find_executable) [WINDOWSNT]: Find the actual file name of the program without looking along PATH, by calling w32_my_exename. * nt/mingw-cfg.site (ac_cv_func_canonicalize_file_name) (ac_cv_func_realpath, gl_cv_func_realpath_works): Disable testing. * nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_canonicalize-lgpl): Set to true.
* | | Fix pdumper executable-finding codeDaniel Colascione2019-06-241-25/+137
| | | | | | | | | | | | | | | | | | * src/emacs.c: (load_pdump_find_executable): New function. (load_pdump): Use it.
* | | Fix locating pdump by symlinkDaniel Colascione2019-06-231-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/merge-gnulib (GNULIB_MODULES): Add canonicalize-lgpl module * build-aux/config.guess, build-aux/gitlog-to-changelog, build-aux/update-copyright, lib/canonicalize-lgpl.c, lib/gnulib.mk.in, lib/malloca.c, lib/malloca.h, lib/pathmax.h, m4/canonicalize.m4, m4/double-slash-root.m4, m4/gnulib-comp.m4, m4/malloca.m4, my/pathmax.4: copy from GNUlib or regenerate from update * src/emacs.c: find dump by canonical path
* | | Don’t line-buffer stderrPaul Eggert2019-06-231-6/+0
| | | | | | | | | | | | | | | | | | * src/sysdep.c (init_standard_fds) [DOS_NT]: Don’t line-buffer stderr. This reverts 2019-06-20T07:32:17!eggert@cs.ucla.edu. See: https://lists.gnu.org/r/emacs-devel/2019-06/msg00882.html
* | | src/bytecode.c (exec_byte_code) Unroll Blist3 and Blist4Alexander Gramiak2019-06-231-2/+2
| | | | | | | | | | | | | | | * src/bytecode.c (exec_byte_code): Unroll Blist3 and Blist4 (bug#35321).
* | | ; * src/image.c: Minor copyedits of native transform commentary.Eli Zaretskii2019-06-231-5/+5
| | |
* | | Document what the `t' value for HIST in `read-string' meansLars Ingebrigtsen2019-06-231-2/+6
| | | | | | | | | | | | | | | | | | * src/minibuf.c (syms_of_minibuf): Say that `t' means "no history" (bug#36324). (Fread_from_minibuffer): Say the same for HIST.
* | | Bring macuvs.h back under Git controlPaul Eggert2019-06-221-0/+9218
| | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/unidata/Makefile.in (maintainer-clean): Instead of removing macuvs.h here ... (extraclean): ... Remove it here. * admin/unidata/uvs.el (uvs-print-table-ivd): Add to comment explaining why macuvs.h is in Git. * src/macuvs.h: Regenerate and re-add to Git.
* | | Make ftcr font backend driver more consistent with xftYAMAMOTO Mitsuharu2019-06-221-0/+12
| | | | | | | | | | | | | | | * src/ftcrfont.c: Include charset.h. (ftcrfont_has_char): Import font adstyle related code from ftfont_has_char.
* | | Make toolbar show keyboard equivalents in its tooltipsStefan Kangas2019-06-221-0/+13
| | | | | | | | | | | | | | | | | | | | | * src/keyboard.c (parse_tool_bar_item): Add equivalent key binding to the tooltip string of toolbar buttons. * etc/NEWS: Announce it. * etc/TODO: Remove its entry. (Bug#36156)
* | | Fix an off-by-one error in assertionEli Zaretskii2019-06-221-1/+1
| | | | | | | | | | | | | | | | | | * src/fileio.c (Fexpand_file_name): Fix off-by-one error in an assertion. This avoids assertion violations when the home directory is an empty string for some reason. (Bug#36363)
* | | Make ftcr font backend driver more consistent with xftYAMAMOTO Mitsuharu2019-06-221-20/+16
| | | | | | | | | | | | | | | * src/ftcrfont.c (ftcrfont_open): Use metrics of glyph ID 0 if there is no glyph for an ASCII printable.
* | | * src/font.c (Ffont_xlfd_name): Don't use strcpy for overlapping strings.YAMAMOTO Mitsuharu2019-06-221-1/+1
| | |
* | | Remove src/macuvs.h from Git repositoryPaul Eggert2019-06-211-9212/+0
| | | | | | | | | | | | | | | | | | | | | | | | It can be generated automatically and easily during a normal bootstrap, so there’s no need to keep it in the repository. * admin/unidata/Makefile.in (maintainer-clean): Behave like extraclean and remove macuvs.h etc. * src/macuvs.h: Remove.
* | | * src/xterm.c (x_update_end) [USE_CAIRO]: Flush non-double-buffered surface.YAMAMOTO Mitsuharu2019-06-211-0/+9
| | |
* | | Fix blank tooltips on cairo (Bug#36298)YAMAMOTO Mitsuharu2019-06-213-1/+6
| | | | | | | | | | | | | | | | | | * src/xterm.h (x_cr_update_surface_desired_size) [USE_CAIRO]: Add extern. * src/xterm.c (x_cr_update_surface_desired_size) [USE_CAIRO]: Make non-static. * src/xfns.c (Fx_show_tip) [USE_CAIRO]: Call x_cr_update_surface_desired_size.
* | | Fix broken display by frame maximization on cairo (Bug#23925)YAMAMOTO Mitsuharu2019-06-211-1/+1
| | | | | | | | | | | | | | | * src/xterm.c (handle_one_xevent) [USE_CAIRO && USE_GTK]: Make calls to x_cr_update_surface_desired_size coincide with those to xg_frame_resized.
* | | Fix aborts when the value of a display property causes redisplayEli Zaretskii2019-06-201-0/+9
| | | | | | | | | | | | | | | * src/xdisp.c (handle_single_display_spec): Protect the bidi cache from evaluation that triggers redisplay. (Bug#36312)
* | | Make extraclean return tree to pristine state by deleting moreLars Ingebrigtsen2019-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/Makefile.in (extraclean): Remove TAGS and config.in. * Makefile.in (extraclean): Remove info, configure and emacsver.texi in extraclean. * admin/unidata/Makefile.in (extraclean): Make it depend on distclean to remove .elc files. * leim/Makefile.in (extraclean): Depend on bootstrap-clean to remove generated .el files. * lib/Makefile.in (extraclean): Added target to remove sys directory and run distclean. * lisp/Makefile.in (extraclean): Also remove loaddefs*.el~ files.
* | | Simplify stdout bufferingPaul Eggert2019-06-201-18/+1
| | | | | | | | | | | | | | | | | | * src/sysdep.c (_sobuf): Remove; we no longer need this microoptimization. (init_sys_modes): Simplify by assuming setvbuf.
* | | Remove no-longer-needed fflushes of stderrPaul Eggert2019-06-202-2/+0
| | | | | | | | | | | | | | | | | | * src/gmalloc.c (mabort) [GC_MCHECK && !__GNU_LIBRARY__]: * src/term.c (vfatal): Remove fflush (stderr) when it is now a no-op because newline automatically flushes stderr.
* | | Line-buffer stderrPaul Eggert2019-06-201-0/+6
| | | | | | | | | | | | | | | * src/sysdep.c (init_standard_fds) [!DOS_NT]: Use setvbuf to ensure stderr is line-buffered.
* | | Fix arbitrary INT_MAX limit on referrer reprPaul Eggert2019-06-201-1/+2
| | | | | | | | | | | | | | | * src/pdumper.c (print_paths_to_root_1): Don’t assume strlen (repr) < INT_MAX.
* | | Minor putc tweaksPaul Eggert2019-06-203-14/+8
| | | | | | | | | | | | | | | | | | | | | * src/emacs-module.c (module_abort): * src/xdisp.c (vmessage): Prefer fputc to putc, since speed isn’t crucial here. * src/region-cache.c (pp_cache) [ENABLE_CHECKING]: Simplify.
* | | Change font_put_extra value for property removal from Qnil to QunboundYAMAMOTO Mitsuharu2019-06-201-3/+7
| | | | | | | | | | | | | | | | | | * font.c (font_put_extra): If VAL is Qunbound, delete the slot for PROP from the list of extra properties. Previous value Qnil is valid as boolean. (font_clear_prop): Changed argument of font_put_extra for property removal.