1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00
Commit Graph

129 Commits

Author SHA1 Message Date
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
Joakim Verona
36e05f0bf7 Remove unused arguments from make-xwidget
The arguments BEG and END were unused, and are now removed.

* display.texi (Xwidgets): Document the change
* xwidget.el (make-xwidget, xwidget-insert)
(xwidget-webkit-new-session): Reflect changed arguments
* xwidget.c (Fmake_xwidget, syms_of_xwidget): Reflect changed arguments
2016-04-02 18:32:13 -07:00
Paul Eggert
91557f5e2d Quoting fixes in doc strings and diagnostics
* lisp/emacs-lisp/bytecomp.el (byte-compile-setq, byte-compile-funcall):
* lisp/gnus/mml-smime.el (mml-smime-get-dns-cert)
(mml-smime-get-ldap-cert):
Follow user style preference when quoting diagnostics.
2016-02-03 17:20:17 -08:00
Glenn Morris
8e5046a6e5 * lisp/xwidget.el (xwidget-query-on-exit-flag): Declare. 2016-01-27 17:06:08 -05:00
Glenn Morris
82bf438c56 * lisp/xwidget.el (xwidget-webkit-browse-url): Give explicit error
if not compiled with xwidgets.
2016-01-27 17:01:30 -05:00
Glenn Morris
60f6bd85a6 * lisp/xwidget.el (xwidget-webkit-scroll-behavior):
Rename using American spelling.  Update all uses.
2016-01-25 18:19:34 -05:00
Glenn Morris
cea07fdf42 Yet more xwidget doc fixes.
* lisp/xwidget.el (xwidget-webkit-scroll-behaviour)
(xwidget-insert, xwidget-webkit-browse-url)
(xwidget-webkit-scroll-up, xwidget-webkit-scroll-down)
(xwidget-webkit-scroll-forward, xwidget-webkit-scroll-backward)
(xwidget-webkit-insert-string, xwidget-webkit-show-named-element)
(xwidget-webkit-show-id-element)
(xwidget-webkit-show-id-or-named-element)
(xwidget-webkit-adjust-size, xwidget-webkit-current-url)
(xwidget-webkit-execute-script-rv)
(xwidget-webkit-copy-selection-as-kill, xwidget-get)
(xwidget-put):  Doc fixes.
(xwidget-webkit-insert-string, xwidget-webkit-show-named-element)
(xwidget-webkit-show-id-element)
(xwidget-webkit-show-id-or-named-element): Prompt fixes.
2016-01-25 18:17:33 -05:00
Paul Eggert
a528a60f48 Spelling fixes 2016-01-25 08:09:09 -08:00
Stefan Monnier
c5ee6de21d * lisp/xwidget.el: Nitpicks
* lisp/xwidget.el (xwidget-log, xwidget-webkit-callback):
Use with-current-buffer rather than save-excursion + set-buffer.
2016-01-19 20:53:10 -05:00
Glenn Morris
96f6cace6b Don't hard-code 1 as point-min.
* lisp/image-mode.el (image-display-size):
* lisp/xwidget.el (xwidget-webkit-last-session)
(xwidget-webkit-current-session): Don't hard-code 1 as point-min.
2016-01-19 19:09:45 -05:00
Glenn Morris
833d53b98b ; * lisp/xwidget.el: Spelling fixes. 2016-01-19 19:06:32 -05:00
Glenn Morris
c9471132c3 * lisp/xwidget.el: Add declarations to silence non-xwidget compilation. 2016-01-19 18:44:29 -05:00
Glenn Morris
0b356a6aeb Avoid advising image-display-size for xwidgets.
* lisp/xwidget.el (xwidget-image-display-size): Remove.
(image-display-size): Remove advice.
* lisp/image-mode.el (xwidget-info, xwidget-at): Declare.
(image-display-size): Incorporate xwidget code directly.
2016-01-19 18:13:07 -05:00
Glenn Morris
b88f4a2c76 Avoid breaking non-xwidget Emacs that happen to load xwidget.el.
* lisp/xwidget.el (window-configuration-change-hook)
(kill-buffer-query-functions): Only modify these hooks if
compiled with xwidget support.
2016-01-19 18:06:30 -05:00
Glenn Morris
22977b5c51 * lisp/xwidget.el (xwidget-webkit-scroll-behaviour): Fix custom spec. 2016-01-19 18:03:37 -05:00
Glenn Morris
9d00392520 * lisp/xwidget.el (report-xwidget-bug): Remove.
(top-level): No longer require reporter.
2016-01-19 16:02:18 -05:00
Glenn Morris
c7441cd7d8 ; Add 2016 to copyright years of new files. 2016-01-19 16:00:34 -05:00
Joakim Verona
7c1f66a94b Support for the new Xwidget feature.
* configure.ac:
(HAVE_XWIDGETS, WIDGET_OBJ, EMACS_CONFIG_FEATURES):
* xterm.c (x_draw_glyph_string, x_draw_bar_cursor):
* xdisp.c:
(handle_display_spec, handle_single_display_spec, push_it)
(pop_it, set_iterator_to_next, dump_glyph)
(calc_pixel_width_or_height, fill_xwidget_glyph_string)
(BUILD_XWIDGET_GLYPH_STRING, BUILD_GLYPH_STRINGS)
(produce_xwidget_glyph, x_produce_glyphs)
(get_window_cursor_type):
* window.c (Fdelete_window_internal):
* termhooks.h (e):
* print.c (print_object):
* lisp.h (ptrdiff_t):
* keyboard.c (kbd_buffer_get_event, make_lispy_event)
(syms_of_keyboard):
* emacs.c (main):
* dispnew.c (update_window, scrolling_window):
* dispextern.h (g, i):
* Makefile.in (XWIDGETS_OBJ, WEBKIT_CFLAGS, WEBKIT_LIBS)
(GIR_LIBS, ALL_CFLAGS, base_obj, LIBES):
* keyboard.c (kbd_buffer_get_event):
* emacsgtkfixed.c (emacs_fixed_gtk_widget_size_allocate)
(emacs_fixed_class_init): Add case for an xwidget view.

* xwidget.c, xwidget.h, xwidget.el: New files for xwidgets

Co-authored-by:  Grégoire Jadi  <daimrod@gmail.com>

Various improvements to the Xwidget feature.
* xwidgets.c:
* emacsgtkfixed.c:
* xwidget.el:
2016-01-19 20:58:22 +01:00
Paul Eggert
241260cc28 Revert changes installed by xwidgets merge 2015-02-01 11:45:15 -08:00
Joakim Verona
4edad429ca Fix compile warnings xwidget.el 2015-01-31 21:09:11 +01:00