From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#56907: [PATCH] * eww.el (eww-browse): Raise error if there are no arguments Date: Wed, 03 Aug 2022 10:37:40 +0000 Message-ID: <874jytliiz.fsf@posteo.net> 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="29694"; mail-complaints-to="usenet@ciao.gmane.io" To: 56907@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 03 12:38:14 2022 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 1oJBlW-0007Wt-FI for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Aug 2022 12:38:14 +0200 Original-Received: from localhost ([::1]:39794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJBlV-0006py-By for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Aug 2022 06:38:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJBlL-0006oS-2B for bug-gnu-emacs@gnu.org; Wed, 03 Aug 2022 06:38:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56476) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJBlK-0004zv-P6 for bug-gnu-emacs@gnu.org; Wed, 03 Aug 2022 06:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oJBlK-0006sh-Gm for bug-gnu-emacs@gnu.org; Wed, 03 Aug 2022 06:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Aug 2022 10:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56907 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.165952308026441 (code B ref -1); Wed, 03 Aug 2022 10:38:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Aug 2022 10:38:00 +0000 Original-Received: from localhost ([127.0.0.1]:46225 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJBlI-0006sP-3W for submit@debbugs.gnu.org; Wed, 03 Aug 2022 06:38:00 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:55146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJBlD-0006sE-SE for submit@debbugs.gnu.org; Wed, 03 Aug 2022 06:37:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJBlD-0006hG-L9 for bug-gnu-emacs@gnu.org; Wed, 03 Aug 2022 06:37:55 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:33113) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJBlB-0004vC-Cq for bug-gnu-emacs@gnu.org; Wed, 03 Aug 2022 06:37:55 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 203F2240105 for ; Wed, 3 Aug 2022 12:37:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1659523071; bh=VQWlIp9TUN+cRqW/7npEIrO4bvtVAcbN0ItxxkCwAhY=; h=From:To:Subject:Autocrypt:Date:From; b=ojmSkNymTZuBQCk4Uw/EPis/14Yd/7IK4OXJJVjuf6MZs8az/qNsFTij5MPG9dMoh MJUY+dv4Owujx36DsoSgsSxDwKAhk7ZAGh06PbYEfD9pIeUmOplnQ8nruzDn1CXH4d hJ+iFJESu7vX2ivtWt53nvPG/nn2koKPU9pdJZ3p0uN+CNPpUYxHeNYlD+ipRFSDGA 4p5FBLJbSZpAKHyIy+yykIOlGsPWgZAYjQ86w350DONSuQDJ0INwuZMH+7+yCATlQX R23k38ao2TYViSULFgTN9nXZDJxVK+4C04EYGHmuZRUfKTRr/tmxX3QC4CCzEQjzhN b+LDe5/qSjRXw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LySx81Jtvz6tpc for ; Wed, 3 Aug 2022 12:37:45 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.bugs:238630 Archived-At: --=-=-= Content-Type: text/plain Tags: patch If there are no command line arguments, then nil is passed to eww, and eventually it is given to string-trim, that raises an apparently unrelated error due to the missing string. An alternative to this patch would be to unmark it as interactive, since it appears to be meant for batch use. I had initially confused it with `eww-open-file'. In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.17.6) of 2022-08-01 built on rhea Repository revision: 47f1cae83c269ea43d6b208e055ce536c017856f Repository branch: feature/package+vc System Description: Fedora Linux 36 (Workstation Edition) Configured using: 'configure --with-pgtk --with-native-compilation --with-imagemagick' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-eww.el-eww-browse-Raise-error-if-there-are-no-argume.patch >From 8b25634cb3f5a486632caa97e20bfe73fa55f37e Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 3 Aug 2022 12:34:53 +0200 Subject: [PATCH] * eww.el (eww-browse): Raise error if there are no arguments --- lisp/net/eww.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 4dbd5de2ef..bf256ec21f 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -349,6 +349,8 @@ eww-browse will start Emacs and browse the GNU web site." (interactive) + (unless command-line-args-left + (user-error "No URL given")) (eww (pop command-line-args-left))) -- 2.37.1 --=-=-=--