the necessary keywords to look them up in the manual, ChangeLog or other
sources of information.
+2006-01-13:
+
+ The semantics for $muttng_folder_name has slightly changed, see docs.
+
2005-10-23:
The %u expando for $sidebar_number_format has been added.
val = CurrentFolder;
} else if (ascii_strcmp ("muttng_folder_name", option->option) == 0 &&
CurrentFolder && *CurrentFolder) {
- if ((t = strrchr (CurrentFolder, '/')) != NULL)
+
+ size_t Maildirlength = str_len (Maildir);
+
+ /*
+ * if name starts with $folder, just strip it to keep hierarchy
+ * $folder=imap://host, path=imap://host/inbox/b -> inbox/b
+ */
+ if (Maildirlength > 0 && str_ncmp (CurrentFolder, Maildir,
+ Maildirlength) == 0 &&
+ str_len (CurrentFolder) > Maildirlength) {
+ val = CurrentFolder + Maildirlength;
+ if (Maildir[strlen(Maildir)-1]!='/')
+ val += 1;
+ /* if not $folder, just use everything after last / */
+ } else if ((t = strrchr (CurrentFolder, '/')) != NULL)
val = t+1;
+ /* default: use as-is */
else
val = CurrentFolder;
+
} else
val = option->init;
/*
** .pp
** \fIThis is a read-only system property and, at runtime,
- ** specifies the last part of the full path or URI of the
- ** folder currently open (if any), i.e. everything after
- ** the last ``/''.\fP
+ ** specifies the actual name of the folder as far as it could
+ ** be detected.\fP
+ ** .pp
+ ** For detection, $$$folder is first taken into account
+ ** and simply stripped to form the result when a match is found. For
+ ** example, with $$$folder being \fTimap://host\fP and the folder is
+ ** \fTimap://host/INBOX/foo\fP, $$$muttng_folder_name will be just
+ ** \fTINBOX/foo\fP.)
+ ** .pp
+ ** Second, if the initial portion of a name is not $$$folder,
+ ** the result will be everything after the last ``/''.
+ ** .pp
+ ** Third and last, the result will be just the name if neither
+ ** $$$folder nor a ``/'' were found in the name.
*/
{"muttng_pwd", DT_SYS, R_NONE, 0, "" },
/*