[mutt] 09/11: Replace sensible-browser patch with neomutt's
Faidon Liambotis
paravoid at moszumanska.debian.org
Fri May 13 15:33:53 UTC 2016
This is an automated email from the git hooks/post-receive script.
paravoid pushed a commit to branch wip-neomutt
in repository mutt.
commit 8bf21789a59a5bc6f0106fa69da9eb56e29934d6
Author: Faidon Liambotis <paravoid at debian.org>
Date: Wed May 11 02:09:22 2016 +0300
Replace sensible-browser patch with neomutt's
---
.../features/sensible_browser_position.patch | 113 ---------
.../patches/neomutt-devel/sensible-browser.patch | 275 +++++++++++++++++++++
debian/patches/series | 2 +-
3 files changed, 276 insertions(+), 114 deletions(-)
diff --git a/debian/patches/features/sensible_browser_position.patch b/debian/patches/features/sensible_browser_position.patch
deleted file mode 100644
index 929dbd4..0000000
--- a/debian/patches/features/sensible_browser_position.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From: Antonio Radici <antonio at debian.org>
-Date: Thu, 27 Feb 2014 14:42:36 +0100
-Subject: sensible_browser_position
-
-This is the sensible browser position patch by Haakon Riiser.
-
- * Found in: <20050309162127.GA5656 at s>
- http://lists.df7cb.de/mutt/message/20050309.162127.a244a894.en.html
----
- browser.c | 24 +++++++++++++++++++++---
- menu.c | 11 +++++++++++
- mutt_menu.h | 1 +
- 3 files changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/browser.c b/browser.c
-index 46919a0..8ce3b2c 100644
---- a/browser.c
-+++ b/browser.c
-@@ -56,6 +56,7 @@ typedef struct folder_t
- int num;
- } FOLDER;
-
-+static char OldLastDir[_POSIX_PATH_MAX] = "";
- static char LastDir[_POSIX_PATH_MAX] = "";
- static char LastDirBackup[_POSIX_PATH_MAX] = "";
-
-@@ -536,15 +537,33 @@ static void init_menu (struct browser_state *state, MUTTMENU *menu, char *title,
- menu->tagged = 0;
-
- if (buffy)
-+ {
-+ menu->is_mailbox_list = 1;
- snprintf (title, titlelen, _("Mailboxes [%d]"), mutt_buffy_check (0));
-+ }
- else
- {
-+ menu->is_mailbox_list = 0;
- strfcpy (path, LastDir, sizeof (path));
- mutt_pretty_mailbox (path, sizeof (path));
- #ifdef USE_IMAP
- if (state->imap_browse && option (OPTIMAPLSUB))
-- snprintf (title, titlelen, _("Subscribed [%s], File mask: %s"),
-- path, NONULL (Mask.pattern));
-+ {
-+ char *p = strrchr (OldLastDir, '/');
-+ if (p && p - OldLastDir == mutt_strlen (LastDir) &&
-+ mutt_strncmp (LastDir, OldLastDir, p - OldLastDir) == 0)
-+ {
-+ /* If we get here, it means that LastDir is the parent directory of
-+ * OldLastDir. I.e., we're returning from a subdirectory, and we want
-+ * to position the cursor on the directory we're returning from. */
-+ int i;
-+ for (i = 0; i < state->entrymax; i++)
-+ if (mutt_strcmp (state->entry[i].name, p + 1) == 0)
-+ menu->current = i;
-+ }
-+ snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
-+ path, NONULL(Mask.pattern));
-+ }
- else
- #endif
- snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
-@@ -731,7 +750,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
- #endif
- )
- {
-- char OldLastDir[_POSIX_PATH_MAX];
-
- /* save the old directory */
- strfcpy (OldLastDir, LastDir, sizeof (OldLastDir));
-diff --git a/menu.c b/menu.c
-index 828df9c..4b13e7c 100644
---- a/menu.c
-+++ b/menu.c
-@@ -850,8 +850,17 @@ int menu_redraw (MUTTMENU *menu)
-
- int mutt_menuLoop (MUTTMENU *menu)
- {
-+ static int last_position = -1;
- int i = OP_NULL;
-
-+ if ( menu->max && menu->is_mailbox_list ) {
-+ if ( last_position > (menu->max-1) ) {
-+ last_position = -1;
-+ } else if (last_position >= 0) {
-+ menu->current = last_position;
-+ }
-+ }
-+
- FOREVER
- {
- if (option (OPTMENUCALLER))
-@@ -1074,6 +1083,8 @@ int mutt_menuLoop (MUTTMENU *menu)
- break;
-
- default:
-+ if (menu->is_mailbox_list)
-+ last_position = menu->current;
- return (i);
- }
- }
-diff --git a/mutt_menu.h b/mutt_menu.h
-index 8192019..bbcd722 100644
---- a/mutt_menu.h
-+++ b/mutt_menu.h
-@@ -49,6 +49,7 @@ typedef struct menu_t
- int offset; /* which screen row to start the index */
- int pagelen; /* number of entries per screen */
- int tagprefix;
-+ int is_mailbox_list;
-
- /* Setting dialog != NULL overrides normal menu behavior.
- * In dialog mode menubar is hidden and prompt keys are checked before
diff --git a/debian/patches/neomutt-devel/sensible-browser.patch b/debian/patches/neomutt-devel/sensible-browser.patch
new file mode 100644
index 0000000..8e4f549
--- /dev/null
+++ b/debian/patches/neomutt-devel/sensible-browser.patch
@@ -0,0 +1,275 @@
+From afb78321ba3b7e63ca04c197de7480411f0c11cc Mon Sep 17 00:00:00 2001
+From: Richard Russon <rich at flatcap.org>
+Date: Fri, 6 May 2016 19:53:13 +0100
+Subject: [PATCH 04/28] patches-20160502/sensible-browser
+
+---
+ PATCHES | 1 +
+ README.sensible-browser | 39 +++++++++++++++++++++
+ browser.c | 30 ++++++++++++-----
+ doc/manual.xml.head | 90 +++++++++++++++++++++++++++++++++++++++++++++++++
+ menu.c | 11 ++++++
+ mutt_menu.h | 1 +
+ 6 files changed, 164 insertions(+), 8 deletions(-)
+ create mode 100644 README.sensible-browser
+
+diff --git a/PATCHES b/PATCHES
+index a6121c7..35f6d91 100644
+--- a/PATCHES
++++ b/PATCHES
+@@ -1,2 +1,3 @@
++patch-sensible-browser-neo-UNKNOWN
+ patch-trash-neo-UNKNOWN
+ patch-ifdef-neo-UNKNOWN
+diff --git a/README.sensible-browser b/README.sensible-browser
+new file mode 100644
+index 0000000..adfc076
+--- /dev/null
++++ b/README.sensible-browser
+@@ -0,0 +1,39 @@
++Sensible-Browser Patch
++======================
++
++ Make the file browser behave
++
++Patch
++-----
++
++ To check if Mutt supports "sensible-browser", look for
++ "patch-sensible-browser" in the mutt version.
++
++ Dependencies
++ * mutt-1.5.24
++
++Introduction
++------------
++
++ When using the file/folder browser, the selection isn't always where you
++ would expect. When you navigate to '..' (parent folder), the selection
++ should show the folder you *used* to be in.
++
++See Also
++--------
++
++ * NeoMutt project
++
++Known Bugs
++----------
++
++ * Limited to IMAP folders
++ * Always on
++ * Should only select folder when folder is sorted alphabetically
++
++Credits
++-------
++
++ * Haakon Riiser <haakon.riiser at fys.uio.no>
++ * Richard Russon <rich at flatcap.org>
++
+diff --git a/browser.c b/browser.c
+index 46919a0..b0dbeb5 100644
+--- a/browser.c
++++ b/browser.c
+@@ -56,6 +56,7 @@ typedef struct folder_t
+ int num;
+ } FOLDER;
+
++static char OldLastDir[_POSIX_PATH_MAX] = "";
+ static char LastDir[_POSIX_PATH_MAX] = "";
+ static char LastDirBackup[_POSIX_PATH_MAX] = "";
+
+@@ -535,17 +536,32 @@ static void init_menu (struct browser_state *state, MUTTMENU *menu, char *title,
+
+ menu->tagged = 0;
+
+- if (buffy)
++ if (buffy) {
++ menu->is_mailbox_list = 1;
+ snprintf (title, titlelen, _("Mailboxes [%d]"), mutt_buffy_check (0));
+- else
++ } else
+ {
++ menu->is_mailbox_list = 0;
+ strfcpy (path, LastDir, sizeof (path));
+ mutt_pretty_mailbox (path, sizeof (path));
+ #ifdef USE_IMAP
+- if (state->imap_browse && option (OPTIMAPLSUB))
+- snprintf (title, titlelen, _("Subscribed [%s], File mask: %s"),
+- path, NONULL (Mask.pattern));
+- else
++ if (state->imap_browse && option (OPTIMAPLSUB)) {
++ char *p = strrchr (OldLastDir, '/');
++ if (p && ((p - OldLastDir) == mutt_strlen (LastDir)) &&
++ (mutt_strncmp (LastDir, OldLastDir, p - OldLastDir) == 0)) {
++ /* If we get here, it means that LastDir is the parent directory of
++ * OldLastDir. I.e., we're returning from a subdirectory, and we want
++ * to position the cursor on the directory we're returning from. */
++ int i;
++ for (i = 0; i < state->entrymax; i++) {
++ if (mutt_strcmp (state->entry[i].name, p + 1) == 0) {
++ menu->current = i;
++ }
++ }
++ }
++ snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
++ path, NONULL(Mask.pattern));
++ } else
+ #endif
+ snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
+ path, NONULL(Mask.pattern));
+@@ -731,8 +747,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
+ #endif
+ )
+ {
+- char OldLastDir[_POSIX_PATH_MAX];
+-
+ /* save the old directory */
+ strfcpy (OldLastDir, LastDir, sizeof (OldLastDir));
+
+diff --git a/doc/manual.xml.head b/doc/manual.xml.head
+index 5d037f9..a650c96 100644
+--- a/doc/manual.xml.head
++++ b/doc/manual.xml.head
+@@ -8411,6 +8411,96 @@ bind index D purge-message
+ </sect2>
+ </sect1>
+
++<sect1 id="sensible-browser">
++ <title>Sensible-Browser Patch</title>
++ <subtitle>Make the file browser behave</subtitle>
++
++ <sect2 id="sensible-browser-patch">
++ <title>Patch</title>
++
++ <para>
++ To check if Mutt supports <quote>sensible-browser</quote>, look for
++ <quote>patch-sensible-browser</quote> in the mutt version.
++ See: <xref linkend="mutt-patches"/>.
++ </para>
++
++ <itemizedlist>
++ <title>Dependencies:</title>
++ <listitem><para>mutt-1.5.24</para></listitem>
++ </itemizedlist>
++
++ <para>This patch is part of the <ulink url="https://github.com/neomutt/neomutt/wiki">NeoMutt Project</ulink>.</para>
++ </sect2>
++
++ <sect2 id="sensible-browser-intro">
++ <title>Introduction</title>
++
++ <para>
++ When using the file/folder browser, the selection isn't always where you would
++ expect. When you navigate to '..' (parent folder), the selection should show the
++ folder you <emphasis>used</emphasis> to be in.
++ </para>
++
++ </sect2>
++
++<!--
++ <sect2 id="sensible-browser-variables">
++ <title>Variables</title>
++ <para>None</para>
++ </sect2>
++
++ <sect2 id="sensible-browser-functions">
++ <title>Functions</title>
++ <para>None</para>
++ </sect2>
++
++ <sect2 id="sensible-browser-commands">
++ <title>Commands</title>
++ <para>None</para>
++ </sect2>
++
++ <sect2 id="sensible-browser-colors">
++ <title>Colors</title>
++ <para>None</para>
++ </sect2>
++
++ <sect2 id="sensible-browser-sort">
++ <title>Sort</title>
++ <para>None</para>
++ </sect2>
++-->
++
++ <sect2 id="sensible-browser-muttrc">
++ <title>Muttrc</title>
++ <para>None</para>
++ </sect2>
++
++ <sect2 id="sensible-browser-see-also">
++ <title>See Also</title>
++
++ <itemizedlist>
++ <listitem><para><ulink url="https://github.com/neomutt/neomutt/wiki">NeoMutt Project</ulink></para></listitem>
++ </itemizedlist>
++ </sect2>
++
++ <sect2 id="sensible-browser-known-bugs">
++ <title>Known Bugs</title>
++ <itemizedlist>
++ <listitem><para>Limited to IMAP folders</para></listitem>
++ <listitem><para>Always on</para></listitem>
++ <listitem><para>Should only select folder when folder is sorted alphabetically</para></listitem>
++ </itemizedlist>
++ </sect2>
++
++ <sect2 id="sensible-browser-credits">
++ <title>Credits</title>
++ <itemizedlist>
++ <listitem><para>Haakon Riiser <email>haakon.riiser at fys.uio.no</email></para></listitem>
++ <listitem><para>Richard Russon <email>rich at flatcap.org</email></para></listitem>
++ </itemizedlist>
++ </sect2>
++</sect1>
++
+ </chapter>
+
+ <chapter id="security">
+diff --git a/menu.c b/menu.c
+index 828df9c..5b9f6bb 100644
+--- a/menu.c
++++ b/menu.c
+@@ -850,8 +850,17 @@ int menu_redraw (MUTTMENU *menu)
+
+ int mutt_menuLoop (MUTTMENU *menu)
+ {
++ static int last_position = -1;
+ int i = OP_NULL;
+
++ if (menu->max && menu->is_mailbox_list) {
++ if (last_position > (menu->max - 1)) {
++ last_position = -1;
++ } else if (last_position >= 0) {
++ menu->current = last_position;
++ }
++ }
++
+ FOREVER
+ {
+ if (option (OPTMENUCALLER))
+@@ -1074,6 +1083,8 @@ int mutt_menuLoop (MUTTMENU *menu)
+ break;
+
+ default:
++ if (menu->is_mailbox_list)
++ last_position = menu->current;
+ return (i);
+ }
+ }
+diff --git a/mutt_menu.h b/mutt_menu.h
+index 8192019..bbcd722 100644
+--- a/mutt_menu.h
++++ b/mutt_menu.h
+@@ -49,6 +49,7 @@ typedef struct menu_t
+ int offset; /* which screen row to start the index */
+ int pagelen; /* number of entries per screen */
+ int tagprefix;
++ int is_mailbox_list;
+
+ /* Setting dialog != NULL overrides normal menu behavior.
+ * In dialog mode menubar is hidden and prompt keys are checked before
+--
+2.8.1
+
diff --git a/debian/patches/series b/debian/patches/series
index 8c5131a..8922baf 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,7 @@
misc/am-maintainer-mode.patch
neomutt/11-ifdef.patch
neomutt/14-trash.patch
-features/sensible_browser_position.patch
+neomutt-devel/sensible-browser.patch
features/compressed-folders.patch
features/compressed-folders.debian.patch
debian-specific/Muttrc.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mutt/mutt.git
More information about the pkg-mutt-commits
mailing list