unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Passing symbols whose values are symbols to macros?
@ 2015-07-09 12:50 Doug Lewan
  2015-07-11 12:23 ` Michael Heerdegen
  0 siblings, 1 reply; 3+ messages in thread
From: Doug Lewan @ 2015-07-09 12:50 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

I have a project with many subsystems. 
I'd like to define a mode for the current subsystem of interest, 
but not for all 200+ subsystems. 
The mode(s) are based on compilation mode
but add customizations for handling local log files.

Doing this with macros seems like the obvious choice, 
but, since I'll be constructing symbols at run time for the subsystem of interest,
I'm having a very hard time using (defcustom).

I've been able to work around that by wrapping (defcustom) in another macro
that evals the argument that is the symbol for the customization and then calls (defcustom) 
but eval-ing args in macros is recommended against.
(I also suspect it won't play nicely once I try to compile it.)

Does anyone have any advice for how I might pass the value of a symbol (which is a symbol)
to a macro that expects a symbol like (defcustom)?

Thanks.

-- 
,Doug
Douglas Lewan
Shubert Ticketing
(201) 489-8600 ext 4335

I once worked in a can recycling facility. It was soda pressing.




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

* Re: Passing symbols whose values are symbols to macros?
       [not found] <mailman.6604.1436446216.904.help-gnu-emacs@gnu.org>
@ 2015-07-09 12:55 ` Pascal J. Bourguignon
  0 siblings, 0 replies; 3+ messages in thread
From: Pascal J. Bourguignon @ 2015-07-09 12:55 UTC (permalink / raw)
  To: help-gnu-emacs

Doug Lewan <dougl@shubertticketing.com> writes:

> I have a project with many subsystems. 
> I'd like to define a mode for the current subsystem of interest, 
> but not for all 200+ subsystems. 
> The mode(s) are based on compilation mode
> but add customizations for handling local log files.
>
> Doing this with macros seems like the obvious choice, 

Nope.  The obvious choice is to remember that GNU emacs  is 30 years
old, and therefore your problem has already occured to someone else, and
have been solved in a customizable way.

Therefore: M-x customize-variable RET compilation-error-regexp-alist RET


> Does anyone have any advice for how I might pass the value of a symbol (which is a symbol)
> to a macro that expects a symbol like (defcustom)?

Use a time-machine.


-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


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

* Re: Passing symbols whose values are symbols to macros?
  2015-07-09 12:50 Passing symbols whose values are symbols to macros? Doug Lewan
@ 2015-07-11 12:23 ` Michael Heerdegen
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Heerdegen @ 2015-07-11 12:23 UTC (permalink / raw)
  To: Doug Lewan; +Cc: help-gnu-emacs@gnu.org

Hi Doug,

has this issue been solved with Pascal's answer?

If not: the expansion of `defcustom' is quite trivial and results in a
call to `custom-declare-variable' which is a function.  So I guess you
should simply use `custom-declare-variable' instead of `defcustom'.


Michael.




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

end of thread, other threads:[~2015-07-11 12:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-09 12:50 Passing symbols whose values are symbols to macros? Doug Lewan
2015-07-11 12:23 ` Michael Heerdegen
     [not found] <mailman.6604.1436446216.904.help-gnu-emacs@gnu.org>
2015-07-09 12:55 ` Pascal J. Bourguignon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).