]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 years ago* admin/automerge: Die if changing directory fails.
Stefan Kangas [Mon, 8 Nov 2021 08:44:09 +0000 (09:44 +0100)]
* admin/automerge: Die if changing directory fails.

3 years agoMerge from origin/emacs-28
Stefan Kangas [Mon, 8 Nov 2021 08:30:18 +0000 (09:30 +0100)]
Merge from origin/emacs-28

fe91f4438c ; * etc/PROBLEMS: Move librsvg-related item to better loca...

3 years agoRemove code what would always maximize xwidgets on Macos
Lars Ingebrigtsen [Mon, 8 Nov 2021 07:01:07 +0000 (08:01 +0100)]
Remove code what would always maximize xwidgets on Macos

* src/xwidget.c (x_draw_xwidget_glyph_string): Remove code that
would always maximize the widget on Macos (bug#51674).  This code
was probably added to work around a resizing bug that has since
been fixed.

3 years agolisp/emacs-lisp/lisp-mode.el: Fix parser state corruption.
akater [Mon, 8 Nov 2021 06:37:51 +0000 (07:37 +0100)]
lisp/emacs-lisp/lisp-mode.el: Fix parser state corruption.

* lisp/emacs-lisp/lisp-mode.el (lisp--local-defform-body-p): Preserve
the point.
* test/lisp/progmodes/elisp-mode-resources/flet.erts: Add corresponding
test example (bug#9622).

3 years agoFix resize of xwidgets on GTK
Po Lu [Mon, 8 Nov 2021 05:34:09 +0000 (06:34 +0100)]
Fix resize of xwidgets on GTK

* src/xwidget.c (Fxwidget_resize): Queue widget for re-allocation
after setting its size request (bug#51679).

3 years ago; * lisp/image-dired.el: Add some basic sections.
Stefan Kangas [Mon, 8 Nov 2021 05:42:44 +0000 (06:42 +0100)]
; * lisp/image-dired.el: Add some basic sections.

This file is currently rather hard to follow due to things just being
thrown in at random by many different contributors, with seemingly no
overall plan or idea.  This is the first step towards giving it some
kind of organization.

3 years agoFix hang when displaying xwidget script dialog
Po Lu [Mon, 8 Nov 2021 05:22:11 +0000 (06:22 +0100)]
Fix hang when displaying xwidget script dialog

* src/xwidget.c (webkit_script_dialog_cb): New function.
(Fmake_xwidget): Attach script callback signal (bug#51674).

3 years agoimage-dired: Set window-resize-pixelwise to t
Stefan Kangas [Mon, 8 Nov 2021 05:20:21 +0000 (06:20 +0100)]
image-dired: Set window-resize-pixelwise to t

* lisp/image-dired.el (image-dired-thumbnail-mode): Set
'window-resize-pixelwise' to t.

3 years agoMention yank-media-types in the manual
Lars Ingebrigtsen [Mon, 8 Nov 2021 05:08:33 +0000 (06:08 +0100)]
Mention yank-media-types in the manual

* doc/lispref/frames.texi (Yanking Media): Mention yank-media-types.

3 years agoMake html-mode--html-yank-handler more resilient
Lars Ingebrigtsen [Mon, 8 Nov 2021 05:04:11 +0000 (06:04 +0100)]
Make html-mode--html-yank-handler more resilient

* lisp/textmodes/sgml-mode.el (html-mode--html-yank-handler): The
HTML may not be valid, so suppress errors.

3 years agoFix yank-media--get-selection thinko in previous change
Lars Ingebrigtsen [Mon, 8 Nov 2021 05:03:41 +0000 (06:03 +0100)]
Fix yank-media--get-selection thinko in previous change

* lisp/yank-media.el (yank-media--get-selection): Fix thinko after
previous change.

3 years agoClean up the yank-media data massaging
Lars Ingebrigtsen [Mon, 8 Nov 2021 04:54:10 +0000 (05:54 +0100)]
Clean up the yank-media data massaging

* lisp/yank-media.el (yank-media--get-selection): Put the
nul-massaging code...
(yank-media-types--format): ... here instead, and decode utf-16
better.

3 years agoAdd a new debugging/exploration command `yank-media-types'
Lars Ingebrigtsen [Mon, 8 Nov 2021 04:44:10 +0000 (05:44 +0100)]
Add a new debugging/exploration command `yank-media-types'

* lisp/yank-media.el (yank-media-types): New command.
(yank-media-types--format): Helper command.

3 years ago; * etc/PROBLEMS: Move librsvg-related item to better location.
Stefan Kangas [Mon, 8 Nov 2021 03:51:44 +0000 (04:51 +0100)]
; * etc/PROBLEMS: Move librsvg-related item to better location.

Reported by Mike Kupfer <mkupfer@alum.berkeley.edu>.

3 years agoFix charset issues when yanking non-plain-text elements
Lars Ingebrigtsen [Mon, 8 Nov 2021 01:04:40 +0000 (02:04 +0100)]
Fix charset issues when yanking non-plain-text elements

* lisp/select.el (gui-get-selection): Make (gui-get-selection
'CLIPBOARD 'text/html) get decoded correctly (bug#31149).

3 years agoRename 'register-yank-media-handler'
Lars Ingebrigtsen [Mon, 8 Nov 2021 00:40:58 +0000 (01:40 +0100)]
Rename 'register-yank-media-handler'

* lisp/textmodes/sgml-mode.el (html-mode):
* lisp/gnus/message.el (message-mode):
* doc/lispref/frames.texi (Yanking Media): Adjust.
* lisp/yank-media.el (yank-media): Adjust doc string.
(yank-media-handler): Rename from `register-' because that may
cause confusion with register.el functions.

3 years agoPrefer ert-with-temp-(directory|file) in most remaining tests
Stefan Kangas [Mon, 8 Nov 2021 00:21:06 +0000 (01:21 +0100)]
Prefer ert-with-temp-(directory|file) in most remaining tests

* test/lisp/auth-source-tests.el (auth-source-test-searches):
* test/lisp/autorevert-tests.el (auto-revert-test00-auto-revert-mode)
(auto-revert-test01-auto-revert-several-files)
(auto-revert-test02-auto-revert-deleted-file)
(auto-revert-test03-auto-revert-tail-mode)
(auto-revert-test04-auto-revert-mode-dired)
(auto-revert-test05-global-notify)
(auto-revert-test06-write-file)
(auto-revert-test07-auto-revert-several-buffers):
* test/lisp/calendar/icalendar-tests.el (icalendar-tests--do-test-cycle):
* test/lisp/custom-tests.el (custom-theme--load-path):
* test/lisp/dired-aux-tests.el (dired-test-bug27496)
(with-dired-bug28834-test):
* test/lisp/emacs-lisp/bytecomp-tests.el (test-byte-comp-compile-and-load)
(bytecomp-tests--dest-mountpoint)
(bytecomp-tests--target-file-no-directory):
* test/lisp/emacs-lisp/gv-tests.el (gv-tests--in-temp-dir):
* test/lisp/eshell/eshell-tests.el (with-temp-eshell)
(eshell-test-command-result):
* test/lisp/info-xref-tests.el (info-xref-test-makeinfo):
* test/lisp/vc/vc-tests.el (vc-test--create-repo)
(vc-test--register, vc-test--state, vc-test--working-revision)
(vc-test--checkout-model, vc-test--rename-file)
(vc-test--version-diff):
* test/src/buffer-tests.el (test-kill-buffer-auto-save-delete):
* test/src/comp-tests.el (comp-tests-bootstrap):
* test/src/process-tests.el (process-test-quoted-batfile): Prefer
'ert-with-temp-(directory|file)' to using 'make-temp-file' directly.

3 years agoSet clipping when dumping stretch glyphs in some cases
Po Lu [Mon, 8 Nov 2021 00:16:29 +0000 (01:16 +0100)]
Set clipping when dumping stretch glyphs in some cases

* src/nsterm.m (ns_draw_glyph_string): Always focus even when dumping
stretch glyphs in s->next (bug#51653).

3 years agoFix charset issues in text/html yanking
Lars Ingebrigtsen [Mon, 8 Nov 2021 00:15:02 +0000 (01:15 +0100)]
Fix charset issues in text/html yanking

* lisp/yank-media.el (yank-media--get-selection): Use
gui-backend-get-selection instead of the higher-level function
which guesses wrong on the charset on many types.
(yank-media): Fix the case where there's only one match.

3 years ago; Fix duplicate temporary file creation
Stefan Kangas [Sun, 7 Nov 2021 21:46:09 +0000 (22:46 +0100)]
; Fix duplicate temporary file creation

* test/lisp/files-tests.el (files-tests-executable-find): Fix creating
duplicate temporary file after recent change.

3 years agoSuppress a compilation warning about vc-switch-backend
Lars Ingebrigtsen [Sun, 7 Nov 2021 23:26:32 +0000 (00:26 +0100)]
Suppress a compilation warning about vc-switch-backend

* lisp/vc/vc-hooks.el (vc-prefix-map): Suppress a warning about an
obsolete command.

3 years agoImprove undoing of RET in comint and eshell
Miha Rihtaršič [Sun, 7 Nov 2021 23:10:03 +0000 (00:10 +0100)]
Improve undoing of RET in comint and eshell

* lisp/comint.el (comint-send-input):
(comint-accumulate):
* lisp/eshell/esh-mode.el (eshell-send-input): Before sending input to
the process, delete it and reinsert it again.  Undoing this
insertion with 'C-/' will delete the region, moving the process mark
back to its original position (bug#49484).

3 years agoAllow 'C-x n d' to work in texinfo-mode
Lars Ingebrigtsen [Sun, 7 Nov 2021 22:57:04 +0000 (23:57 +0100)]
Allow 'C-x n d' to work in texinfo-mode

* lisp/textmodes/texinfo.el (texinfo-mode): Set
beginning/end-of-defun functions to allow narrowing to the current
node.
(texinfo--beginning-of-defun, texinfo--end-of-defun): New functions.

3 years agoMake paragraph/filling functions in texinfo-mode work better
Lars Ingebrigtsen [Sun, 7 Nov 2021 22:47:47 +0000 (23:47 +0100)]
Make paragraph/filling functions in texinfo-mode work better

* lisp/textmodes/texinfo.el (texinfo-mode): Make paragraph
definitions more traditional.  This makes (forward-paragraph 1)
behave better.
(texinfo-mode): Set a new filling function.
(texinfo--fill-paragraph): New filling function.
(texinfo-fillable-commands): New variable (bug#49558).

3 years agoMake debugging ert--erts-specifications easier
Lars Ingebrigtsen [Sun, 7 Nov 2021 22:45:14 +0000 (23:45 +0100)]
Make debugging ert--erts-specifications easier

* lisp/emacs-lisp/ert.el (ert--erts-specifications): Strip text
properties from specs to make debugging easier.

3 years agoMerge from origin/emacs-28
Alan Mackenzie [Sun, 7 Nov 2021 20:53:21 +0000 (20:53 +0000)]
Merge from origin/emacs-28

0c51db6bb1 Amend Follow Mode to handle header lines and tab lines cor...
261367781b * lisp/files.el (user-emacs-directory-warning): Clarify do...
8d9b55330d * doc/emacs/frames.texi (Tab Bars): Add text about mouse a...
d9b0b730e8 * doc/emacs/frames.texi (Tab Bars): Describe tab-last.

3 years ago; Merge from origin/emacs-28
Alan Mackenzie [Sun, 7 Nov 2021 20:53:21 +0000 (20:53 +0000)]
; Merge from origin/emacs-28

The following commit was skipped:

ffe40045dc ; * etc/PROBLEMS: Minor clarification of a recent entry.

3 years agoAmend Follow Mode to handle header lines and tab lines correctly
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.

3 years agoMatch password prompts from new OpenSSH
Lars Ingebrigtsen [Sun, 7 Nov 2021 20:34:41 +0000 (21:34 +0100)]
Match password prompts from new OpenSSH

* lisp/comint.el (comint-password-prompt-regexp): Add support for
the openssh-8.6p1 "(user@host) Password:" format (bug#51666).

3 years agoFix intermittent electric test failures
Jim Porter [Sun, 7 Nov 2021 20:20:15 +0000 (21:20 +0100)]
Fix intermittent electric test failures

* test/lisp/electric-tests.el
(whitespace-chomping-dont-cross-comments): Move
'c-toggle-comment-style' to here.: (bug#51665).

3 years ago* lisp/files.el (user-emacs-directory-warning): Clarify docstring.
Stefan Kangas [Sun, 7 Nov 2021 18:48:14 +0000 (19:48 +0100)]
* lisp/files.el (user-emacs-directory-warning): Clarify docstring.

3 years agoSimplify c8acc5fd92ad9979fc5870623014290cad998337
Juri Linkov [Sun, 7 Nov 2021 18:13:01 +0000 (20:13 +0200)]
Simplify c8acc5fd92ad9979fc5870623014290cad998337

* lisp/isearch.el (isearch-filter-visible): Add check if there are
no properties 'inhibit-isearch' in the search range,
instead of code of c8acc5fd92ad9979fc5870623014290cad998337.

3 years ago* doc/emacs/frames.texi (Tab Bars): Add text about mouse and tab-bar-format
Juri Linkov [Sun, 7 Nov 2021 18:00:56 +0000 (20:00 +0200)]
* doc/emacs/frames.texi (Tab Bars): Add text about mouse and tab-bar-format

Briefly describe mouse commands on the tab bar and tab-bar-format (bug#51444)

3 years ago* doc/emacs/frames.texi (Tab Bars): Describe tab-last.
Juri Linkov [Sun, 7 Nov 2021 17:56:28 +0000 (19:56 +0200)]
* doc/emacs/frames.texi (Tab Bars): Describe tab-last.

'C-9' and 'M-9' already had kindex, so describe them in the text as well
(bug#51444).

3 years ago; * etc/PROBLEMS: Minor clarification of a recent entry.
Stefan Kangas [Sun, 7 Nov 2021 17:32:28 +0000 (18:32 +0100)]
; * etc/PROBLEMS: Minor clarification of a recent entry.

This was accidentally committed to master instead of emacs-28.

(cherry picked from commit a95520d3dfa1b97f88e51f1ee5ef07e278cb854a)

3 years ago; * etc/PROBLEMS: Minor clarification of a recent entry.
Stefan Kangas [Sun, 7 Nov 2021 17:32:28 +0000 (18:32 +0100)]
; * etc/PROBLEMS: Minor clarification of a recent entry.

3 years agoMerge from origin/emacs-28
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

3 years agoAdd some unit tests for 'abbreviate-file-name'
Jim Porter [Sun, 7 Nov 2021 17:03:23 +0000 (18:03 +0100)]
Add some unit tests for 'abbreviate-file-name'

* test/lisp/files-tests.el (files-tests-abbreviate-file-name-homedir)
(files-tests-abbreviate-file-name-directory-abbrev-alist): New tests.

3 years agoMake `C-x 8 e e' work better in the terminal
Lars Ingebrigtsen [Sun, 7 Nov 2021 15:59:22 +0000 (16:59 +0100)]
Make `C-x 8 e e' work better in the terminal

* lisp/international/emoji.el (emoji--adjust-displayable-1): Make
something rudimentary work on non-graphical Emacsen for `C-x 8 e e'.

3 years agoMake emoji-describe really describe only the glyph under point
Lars Ingebrigtsen [Sun, 7 Nov 2021 15:04:18 +0000 (16:04 +0100)]
Make emoji-describe really describe only the glyph under point

* lisp/international/emoji.el (emoji-describe): Only look at the
compositions under point (bug#51659).

3 years agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Sun, 7 Nov 2021 15:03:33 +0000 (17:03 +0200)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

3 years agoFix compilation MinGW warnings
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.

3 years agoDon't inhibit compilation of emoji.elc
Lars Ingebrigtsen [Sun, 7 Nov 2021 14:31:40 +0000 (15:31 +0100)]
Don't inhibit compilation of emoji.elc

* lisp/international/emoji.el (emoji--generate-file): Further
obfuscate to not inhibit byte compilation.

3 years ago'yank-media' is not universally supported
Eli Zaretskii [Sun, 7 Nov 2021 14:31:29 +0000 (16:31 +0200)]
'yank-media' is not universally supported

* doc/emacs/killing.texi (Clipboard):
* etc/NEWS: Say that 'yank-media' is not universally supported.

3 years agoFree find text in correct procedure
Po Lu [Sun, 7 Nov 2021 06:28:37 +0000 (14:28 +0800)]
Free find text in correct procedure

* src/xwidget.c (Fxwidget_webkit_previous_result): Don't free find
text.
(Fxwidget_webkit_finish_search): Free find text here instead.

3 years agoFix C-r inside xwidget isearch
Po Lu [Sun, 7 Nov 2021 06:22:52 +0000 (14:22 +0800)]
Fix C-r inside xwidget isearch

* lisp/xwidget.el (xwidget-webkit-isearch-backward): Ask for previous
result.

3 years agoFix xwidget-webkit-goto-history
Po Lu [Sun, 7 Nov 2021 13:41:43 +0000 (14:41 +0100)]
Fix xwidget-webkit-goto-history

* src/xwidget.c (xwidget-webkit-goto-history): Use
WebKitBackForwardList and XFIXNUM instead of XFIXNAT (bug#51651).

3 years agoHandle WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION appropriately
Po Lu [Sun, 7 Nov 2021 11:51:39 +0000 (19:51 +0800)]
Handle WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION appropriately

* src/xwidget.c (webkit_decide_policy_cb): Send an xwidget display
event when a webpage asks to create a new window.

3 years ago; * test/lisp/net/tramp-tests.el: Rearrange tests to be in order.
Jim Porter [Sun, 7 Nov 2021 12:59:32 +0000 (13:59 +0100)]
; * test/lisp/net/tramp-tests.el: Rearrange tests to be in order.

3 years agoDocument the xwidget type
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.

3 years agoImprove detection of suspiciously reordered text segments
Eli Zaretskii [Sun, 7 Nov 2021 12:22:15 +0000 (14:22 +0200)]
Improve detection of suspiciously reordered text segments

* src/bidi.c (bidi_find_first_overridden): Detect reordered weak
and neutral characters as well.

* lisp/international/mule-cmds.el
(highlight-confusing-reorderings): Count and announce how many
instances were found.

* test/src/xdisp-tests.el
(xdisp-tests--find-directional-overrides-case-3): New test.
(xdisp-tests--find-directional-overrides-case-2): Adjust expected
result.

3 years ago; Fix some recent typos/thinkos.
Basil L. Contovounesios [Sun, 7 Nov 2021 10:58:08 +0000 (12:58 +0200)]
; Fix some recent typos/thinkos.

3 years agoAnother addition to latin-2 input methods
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)

Copyright-paperwork-exempt: yes

3 years agoFix documentation and coding style in recent xwidget commits
Eli Zaretskii [Sun, 7 Nov 2021 09:50:06 +0000 (11:50 +0200)]
Fix documentation and coding style in recent xwidget commits

* src/xwidget.c (Fmake_xwidget, find_widget)
(xwidget_motion_or_crossing, xwidget_button_1, xwidget_button):
Fix style in comments.
(Fxwidget_perform_lispy_event): Doc fix.
* src/xwidget.c (set_widget_if_text_view, kill_frame_xwidget_views):
* src/keyboard.c (make_lispy_event): Fix style of braces.

* lisp/xwidget.el (xwidget-webkit-isearch-mode): Fix keys in doc
string.

* doc/lispref/commands.texi (Xwidget Events): Fix markup and
wording.
* doc/lispref/display.texi (Xwidgets): Fix wording and markup.
* doc/emacs/misc.texi (Embedded WebKit Widgets): Fix wording.

* etc/NEWS: Fix wording and punctuation.

3 years ago; * etc/PROBLEMS: More specific recipe for WebKit-related crashes.
Eli Zaretskii [Sun, 7 Nov 2021 07:34:30 +0000 (09:34 +0200)]
; * etc/PROBLEMS: More specific recipe for WebKit-related crashes.

3 years ago* doc/lispref/tips.texi (Coding Conventions): Mention GNU "path" convention
Stefan Monnier [Sun, 7 Nov 2021 05:11:28 +0000 (01:11 -0400)]
* doc/lispref/tips.texi (Coding Conventions): Mention GNU "path" convention

Suggested by Ihor Radchenko <yantar92@gmail.com>.

3 years agoEnsure that the x_show_hourglass is seen
Lars Ingebrigtsen [Sun, 7 Nov 2021 04:12:00 +0000 (05:12 +0100)]
Ensure that the x_show_hourglass is seen

* src/xterm.c (x_show_hourglass): Ensure that the hourglass is
seen (bug#51649).

3 years agoActually start the alarms in atimer
Lars Ingebrigtsen [Sun, 7 Nov 2021 03:55:02 +0000 (04:55 +0100)]
Actually start the alarms in atimer

* src/atimer.c (set_alarm): Actually start both timerfd and
alarms (attempted in 4107549a).

3 years agoFix backspace in xwidget webkit isearch
Po Lu [Sun, 7 Nov 2021 03:32:20 +0000 (04:32 +0100)]
Fix backspace in xwidget webkit isearch

* lisp/xwidget.el: Set backspace to
xwidget-webkit-isearch-erasing-char (bug#51647).

3 years agoRemove too-agressive window refresh in the hourglass code
Lars Ingebrigtsen [Sun, 7 Nov 2021 03:10:56 +0000 (04:10 +0100)]
Remove too-agressive window refresh in the hourglass code

* src/xterm.c (x_show_hourglass): Don't force a spurious refresh
(bug#51649).

3 years agoFix build on nextstep
Po Lu [Sun, 7 Nov 2021 01:17:11 +0000 (09:17 +0800)]
Fix build on nextstep

* src/xwidget.h: Make some prototypes conditional to X-Windows.
(struct xwidget): Move find_text field out of GTK conditional.

* src/xwidget.c (Fmake_xwidget): Move find_text out of GTK
conditional.
* src/print.c (print_vectorlike): Print correct pointer on macOS.

3 years agoImprove xwidget isearch visuals
Po Lu [Sun, 7 Nov 2021 01:02:12 +0000 (09:02 +0800)]
Improve xwidget isearch visuals

* lisp/xwidget.el (xwidget-webkit-isearch--update): New argument
ONLY-MESSAGE.
(xwidget-webkit-isearch-forward)
(xwidget-webkit-isearch-backward): Always refresh message.
(xwidget-webkit-isearch-mode): Update message when enabling.

3 years agoFix web inspector
Po Lu [Sun, 7 Nov 2021 00:55:03 +0000 (08:55 +0800)]
Fix web inspector

* src/xwidget.c (Fmake_xwidget): Move developer extra initialization.

3 years agoDefault to creating new related sessions
Po Lu [Sun, 7 Nov 2021 00:50:59 +0000 (08:50 +0800)]
Default to creating new related sessions

* doc/lispref/display.texi:
* etc/NEWS: Document changes.

* lisp/xwidget.el (xwidget-insert): Accept an extra RELATED argument.
(xwidget-webkit-new-session): Pass current session as RELATED if
present.

* src/xwidget.c (Fmake_xwidget): Make RELATED argument public.

3 years agoRationalize creation decisions
Po Lu [Sat, 6 Nov 2021 13:11:51 +0000 (21:11 +0800)]
Rationalize creation decisions

* src/xwidget.c (webkit_create_cb): Only create a new widget if type
is OTHER.

3 years agoMake "open in new window" from an xwidget's context menu work
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.

3 years agoAdd xwidget-webkit-isearch to the menu bar and tool bar
Po Lu [Sat, 6 Nov 2021 10:27:48 +0000 (18:27 +0800)]
Add xwidget-webkit-isearch to the menu bar and tool bar

* lisp/xwidget.el: Add isearch to tool bar and menu bar.

(xwidget-webkit-mode-map)
(xwidget-webkit-isearch-mode-map): Reorder key definitions so the
equivalent key shows up as `C-s' in the menu bar.

3 years agoAdd xwidget-webkit-isearch-mode
Po Lu [Sat, 6 Nov 2021 10:20:03 +0000 (18:20 +0800)]
Add xwidget-webkit-isearch-mode

* etc/NEWS:
* doc/emacs/misc.texi: Document changes

* 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.

3 years agoAdd functions for performing searches on xwidgets
Po Lu [Sat, 6 Nov 2021 07:07:09 +0000 (15:07 +0800)]
Add functions for performing searches on xwidgets

* etc/NEWS:
* doc/lispref/display.texi: Document changes.

* 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.

3 years agoMake it safe to have non-xwidget views in xwidget-view-list
Po Lu [Sat, 6 Nov 2021 06:01:56 +0000 (14:01 +0800)]
Make it safe to have non-xwidget views in xwidget-view-list

* src/xwidget.c (define_cursors, offscreen_damage_event): Check
XWIDGET_VIEW_P before XXWIDGET_VIEW.

3 years agoMake xwidgets print nicer
Po Lu [Sat, 6 Nov 2021 05:58:52 +0000 (13:58 +0800)]
Make xwidgets print nicer

* src/print.c (print_vectorlike): Print xwidgets with ID and widget
pointer, and print xwidget views separately.

3 years agoFix cursor for new widget views
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.

3 years agoAdd support for cursors in xwidget views
Po Lu [Sat, 6 Nov 2021 03:28:40 +0000 (11:28 +0800)]
Add support for cursors in xwidget views

* src/xwidget.c (mouse_target_changed): New function.
(Fmake_xwidget): Attach mouse target changed signal.
(cursor_for_hit, define_cursors, mouse_target_changed): New functions.
(xwidget_init_view): Set default cursor to nontext cursor.
(x_draw_xwidget_glyph_string): Define cursor.

* src/xwidget.h (struct xwidget_view): Add cursor field.

3 years agoDisplay page titles in xwidget webkit header line
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.

3 years agoImprove detail of load-changed xwidget events
Po Lu [Sat, 6 Nov 2021 01:45:06 +0000 (09:45 +0800)]
Improve detail of load-changed xwidget events

* src/xwidget.c (webkit_view_load_changed_cb): Improve event detail.
* etc/NEWS: Document changes.
* doc/lispref/commands.texi: Document Xwidget events.
* doc/lispref/display.texi (Xwidgets): Add reference to Xwidget events.

3 years agoMake the WebKit inspector available
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.

3 years agoAdd xwidget-webkit-copy-selection-as-kill to the menu bar
Po Lu [Fri, 5 Nov 2021 11:40:24 +0000 (19:40 +0800)]
Add xwidget-webkit-copy-selection-as-kill to the menu bar

* lisp/xwidget.el: New menu item
`xwidget-webkit-copy-selection-as-kill'.

3 years agoAdd new tool-bar items to xwidget-webkit
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.

3 years agoAdd a menu to xwidget-webkit
Po Lu [Fri, 5 Nov 2021 10:53:50 +0000 (18:53 +0800)]
Add a menu to xwidget-webkit

* lisp/xwidget.el: Add a menu to xwidget-webkit-mode-map.

3 years agoRedisplay xwidget view windows instead of just setting their size
Po Lu [Fri, 5 Nov 2021 10:34:42 +0000 (18:34 +0800)]
Redisplay xwidget view windows instead of just setting their size

* src/xwidget.c (Fxwidget_resize): Mark windows as needing redisplay
and redisplay instead.

3 years agoSelect window when clicking on an xwidget view
Po Lu [Fri, 5 Nov 2021 09:46:47 +0000 (17:46 +0800)]
Select window when clicking on an xwidget view

* src/xterm.c (handle_one_xevent): Select window when clicking on an
xwidget view.

3 years agoFix xwidget scrolling
Po Lu [Fri, 5 Nov 2021 07:27:36 +0000 (15:27 +0800)]
Fix xwidget scrolling

* src/xterm.c (x_scroll_run): Use from_y and height.

3 years agoAllow enabling xwidget-webkit-edit-mode via a binding
Po Lu [Fri, 5 Nov 2021 07:12:32 +0000 (15:12 +0800)]
Allow enabling xwidget-webkit-edit-mode via a binding

* doc/emacs/misc.texi: Document changes.
* lisp/xwidget.el (xwidget-webkit-mode-map): Add shortcut for
xwidget-webkit-edit-mode.

3 years agoAdd xwidget-webkit-edit-mode to make using the WebKit browser easier
Po Lu [Fri, 5 Nov 2021 06:47:26 +0000 (14:47 +0800)]
Add xwidget-webkit-edit-mode to make using the WebKit browser easier

* doc/emacs/misc.texi: Document changes.
* etc/NEWS: Document recent changes.
* lisp/xwidget.el (xwidget-webkit-pass-command-event): New variable.
* lisp/xwidget.el (xwidget-perform-lispy-event): New function
declaration.
* lisp/xwidget.el (xwidget-webkit-edit-mode): New minor mode.

3 years agoFix special events in xwidgets
Po Lu [Fri, 5 Nov 2021 06:34:45 +0000 (14:34 +0800)]
Fix special events in xwidgets

* src/xwidget.c (set_widget_if_text_view): New function.
(Fxwidget_perform_lispy_event): Fix for webkit widgets.

3 years agoFix drag on xwidget motion events
Po Lu [Fri, 5 Nov 2021 02:31:27 +0000 (10:31 +0800)]
Fix drag on xwidget motion events

* src/xwidget.c (xwidget_motion_or_crossing): Set state.

3 years agoHandle crossing events on xwidget windows correctly
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.

3 years agoDraw offscreen surface
Po Lu [Thu, 4 Nov 2021 10:53:55 +0000 (18:53 +0800)]
Draw offscreen surface

* src/xwidget.c (xv_do_draw): Draw offscreen surface.

3 years agoImplement function for sending events to widgets
Po Lu [Thu, 4 Nov 2021 10:51:28 +0000 (18:51 +0800)]
Implement function for sending events to widgets

* doc/lispref/display.texi (Xwidgets): Document changes.
* src/keyboard.c (lispy_function_keys): Make non-static on X.
* src/keyboard.h (lispy_function_keys): Expose lispy_function_keys on
X.
* src/xterm.c (x_emacs_to_x_modifiers): Export function.
* src/xterm.h (x_emacs_to_x_modifiers): Likewise.
* src/xwidget.c (Fxwidget_perform_lispy_event)
(find_suitable_keyboard): New functions.
(syms_of_xwidget): Define new subr.

3 years agoUse gtk_widget_queue_draw instead of xv_do_draw
Po Lu [Wed, 3 Nov 2021 13:00:20 +0000 (21:00 +0800)]
Use gtk_widget_queue_draw instead of xv_do_draw

* src/xwidget.c (x_draw_xwidget_glyph_string): Call
gtk_widget_queue_draw.

3 years agoPrefer XMoveResizeWindow to XMoveWindow for resizing xwidgets
Po Lu [Wed, 3 Nov 2021 12:00:57 +0000 (20:00 +0800)]
Prefer XMoveResizeWindow to XMoveWindow for resizing xwidgets

* src/xwidget.c (x_draw_xwidget_glyph_string): Prefer
XMoveResizeWindow to avoid extra expose events.

3 years agoAllow xwidgets to accept motion and button events
Po Lu [Wed, 3 Nov 2021 11:02:59 +0000 (19:02 +0800)]
Allow xwidgets to accept motion and button events

* src/xterm.c (handle_one_xevent): Pass through some events to
xwidgets.

* src/xwidget.c (synthesize_focus_in_event)
(find_suitable_pointer, xwidget_button_1)
(xwidget_button, xwidget_motion_or_crossing): New functions.
(xwidget_view_from_window): Draw offscreen window instead of the
widget.
(x_draw_xwidget_glyph_string): Set appropriate event masks.

* src/xwidget.h (xwidget_button, xwidget_motion_or_crossing): New
functions.

3 years agoDestroy xwidgets when destroying frames
Po Lu [Fri, 29 Oct 2021 11:26:49 +0000 (19:26 +0800)]
Destroy xwidgets when destroying frames

* src/xterm.c (x_free_frame_resources): Make sure to kill xwidget views.
* src/xwidget.c (Fmake_xwidget): Attach damage event signal.
(offscreen_damage_event): Operate on xwidgets and not individual
views.
(xwidget_init_view): Don't attach damage event signal here.
(Fdelete_xwidget_view): Destroy window correctly and stop removing
damage event signal.
(kill_frame_xwidget_views): New function.
* src/xwidget.c (kill_frame_xwidget_views): New function.

3 years agoEnable scrolling optimization for xwidgets
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.

3 years agoUse an X window to display xwidgets on X11
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.

* src/xterm.c (x_window_to_frame): Return xwidget window if
appropriate.
(handle_one_xevent): Handle xwidget expose events.

* src/xwidget.c (x_window_to_xvw_map): New variable.
(xwidget_view_from_window): New function.

(xwidget_show_view, xwidget_hide_view)
(offscreen_damage_event): Move to drawing xwidgets with X windows.

(xv_do_draw)
(xwidget_expose): New function.

(xwidget_osr_draw_cb, xwidget_osr_event_forward)
(xwidget_osr_event_set_embedder): Removed.

(xwidget_init_view): Replace use of GtkDrawingArea with that of an X
window.

(x_draw_xwidget_glyph_string): Prevent xwidget views from constantly
generating expose events, and use an X window instead of a
GtkDrawingArea.

(syms_of_xwidget): Initialize x_window_to_xwv_map.

src/xwidget.h (struct xwidget_view): Replace GTK widgets with
X-related fields.

(xwidget_view_from_window, xwidget_expose): New functions.

3 years agoFix pp-emacs-lisp-code for `when' and related
Lars Ingebrigtsen [Sun, 7 Nov 2021 01:44:42 +0000 (02:44 +0100)]
Fix pp-emacs-lisp-code for `when' and related

* lisp/emacs-lisp/pp.el (pp--format-definition): Skip edebug specs
we don't understand at all.

3 years agoFix html-mode--image-yank-handler prompting
Lars Ingebrigtsen [Sun, 7 Nov 2021 01:34:54 +0000 (02:34 +0100)]
Fix html-mode--image-yank-handler prompting

* lisp/textmodes/sgml-mode.el (html-mode--image-yank-handler): Fix
two format statements and rearrange images.

3 years agoEnsure return value of ert-with-temp-directory
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.

3 years agoPrefer ert-with-temp-(directory|file)
Stefan Kangas [Sat, 6 Nov 2021 22:20:59 +0000 (23:20 +0100)]
Prefer ert-with-temp-(directory|file)

* test/lisp/abbrev-tests.el (read-write-abbrev-file-test)
(read-write-abbrev-file-test-with-props)
(abbrev-edit-save-to-file-test):
* test/lisp/auth-source-tests.el (auth-source-test-netrc-create-secret)
(auth-source-delete):
* test/lisp/autoinsert-tests.el (autoinsert-tests-auto-insert-file):
* test/lisp/bookmark-tests.el (with-bookmark-test-save-load):
* test/lisp/buff-menu-tests.el (buff-menu-24962):
* test/lisp/calendar/icalendar-tests.el (icalendar-tests--do-test-export):
* test/lisp/calendar/todo-mode-tests.el (with-todo-test):
* test/lisp/dired-tests.el
(dired-test-bug27243-01, dired-test-bug27243-02)
(dired-test-bug27243-03, dired-test-bug27631)
(dired-test-bug27968, dired-test-with-temp-dirs):
* test/lisp/dired-x-tests.el (dired-test-bug25942):
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--with-temp-file):
* test/lisp/emacs-lisp/check-declare-tests.el (check-declare-tests-scan)
(check-declare-tests-verify-mismatch):
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-with-normal-env):
* test/lisp/emacs-lisp/package-tests.el (with-package-test)
(package-test-signed):
* test/lisp/emacs-lisp/testcover-tests.el (testcover-tests-markup-region)
(testcover-tests-run-test-case):
* test/lisp/emulation/viper-tests.el (viper-test-undo-kmacro):
* test/lisp/epg-tests.el (with-epg-tests):
* test/lisp/eshell/em-hist-tests.el (eshell-write-readonly-history):
* test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27631):
* test/lisp/ffap-tests.el (ffap-tests-25243):
* test/lisp/files-tests.el (files-tests-bug-18141)
(files-tests-read-file-in-~, files-tests-make-directory)
(files-tests-copy-directory, files-tests-executable-find)
(files-tests-dont-rewrite-precious-files)
(files-tests--save-some-buffers):
* test/lisp/ls-lisp-tests.el (ls-lisp-test-bug27631):
* test/lisp/mail/uudecode-tests.el (uudecode-tests-decode-region-internal)
(uudecode-tests-decode-region-external):
* test/lisp/net/browse-url-tests.el (browse-url-tests-delete-temp-file):
* test/lisp/progmodes/elisp-mode-tests.el (xref--case-insensitive):
* test/lisp/progmodes/etags-tests.el (etags-buffer-local-tags-table-list):
* test/lisp/progmodes/flymake-tests.el (ruby-backend):
* test/lisp/progmodes/python-tests.el (python-tests-with-temp-file):
* test/lisp/progmodes/sql-tests.el (with-sql-test-connect-harness):
* test/lisp/saveplace-tests.el (saveplace-test-save-place-to-alist/file)
(saveplace-test-forget-unreadable-files)
(saveplace-test-place-alist-to-file):
* test/lisp/so-long-tests/spelling-tests.el:
* test/lisp/textmodes/reftex-tests.el (reftex-locate-bibliography-files)
(reftex-parse-from-file-test):
* test/lisp/thumbs-tests.el (thumbs-tests-thumbsdir/create-if-missing):
* test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-bug9726)
(vc-bzr-test-bug9781, vc-bzr-test-faulty-bzr-autoloads):
* test/lisp/vc/diff-mode-tests.el (diff-mode-test-ignore-trailing-dashes):
* test/lisp/vc/ediff-ptch-tests.el (ediff-ptch-test-bug26084):
* test/lisp/wdired-tests.el (wdired-test-bug32173-01)
(wdired-test-bug32173-02, wdired-test-symlink-name)
(wdired-test-unfinished-edit-01, wdired-test-bug34915)
(wdired-test-bug39280):
* test/src/buffer-tests.el (test-kill-buffer-auto-save-default):
* test/src/filelock-tests.el (filelock-tests--fixture):
* test/src/inotify-tests.el (inotify-file-watch-simple):
* test/src/undo-tests.el (undo-test-file-modified): Prefer
'ert-with-temp-(directory|file)' to using 'make-temp-file' directly.
In some cases, this is just cleanup, but in several cases this fixes
bugs where an error would have lead to us not cleaning up.

3 years agoAdd generated suffix to test temp file names
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.