unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 00623b8cf757d72ac675d56bcf6b96b1c80b8129 1736 bytes (raw)
name: emacs/try-emacs-mua.sh 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
 
#!/bin/sh

# This script provides an easy way to try and experiment with the
# notmuch emacs client provided in this directory.

set -eu

test $# -gt 0 || {
	exec >&2
	echo
	echo "Usage: $0 '' | q | Q [other-emacs-args]"
	echo
	printf "  $0 %s\n" "'' starts emacs without either -q or -Q option" \
		"q  starts emacs with -q" \
		"Q  starts emacs with -Q"
	echo
	exit 1
}

case $1 in '') opt=
	;; q | -q) opt=-q
	;; Q | -Q) opt=-Q
	;; *) echo "option '$1' not '', 'q' nor 'Q'" >&2; exit 1
esac
shift

case $0 in
	*\"*)	echo "'$0' contain one or more '\"'s" >&2; exit 1 ;;
	*/*)	d0=${0%/*} ;;
	*)	d0=.
esac

pwd=$PWD
cd "$d0"
elwd=$PWD

# ensure we don't load .elc files that are older than corresponding .el file
perl -e 'use strict; use warnings;
while (<*.elc>) {
	my $elc = $_; s/elc$/el/;
	if (-M $_ < -M $elc) {
		warn "$_ is newer than $elc. Removing $elc\n";
		unlink $elc or die "Failed to remove '\''$elc'\'': $!\n";
	}
}'

cd "$pwd"

# note: whitespace in $EMACS splits to command and args
exec ${EMACS:-emacs} $opt -L "$elwd" -l "$d0"/notmuch.el "$@" --eval '
(with-current-buffer "*scratch*"
  (let ((pdir (expand-file-name "'"$elwd/.."'")))
    (insert "
Go to the end of the following lines and type C-x C-e to evaluate

To \"disable\" mail sending, evaluate
(setq message-send-mail-function (lambda () t))

To enable address completion, evaluate
(notmuch-address-message-insinuate)

To use accompanied notmuch binary from the same source, evaluate
(setq exec-path (cons \"" pdir "\" exec-path))
Note: Evaluating the above may be followed by unintended database
upgrade and getting back to old version may require dump & restore.

To start notmuch (hello) screen, evaluate
(notmuch-hello)")) (set-buffer-modified-p nil))'

debug log:

solving 923137b41de6 ...
found 923137b41de6 in https://yhetil.org/notmuch/1441608490-9413-1-git-send-email-tomi.ollila@iki.fi/

applying [1/1] https://yhetil.org/notmuch/1441608490-9413-1-git-send-email-tomi.ollila@iki.fi/
diff --git a/emacs/try-emacs-mua.sh b/emacs/try-emacs-mua.sh
new file mode 100755
index 000000000000..923137b41de6

Checking patch emacs/try-emacs-mua.sh...
Applied patch emacs/try-emacs-mua.sh cleanly.

index at:
100755 00623b8cf757d72ac675d56bcf6b96b1c80b8129	emacs/try-emacs-mua.sh

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

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