diff --git a/lisp/mitch-packages.el b/lisp/mitch-packages.el index e51061b..c155742 100644 --- a/lisp/mitch-packages.el +++ b/lisp/mitch-packages.el @@ -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." - (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 "/")))))) + (named-let hda-internal ((dir dir)) + (if (eq dir nil) nil + (if (file-exists-p (expand-file-name "config.toml" dir)) dir + (hda-internal (file-name-directory (string-trim-right dir "/"))))))) (defun hugo-compile (dir) (let ((hugo-dir (hugo-dir-above dir))) (if hugo-dir