Changeset d36f2cb for functions.c


Ignore:
Timestamp:
Jun 29, 2002, 7:42:37 PM (22 years ago)
Author:
Erik Nygren <nygren@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
8ee73f8d
Parents:
7360fab
Message:
	Added variables edit:maxfillcols and edit:maxwrapcols which
	        will limit how wide editing paragraphs may get before
		they get wrapped.  Default is 70 columns each.
	Added smartzpunt command with key binding of "C-x k".
	        This starts a zpunt command filled in with
		the proposed zpunt.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r7360fab rd36f2cb  
    218218                         skip_deleted?" non-deleted":"",
    219219                         filter?" in ":"", filter?filter:"");
    220     owl_function_beep();
     220    if (!skip_deleted) owl_function_beep();
    221221  }
    222222
     
    267267                         skip_deleted?" non-deleted":"",
    268268                         filter?" in ":"", filter?filter:"");
    269     owl_function_beep();
     269    if (!skip_deleted) owl_function_beep();
    270270  }
    271271
     
    18431843}
    18441844
     1845void owl_function_smartzpunt(int type) {
     1846  /* Starts a zpunt command based on the current class,instance pair.
     1847   * If type=0, uses just class.  If type=1, uses instance as well. */
     1848  owl_view *v;
     1849  owl_message *m;
     1850  char *cmd, *cmdprefix, *mclass, *minst;
     1851 
     1852  v=owl_global_get_current_view(&g);
     1853  m=owl_view_get_element(v, owl_global_get_curmsg(&g));
     1854
     1855  if (owl_view_get_size(v)==0) {
     1856    owl_function_makemsg("No message selected\n");
     1857    return;
     1858  }
     1859
     1860  /* for now we skip admin messages. */
     1861  if (owl_message_is_admin(m)
     1862      || owl_message_is_login(m)
     1863      || !owl_message_is_zephyr(m)) {
     1864    owl_function_makemsg("smartzpunt doesn't support this message type.");
     1865    return;
     1866  }
     1867
     1868  mclass = owl_message_get_class(m);
     1869  minst = owl_message_get_instance(m);
     1870  if (!mclass || !*mclass || *mclass==' '
     1871      || (!strcasecmp(mclass, "message") && !strcasecmp(minst, "personal"))
     1872      || (type && (!minst || !*minst|| *minst==' '))) {
     1873    owl_function_makemsg("smartzpunt can't safely do this for <%s,%s>",
     1874                         mclass, minst);
     1875  } else {
     1876    cmdprefix = "start-command zpunt ";
     1877    cmd = owl_malloc(strlen(cmdprefix)+strlen(mclass)+strlen(minst)+3);
     1878    strcpy(cmd, cmdprefix);
     1879    strcat(cmd, mclass);
     1880    if (type) {
     1881      strcat(cmd, " ");
     1882      strcat(cmd, minst);
     1883    } else {
     1884      strcat(cmd, " *");
     1885    }
     1886    owl_function_command(cmd);
     1887    owl_free(cmd);
     1888  }
     1889}
     1890
     1891
     1892
    18451893void owl_function_color_current_filter(char *color) {
    18461894  owl_filter *f;
Note: See TracChangeset for help on using the changeset viewer.