mohkale / compile-multi

Multi target interface to compile.
GNU General Public License v3.0
24 stars 3 forks source link

`compile-multi-forms` does not work properly #2

Closed y0sik closed 2 years ago

y0sik commented 2 years ago

Problem

It looks like values from compile-multi-forms are not substituted into compile-multi-config.

Example

Can be reproduced in emacs -Q

  1. (optional, default value already contains this) (setq compile-multi-forms '((file-name . (buffer-file-name))))
  2. (setq compile-multi-config '((t ("say file name" "echo" file-name))))
  3. Run compile-multi in some file, it will complain: Invalid function: "say file name"
  4. (setq compile-multi-config '((t ("say file name" "echo" (buffer-file-name)))))
  5. Run compile-multi in some file, it will work correctly

Possible source of the problem

These lines are somewhat suspicious: https://github.com/mohkale/compile-multi/blob/f4c315734a095a4ca9b0d085ccd5556106008428/compile-multi.el#L110-L115

If I change let* to this, everything works fine:

(let* ((val (or (alist-get it compile-multi-forms)
                it))
       (evaluated-value (eval val)))
  (unless (stringp evaluated-value)
    (error "Failed to stringify task argument %s" val))
  evaluated-value)
mohkale commented 2 years ago

Ah, good job spotting the issue and the cause behind it. Should be fixed with eb95d42. Please let me know if the applied patch has fixed the issue for you and then close this issue. :-).

y0sik commented 2 years ago

Yes, everything is working now, thanks.