help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tool for writing thin wrappers for changing existing elisp configura


From: Andreas Röhler
Subject: Re: Tool for writing thin wrappers for changing existing elisp configurations
Date: Tue, 08 Apr 2014 07:35:13 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Am 07.04.2014 20:40, schrieb Andrey Tykhonov:

Hi List,

is there any way to change configuration files by means of elisp functions?
Which of them may help?

For example, there are such lines in the ~/.gnus.el (but please note that
that question is not about Gnus):

#+begin_src elisp
(setq nnmail-split-fancy
       '(|
         (: nnmail-split-fancy-with-parent )
         (any "help-gnu-emacs@gnu\\.org" "help-gnu-emacs")
         (any "emacs-devel@gnu\\.org" "emacs-devel")
         "mail.misc"))
#+end_src

I would like to write a thin wrapper, interactive elisp function, which
will be able to append new entry to the `nnmail-split-fancy'.

When I will call that function (M-x add-nnmail-split-fancy-entry) then I'll
be prompted for email address and imap folder (let 'any' will be
hard-coded). Thus such command execution:

M-x add-nnmail-split-fancy-entry RET emacs-orgmode@gnu.org RET
emacs-orgmode RET

will change configuration of the mentioned lines to the following:

#+begin_src elisp
(setq nnmail-split-fancy
       '(|
         (: nnmail-split-fancy-with-parent )
         (any "help-gnu-emacs@gnu\\.org" "help-gnu-emacs")
         (any "emacs-devel@gnu\\.org" "emacs-devel")
         (any "emacs-orgmode@gnu\\.org" "emacs-orgmode")
         "mail.misc"))
#+end_src

Yes, of course, I can just open ~/.gnus.el and add such entry. And of
course I can change via M-x customize-variable RET nnmail-split-fancy RET.

But this question is not about *how* to change existing elisp configuration
but about a tool. I wonder: is there any elisp tool (package, functions
etc) which allows to write such a thin wrapper (elisp program); wrapper
which allows to change source of existing elisp program (configuration)?

How would you implement such a wrapper? Any suggestions? Would you suggest
to investigate how does work `customize-variable'? What else?



Andrey



You could have a batch file calling Emacs to change existing file(s) as you can 
change this files calling other programs.
Also loading a certain init file might be an option, keeping several init-files.

Emacs init files are in Emacs lisp as others. Don't see anything special so far 
when changing it.

HTH,

Andreas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]