summary refs log tree commit diff stats
path: root/widgets/compose.go
Commit message (Expand)AuthorAgeFilesLines
* Add recall commandJeffas2020-04-241-1/+1
* Add postpone commandJeffas2020-04-241-19/+25
* Remove ability to specify headers in the editorReto Brunner2020-04-241-147/+42
* compose: add space between headers and editorDrew DeVault2020-03-031-3/+5
* Correct spellingReto Brunner2020-01-161-1/+1
* remove Original* checkLeszek Cimała2020-01-091-2/+1
* create OriginalMail structLeszek Cimała2020-01-091-2/+3
* Add address book completion in composerBen Burwell2019-12-211-3/+20
* Composer: fix EOF errorsDrew DeVault2019-12-121-6/+10
* remove garbage headers in reply messageLeszek Cimała2019-12-081-1/+2
* Parse headers from templateRobert Günzler2019-12-071-3/+50
* Revert "Parse headers from template"Drew DeVault2019-12-041-39/+3
* Parse headers from templateRobert Günzler2019-12-041-3/+39
* Allow fields in compose widget to be clickedGreg Anders2019-11-171-2/+32
* Add some defaults for template optionsDrew DeVault2019-11-101-2/+4
* Add Templates with ParsingSrivathsan Murali2019-11-101-3/+34
* Add signaturesJeffas2019-09-121-1/+65
* Add MouseableJeffas2019-09-111-4/+17
* widgets: rewrite references to os.SET_SEEK to io.SeekStartWagner Riffel2019-09-041-4/+4
* Add forwarding as attachment featureJelle Besseling2019-08-201-0/+9
* Add addresses argument to forward commandJelle Besseling2019-08-201-0/+7
* Allow cc/bcc command to receive no argumentsDaniel Bridges2019-08-071-0/+17
* cc/bcc: Append to existing headers if called twiceKevin Kuehler2019-08-071-1/+6
* Add cc and bcc commandsDaniel Bridges2019-08-031-14/+44
* Fix sending attachments with less than 512 bytesBen Burwell2019-08-021-1/+1
* Include body MIME terminator in multipart messagesBen Burwell2019-08-021-23/+30
* Add :detach commandGalen Abell2019-07-271-0/+20
* Fix review message not filling entire spaceGalen Abell2019-07-271-1/+1
* Add command history and cyclingGalen Abell2019-07-261-2/+7
* Support configurable header layout in compose widgetDaniel Bridges2019-07-261-113/+138
* Add [a]ttach to the review message promptsDrew DeVault2019-07-191-1/+1
* Add Unix socket for communicating with aercDrew DeVault2019-07-191-0/+7
* Add :attach command for composeGalen Abell2019-07-191-17/+129
* When reviewing an email don't pass characters onJeffas2019-07-171-1/+4
* Use go-message implementation of GenerateMessageIDBen Burwell2019-07-041-2/+1
* Reopening mailcontent file to fix #166Stefan Rakel2019-06-271-1/+7
* Fix Cc & Bcc handling in repliesDrew DeVault2019-06-211-7/+7
* Execute the editor with the shellDrew DeVault2019-06-071-1/+1
* Use SetAddressList for From headerDrew DeVault2019-06-051-2/+10
* Enumerate Cc and Bcc lists in composerDrew DeVault2019-06-021-1/+20
* Implement :edit in compose screenDrew DeVault2019-05-261-27/+51
* Fix special characters in address.PersonalNameDrew DeVault2019-05-251-6/+9
* s/aerc2/aerc/gDrew DeVault2019-05-171-4/+4
* Fix date header on outgoing emailsDrew DeVault2019-05-171-1/+1
* Decode email when reading it for quotingDrew DeVault2019-05-161-0/+1
* Implement :reply -q and :reply -aDrew DeVault2019-05-161-0/+9
* Implement (basic form) of :replyDrew DeVault2019-05-161-3/+11
* Let caller pass in custom headers to composeDrew DeVault2019-05-161-6/+32
* Copy sent emails to the Sent folderDrew DeVault2019-05-151-1/+9
* Update tab name as subject changesDrew DeVault2019-05-141-0/+12
lt;vc@akkartik.com> 2016-08-27 20:49:03 -0700 3266' href='/akkartik/mu/commit/html/044space_surround.cc.html?h=main&id=cd9bb850caeca88747a25436fc65c67c6d5cd89a'>cd9bb850 ^
d009e158 ^
672e3e50 ^
d990e8f0 ^


672e3e50 ^



a654e4ec ^


d009e158 ^
672e3e50 ^

a654e4ec ^
4690ce81 ^
672e3e50 ^
a654e4ec ^
672e3e50 ^


a654e4ec ^
d059fe74 ^
4690ce81 ^

2f02189d ^
76755b28 ^
65361948 ^
672e3e50 ^


c5ffb6e1 ^

3e1349d2 ^
f344b250 ^
c5ffb6e1 ^
672e3e50 ^


a654e4ec ^
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



                                                                                          
                                        

                                                
                                  

                                                                                         

                       
                                                                                                 
                                                                                            

                                      
                             
                             
                            

                              
                                  
                                                                           
                               

        





                               

       
                         







                                                                                                                
                                        
                                                                                          

                                                                                                                                                       
                                                                                          

                                                                                                                                                       
                                                            



                                                                                                                                                                                                                  
 
                                                                                                             
 
                                                                        
                                                                  
                                                                                                    
                                                                  
                                                                                                                         
                                                                  
 


                                                                                                                                                                                                                                                                                                                                                                                                        



                                                                                                        


                                                                                                                                                                                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                        

                                
                                                                                                                                                                                                                                                                                                                                            
                                                                                                                                               
                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          


                                                                               
                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                                                                                                    

                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                                                      
                                    


                                                                                                        

                                                                        
                                        
                                                                                                               
 


       
                                     
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - 044space_surround.cc</title>
<meta name="Generator" content="Vim/7.4">
<meta name="plugin-version" content="vim7.4_v2">
<meta name="syntax" content="cpp">
<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy=">
<meta name="colorscheme" content="minimal">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; }
body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; }
* { font-size: 12pt; font-size: 1em; }
.Constant { color: #00a0a0; }
.cSpecial { color: #008000; }
.muRecipe { color: #ff8700; }
.Comment { color: #9090ff; }
.Delimiter { color: #800080; }
.Special { color: #c00000; }
.traceContains { color: #008000; }
.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; }
.Identifier { color: #c0a020; }
-->
</style>

<script type='text/javascript'>
<!--

-->
</script>
</head>
<body>
<pre id='vimCodeElement'>
<span class="Comment">//: So far you can have global variables by not setting default-space, and</span>
<span class="Comment">//: local variables by setting default-space. You can isolate variables</span>
<span class="Comment">//: between those extremes by creating 'surrounding' spaces.</span>
<span class="Comment">//:</span>
<span class="Comment">//: (Surrounding spaces are like lexical scopes in other languages.)</span>

<span class="Delimiter">:(scenario surrounding_space)</span>
<span class="Comment"># location 1 in space 1 refers to the space surrounding the default space, here 20.</span>
<span class="muRecipe">def</span> main [
  <span class="Comment"># pretend address:array:location; in practice we'll use new</span>
  <span class="Constant">10</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>  <span class="Comment"># refcount</span>
  <span class="Constant">11</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">5</span>  <span class="Comment"># length</span>
  <span class="Comment"># pretend address:array:location; in practice we'll use new</span>
  <span class="Constant">20</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>  <span class="Comment"># refcount</span>
  <span class="Constant">21</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">5</span>  <span class="Comment"># length</span>
  <span class="Comment"># actual start of this recipe</span>
  <span class="Normal">default</span>-space:space<span class="Special"> &lt;- </span>copy <span class="Constant">10</span>/unsafe
  <span class="Constant">0</span>:space/names:dummy<span class="Special"> &lt;- </span>copy <span class="Constant">20</span>/unsafe  <span class="Comment"># later layers will explain the /names: property</span>
  <span class="Constant">1</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">32</span>
  <span class="Constant">1</span>:num/space:<span class="Constant">1</span><span class="Special"> &lt;- </span>copy <span class="Constant">33</span>
]
<span class="muRecipe">def</span> dummy [  <span class="Comment"># just for the /names: property above</span>
]
<span class="Comment"># chain space: 10 + (refcount and length) 2</span>
<span class="traceContains">+mem: storing 20 in location 12</span>
<span class="Comment"># store to default space: 10 + (skip refcount and length) 2 + (index) 1</span>
<span class="traceContains">+mem: storing 32 in location 13</span>
<span class="Comment"># store to chained space: (contents of location 12) 20 + (refcount and length) 2 + (index) 1</span>
<span class="traceContains">+mem: storing 33 in location 23</span>

<span class="Delimiter">:(before &quot;End Checks For Reclaiming Locals&quot;)</span>
<span class="Normal">if</span> <span class="Delimiter">(</span>space_index<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">))</span> &gt; <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span>

<span class="Comment">//: If you think of a space as a collection of variables with a common</span>
<span class="Comment">//: lifetime, surrounding allows managing shorter lifetimes inside a longer</span>
<span class="Comment">//: one.</span>

<span class="Delimiter">:(replace{} &quot;int space_base(const reagent&amp; x)&quot;)</span>
<span class="Normal">int</span> space_base<span class="Delimiter">(</span><span class="Normal">const</span> reagent&amp; x<span class="Delimiter">)</span> <span class="Delimiter">{</span>
  <span class="Normal">int</span> base = current_call<span class="Delimiter">().</span>default_space ? <span class="Delimiter">(</span>current_call<span class="Delimiter">().</span>default_space+<span class="Comment">/*</span><span class="Comment">skip refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">)</span> : <span class="Constant">0</span><span class="Delimiter">;</span>
  <span class="Identifier">return</span> space_base<span class="Delimiter">(</span>x<span class="Delimiter">,</span> space_index<span class="Delimiter">(</span>x<span class="Delimiter">),</span> base<span class="Delimiter">);</span>
<span class="Delimiter">}</span>

<span class="Normal">int</span> space_base<span class="Delimiter">(</span><span class="Normal">const</span> reagent&amp; x<span class="Delimiter">,</span> <span class="Normal">int</span> space_index<span class="Delimiter">,</span> <span class="Normal">int</span> base<span class="Delimiter">)</span> <span class="Delimiter">{</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>space_index == <span class="Constant">0</span><span class="Delimiter">)</span>
    <span class="Identifier">return</span> base<span class="Delimiter">;</span>
  <span class="Normal">int</span> result = space_base<span class="Delimiter">(</span>x<span class="Delimiter">,</span> space_index-<span class="Constant">1</span><span class="Delimiter">,</span> get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> base+<span class="Comment">/*</span><span class="Comment">skip length</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">))</span>+<span class="Comment">/*</span><span class="Comment">skip refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">;</span>
  <span class="Identifier">return</span> result<span class="Delimiter">;</span>
<span class="Delimiter">}</span>

<span class="Normal">int</span> space_index<span class="Delimiter">(</span><span class="Normal">const</span> reagent&amp; x<span class="Delimiter">)</span> <span class="Delimiter">{</span>
  <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span>  i &lt; SIZE<span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties<span class="Delimiter">);</span>  ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span>
    <span class="Normal">if</span> <span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>first == <span class="Constant">&quot;space&quot;</span><span class="Delimiter">)</span> <span class="Delimiter">{</span>
      <span class="Normal">if</span> <span class="Delimiter">(</span>!x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>second || x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>second<span class="Delimiter">-&gt;</span>right<span class="Delimiter">)</span>
        raise &lt;&lt; maybe<span class="Delimiter">(</span>current_recipe_name<span class="Delimiter">())</span> &lt;&lt; <span class="Constant">&quot;/space metadata should take exactly one value in '&quot;</span> &lt;&lt; x<span class="Delimiter">.</span>original_string &lt;&lt; <span class="Constant">&quot;'</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; end<span class="Delimiter">();</span>
      <span class="Identifier">return</span> to_integer<span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>second<span class="Delimiter">-&gt;</span>value<span class="Delimiter">);</span>
    <span class="Delimiter">}</span>
  <span class="Delimiter">}</span>
  <span class="Identifier">return</span> <span class="Constant">0</span><span class="Delimiter">;</span>
<span class="Delimiter">}</span>

<span class="Delimiter">:(scenario permit_space_as_variable_name)</span>
<span class="muRecipe">def</span> main [
  <span class="Normal">space</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>
]
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->