From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#74218: [PATCH] Ask confirmation before sending region to search engine. Date: Wed, 06 Nov 2024 14:34:33 +0200 Message-ID: <86pln8sfqe.fsf@gnu.org> References: <20241106005544.26516-1-me@fabionatali.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10526"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74218@debbugs.gnu.org To: Fabio Natali Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 06 13:35:31 2024 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 1t8fFy-0002XE-Uy for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Nov 2024 13:35:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8fFf-0000zB-RV; Wed, 06 Nov 2024 07:35:12 -0500 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 1t8fFY-0000uu-Q5 for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 07:35:05 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8fFY-00073q-9W for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 07:35:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=xQ3PFr0VM68zngxQ4/wA1llLVOEfQ2koYLdLwklcvJs=; b=buLi/Awh+gcv4zOKBLo2N2OnC0j+uk5z3mUGzomf6wgRVeZ0kv2omxn9yJx0o7GBZ+NI7hcnjdyVFLEMinltuUzCKOJh0mE1Q/HAFRiwoobOs4PlBLnhu615khTUU4seQUUtvEV39VYxADbxFW4hap5+nB8gR7fTlN/3k1SzfSqJdPxdEodLjy3nZg/X0MhUxpAJptATsZrjorr/FiWfiVQqa494krapusfkzP9/lj+G6Ce8txolIUtR3uIYrBX5r+Uc8BCUHFlUbvJNGaCHZoHen3xcrMsHB1sl1rbQNTRDcDbOg3k7CqUhYtNcdy3tU9VXDuqZji5ZcwyBBC32jg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t8fFW-00058X-4B for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 07:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Nov 2024 12:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74218 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74218-submit@debbugs.gnu.org id=B74218.173089649419727 (code B ref 74218); Wed, 06 Nov 2024 12:35:02 +0000 Original-Received: (at 74218) by debbugs.gnu.org; 6 Nov 2024 12:34:54 +0000 Original-Received: from localhost ([127.0.0.1]:39925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8fFO-000586-DA for submit@debbugs.gnu.org; Wed, 06 Nov 2024 07:34:54 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8fFL-00057t-4u for 74218@debbugs.gnu.org; Wed, 06 Nov 2024 07:34:52 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t8fFC-00071w-98; Wed, 06 Nov 2024 07:34:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=xQ3PFr0VM68zngxQ4/wA1llLVOEfQ2koYLdLwklcvJs=; b=Gf6TFqaCNT9C 4lQF3hVEXWe6xd74ahnImacQMNcxWHdS7hNvbFY3VdWfm9M1pr/uAh95MV3Dolcxv2eks6kDDvR2b LkdGvHJPYrxwluKZ/mbvt29AmXBFtL6/X1AdY5Xm1kKLQMYqv+LF2f0btWG23/CbZRl0A85OU5Wof qJxbkFRZRg4N7oftldZyLcTkXXx10OhVJFFCVlIubIUFCbYaAlItUBRgYJZ/ik5GZtwAEW/6zyN0a giTTxKObn4EnpE3v02baOmBqMbwmTJ0133MKNf+ehbxcZylblnDzivTchRI21FcgM8Osttt96y51G UwP8fKPhvlGlVuS0HGknXA==; In-Reply-To: <20241106005544.26516-1-me@fabionatali.com> (bug-gnu-emacs@gnu.org) 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:294949 Archived-At: > Cc: Fabio Natali > Date: Wed, 6 Nov 2024 00:46:46 +0000 > From: Fabio Natali via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > * lisp/net/eww.el (eww-search-confirm-send-region, > eww-search-words): With 'eww-search-words' (by default bound to 'M-s > M-w') a user can type in some search terms and get back the results > of a web search from a predefined search engine. If a region is > selected, 'eww-search-words' will use that for the web search > instead of prompting the user. This should be reformatted according to our conventions, see CONTRIBUTE. > +(defcustom eww-search-confirm-send-region t > + "Non-nil if Emacs should confirm sending the selected region to > +the configured search engine. This is the default to mitigate the The first line of a doc string should be a single complete sentence, and should attempt to summarize what the function/variable does, because some "apropos" commands show only the first line of each doc string. > +risk of accidental data leak. Set this variable to nil to send > +the region to the search engine straightaway." > + :version "30.0" This should be "31.1". > + (when (or (not eww-search-confirm-send-region) > + (yes-or-no-p > + (format-message > + "Send region to the configured search engine? "))) IMO, this should somehow try to indicate the problematic aspect of doing this. For example, maybe it should say Really send the entire region to the search engine? It is also possible that short regions should be sent without any need for confirmation. In which case perhaps the variable should allow integer values, not just nil and t. In addition, I don't see any need to ask for confirmation when we are not going to send anything to the search engine, so I think the test for white-space region should be before the confirmation prompt, and only if the region is going to be sent. Last, but not least: this contribution almost exhausts the amount of changes we can accept from you without a copyright assignment. Would you like to start at this time your legal paperwork of assigning the copyright to the FSF, so that we could accept your future contributions without limitations? If so, I will send you the form to fill and the instructions to go with it. Thanks.