all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: 15396@debbugs.gnu.org
Subject: bug#15396: permanent-local truncate-lines
Date: Wed, 22 Nov 2017 14:20:47 -0500	[thread overview]
Message-ID: <5x3756qfw0.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <tqk3ig3br6.fsf@fencepost.gnu.org> (Glenn Morris's message of "Mon, 16 Sep 2013 13:41:17 -0400")

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); ++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;





      parent reply	other threads:[~2017-11-22 19:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16 17:41 bug#15396: permanent-local truncate-lines Glenn Morris
2013-09-16 17:56 ` Drew Adams
2013-09-17  1:09   ` Stefan Monnier
2013-09-17  1:07 ` Stefan Monnier
2017-11-22 19:20 ` Glenn Morris [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5x3756qfw0.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=15396@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.