NeoMutt  2018-07-16 +1360-3df4a2
Teaching an old dog new tricks
DOXYGEN
edit.c File Reference

GUI basic built-in text editor. More...

#include "config.h"
#include <ctype.h>
#include <errno.h>
#include <locale.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include "mutt/mutt.h"
#include "email/lib.h"
#include "alias.h"
#include "context.h"
#include "curs_lib.h"
#include "globals.h"
#include "hdrline.h"
#include "mailbox.h"
#include "mutt_curses.h"
#include "mutt_header.h"
#include "mutt_window.h"
#include "muttlib.h"
#include "protos.h"
+ Include dependency graph for edit.c:

Go to the source code of this file.

Functions

static char ** be_snarf_data (FILE *fp, char **buf, int *bufmax, int *buflen, LOFF_T offset, int bytes, int prefix)
 Read data from a file into a buffer. More...
 
static char ** be_snarf_file (const char *path, char **buf, int *max, int *len, bool verbose)
 Read a file into a buffer. More...
 
static int be_barf_file (const char *path, char **buf, int buflen)
 Write a buffer to a file. More...
 
static void be_free_memory (char **buf, int buflen)
 Free an array of buffers. More...
 
static char ** be_include_messages (char *msg, char **buf, int *bufmax, int *buflen, int pfx, int inc_hdrs)
 Gather the contents of some messages. More...
 
static void be_print_header (struct Envelope *env)
 Print a message Header. More...
 
static void be_edit_header (struct Envelope *e, bool force)
 Edit the message headers. More...
 
int mutt_builtin_editor (const char *path, struct Email *msg, struct Email *cur)
 Show the user the built-in editor. More...
 

Variables

char * C_Escape
 Config: Escape character to use for functions in the built-in editor. More...
 
static char * EditorHelp1
 
static char * EditorHelp2
 

Detailed Description

GUI basic built-in text editor.

Authors
  • Michael R. Elkins

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file edit.c.

Function Documentation

static char** be_snarf_data ( FILE *  fp,
char **  buf,
int *  bufmax,
int *  buflen,
LOFF_T  offset,
int  bytes,
int  prefix 
)
static

Read data from a file into a buffer.

Parameters
[in]fpFile to read from
[out]bufBuffer allocated to save data
[out]bufmaxAllocated size of buffer
[out]buflenBytes of buffer used
[in]offsetStart reading at this file offset
[in]bytesRead this many bytes
[in]prefixIf true, prefix the lines with the C_IndentString
Return values
ptrPointer to allocated buffer

Definition at line 92 of file edit.c.

94 {
95  char tmp[8192];
96  char *p = tmp;
97  int tmplen = sizeof(tmp);
98 
99  tmp[sizeof(tmp) - 1] = '\0';
100  if (prefix)
101  {
102  mutt_str_strfcpy(tmp, C_IndentString, sizeof(tmp));
103  tmplen = mutt_str_strlen(tmp);
104  p = tmp + tmplen;
105  tmplen = sizeof(tmp) - tmplen;
106  }
107 
108  fseeko(fp, offset, SEEK_SET);
109  while (bytes > 0)
110  {
111  if (!fgets(p, tmplen - 1, fp))
112  break;
113  bytes -= mutt_str_strlen(p);
114  if (*bufmax == *buflen)
115  mutt_mem_realloc(&buf, sizeof(char *) * (*bufmax += 25));
116  buf[(*buflen)++] = mutt_str_strdup(tmp);
117  }
118  if (buf && (*bufmax == *buflen))
119  { /* Do not smash memory past buf */
120  mutt_mem_realloc(&buf, sizeof(char *) * (++*bufmax));
121  }
122  if (buf)
123  buf[*buflen] = NULL;
124  return buf;
125 }
WHERE char * C_IndentString
Config: String used to indent &#39;reply&#39; text.
Definition: globals.h:141
size_t mutt_str_strlen(const char *a)
Calculate the length of a string, safely.
Definition: string.c:662
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:124
size_t mutt_str_strfcpy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:741
char * mutt_str_strdup(const char *str)
Copy a string, safely.
Definition: string.c:383

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static char** be_snarf_file ( const char *  path,
char **  buf,
int *  max,
int *  len,
bool  verbose 
)
static

Read a file into a buffer.

Parameters
[in]pathFile to read
[out]bufBuffer allocated to save data
[out]maxAllocated size of buffer
[out]lenBytes of buffer used
[in]verboseIf true, report the file and bytes read
Return values
ptrPointer to allocated buffer

Definition at line 136 of file edit.c.

137 {
138  char tmp[1024];
139  struct stat sb;
140 
141  FILE *fp = fopen(path, "r");
142  if (fp)
143  {
144  fstat(fileno(fp), &sb);
145  buf = be_snarf_data(fp, buf, max, len, 0, sb.st_size, 0);
146  if (verbose)
147  {
148  snprintf(tmp, sizeof(tmp), "\"%s\" %lu bytes\n", path, (unsigned long) sb.st_size);
149  addstr(tmp);
150  }
151  mutt_file_fclose(&fp);
152  }
153  else
154  {
155  snprintf(tmp, sizeof(tmp), "%s: %s\n", path, strerror(errno));
156  addstr(tmp);
157  }
158  return buf;
159 }
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
Definition: file.c:149
static char ** be_snarf_data(FILE *fp, char **buf, int *bufmax, int *buflen, LOFF_T offset, int bytes, int prefix)
Read data from a file into a buffer.
Definition: edit.c:92

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int be_barf_file ( const char *  path,
char **  buf,
int  buflen 
)
static

Write a buffer to a file.

Parameters
[in]pathPath to write to
[out]bufBuffer to read from
[in]buflenLength of buffer
Return values
0Success
-1Error

Definition at line 169 of file edit.c.

170 {
171  FILE *fp = fopen(path, "w");
172  if (!fp)
173  {
174  addstr(strerror(errno));
175  addch('\n');
176  return -1;
177  }
178  for (int i = 0; i < buflen; i++)
179  fputs(buf[i], fp);
180  if (fclose(fp) == 0)
181  return 0;
182  printw("fclose: %s\n", strerror(errno));
183  return -1;
184 }

+ Here is the caller graph for this function:

static void be_free_memory ( char **  buf,
int  buflen 
)
static

Free an array of buffers.

Parameters
[out]bufBuffer to free
[in]buflenNumber of buffers to free

Definition at line 191 of file edit.c.

192 {
193  while (buflen-- > 0)
194  FREE(&buf[buflen]);
195  FREE(&buf);
196 }
#define FREE(x)
Definition: memory.h:40

+ Here is the caller graph for this function:

static char** be_include_messages ( char *  msg,
char **  buf,
int *  bufmax,
int *  buflen,
int  pfx,
int  inc_hdrs 
)
static

Gather the contents of some messages.

Parameters
[in]msgList of message numbers (space or comma separated)
[out]bufBuffer allocated to save data
[out]bufmaxAllocated size of buffer
[out]buflenBytes of buffer used
[in]pfxPrefix
[in]inc_hdrsIf true, include the message headers
Return values
ptrPointer to allocated buffer

Definition at line 208 of file edit.c.

210 {
211  int n;
212  // int offset, bytes;
213  char tmp[1024];
214 
215  if (!msg || !buf || !bufmax || !buflen)
216  return buf;
217 
218  while ((msg = strtok(msg, " ,")))
219  {
220  if ((mutt_str_atoi(msg, &n) == 0) && (n > 0) && (n <= Context->mailbox->msg_count))
221  {
222  n--;
223 
224  /* add the attribution */
225  if (C_Attribution)
226  {
227  setlocale(LC_TIME, NONULL(C_AttributionLocale));
228  mutt_make_string(tmp, sizeof(tmp) - 1, C_Attribution, Context,
230  setlocale(LC_TIME, "");
231  strcat(tmp, "\n");
232  }
233 
234  if (*bufmax == *buflen)
235  mutt_mem_realloc(&buf, sizeof(char *) * (*bufmax += 25));
236  buf[(*buflen)++] = mutt_str_strdup(tmp);
237 
238 #if 0
239  /* This only worked for mbox Mailboxes because they had Context->fp set.
240  * As that no longer exists, the code is now completely broken. */
241  bytes = Context->mailbox->emails[n]->content->length;
242  if (inc_hdrs)
243  {
244  offset = Context->mailbox->emails[n]->offset;
245  bytes += Context->mailbox->emails[n]->content->offset - offset;
246  }
247  else
248  offset = Context->mailbox->emails[n]->content->offset;
249  buf = be_snarf_data(Context->fp, buf, bufmax, buflen, offset, bytes, pfx);
250 #endif
251 
252  if (*bufmax == *buflen)
253  mutt_mem_realloc(&buf, sizeof(char *) * (*bufmax += 25));
254  buf[(*buflen)++] = mutt_str_strdup("\n");
255  }
256  else
257  printw(_("%d: invalid message number.\n"), n);
258  msg = NULL;
259  }
260  return buf;
261 }
struct Email ** emails
Definition: mailbox.h:100
The "current" mailbox.
Definition: context.h:37
#define NONULL(x)
Definition: string2.h:36
int mutt_str_atoi(const char *str, int *dst)
Convert ASCII string to an integer.
Definition: string.c:261
WHERE char * C_AttributionLocale
Config: Locale for dates in the attribution message.
Definition: globals.h:105
struct Body * content
list of MIME parts
Definition: email.h:93
LOFF_T offset
offset where the actual data begins
Definition: body.h:46
#define _(a)
Definition: message.h:28
static char ** be_snarf_data(FILE *fp, char **buf, int *bufmax, int *buflen, LOFF_T offset, int bytes, int prefix)
Read data from a file into a buffer.
Definition: edit.c:92
struct Mailbox * mailbox
Definition: context.h:51
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:124
LOFF_T length
length (in bytes) of attachment
Definition: body.h:47
LOFF_T offset
where in the stream does this message begin?
Definition: email.h:86
char * mutt_str_strdup(const char *str)
Copy a string, safely.
Definition: string.c:383
#define mutt_make_string(BUF, BUFLEN, S, CTX, M, E)
Definition: hdrline.h:59
WHERE char * C_Attribution
Config: Message to start a reply, "On DATE, PERSON wrote:".
Definition: globals.h:104

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void be_print_header ( struct Envelope env)
static

Print a message Header.

Parameters
envEnvelope to print

Definition at line 267 of file edit.c.

268 {
269  char tmp[8192];
270 
271  if (env->to)
272  {
273  addstr("To: ");
274  tmp[0] = '\0';
275  mutt_addr_write(tmp, sizeof(tmp), env->to, true);
276  addstr(tmp);
277  addch('\n');
278  }
279  if (env->cc)
280  {
281  addstr("Cc: ");
282  tmp[0] = '\0';
283  mutt_addr_write(tmp, sizeof(tmp), env->cc, true);
284  addstr(tmp);
285  addch('\n');
286  }
287  if (env->bcc)
288  {
289  addstr("Bcc: ");
290  tmp[0] = '\0';
291  mutt_addr_write(tmp, sizeof(tmp), env->bcc, true);
292  addstr(tmp);
293  addch('\n');
294  }
295  if (env->subject)
296  {
297  addstr("Subject: ");
298  addstr(env->subject);
299  addch('\n');
300  }
301  addch('\n');
302 }
struct Address * to
Definition: envelope.h:42
size_t mutt_addr_write(char *buf, size_t buflen, struct Address *addr, bool display)
Write an Address to a buffer.
Definition: address.c:1146
struct Address * bcc
Definition: envelope.h:44
char * subject
Definition: envelope.h:50
struct Address * cc
Definition: envelope.h:43

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void be_edit_header ( struct Envelope e,
bool  force 
)
static

Edit the message headers.

Parameters
eEmail
forceoverride the $ask* vars (used for the ~h command)

Definition at line 309 of file edit.c.

310 {
311  char tmp[8192];
312 
314 
315  addstr("To: ");
316  tmp[0] = '\0';
318  mutt_addr_write(tmp, sizeof(tmp), e->to, false);
319  if (!e->to || force)
320  {
321  if (mutt_enter_string(tmp, sizeof(tmp), 4, 0) == 0)
322  {
323  mutt_addr_free(&e->to);
324  e->to = mutt_addr_parse_list2(e->to, tmp);
325  e->to = mutt_expand_aliases(e->to);
326  mutt_addrlist_to_intl(e->to, NULL); /* XXX - IDNA error reporting? */
327  tmp[0] = '\0';
328  mutt_addr_write(tmp, sizeof(tmp), e->to, true);
330  }
331  }
332  else
333  {
334  mutt_addrlist_to_intl(e->to, NULL); /* XXX - IDNA error reporting? */
335  addstr(tmp);
336  }
337  addch('\n');
338 
339  if (!e->subject || force)
340  {
341  addstr("Subject: ");
342  mutt_str_strfcpy(tmp, e->subject ? e->subject : "", sizeof(tmp));
343  if (mutt_enter_string(tmp, sizeof(tmp), 9, 0) == 0)
344  mutt_str_replace(&e->subject, tmp);
345  addch('\n');
346  }
347 
348  if ((!e->cc && C_Askcc) || force)
349  {
350  addstr("Cc: ");
351  tmp[0] = '\0';
353  mutt_addr_write(tmp, sizeof(tmp), e->cc, false);
354  if (mutt_enter_string(tmp, sizeof(tmp), 4, 0) == 0)
355  {
356  mutt_addr_free(&e->cc);
357  e->cc = mutt_addr_parse_list2(e->cc, tmp);
358  e->cc = mutt_expand_aliases(e->cc);
359  tmp[0] = '\0';
360  mutt_addrlist_to_intl(e->cc, NULL);
361  mutt_addr_write(tmp, sizeof(tmp), e->cc, true);
363  }
364  else
365  mutt_addrlist_to_intl(e->cc, NULL);
366  addch('\n');
367  }
368 
369  if (C_Askbcc || force)
370  {
371  addstr("Bcc: ");
372  tmp[0] = '\0';
374  mutt_addr_write(tmp, sizeof(tmp), e->bcc, false);
375  if (mutt_enter_string(tmp, sizeof(tmp), 5, 0) == 0)
376  {
377  mutt_addr_free(&e->bcc);
378  e->bcc = mutt_addr_parse_list2(e->bcc, tmp);
379  e->bcc = mutt_expand_aliases(e->bcc);
380  mutt_addrlist_to_intl(e->bcc, NULL);
381  tmp[0] = '\0';
382  mutt_addr_write(tmp, sizeof(tmp), e->bcc, true);
384  }
385  else
386  mutt_addrlist_to_intl(e->bcc, NULL);
387  addch('\n');
388  }
389 }
struct Address * mutt_addr_parse_list2(struct Address *p, const char *s)
Parse a list of email addresses.
Definition: address.c:630
struct Address * to
Definition: envelope.h:42
int mutt_addrlist_to_intl(struct Address *a, char **err)
Convert an Address list to Punycode.
Definition: address.c:1208
size_t mutt_addr_write(char *buf, size_t buflen, struct Address *addr, bool display)
Write an Address to a buffer.
Definition: address.c:1146
int mutt_addrlist_to_local(struct Address *a)
Convert an Address list from Punycode.
Definition: address.c:1249
struct Address * bcc
Definition: envelope.h:44
size_t mutt_str_strfcpy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:741
void mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition: string.c:459
int mutt_window_mvaddstr(struct MuttWindow *win, int row, int col, const char *str)
Move the cursor and write a fixed string to a Window.
Definition: mutt_window.c:190
int mutt_window_move(struct MuttWindow *win, int row, int col)
Move the cursor in a Window.
Definition: mutt_window.c:162
char * subject
Definition: envelope.h:50
struct Address * mutt_expand_aliases(struct Address *a)
Expand aliases in a List of Addresses.
Definition: alias.c:297
int mutt_enter_string(char *buf, size_t buflen, int col, CompletionFlags flags)
Ask the user for a string.
Definition: enter.c:145
struct MuttWindow * MuttMessageWindow
Message Window.
Definition: mutt_window.c:41
void mutt_addr_free(struct Address **p)
Free a list of Addresses.
Definition: address.c:446
WHERE bool C_Askbcc
Config: Ask the user for the blind-carbon-copy recipients.
Definition: globals.h:204
WHERE bool C_Askcc
Config: Ask the user for the carbon-copy recipients.
Definition: globals.h:205
struct Address * cc
Definition: envelope.h:43

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mutt_builtin_editor ( const char *  path,
struct Email msg,
struct Email cur 
)

Show the user the built-in editor.

Parameters
pathFile to read
msgNew Email
curCurrent Email
Return values
0Success
-1Error

Definition at line 399 of file edit.c.

400 {
401  char **buf = NULL;
402  int bufmax = 0, buflen = 0;
403  char tmp[1024];
404  bool abort = false;
405  bool done = false;
406  char *p = NULL;
407 
408  scrollok(stdscr, true);
409 
410  be_edit_header(msg->env, false);
411 
412  addstr(_("(End message with a . on a line by itself)\n"));
413 
414  buf = be_snarf_file(path, buf, &bufmax, &buflen, false);
415 
416  tmp[0] = '\0';
417  while (!done)
418  {
419  if (mutt_enter_string(tmp, sizeof(tmp), 0, 0) == -1)
420  {
421  tmp[0] = '\0';
422  continue;
423  }
424  addch('\n');
425 
426  if (C_Escape && (tmp[0] == C_Escape[0]) && (tmp[1] != C_Escape[0]))
427  {
428  /* remove trailing whitespace from the line */
429  p = tmp + mutt_str_strlen(tmp) - 1;
430  while (p >= tmp && ISSPACE(*p))
431  *p-- = '\0';
432 
433  p = tmp + 2;
434  SKIPWS(p);
435 
436  switch (tmp[1])
437  {
438  case '?':
439  addstr(_(EditorHelp1));
440  addstr(_(EditorHelp2));
441  break;
442  case 'b':
443  msg->env->bcc = mutt_addr_parse_list2(msg->env->bcc, p);
444  msg->env->bcc = mutt_expand_aliases(msg->env->bcc);
445  break;
446  case 'c':
447  msg->env->cc = mutt_addr_parse_list2(msg->env->cc, p);
448  msg->env->cc = mutt_expand_aliases(msg->env->cc);
449  break;
450  case 'h':
451  be_edit_header(msg->env, true);
452  break;
453  case 'F':
454  case 'f':
455  case 'm':
456  case 'M':
457  if (Context)
458  {
459  if (!*p && cur)
460  {
461  /* include the current message */
462  p = tmp + mutt_str_strlen(tmp) + 1;
463  snprintf(tmp + mutt_str_strlen(tmp),
464  sizeof(tmp) - mutt_str_strlen(tmp), " %d", cur->msgno + 1);
465  }
466  buf = be_include_messages(p, buf, &bufmax, &buflen, (tolower(tmp[1]) == 'm'),
467  (isupper((unsigned char) tmp[1])));
468  }
469  else
470  addstr(_("No mailbox.\n"));
471  break;
472  case 'p':
473  addstr("-----\n");
474  addstr(_("Message contains:\n"));
475  be_print_header(msg->env);
476  for (int i = 0; i < buflen; i++)
477  addstr(buf[i]);
478  /* L10N: This entry is shown AFTER the message content,
479  not IN the middle of the content.
480  So it doesn't mean "(message will continue)"
481  but means "(press any key to continue using neomutt)". */
482  addstr(_("(continue)\n"));
483  break;
484  case 'q':
485  done = true;
486  break;
487  case 'r':
488  if (*p)
489  {
490  mutt_str_strfcpy(tmp, p, sizeof(tmp));
491  mutt_expand_path(tmp, sizeof(tmp));
492  buf = be_snarf_file(tmp, buf, &bufmax, &buflen, true);
493  }
494  else
495  addstr(_("missing filename.\n"));
496  break;
497  case 's':
498  mutt_str_replace(&msg->env->subject, p);
499  break;
500  case 't':
501  msg->env->to = mutt_addr_parse_list(msg->env->to, p);
502  msg->env->to = mutt_expand_aliases(msg->env->to);
503  break;
504  case 'u':
505  if (buflen)
506  {
507  buflen--;
508  mutt_str_strfcpy(tmp, buf[buflen], sizeof(tmp));
509  tmp[mutt_str_strlen(tmp) - 1] = '\0';
510  FREE(&buf[buflen]);
511  buf[buflen] = NULL;
512  continue;
513  }
514  else
515  addstr(_("No lines in message.\n"));
516  break;
517 
518  case 'e':
519  case 'v':
520  if (be_barf_file(path, buf, buflen) == 0)
521  {
522  const char *tag = NULL;
523  char *err = NULL;
524  be_free_memory(buf, buflen);
525  buf = NULL;
526  bufmax = 0;
527  buflen = 0;
528 
529  if (C_EditHeaders)
530  {
531  mutt_env_to_local(msg->env);
532  mutt_edit_headers(NONULL(C_Visual), path, msg, NULL, 0);
533  if (mutt_env_to_intl(msg->env, &tag, &err))
534  printw(_("Bad IDN in '%s': '%s'"), tag, err);
535  /* tag is a statically allocated string and should not be freed */
536  FREE(&err);
537  }
538  else
540 
541  buf = be_snarf_file(path, buf, &bufmax, &buflen, false);
542 
543  addstr(_("(continue)\n"));
544  }
545  break;
546  case 'w':
547  be_barf_file(*p ? p : path, buf, buflen);
548  break;
549  case 'x':
550  abort = true;
551  done = true;
552  break;
553  default:
554  printw(_("%s: unknown editor command (~? for help)\n"), tmp);
555  break;
556  }
557  }
558  else if (mutt_str_strcmp(".", tmp) == 0)
559  done = true;
560  else
561  {
562  mutt_str_strcat(tmp, sizeof(tmp), "\n");
563  if (buflen == bufmax)
564  mutt_mem_realloc(&buf, sizeof(char *) * (bufmax += 25));
565  buf[buflen++] = mutt_str_strdup(tmp[1] == '~' ? tmp + 1 : tmp);
566  }
567 
568  tmp[0] = '\0';
569  }
570 
571  if (!abort)
572  be_barf_file(path, buf, buflen);
573  be_free_memory(buf, buflen);
574 
575  return abort ? -1 : 0;
576 }
The "current" mailbox.
Definition: context.h:37
struct Address * mutt_addr_parse_list2(struct Address *p, const char *s)
Parse a list of email addresses.
Definition: address.c:630
#define NONULL(x)
Definition: string2.h:36
struct Address * to
Definition: envelope.h:42
#define _(a)
Definition: message.h:28
size_t mutt_str_strlen(const char *a)
Calculate the length of a string, safely.
Definition: string.c:662
int mutt_env_to_intl(struct Envelope *env, const char **tag, char **err)
Convert an Envelope&#39;s Address fields to Punycode format.
Definition: envelope.c:238
char * mutt_expand_path(char *buf, size_t buflen)
Create the canonical path.
Definition: muttlib.c:157
static void be_edit_header(struct Envelope *e, bool force)
Edit the message headers.
Definition: edit.c:309
WHERE bool C_EditHeaders
Config: Let the user edit the email headers whilst editing an email.
Definition: globals.h:216
struct Envelope * env
envelope information
Definition: email.h:92
#define SKIPWS(ch)
Definition: string2.h:46
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:124
struct Address * bcc
Definition: envelope.h:44
static char ** be_snarf_file(const char *path, char **buf, int *max, int *len, bool verbose)
Read a file into a buffer.
Definition: edit.c:136
struct Address * mutt_addr_parse_list(struct Address *top, const char *s)
Parse a list of email addresses.
Definition: address.c:465
size_t mutt_str_strfcpy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:741
void mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition: string.c:459
#define ISSPACE(ch)
Definition: string2.h:37
static char ** be_include_messages(char *msg, char **buf, int *bufmax, int *buflen, int pfx, int inc_hdrs)
Gather the contents of some messages.
Definition: edit.c:208
char * mutt_str_strcat(char *buf, size_t buflen, const char *s)
Concatenate two strings.
Definition: string.c:401
void mutt_env_to_local(struct Envelope *env)
Convert an Envelope&#39;s Address fields to local format.
Definition: envelope.c:203
static char * EditorHelp2
Definition: edit.c:70
char * C_Escape
Config: Escape character to use for functions in the built-in editor.
Definition: edit.c:54
char * subject
Definition: envelope.h:50
struct Address * mutt_expand_aliases(struct Address *a)
Expand aliases in a List of Addresses.
Definition: alias.c:297
static void be_print_header(struct Envelope *env)
Print a message Header.
Definition: edit.c:267
char * mutt_str_strdup(const char *str)
Copy a string, safely.
Definition: string.c:383
void mutt_edit_headers(const char *editor, const char *body, struct Email *msg, char *fcc, size_t fcclen)
Let the user edit the message header and body.
Definition: mutt_header.c:171
int mutt_enter_string(char *buf, size_t buflen, int col, CompletionFlags flags)
Ask the user for a string.
Definition: enter.c:145
#define FREE(x)
Definition: memory.h:40
void mutt_edit_file(const char *editor, const char *file)
Let the user edit a file.
Definition: curs_lib.c:308
int mutt_str_strcmp(const char *a, const char *b)
Compare two strings, safely.
Definition: string.c:611
static int be_barf_file(const char *path, char **buf, int buflen)
Write a buffer to a file.
Definition: edit.c:169
struct Address * cc
Definition: envelope.h:43
int msgno
number displayed to the user
Definition: email.h:89
WHERE char * C_Visual
Config: Editor to use when &#39;~v&#39; is given in the built-in editor.
Definition: globals.h:154
static char * EditorHelp1
Definition: edit.c:59
static void be_free_memory(char **buf, int buflen)
Free an array of buffers.
Definition: edit.c:191

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

char* C_Escape

Config: Escape character to use for functions in the built-in editor.

Definition at line 54 of file edit.c.

char* EditorHelp1
static
Initial value:
=
N_("~~ insert a line beginning with a single ~\n"
"~b users add users to the Bcc: field\n"
"~c users add users to the Cc: field\n"
"~f messages include messages\n"
"~F messages same as ~f, except also include headers\n"
"~h edit the message header\n"
"~m messages include and quote messages\n"
"~M messages same as ~m, except include headers\n"
"~p print the message\n")
#define N_(a)
Definition: message.h:32

Definition at line 59 of file edit.c.

char* EditorHelp2
static
Initial value:
=
N_("~q write file and quit editor\n"
"~r file read a file into the editor\n"
"~t users add users to the To: field\n"
"~u recall the previous line\n"
"~v edit message with the $visual editor\n"
"~w file write message to file\n"
"~x abort changes and quit editor\n"
"~? this message\n"
". on a line by itself ends input\n")
#define N_(a)
Definition: message.h:32

Definition at line 70 of file edit.c.