unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: 56907@debbugs.gnu.org
Subject: bug#56907: [PATCH] * eww.el (eww-browse): Raise error if there are no arguments
Date: Wed, 03 Aug 2022 10:37:40 +0000	[thread overview]
Message-ID: <874jytliiz.fsf@posteo.net> (raw)

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

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'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-eww.el-eww-browse-Raise-error-if-there-are-no-argume.patch --]
[-- Type: text/patch, Size: 642 bytes --]

From 8b25634cb3f5a486632caa97e20bfe73fa55f37e Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
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


             reply	other threads:[~2022-08-03 10:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-03 10:37 Philip Kaludercic [this message]
2022-08-04  6:33 ` bug#56907: [PATCH] * eww.el (eww-browse): Raise error if there are no arguments Lars Ingebrigtsen
2022-08-04 12:22   ` Philip Kaludercic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874jytliiz.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=56907@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).