aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add support for --seccomp command-line option.Philipp Stephani2020-12-291-1/+119
| | | | | | | | | | | | | | | | | | | | | | | When passing this option on GNU/Linux, Emacs installs a Secure Computing kernel system call filter. See Bug#45198. * configure.ac: Check for seccomp header. * src/emacs.c (usage_message): Document --seccomp option. (emacs_seccomp): New wrapper for 'seccomp' syscall. (load_seccomp, maybe_load_seccomp): New helper functions. (main): Potentially load seccomp filters during startup. (standard_args): Add --seccomp option. * lisp/startup.el (command-line): Detect and ignore --seccomp option. * test/src/emacs-tests.el (emacs-tests/seccomp/absent-file) (emacs-tests/seccomp/empty-file) (emacs-tests/seccomp/file-too-large) (emacs-tests/seccomp/invalid-file-size): New unit tests. (emacs-tests--with-temp-file): New helper macro. * etc/NEWS: Document new --seccomp option.
* * src/xdisp.c (display_mode_line): I guess FALSE should be false.Glenn Morris2020-12-281-1/+1
|
* Revert the previous display_string changeLars Ingebrigtsen2020-12-291-24/+20
| | | | | | * src/xdisp.c (display_string): Revert adding the additional ignore_text_properties parameter -- it was already covered by the other mix of parameters.
* Fix compact mode line text propertiesLars Ingebrigtsen2020-12-291-14/+27
| | | | | * src/xdisp.c (display_mode_line): Display the compact mode correctly (with text properties) (bug#45520).
* Add a parameter to display_string to allow not ignoring text propsLars Ingebrigtsen2020-12-291-19/+26
| | | | | | * src/xdisp.c (display_string): Add a parameter to allow not ignoring text properties (bug#45520). Adjust callers throughout xdisp.c.
* Introduce new variable mode-line-compactLars Ingebrigtsen2020-12-291-3/+46
| | | | | | | * doc/lispref/modes.texi (Mode Line Basics): Document it (bug#34476). * src/xdisp.c (display_mode_line): Use it. (syms_of_xdisp): New variable mode-line-compact.
* Fix crash in NS menu codeAlan Third2020-12-281-55/+46
| | | | | | | * src/nsmenu.m (ns_update_menubar): Don't assume that the top level menus are correct when populating the submenus. (free_frame_menubar): Clear the menu. ([EmacsMenu removeAllItems]): Actually remove all menu items.
* Make XIM to work with non-CJK localesYichao Yu2020-12-282-33/+5
| | | | | | | | * src/xfns.c (best_xim_style): Don't rely on supported_xim_styles (bug#10867). * src/xterm.c (x_draw_window_cursor): Adjust to modern input styles. (xim_instantiate_callback): Ditto.
* Remove NS menu synthesized events (bug#44333)Alan Third2020-12-273-415/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the frame tracking stuff as it's not used for anything, and move the update tracking into the EmacsMenu class. * src/nsmenu.m (ns_update_menubar): Copy the parsing code from xmenu.c and rework the NS specific code around to update the existing menus instead of rebuilding them completely. (ns_activate_menubar): ([EmacsMenu trackingNotification:]): ([EmacsMenu menuWillOpen:]): ([EmacsMenu menuDidClose:]): Remove unused functions. ([EmacsMenu menuNeedsUpdate:]): Remove menu tracking code and add code to check whether an update is required. ([EmacsMenu fillWithWidgetValue:]): ([EmacsMenu addSubmenuWithTitle:]): ([EmacsMenu initWithTitle:]): Remove references to frame. ([EmacsMenu setFrame:]): Remove method. ([EmacsMenu clear]): Rename to removeAllItems. ([EmacsMenu removeAllItems]): Use built-in removeAllItems, if available. (syms_of_nsmenu): Remove tracking code. * src/nsterm.m (ns_check_menu_open): (ns_check_pending_open_menu): (ns_create_terminal): Remove unused functions. (ns_term_init): Get rid of menu tracking. * src/nsterm.h (EmacsMenu): Remove frame, add needsUpdate and update method definitions.
* ; Fix recent shortdoc.el and fns.c additionsBasil L. Contovounesios2020-12-271-1/+1
| | | | | * lisp/emacs-lisp/shortdoc.el (list): Fix typos. * src/fns.c (Flength_equal): Fix docstring.
* ; Fix the recent `length' doc string additionŠtěpán Němec2020-12-271-1/+1
|
* Fix up length_internal with degenerate length inputsLars Ingebrigtsen2020-12-271-2/+5
| | | | * src/fns.c (length_internal): Protect against edge conditions.
* Add new predicates for sequence lengthsLars Ingebrigtsen2020-12-271-1/+75
| | | | | | | | | | | | | * doc/lispref/sequences.texi (Sequence Functions): Document them. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Mark them as side-effect-free. * lisp/emacs-lisp/shortdoc.el (list): Mention them. * src/fns.c (Flength): Mention them in the doc string. (length_internal): New function. (Flength_less, Flength_greater, Flength_equal): New defuns. (syms_of_fns): Sym them.
* Fix test/src/process-tests on MS-WindowsEli Zaretskii2020-12-261-0/+6
| | | | | * src/process.c (network_lookup_address_info_1) [WINDOWSNT]: Initialize winsock.
* Improvements for `:base-uri' svg image propertyZajcev Evgeny2020-12-261-3/+5
| | | | | | | * src/image.c (svg_load): Use ENCODE_FILE for `:base-uri' * doc/lispref/display.texi (SVG Images): Add more documentation for `:base-uri'
* Merge from origin/emacs-27Glenn Morris2020-12-251-1/+1
|\ | | | | | | | | | | b242bbb073 (origin/emacs-27) ; lisp/org/org.el: Fix Version header. e0fc939c5f Add more details to the "word processor" section fda9b3e83a * src/Makefile.in (DO_CODESIGN): Fix expected architecture...
| * * src/Makefile.in (DO_CODESIGN): Fix expected architecture name.Philipp Stephani2020-12-231-1/+1
| |
| * Codesign the executable on recene MacOS systemsItai Seggev2020-12-231-0/+7
| | | | | | | | | | | | | | | | * src/Makefile.in (temacs$(EXEEXT)): Codesign the executable on recent (ARM) MacOS systems (bug#43878). Without this, building Emacs fails. Copyright-paperwork-exempt: yes
| * Fix error with fn key in NS port (bug#44533)Alan Third2020-12-141-11/+8
| | | | | | | | | | | | | | * src/nsterm.m ([EmacsView keyDown:]): Move the correction for fn key handling to before the modifiers are calculated. (cherry picked from commit 7970610d48701a949ce443c94c71eac47d044197)
| * Fix crash in ns_mouse_position (bug#44313)Alan Third2020-12-121-1/+3
| | | | | | | | | | | | | | | | * src/nsterm.m (ns_destroy_window): Close the window before freeing the frame resources so we don't end up accessing the frame struct after it's been freed. (cherry picked from commit 18a7267c32a909bb26bd93d24543155aeb10e042)
* | Revert "Use posix_spawn if possible."Eli Zaretskii2020-12-252-150/+2
| | | | | | | | | | | | This reverts commit 2c79a8f9210db01c86b0e5f236adeb0509519d30. It breaks the MinGW build in too many ways, and should be first tested on a branch.
* | Use posix_spawn if possible.Philipp Stephani2020-12-252-2/+150
| | | | | | | | | | | | | | | | | | | | | | | | posix_spawn is less error-prone than vfork + execve, and can make better use of system-specific enhancements like 'clone' on Linux. Use it if we don't need to configure a pseudoterminal. * src/Makefile.in (LIB_POSIX_SPAWN): New variable. (LIBES): Use it. * src/callproc.c (emacs_spawn): Use posix_spawn on Unix-like system if we don't need to set up a pseudoterminal.
* | Adjust to recent Gnulib changesPaul Eggert2020-12-253-23/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The latest Gnulib merge brought in free-posix, which causes 'free' to preserve errno. This lets us simplify some Emacs code that calls 'free'. * admin/merge-gnulib (GNULIB_MODULES): Add free-posix. This module is pulled in by canonicalize-lgpl anyway, so we might as well rely on it. * lib-src/emacsclient.c (get_current_dir_name): Sync better with src/sysdep.c. * lib-src/etags.c (process_file_name, etags_mktmp): * lib-src/update-game-score.c (unlock_file): * src/fileio.c (file_accessible_directory_p): * src/sysdep.c (get_current_dir_name_or_unreachable): Simplify by assuming that 'free' preserves errno. * src/alloc.c (malloc_unblock_input): Preserve errno, so that xfree preserves errno. * src/sysdep.c (get_current_dir_name_or_unreachable): Simplify by using strdup instead of malloc+memcpy. No need for realloc (and the old code leaked memory anyway on failure); just use free+malloc.
* | Pacify gcc 10.2 -Wanalyzer-null-argument in gtkutil.cPaul Eggert2020-12-251-5/+2
| | | | | | | | | | | | | | * src/gtkutil.c (xg_item_label_same_p): Simplify. Without this simplification, GCC (Ubuntu 10.2.0-13ubuntu1) -Wanalyzer-null-argument complains about use of NULL where non-null expected as argument of strcmp.
* | ; * src/callproc.c (emacs_spawn) [!WINDOWSNT]: Fix last change.Eli Zaretskii2020-12-241-2/+2
| |
* | Unbreak the MinGW build broken by recent changes in callproc.cEli Zaretskii2020-12-245-48/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32.h (set_process_dir): * src/w32proc.c (set_process_dir): Change the argument to 'const char *'. * src/lisp.h (make_environment_block): * src/callproc.c (make_environment_block): Now returns 'char **'. (exec_failed) [DOS_NT]: Remove unused function. * src/callproc.c (child_setup): NEW_ARGV and ENV are now 'char **'. Making them 'const' breaks the MinGW build and is not needed for other platforms. * src/callproc.c (emacs_spawn): ARGV and ENVP arguments are now 'char *', for the same reason. * src/process.c (create_process): Adapt to above changes.
* | Centralize subprocess creation in a single function.Philipp Stephani2020-12-243-223/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Getting the vfork + execve combination right isn't easy, and the code was partially duplicated between callproc.c and process.c. Centralize the spawn operation in a single function that deals with the nasty details. Going forward, we should be able to use posix_spawn from either libc or Gnulib (or CreateProcessW on Windows) in the non-pty case. * src/callproc.c (emacs_spawn): New function to start an asynchronous subprocess. Merge code from 'call_process' and 'create_process' into this function. (call_process): Use new 'emacs_spawn' function. (child_setup): Make static, since there are no users outside this compilation unit left. (CHILD_SETUP_TYPE): Move from header file, since there are no users outside this compilation unit left. * src/process.c (create_process): Use new 'emacs_spawn' function.
* | * src/dispnew.c (sit_for): Fix bug#45292Stefan Monnier2020-12-231-0/+9
| | | | | | | | | | When reading, prefer staying in the selected-window over preserving the current-buffer.
* | Declare argument vector as char *const *.Philipp Stephani2020-12-232-4/+4
| | | | | | | | | | | | This matches the signature of execve. * src/callproc.c (child_setup): Declare NEW_ARGV as char *const *.
* | Pass C string pointer to current directory to 'child_setup'.Philipp Stephani2020-12-233-10/+14
| | | | | | | | | | | | | | | | | | | | | | This avoids the impression that 'child_setup' could do anything Lisp-related. * src/callproc.c (child_setup): Pass C pointer to current directory name. (call_process): Adapt callers. * src/process.c (create_process): Adapt callers.
* | Allocate environment block before forking.Philipp Stephani2020-12-233-118/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While 'child_setup' carefully avoids calls to async-signal-unsafe functions like 'malloc', it seems simpler and less brittle to use normal allocation outside the critical section between 'fork' and 'exec'. * src/callproc.c (make_environment_block): New function to create the environment block for subprocesses. Code largely extracted from 'child_setup' and adapted to use 'xmalloc' instead of 'alloca'. (child_setup): Remove environment block allocation in favor of passing the environment block as command-line argument. (call_process): Adapt to new calling convention. * src/process.c (create_process): Adapt to new calling convention.
* | Reject filenames containing NUL bytes.Philipp Stephani2020-12-231-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Such filenames are dangerous, as Emacs would silently only use the part up to the first NUL byte. Reject them explicitly instead. * src/coding.c (encode_file_name_1): New helper function. (encode_file_name): Check that encoded filename doesn't contain a NUL byte. (syms_of_coding): Define 'filenamep' symbol. * test/src/fileio-tests.el (fileio-tests/null-character): New unit test. * etc/NEWS: Document change.
* | Remove an unused parameter from 'child_setup' function.Philipp Stephani2020-12-233-9/+7
| | | | | | | | | | | | | | * src/callproc.c (child_setup): Remove unused SET_PGRP parameter. * src/callproc.c (call_process): * src/process.c (create_process): Fix all callers.
* | Fix use of obsolete 'emergency' warning levelStefan Kangas2020-12-231-1/+1
| | | | | | | | | | * src/alloc.c (display_malloc_warning): Use new style ':emergency' warning level instead of obsolete 'emergency'.
* | Fix use of obsolete 'error' warning levelZajcev Evgeny2020-12-231-1/+1
| | | | | | | | | | * src/fileio.c (auto_save_error): Use new style ':error' warning level instead of obsolete 'error'.
* | Use new NSString lisp methodsAlan Third2020-12-226-36/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/nsfont.m (ns_otf_to_script): (ns_registry_to_script): (ns_get_req_script): Use NSString conversion methods. * src/nsimage.m ([EmacsImage allocInitFromFile:]): Use NSString conversion methods. * src/nsmenu.m (ns_menu_show): Use NSString conversion methods. * src/nsselect.m (symbol_to_nsstring): (ns_string_to_pasteboard_internal): Use NSString conversion methods. * src/nsterm.m (ns_term_init): ([EmacsView initFrameFromEmacs:]): Use NSString conversion methods. * src/nsxwidget.m (nsxwidget_webkit_uri): (nsxwidget_webkit_title): (js_to_lisp): Use NSString conversion methods. (build_string_with_nsstr): Functionality replaced by NSString extensions.
* | Fix frame creation on X when tool bar is disabledEli Zaretskii2020-12-211-2/+7
| | | | | | | | | | | | * src/xterm.c (handle_one_xevent): Restrict the fix for bug#44002 to situations when we are asked by the WM to create a window with bogus 1x1 dimensions. (Bug#44794)
* | ; * src/nsfns.m (all_nonzero_ascii): comment correctionMattias Engdegård2020-12-211-1/+1
| |
* | Unbreak build after commit 1a0a11f7d2d1dbecb9f754b1e129d50e489058e6.Philipp Stephani2020-12-211-1/+1
| | | | | | | | | | | | | | The commit only changed a comment in 'struct buffer', so the portable dumper doesn't need to be adapted. * src/pdumper.c (dump_buffer): Update hash for 'struct buffer'.
* | Fix image cache lookupAlan Third2020-12-201-1/+1
| | | | | | | | | | * src/image.c (lookup_image): ignore_colors should be false as we want to search for images with matching colors.
* | Remove unnecessary string conversionAlan Third2020-12-201-4/+2
| | | | | | | | | | * src/nsfns.m (ns_set_represented_filename): NSString can load List strings directly now.
* | Inhibit buffer hooks in temporary buffersBasil L. Contovounesios2020-12-2014-72/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Give get-buffer-create an optional argument to inhibit buffer hooks in internal or temporary buffers for efficiency (bug#34765). * etc/NEWS: Announce new parameter of get-buffer-create and generate-new-buffer, and that with-temp-buffer and with-temp-file now inhibit buffer hooks. * doc/lispref/buffers.texi (Buffer Names): Fix typo. (Creating Buffers): Document new parameter of get-buffer-create and generate-new-buffer. (Buffer List, Killing Buffers): Document when buffer hooks are inhibited. (Current Buffer): * doc/lispref/files.texi (Writing to Files): Document that with-temp-buffer and with-temp-file inhibit buffer hooks. * doc/lispref/internals.texi (Buffer Internals): Document inhibit_buffer_hooks flag. Remove stale comment. * doc/misc/gnus-faq.texi (FAQ 5-8): * lisp/simple.el (shell-command-on-region): Fix indentation. * lisp/files.el (kill-buffer-hook): Document when hook is inhibited. (create-file-buffer): * lisp/gnus/gnus-uu.el (gnus-uu-unshar-article): * lisp/international/mule.el (load-with-code-conversion): * lisp/mh-e/mh-xface.el (mh-x-image-url-fetch-image): * lisp/net/imap.el (imap-open): * lisp/net/mailcap.el (mailcap-maybe-eval): * lisp/progmodes/flymake-proc.el (flymake-proc--read-file-to-temp-buffer) (flymake-proc--copy-buffer-to-temp-buffer): Simplify. * lisp/subr.el (generate-new-buffer): Forward new optional argument to inhibit buffer hooks to get-buffer-create. (with-temp-file, with-temp-buffer, with-output-to-string): * lisp/json.el (json-encode-string): Inhibit buffer hooks in buffer used. * src/buffer.c (run_buffer_list_update_hook): New helper function. (Fget_buffer_create): Use it. Add optional argument to set inhibit_buffer_hooks flag instead of comparing the buffer name to Vcode_conversion_workbuf_name. All callers changed. (Fmake_indirect_buffer, Frename_buffer, Fbury_buffer_internal) (record_buffer): Use run_buffer_list_update_hook. (Fkill_buffer): Document when buffer hooks are inhibited. Use run_buffer_list_update_hook. (init_buffer_once): Inhibit buffer hooks in Vprin1_to_string_buffer. (Vkill_buffer_query_functions, Vbuffer_list_update_hook): Document when hooks are inhibited. * src/buffer.h (struct buffer): Update inhibit_buffer_hooks commentary. * src/coding.h (Vcode_conversion_workbuf_name): * src/coding.c (Vcode_conversion_workbuf_name): Make static again since it is no longer needed in src/buffer.c. (code_conversion_restore, code_conversion_save, syms_of_coding): Prefer boolean over integer constants. * src/fileio.c (Finsert_file_contents): Inhibit buffer hooks in " *code-converting-work*" buffer. * src/window.c (Fselect_window): Fix grammar. Mention window-selection-change-functions alongside buffer-list-update-hook. * test/src/buffer-tests.el: Fix requires. (buffer-tests-inhibit-buffer-hooks): New test.
* | image-cache-size improvementsMattias Engdegård2020-12-205-20/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | Implement for non-Cairo X11 and NS. Count masks as well, and XImage objects on X11. * src/image.c (image_size_in_bytes): New. (image_frame_cache_size): Use image_size_in_bytes. * src/nsterm.h: * src/nsimage.m (ns_image_size_in_bytes, [EmacsImage sizeInBytes]): New function and method. * src/w32gui.h: * src/w32term.c (w32_image_size): Update signature.
* | Convert apropos-internal from C to Lisp (Bug#44529)Stefan Kangas2020-12-191-39/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This runs insignificantly faster in C, and is already fast enough on reasonably modern hardware. We might as well lift it to Lisp. This benchmark can be used to verify: (benchmark-run 10 (apropos-command "test")) => (0.12032415399999999 2 0.014772391999999995) ; C => (0.13513192100000002 2 0.017216643000000004) ; Lisp * lisp/subr.el (apropos-internal): New defun, converted from C. * src/keymap.c (Fapropos_internal): Remove defun. (apropos_accum): Remove function. (apropos_predicate, apropos_accumulate): Remove variables. (syms_of_keymap): Remove defsubr for Fapropos_internal, and definitions of the above variables. * test/src/keymap-tests.el (keymap-apropos-internal) (keymap-apropos-internal/predicate): Move tests from here... * test/lisp/subr-tests.el (apropos-apropos-internal) (apropos-apropos-internal/predicate): ...to here.
* | ; Revert unintended change.Eli Zaretskii2020-12-191-7/+2
| |
* | Fix over-wide doc stringsEli Zaretskii2020-12-191-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/vc/ediff-init.el (ediff-before-flag-bol) (ediff-after-flag-eol, ediff-before-flag-mol): * lisp/org/org-ctags.el (org-ctags-open-link-functions): * lisp/mail/feedmail.el (feedmail-sendmail-f-doesnt-sell-me-out): * lisp/language/ethio-util.el (ethio-use-three-dot-question) (ethio-quote-vowel-always, ethio-W-sixth-always): * lisp/gnus/nnvirtual.el (nnvirtual-mapping-table) (nnvirtual-mapping-offsets, nnvirtual-mapping-reads) (nnvirtual-mapping-marks, nnvirtual-info-installed): * lisp/gnus/gnus.el (charset): * lisp/gnus/deuglify.el (gnus-outlook-deuglify-unwrap-stop-chars) (gnus-outlook-deuglify-no-wrap-chars) (gnus-outlook-deuglify-attrib-cut-regexp): Fix doc strings to not exceed 80-column limits. (Bug#44858)
* | Fix my two most common causes of all windows/frames redisplayStefan Monnier2020-12-172-2/+2
| | | | | | | | | | * src/buffer.c (Fkill_all_local_variables): Only redisplay the buffer. * src/window.c (set_window_scroll_bars): Only redisplay the window.
* | Make "Invalid modifier in string" ordinary invalid-read-syntax errorZajcev Evgeny2020-12-171-1/+1
| | | | | | | | | | | | * src/lread.ec (read1): Raise "Invalid modifier in string" error as `invalid-read-syntax'. This fixes raise of unhandled error in `elisp--local-variables'
* | Fix C-n/C-p when a line starts with an imageEli Zaretskii2020-12-151-1/+21
| | | | | | | | | | | | | | | | * src/xdisp.c (move_it_to): Handle the case where the second call to move_it_in_display_line_to under MOVE_TO_Y takes us farther from TO_CHARPOS than the first call. This fixes values returned by pos-visible-in-window-p and posn-at-point when the screen line starts with invisible text followed by an image. (Bug#9092)
* | Merge from origin/emacs-27Glenn Morris2020-12-152-0/+13
|\ \ | |/ | | | | | | 62a6934af9 Fix crash when using XRender and restoring image from X (b... de032d41c6 Bind k to image-kill-buffer in doc-view-mode-map.