diff options
| author | Gregory Heytings | 2022-07-06 00:43:56 +0200 |
|---|---|---|
| committer | Gregory Heytings | 2022-07-06 00:43:56 +0200 |
| commit | 38b3780f6e1bdcbb2a9a7dde76fa55da36e2774f (patch) | |
| tree | d0642db75c1bfbbe11e50d8f48511a9f1ea94f5a /src/buffer.c | |
| parent | 0463368a7b70dfc7914e5c5577c9690f8d0c4f7c (diff) | |
| download | emacs-38b3780f6e1bdcbb2a9a7dde76fa55da36e2774f.tar.gz emacs-38b3780f6e1bdcbb2a9a7dde76fa55da36e2774f.zip | |
Actually fix the long lines display bug (bug#56393).
* lisp/files.el (auto-narrow-mode): New minor mode.
(auto-narrow-pre-command-function, auto-narrow-post-command-function):
New auxiliary functions for the minor mode.
(auto-narrow-display-length, auto-narrow-widen-automatically): New
defcustoms for the minor mode.
(auto-narrow--widen-automatically, auto-narrow--isearch-widen-automatically,
auto-narrow--initialized): New internal variables for the minor mode.
* src/buffer.h (struct buffer): New internal variable for the minor mode.
(bset_auto_narrow__narrowing_state, BUFFER_AUTO_NARROWED_P): New
auxiliary functions.
* src/buffer.c (init_buffer_once, syms_of_buffer): New internal variable
for the minor mode. Update the docstring of mode-line-format.
* src/fileio.c (Finsert_file_contents): Detect whether the minor mode should
be entered when the buffer is displayed.
(syms_of_fileio): New defcustom for the minor mode.
* src/keyboard.c (syms_of_keyboard): New hook functions for the minor mode.
(command_loop_1): Execute the hook functions.
* src/xdisp.c (redisplay_window): Enter the minor mode when the buffer is
displayed.
(decode_mode_spec): Indicate when the minor mode is active
in the modeline. Indicate the buffer position relative to the whole buffer.
(set_vertical_scroll_bar): Indicate the buffer position relative to the
whole buffer.
(syms_of_xdisp): Two new symbols.
* lisp/isearch.el (isearch-widen-automatically): New defcustom.
(isearch-search): Use the new defcustom.
* lisp/bindings.el (mode-line-modes): Do not propertize the indication
in the modeline when the new minor mode is active.
* etc/NEWS: Announce the new minor mode, and remove the unobsoletion
indication for 'longlines-mode'.
* lisp/longlines.el: Reobsolete longlines-mode.
* doc/emacs/display.texi (Auto-Narrowing): New section, describing the new
minor mode.
(Display): Entry for the new section.
* doc/emacs/trouble.texi (Long Lines): Remove the section.
(Lossage): Remove the entry for the Long Lines section.
* doc/emacs/emacs.texi (Top): Remove the entry for the Long Lines section.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c index 509ce51b55e..d5b4292a21d 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5276,6 +5276,9 @@ init_buffer_once (void) | |||
| 5276 | XSETFASTINT (BVAR (&buffer_local_flags, tab_line_format), idx); ++idx; | 5276 | XSETFASTINT (BVAR (&buffer_local_flags, tab_line_format), idx); ++idx; |
| 5277 | XSETFASTINT (BVAR (&buffer_local_flags, cursor_type), idx); ++idx; | 5277 | XSETFASTINT (BVAR (&buffer_local_flags, cursor_type), idx); ++idx; |
| 5278 | XSETFASTINT (BVAR (&buffer_local_flags, extra_line_spacing), idx); ++idx; | 5278 | XSETFASTINT (BVAR (&buffer_local_flags, extra_line_spacing), idx); ++idx; |
| 5279 | XSETFASTINT (BVAR (&buffer_local_flags, auto_narrow__narrowing_state), idx); | ||
| 5280 | /* Make this one a permanent local. */ | ||
| 5281 | buffer_permanent_local_flags[idx++] = 1; | ||
| 5279 | XSETFASTINT (BVAR (&buffer_local_flags, cursor_in_non_selected_windows), idx); ++idx; | 5282 | XSETFASTINT (BVAR (&buffer_local_flags, cursor_in_non_selected_windows), idx); ++idx; |
| 5280 | 5283 | ||
| 5281 | /* buffer_local_flags contains no pointers, so it's safe to treat it | 5284 | /* buffer_local_flags contains no pointers, so it's safe to treat it |
| @@ -5662,7 +5665,7 @@ A string is printed verbatim in the mode line except for %-constructs: | |||
| 5662 | %p -- print percent of buffer above top of window, or Top, Bot or All. | 5665 | %p -- print percent of buffer above top of window, or Top, Bot or All. |
| 5663 | %P -- print percent of buffer above bottom of window, perhaps plus Top, | 5666 | %P -- print percent of buffer above bottom of window, perhaps plus Top, |
| 5664 | or print Bottom or All. | 5667 | or print Bottom or All. |
| 5665 | %n -- print Narrow if appropriate. | 5668 | %n -- print Narrow or Auto-Narrow if appropriate. |
| 5666 | %t -- visited file is text or binary (if OS supports this distinction). | 5669 | %t -- visited file is text or binary (if OS supports this distinction). |
| 5667 | %z -- print mnemonics of keyboard, terminal, and buffer coding systems. | 5670 | %z -- print mnemonics of keyboard, terminal, and buffer coding systems. |
| 5668 | %Z -- like %z, but including the end-of-line format. | 5671 | %Z -- like %z, but including the end-of-line format. |
| @@ -6363,6 +6366,10 @@ see `display-graphic-p'. | |||
| 6363 | If value is a floating point number, it specifies the spacing relative | 6366 | If value is a floating point number, it specifies the spacing relative |
| 6364 | to the default frame line height. A value of nil means add no extra space. */); | 6367 | to the default frame line height. A value of nil means add no extra space. */); |
| 6365 | 6368 | ||
| 6369 | DEFVAR_PER_BUFFER ("auto-narrow--narrowing-state", | ||
| 6370 | &BVAR (current_buffer, auto_narrow__narrowing_state), Qnil, | ||
| 6371 | doc: /* Internal variable used by `auto-narrow-mode'. */); | ||
| 6372 | |||
| 6366 | DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows", | 6373 | DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows", |
| 6367 | &BVAR (current_buffer, cursor_in_non_selected_windows), Qnil, | 6374 | &BVAR (current_buffer, cursor_in_non_selected_windows), Qnil, |
| 6368 | doc: /* Non-nil means show a cursor in non-selected windows. | 6375 | doc: /* Non-nil means show a cursor in non-selected windows. |