From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.devel Subject: Can we expand the valid location of "Local Variables" ? Date: Tue, 10 Mar 2020 13:56:13 -0700 Message-ID: <87r1y0apzm.fsf@secretsauce.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="90144"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.2.0; emacs 28.0.50 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 10 21:57:11 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jBlw6-000NGo-7h for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Mar 2020 21:57:10 +0100 Original-Received: from localhost ([::1]:40172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBlw5-0003rm-9w for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Mar 2020 16:57:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37547) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBlvJ-0002S7-0i for emacs-devel@gnu.org; Tue, 10 Mar 2020 16:56:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jBlvG-0002S6-M4 for emacs-devel@gnu.org; Tue, 10 Mar 2020 16:56:19 -0400 Original-Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:35317) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jBlvG-0002O9-2q for emacs-devel@gnu.org; Tue, 10 Mar 2020 16:56:18 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 8D0B6849 for ; Tue, 10 Mar 2020 16:56:15 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 10 Mar 2020 16:56:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secretsauce.net; h=from:to:subject:date:message-id:mime-version:content-type; s= fm2; bh=jPM0FSoG+giKXXLXax8NFfO7etZdQrYW3qgdFQovqpY=; b=W11R1D61 4WLFUf7DRSJdhrIfNEkWcalGhJzTKDq7CRVbkqZmIbA0zeT7VWy8wGHdGEkiqNs9 QmWjtdxf88CFdj2XMMFx0CquM+Ea2H+5wG9wT7lhtDEZYTQflg/OTEx5cAlbNpPK eM+kdBCCVow13398t5haHWB8NQGdK0EpslCwBrY+42reMBmE1HdR6VluerR/4L9e eNzLQa406FtVB8sjjoc49Bn4VcyCD+1ulGbABdlX6ueTYkltqXe10EwKDo1sCl7L vAIo3VvjykhS0HArXVUHWRVYIG2Oc0Uysll5DMgT5dtdPv7DteYRRrqxLpEAsJxc 164lMe6U+tMiqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=jPM0FSoG+giKXXLXax8NFfO7etZdQ rYW3qgdFQovqpY=; b=2044dZtp61K8wKBoMfCsZChgVcomqwMCc2j3O9VD3f5ZF 1Bf0f3rGfUBDUH9GHiMB906u9bay31dH4hM0akgikvMrrsApK/GO5cyYXHi3RpAd RsbEPKDmQ3IdtGtrfCW79GiJdps6gE/ALHZZcVfXU/UHXywkq5j8mPh7HnzJgRao i5u+orrAG4aIy0rxhru8IJpKetFjte0lS9A0WxBZDkWHkzYMGyUmcKVgmW7Tud8J fPr+fdmKnAQJuzzVxVP7HPJqWC+zhJL6piqTV9xb+3NVc9oj9mRnWo3jVHrTUk3j 4cOXD+FqunxuhoaK6UGtctCgQRC57Y7MCBqzBlKYw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddvtddgudefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfgfhvffufffkgggtsehttdertd dtredtnecuhfhrohhmpeffihhmrgcumfhoghgrnhcuoeguihhmrgesshgvtghrvghtshgr uhgtvgdrnhgvtheqnecuffhomhgrihhnpehgnhhurdhorhhgpdgslhhotghkrdhorhhgne cukfhppeelkedrudejuddrudeffedruddvtdenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpeguihhmrgesshgvtghrvghtshgruhgtvgdrnhgvth X-ME-Proxy: Original-Received: from shorty.local (wsip-98-171-133-120.sd.sd.cox.net [98.171.133.120]) by mail.messagingengine.com (Postfix) with ESMTPA id D0D693280063 for ; Tue, 10 Mar 2020 16:56:14 -0400 (EDT) Original-Received: from dima by shorty.local with local (Exim 4.92.1) (envelope-from ) id 1jBlvB-0000tg-5m for emacs-devel@gnu.org; Tue, 10 Mar 2020 13:56:13 -0700 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.123.21 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245453 Archived-At: Hi. Currently we can specify buffer-local variables in a "Local Variables" stanza at the end of a buffer: https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables For efficiency reasons, emacs doesn't look for this stanza in the entire buffer, but only scans the last 3000 bytes. This is documented. It looks like this setting (3000 bytes) was there in the first revision of files.el back in 1991: http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/files.el?id=b4da00 At the time, extending this limit would presumably result in an observable performance penalty, but it's not 1991 anymore. Can we bump this up? The patch would be trivial, so I'm not attaching one yet. The locations in the source that currently hard-code this are: doc/emacs/custom.texi:1129:The start of the local variables list should be no more than 3000 doc/misc/calc.texi:31065:The Local Variables section must be within 3000 characters of the lisp/allout.el:6329: (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) 'move) lisp/calendar/diary-lib.el:2087: (max (- (point-max) 3000) (point-min)) lisp/cus-edit.el:4574: (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) lisp/files-x.el:172: (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) 'move) lisp/files.el:3723: (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) lisp/international/latexenc.el:150: (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) lisp/org/org-macs.el:189: (max (- (point) 3000) 1) lisp/progmodes/cc-mode.el:862: (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) 'move) lisp/progmodes/dcl-mode.el:1752: (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) 'move) Probably we'd want to make this into a variable? And the default maybe should be higher than 3000? The use case where I hit this was in an .org file that was defining a presentation where I needed to control the export with an eval: (progn ...) block. Org wasn't doing quite what I needed it to, so the block had some advice definitions in it, and that pushed the thing over the 3000 byte limit. I'm not subscribed to emacs-devel at the moment, so please Cc me in replies. Thanks!