diff --git a/core/libs/ht.el b/core/libs/ht.el index aaf785143..906882e64 100644 --- a/core/libs/ht.el +++ b/core/libs/ht.el @@ -114,9 +114,10 @@ for the final key, which may return any value." (declare (side-effect-free t)) (inline-letevals (table keys) (inline-quote - (prog1 ,table + (progn (while ,keys - (setf ,table (ht-get table (pop ,keys)))))))) + (setf ,table (ht-get ,table (pop ,keys)))) + ,table)))) (put 'ht-get* 'compiler-macro (lambda (_ table &rest keys) diff --git a/core/libs/package-build.el b/core/libs/package-build.el index df345b9d8..af5dfc229 100644 --- a/core/libs/package-build.el +++ b/core/libs/package-build.el @@ -414,8 +414,10 @@ is used instead." "^;;[[:blank:]]*" ; double semicolon prefix "[[:blank:]\n]*\\'") ; trailing new-lines "" commentary)))) - (unless (= (char-before) ?\n) + (unless (or (bobp) (= (char-before) ?\n)) (insert ?\n)) + ;; We write the file even if it is empty, which is perhaps + ;; a questionable choice, but at least it's consistent. (let ((coding-system-for-write buffer-file-coding-system)) (write-region nil nil (expand-file-name (concat name "-readme.txt") @@ -437,9 +439,13 @@ SOURCE-DIR and TARGET-DIR respectively." (progn (setq info (concat (file-name-sans-extension tmp) ".info")) (unless (file-exists-p info) + ;; If the info file is located in a subdirectory + ;; and contains relative includes, then it is + ;; necessary to run makeinfo in the subdirectory. (with-demoted-errors "Error: %S" (package-build--run-process - source-dir nil "makeinfo" src "-o" info)) + (file-name-directory src) nil + "makeinfo" src "-o" info)) (package-build--message "Created %s" info))) (delete-file tmp))) (with-demoted-errors "Error: %S"