summaryrefslogtreecommitdiff
path: root/pith
diff options
context:
space:
mode:
Diffstat (limited to 'pith')
-rw-r--r--pith/conf.c7
-rw-r--r--pith/conf.h1
-rw-r--r--pith/conftype.h1
-rw-r--r--pith/hist.c51
-rw-r--r--pith/hist.h3
-rw-r--r--pith/pine.hlp38
6 files changed, 98 insertions, 3 deletions
diff --git a/pith/conf.c b/pith/conf.c
index 6e320527..79243222 100644
--- a/pith/conf.c
+++ b/pith/conf.c
@@ -244,6 +244,8 @@ CONF_TXT_T cf_text_image_viewer[] = "Program to view images (e.g. GIF or TIFF at
CONF_TXT_T cf_text_browser[] = "List of programs to open Internet URLs (e.g. http or ftp references).";
+CONF_TXT_T cf_text_history[] = "List of directories that are preferred locations to save or export attachments.";
+
CONF_TXT_T cf_text_inc_startup[] = "Sets message which cursor begins on. Choices: first-unseen, first-recent,\n# first-important, first-important-or-unseen, first-important-or-recent,\n# first, last. Default: \"first-unseen\".";
CONF_TXT_T cf_pruning_rule[] = "Allows a default answer for the prune folder questions. Choices: yes-ask,\n# yes-no, no-ask, no-no, ask-ask, ask-no. Default: \"ask-ask\".";
@@ -656,6 +658,8 @@ static struct variable variables[] = {
NULL, cf_text_mimetype_path},
{"url-viewers", 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0,
"URL-Viewers", cf_text_browser},
+{"default-directories", 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0,
+ "Extra Directories for Save", cf_text_history},
{"max-remote-connections", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0,
"Maximum Remote Connections", cf_text_maxremstreams},
{"stay-open-folders", 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0,
@@ -2018,6 +2022,7 @@ init_vars(struct pine *ps, void (*cmds_f) (struct pine *, char **))
#endif /* _WINDOWS */
set_current_val(&vars[V_IMAGE_VIEWER], TRUE, TRUE);
set_current_val(&vars[V_BROWSER], TRUE, TRUE);
+ set_current_val(&vars[V_HISTORY], TRUE, TRUE);
set_current_val(&vars[V_SMTP_SERVER], TRUE, TRUE);
set_current_val(&vars[V_COMP_HDRS], TRUE, TRUE);
set_current_val(&vars[V_CUSTOM_HDRS], TRUE, TRUE);
@@ -7868,6 +7873,8 @@ config_help(int var, int feature)
return(h_config_newsrc_path);
case V_BROWSER :
return(h_config_browser);
+ case V_HISTORY :
+ return(h_config_history);
#if defined(DOS) || defined(OS2)
case V_FILE_DIR :
return(h_config_file_dir);
diff --git a/pith/conf.h b/pith/conf.h
index acdf7868..1fb95fcd 100644
--- a/pith/conf.h
+++ b/pith/conf.h
@@ -343,6 +343,7 @@
#define GLO_THREAD_EXP_CHAR vars[V_THREAD_EXP_CHAR].global_val.p
#define VAR_THREAD_LASTREPLY_CHAR vars[V_THREAD_LASTREPLY_CHAR].current_val.p
#define GLO_THREAD_LASTREPLY_CHAR vars[V_THREAD_LASTREPLY_CHAR].global_val.p
+#define VAR_HISTORY vars[V_HISTORY].current_val.l
#if defined(DOS) || defined(OS2)
#define VAR_FILE_DIR vars[V_FILE_DIR].current_val.p
diff --git a/pith/conftype.h b/pith/conftype.h
index afae74ec..9549e49d 100644
--- a/pith/conftype.h
+++ b/pith/conftype.h
@@ -126,6 +126,7 @@ typedef enum { V_PERSONAL_NAME = 0
, V_MAILCAP_PATH
, V_MIMETYPE_PATH
, V_BROWSER
+ , V_HISTORY
, V_MAXREMSTREAM
, V_PERMLOCKED
, V_INCCHECKTIMEO
diff --git a/pith/hist.c b/pith/hist.c
index d42b67a6..9d5022c9 100644
--- a/pith/hist.c
+++ b/pith/hist.c
@@ -57,6 +57,57 @@ free_hist(HISTORY_S **history)
}
}
+char *
+hist_in_pos(int pos, char **list, int llen, HISTORY_S *hist, int n)
+{
+ char *p;
+ int i;
+
+ if(pos < 0 || pos > llen + n)
+ return NULL;
+
+ if(pos < llen)
+ return list[pos];
+
+ hist->curindex = hist->origindex; /* reset history */
+ for(i = 0; i < n-1; i++)
+ p = get_prev_hist_dir(hist);
+ p = get_prev_hist_dir(hist);
+ for(i = 0; i < pos - llen; i++)
+ p = get_next_hist_dir(hist);
+ return p;
+}
+
+
+char *
+get_next_hist_dir(HISTORY_S *history)
+{
+ return get_next_hist(history, NULL, 0, NULL);
+}
+
+
+char *
+get_prev_hist_dir(HISTORY_S *history)
+{
+ int nextcurindex;
+
+ if(!(history && history->histsize > 0))
+ return NULL;
+
+ nextcurindex = (history->curindex + 1) % history->histsize;
+
+ /* already at start of history */
+ if(nextcurindex == history->origindex
+ || !(history->hist[nextcurindex] && history->hist[nextcurindex]->str
+ && history->hist[nextcurindex]->str[0]))
+ return NULL;
+
+ history->curindex = nextcurindex;
+
+ return((history->hist[history->curindex] && history->hist[history->curindex]->str)
+ ? history->hist[history->curindex]->str : NULL);
+}
+
char *
get_prev_hist(HISTORY_S *history, char *savethis, unsigned saveflags, void *cntxt)
diff --git a/pith/hist.h b/pith/hist.h
index 8217bc5b..65082998 100644
--- a/pith/hist.h
+++ b/pith/hist.h
@@ -43,6 +43,9 @@ void init_hist(HISTORY_S **, int);
void free_hist(HISTORY_S **);
char *get_prev_hist(HISTORY_S *, char *, unsigned, void *);
char *get_next_hist(HISTORY_S *, char *, unsigned, void *);
+char *get_prev_hist_dir(HISTORY_S *);
+char *get_next_hist_dir(HISTORY_S *);
+char *hist_in_pos(int, char **, int, HISTORY_S *, int);
void save_hist(HISTORY_S *, char *, unsigned, void *);
int items_in_hist(HISTORY_S *);
void add_to_histlist(HISTORY_S **);
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 9eb5575b..af5b06b7 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -194,6 +194,13 @@ Additions include:
that allows users to ignore errors in the computation of the size
of a message from defective servers.
+ <LI> Add the configuration variable "default-directories", which is called
+ <A href="h_config_history"><!--#echo var="VAR_default-directories"--></A>
+ variable saves a list of directories that are readily accessible
+ for save or export of attachments. This makes it easier to save
+ attachments in directories that are hard to navigate to, or that
+ are accessed frequently.
+
<LI> Ignore message from smtp server after a successful authentication
challenge.
@@ -4123,6 +4130,7 @@ There are also additional details on
<li><a href="h_config_upload_cmd">OPTION: <!--#echo var="VAR_upload-command"--></a>
<li><a href="h_config_upload_prefix">OPTION: <!--#echo var="VAR_upload-command-prefix"--></a>
<li><a href="h_config_browser">OPTION: <!--#echo var="VAR_url-viewers"--></a>
+<li><a href="h_config_history">OPTION: <!--#echo var="VAR_default-directories"--></a>
<li><a href="h_config_domain_name">OPTION: <!--#echo var="VAR_use-only-domain-name"--></a>
<li><a href="h_config_user_dom">OPTION: <!--#echo var="VAR_user-domain"--></a>
<li><a href="h_config_user_id">OPTION: <!--#echo var="VAR_user-id"--></a>
@@ -20483,9 +20491,9 @@ example.
<DD>This option makes sense only for IMAP servers that do not perform
a SEARCH command correctly. If your filtering rules
fail to filter some messages, that should have been filtered, then this
-option will make Alpine download all data necessary to perform that search.
-There is a performance penalty when using this option. Downloading the
-data to perfom the search will take longer than requesting the IMAP
+option will make Alpine download all data necessary data to perform that
+search. There is a performance penalty when using this option. Downloading
+the data to perfom the search will take longer than requesting the IMAP
server to perform the filtering, but the filtering will be done correctly.
<P>
</DD>
@@ -27227,6 +27235,30 @@ local computing support staff.
&lt;End of help on this topic&gt;
</BODY>
</HTML>
+====== h_config_history =====
+<HTML>
+<HEAD>
+<TITLE>OPTION: <!--#echo var="VAR_default-directories"--></TITLE>
+</HEAD>
+<BODY>
+<H1>OPTION: <!--#echo var="VAR_default-directories"--></H1>
+<P>
+This option allows you to input a list of directories that Alpine will offer
+for you to use when you are saving or exporting attachments. This is useful
+when navigating to specific directories becomes too tedious, or when you
+need to do this on a daily basis, and want Alpine to remember this on a
+permanent basis.
+<P>
+The list of directories saved here can be accessed using the ^Y and ^V commands
+in the save prompt for attachments, or the export command.
+
+<P><UL>
+<LI><A HREF="h_finding_help">Finding more information and requesting help</A>
+</UL>
+<P>
+&lt;End of help on this topic&gt;
+</BODY>
+</HTML>
====== h_config_browser_xterm =====
<HTML>
<HEAD>