aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--luwak.el20
1 files changed, 17 insertions, 3 deletions
diff --git a/luwak.el b/luwak.el
index 88946f4..b2cb42d 100644
--- a/luwak.el
+++ b/luwak.el
@@ -207,9 +207,10 @@ When non-nill, swap the tor-switch in prefix-arg effect."
(defun luwak-reload ()
(interactive)
- (luwak-open-url
- (plist-get luwak-data :url)
- (plist-get luwak-data :no-tor)))
+ (let ((url (plist-get luwak-data :url)))
+ (unless url
+ (error "The current buffer is not associated with any url."))
+ (luwak-open-url url (plist-get luwak-data :no-tor))))
(defun luwak-follow-link (marker)
(let ((url (get-text-property marker 'url)))
@@ -225,6 +226,19 @@ When non-nill, swap the tor-switch in prefix-arg effect."
(funcall luwak-render-link-function i url)
(setq i (1+ i)))))))
+(defun luwak-render-buffer ()
+ "Render the current buffer in luwak mode."
+ (interactive)
+ (let ((dump (buffer-string)))
+ (with-current-buffer (get-buffer-create luwak-buffer)
+ (luwak-open-internal
+ nil
+ dump
+ (or (plist-get luwak-data :history-pos) 0)
+ (or (plist-get luwak-data :no-tor)
+ (xor luwak-tor-switch current-prefix-arg)))
+ (luwak-add-to-history))))
+
(defun luwak-render-link-forward-sexp (idx url)
"Render a link using forward-sexp."
(when (re-search-forward (format "\\[%d\\]" idx) nil t)