aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-10-21 23:35:47 +1100
committerYuchen Pei <hi@ypei.me>2022-10-21 23:35:47 +1100
commit544187e3e7ee057b97e2048f71f4e19396884b50 (patch)
tree6022a0ed415b2ba4c0a2b7ce4240646f705d0b19
parent2d11ff50d65b33d5438481ec2fc8ddb528d0a8ab (diff)
fixed a bug when no title could be guessed.
-rw-r--r--luwak.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/luwak.el b/luwak.el
index b0f7440..08eb793 100644
--- a/luwak.el
+++ b/luwak.el
@@ -115,9 +115,9 @@ When non-nill, swap the tor-switch in prefix-arg effect."
(defun luwak-guess-title ()
(save-excursion
(goto-char (point-min))
- (re-search-forward "^[^[:space:]]" nil t)
- (buffer-substring-no-properties (1- (point))
- (progn (end-of-line 1) (point)))))
+ (when (re-search-forward "^[^[:space:]]" nil t)
+ (buffer-substring-no-properties (1- (point))
+ (progn (end-of-line 1) (point))))))
(when (require 'org nil t)
(defun luwak-org-store-link ()