1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-01 01:41:01 -08:00
Commit graph

42662 commits

Author SHA1 Message Date
Mattias Engdegård
90aab73f8d More string-search optimisations
All-ASCII strings cannot have substrings with non-ASCII characters in
them; use this fact to avoid searching entirely.

* src/fns.c (Fstring_search): For multibyte non-ASCII needle and
unibyte haystack, don't check if the haystack is all-ASCII; it's a
waste of time. For multibyte non-ASCII needle and multibyte
all-ASCII haystack, fail immediately.
* test/src/fns-tests.el (string-search): Add more test cases.
2020-11-19 14:58:48 +01:00
Alan Mackenzie
6e469709c5 In attempted recursive minibuffer use, display error message in correct frame
This was problematic when minibuffer-follows-selected-frame was non-nil.
Introduce a new parameter DONT-SET-FRAME to set-window-configuration.

* doc/lispref/windows.texi (Window Configurations): Describe the new &optional
parameter to set-window-configuration.

* etc/NEWS (Lisp Changes): Note the new parameter to set-window-configuration.

* src/keyboard.c (read_char_help_form_unwind): Add a new Qnil argument to the
call of Fset_window_configuration.

* src/minibuf.c (read_minibuf): Cons up a Qt with the window configuration in
the argument to record_unwind_protect for the window configuration (twice).

* src/window.c (Fset_window_configuration): Add the new &optional parameter
and document it in the doc string.  At the final do_switch_frame operation,
restore the original frame when DONT-SET-FRAME is non-nil.
(restore_window_configuration): Handle the new parameter when the supplied
argument is a cons.
2020-11-19 10:31:50 +00:00
Alan Third
ca8e37eaf6 Fix SVG display again (bug#44655)
* src/image.c (svg_load_image): Fall back to
rsvg_handle_get_dimensions if we can't calculate the size of the
image.
2020-11-18 23:07:57 +00:00
Glenn Morris
a280a6d7ca Merge from origin/emacs-27
19da602991 Fix input method translation near read-only text
5aabf2cc7f Fix display of truncated R2L lines on TTY frames
daff3bda10 Avoid crashes when a reversed glyph row starts with a comp...
b697bb91a1 ; * .gitignore: src/fingerprint.c not generated since 2019...
2020-11-16 08:59:47 -08:00
Stefan Kangas
36431e1679 Make initial frame match frame-title-format
* src/xterm.c (x_term_init):
* src/w32term.c (w32_initialize_display_info): Sync initial frame
title with new value of Vframe_title_format.
Problem reported by Angelo Graziosi <angelo.g0@libero.it>.
2020-11-15 02:41:36 +01:00
Akira Kyle
e71f5f1fd1 Work around glib messing with signal handlers more than it should
* src/process.c (init_process_emacs): force glib's g_unix_signal
handler into lib_child_handler where it should belong.

Copyright-paperwork-exempt: yes
2020-11-14 16:39:41 +01:00
Eli Zaretskii
206445a703 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2020-11-14 14:36:34 +02:00
Philipp Stephani
b13e87c35b Capitalize portable dump messages.
We capitalize all other messages during the dump, so capitalize the
"dump mode" and "dumping fingerprint" ones as well for consistency.

* src/pdumper.c (Fdump_emacs_portable): Capitalize fingerprint message
prefix.

* lisp/loadup.el: Capitalize "dump mode" message.
2020-11-14 13:33:07 +01:00
Jared Finder
91d5edd9d1 Face-changing text properties and help-echo now work with xterm-mouse.
* src/dispnew.c (update_mouse_position): New function for mouse
movement logic in 'handle_one_term_event' that can be shared across
different mouse backends.
(display--update-for-mouse-movement): New lisp function, call it.
* lisp/xt-mouse.el (xterm-mouse--handle-mouse-movement): New function
that calls 'display--update-for-mouse-movement'.
(xterm-mouse-translate-1): Call it.
* src/term.c (handle_one_term_event): Inline logic from
'term_mouse_movement' and call 'update_mouse_position'.
(term_mouse_movement): Delete.
2020-11-14 14:31:55 +02:00
Eli Zaretskii
5aabf2cc7f Fix display of truncated R2L lines on TTY frames
* src/xdisp.c (extend_face_to_end_of_line): Use a while-loop, not
a do-while loop, to avoid appending an extra glyph at the end of a
line that is one character shorter than the window-width.  This is
needed to fix display of reversed glyph rows that are almost as
wide as the window, because append_space_for_newline already added
one space glyph.
2020-11-14 13:56:12 +02:00
Eli Zaretskii
daff3bda10 Avoid crashes when a reversed glyph row starts with a composition
* src/dispnew.c (build_frame_matrix_from_leaf_window): Add an
assertion to prevent us from overwriting non-char glyphs with the
vertical border glyph.
* src/xdisp.c (extend_face_to_end_of_line): Account for one glyph
possibly inserted by append_space_for_newline.  (Bug#44506)
Remove a kludgey correction for an off-by-one error in column
counting, which is no longer needed.
2020-11-14 13:43:16 +02:00
Glenn Morris
a32fd9f64d Merge from origin/emacs-27
a3d316bbb7 (origin/emacs-27) Update information about refcards
f43e9ad524 Avoid crashes in the daemon due to user interaction
2020-11-13 09:00:26 -08:00
Glenn Morris
d4e436e080 Merge from origin/emacs-27
ac1a2b2160 Add more doc-view requirements
109eb1e7e2 Fix undefined behavior when fetching glyphs from the displ...

# Conflicts:
#	lisp/doc-view.el
2020-11-13 09:00:26 -08:00
Glenn Morris
e3e1cd733e Merge from origin/emacs-27
75384bd155 Update the doc-view header line
13ab70c80e Avoid breaking Arabic shaping in 'window-text-pixel-size'
e693d97e50 doc-view.el comment clarification
968e85a2ce Update erc documentation about C-c C-b
2020-11-13 08:58:06 -08:00
Alan Third
7970610d48 Fix error with fn key in NS port (bug#44533)
* src/nsterm.m ([EmacsView keyDown:]): Move the correction for fn key
handling to before the modifiers are calculated.
2020-11-13 16:15:00 +00:00
Stefan Kangas
ccf2576081 Fix mistake in describe-buffer-bindings
* src/keymap.c (Fdescribe_buffer_bindings): Fix a call in
describe-buffer-bindings.  This fixes a mistake in my previous commit
to prefer the Lisp version of describe-map-tree (8a1441310a), where
0 was accidentally converted to Qt in two places.
2020-11-12 02:58:02 +01:00
Eli Zaretskii
f43e9ad524 Avoid crashes in the daemon due to user interaction
* src/minibuf.c (read_minibuf): Avoid crashes in the daemon if the
init file invokes some kind of minibuffer interaction, by not
updating the selected frame if it's the initial frame.
(Bug#44583)
2020-11-11 21:46:43 +02:00
Eli Zaretskii
621bb79b70 New debugging command 'malloc-info'
* src/alloc.c (Fmalloc_info) [GNU_LINUX]: New command.
(syms_of_alloc): Defsubr it.  (Bug#43389)
2020-11-10 19:41:04 +02:00
Eli Zaretskii
f1eca59dfa Fix a recent change in image.c for MS-Windows
* src/image.c: Fix DEF_DLL_FN of
rsvg_handle_get_intrinsic_dimensions.  Reported by Andy Moreton
<andrewjmoreton@gmail.com>.
2020-11-10 17:06:46 +02:00
Philipp Stephani
109eb1e7e2 Fix undefined behavior when fetching glyphs from the display vector.
You can trigger this rather obscure bug by enabling selective display
if the second glyph in its display vector has an invalid face.  For
example, evaluate

(set-display-table-slot standard-display-table
                        'selective-display [?A (?B . invalid)])

and then enable selective display.

* src/xdisp.c (next_element_from_display_vector): Check whether next
glyph code is valid before accessing it.
2020-11-09 22:14:39 +01:00
Stefan Kangas
95c04675ab Simplify getting value of text-quoting-style (Bug#44471)
* src/doc.c (text_quoting_style): Remove function by merging it...
(Ftext_quoting_style): ...here.  Rename from Fget_quoting_style.
(syms_of_doc): Update defsubr for Ftext_quoting_style.
* src/lisp.h (enum text_quoting_style): Remove enum.
* src/doprnt.c (doprnt):
* src/editfns.c (styled_format):
* lisp/help.el (substitute-command-keys): Update callers to use
text-quoting-style.
2020-11-09 21:08:28 +01:00
Alan Third
5293795806 Fix css length calculations
* src/image.c (svg_css_length_to_pixels): Put in missing breaks where
necessary.
2020-11-09 16:23:24 +00:00
Eli Zaretskii
3de31e7b71 Fix compilation of image.c on MS-Windows
This is a followup to last change in image.c.
* src/image.c (rsvg_handle_get_intrinsic_dimensions): Define to
call fn_rsvg_handle_get_intrinsic_dimensions.
(svg_css_length_to_pixels): Compile only for librsvg >= 2.46.0, as
RsvgLength type was not defined before.
2020-11-09 17:35:52 +02:00
Eli Zaretskii
13ab70c80e Avoid breaking Arabic shaping in 'window-text-pixel-size'
* src/xdisp.c (CHAR_COMPOSED_P): If the bidi_p flag is not set,
pass -1 to composition_reseat_it, so that the shaping engine will
figure out the directionality of the text.  This is important,
e.g., when using move_it_* functions in some context that is not
redisplay, such as 'window-text-pixel-size'.  (Bug#44521)
2020-11-09 17:22:25 +02:00
Eli Zaretskii
bffd5d3a9d Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2020-11-09 16:57:03 +02:00
Alan Third
18a7267c32 Fix crash in ns_mouse_position (bug#44313)
* 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.
2020-11-09 14:49:52 +00:00
Alan Third
4469e0de01 Calculate SVG image sizes more accurately (bug#44206)
* src/image.c (svg_css_length_to_pixels): New function.
(svg_load_image): Try more methods to work out the image size.
2020-11-09 14:49:51 +00:00
Akira Kyle
a05810b2d5 Fix xwidget's webkitgtk widget overriding of Emacs SIGCHLD handler
* src/xwidget.c (make-xwidget): Save and restore Emacs SIGCHLD signal
handler since glib doesn't (but should) do this.
Copyright-paperwork-exempt: yes
2020-11-09 14:51:48 +01:00
Eli Zaretskii
b83e31bf95 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2020-11-08 16:51:13 +02:00
Alan Mackenzie
cfe8a73cab Don't set the selected window to the miniwindow on a frame change.
Intended to fix bug #44502.

* src/minibuf.c (move_minibuffer_onto_frame): Remove the lines of code which
set the selected window to the minibuffer.
2020-11-08 13:28:55 +00:00
Glenn Morris
33e8116fc2 Merge from origin/emacs-27
f5d7fb3a2d (origin/emacs-27) Fix 'uudecode-decode-region-internal' in...
d4242177da Fix 'send-string-to-terminal' writing very long strings
9da0f4026c * lisp/subr.el (read-char-from-minibuffer): Doc fix.  (Bug...
9899f74e4e Merge branch 'emacs-27' of git.savannah.gnu.org:/srv/git/e...
a6fcba783e Fix documentation of 'windmove-swap-states-default-keybind...
f4acd7a924 Split windows evenly when 'min-margins' parameter was set ...
2020-11-07 09:57:56 -08:00
Glenn Morris
6b63b6669d Merge from origin/emacs-27
53933cdf5c ; * lisp/international/mule.el (define-coding-system): Doc...
e90ffcf759 * src/w32fns.c (Fw32_register_hot_key): Doc fix.  (Bug#44456)
89740e9cb5 Prevent redisplay from moving point behind user's back
5932df7435 Document that the :match function for a widget takes an ex...
1b7ab9d0ac Don't render XML declaration of an HTML document (bug#44348)

# Conflicts:
#	lisp/international/mule.el
2020-11-07 09:57:56 -08:00
Eli Zaretskii
a5867ddfbd Don't leave lock files after 'replace-buffer-contents'
* src/editfns.c (Freplace_buffer_contents): Unlock the buffer's
file if no changes have been made.  (Bug#44303)
2020-11-07 12:29:41 +02:00
Eli Zaretskii
d4242177da Fix 'send-string-to-terminal' writing very long strings
* src/dispnew.c (Fsend_string_to_terminal): Prevent partial writes
by blocking SIGIO while 'fwrite' runs.  (Bug#44320)
2020-11-07 11:19:44 +02:00
Eli Zaretskii
bc76afd355 ; * src/xdisp.c (redisplay_window): Add comment for a recent change. 2020-11-07 10:44:30 +02:00
Eli Zaretskii
33e2418a7c Fix scrolling problems with misc-fixed fonts under Cairo
* src/ftcrfont.c (ftcrfont_glyph_extents): Avoid rounding up the
glyph ascent to a higher value than needed due to floating-point
roundoff errors.  (Bug#44284)
2020-11-07 10:27:15 +02:00
Pip Cet
0cdd6c9218 Handle Cairo errors in ftcrfont_open
* src/ftcrfont.c (ftcrfont_open): Handle Cairo errors (bug#41627).

(cherry picked from commit 954a4decfc)
2020-11-07 10:13:07 +02:00
Glenn Morris
6b77ad6e77 Fix --enable-check-lisp-object-type build
* src/print.c (syms_of_print) <print-integers-as-characters>:
Fix type.
2020-11-06 08:00:54 -08:00
Mattias Engdegård
0c5eb1c7e7 Reduce integer-output-format to print-integers-as-characters
The variable now only controls whether characters are printed, not
the radix.  Control chars are printed in human-readable syntax
only when special escapes such as ?\n are available.  Spaces,
formatting and combining chars are excluded (bug#44155).
Done in collaboration with Juri Linkov.

* src/character.c (graphic_base_p):
* src/print.c (named_escape): New functions.
(print_object): Change semantics as described above.
(syms_of_print): Rename integer-output-format.  Update doc string.
* doc/lispref/streams.texi (Output Variables):
* etc/NEWS:
* test/src/print-tests.el (print-integers-as-characters):
Rename and update according to new semantics.  The test now passes.
2020-11-06 13:55:32 +01:00
Philipp Stephani
5d0da63f00 * src/minibuf.c (move_minibuffer_onto_frame): Fix comparison 2020-11-05 21:11:14 +01:00
Alan Mackenzie
2ecbf4cfae Allow minibuffer to stay in its original frame. Tidy up this area.
* doc/emacs/mini.texi (Basic Minibuffer): Add an entry for
minibuffer-follows-selected-frame.

* doc/lispref/minibuf.texi (Minibuffer Misc): Describe the new parameter to
minibufferp, LIVE.

* etc/NEWS: Add an entry describing the new minibuffer strategy.

* lisp/cus-start.el (minibuffer-prompt-properties--setter): Add an entry for
minibuffer-follows-selected-frame.

* lisp/minibuffer.el (minibuffer-message): Check for the current buffer being
an _active_ minibuffer rather than merely a minibuffer.

* src/frame.c (do_switch_frame): Call move_minibuffer_onto_frame.

* src/lisp.h (Top level): Add prototypes for move_minibuffer_onto_frame and
is_minibuffer.

* src/minibuf.c (minibuf_follows_frame): New function which ignores local and
let-bound values of minibuffer-follows-selected-frame.
(choose_minibuf_frame): Reformulate this function to reuse a minibuffer window
where possible, and to ensure no other frame has its minibuffer current, but
only when `minibuffer-follows-selected-frame'.
(move_minibuffer_onto_frame): New function.
(live_minibuffer_p): New function.
(Fminibufferp): Add a new &optional parameter LIVE.  Reformulate, possibly
calling live_minibuffer_p.
(read_minibuf): move the incrementation of minibuf_level to before the call of
choose_minibuf_frame.  Empty the miniwindows of frames without an active
minibuffer, rather than of all but the current frame.
(is_minibuffer): New function.
(read_minibuf_unwind): Note the miniwindow being restored and resize all other
miniwindows to zero size.
(minibuffer-follows-selected-frame): New configuration variable.

* src/window.c (candidate_window_p): In some scenarios, check the miniwindow
holds an active minibuffer.

* src/xdisp.c (get_window_cursor_type): Suppress the cursor for non-active
miniwindows, regardless of minibuf_level.
2020-11-05 19:27:43 +00:00
Eli Zaretskii
e90ffcf759 * src/w32fns.c (Fw32_register_hot_key): Doc fix. (Bug#44456) 2020-11-05 19:46:50 +02:00
Eli Zaretskii
89740e9cb5 Prevent redisplay from moving point behind user's back
* src/bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start):
Bind inhibit-quit to a non-nil value around calls to
fast_looking_at, to prevent breaking out of redisplay_window,
which temporarily moves point in buffers shown in non-selected
windows.  (Bug#44448)
2020-11-04 22:10:06 +02:00
Stefan Monnier
1c9500da66 * src/term.c (handle_one_term_event): Simplify.
Remove the `hold_quit` argument which was never used.
Streamline the control flow.
Thanks to Jared Finder <jared@finder.org> for pointing it out.

* src/keyboard.c (tty_read_avail_input): Simplify accordingly.
2020-11-04 13:44:51 -05:00
Mattias Engdegård
4445cb76db Add missing argument to directory_files_internal calls
* src/kqueue.c (kqueue_compare_dir_list, Fkqueue_add_watch):
Pass the new seventh argument.
2020-11-02 18:58:01 +01:00
Eli Zaretskii
5f6dcb1c66 Fix a recent change in dired.c
* src/dired.c (directory_files_internal): Fix type of integer
variables to avoid overflow in 32-bit builds --with-wide-int.
2020-11-02 19:55:48 +02:00
Glenn Morris
c1565cc3b9 Merge from origin/emacs-27
4e6104ea0b ; * src/xdisp.c (display_string): Fix a typo in a comment.
7162228815 Improve indexing of check-declare
d218b28ab5 ; * lisp/autoinsert.el (auto-insert-alist): Fix texinfo URL.
2020-11-02 09:27:40 -08:00
Glenn Morris
018e0c36fb Merge from origin/emacs-27
1fc9de4b81 Improve reproducibility of generated -pkg.el files
da6234e2df Make sure pixel sizes are zero when setting window size fo...
2d15296db1 Fix failure of 'emacs --daemon' on Cygwin
8abce5b0c6 CC Mode: Only recognize foo (*bar) as a function pointer w...
85d1d8d768 Fix NEWS entry for fix of Bug#44080
2443b15a91 * src/buffer.c (syms_of_buffer) <fill-column>: Improve doc...

# Conflicts:
#	etc/NEWS
2020-11-02 09:27:40 -08:00
Michael Albinus
e654b41c6f Fix some glitches in recent directory-files-* changes
* doc/lispref/files.texi (Contents of Directories):
Fix description of directory-files, directory-empty-p and
directory-files-and-attributes.

* etc/NEWS: Fix entry for directory-files-and-attributes.  Fix typos.

* lisp/dired.el (directory-empty-p): Move function from here ...

* lisp/files.el (directory-empty-p): ... to here.

* lisp/net/ange-ftp.el (ange-ftp-directory-files): Call `nreverse' later.

* lisp/net/tramp.el (tramp-handle-directory-files):
* lisp/net/tramp-adb.el
(tramp-adb-handle-directory-files-and-attributes): Do not call
`nreverse'.

* src/dired.c (Fdirectory_files)
(Fdirectory_files_and_attributes): Fix docstrings.

* test/src/dired-tests.el: Removed.  Tests moved to
test/lisp/dired-tests.el.

* test/lisp/dired-tests.el (dired-test-bug27899): Tag it :unstable.
(dired-test-directory-files)
(dired-test-directory-files-and-attributes): New tests.
2020-11-02 17:56:06 +01:00
Arthur Miller
0806075520 Add directory-empty-p and new argument COUNT for directory-files-*
* doc/lispref/files.texi (Contents of Directories): Mention COUNT
argument of directory-files.  Add directory-empty-p.

* etc/NEWS: Mention directory-empty-p and directory-files changes.

* lisp/dired.el (directory-empty-p): New defun.

* lisp/net/ange-ftp.el (ange-ftp-directory-files)
(ange-ftp-directory-files-and-attributes):
* lisp/net/tramp.el (tramp-handle-directory-files)
(tramp-handle-directory-files-and-attributes):
* lisp/net/tramp-adb.el
(tramp-adb-handle-directory-files-and-attributes):
* lisp/net/tramp-rclone.el (tramp-rclone-handle-directory-files):
* lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes):
* lisp/net/tramp-smb.el (tramp-smb-handle-directory-files): Add new COUNT
argument.

* src/dired.c (directory_files_internal): Implement new
RETURN_COUNT argument.
(Fdirectory_files, Fdirectory_files_and_attributes): Add new COUNT
argument.

* src/lisp.h (directory_files_internal): Add RETURN_COUNT to declaration.

* src/sysdep.c (list_system_processes): Add Qnil to
directory_files_internal call.

* test/src/dired-tests.el (directory-files-and-attributes-tests):
New file.
2020-11-02 12:38:27 +01:00