diff options
author | Yuchen Pei <id@ypei.org> | 2023-07-10 13:12:18 +1000 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2023-07-10 13:12:18 +1000 |
commit | 161752ee1943dbb25060a1488086da1a00aeaadb (patch) | |
tree | e361c658e0a998d5c5909d5f1360254e3c8e028b /wiki-utils.el | |
parent | 2e735a1052984299337decc6648ac02034d1263b (diff) |
Implement wiki-fetch-prefer-local
Diffstat (limited to 'wiki-utils.el')
-rw-r--r-- | wiki-utils.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wiki-utils.el b/wiki-utils.el index 5b66075..c2500a4 100644 --- a/wiki-utils.el +++ b/wiki-utils.el @@ -34,14 +34,14 @@ "If non-nil, visit the local file if exists when instructed for fetching.") -(defun wiki-fetch-url (url &optional callback title) +(defun wiki-fetch-url (url dir &optional callback title) "Fetch URL asynchronously. Then calls CALLBACK which is a closure taking no argument." (interactive "sURL: ") (let ((file-name (expand-file-name (or title (wiki-make-file-name-from-url url)) - wiki-download-dir)) + dir)) (cb (lambda (status file-name) (wiki-fetch-url-save-and-switch status file-name) (when callback (funcall callback))))) |