From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Antero Mejr via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#62800: [PATCH] eww: Use completion in URL/keyword prompt. Date: Sun, 23 Apr 2023 18:03:34 +0000 Message-ID: <87v8hmv5l5.fsf@mailbox.org> References: <87o7ntc6pp.fsf@mailbox.org> <86v8i1x86z.fsf@mail.linkov.net> <87jzygdgwe.fsf@mailbox.org> <86jzygjndv.fsf@mail.linkov.net> <87bkjrbt2y.fsf@mailbox.org> <83zg701e6n.fsf@gnu.org> Reply-To: Antero Mejr Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22640"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62800@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 23 20:04:27 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pqe4Z-0005hh-Al for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 23 Apr 2023 20:04:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pqe4D-0005MJ-4l; Sun, 23 Apr 2023 14:04:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pqe4B-0005Ls-Fi for bug-gnu-emacs@gnu.org; Sun, 23 Apr 2023 14:04:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pqe4A-00041A-MT for bug-gnu-emacs@gnu.org; Sun, 23 Apr 2023 14:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pqe4A-0004s7-5r for bug-gnu-emacs@gnu.org; Sun, 23 Apr 2023 14:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Antero Mejr Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Apr 2023 18:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62800 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 62800-submit@debbugs.gnu.org id=B62800.168227302918698 (code B ref 62800); Sun, 23 Apr 2023 18:04:02 +0000 Original-Received: (at 62800) by debbugs.gnu.org; 23 Apr 2023 18:03:49 +0000 Original-Received: from localhost ([127.0.0.1]:46948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqe3w-0004rV-TN for submit@debbugs.gnu.org; Sun, 23 Apr 2023 14:03:49 -0400 Original-Received: from mout-p-101.mailbox.org ([80.241.56.151]:50148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqe3t-0004rE-Nx for 62800@debbugs.gnu.org; Sun, 23 Apr 2023 14:03:47 -0400 Original-Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4Q4GN96l4Gz9sWT; Sun, 23 Apr 2023 20:03:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1682273017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WnG1xxKgKg45HDS7s+qstgpqQ33om/IqY7FpACnDb98=; b=nTiSnC2qhQhxhD0bA3C81ECR+cgQBMySCmirvg9ztVRkW0558eurHweeFC4z62IpamwZgp PYRCaZimfIfmFPWWVk59R4Ty9JmSOfyEgQGkNJOumeIBxlim0ZAFxSVl7OISNpuRj1hLQp mXNfVTE2SKA37nqw0VZpcQCVb62tHobcASd6xefP4iVo73/aPbymNr2DHt+mZATnFovKVl 5gqBHOW7Lb0258Znqke/s8Sfy34XW3JxnRRg1EN0pibNJxd8tckqpRIyfSIwA+39Suupli LDCXOlDJScLxxc6G55tOkoA3Z28CRkom/3+cUhzdvpJtCVfN7pq6VrWLg+Ug2g== In-Reply-To: <83zg701e6n.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 22 Apr 2023 12:03:44 +0300") X-MBO-RS-ID: cd50d663c71fc8ccc22 X-MBO-RS-META: 74a53nfo9xh8fei86miua7rm4gjxfzq6 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:260532 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> Cc: 62800@debbugs.gnu.org >> Date: Thu, 13 Apr 2023 17:16:53 +0000 >> From: Antero Mejr via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> New patches are attached. The first adds tab completion and is just >> slightly reworded. The second adds "eww-suggested-uris" to the >> completion options, and adds bookmark URIs to the "eww-suggest-uris" >> list, since browsers suggest bookmarks too. > > Thanks. The patches don't apply to the Emacs master branch. Could > you please update them and re-post? When you do so, please mention > the bug number in the commit log messages, to minimize the amount of > manual work required when installing the changes. Updated patches are attached. > Also, this and your previous contributions exhaust the amount of > changes we can accept without a copyright assignment. Would you like > to start the legal paperwork of assigning the copyright at this time, > so we could accept contributions from you in the future without > limitations? I submitted all the paperwork in early March for my other pending patch, but haven't gotten the counter-signed copy yet. Hopefully it's in the queue somewhere. I wrote another patch mentioning the assignment time frame in the CONTRIBUTING file, since new contributors might assume something is wrong if they haven't heard back, but based on what I've read 6+ weeks is normal. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v4-0001-eww-Enable-completion-in-URL-keyword-prompt.patch >From 1779ea789e6478a48a2503eda735ab34edce79e4 Mon Sep 17 00:00:00 2001 From: Antero Mejr Date: Wed, 12 Apr 2023 17:56:01 +0000 Subject: [PATCH v4 1/3] eww: Enable completion in URL/keyword prompt. * lisp/net/eww.el (eww): Use 'completing-read' when prompting for a URL or keywords. (eww-minibuffer-url-keymap): New keymap for use in the URL/keyword prompt. * etc/NEWS (EWW): Add NEWS entry for the change. (Bug#62800) --- etc/NEWS | 5 +++++ lisp/net/eww.el | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index ca529be7aa1..df749a12743 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -226,6 +226,11 @@ the new argument NEW-BUFFER non-nil, it will use a new buffer instead. Interactively, invoke 'eww-open-file' with a prefix argument to activate this behavior. ++++ +*** 'eww' URL or keyword prompt now has tab completion. +The interactive minibuffer prompt when invoking 'eww' now has support +for tab completion. + ** go-ts-mode +++ diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 99450356b7c..eb123864973 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -329,6 +329,12 @@ parameter, and should return the (possibly) transformed URL." :parent shr-image-map "RET" #'eww-follow-link) +(defvar-keymap eww-minibuffer-url-keymap + :doc "Keymap used in the minibuffer prompt for URLs or keywords." + :parent minibuffer-local-completion-map + "SPC" #'self-insert-command + "?" #'self-insert-command) + (defun eww-suggested-uris nil "Return the list of URIs to suggest at the `eww' prompt. This list can be customized via `eww-suggest-uris'." @@ -377,10 +383,12 @@ killed after rendering. For more information, see Info node `(eww) Top'." (interactive - (let ((uris (eww-suggested-uris))) - (list (read-string (format-prompt "Enter URL or keywords" - (and uris (car uris))) - nil 'eww-prompt-history uris) + (let ((uris (eww-suggested-uris)) + (minibuffer-local-completion-map eww-minibuffer-url-keymap)) + (list (completing-read (format-prompt "Enter URL or keywords" + (and uris (car uris))) + eww-prompt-history nil nil nil + 'eww-prompt-history uris) current-prefix-arg))) (setq url (eww--dwim-expand-url url)) (pop-to-buffer-same-window -- 2.39.2 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v4-0002-eww-Provide-completions-for-bookmarks-and-suggest.patch >From 4832f508748e8c3e6c94e8e5c4bf7ddc057b5265 Mon Sep 17 00:00:00 2001 From: Antero Mejr Date: Thu, 13 Apr 2023 15:59:54 +0000 Subject: [PATCH v4 2/3] eww: Provide completions for bookmarks and suggested URIs. * lisp/net/eww.el (eww): Add the result of 'eww-suggest-uris' to the completion collection argument. (eww-bookmark-urls): New procedure. (eww-suggest-uris): Add "eww-bookmark-urls" to the default list. * etc/NEWS (EWW): Add NEWS entry for the change. (Bug#62800) --- etc/NEWS | 6 ++++++ lisp/net/eww.el | 16 ++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index df749a12743..286cfcad4f3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -231,6 +231,12 @@ activate this behavior. The interactive minibuffer prompt when invoking 'eww' now has support for tab completion. ++++ +*** 'eww' URL and keyword prompt now completes suggested URIs and bookmarks. +The interactive minibuffer prompt when invoking 'eww' now provides +completions from 'eww-suggest-uris'. 'eww-suggest-uris' now includes +bookmark URIs. + ** go-ts-mode +++ diff --git a/lisp/net/eww.el b/lisp/net/eww.el index eb123864973..61f0f47373d 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -94,7 +94,8 @@ no parameters) that returns a directory name." (defcustom eww-suggest-uris '(eww-links-at-point thing-at-point-url-at-point - eww-current-url) + eww-current-url + eww-bookmark-urls) "List of functions called to form the list of default URIs for `eww'. Each of the elements is a function returning either a string or a list of strings. The results will be joined into a single list with @@ -104,7 +105,8 @@ duplicate entries (if any) removed." :type 'hook :options '(eww-links-at-point thing-at-point-url-at-point - eww-current-url)) + eww-current-url + eww-bookmark-urls)) (defcustom eww-bookmarks-directory user-emacs-directory "Directory where bookmark files will be stored." @@ -387,8 +389,8 @@ For more information, see Info node `(eww) Top'." (minibuffer-local-completion-map eww-minibuffer-url-keymap)) (list (completing-read (format-prompt "Enter URL or keywords" (and uris (car uris))) - eww-prompt-history nil nil nil - 'eww-prompt-history uris) + (seq-uniq (append eww-prompt-history uris)) + nil nil nil 'eww-prompt-history uris) current-prefix-arg))) (setq url (eww--dwim-expand-url url)) (pop-to-buffer-same-window @@ -2235,6 +2237,12 @@ If ERROR-OUT, signal user-error if there are no bookmarks." 'eww-bookmark))) (eww-browse-url (plist-get bookmark :url)))) +(defun eww-bookmark-urls () + "Get the URLs from the current list of bookmarks." + (interactive nil eww-boomark-mode) + (eww-read-bookmarks) + (mapcar (lambda (x) (plist-get x :url)) eww-bookmarks)) + (defvar-keymap eww-bookmark-mode-map "C-k" #'eww-bookmark-kill "C-y" #'eww-bookmark-yank -- 2.39.2 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Mention-copyright-assignment-time-frame.patch >From ef1abee64d9826ce0c29413738c171bc012c2942 Mon Sep 17 00:00:00 2001 From: Antero Mejr Date: Sun, 23 Apr 2023 17:40:39 +0000 Subject: [PATCH] Mention copyright assignment time frame. * CONTRIBUTE (Getting involved with development): Mention copyright assignment time frame and add a reminder to make sure patches apply. --- CONTRIBUTE | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CONTRIBUTE b/CONTRIBUTE index 464b800adfb..85fc485646f 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -81,6 +81,9 @@ and return the completed information to the address at the top. (There are other assignment options, but they are much less commonly used.) If you have questions about the assignment process, you can ask the address listed on the form, and/or emacs-devel@gnu.org. +The assignment process may take 6-8 weeks, so please ensure your +pending patches still apply on the relevant branch, if the branch +moves forward during that time period. ** Issue tracker (a.k.a. "bug tracker") -- 2.39.2 --=-=-=--