all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
[parent not found: <mailman.5935.1406151450.1147.help-gnu-emacs@gnu.org>]
* when you gotta have a variable value for a symbol name
@ 2014-07-23 21:37 Buchs, Kevin J.
  2014-07-23 22:02 ` Drew Adams
       [not found] ` <mailman.5936.1406152985.1147.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 7+ messages in thread
From: Buchs, Kevin J. @ 2014-07-23 21:37 UTC (permalink / raw)
  To: help-gnu-emacs

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)))




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-07-25  0:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.5972.1406239064.1147.help-gnu-emacs@gnu.org>
2014-07-24 22:22 ` when you gotta have a variable value for a symbol name Emanuel Berg
     [not found] <mailman.5935.1406151450.1147.help-gnu-emacs@gnu.org>
2014-07-23 23:24 ` Emanuel Berg
2014-07-23 21:37 Buchs, Kevin J.
2014-07-23 22:02 ` Drew Adams
     [not found]   ` <(message>
     [not found]     ` <from>
     [not found]       ` <Drew>
     [not found]         ` <Adams>
     [not found]           ` <on>
     [not found]             ` <Wed>
     [not found]               ` <23>
     [not found]                 ` <Jul>
     [not found]                   ` <2014>
     [not found]                     ` <15:02:38>
     [not found]                       ` <-0700>
2014-07-24 21:57   ` Robert Thorpe
2014-07-25  0:06     ` Drew Adams
     [not found] ` <mailman.5936.1406152985.1147.help-gnu-emacs@gnu.org>
2014-07-23 22:12   ` Pascal J. Bourguignon

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.