Created
February 24, 2021 19:18
-
-
Save Dima-369/03029a0475aaf8cc66d346dc896c88ab to your computer and use it in GitHub Desktop.
Use (buffer-file-name) with (intern) to dynamically create and access symbols entirely from strings in Emacs Lisp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun get-symbol-for-buffer-file () | |
(intern (concat "jump-list-" (buffer-file-name)))) | |
;; (message "%s" (intern "abcd")) | |
;; (message "%s" (boundp (intern "tab-width"))) | |
(set (get-symbol-for-buffer-file) 369) | |
(message "%s" (symbol-value (get-symbol-for-buffer-file))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment