Alan Mackenzie [Sun, 7 Nov 2021 20:44:46 +0000 (20:44 +0000)]
Amend Follow Mode to handle header lines and tab lines correctly
This fixes bug #51590.
list/follow.el (follow-scroll-down): Incorporate the height of the tab line
into the calculation of the window height.
(follow-calc-win-end): Incorporate the pixel heights of the header line and
the tab line the calculation of the buffer position of the bottom screen line.
* lisp/isearch.el (isearch-filter-visible): Add check if there are
no properties 'inhibit-isearch' in the search range,
instead of code of c8acc5fd92ad9979fc5870623014290cad998337.
Michael Albinus [Sun, 7 Nov 2021 17:06:24 +0000 (18:06 +0100)]
Merge from origin/emacs-28
7fdb2ae412 Add some unit tests for 'abbreviate-file-name' 21de5e7b2e Fix compilation MinGW warnings 54b726c815 ; * etc/PROBLEMS: More specific recipe for WebKit-related ... d85cf33e49 Escape '%' in filenames to fix flymake warnings 6243a43ac2 Fix search string generation in nnimap-make-thread-query f05b8a939b Update to Org 9.5-68-g77e2ec
Eli Zaretskii [Sun, 7 Nov 2021 15:02:46 +0000 (17:02 +0200)]
Fix compilation MinGW warnings
* src/w32.h (prepare_standard_handles, reset_standard_handles):
Fix prototypes. Reported by Andy Moreton
<andrewjmoreton@gmail.com> in
https://lists.gnu.org/archive/html/emacs-devel/2021-11/msg00597.html.
Po Lu [Sun, 7 Nov 2021 12:02:06 +0000 (20:02 +0800)]
Document the xwidget type
* doc/lispref/elisp.texi: Add Xwidget Type to the menu.
* doc/lispref/objects.texi (Editing Types): Add Xwidget Type to the
menu.
(Xwidget Type): New node.
Cristian [Sun, 7 Nov 2021 01:03:12 +0000 (02:03 +0100)]
Another addition to latin-2 input methods
* lisp/leim/quail/latin-pre.el ("latin-2-prefix"):
* lisp/leim/quail/latin-post.el ("latin-2-postfix"): Add variants
of "`t" and "t," for Romanian. (Bug#51638)
Po Lu [Sat, 6 Nov 2021 12:59:08 +0000 (20:59 +0800)]
Make "open in new window" from an xwidget's context menu work
* doc/lispref/commands.texi (Xwidget Events): Document new event type.
* doc/lisprefdisplay.texi (Xwidgets): Document new argument to
make-xwidget, and new function.
* etc/NEWS: Document changes.
* lisp/xwidget.el: Bind xwidget-display-event to
xwidget-webkit-display-event.
(xwidget-webkit-import-widget): New function.
(xwidget-webkit-display-event): New command.
* src/keyboard.c (kbd_buffer_get_event): New event type.
(make_lispy_event): Handle XWIDGET_DISPLAY_EVENTs.
(syms_f_keyboard): Define new symbol.
* src/termhooks.h (enum event_kind): New enum XWIDGET_DISPLAY_EVENT.
* src/xwidget.c (webkit_create_cb)
(store_xwidget_display_event)
(webkit_ready_to_show)
(webkit_create_cb_1, webkit_create_cb)
(Fset_xwidget_buffer): New functions.
(Fmake_xwidget): Add internal argument RELATED and connect create
signal.
(syms_of_xwidget): Define now subrs.
* lisp/xwidget.el (xwidget-webkit-mode-map): Bind C-s and C-r to
webkit isearch.
(xwidget-webkit-isearch--string, xwidget-webkit-isearch--is-reverse):
New buffer-local variables.
(xwidget-webkit-isearch--update, xwidget-webkit-isearch-erasing-char)
(xwidget-webkit-isearch-printing-char, xwidget-webkit-isearch-forward)
(xwidget-webkit-isearch-backward, xwidget-webkit-isearch-exit):
New functions.
(xwidget-webkit-isearch-mode-map): New keymap.
(xwidget-webkit-isearch-mode): New minor mode.
* src/xwidget.c (Fxwidget_webkit_search)
(Fxwidget_webkit_next_result)
(Fxwidget_webkit_previous_result)
(Fxwidget_wenkit_finish_search): New functions.
(syms_of_xwidget): Define new built-ins.
(kill_buffer_xwidgets): Free search query if present.
* src/xwidget.h (struct xwidget): Add field for search query.
Po Lu [Sat, 6 Nov 2021 04:34:41 +0000 (12:34 +0800)]
Fix cursor for new widget views
* src/xwidget.c (Fmake_xwidget): Clear hit result.
(cursor_for_hit): Use integer hit result.
(define_cursors): Set hit result appropriately.
(widget_init_view): Set cursor to the existing hit result.
* src/xwidget.h (struct xwidget): Add hit result field.
Po Lu [Sat, 6 Nov 2021 02:37:25 +0000 (10:37 +0800)]
Display page titles in xwidget webkit header line
* lisp/xwidget.el (xwidget-webkit--title): New variable.
(xwidget-webkit-callback, xwidget-webkit-mode): Set header line format
and associated variables.
Po Lu [Fri, 5 Nov 2021 13:01:12 +0000 (21:01 +0800)]
Make the WebKit inspector available
* etc/NEWS: Document changes.
* src/xwidget.c (find_widget_at_pos)
(find_widget)
(find_widget_cb): New functions.
(struct widget_search_data): New structure.
(Fmake_xwidget): Enable web inspector for WebKit widgets.
(Fxwidget_perform_lispy_event): Use current focus instead of
hard-coded widget.
(xwidget_button_1, xwidget_button, xwidget_motion_or_crossing):
Use window at event position instead of the default widget.
Po Lu [Fri, 5 Nov 2021 11:32:20 +0000 (19:32 +0800)]
Add new tool-bar items to xwidget-webkit
* etc/images/README: Update copyright information for new images.
* etc/images/connect-to-url.pbm:
* etc/images/connect-to-url.xpm: Import new images from GNOME.
* lisp/xwidget.el (xwidget-webkit-tool-bar-map): New keymap variable.
(xwidget-webkit-mode): Set tool-bar-map to the appropriate map.
Po Lu [Fri, 5 Nov 2021 02:22:27 +0000 (10:22 +0800)]
Handle crossing events on xwidget windows correctly
* src/xterm.c (handle_one_xevent): Clear help and mouse face
when handling xwidget entry events.
* src/xwidget.c (xwidget_motion_or_crossing): Add device to crossing
events.
(x_draw_xwidget_glyph_string): Add EnterWindowMask and
LeaveWindowMask.
Po Lu [Fri, 29 Oct 2021 03:33:06 +0000 (11:33 +0800)]
Enable scrolling optimization for xwidgets
* src/dispextern.h (struct glyph): Store xwidget ID instead of a
reference.
* src/dispnew.c (scrolling_window): Enable scrolling optimization on
xwidget builds.
* src/xdisp.c (fill_xwidget_glyph_string, produce_xwidget_glyph):
Obtain xwidget from ID.
* src/xterm.c (x_scroll_run): Scroll xwidget windows.
* src/xwidget.c (id_to_xwidget_map, xwidget_counter): New xwidget
variables.
(Fmake_xwidget): Assign each xwidget a unique ID, and keep track of
that ID.
(xwidget_from_id): New function.
(syms_of_xwidget): Initialize id_to_xwidget_map.
(xwidget_end_redisplay): Lookup xwidgets via ID.
* src/xwidget.h (struct xwidget): Add ID field.
(xwidget_from_id): New function.
Po Lu [Thu, 28 Oct 2021 13:46:01 +0000 (21:46 +0800)]
Use an X window to display xwidgets on X11
Since Emacs draws using X11 primitives, Emacs drawing operations can
erase the GtkDrawingArea used to draw the offscreen widget, which
leads to unpleasant flickering effects, all of which can be prevented
by creating a native X window and drawing to that instead.
Stefan Kangas [Sat, 6 Nov 2021 23:41:14 +0000 (00:41 +0100)]
Ensure return value of ert-with-temp-directory
* lisp/emacs-lisp/ert-x.el (ert-with-temp-file): Ensure return
value when :directory is t is the directory name.
* test/lisp/emacs-lisp/ert-x-tests.el
(ert-x-tests-with-temp-directory): Extend test for the above.
Stefan Kangas [Sat, 6 Nov 2021 20:54:02 +0000 (21:54 +0100)]
Add generated suffix to test temp file names
* lisp/emacs-lisp/ert-x.el
(ert-with-temp-file): Add temp file name suffix based on file name of
caller. Reflow docstring.
(ert--with-temp-file-generate-suffix): New defun.
* test/lisp/emacs-lisp/ert-x-tests.el
(ert-x-tests--with-temp-file-generate-suffix): New test.
* doc/misc/eww.texi (Advanced): Document it.
* lisp/net/eww.el (eww-url-transformers): New user option.
(eww-remove-tracking): New default function.
(eww--transform-url): Helper function.
(eww-follow-link): Use it.
(eww): Ditto.
* doc/emacs/killing.texi (Clipboard): Refer to it.
* doc/lispref/frames.texi (Yanking Media): Document the mechanism.
* lisp/yank-media.el: New file.
* lisp/gnus/message.el (message-mode): Register a yank handler for
images.
(message-insert-screenshot): Factor out image code from here...
(message--yank-media-image-handler): ... to here.
Stefan Kangas [Sat, 6 Nov 2021 19:59:28 +0000 (20:59 +0100)]
Escape '%' in filenames to fix flymake warnings
* lisp/progmodes/flymake.el (flymake--log-1): Escape '%' in filenames
for 'warning-type-format' so they are not interpreted as a %-sequence
by 'format' later. (Bug#51549)
Stefan Kangas [Fri, 5 Nov 2021 03:22:12 +0000 (04:22 +0100)]
New user option image-auto-resize-max-scale-percent
* lisp/image-mode.el (image-auto-resize-max-scale-percent): New
user option to limit how much 'fit-window' will scale up an image.
(image--scale-within-limits-p): New function.
(image-toggle-display-image): Respect above new user option.
Stefan Kangas [Fri, 5 Nov 2021 02:24:50 +0000 (03:24 +0100)]
New command image-transform-fit-to-window
* lisp/image-mode.el (image-auto-resize, image-transform-resize):
Add new value 'fit-window', meaning to scale the image up or down
to fit the window. (Bug#)
(image-transform-fit-to-window): New command.
(image-transform-fit-to-height, image-transform-fit-to-width):
Make obsolete in favor of above new command.
(image-mode-map): Bind "s w" to 'image-transform-fit-to-window'.
Move binding for obsolete command 'image-transform-fit-to-width'
to "s i".
(image-mode-map): Add menu entry for
'image-transform-fit-to-window'. Remove menu entries for above
obsolete commands.
* doc/emacs/files.texi (Image Mode): Update documentation.
(image-transform-fit-both): Doc fix.
* lisp/outline.el (outline-flag-region): Update buttons on most
outline toggling commands (bug#51629).
(outline--fix-up-all-buttons): Take a region as parameter.
(outline-cycle-buffer): Adjust call.