unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 480b16a77acbb48f44a8313b7a4dcc95b896d057 2872 bytes (raw)
name: devel/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
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
 
#!/bin/sh

# This script offers an easy way to try and experiment with the
# notmuch emacs client provided in notmuch/emacs 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 ;;
	*\\*)	echo "'$0' contain one or more '\\'s" >&2; exit 1 ;;
	*/*)	d0=${0%/*} ;;
	*)	d0=.
esac

pwd=$PWD
cd "$d0"/..
nmd=$PWD
emd=$PWD/emacs

test -f "$emd"/notmuch-lib.el || {
	echo "Cannot find notmuch-emacs source directory" >&2
	exit 1
}

case `exec 2>&1 "${EMACS:-emacs}" -Q --batch -eval \
	'(message (if (boundp '\''load-prefer-newer) "<-yes->" "<-no->"))'`
in (*'<-no->'*)
	allnew=true
	for elc in "$emd"/*.elc
	do
		test -f "$elc" || continue
		if test "$elc" -ot "${elc%c}"
		then
			echo "'$elc' is older than '${elc%c}'" >&2
			allnew=false
		fi
	done
	$allnew || {
		exec >&2
		echo
		echo "In directory '$emd' there are .elc files that are"
		echo "older than their corresponding .el files."
		echo "Please remove (or recompile) these older files and try again."
		echo
		exit 1
	}
	unset allnew
esac

if test -x "$nmd"/notmuch
then
	nmin='
To use accompanied notmuch binary from the same source, evaluate
(setq exec-path (cons \"'"$nmd"'\" exec-path))
Note: Evaluating the above may be followed by unintended database
upgrade and getting back to old version may require dump & restore.
'
else
	nmin=
fi

if test "$opt" = '-q' || test "$opt" = '-Q'
then
	qin='
If you want to load your .emacs startup file now, evaluate
(load \"~/.emacs\")

If you want to use packages (e.g. company from elpa) evaluate
(progn (require '\''package) (package-initialize))
'
else
	qin='
To view initialization time messages, evaluate
(pop-to-buffer \"*Messages*\")
'
fi

cd "$pwd"

exec "${EMACS:-emacs}" $opt --debug-init -L "$emd" --eval '
(with-current-buffer "*scratch*"
  (if (featurep '\''notmuch)
      (insert "
Notmuch has been loaded to this emacs (during processing of the init file)
which means it is (most probably) loaded from different source than expected.

Please rerun \"'"$0"'\" with '"'q'"' to disable
processing of the init file -- you can load it after emacs has started.\n\n")
    (let ((load-prefer-newer t)) (load "notmuch" t))
    (insert "
Go to the end of the following lines and type C-x C-e to evaluate
(or C-j which is shorter but inserts evaluation results into buffer)

To \"disable\" mail sending, evaluate
(setq message-send-mail-function (lambda () t))
'"$nmin$qin"'
To start notmuch (hello) screen, evaluate
(notmuch-hello)")) (set-buffer-modified-p nil))' "$@"

debug log:

solving e8406e3cb143 ...
found e8406e3cb143 in https://yhetil.org/notmuch/1447457397-11688-1-git-send-email-tomi.ollila@iki.fi/

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

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

index at:
100755 480b16a77acbb48f44a8313b7a4dcc95b896d057	devel/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).