1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-10 00:00:39 -08:00
Commit graph

198 commits

Author SHA1 Message Date
Po Lu
397bee1dc3 Fix C-r inside xwidget isearch
* lisp/xwidget.el (xwidget-webkit-isearch-backward): Ask for previous
result.
2021-11-07 15:16:29 +01:00
Eli Zaretskii
d5bb053809 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.
2021-11-07 11:50:06 +02:00
Po Lu
e20c27c770 Fix backspace in xwidget webkit isearch
* lisp/xwidget.el: Set backspace to
xwidget-webkit-isearch-erasing-char (bug#51647).
2021-11-07 04:32:20 +01:00
Po Lu
969ce9d201 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.
2021-11-07 02:59:42 +01:00
Po Lu
eabd735e6c 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.
2021-11-07 02:59:42 +01:00
Po Lu
0be966f97e 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.
2021-11-07 02:59:42 +01:00
Po Lu
1a84537f79 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.
2021-11-07 02:59:42 +01:00
Po Lu
e7503291d3 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.
2021-11-07 02:59:41 +01:00
Po Lu
74711c0298 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.
2021-11-07 02:59:41 +01:00
Po Lu
8729ae29d8 Add xwidget-webkit-copy-selection-as-kill to the menu bar
* lisp/xwidget.el: New menu item
`xwidget-webkit-copy-selection-as-kill'.
2021-11-07 02:59:41 +01:00
Po Lu
cd7158edd3 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.
2021-11-07 02:59:41 +01:00
Po Lu
d97718c87c Add a menu to xwidget-webkit
* lisp/xwidget.el: Add a menu to xwidget-webkit-mode-map.
2021-11-07 02:59:41 +01:00
Po Lu
8ddeebbe0c 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.
2021-11-07 02:59:40 +01:00
Po Lu
6ed7454f17 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.
2021-11-07 02:59:40 +01:00
Lars Ingebrigtsen
bd6dca038e Do some xwidget NEWS markup (and adjust doc string)
* lisp/xwidget.el (xwidget-webkit-bookmark-make-record): Mention
`xwidget-webkit-bookmark-jump-new-session' in the doc string.
2021-09-18 18:18:13 +02:00
Lars Ingebrigtsen
5d32630f79 Do command mode markup in xwidget.el 2021-08-23 01:52:16 +02:00
Lars Ingebrigtsen
98e1752f9d Make xwidget-webkit-enable-plugins a defcustom
* lisp/xwidget.el (xwidget-webkit-enable-plugins): Make into
defcustom.
2021-08-23 01:45:10 +02:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
Stefan Kangas
c50c0a19e3 Prefer setq-local in most files
* lisp/apropos.el (apropos-print):
* lisp/buff-menu.el (Buffer-menu-mode):
* lisp/calc/calc.el (calc-trail-buffer):
* lisp/chistory.el (command-history-mode):
* lisp/dabbrev.el:
* lisp/dframe.el (dframe-frame-mode):
* lisp/doc-view.el (doc-view-presentation-mode):
* lisp/ebuff-menu.el (electric-buffer-menu-mode)
(electric-buffer-update-highlight):
* lisp/edmacro.el (edit-kbd-macro):
* lisp/face-remap.el (buffer-face-set, buffer-face-toggle):
* lisp/files.el:
(find-file-noselect-1, hack-local-variables-confirm)
(set-visited-file-name, revert-buffer--default):
* lisp/filesets.el (filesets-spawn-external-viewer):
* lisp/find-dired.el (find-dired):
* lisp/find-lisp.el (find-lisp-find-dired-internal):
* lisp/finder.el (finder-mode):
* lisp/font-core.el (font-lock-default-function):
* lisp/format.el (format-annotate-function):
* lisp/help-fns.el (describe-variable):
* lisp/help-mode.el (help-mode):
* lisp/icomplete.el (icomplete-minibuffer-setup)
(icomplete--in-region-setup):
* lisp/ido.el (ido-completion-help, ido-tidy):
* lisp/international/robin.el (robin-activate):
* lisp/leim/quail/hangul.el (hangul-input-method-activate):
* lisp/leim/quail/uni-input.el (ucs-input-activate):
* lisp/man.el (Man-mode):
* lisp/master.el (master-set-slave):
* lisp/minibuffer.el (minibuffer-completion-help)
(read-file-name-default):
* lisp/outline.el (outline-minor-mode):
* lisp/pcomplete.el (pcomplete-comint-setup):
* lisp/proced.el (proced-mode):
* lisp/recentf.el (recentf-edit-list, recentf-open-files-items):
* lisp/replace.el (occur-1):
* lisp/reveal.el (reveal-mode):
* lisp/ruler-mode.el (ruler--save-header-line-format):
* lisp/scroll-lock.el (scroll-lock-mode):
* lisp/startup.el (normal-top-level, normal-splash-screen):
* lisp/strokes.el (strokes-list-strokes):
* lisp/thumbs.el (thumbs-insert-image, thumbs-show-thumbs-list):
* lisp/tree-widget.el (tree-widget-set-theme):
* lisp/window.el (read-buffer-to-switch):
* lisp/xwidget.el (xwidget-webkit-begin-edit-textarea): Prefer
setq-local.
2020-12-09 11:58:38 +01:00
Stefan Kangas
462dbc1cb2 ; Fix typos 2020-09-21 14:26:42 +02:00
Masahiro Nakamura
f028a893a5 ; Minor fix for nsxwidget patch
* lisp/xwdget.el (xwidget-webkit-download-dir)
(xwidget-webkit-save-as-file): Set version to 28.1 because the patch
was introduced in Emacs 28.0.50.

* src/nsxwidget.m: Fix typo.
2020-09-16 00:51:04 +01:00
Lars Ingebrigtsen
9ca83cdd79 Revert "Use format-prompt in read-file-name calls that have a default"
This reverts commit de4f347901.

read-file-name already displays a long path when given a default
(like INITIAL in many other prompting functions), so using
format-prompt here is superfluous.
2020-09-13 14:58:24 +02:00
Lars Ingebrigtsen
de4f347901 Use format-prompt in read-file-name calls that have a default
* lisp/xwidget.el (xwidget-webkit-save-as-file):
* lisp/vc/vc.el (vc-backend-for-registration, vc-delete-file)
(vc-rename-file):
* lisp/vc/ediff-ptch.el (ediff-prompt-for-patch-file):
* lisp/vc/diff-mode.el (diff-tell-file-name):
* lisp/progmodes/etags.el (visit-tags-table)
(visit-tags-table-buffer):
* lisp/misearch.el (multi-isearch-read-files):
* lisp/mail/rmailmm.el (rmail-mime-save):
* lisp/help-fns.el (doc-file-to-man, doc-file-to-info):
* lisp/gnus/gnus-bookmark.el (gnus-bookmark-load):
* lisp/files.el (write-file, basic-save-buffer):
* lisp/dired.el (dired-read-dir-and-switches):
* lisp/bookmark.el (bookmark-save, bookmark-load):
* lisp/abbrev.el (write-abbrev-file, abbrev-edit-save-to-file):
Use format-prompt in read-file-name calls that have a default.
2020-09-07 22:10:06 +02:00
Sungbin Jo
c25321e447 Add utility functions and new xwidget commands
Co-authored-by: Jaesup Kwak <veshboo@gmail.com>

* lisp/xwidget.el (xwidget-webkit-callback): Add case for
'response-callback' event.
(xwidget-webkit-download-dir): New variable.
(xwidget-webkit-save-as-file): New function.
* src/nsxwidget.m (XwWebView::decidePolicyForNavigationResponse):
Store download event.
* src/xwidget.c src/xwidget.h (store_xwidget_download_callback_event):
New function.
2020-08-12 12:39:50 +02:00
Sungbin Jo
9e1af8251f Add utility functions and new xwidget commands
Co-authored-by: Jaesup Kwak <veshboo@gmail.com>

* etc/NEWS: Announce new functions and options.
* lisp/xwidget.el (xwidget): New defgroup.
(xwidget-webkit-mode-map): Add new keybindings.
(xwidget-webkit-scroll-up, xwidget-webkit-scroll-down)
(xwidget-webkit-scroll-forward, xwidget-webkit-scroll-backward):
Add optional argument to specify specific amounts to scroll down.
(xwidget-webkit-scroll-up-line, xwidget-webkit-scroll-down-line): New
functions.
(xwidget-webkit-scroll-bottom): Fix function to scroll to the bottom
of the document.
(xwidget-webkit-callback): Use new function to update buffer title
even when Javascript is disabled.
(xwidget-webkit-bookmark-jump-new-session): New variable.
(xwidget-webkit-bookmark-make-record): Modify to use xwidget-webkit to
open bookmark that is created in xwidget-webkit.
(xwidget-webkit-insert-string): Fix Javascript snippet to not throw
Javsscript exceptions.
(xwidget-webkit-inside-pixel-width)
(xwidget-window-inside-pixel-height): New functions.
(xwidget-webkit-adjust-size-to-window): Use new functions.
(xwidget-webkit-new-session): Insert invisible URL instead of an empty
string to achieve better default behavior.
(xwidget-webkit-back, xwidget-webkit-forward, xwidget-webkit-reload)
(xwidget-webkit-current-url): Use new functions to enable scrolling
even when Javascript is disabled.
(xwidget-webkit-copy-selection-as-kill): Remove unnecessary lambda.
* src/nsxwidget.h src/nsxwidget.m (nsxwidget_webkit_uri)
(nsxwidget_webkit_title, nsxwidget_webkit_goto_history): Add new
functions.
* src/xwidget.c (Fxwidget_webkit_uri, Fxwidget_webkit_title)
(Fxwidget_webkit_goto_history): Add new functions.
(syms_of_xwidget): Define new functions.
2020-08-12 12:34:39 +02:00
Sungbin Jo
d089c4fbfc Add xwidget support for macOS
Co-authored-by: Jaesup Kwak <veshboo@gmail.com>

* configure.ac: Allow '--with-xwidgets' for "${NS_IMPL_COCOA}".
* etc/NEWS: Mention new feature.
* etc/TODO: Remove done TODO to implement xwidget in NeXTstep port.
* lisp/xwidget.el (xwidget-webkit-clone-and-split-below)
(xwidget-webkit-clone-and-split-right): New procedures.
(xwidget-webkit-callback): Remove call to
'xwidget-webkit-adjust-size-to-window' as adjusting xwidget size is
handled in 'x_draw_xwidget_glyph_string'.
(xwidget-webkit-enable-plugins): New variable.
* nextstep/templates/Info.plist.in: Add 'NSAppTransportSecurity'.
* src/Makefile.in: Add nsxwidget.o for compilation.
* src/emacs.c (main): Move conditional call to 'syms_of_xwidget'.
* src/nsterm.m (ns_draw_glyph_string): Add case for 'XWIDGET_GLYPH'.
(note_mouse_movement mouseMoved): Make it easy to resize window by
dragging mode-line or vertical separator adjacent to large glyph.
* src/nsxwidget.h src/nsxwidget.m: Newly added files, xwidget webkit
backend for macOS Cocoa.
* src/xwidget.c (Fmake_xwidget, xwidget_init_view)
(x_draw_xwidget_glyph_string, xwidget_is_web_view)
(Fxwidget_webkit_goto_uri, Fxwidget_webkit_zoom, Fxwidget_resize)
(Fxwidget_size_request, Fdelete_xwidget_view, xwidget_end_redisplay)
(kill_buffer_xwidgets): Add macOS Cocoa specific functions and code
with 'NS_IMPL_COCOA' and guard GTK specific functions and code with
'USE_GTK'.
(x_draw_xwidget_glyph_string): Handle adjusting xwidget size.
* src/xwidget.h (xwidget, xwidget_view): Add macOS Cocoa specific
fields with 'NS_IMPL_COCOA' and guard GTK specific fields with
USE_GTK.
2020-08-12 12:12:34 +02:00
Puneeth Chaganti
be0fecf819 Allow specifying the callback in new xwidget sessions
* lisp/xwidget.el (xwidget-webkit-new-session): Optional callback
arg (bug#24019).
(xwidget-event-handler): Respect the 'callback parameter.
2020-08-11 16:23:10 +02:00
Lars Ingebrigtsen
44d2368ca1 Make xwidget-webkit-browse-url slightly more DWIM
* lisp/xwidget.el (xwidget-webkit-browse-url): Prepend "https" to
URLs that don't have a protocol (bug#31369).
2020-07-20 12:21:46 +02:00
Paul Eggert
365e01cc9f Update copyright year to 2020
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2020-01-01 00:59:52 +00:00
Paul Eggert
26bed8ba10 Update copyright year to 2019
Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
2019-01-01 01:01:13 +00:00
Paul Eggert
5c7dd8a783 Update copyright year to 2018
Run admin/update-copyright.
2018-01-01 00:57:59 -08:00
Paul Eggert
bc511a64f6 Prefer HTTPS to FTP and HTTP in documentation
Most of this change is to boilerplate commentary such as license URLs.
This change was prompted by ftp://ftp.gnu.org's going-away party,
planned for November.  Change these FTP URLs to https://ftp.gnu.org
instead.  Make similar changes for URLs to other organizations moving
away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
fsf.org when this works, as this will further help defend against
man-in-the-middle attacks (for this part I omitted the MS-DOS and
MS-Windows sources and the test tarballs to keep the workload down).
HTTPS is not fully working to lists.gnu.org so I left those URLs alone
for now.
2017-09-13 15:54:37 -07:00
Paul Eggert
bcf244ef9b Merge from origin/emacs-25
2e2a806 Fix copyright years by hand
5badc81 Update copyright year to 2017
2017-01-01 01:10:47 -08:00
Paul Eggert
5badc81c1c Update copyright year to 2017
Run admin/update-copyright.
2016-12-31 19:42:26 -08:00
Ricardo Wurmus
ca479f9e75 xwidget: Map "previous-line" and "next-line" to scroll
* lisp/xwidget.el: Map "previous-line" and "next-line" to scrolling
procedures.
2016-10-25 23:07:13 -07:00
Ricardo Wurmus
01c2fba677 xwidget: Bind "beginning-of-buffer" and "end-of-buffer"
* lisp/xwidget.el: Rebind "beginning-of-buffer" and "end-of-buffer" to
"xwidget-webkit-scroll-top" and "xwidget-webkit-scroll-bottom",
respectively.
(xwidget-webkit-scroll-top,
xwidget-webkit-scroll-bottom): New procedures.
2016-10-25 23:07:13 -07:00
Ricardo Wurmus
e443eab6bf Implement zoom for WebKit widget.
* src/xwidget.c (xwidget-webkit-zoom): New procedure.
* lisp/xwidget.el: Bind "+" and "-" to zoom in and out, respectively.
(xwidget-webkit-zoom): Declare procedure.
(xwidget-webkit-zoom-in, xwidget-webkit-zoom-out): New procedures.
2016-10-25 23:07:13 -07:00
Ricardo Wurmus
a9785bd5c2 Dynamically resize WebKit widget.
* lisp/xwidget.el (xwidget-webkit-auto-adjust-size,
xwidget-webkit-adjust-size-in-frame): New procedures.
(xwidget-webkit-new-session): Remove hint to resize widget with `a'.
(xwidget-webkit-adjust-size-dispatch): Resize current webkit widget.
(xwidget-webkit-adjust-size-to-window): Make non-interactive,
add widget and window as arguments.
(xwidget-webkit-callback): Use xwidget-webkit-adjust-size-to-window.
2016-10-25 23:07:13 -07:00
Ricardo Wurmus
c483fa6ef2 Let initial WebKit view fill window
* lisp/xwidget.el (xwidget-webkit-new-session): Change default size of
WebKit widget to window size.
2016-10-25 23:07:13 -07:00
Ricardo Wurmus
67e03311a0 xwidget: Remove title hack.
* src/xwidget.c (xwidget-webkit-get-title): Remove procedure.
* lisp/xwidget.el (xwidget-webkit-get-title,
xwidget-webkit-execute-script-rv): Remove procedures.
2016-10-25 23:07:13 -07:00
Ricardo Wurmus
8809002052 xwidget: Get URL asynchronously.
* lisp/xwidget.el (xwidget-webkit-current-url): Kill URL in callback.
2016-10-25 23:07:13 -07:00
Ricardo Wurmus
4aa7c4b4aa xwidget: Get selection with asynchronous JavaScript
* lisp/xwidget.el (xwidget-webkit-get-selection): Add PROC argument to
process selection.
(xwidget-webkit-copy-selection-as-kill): Kill selection in callback.
2016-10-25 23:07:13 -07:00
Ricardo Wurmus
efa269d146 xwidget: Add function to find element by CSS selector
* lisp/xwidget.el (xwidget-webkit-show-element): New procedure.
2016-10-25 23:07:13 -07:00
Ricardo Wurmus
74576447b9 xwidget: Simplify functions to scroll to elements
* lisp/xwidget.el (xwidget-webkit-show-named-element,
xwidget-webkit-show-id-element,
xwidget-webkit-show-id-or-named-element): Simplify functions by
scrolling exclusively with JavaScript.
2016-10-25 23:07:13 -07:00
Ricardo Wurmus
cc3b868fbf xwidget: Get title via asynchronous JavaScript.
* lisp/xwidget.el (xwidget-webkit-callback): Get document title
asynchronously.
2016-10-25 23:07:13 -07:00
Ricardo Wurmus
ff80a9c837 xwidget: Do not use `xwidget-execute-script-rv' to insert string
* lisp/xwidget.el (xwidget-webkit-insert-string): Obtain JavaScript
return value via callback instead of using
`xwidget-webkit-execute-script-rv'.
2016-10-25 23:07:13 -07:00
Ricardo Wurmus
7ee870e87c Remove scrolled window container around WebKit widget
The WebKit widget can scroll on its own and does not need to wrapped
with a scrolled window container.

* src/xwidget.h: Remove struct member widgetscrolledwindow_osr.
* src/xwidget.c: Remove widgetscrolledwindow_osr.
(xwidget-set-adjustment): Remove.
(xwidget-resize): Resize Webkit widget last.
* lisp/xwidget.el (xwidget-set-adjustment): Remove.
(xwidget-webkit-scroll-up, xwidget-webkit-scroll-down,
xwidget-webkit-scroll-forward, xwidget-webkit-scroll-backward):
Implement scrolling via JavaScript.
2016-10-25 23:07:13 -07:00
Ricardo Wurmus
623deaf406 xwidget: Pass JavaScript return value to optional callback procedure
* lisp/xwidget.el (xwidget-webkit-execute-script): Accept optional
callback argument.
(xwidget-webkit-callback): Handle "javascript-callback" event type.
* src/xwidget.c (xwidget-webkit-execute-script): Accept optional
argument FUN, a Lisp procedure to execute on the JavaScript return
value.
(store_xwidget_js_callback_event, webkit_javascript_finished_cb,
webkit_js_to_lisp): New procedures.
2016-10-25 23:07:13 -07:00
Ricardo Wurmus
d781662873 xwidget: Use WebKit2 API
* configure.ac: Check for webkit2gtk-4.0.
* src/xwidget.c: Adjust to use WebKit2 API.
* lisp/xwidget.el (xwidget-webkit-callback): Adjust matches for
`xwidget-event-type'.
2016-10-25 23:07:13 -07:00
Paul Eggert
edae7d93ed Remove buggy non-native image scrolling
This never worked, and could cause infinite recursion.
Problem reported by Glenn Morris (Bug#22465).
* lisp/xwidget.el (xwidget-webkit-scroll-behavior): Remove.
All uses removed.
2016-05-13 09:52:43 -07:00