unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56907: [PATCH] * eww.el (eww-browse): Raise error if there are no arguments
@ 2022-08-03 10:37 Philip Kaludercic
  2022-08-04  6:33 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Philip Kaludercic @ 2022-08-03 10:37 UTC (permalink / raw)
  To: 56907

[-- 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


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

* bug#56907: [PATCH] * eww.el (eww-browse): Raise error if there are no arguments
  2022-08-03 10:37 bug#56907: [PATCH] * eww.el (eww-browse): Raise error if there are no arguments Philip Kaludercic
@ 2022-08-04  6:33 ` Lars Ingebrigtsen
  2022-08-04 12:22   ` Philip Kaludercic
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-08-04  6:33 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 56907

Philip Kaludercic <philipk@posteo.net> writes:

> Subject: [PATCH] * eww.el (eww-browse): Raise error if there are no arguments

Looks good to me; please go ahead and push.






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

* bug#56907: [PATCH] * eww.el (eww-browse): Raise error if there are no arguments
  2022-08-04  6:33 ` Lars Ingebrigtsen
@ 2022-08-04 12:22   ` Philip Kaludercic
  0 siblings, 0 replies; 3+ messages in thread
From: Philip Kaludercic @ 2022-08-04 12:22 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56907-done

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> Subject: [PATCH] * eww.el (eww-browse): Raise error if there are no arguments
>
> Looks good to me; please go ahead and push.

Done.





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

end of thread, other threads:[~2022-08-04 12:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-03 10:37 bug#56907: [PATCH] * eww.el (eww-browse): Raise error if there are no arguments Philip Kaludercic
2022-08-04  6:33 ` Lars Ingebrigtsen
2022-08-04 12:22   ` Philip Kaludercic

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).