[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
when you gotta have a variable value for a symbol name
From: |
Buchs, Kevin J. |
Subject: |
when you gotta have a variable value for a symbol name |
Date: |
Wed, 23 Jul 2014 16:37:06 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
I want to evaluate (kmacro-name-last-macro variable), where I want the
value of "variable" passed as the symbol name. Despite years of trying,
I don't think I ever really conceptually "got" the distinction between
symbols and variables and that seems to be critical here. I'm working
with the code below, but it is not suceeding in naming the macros (no
error messages, however). Of course (kmacro-name-last-macro 'my-macro)
works just fine.
--
Kevin Buchs Research Computer Services Phone: 507-538-5459
Mayo Clinic 200 1st. St SW Rochester, MN 55905
http://mayoclinic.org http://facebook.com/MayoClinic
http://youtube.com/MayoClinic http://twitter.com/MayoClinic
(defun name-my-macro-sequentially ()
"Names the last recorded macro as my-macro#, where # is a number sequentially
incremented"
(interactive)
(unless (boundp 'my-macro-counter) (setq my-macro-counter 0))
(setq my-macro-counter (1+ my-macro-counter))
(let ((macro-name (format "my-macro-%d" my-macro-counter)))
(kmacro-name-last-macro (make-symbol macro-name))
(message "named keyboard macro %s" macro-name)))
- when you gotta have a variable value for a symbol name,
Buchs, Kevin J. <=