diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index c0e821a934c..05880617385 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -23924,6 +23924,27 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 23924 | return " Narrow"; | 23924 | return " Narrow"; |
| 23925 | break; | 23925 | break; |
| 23926 | 23926 | ||
| 23927 | /* Display the "degree of travel" of the window through the buffer. */ | ||
| 23928 | case 'o': | ||
| 23929 | { | ||
| 23930 | ptrdiff_t toppos = marker_position (w->start); | ||
| 23931 | ptrdiff_t botpos = BUF_Z (b) - w->window_end_pos; | ||
| 23932 | ptrdiff_t begv = BUF_BEGV (b); | ||
| 23933 | ptrdiff_t zv = BUF_ZV (b); | ||
| 23934 | |||
| 23935 | if (zv <= botpos) | ||
| 23936 | return toppos <= begv ? "All" : "Bottom"; | ||
| 23937 | else if (toppos <= begv) | ||
| 23938 | return "Top"; | ||
| 23939 | else | ||
| 23940 | { | ||
| 23941 | sprintf (decode_mode_spec_buf, "%2d%%", | ||
| 23942 | percent99 (toppos - begv, (toppos - begv) + (zv - botpos))); | ||
| 23943 | return decode_mode_spec_buf; | ||
| 23944 | } | ||
| 23945 | } | ||
| 23946 | |||
| 23947 | /* Display percentage of buffer above the top of the screen. */ | ||
| 23927 | case 'p': | 23948 | case 'p': |
| 23928 | { | 23949 | { |
| 23929 | ptrdiff_t pos = marker_position (w->start); | 23950 | ptrdiff_t pos = marker_position (w->start); |
| @@ -23961,6 +23982,33 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 23961 | } | 23982 | } |
| 23962 | } | 23983 | } |
| 23963 | 23984 | ||
| 23985 | /* Display percentage offsets of top and bottom of the window, | ||
| 23986 | using "All" (but not "Top" or "Bottom") where appropriate. */ | ||
| 23987 | case 'q': | ||
| 23988 | { | ||
| 23989 | ptrdiff_t toppos = marker_position (w->start); | ||
| 23990 | ptrdiff_t botpos = BUF_Z (b) - w->window_end_pos; | ||
| 23991 | ptrdiff_t begv = BUF_BEGV (b); | ||
| 23992 | ptrdiff_t zv = BUF_ZV (b); | ||
| 23993 | |||
| 23994 | if ((toppos <= begv) && (zv <= botpos)) | ||
| 23995 | return "All "; | ||
| 23996 | |||
| 23997 | if (toppos <= begv) | ||
| 23998 | strcpy (decode_mode_spec_buf, "0-"); | ||
| 23999 | else | ||
| 24000 | sprintf (decode_mode_spec_buf, "%d-", | ||
| 24001 | percent99 (toppos - begv, zv - begv)); | ||
| 24002 | |||
| 24003 | if (zv <= botpos) | ||
| 24004 | strcat (decode_mode_spec_buf, "100%"); | ||
| 24005 | else | ||
| 24006 | sprintf (&decode_mode_spec_buf [strlen (decode_mode_spec_buf)], | ||
| 24007 | "%d%%", percent99 (botpos - begv, zv - begv)); | ||
| 24008 | |||
| 24009 | return decode_mode_spec_buf; | ||
| 24010 | } | ||
| 24011 | |||
| 23964 | case 's': | 24012 | case 's': |
| 23965 | /* status of process */ | 24013 | /* status of process */ |
| 23966 | obj = Fget_buffer_process (Fcurrent_buffer ()); | 24014 | obj = Fget_buffer_process (Fcurrent_buffer ()); |