all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrey Tykhonov <atykhonov@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Tool for writing thin wrappers for changing existing elisp configurations
Date: Mon, 07 Apr 2014 21:40:35 +0300	[thread overview]
Message-ID: <87vbulgezg.fsf@gmail.com> (raw)


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



             reply	other threads:[~2014-04-07 18:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-07 18:40 Andrey Tykhonov [this message]
2014-04-08  5:35 ` Tool for writing thin wrappers for changing existing elisp configurations 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vbulgezg.fsf@gmail.com \
    --to=atykhonov@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.