unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: target notmuch-one.el[c] -- emacs client in one .el[c] file
@ 2013-09-02 19:37 Tomi Ollila
  0 siblings, 0 replies; only message in thread
From: Tomi Ollila @ 2013-09-02 19:37 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

Added Makefile recipes to create notmuch emacs client in just one
.el[c] file.

This is an experimental feature and not built by default.

This is useful for example when one wants to build the latest
emacs client and then distribute the elisp file to many machines.

This is also useful for (initial) testing:

     make emacs/notmuch-one.elc
     emacs -q -l emacs/notmuch-one.elc -f notmuch

can be used to quickly experiment with new development.
---

I've used one-file notmuch.elc since Fri Nov 4 11:03:33 2011 +0200
when I created perl script to combine all .el files together
and had only minor problems (if any, cannot be sure).

I build notmuch.elc in one machine and then distribute it to 2
others.

Now with the .eldeps target Austin created the same can be done
by utilizing the dependency information it provied.

Now I build notmuch using something like the following sequence:

    ./configure --without-emacs
    make
    make install
    make emacs/notmuch-one.elc
    cp emacs/notmuch-one.elc ~/local/elisp-ext/notmuch.elc

... but most often I do last 2 of the above and then continue with:

    scp ~/local/elisp-ext/notmuch.elc host2:local/elisp-ext
    scp ~/local/elisp-ext/notmuch.elc host3:local/elisp-ext

 emacs/Makefile.local | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/emacs/Makefile.local b/emacs/Makefile.local
index a910aff..9e3d409 100644
--- a/emacs/Makefile.local
+++ b/emacs/Makefile.local
@@ -46,6 +46,20 @@ endif
 install: install-emacs
 endif
 
+# Unsupported hack to provide notmuch emacs client in one *.elc file.
+# It probably works -- or then it fails mysteriously. YMMV.
+# Enter `make emacs/notmuch-one.elc' in top level directory to build it.
+ifeq ($(HAVE_EMACS),1)
+$(dir)/notmuch-one.el: $(emacs_sources)
+	rm -f $(emacs_bytecode) # XXX
+	make -n all WITH_EMACS=1 | sed -n '/printf.*EMACS/ s/.* //p' | \
+		xargs grep -vh '(declare-function.*"notmuch' > '$@' || :
+	{ echo ';; Local Variables:'; \
+	  echo ';; byte-compile-warnings: (not cl-functions)'; \
+	  echo ';; End:'; } >> '$@'
+endif
+CLEAN+=$(dir)/notmuch-one.el $(dir)/notmuch-one.elc
+
 .PHONY: install-emacs
 install-emacs:
 	mkdir -p "$(DESTDIR)$(emacslispdir)"
-- 
1.8.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-02 19:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-02 19:37 [PATCH] emacs: target notmuch-one.el[c] -- emacs client in one .el[c] file Tomi Ollila

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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