Skip to content

Conversation

@zonuexe
Copy link
Contributor

@zonuexe zonuexe commented Jan 13, 2026

Handle cases where load-file-name is nil by falling back to default-directory. This allows the code to be evaluated directly without errors.

Handle cases where load-file-name is nil by falling back to
default-directory. This allows the code to be evaluated directly
without errors.
@manateelazycat
Copy link
Owner

No, it's not right, if default-directory it not acm/ directory, code can pass, but result is wrong

@zonuexe
Copy link
Contributor Author

zonuexe commented Jan 15, 2026

This is a common pattern in Emacs Lisp to support both loading and direct evaluation. Similar approaches are used in other projects as well:

After submitting this PR, I realized that the following might be a more concise way to handle it:

(defvar acm-icon-dir (expand-file-name "icons" (file-name-directory (or load-file-name buffer-file-name))))

Since this is not a critical issue, I don't intend to pursue this specific change further or update the PR. However, I remain happy to contribute to the project's development in other areas. Thanks!

@zonuexe zonuexe deleted the fix/acm-icon-dir-eval branch January 15, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants