[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#15396: permanent-local truncate-lines

From: Glenn Morris
Subject: bug#15396: permanent-local truncate-lines
Date: Wed, 22 Nov 2017 14:20:47 -0500
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Glenn Morris wrote:

> I wish truncate-lines was permanent local. Motivation:
> emacs -Q foo.txt
>    where foo.txt has lines longer than the frame width.
> M-x toggle-truncate-lines
>    now lines are truncated
> M-x revert-buffer   ; or even just change mode
>    now lines are untruncated again, grr

Here's a patch to enable this.

--- i/src/buffer.c
+++ w/src/buffer.c
@@ -5128,7 +5128,9 @@ struct mmap_region
   XSETFASTINT (BVAR (&buffer_local_flags, selective_display), idx); ++idx;
   XSETFASTINT (BVAR (&buffer_local_flags, selective_display_ellipses), idx); 
   XSETFASTINT (BVAR (&buffer_local_flags, tab_width), idx); ++idx;
-  XSETFASTINT (BVAR (&buffer_local_flags, truncate_lines), idx); ++idx;
+  XSETFASTINT (BVAR (&buffer_local_flags, truncate_lines), idx);
+  /* Make this one a permanent local.  */
+  buffer_permanent_local_flags[idx++] = 1;
   XSETFASTINT (BVAR (&buffer_local_flags, word_wrap), idx); ++idx;
   XSETFASTINT (BVAR (&buffer_local_flags, ctl_arrow), idx); ++idx;
   XSETFASTINT (BVAR (&buffer_local_flags, fill_column), idx); ++idx;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]