NeoMutt  2024-04-25-100-gcb3684
Teaching an old dog new tricks
No Matches
functions.h File Reference

Pager functions. More...

#include <stdbool.h>
+ Include dependency graph for functions.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PagerFunction
 A NeoMutt function. More...


typedef int(* pager_function_t) (struct IndexSharedData *shared, struct PagerPrivateData *priv, int op)


int pager_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Pager function - Implements function_dispatcher_t -.
bool jump_to_bottom (struct PagerPrivateData *priv, struct PagerView *pview)
 Make sure the bottom line is displayed.

Detailed Description

Pager functions.

  • Richard Russon

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

Definition in file functions.h.

Typedef Documentation

◆ pager_function_t

typedef int(* pager_function_t) (struct IndexSharedData *shared, struct PagerPrivateData *priv, int op)

Definition at line 44 of file functions.h.

Function Documentation

◆ jump_to_bottom()

bool jump_to_bottom ( struct PagerPrivateData priv,
struct PagerView pview 

Make sure the bottom line is displayed.

privPrivate Pager data
Return values
trueSomething changed
falseBottom was already displayed

Definition at line 376 of file functions.c.

378 if (!(priv->lines[priv->cur_line].offset < (priv->st.st_size - 1)))
379 {
380 return false;
381 }
383 int line_num = priv->cur_line;
384 /* make sure the types are defined to the end of file */
385 while (display_line(priv->fp, &priv->bytes_read, &priv->lines, line_num,
386 &priv->lines_used, &priv->lines_max,
387 priv->has_types | (pview->flags & MUTT_PAGER_NOWRAP),
388 &priv->quote_list, &priv->q_level, &priv->force_redraw,
389 &priv->search_re, priv->pview->win_pager, &priv->ansi_list) == 0)
390 {
391 line_num++;
392 }
393 priv->top_line = up_n_lines(priv->pview->win_pager->state.rows, priv->lines,
394 priv->lines_used, priv->hide_quoted);
396 return true;
int display_line(FILE *fp, LOFF_T *bytes_read, struct Line **lines, int line_num, int *lines_used, int *lines_max, PagerFlags flags, struct QuoteStyle **quote_list, int *q_level, bool *force_redraw, regex_t *search_re, struct MuttWindow *win_pager, struct AttrColorList *ansi_list)
Print a line on screen.
Definition: display.c:1042
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:173
Pager data has changed, NotifyPager, PagerPrivateData.
Definition: notify_type.h:53
static int up_n_lines(int nlines, struct Line *info, int cur, bool hiding)
Reposition the pager's view up by n lines.
Definition: functions.c:357
Pager View has changed.
Definition: lib.h:187
Format for term width, ignore $wrap.
Definition: lib.h:73
LOFF_T offset
Offset into Email file (PagerPrivateData->fp)
Definition: display.h:52
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:126
PagerFlags hide_quoted
Set to MUTT_HIDE when quoted email is hidden <toggle-quoted>
Definition: private_data.h:60
int q_level
Number of unique quoting levels.
Definition: private_data.h:59
int cur_line
Current line (last line visible on screen)
Definition: private_data.h:51
int lines_used
Size of lines array (used entries)
Definition: private_data.h:49
int lines_max
Capacity of lines array (total entries)
Definition: private_data.h:50
bool force_redraw
Repaint is needed.
Definition: private_data.h:68
struct Line * lines
Array of text lines in pager.
Definition: private_data.h:48
int has_types
Definition: private_data.h:56
struct Notify * notify
Notifications: NotifyPager, PagerPrivateData.
Definition: private_data.h:71
LOFF_T bytes_read
Number of bytes read from file.
Definition: private_data.h:46
int top_line
First visible line on screen.
Definition: private_data.h:55
struct stat st
Stats about Email file.
Definition: private_data.h:45
struct QuoteStyle * quote_list
Tree of quoting levels.
Definition: private_data.h:58
struct PagerView * pview
Object to view in the pager.
Definition: private_data.h:42
struct AttrColorList ansi_list
List of ANSI colours used in the Pager.
Definition: private_data.h:70
regex_t search_re
Compiled search string.
Definition: private_data.h:65
FILE * fp
File containing decrypted/decoded/weeded Email.
Definition: private_data.h:44
PagerFlags flags
Additional settings to tweak pager's function.
Definition: lib.h:175
struct MuttWindow * win_pager
Pager Window.
Definition: lib.h:180
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function: