From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#15396: permanent-local truncate-lines Date: Wed, 22 Nov 2017 14:20:47 -0500 Message-ID: <5x3756qfw0.fsf@fencepost.gnu.org> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1511378469 27299 195.159.176.226 (22 Nov 2017 19:21:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 22 Nov 2017 19:21:09 +0000 (UTC) User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) To: 15396@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 22 20:21:05 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHaZy-0006f8-32 for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Nov 2017 20:21:02 +0100 Original-Received: from localhost ([::1]:40986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHaa5-0008T1-Bb for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Nov 2017 14:21:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHaZz-0008Sk-Eo for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2017 14:21:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHaZy-0001GN-LG for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2017 14:21:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44413) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eHaZy-0001G8-Gn for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2017 14:21:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eHaZy-0006gD-7z for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2017 14:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Nov 2017 19:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15396 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15396-submit@debbugs.gnu.org id=B15396.151137845725646 (code B ref 15396); Wed, 22 Nov 2017 19:21:02 +0000 Original-Received: (at 15396) by debbugs.gnu.org; 22 Nov 2017 19:20:57 +0000 Original-Received: from localhost ([127.0.0.1]:53094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHaZt-0006fZ-EI for submit@debbugs.gnu.org; Wed, 22 Nov 2017 14:20:57 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46045) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHaZr-0006fN-9r for 15396@debbugs.gnu.org; Wed, 22 Nov 2017 14:20:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHaZl-00016w-JI for 15396@debbugs.gnu.org; Wed, 22 Nov 2017 14:20:50 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38805) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHaZl-00016s-Fs for 15396@debbugs.gnu.org; Wed, 22 Nov 2017 14:20:49 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1eHaZk-0006KX-2v; Wed, 22 Nov 2017 14:20:48 -0500 X-Spook: InfoSec Body scanner Looting Ruby Ridge Dock encryption X-Ran: Q%K2wjv'M;Y|UxN^n6Ui`b9fRDGSCzW1u4lNuMz*WFK=&TT_%Q}b9&8w=0cOp{lplvD X-Hue: green X-Attribution: GM In-Reply-To: (Glenn Morris's message of "Mon, 16 Sep 2013 13:41:17 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140248 Archived-At: 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;