From dd585264c2f1b7817c8d5a431651c8e0b8612bc6 Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Fri, 2 Sep 2022 08:07:04 +0200 Subject: [PATCH] Handle org-mode source blocks without a tangled file --- README.org | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 2ec71ff..239da6f 100644 --- a/README.org +++ b/README.org @@ -3271,9 +3271,12 @@ mode independent [[https://github.com/joaotavora/eglot][eglot]] configuration: (user-error "Buffer %s is no `org-src-mode' buffer" (buffer-name))) (let ((mark (point)) (body (nth 1 info)) - (filename (expand-file-name (cdr (assq :tangle (nth 2 info)))))) + (filename (cdr (assq :tangle (nth 2 info))))) + (when (string= filename "no") + (user-error "Org source block has no tangled file")) + (setq filename (expand-file-name filename)) (unless (file-readable-p filename) - (user-error "Tangled file %s is not readible" filename)) + (user-error "Tangled file %s is not readable" filename)) (with-temp-buffer (insert-file-contents filename 'visit nil nil 'replace) (unless (search-forward body nil 'noerror)