about summary refs log tree commit diff stats
path: root/commands/account/compose.go
blob: aeb415e084d4da80afd92fc6f5a06b5bd71feef9 (plain) (blame)
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
package account

import (
	"errors"

	"git.sr.ht/~sircmpwn/aerc/widgets"
)

func init() {
	register("compose", Compose)
}

// TODO: Accept arguments for default headers, message body
func Compose(aerc *widgets.Aerc, args []string) error {
	if len(args) != 1 {
		return errors.New("Usage: compose")
	}
	acct := aerc.SelectedAccount()
	composer := widgets.NewComposer(
		aerc.Config(), acct.AccountConfig(), acct.Worker())
	tab := aerc.NewTab(composer, "New email")
	composer.OnSubjectChange(func(subject string) {
		if subject == "" {
			tab.Name = "New email"
		} else {
			tab.Name = subject
		}
		tab.Content.Invalidate()
	})
	return nil
}
an class="na">align="right"><A HREF="../v3-toc2.html">Back to Table of Contents</A> <TR><TD align="right"><A HREF="preface.html"><STRONG>BACK</STRONG></A> chapter thread <A HREF="../v3ch1/v3ch1.html"><STRONG>NEXT</STRONG></A> <TR><TD align="right"><A HREF="https://mitpress.mit.edu/books/computer-science-logo-style-second-edition-volume-3">MIT Press web page for <CITE>Computer Science Logo Style</CITE></A> </TABLE></TABLE> <HR> <P> As for the previous two volumes, my greatest debts are to Hal Abelson and Paul Goldenberg. Both of them read the manuscript carefully through several drafts. Hal is great at noticing the large problems; he makes comments like &quot;throw out this whole chapter&quot; and &quot;you are putting the cart before the horse here.&quot; Paul's comments were generally on a more detailed level, pointing out sections in which potentially valuable content was sabotaged by a presentation that nobody would understand. Together they have improved the book enormously. <P>Some of the examples in this book are ones that were posed to me by other people in other contexts. Horacio Reggini raised the issue of listing (not merely counting) the combinations of <EM>r</EM> elements of a list; Dick White asked me to investigate just how secure the Simplex lock is; Chris Anderson taught the probability class where the question about multinomial expansions arose. I'm grateful to Anita Harnadek, whom I've never met, for a logic problem I use to demonstrate inference systems. (She is, by the way, the author of a fantastic textbook called <EM>Critical Thinking</EM> that I recommend to teachers of almost any subject: math, English, or social studies.) Jim Davis's Logo interpreter in Logo (in the <EM>LogoWorks</EM> anthology I co-edited) was an inspiration for the Pascal compiler. <P> I'm grateful to Dan Bobrow, Sherry Turkle, and Terry Winograd for permission to quote from their work here. In particular, Bobrow's doctoral thesis forms the basis for my chapter on artificial intelligence, and I'm grateful for the program design as well as my extensive quotations from the thesis itself. He was also very patient in answering technical questions about details of a program he wrote over 20 years ago. <P> Mike Clancy taught me about generating functions and used them to find the closed form definition for the multinomial problem; Michael Somos, via the <CODE>sci.math</CODE> newsgroup, provided the closed form solution to the Simplex lock problem. Paul Hilfinger straightened me out about parser complexity. <P> <P><A HREF="../v3-toc2.html">(back to Table of Contents)</A> <P><A HREF="preface.html"><STRONG>BACK</STRONG></A> chapter thread <A HREF="../v3ch1/v3ch1.html"><STRONG>NEXT</STRONG></A> <P> <ADDRESS> <A HREF="../index.html">Brian Harvey</A>, <CODE>bh@cs.berkeley.edu</CODE> </ADDRESS> </BODY> </HTML>