[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: warn of asynchronous processes before prompting for next URL



jidanni@xxxxxxxxxxx writes:

> g runs the command w3m-goto-url, which is an interactive compiled Lisp
> function in `w3m.el'.
>
> The problem is, it will prompt you like everything is OK,
> then only after you painfully type in the URL you want to browse, does
> it finally tell you
> "Cannot run two w3m processes simultaneously (Type `C-c C-k' to stop
> asynchronous process)".
>
> It should tell you that before prompting!

Does this patch work as you might want to do?

For emacs-w3m developers: Any comment about applying this patch? I think
this would be reasonable.

diff --git a/w3m.el b/w3m.el
index 7e4f38f..93af8fd 100644
--- a/w3m.el
+++ b/w3m.el
@@ -9161,7 +9161,11 @@ already been registered in the `w3m-history-flat' variable.  It is
 corresponding to URL to be retrieved at this time, not for the url of
 the current page."
   (interactive
-   (list (w3m-input-url nil nil nil nil 'feeling-lucky)
+   (list (if w3m-current-process
+	     (error "%s"
+		    (substitute-command-keys "Cannot run two w3m processes simultaneously \
+\(Type `\\<w3m-mode-map>\\[w3m-process-stop]' to stop asynchronous process)"))
+	   (w3m-input-url nil nil nil nil 'feeling-lucky))
 	 current-prefix-arg
 	 (w3m-static-if (fboundp 'universal-coding-system-argument)
 	     coding-system-for-read)))

Attachment: pgpwWOzNa8BYi.pgp
Description: PGP signature