From 544187e3e7ee057b97e2048f71f4e19396884b50 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Fri, 21 Oct 2022 23:35:47 +1100 Subject: fixed a bug when no title could be guessed. --- luwak.el | 6 +++--- 1 file 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 () -- cgit v1.2.3