From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenjiro NAKAYAMA Newsgroups: gmane.emacs.bugs Subject: bug#16217: 24.3.50; [PATCH] eww: Add non-supported ftp error. Date: Sun, 22 Dec 2013 19:51:52 +0900 Message-ID: <871u15i2ev.fsf@dhcp-193-97.nrt.redhat.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1387709617 306 80.91.229.3 (22 Dec 2013 10:53:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Dec 2013 10:53:37 +0000 (UTC) To: 16217@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 22 11:53:42 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VugfF-0003U8-5z for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Dec 2013 11:53:41 +0100 Original-Received: from localhost ([::1]:57264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VugfE-0002tr-TI for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Dec 2013 05:53:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vugem-0002MH-66 for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2013 05:53:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vuged-0000IR-Mq for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2013 05:53:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vuged-0000IM-Ba for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2013 05:53:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Vugec-0006Ln-Qa for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2013 05:53:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kenjiro NAKAYAMA Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Dec 2013 10:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16217 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.138770955124359 (code B ref -1); Sun, 22 Dec 2013 10:53:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Dec 2013 10:52:31 +0000 Original-Received: from localhost ([127.0.0.1]:34084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vuge6-0006Kp-Aj for submit@debbugs.gnu.org; Sun, 22 Dec 2013 05:52:30 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58632) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vuge3-0006Kg-Ti for submit@debbugs.gnu.org; Sun, 22 Dec 2013 05:52:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vugdv-0008Nv-69 for submit@debbugs.gnu.org; Sun, 22 Dec 2013 05:52:27 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:59298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vugdv-0008Nm-2F for submit@debbugs.gnu.org; Sun, 22 Dec 2013 05:52:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vugdm-00020d-Jh for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2013 05:52:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vugde-0008HZ-6i for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2013 05:52:10 -0500 Original-Received: from mail-pd0-x234.google.com ([2607:f8b0:400e:c02::234]:40253) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vugdd-0008G8-V5 for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2013 05:52:02 -0500 Original-Received: by mail-pd0-f180.google.com with SMTP id q10so4207677pdj.39 for ; Sun, 22 Dec 2013 02:52:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:from:to:subject:date:message-id:mime-version :content-type; bh=AOj3Tu65cXcc+98TBnkb9TnRaQjud+k7faEsvp6tyU0=; b=oye1veMQWhvM9V25k5fdTH3SRVTvflY+GUAqUa4TP5/2NbADwDwTHRVWnlAz9agIh+ lGmqm+o0JwLolohyvkW3/C/4zVrhXHjoSy55jtY8VfUI75W37FK4MjsfWG7+lcUKOm3L 8JT6Ok1WEBQLAERxX2vaEqwxqAWtie+ltLKxCfU1f6T7XL7reR7YHCjdcGz2ZYEAdlfv 4qkCQO7DfH0olCfMjFvm3Kptq/qBAa0YZz6JMkXhkbF+X6MPwYuiAjQmJP9pSB8s355k o87Hx6BX8zZngiRmPi3imYFhKuA1uVHKrJnVTyzNXhiMgQocKADOjSat7/SiIHm1esqo XVZA== X-Received: by 10.68.189.5 with SMTP id ge5mr19469895pbc.42.1387709520330; Sun, 22 Dec 2013 02:52:00 -0800 (PST) Original-Received: from dhcp-193-97.nrt.redhat.com (nat-pool-nrt-t1.redhat.com. [66.187.238.10]) by mx.google.com with ESMTPSA id nw11sm34901133pab.13.2013.12.22.02.51.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Dec 2013 02:51:59 -0800 (PST) User-agent: mu4e 0.9.9.6pre2; emacs 24.3.50.1 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:82390 Archived-At: This report includes a patch to the bug. Please, review and install it to the official tree if appreciated. Reproduce the bug. 1. M-x eww ftp://SOMEWHERE/pub (eg. ftp://ftp.kernel.org/pub/) 2. The error message "Searching for program: no such file or directory, ftp" is wrong. I included tiny change ("\\`file:"-> "\\`file://"), and corrected indent. (Number of spaces is wrong?) Signed-off-by: Kenjiro NAKAYAMA * net/eww.el (eww) : Add non-supported ftp error. --- lisp/net/eww.el | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 15bb2c0..fd592ef 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -144,19 +144,21 @@ See also `eww-form-checkbox-selected-symbol'." If the input doesn't look like an URL or a domain name, the word(s) will be searched for via `eww-search-prefix'." (interactive "sEnter URL or keywords: ") - (cond ((string-match-p "\\`file:" url)) - (t - (if (and (= (length (split-string url)) 1) - (or (> (length (split-string url "\\.")) 1) - (string-match eww-local-regex url))) - (progn - (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url) - (setq url (concat "http://" url))) - ;; some site don't redirect final / - (when (string= (url-filename (url-generic-parse-url url)) "") - (setq url (concat url "/")))) - (setq url (concat eww-search-prefix - (replace-regexp-in-string " " "+" url)))))) + (cond ((string-match-p "\\`file://" url)) + ((string-match-p "\\`ftp://" url) + (user-error "FTP is not supported.")) + (t + (if (and (= (length (split-string url)) 1) + (or (> (length (split-string url "\\.")) 1) + (string-match eww-local-regex url))) + (progn + (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url) + (setq url (concat "http://" url))) + ;; some site don't redirect final / + (when (string= (url-filename (url-generic-parse-url url)) "") + (setq url (concat url "/")))) + (setq url (concat eww-search-prefix + (replace-regexp-in-string " " "+" url)))))) (url-retrieve url 'eww-render (list url))) ;;;###autoload (defalias 'browse-web 'eww) -- 1.8.3.1 Regards, Kenjiro NAKAYAMA