Changeset 70110286 for functions.c


Ignore:
Timestamp:
May 12, 2009, 11:25:10 PM (16 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
bd783db
Parents:
e1b136bf
Message:
Implement mark and swap.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r0cb6c26 r70110286  
    35323532  sigprocmask(SIG_UNBLOCK, &intr, oldmask);
    35333533}
     3534
     3535void _owl_function_mark_message(owl_message *m)
     3536{
     3537  if (m)
     3538    owl_global_set_markedmsgid(&g, owl_message_get_id(m));
     3539}
     3540
     3541void owl_function_mark_message()
     3542{
     3543  owl_message *m;
     3544  owl_view *v;
     3545
     3546  v=owl_global_get_current_view(&g);
     3547
     3548  /* bail if there's no current message */
     3549  if (owl_view_get_size(v) < 1) {
     3550    owl_function_error("No messages to mark");
     3551    return;
     3552  }
     3553
     3554  /* mark the message */
     3555  m=owl_view_get_element(v, owl_global_get_curmsg(&g));
     3556  _owl_function_mark_message(m);
     3557}
     3558
     3559void owl_function_swap_cur_marked()
     3560{
     3561  int marked_id;
     3562  owl_message *m;
     3563  owl_view *v;
     3564
     3565  v=owl_global_get_current_view(&g);
     3566  /* bail if there's no current message */
     3567  if (owl_view_get_size(v) < 1) {
     3568    return;
     3569  }
     3570  m=owl_view_get_element(v, owl_global_get_curmsg(&g));
     3571  marked_id=owl_global_get_markedmsgid(&g);
     3572
     3573  _owl_function_mark_message(m);
     3574
     3575  owl_global_set_curmsg(&g, owl_view_get_nearest_to_msgid(v, marked_id));
     3576  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
     3577  owl_global_set_direction_downwards(&g);
     3578}
Note: See TracChangeset for help on using the changeset viewer.