[PATCH v3 2/9] emacs/show: Allow the user to decide when part headers should be inserted
[notmuch-archives.git] / 04 / 30148cc8614065136798599b9e2d4b9414babd
1 Return-Path: <jeff@ocjtech.us>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 4342E431FBC\r
6         for <notmuch@notmuchmail.org>; Thu, 19 Nov 2009 13:20:27 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id aS9oiwhF2RZh for <notmuch@notmuchmail.org>;\r
11         Thu, 19 Nov 2009 13:20:26 -0800 (PST)\r
12 Received: from ey-out-1920.google.com (ey-out-1920.google.com [74.125.78.149])\r
13         by olra.theworths.org (Postfix) with ESMTP id 283B0431FAE\r
14         for <notmuch@notmuchmail.org>; Thu, 19 Nov 2009 13:20:26 -0800 (PST)\r
15 Received: by ey-out-1920.google.com with SMTP id 26so833174eyw.6\r
16         for <notmuch@notmuchmail.org>; Thu, 19 Nov 2009 13:20:20 -0800 (PST)\r
17 Received: by 10.213.23.213 with SMTP id s21mr1996972ebb.76.1258665619940;\r
18         Thu, 19 Nov 2009 13:20:19 -0800 (PST)\r
19 Received: from lt26923.campus.dmacc.edu ([161.210.45.123])\r
20         by mx.google.com with ESMTPS id 14sm419165ewy.3.2009.11.19.13.20.18\r
21         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
22         Thu, 19 Nov 2009 13:20:18 -0800 (PST)\r
23 Received: from localhost ([127.0.0.1] helo=localhost.localdomain)\r
24         by lt26923.campus.dmacc.edu with esmtps (TLSv1:AES256-SHA:256)\r
25         (Exim 4.69) (envelope-from <jeff@ocjtech.us>)\r
26         id 1NBEQJ-0000C2-88; Thu, 19 Nov 2009 15:20:15 -0600\r
27 From: "Jeffrey C. Ollie" <jeff@ocjtech.us>\r
28 To: Not Much Mail <notmuch@notmuchmail.org>\r
29 Date: Thu, 19 Nov 2009 15:20:01 -0600\r
30 Message-Id: <1258665602-700-1-git-send-email-jeff@ocjtech.us>\r
31 X-Mailer: git-send-email 1.6.5.2\r
32 In-Reply-To: <yunmy2i2u6t.fsf@aiko.keithp.com>\r
33 References: <yunmy2i2u6t.fsf@aiko.keithp.com>\r
34 Subject: [notmuch] [PATCH 1/2] Improve installation of emacs mode.\r
35 X-BeenThere: notmuch@notmuchmail.org\r
36 X-Mailman-Version: 2.1.12\r
37 Precedence: list\r
38 List-Id: "Use and development of the notmuch mail system."\r
39         <notmuch.notmuchmail.org>\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
43 List-Post: <mailto:notmuch@notmuchmail.org>\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
47 X-List-Received-Date: Thu, 19 Nov 2009 21:20:27 -0000\r
48 \r
49 1) Add a separate targets to build and install emacs mode.\r
50 \r
51 2) Don't hardcode the installation directory, instead use emacs'\r
52    pkg-config module.\r
53 \r
54 3) Install a byte compiled version of the emacs mode.\r
55 \r
56 4) Install the emacs mode in emacs' site-lisp directory.  Put\r
57    "(require 'notmuch)" in your .emacs to load it automatically.\r
58 \r
59 5) Ignore byte-compiled emacs files.\r
60 \r
61 Signed-off-by: Jeffrey C. Ollie <jeff@ocjtech.us>\r
62 ---\r
63  .gitignore     |    2 +-\r
64  Makefile       |    6 ++++++\r
65  Makefile.local |   15 ++++++++++++---\r
66  3 files changed, 19 insertions(+), 4 deletions(-)\r
67 \r
68 diff --git a/.gitignore b/.gitignore\r
69 index 8417d60..7d3c543 100644\r
70 --- a/.gitignore\r
71 +++ b/.gitignore\r
72 @@ -5,4 +5,4 @@ notmuch.1.gz\r
73  *.[ao]\r
74  *~\r
75  .*.swp\r
76 -\r
77 +*.elc\r
78 diff --git a/Makefile b/Makefile\r
79 index 023b2ec..17fa4a2 100644\r
80 --- a/Makefile\r
81 +++ b/Makefile\r
82 @@ -7,6 +7,9 @@ CFLAGS=-O2\r
83  extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc)\r
84  extra_cxxflags := $(shell xapian-config --cxxflags)\r
85  \r
86 +emacs_lispdir := $(shell pkg-config emacs --variable sitepkglispdir)\r
87 +emacs_startdir := $(shell pkg-config emacs --variable sitestartdir)\r
88 +\r
89  # Now smash together user's values with our extra values\r
90  override CFLAGS += $(WARN_FLAGS) $(extra_cflags)\r
91  override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags)\r
92 @@ -28,6 +31,9 @@ include Makefile.config\r
93  %.o: %.c\r
94         $(CC) -c $(CFLAGS) $< -o $@\r
95  \r
96 +%.elc: %.el\r
97 +       emacs -batch -f batch-byte-compile $<\r
98 +\r
99  .deps/%.d: %.c\r
100         @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \\r
101         $(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.$$$$; \\r
102 diff --git a/Makefile.local b/Makefile.local\r
103 index c44d160..ecd4ceb 100644\r
104 --- a/Makefile.local\r
105 +++ b/Makefile.local\r
106 @@ -1,5 +1,7 @@\r
107  all: notmuch notmuch.1.gz\r
108  \r
109 +emacs: notmuch.elc\r
110 +\r
111  notmuch_client_srcs =          \\r
112         notmuch.c               \\r
113         notmuch-config.c        \\r
114 @@ -25,15 +27,22 @@ notmuch.1.gz: notmuch.1\r
115  \r
116  install: all notmuch.1.gz\r
117         for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \\r
118 -               $(DESTDIR)/$(prefix)/share/emacs/site-lisp/ $(DESTDIR)/etc/bash_completion.d/ ; \\r
119 +               $(DESTDIR)/etc/bash_completion.d/ ; \\r
120         do \\r
121                 install -d $$d ; \\r
122         done ;\r
123         install notmuch $(DESTDIR)$(prefix)/bin/\r
124         install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/\r
125 -       install -m0644 notmuch.el $(DESTDIR)$(prefix)/share/emacs/site-lisp/\r
126         install notmuch-completion.bash \\r
127                 $(DESTDIR)/etc/bash_completion.d/notmuch\r
128  \r
129 +install-emacs: install emacs\r
130 +       for d in $(DESTDIR)/$(emacs_lispdir) ; \\r
131 +       do \\r
132 +               install -d $$d ; \\r
133 +       done ;\r
134 +       install -m0644 notmuch.el $(DESTDIR)$(emacs_lispdir)\r
135 +       install -m0644 notmuch.elc $(DESTDIR)$(emacs_lispdir)\r
136 +\r
137  SRCS  := $(SRCS) $(notmuch_client_srcs)\r
138 -CLEAN := $(CLEAN) notmuch $(notmuch_client_modules)\r
139 +CLEAN := $(CLEAN) notmuch $(notmuch_client_modules) notmuch.elc\r
140 -- \r
141 1.6.5.2\r
142 \r