unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Tool for writing thin wrappers for changing existing elisp configurations
@ 2014-04-07 18:40 Andrey Tykhonov
  2014-04-08  5:35 ` Andreas Röhler
  2014-04-10  7:45 ` Suvayu Ali
  0 siblings, 2 replies; 4+ messages in thread
From: Andrey Tykhonov @ 2014-04-07 18:40 UTC (permalink / raw)
  To: help-gnu-emacs


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



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

end of thread, other threads:[~2014-04-10  7:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-07 18:40 Tool for writing thin wrappers for changing existing elisp configurations Andrey Tykhonov
2014-04-08  5:35 ` Andreas Röhler
     [not found]   ` <CAM7J8HKs-asCt9skPYLjM8ry+_vxrgoq5j7r-HSsmqMA99Xa3Q@mail.gmail.com>
2014-04-10  5:53     ` Andreas Röhler
2014-04-10  7:45 ` Suvayu Ali

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