From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Tool for writing thin wrappers for changing existing elisp configurations
Date: Tue, 08 Apr 2014 07:35:13 +0200 [thread overview]
Message-ID: <53438A91.9060001@easy-emacs.de> (raw)
In-Reply-To: <87vbulgezg.fsf@gmail.com>
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
next prev parent reply other threads:[~2014-04-08 5:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
[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=53438A91.9060001@easy-emacs.de \
--to=andreas.roehler@easy-emacs.de \
--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.