[Top][All Lists]

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

Re: [PATCH] checking eww download directory

From: Lars Ingebrigtsen
Subject: Re: [PATCH] checking eww download directory
Date: Fri, 27 Jan 2017 20:21:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Mark Oteiza <address@hidden> writes:

> - it would be nice if eww looked a little harder for an existing
>   downloads directory.  Perhaps what's below is too much, comments
>   welcome


> -(defcustom eww-download-directory "~/Downloads/"
> +(defcustom eww-download-directory
> +  (cond
> +   ((memq system-type '(ms-dos windows-nt cygwin))
> +    (expand-file-name "Downloads" (getenv "USERPROFILE")))
> +   ((cl-some
> +     (lambda (str)
> +       (let ((f (expand-file-name str "~")))
> +         (and (file-directory-p f)
> +              (string-match-p "downloads?" (downcase f))
> +              (abbreviate-file-name f))))
> +     (directory-files "~")))
> +   (t "~/Downloads/"))

Yikes.  There must be a gazillion places directories are defined under
the home director.  Do they all do this dance?  If they do, perhaps it
should be made into a library function?

> +  (access-file eww-download-directory "Download failed")

Seem OK, except that the error message should say what the error is
instead of this.

(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

[Prev in Thread] Current Thread [Next in Thread]