]> granicus.if.org Git - neomutt/commitdiff
menu: unify api function params
authorRichard Russon <rich@flatcap.org>
Wed, 26 Sep 2018 23:41:32 +0000 (00:41 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 27 Sep 2018 00:01:37 +0000 (01:01 +0100)
15 files changed:
addrbook.c
browser.c
compose.c
curs_main.c
curs_main.h
menu.c
mutt_attach.h
mutt_history.c
ncrypt/crypt_gpgme.c
ncrypt/pgpkey.c
ncrypt/smime.c
pager.c
postpone.c
query.c
recvattach.c

index daa2a5032cb0cff944cf2560d4b96360c99b453a..6297f4b108efa4502fa6a2fc7e35bb01784e9b74 100644 (file)
@@ -105,32 +105,24 @@ static const char *alias_format_str(char *buf, size_t buflen, size_t col, int co
 }
 
 /**
- * alias_make_entry - Format a menu item for the alias list
- * @param[out] buf    Buffer in which to save string
- * @param[in]  buflen Buffer length
- * @param[in]  menu   Menu containing aliases
- * @param[in]  num    Index into the menu
+ * alias_make_entry - Format a menu item for the alias list - Implements Menu::menu_make_entry()
  */
-static void alias_make_entry(char *buf, size_t buflen, struct Menu *menu, int num)
+static void alias_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
 {
   mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(AliasFormat), alias_format_str,
-                      (unsigned long) ((struct Alias **) menu->data)[num],
+                      (unsigned long) ((struct Alias **) menu->data)[line],
                       MUTT_FORMAT_ARROWCURSOR);
 }
 
 /**
- * alias_tag - Tag some aliases
- * @param menu Menu
- * @param n    Current selection
- * @param m    Current number of tagged aliases
- * @retval num How man more aliases are now tagged?
+ * alias_tag - Tag some aliases - Implements Menu::menu_tag()
  */
-static int alias_tag(struct Menu *menu, int n, int m)
+static int alias_tag(struct Menu *menu, int sel, int act)
 {
-  struct Alias *cur = ((struct Alias **) menu->data)[n];
+  struct Alias *cur = ((struct Alias **) menu->data)[sel];
   bool ot = cur->tagged;
 
-  cur->tagged = (m >= 0 ? m : !cur->tagged);
+  cur->tagged = ((act >= 0) ? act : !cur->tagged);
 
   return cur->tagged - ot;
 }
index 054bc5b5769ab34ca8d2e30d8164be2c91c0569c..6b78180824eacb5ac8cbe13c42717fb47a65f683 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -1033,50 +1033,36 @@ static int examine_mailboxes(struct Menu *menu, struct BrowserState *state)
 }
 
 /**
- * select_file_search - Menu search callback for matching files
- * @param menu Current menu
- * @param re   Regex to match
- * @param n    Index of menu entry to match
- * @retval 0 Success
- * @retval 1 No match
+ * select_file_search - Menu search callback for matching files - Implements Menu::menu_search()
  */
-static int select_file_search(struct Menu *menu, regex_t *re, int n)
+static int select_file_search(struct Menu *menu, regex_t *rx, int line)
 {
 #ifdef USE_NNTP
   if (OptNews)
-    return regexec(re, ((struct FolderFile *) menu->data)[n].desc, 0, NULL, 0);
+    return regexec(rx, ((struct FolderFile *) menu->data)[line].desc, 0, NULL, 0);
 #endif
-  return regexec(re, ((struct FolderFile *) menu->data)[n].name, 0, NULL, 0);
+  return regexec(rx, ((struct FolderFile *) menu->data)[line].name, 0, NULL, 0);
 }
 
 #ifdef USE_NOTMUCH
 /**
- * select_vfolder_search - Menu search callback for virtual folders
- * @param menu Current menu
- * @param re   Regex to match
- * @param n    Index of menu entry to match
- * @retval 0 Success
- * @retval 1 No match
+ * select_vfolder_search - Menu search callback for virtual folders - Implements Menu::menu_search()
  */
-static int select_vfolder_search(struct Menu *menu, regex_t *re, int n)
+static int select_vfolder_search(struct Menu *menu, regex_t *rx, int line)
 {
-  return regexec(re, ((struct FolderFile *) menu->data)[n].desc, 0, NULL, 0);
+  return regexec(rx, ((struct FolderFile *) menu->data)[line].desc, 0, NULL, 0);
 }
 #endif
 
 /**
- * folder_make_entry - Format a menu item for the folder browser
- * @param[out] buf    Buffer in which to save string
- * @param[in]  buflen Buffer length
- * @param[in]  menu   Menu containing aliases
- * @param[in]  num    Index into the menu
+ * folder_make_entry - Format a menu item for the folder browser - Implements Menu::menu_make_entry()
  */
-static void folder_make_entry(char *buf, size_t buflen, struct Menu *menu, int num)
+static void folder_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
 {
   struct Folder folder;
 
-  folder.ff = &((struct FolderFile *) menu->data)[num];
-  folder.num = num;
+  folder.ff = &((struct FolderFile *) menu->data)[line];
+  folder.num = line;
 
 #ifdef USE_NNTP
   if (OptNews)
@@ -1096,18 +1082,14 @@ static void folder_make_entry(char *buf, size_t buflen, struct Menu *menu, int n
 
 #ifdef USE_NOTMUCH
 /**
- * vfolder_make_entry - Format a menu item for the virtual folder list
- * @param[out] buf    Buffer in which to save string
- * @param[in]  buflen Buffer length
- * @param[in]  menu   Menu containing aliases
- * @param[in]  num    Index into the menu
+ * vfolder_make_entry - Format a menu item for the virtual folder list - Implements Menu::menu_make_entry()
  */
-static void vfolder_make_entry(char *buf, size_t buflen, struct Menu *menu, int num)
+static void vfolder_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
 {
   struct Folder folder;
 
-  folder.ff = &((struct FolderFile *) menu->data)[num];
-  folder.num = num;
+  folder.ff = &((struct FolderFile *) menu->data)[line];
+  folder.num = line;
 
   mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(VfolderFormat),
                       folder_format_str, (unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR);
@@ -1237,15 +1219,11 @@ static void init_menu(struct BrowserState *state, struct Menu *menu,
 }
 
 /**
- * file_tag - Tag an entry in the menu
- * @param menu Current menu
- * @param n    Index of menu entry to tag
- * @param m    If >=0 then multiple tags are allowed
- * @retval num Number of tagged menu items
+ * file_tag - Tag an entry in the menu - Implements Menu::menu_tag()
  */
-static int file_tag(struct Menu *menu, int n, int m)
+static int file_tag(struct Menu *menu, int sel, int act)
 {
-  struct FolderFile *ff = &(((struct FolderFile *) menu->data)[n]);
+  struct FolderFile *ff = &(((struct FolderFile *) menu->data)[sel]);
   if (S_ISDIR(ff->mode) || (S_ISLNK(ff->mode) && link_is_dir(LastDir, ff->name)))
   {
     mutt_error(_("Can't attach a directory"));
@@ -1253,7 +1231,7 @@ static int file_tag(struct Menu *menu, int n, int m)
   }
 
   bool ot = ff->tagged;
-  ff->tagged = (m >= 0 ? m : !ff->tagged);
+  ff->tagged = ((act >= 0) ? act : !ff->tagged);
 
   return ff->tagged - ot;
 }
index 97cefd80ef9ed420e46ba5eade9b39d19691b393..53b1dca3c10e2a3fea6470fe2ce3503a9dbf978c 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -248,18 +248,14 @@ static void init_header_padding(void)
 }
 
 /**
- * snd_make_entry - Format a menu item for the attachment list
- * @param[out] buf    Buffer in which to save string
- * @param[in]  buflen Buffer length
- * @param[in]  menu   Menu containing aliases
- * @param[in]  num    Index into the menu
+ * snd_make_entry - Format a menu item for the attachment list - Implements Menu::menu_make_entry()
  */
-static void snd_make_entry(char *buf, size_t buflen, struct Menu *menu, int num)
+static void snd_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
 {
   struct AttachCtx *actx = menu->data;
 
   mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(AttachFormat),
-                      attach_format_str, (unsigned long) (actx->idx[actx->v2r[num]]),
+                      attach_format_str, (unsigned long) (actx->idx[actx->v2r[line]]),
                       MUTT_FORMAT_STAT_FILE | MUTT_FORMAT_ARROWCURSOR);
 }
 
@@ -678,8 +674,7 @@ static void compose_status_line(char *buf, size_t buflen, size_t col, int cols,
                                 struct Menu *menu, const char *p);
 
 /**
- * compose_custom_redraw - Redraw the compose menu
- * @param menu Current menu
+ * compose_custom_redraw - Redraw the compose menu - Implements Menu::menu_custom_redraw()
  */
 static void compose_custom_redraw(struct Menu *menu)
 {
index 724a1a5c8f398354bd5f12a2a55364d873999610..f5d11e88d0bdd0a169c3e6d83ffddba5d822a9bf 100644 (file)
@@ -641,18 +641,14 @@ static int main_change_folder(struct Menu *menu, int op, char *buf,
 }
 
 /**
- * index_make_entry - Format a menu item for the index list
- * @param[out] buf    Buffer in which to save string
- * @param[in]  buflen Buffer length
- * @param[in]  menu   Menu containing aliases
- * @param[in]  num    Index into the menu
+ * index_make_entry - Format a menu item for the index list - Implements Menu::menu_make_entry()
  */
-void index_make_entry(char *buf, size_t buflen, struct Menu *menu, int num)
+void index_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
 {
-  if (!Context || !menu || (num < 0) || (num >= Context->mailbox->hdrmax))
+  if (!Context || !menu || (line < 0) || (line >= Context->mailbox->hdrmax))
     return;
 
-  struct Email *e = Context->mailbox->hdrs[Context->mailbox->v2r[num]];
+  struct Email *e = Context->mailbox->hdrs[Context->mailbox->v2r[line]];
   if (!e)
     return;
 
@@ -717,17 +713,14 @@ void index_make_entry(char *buf, size_t buflen, struct Menu *menu, int num)
 }
 
 /**
- * index_color - Calculate the colour for a line of the index
- * @param index_no Index line number
- * @retval >0 Colour pair
- * @retval  0 No colour
+ * index_color - Calculate the colour for a line of the index - Implements Menu::menu_color()
  */
-int index_color(int index_no)
+int index_color(int line)
 {
-  if (!Context || (index_no < 0))
+  if (!Context || (line < 0))
     return 0;
 
-  struct Email *e = Context->mailbox->hdrs[Context->mailbox->v2r[index_no]];
+  struct Email *e = Context->mailbox->hdrs[Context->mailbox->v2r[line]];
 
   if (e && e->pair)
     return e->pair;
@@ -901,8 +894,7 @@ struct Mapping IndexNewsHelp[] = {
 #endif
 
 /**
- * index_custom_redraw - Redraw the index
- * @param menu Current Menu
+ * index_custom_redraw - Redraw the index - Implements Menu::menu_custom_redraw()
  */
 static void index_custom_redraw(struct Menu *menu)
 {
index e47d423caa21b9c52babccb960e4f093310e6af0..1492555c51e8ddd99256320b43af8ecc6189fbb8 100644 (file)
@@ -40,8 +40,8 @@ extern bool  PgpAutoDecode;
 extern bool  UncollapseJump;
 extern bool  UncollapseNew;
 
-int  index_color(int index_no);
-void index_make_entry(char *buf, size_t buflen, struct Menu *menu, int num);
+int  index_color(int line);
+void index_make_entry(char *buf, size_t buflen, struct Menu *menu, int line);
 void mutt_draw_statusline(int cols, const char *buf, size_t buflen);
 int  mutt_index_menu(void);
 void mutt_set_header_color(struct Context *ctx, struct Email *curhdr);
diff --git a/menu.c b/menu.c
index b2096163f9a7bb4c4aa3c6faae469758a0152ec0..795c551150a428429c5ce28ae357874af07e9c97 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -933,29 +933,22 @@ static void menu_prev_entry(struct Menu *menu)
 }
 
 /**
- * default_color - Get the default colour
- * @param i Colour index (UNUSED)
- * @retval num Colour pair in an integer
+ * default_color - Get the default colour for a line of the menu - Implements Menu::menu_color()
  */
-static int default_color(int i)
+static int default_color(int line)
 {
   return ColorDefs[MT_COLOR_NORMAL];
 }
 
 /**
- * generic_search - Search a menu for a item matching a regex
- * @param m  Menu to search
- * @param re Regex to match
- * @param n  Index number
- * @retval  0 Success
- * @retval >0 Error, e.g. REG_NOMATCH
+ * generic_search - Search a menu for a item matching a regex - Implements Menu::menu_search()
  */
-static int generic_search(struct Menu *m, regex_t *re, int n)
+static int generic_search(struct Menu *menu, regex_t *rx, int line)
 {
   char buf[LONG_STRING];
 
-  menu_make_entry(buf, sizeof(buf), m, n);
-  return regexec(re, buf, 0, NULL, 0);
+  menu_make_entry(buf, sizeof(buf), menu, line);
+  return regexec(rx, buf, 0, NULL, 0);
 }
 
 /**
index 5f95b15c73c10eb26b9b80b1b2fffa2795223270..eb0f83dd742babc1a454d5fd7b2db39f260ca7c5 100644 (file)
@@ -33,7 +33,7 @@ struct Menu;
 struct Email;
 struct Body;
 
-int attach_tag(struct Menu *menu, int n, int m);
+int attach_tag(struct Menu *menu, int sel, int act);
 int mutt_attach_display_loop(struct Menu *menu, int op, struct Email *e,
                              struct AttachCtx *actx, bool recv);
 
index 1ac22f6c6699e5c18c6de3d18140ec2d8da8e306..3bcbc57e01f3452e76e1d8f7fd0e4c5a2d81abfd 100644 (file)
@@ -65,15 +65,11 @@ static const char *history_format_str(char *buf, size_t buflen, size_t col, int
 }
 
 /**
- * history_make_entry - Format a menu item for the history list
- * @param[out] buf    Buffer in which to save string
- * @param[in]  buflen Buffer length
- * @param[in]  menu   Menu containing aliases
- * @param[in]  num    Index into the menu
+ * history_make_entry - Format a menu item for the history list - Implements Menu::menu_make_entry()
  */
-static void history_make_entry(char *buf, size_t buflen, struct Menu *menu, int num)
+static void history_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
 {
-  char *entry = ((char **) menu->data)[num];
+  char *entry = ((char **) menu->data)[line];
 
   mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, "%s", history_format_str,
                       (unsigned long) entry, MUTT_FORMAT_ARROWCURSOR);
index 4188a5e3b36cc59631bd58f2576b4cbe7116470e..2f02b77ae1c6cfa9b8cf4e4b8b68ed063f846d0a 100644 (file)
@@ -3150,19 +3150,15 @@ static const char *crypt_format_str(char *buf, size_t buflen, size_t col, int co
 }
 
 /**
- * crypt_make_entry - Format a menu item for the key selection list
- * @param[out] buf    Buffer in which to save string
- * @param[in]  buflen Buffer length
- * @param[in]  menu   Menu containing aliases
- * @param[in]  num    Index into the menu
+ * crypt_make_entry - Format a menu item for the key selection list - Implements Menu::menu_make_entry()
  */
-static void crypt_make_entry(char *buf, size_t buflen, struct Menu *menu, int num)
+static void crypt_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
 {
   struct CryptKeyInfo **key_table = menu->data;
   struct CryptEntry entry;
 
-  entry.key = key_table[num];
-  entry.num = num + 1;
+  entry.key = key_table[line];
+  entry.num = line + 1;
 
   mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(PgpEntryFormat),
                       crypt_format_str, (unsigned long) &entry, MUTT_FORMAT_ARROWCURSOR);
index 5daf747b0121eca95f83a61e035fd4190e2bf5ec..df98684938881b45086c251fe274ee1b87289c66 100644 (file)
@@ -326,19 +326,15 @@ static const char *pgp_entry_fmt(char *buf, size_t buflen, size_t col, int cols,
 }
 
 /**
- * pgp_make_entry - Format a menu item for the pgp key list
- * @param[out] buf    Buffer in which to save string
- * @param[in]  buflen Buffer length
- * @param[in]  menu   Menu containing aliases
- * @param[in]  num    Index into the menu
+ * pgp_make_entry - Format a menu item for the pgp key list - Implements Menu::menu_make_entry()
  */
-static void pgp_make_entry(char *buf, size_t buflen, struct Menu *menu, int num)
+static void pgp_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
 {
   struct PgpUid **KeyTable = menu->data;
   struct PgpEntry entry;
 
-  entry.uid = KeyTable[num];
-  entry.num = num + 1;
+  entry.uid = KeyTable[line];
+  entry.num = line + 1;
 
   mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(PgpEntryFormat),
                       pgp_entry_fmt, (unsigned long) &entry, MUTT_FORMAT_ARROWCURSOR);
index 12275a943b8e0fcd5dd8fe3b71beb9dcf807edba..f625d6a2ae32103b649cb496168150d7a2f486b5 100644 (file)
@@ -435,16 +435,12 @@ static char *smime_key_flags(int flags)
 }
 
 /**
- * smime_make_entry - Format a menu item for the smime key list
- * @param[out] buf    Buffer in which to save string
- * @param[in]  buflen Buffer length
- * @param[in]  menu   Menu containing aliases
- * @param[in]  num    Index into the menu
+ * smime_make_entry - Format a menu item for the smime key list - Implements Menu::menu_make_entry()
  */
-static void smime_make_entry(char *buf, size_t buflen, struct Menu *menu, int num)
+static void smime_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
 {
   struct SmimeKey **Table = menu->data;
-  struct SmimeKey *this = Table[num];
+  struct SmimeKey *this = Table[line];
   char *truststate = NULL;
   switch (this->trust)
   {
diff --git a/pager.c b/pager.c
index 661e1edc76ed45f30db4cc1f7d123130c1e7d2db..e1935a82b88afafed9d00383cab00a2b18a044f4 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -1885,8 +1885,7 @@ struct PagerRedrawData
 };
 
 /**
- * pager_custom_redraw - Redraw the pager window
- * @param pager_menu Pager Menu
+ * pager_custom_redraw - Redraw the pager window - Implements Menu::menu_custom_redraw()
  */
 static void pager_custom_redraw(struct Menu *pager_menu)
 {
index 1d10d72ca2489736ab4daaa1a1a3a9680626fc34..d523be051a56b4d648210d4689b1c2f2fc9d1068 100644 (file)
@@ -187,18 +187,14 @@ void mutt_update_num_postponed(void)
 }
 
 /**
- * post_make_entry - Format a menu item for the email list
- * @param[out] buf    Buffer in which to save string
- * @param[in]  buflen Buffer length
- * @param[in]  menu   Menu containing aliases
- * @param[in]  num    Index into the menu
+ * post_make_entry - Format a menu item for the email list - Implements Menu::menu_make_entry()
  */
-static void post_make_entry(char *buf, size_t buflen, struct Menu *menu, int num)
+static void post_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
 {
   struct Context *ctx = menu->data;
 
   mutt_make_string_flags(buf, buflen, NONULL(IndexFormat), ctx,
-                         ctx->mailbox->hdrs[num], MUTT_FORMAT_ARROWCURSOR);
+                         ctx->mailbox->hdrs[line], MUTT_FORMAT_ARROWCURSOR);
 }
 
 /**
diff --git a/query.c b/query.c
index d9508136af8daffd44580d15b0375496b8e95ea7..18c8b23aecb351933fa48be26e4e0d5562ed5c88 100644 (file)
--- a/query.c
+++ b/query.c
@@ -198,32 +198,27 @@ static struct Query *run_query(char *s, int quiet)
 }
 
 /**
- * query_search - Search a Address menu item
- * @param m  Current Menu
- * @param re Regex to match
- * @param n  Index of menu item to test
- * @retval  0 Success
- * @retval -1 Error, or no match
+ * query_search - Search a Address menu item - Implements Menu::menu_search()
  *
  * Try to match various Address fields.
  */
-static int query_search(struct Menu *m, regex_t *re, int n)
+static int query_search(struct Menu *menu, regex_t *rx, int line)
 {
-  struct Entry *table = m->data;
+  struct Entry *table = menu->data;
 
-  if (table[n].data->name && !regexec(re, table[n].data->name, 0, NULL, 0))
+  if (table[line].data->name && !regexec(rx, table[line].data->name, 0, NULL, 0))
     return 0;
-  if (table[n].data->other && !regexec(re, table[n].data->other, 0, NULL, 0))
+  if (table[line].data->other && !regexec(rx, table[line].data->other, 0, NULL, 0))
     return 0;
-  if (table[n].data->addr)
+  if (table[line].data->addr)
   {
-    if (table[n].data->addr->personal &&
-        !regexec(re, table[n].data->addr->personal, 0, NULL, 0))
+    if (table[line].data->addr->personal &&
+        !regexec(rx, table[line].data->addr->personal, 0, NULL, 0))
     {
       return 0;
     }
-    if (table[n].data->addr->mailbox &&
-        !regexec(re, table[n].data->addr->mailbox, 0, NULL, 0))
+    if (table[line].data->addr->mailbox &&
+        !regexec(rx, table[line].data->addr->mailbox, 0, NULL, 0))
     {
       return 0;
     }
@@ -292,34 +287,26 @@ static const char *query_format_str(char *buf, size_t buflen, size_t col, int co
 }
 
 /**
- * query_make_entry - Format a menu item for the query list
- * @param[out] buf    Buffer in which to save string
- * @param[in]  buflen Buffer length
- * @param[in]  menu   Menu containing aliases
- * @param[in]  num    Index into the menu
+ * query_make_entry - Format a menu item for the query list - Implements Menu::menu_make_entry()
  */
-static void query_make_entry(char *buf, size_t buflen, struct Menu *menu, int num)
+static void query_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
 {
-  struct Entry *entry = &((struct Entry *) menu->data)[num];
+  struct Entry *entry = &((struct Entry *) menu->data)[line];
 
-  entry->data->num = num;
+  entry->data->num = line;
   mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(QueryFormat),
                       query_format_str, (unsigned long) entry, MUTT_FORMAT_ARROWCURSOR);
 }
 
 /**
- * query_tag - Tag an entry in the Query Menu
- * @param menu Current Menu
- * @param n    Index of menu entry to tag
- * @param m    If >=0 then multiple tags are allowed
- * @retval num Number of tagged menu items
+ * query_tag - Tag an entry in the Query Menu - Implements Menu::menu_tag()
  */
-static int query_tag(struct Menu *menu, int n, int m)
+static int query_tag(struct Menu *menu, int sel, int act)
 {
-  struct Entry *cur = &((struct Entry *) menu->data)[n];
+  struct Entry *cur = &((struct Entry *) menu->data)[sel];
   bool ot = cur->tagged;
 
-  cur->tagged = m >= 0 ? m : !cur->tagged;
+  cur->tagged = ((act >= 0) ? act : !cur->tagged);
   return cur->tagged - ot;
 }
 
index a3936512aacc5ecb01d9bf5fdbc8f9736c5b9221..178f61b80ca71b09a7a1754146a5095877a6a098 100644 (file)
@@ -416,35 +416,27 @@ const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols,
 }
 
 /**
- * attach_make_entry - Format a menu item for the attachment list
- * @param[out] buf    Buffer in which to save string
- * @param[in]  buflen Buffer length
- * @param[in]  menu   Menu containing aliases
- * @param[in]  num    Index into the menu
+ * attach_make_entry - Format a menu item for the attachment list - Implements Menu::menu_make_entry()
  */
-static void attach_make_entry(char *buf, size_t buflen, struct Menu *menu, int num)
+static void attach_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
 {
   struct AttachCtx *actx = menu->data;
 
   mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(AttachFormat),
-                      attach_format_str, (unsigned long) (actx->idx[actx->v2r[num]]),
+                      attach_format_str, (unsigned long) (actx->idx[actx->v2r[line]]),
                       MUTT_FORMAT_ARROWCURSOR);
 }
 
 /**
- * attach_tag - Tag an attachment
- * @param menu Menu listing attachments
- * @param n    Index number of the attachment
- * @param m    Action: 0 untag, 1 tag, -1 toggle
- * @retval num Net change in number of tagged attachments
+ * attach_tag - Tag an attachment - Implements Menu::menu_tag()
  */
-int attach_tag(struct Menu *menu, int n, int m)
+int attach_tag(struct Menu *menu, int sel, int act)
 {
   struct AttachCtx *actx = menu->data;
-  struct Body *cur = actx->idx[actx->v2r[n]]->content;
+  struct Body *cur = actx->idx[actx->v2r[sel]]->content;
   bool ot = cur->tagged;
 
-  cur->tagged = (m >= 0 ? m : !cur->tagged);
+  cur->tagged = ((act >= 0) ? act : !cur->tagged);
   return cur->tagged - ot;
 }