aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* * src/minibuf.c (Fread_no_blanks_input): Move to `minibuffer.el`Stefan Monnier2021-04-202-31/+0
| | | | | | | * src/keymap.c (syms_of_keymap): * lisp/minibuffer.el (minibuffer-local-ns-map): Move declaration to initialization. (read-no-blanks-input): Move from `minibuf.c`.
* * src/minibuf.c (read_minibuf): Change multibyte more safelyStefan Monnier2021-04-201-9/+7
| | | | | | | | We used to `bset_enable_multibyte_characters` while the buffer is not empty, putting the buffer temporarily in an inconsistent state. Further simplifications along the way: Prefer re-using local var `histvar` and let `insert` do the unibyte<->multibyte conversion if needed.
* Fix bug #47781: (window-list-1 nil t) wrongly returned nil.Alan Mackenzie2021-04-201-1/+2
| | | | | * src/window.c (candidate_window_p): In the WINDOW_P (all_frames) branch of the conditional, insert "EQ (minibuf, Qt)" in the requisite place.
* Introduce and use minibuffer-mode. This fixes bug #47150Alan Mackenzie2021-04-201-8/+14
| | | | | | | | | | | | | | | | | | | * lisp/minibuffer.el (minibuffer-mode): New derived mode. * src/minibuf.c (syms_of_minibuf): New DEFSYMs Qminibuffer_mode, Qminibuffer_inactive_mode, Qminibuffer_completing_file_name, Qselect_frame_set_input_focus, Qadd_to_history. (read_minibuf, set_minibuffer_mode, read_minibuf_unwind): Use the new DEFSYMs in place of continual interning. (set_minibuffer_mode): Put an active minibuffer into minibuffer-mode rather than fundamental-mode. * doc/emacs/mini.texi (Minibuffer Edit): Mention minibuffer-mode. * doc/lispref/minibuf.texi (Intro to Minibuffers): Add a paragraph about minibuffer-mode. * etc/NEWS (Incompatible Lisp Changes in Emacs 28.1): Add an entry.
* completing-read: If HIST is the symbol `t', history is not recorded.Daniel Mendler2021-04-191-1/+2
| | | | | | | | * lisp/minibuffer.el (completion-all-sorted-completions): Check if `minibuffer-history-variable` is `t` * src/minibuf.c (completing-read): Update docstring * doc/lispref/minibuf.texi: Update documentation of `read-from-minibuffer` and `completing-read`
* Avoid selecting tooltip windows and frames (Bug#47207)Martin Rudalics2021-04-184-15/+40
| | | | | | | | | | | | | * src/frame.c (do_switch_frame): Don't switch to a tooltip frame. (Fselect_frame): Do not select a tooltip frame. * src/w32fns.c (Fx_show_tip): * src/xfns.c (Fx_show_tip): Set the tooltip window's `no-other-window' parameter so `other-window' will skip it. * src/window.c (select_window): Do not select a tooltip window. (candidate_window_p): Make sure MINIBUF is live. (decode_next_window_args): Make sure that W's frame's minibuffer window is live before including it. (Qno_other_window): New symbol.
* Fix :scale's affect on :width and :height (bug#47819)Alan Third2021-04-171-2/+2
| | | | | * src/image.c (compute_image_size): Multiply width and height values by scale.
* Don't allow quitting while rebuilding Vwindow_list (Bug#47244)Martin Rudalics2021-04-171-0/+21
| | | | | * src/window.c (window_list, next_window, window_list_1): Don't allow quitting in Fnconc and Fmemq (Bug#47244).
* Check minibuffer windows are live windows, rather than assuming itAlan Mackenzie2021-04-161-14/+24
| | | | | | | | | This partly fixes bug #47207. * src/minibuf.c (choose_minibuf_frame, move_minibuffers_onto_frame) (read_minibuf (twice), read_minibuf_unwind): Before using a frame's ->minibuffer_window field, check it is valid with WINDOW_LIVE_P. (choose_minibuf_frame): Remove the emacs_abort for a null minibuffer.
* Improve docstring of 'frame-scale-factor'Robert Pluim2021-04-161-0/+1
| | | | | * src/frame.c (Fframe_scale_factor): Explain what happens when the FRAME argument is nil.
* Fix 'garbage-collect-maybe'Eli Zaretskii2021-04-151-1/+1
| | | | | * src/alloc.c (Fgarbage_collect_maybe): No longer interactive. (Bug#47805)
* Allow use of em in image spec sizesAlan Third2021-04-151-17/+41
| | | | | | | | | | * src/image.c (image_get_dimension): New function. (compute_image_size): Use image_get_dimension to set the sizes, and pass in the image struct instead of just the spec. (image_set_transform): (imagemagick_load_image): (svg_load_image): Use the image instead of the spec in compute_image_size. (syms_of_image): Add 'em' as a symbol.
* Add condition-case success handler (bug#47677)Mattias Engdegård2021-04-151-3/+31
| | | | | | | | | | | | | | | | | | | | Allow a condition-case handler on the form (:success BODY) to be specified as the success continuation of the protected form, with the specified variable bound to its result. * src/eval.c (Fcondition_case): Update the doc string. (internal_lisp_condition_case): Implement in interpreter. (syms_of_eval): Defsym :success. * lisp/emacs-lisp/bytecomp.el (byte-compile-condition-case): Implement in byte-compiler. * lisp/emacs-lisp/cl-macs.el (cl--self-tco): Allow self-TCO from success handler. * doc/lispref/control.texi (Handling Errors): Update manual. * etc/NEWS: Announce. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases) (bytecomp-condition-case-success): * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels): Add test cases.
* Don't error out when selection data is unavailable (bug#47642)Juri Linkov2021-04-141-7/+14
| | | | | * src/xselect.c (x_get_window_property_as_lisp_data): Display a message and return nil when data is not available.
* ; Fix a couple of recent typos.Basil L. Contovounesios2021-04-141-2/+3
|
* Add two optional arguments to 'string-width'Eli Zaretskii2021-04-143-28/+41
| | | | | | | | | | | | | | | | | | | * src/character.c (Fstring_width, lisp_string_width): Accept two optional arguments FROM and TO, to indicate the substring to be considered. (Fstring_width): Add caveats in the doc string about display features ignored by the function. (Bug#47712) * src/character.h (lisp_string_width): Update prototype. * src/editfns.c (styled_format): Adjust call of lisp_string_width to its changed signature. * test/src/character-tests.el (character-test-string-width): New file with tests for 'string-width'. * doc/lispref/display.texi (Size of Displayed Text): Document caveats of using 'string-width'. * etc/NEWS: Announce the change.
* * src/xdisp.c (wset_update_mode_line): Move from `src/window.c`Stefan Monnier2021-04-133-14/+13
| | | | | | | | | | Move that function next to its siblings. Also simplify it, since after careful analysis it is now clear that the frame's title's update is already handled elsewhere (in `prepare_menu_bars` and `redisplay_window`) so we just need to make sure the `redisplay` bit is set. * src/window.c (wset_update_mode_line): Move to `src/xdisp.c`. * src/window.h (wset_update_mode_line): Declare.
* Resurrect mouse-highlight of close buttons on tab-barEli Zaretskii2021-04-132-5/+131
| | | | | | | | | | | | | | * src/w32term.c (w32_draw_image_relief): Support tab-bar drawing with relief as xterm.c does. * src/xdisp.c (handle_tab_bar_click): Access the mouse-highlight info. Call show_mouse_face to show the button in the pressed or the released state, according to value of DOWN_P. (note_tab_bar_highlight): Function added back. (note_mouse_highlight): Call note_tab_bar_highlight when the mouse pointer is in the tab-bar window. (show_mouse_face): Return immediately if mouse_face_window is not set up in HLINFO. This avoids rare assertion violations.
* * src/emacs.c (load_seccomp): Consistently check for nonzero resultPhilipp Stephani2021-04-111-1/+1
|
* Add another check for the required header <linux/filter.h>.Philipp Stephani2021-04-111-2/+2
| | | | | * configure.ac: Also check for <linux/filter.h>. * src/emacs.c (SECCOMP_USABLE): Also check for <linux/filter.h>.
* Also check for needed seccomp macros.Philipp Stephani2021-04-111-6/+14
| | | | | | | | | It looks like these are not available on some versions of GNU/Linux, breaking the build. * configure.ac: Also check for needed seccomp macros. * src/emacs.c (SECCOMP_USABLE): New macro. (usage_message, main, standard_args): Use it.
* Fix handling of mouse clicks on tab-bar buttonsEli Zaretskii2021-04-111-137/+10
| | | | | | | | | | | | | | | | * src/xdisp.c (note_mouse_highlight): Don't attempt to highlight tab-bar buttons. (note_tab_bar_highlight): Function deleted: it had no effect on display of tab-bar buttons. (tab_bar_item_info): Mention all arguments in the commentary. (get_tab_bar_item): Don't pay attention to mouse-highlight information; instead, compare the button's index with the one recorded in f->last_tab_bar_item. (handle_tab_bar_click): Don't attempt to show tab-bar buttons in pressed or released state: that isn't supported. Determine whether to generate a tab-bar button click based on DOWN_P argument, not on mouse-highlight, which has no effect on tab-bar display. (Bug#47581)
* * src/emacs.c (read_full): Add a few assertions.Philipp Stephani2021-04-101-0/+3
|
* * src/emacs.c (load_seccomp): Add a useful assertion.Philipp Stephani2021-04-101-0/+1
|
* * src/emacs.c (load_seccomp): Fix condition.Philipp Stephani2021-04-101-1/+1
|
* * src/emacs.c (load_seccomp): Fix condition.Philipp Stephani2021-04-101-1/+1
|
* Read file in a loop if necessary.Philipp Stephani2021-04-101-11/+39
| | | | | | | This allows for short reads from 'emacs_read'. * src/emacs.c (read_full): New helper function. (load_seccomp): Use it.
* Add support for --seccomp command-line option.scratch/seccomp-emacs-openPhilipp Stephani2021-04-101-1/+166
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix MS-Windows buildEli Zaretskii2021-04-041-1/+15
| | | | | | * src/image.c: (init_svg_functions) [WINDOWSNT]: Define and load rsvg_handle_set_stylesheet from the DLL for librsvg > 2.48. (lookup_image): Use xmalloc.
* Fix warnings in image.cAlan Third2021-04-041-4/+7
| | | | | * src/image.c (svg_load_image): Fix types and move declaration of 'css' to the top of the function.
* Fix unexec compilationEli Zaretskii2021-04-041-3/+5
| | | | | | | * src/pdumper.c (thaw_hash_tables): Now conditioned by HAVE_PDUMPER. (init_pdumper_once): No-op unless HAVE_PDUMPER. Reported by Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>.
* Fix recent changes regarding frame-scale-factorEli Zaretskii2021-04-041-3/+3
| | | | | * src/frame.c (Fframe_scale_factor): Make more robust and avoid compiler warning while at that. Doc fix.
* Fix build error in frame.h on non-NSİ. Göktuğ Kayaalp2021-04-041-1/+1
| | | | | * src/frame.h (FRAME_SCALE_FACTOR): Fix syntax of macro in previous change.
* Set CSS for SVG filesAlan Third2021-04-032-15/+74
| | | | | | | | | | | | | | | | * src/dispextern.h (struct image): Add font details required for the CSS. * src/image.c (free_image): Free the font family string. (search_image_cache): (uncache_image): Make image caching understand the font details. (lookup_image): Handle the font details when generating the image and looking up the cache. (svg_css_length_to_pixels): Handle 'em' when we know the font size. (svg_load_image): Generate the CSS and apply it to the SVG. (enum svg_keyword_index): (svg_format): (syms_of_image): Add ':css' attribute. * doc/lispref/display.texi (SVG Images): Add details of new svg image attributes.
* Fix NSTRACE failureAlan Third2021-04-031-1/+1
| | | | * src/nsterm.m ([EmacsSurface getContext]): Remove unneeded '@' symbol.
* Implement frame-scale-factorAlan Third2021-04-033-8/+19
| | | | | | | * src/frame.c (Fframe_scale_factor): New function. (syms_of_frame): Add frame-scale-factor. * src/frame.h: Add FRAME_SCALE_FACTOR. * src/image.c: Move FRAME_SCALE_FACTOR to frame.h.
* Protect add-variable-watcher from incorrect usageEli Zaretskii2021-03-291-0/+1
| | | | | * src/data.c (Fadd_variable_watcher): Avoid crashes if SYMBOL isn't. (Bug#47462)
* Use a 64KB page size for pdumpLars Ingebrigtsen2021-03-281-5/+1
| | | | | * src/pdumper.c (dump_get_page_size): Use a 64KB page size on all architectures, as this many vary between systems (bug#47125).
* Clarify the doc string of plist-memeber and plist-putLars Ingebrigtsen2021-03-281-2/+8
| | | | | | * src/fns.c (Fplist_member): (Fplist_put): Clarify what comparison function is used for PROP (bug#47426) and don't claim that PROP has to be a symbol.
* File unlock errors now issue warnings (Bug#46397)Matt Armstrong2021-03-271-3/+23
| | | | | | | | | | | | | | | | The primary idea is to allow `kill-buffer' and `kill-emacs' to complete even if Emacs has trouble unlocking the buffer's file. * lisp/userlock.el (userlock--handle-unlock-error): New function, call `display-error'. * src/filelock.c (unlock_file_body): New function, do what 'unlock_file' used to. (unlock_file_handle_error): New function, call `userlock--handle-unlock-error' with the captured error. (unlock_file): Handle `file-error' conditions by calling the handler defined above. * test/src/filelock-tests.el (filelock-tests-kill-buffer-spoiled): (filelock-tests-unlock-spoiled): Modify to test new behavior.
* Fix encoding by ISO-2022-JPKenichi Handa2021-03-271-0/+6
| | | | | * src/coding.c (encode_coding): Reset the CODING_MODE_LAST_BLOCK flag for all iterations but the last one. (Bug#46933)
* Merge from origin/emacs-27Paul Eggert2021-03-251-1/+1
|\ | | | | | | | | 291a421c2e * admin/make-tarball.txt: Improve and expand the instructi... 0e4795fc98 Fix preeditarea reporting wrong spot.
| * Fix preeditarea reporting wrong spot.Amos Bird2021-03-251-1/+1
| | | | | | | | | | | | | | | | This patch adjust the x position of preeditarea with both left fringe and left margin, which prevents IME preedit box (such as fcitx) from placing at the wrong position in GUI emacs. * src/xfns.c (xic_set_preeditarea): Adjust X for left margin width. (Bug#47377)
| * Fix replace-buffer-contents undefined behaviorPaul Eggert2021-03-251-2/+4
| | | | | | | | | | | | * src/editfns.c (Freplace_buffer_contents): Avoid undefined behavior with competing side effects in parallel subexpressions. Problem reported by Apple clang version 12.0.0 (clang-1200.0.32.29).
| * Document that `buffer-string' retains text propertiesLars Ingebrigtsen2021-03-181-1/+5
| | | | | | | | | | | | | | | | | | * doc/lispref/text.texi (Buffer Contents): Mention text properties in the `buffer-string' documentation. * src/editfns.c (Fbuffer_string): Mention text properties in the doc string (bug#47220). (cherry picked from commit 60af754170f22f5d25510af069ed0ebfec95f992)
| * Fix buffer overflow in xbm_scan (bug#47094)Alan Third2021-03-141-1/+2
| | | | | | | | | | | | | | * src/image.c (xbm_scan): Ensure reading a string doesn't overflow the buffer. (cherry picked from commit ebc3b25409dd614c1814a0643960452683e37aa3)
* | Replace "(default %s)" with 'format-prompt'Gabriel do Nascimento Ribeiro2021-03-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/cmuscheme.el (scheme-load-file, scheme-compile-file): * lisp/comint.el (comint-get-source): * lisp/emulation/viper-cmd.el (viper-quote-region, viper-kill-buffer) (viper-query-replace, viper-read-string-with-history): * lisp/eshell/esh-mode.el (eshell-find-tag): * lisp/gnus/gnus-sum.el (gnus-articles-to-read) (gnus-summary-search-article-forward) (gnus-summary-search-article-backward): * lisp/international/mule-cmds.el (set-input-method, toggle-input-method) (describe-input-method, set-language-environment) (describe-language-environment): * lisp/mh-e/mh-gnus.el (mh-mml-minibuffer-read-disposition): * lisp/mh-e/mh-letter.el (mh-insert-letter): * lisp/mh-e/mh-mime.el (mh-display-with-external-viewer) (mh-mime-save-parts, mh-mh-forward-message) (mh-mml-query-cryptographic-method, mh-minibuffer-read-type): * lisp/mh-e/mh-seq.el (mh-read-seq, mh-read-range): * lisp/mh-e/mh-utils.el (mh-prompt-for-folder): * lisp/progmodes/etags.el (find-tag-tag): (find-tag-noselect, find-tag, find-tag-other-window) (find-tag-other-frame, find-tag-regexp): * lisp/progmodes/idlwave.el (idlwave-find-module): * lisp/progmodes/inf-lisp.el (lisp-load-file, lisp-compile-file): * lisp/progmodes/tcl.el (tcl-load-file, tcl-restart-with-file): * lisp/progmodes/xref.el (xref--read-identifier): (xref-find-definitions, xref-find-definitions-other-window) (xref-find-definitions-other-frame, xref-find-references): * lisp/ses.el (ses-read-printer): (ses-read-cell-printer, ses-read-column-printer) (ses-read-default-printer, ses-define-local-printer): * lisp/subr.el (read-number): * lisp/term.el (term-get-source): * src/minibuf.c (read-buffer): Remove prompt suffix and use 'format-prompt'. * lisp/minibuffer.el (format-prompt): Ignore DEFAULT empty strings (bug#47286).
* | Prevent open minibuffers getting lost when their frame gets deletedAlan Mackenzie2021-03-216-113/+236
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This happened with minibuffer-follows-selected-frame set to t. * doc/emacs/mini.texi (Basic Minibuffer): State where a command's action takes place when a minibuffer's frame has been deleted. * lisp/window.el (window--before-delete-windows, record-window-buffer): Take into account that minibuffers are now recorded on w->prev_buffers field. * src/fns.c (merge_c): New version of `merge' taking a C function, rather than a Lisp function as the comparison function. * src/frame.c (do_switch_frame): Pass arguments sf and for_deletion to move_minibuffers_onnto_frame. * src/lisp.h (top level): Declare merge_c and move_minibuffers_onto_selected_frame. * src/minibuf.c (MB_frame): New Lisp_Object recording the minibuffer's frame. (choose_minibuf_frame): Remove all code except that which sets minibuf_window to the current frame's minibuffer. (minibuffer_ent_greater): New comparison function, passed to merge_c. (zip_minibuffer_stacks): New function. (move_minibuffers_onto_frame): Renamed from `move_minibuffer_onto_frame' given two arguments, the old frame and for_deletion, and simplified. Minibuffers are now stacked in the mini-window's ->prev_buffers field. (read_minibuf): Several detailed amendments. (exp_MB_frame): New Lisp_Object, the expired minibuffer's frame. (read_minibuf_unwind): Search for the expired minibuffer's frame, rather than taking it from (unreliable) variables. Switch temporarily to this frame for tidying up operations. (minibuffer_unwind): New function which pops a stacked minibuffer. (syms_of_minibuf): Call staticpro for the two new Lisp variables. * src/window.c (Fset_window_configuration): Don't record minibuffers with record-window-buffer. * src/xdisp.c (gui_consider_frame_title): Remove redundant Fselect_window, which caused an unwanted frame switch. Amend the arguments to format_mode_line_unwind_data to match.
* | Don’t convert pointer to boolPaul Eggert2021-03-191-1/+1
| | | | | | | | | | | | Without this patch, Oracle Studio 12.6 complains about converting pointer to bool. * src/editfns.c (styled_format): Use !!.
* | Extend handled events in 'while-no-input-ignore-events' (Bug#47205)Michael Albinus2021-03-181-0/+6
| | | | | | | | | | | | | | * etc/NEWS: Mention changes to 'while-no-input-ignore-events'. * src/keyboard.c (kbd_buffer_store_buffered_event): Handle also Qfile_notify and Qdbus_event as ignore_event. (Bug#47205)