[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Tool for writing thin wrappers for changing existing elisp configuration
From: |
Andrey Tykhonov |
Subject: |
Tool for writing thin wrappers for changing existing elisp configurations |
Date: |
Mon, 07 Apr 2014 21:40:35 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
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