unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* make-xwidget api change patch
@ 2016-03-27 16:55 joakim
  2016-03-27 17:29 ` Eli Zaretskii
  2016-03-27 20:37 ` Paul Eggert
  0 siblings, 2 replies; 7+ messages in thread
From: joakim @ 2016-03-27 16:55 UTC (permalink / raw)
  To: Emacs developers, Eli Zaretskii

Eli noticed a problem in the make-xwidget function a while back.
The problem is that the function takes 2 arguments that are never used.

The type for the webkit widget also has a redundant -osr suffix.

The patch below attempts to fix these issues.

The changes are uncontroversial, but since it is late in the cycle I ask
for a review.

/Joakim

commit 210ba7fbae4daf1e631b1c1b9ca0ea553d18d6f5
Author: Joakim Verona <joakim@verona.se>
Date:   Sun Mar 27 18:38:30 2016 +0200

    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

diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index e4aff43..2d8b60d 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -5641,7 +5641,7 @@ Xwidgets
 in a @code{display} text or overlay property (@pxref{Display
 Property}).
 
-@defun make-xwidget beg end type title width height arguments &optional buffer
+@defun make-xwidget type title width height arguments &optional buffer
 This creates an xwidget object between @var{beg} and @var{end}, buffer
 positions in @var{buffer}, and returns the new object.  If
 @var{buffer} is omitted or @code{nil}, it defaults to the current
@@ -5650,8 +5650,8 @@ Xwidgets
 it can be one of the following:
 
 @table @code
-@item webkit-osr
-The WebKit OSR (@dfn{on-stack replacement}) component.
+@item webkit
+The WebKit (@dfn{on-stack replacement}) component.
 @end table
 
 The @var{width} and @var{height} arguments specify the widget size in
diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index cd8ec0e..19f631f 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -42,7 +42,7 @@ xwidget-webkit-scroll-behavior
   :type '(choice (const native) (const image)))
 
 (declare-function make-xwidget "xwidget.c"
-                  (beg end type title width height arguments &optional buffer))
+                  (type title width height arguments &optional buffer))
 (declare-function xwidget-set-adjustment "xwidget.c"
                   (xwidget axis relative value))
 (declare-function xwidget-buffer "xwidget.c" (xwidget))
@@ -66,8 +66,7 @@ xwidget-insert
 The usage of optional argument ARGS depends on the xwidget.
 This returns the result of `make-xwidget'."
   (goto-char pos)
-  (let ((id (make-xwidget (point) (point)
-                          type title width height args)))
+  (let ((id (make-xwidget type title width height args)))
     (put-text-property (point) (+ 1 (point))
                        'display (list 'xwidget ':xwidget id))
     id))
@@ -454,7 +453,7 @@ xwidget-webkit-new-session
     (setq xwidget-webkit-last-session-buffer (switch-to-buffer
                                               (get-buffer-create bufname)))
     (insert " 'a' adjusts the xwidget size.")
-    (setq xw (xwidget-insert 1 'webkit-osr  bufname 1000 1000))
+    (setq xw (xwidget-insert 1 'webkit  bufname 1000 1000))
     (xwidget-put xw 'callback 'xwidget-webkit-callback)
     (xwidget-webkit-mode)
     (xwidget-webkit-goto-uri (xwidget-webkit-last-session) url)))
diff --git a/src/xwidget.c b/src/xwidget.c
index 54b8004..2c69c24 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -156,27 +156,23 @@ webkit_navigation_policy_decision_requested_cb (WebKitWebView *,
 
 DEFUN ("make-xwidget",
        Fmake_xwidget, Smake_xwidget,
-       7, 8, 0,
-       doc: /* Make an xwidget from BEG to END of TYPE.
+       5, 6, 0,
+       doc: /* Make an xwidget of TYPE.
 If BUFFER is nil, use the current buffer.
 If BUFFER is a string and no such buffer exists, create it.
 TYPE is a symbol which can take one of the following values:
 
-- webkit-osr
+- webkit
 
 Returns the newly constructed xwidget, or nil if construction fails.  */)
-  (Lisp_Object beg, Lisp_Object end, Lisp_Object type,
+  (Lisp_Object type,
    Lisp_Object title, Lisp_Object width, Lisp_Object height,
    Lisp_Object arguments, Lisp_Object buffer)
 {
   CHECK_SYMBOL (type);
   CHECK_NATNUM (width);
   CHECK_NATNUM (height);
-  /* This should work a bit like "make-button"
-     (make-button BEG END &rest PROPERTIES)
-     TYPE etc. should be keyword args eventually.
-     (make-xwidget 3 3 'button "oei" 31 31 nil)
-     (xwidget-info (car xwidget-list))  */
+
   struct xwidget *xw = allocate_xwidget ();
   Lisp_Object val;
   xw->type = type;
@@ -987,7 +983,7 @@ syms_of_xwidget (void)
   defsubr (&Sxwidget_webkit_goto_uri);
   defsubr (&Sxwidget_webkit_execute_script);
   defsubr (&Sxwidget_webkit_get_title);
-  DEFSYM (Qwebkit_osr, "webkit-osr");
+  DEFSYM (Qwebkit_osr, "webkit");
 
   defsubr (&Sxwidget_size_request);
   defsubr (&Sdelete_xwidget_view);
-- 
Joakim Verona



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: make-xwidget api change patch
  2016-03-27 16:55 make-xwidget api change patch joakim
@ 2016-03-27 17:29 ` Eli Zaretskii
  2016-04-02 21:58   ` John Wiegley
  2016-03-27 20:37 ` Paul Eggert
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-03-27 17:29 UTC (permalink / raw)
  To: joakim; +Cc: emacs-devel

> From: joakim@verona.se
> Date: Sun, 27 Mar 2016 18:55:48 +0200
> 
> Eli noticed a problem in the make-xwidget function a while back.
> The problem is that the function takes 2 arguments that are never used.
> 
> The type for the webkit widget also has a redundant -osr suffix.
> 
> The patch below attempts to fix these issues.
> 
> The changes are uncontroversial, but since it is late in the cycle I ask
> for a review.

Looks good to me, thanks.

John?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: make-xwidget api change patch
  2016-03-27 16:55 make-xwidget api change patch joakim
  2016-03-27 17:29 ` Eli Zaretskii
@ 2016-03-27 20:37 ` Paul Eggert
  2016-03-27 21:06   ` joakim
  2016-03-30 15:37   ` joakim
  1 sibling, 2 replies; 7+ messages in thread
From: Paul Eggert @ 2016-03-27 20:37 UTC (permalink / raw)
  To: joakim, Emacs developers, Eli Zaretskii

[-- Attachment #1: Type: text/plain, Size: 183 bytes --]

I also think this change should go in. I never understood what those two 
parameters were for anyway. Some further tweaks appear to be needed, 
though; please see the attached patch.

[-- Attachment #2: 0001-make-xwidget-unused-arg-cleanup.patch --]
[-- Type: application/x-patch, Size: 4061 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: make-xwidget api change patch
  2016-03-27 20:37 ` Paul Eggert
@ 2016-03-27 21:06   ` joakim
  2016-03-30 15:37   ` joakim
  1 sibling, 0 replies; 7+ messages in thread
From: joakim @ 2016-03-27 21:06 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Eli Zaretskii, Emacs developers

Paul Eggert <eggert@cs.ucla.edu> writes:

> I also think this change should go in. I never understood what those
> two parameters were for anyway. Some further tweaks appear to be
> needed, though; please see the attached patch.

Yes it looks correct.

-- 
Joakim Verona



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: make-xwidget api change patch
  2016-03-27 20:37 ` Paul Eggert
  2016-03-27 21:06   ` joakim
@ 2016-03-30 15:37   ` joakim
  1 sibling, 0 replies; 7+ messages in thread
From: joakim @ 2016-03-30 15:37 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Eli Zaretskii, Emacs developers

Paul Eggert <eggert@cs.ucla.edu> writes:

> I also think this change should go in. I never understood what those
> two parameters were for anyway. Some further tweaks appear to be
> needed, though; please see the attached patch.
>
>

I squashed Pauls and my commit. Should I push, or are we awaiting John?

-- 
Joakim Verona



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: make-xwidget api change patch
  2016-03-27 17:29 ` Eli Zaretskii
@ 2016-04-02 21:58   ` John Wiegley
  2016-04-03  2:36     ` Paul Eggert
  0 siblings, 1 reply; 7+ messages in thread
From: John Wiegley @ 2016-04-02 21:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: joakim, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 409 bytes --]

>>>>> Eli Zaretskii <eliz@gnu.org> writes:

>> The changes are uncontroversial, but since it is late in the cycle I ask
>> for a review.

> Looks good to me, thanks.

> John?

If this one looks good to you, Eli, then you have my agreement too.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 629 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: make-xwidget api change patch
  2016-04-02 21:58   ` John Wiegley
@ 2016-04-03  2:36     ` Paul Eggert
  0 siblings, 0 replies; 7+ messages in thread
From: Paul Eggert @ 2016-04-03  2:36 UTC (permalink / raw)
  To: Eli Zaretskii, joakim, emacs-devel

John Wiegley wrote:
> If this one looks good to you, Eli, then you have my agreement too.

OK, I installed it into the emacs-25 branch.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-04-03  2:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-27 16:55 make-xwidget api change patch joakim
2016-03-27 17:29 ` Eli Zaretskii
2016-04-02 21:58   ` John Wiegley
2016-04-03  2:36     ` Paul Eggert
2016-03-27 20:37 ` Paul Eggert
2016-03-27 21:06   ` joakim
2016-03-30 15:37   ` joakim

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).