hugo: use named-let to avoid hypothetical stack overflow
This commit is contained in:
parent
41313be8a6
commit
700d0da6b7
@ -649,9 +649,10 @@ See https://emacs.stackexchange.com/questions/2538/how-to-define-additional-mode
|
||||
(defun hugo-dir-above (dir)
|
||||
"Return path of Hugo project root above or at DIR.
|
||||
Return nil if DIR is not in a hugo project at all."
|
||||
(named-let hda-internal ((dir dir))
|
||||
(if (eq dir nil) nil
|
||||
(if (file-exists-p (expand-file-name "config.toml" dir)) dir
|
||||
(hugo-dir-above (file-name-directory (string-trim-right dir "/"))))))
|
||||
(hda-internal (file-name-directory (string-trim-right dir "/")))))))
|
||||
(defun hugo-compile (dir)
|
||||
(let ((hugo-dir (hugo-dir-above dir)))
|
||||
(if hugo-dir
|
||||
|
Loading…
Reference in New Issue
Block a user