Read/write command history from/to a file. More...
Go to the source code of this file.
Data Structures | |
struct | HistoryEntry |
A line in the History menu. More... | |
Enumerations | |
enum | HistoryClass { HC_EXT_COMMAND , HC_ALIAS , HC_NEO_COMMAND , HC_FILE , HC_PATTERN , HC_OTHER , HC_MAILBOX , HC_MAX } |
Type to differentiate different histories. More... | |
enum | ExpandoDataHistory { ED_HIS_MATCH = 1 , ED_HIS_NUMBER } |
Expando UIDs for History. More... | |
Functions | |
void | mutt_hist_add (enum HistoryClass hclass, const char *str, bool save) |
Add a string to a history. | |
bool | mutt_hist_at_scratch (enum HistoryClass hclass) |
Is the current History position at the 'scratch' place? | |
void | mutt_hist_cleanup (void) |
Free all the history lists. | |
void | mutt_hist_init (void) |
Create a set of empty History ring buffers. | |
char * | mutt_hist_next (enum HistoryClass hclass) |
Get the next string in a History. | |
char * | mutt_hist_prev (enum HistoryClass hclass) |
Get the previous string in a History. | |
void | mutt_hist_read_file (void) |
Read the History from a file. | |
void | mutt_hist_reset_state (enum HistoryClass hclass) |
Move the 'current' position to the end of the History. | |
void | mutt_hist_save_scratch (enum HistoryClass hclass, const char *str) |
Save a temporary string to the History. | |
int | mutt_hist_search (const char *find, enum HistoryClass hclass, struct HistoryArray *matches) |
Find matches in a history list. | |
void | mutt_hist_complete (struct Buffer *buf, enum HistoryClass hclass) |
Complete a string from a history list. | |
int | main_hist_observer (struct NotifyCallback *nc) |
Notification that a Config Variable has change - Implements observer_t -. | |
void | dlg_history (struct Buffer *buf, struct HistoryArray *matches) |
Select an item from a history list -. | |
Read/write command history from/to a file.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file lib.h.
enum HistoryClass |
Type to differentiate different histories.
Saved lists of recently-used:
Enumerator | |
---|---|
HC_EXT_COMMAND | External commands. |
HC_ALIAS | Aliases. |
HC_NEO_COMMAND | NeoMutt commands. |
HC_FILE | Files. |
HC_PATTERN | Patterns. |
HC_OTHER | Miscellaneous strings. |
HC_MAILBOX | Mailboxes. |
HC_MAX |
Definition at line 51 of file lib.h.
enum ExpandoDataHistory |
Enumerator | |
---|---|
ED_HIS_MATCH | |
ED_HIS_NUMBER |
void mutt_hist_add | ( | enum HistoryClass | hclass, |
const char * | str, | ||
bool | save | ||
) |
Add a string to a history.
hclass | History to add to |
str | String to add |
save | Should the changes be saved to file immediately? |
Definition at line 494 of file history.c.
bool mutt_hist_at_scratch | ( | enum HistoryClass | hclass | ) |
Is the current History position at the 'scratch' place?
hclass | History to use |
true | History is at 'scratch' place |
The last entry in the history is used as a 'scratch' area. It can be overwritten as the user types and edits.
To get (back) to the scratch area, call mutt_hist_next(), mutt_hist_prev() or mutt_hist_reset_state().
Definition at line 656 of file history.c.
void mutt_hist_cleanup | ( | void | ) |
Free all the history lists.
Definition at line 449 of file history.c.
void mutt_hist_init | ( | void | ) |
Create a set of empty History ring buffers.
This just creates empty histories. To fill them, call mutt_hist_read_file().
Definition at line 476 of file history.c.
char * mutt_hist_next | ( | enum HistoryClass | hclass | ) |
Get the next string in a History.
hclass | History to choose |
ptr | Next string |
If there is no next string, and empty string will be returned.
Definition at line 534 of file history.c.
char * mutt_hist_prev | ( | enum HistoryClass | hclass | ) |
Get the previous string in a History.
hclass | History to choose |
ptr | Previous string |
If there is no previous string, and empty string will be returned.
Definition at line 562 of file history.c.
void mutt_hist_read_file | ( | void | ) |
Read the History from a file.
The file $history_file
is read and parsed into separate History ring buffers.
Definition at line 604 of file history.c.
void mutt_hist_reset_state | ( | enum HistoryClass | hclass | ) |
Move the 'current' position to the end of the History.
hclass | History to reset |
After calling mutt_hist_next() and mutt_hist_prev(), this function resets the current position ('cur' pointer).
Definition at line 590 of file history.c.
void mutt_hist_save_scratch | ( | enum HistoryClass | hclass, |
const char * | str | ||
) |
Save a temporary string to the History.
hclass | History to alter |
str | String to set |
Write a 'scratch' string into the History's current position. This is useful to preserver a user's edits.
Definition at line 673 of file history.c.
int mutt_hist_search | ( | const char * | find, |
enum HistoryClass | hclass, | ||
struct HistoryArray * | matches | ||
) |
Find matches in a history list.
[in] | find | String to find |
[in] | hclass | History list |
[out] | matches | All the matching lines |
num | Matches found |
Definition at line 417 of file history.c.
void mutt_hist_complete | ( | struct Buffer * | buf, |
enum HistoryClass | hclass | ||
) |
Complete a string from a history list.
Definition at line 689 of file history.c.