unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com>
To: 16217@debbugs.gnu.org
Subject: bug#16217: 24.3.50; [PATCH] eww: Add non-supported ftp error.
Date: Sun, 22 Dec 2013 19:51:52 +0900	[thread overview]
Message-ID: <871u15i2ev.fsf@dhcp-193-97.nrt.redhat.com> (raw)

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 <nakayamakenjiro@gmail.com>

        * 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





             reply	other threads:[~2013-12-22 10:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-22 10:51 Kenjiro NAKAYAMA [this message]
2013-12-22 22:41 ` bug#16217: 24.3.50; [PATCH] eww: Add non-supported ftp error Ted Zlatanov

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=871u15i2ev.fsf@dhcp-193-97.nrt.redhat.com \
    --to=nakayamakenjiro@gmail.com \
    --cc=16217@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).