/[mailutils]/mailutils/mail/visual.c
ViewVC logotype

Diff of /mailutils/mail/visual.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by polak, Mon Dec 23 22:01:34 2002 UTC revision 1.9 by gray, Sun Dec 29 13:37:43 2002 UTC
# Line 21  Line 21 
21   * v[isual] [msglist]   * v[isual] [msglist]
22   */   */
23    
24    static int
25    visual0 (msgset_t *mspec, message_t msg, void *data)
26    {
27      attribute_t attr = NULL;
28      char *file = mu_tempname (NULL);
29    
30      util_do_command ("copy %s", file);
31      util_do_command ("shell %s %s", getenv("VISUAL"), file);
32    
33      remove (file);
34      free (file);
35    
36      /* Mark as read */
37      message_get_attribute (msg, &attr);
38      attribute_set_read (attr);
39    
40      cursor = mspec->msg_part[0];
41      
42      return 0;
43    }
44    
45  int  int
46  mail_visual (int argc, char **argv)  mail_visual (int argc, char **argv)
47  {  {
48    if (argc > 1)    return util_foreach_msg (argc, argv, MSG_NODELETED, visual0, NULL);
     return util_msglist_command (mail_visual, argc, argv, 1);  
   else  
     {  
       message_t msg = NULL;  
       attribute_t attr = NULL;  
       char *file = mu_tempname (NULL);  
   
       util_do_command ("copy %s", file);  
       util_do_command ("shell %s %s", getenv("VISUAL"), file);  
   
       remove (file);  
       free (file);  
   
       /* Mark as read */  
       mailbox_get_message (mbox, cursor, &msg);  
       message_get_attribute (msg, &attr);  
       attribute_set_read (attr);  
   
       return 0;  
     }  
   return 1;  
49  }  }
50    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26