Handle org-mode source blocks without a tangled file
This commit is contained in:
parent
e6d5a257fc
commit
dd585264c2
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user