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: Re: Can we expand the valid location of "Local Variables" ? Date: Tue, 10 Mar 2020 16:44:44 -0700 Message-ID: <87mu8nbwr7.fsf@dima.secretsauce.net> References: <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="10204"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.2.0; emacs 28.0.50 Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 11 00:45:29 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 1jBoYy-0002W9-Rj for ged-emacs-devel@m.gmane-mx.org; Wed, 11 Mar 2020 00:45:28 +0100 Original-Received: from localhost ([::1]:41904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBoYx-0006Sd-S8 for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Mar 2020 19:45:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46396) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBoYO-0005Yo-Lw for emacs-devel@gnu.org; Tue, 10 Mar 2020 19:44:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jBoYN-0006MX-NO for emacs-devel@gnu.org; Tue, 10 Mar 2020 19:44:52 -0400 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:42175) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jBoYM-0006KE-Sz for emacs-devel@gnu.org; Tue, 10 Mar 2020 19:44:51 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 163EB3E1; Tue, 10 Mar 2020 19:44:48 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 10 Mar 2020 19:44:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secretsauce.net; h=references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; s=fm2; bh=m5AXllQFvBZ8erXR/hb+GFY1t8 o1FCUj/kcq+oeWsx0=; b=mue8Z74RVQNE8kQL+Vz/3l5uEXfKeKcIty0+qYebSX L34jL4ZegsPT/dH/F3HoSX4Hbm7Fq5oJMkLl3NkSFbi1h6eeW9z7kAa/Cv/ifdtL S07eKpywVr89j09SQkKx77Az3+WuA/h1RwkLVHhhmzQzvIArQPS9UalXgK3wMSYv jxpa1ohREhR4QWWu9lyv7yW1FdnA0aQk+8uTxCJLlQSG9kE7UCVlHWywl3Y1EtcI OTxY7zWJEXrlluIdYej55COOtPlKZSFNXd1todIY2txkbchuEmy4pNz63OlOp3/s M1oFOVviDWsQBJs31Itbphyp0+sgu2s652UO0cRMk0rQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=m5AXll QFvBZ8erXR/hb+GFY1t8o1FCUj/kcq+oeWsx0=; b=I9hlqcNThYxkNbk/7wQVQQ wSL9RxV/1bdjm3iIUMQgqDTmOpVmzuRb4Jn8dHp/hAWS9t+ZMlBJPiTm8hi/bpeS UoM3rOpoSq10YSB69Fk6ZpOs61vfvNfPWVmGNdyEkGyG5KYvDRDG5UXnF5aDjdl1 c1FVE2ppcOln8lqVrSLIKkoFavK9GqwG730Wvwd6cHnCP1MV6NcR1TDyA+NsfEA+ 5nIpDSmaY4ajkuiSDgatyzgc+QccHnDYA71DfK+YyH7x6BQDG8kEgKW5AbeRo+k/ JalqlGV6TEDc5mfwEFNBCGRmMLyq/8KYLZOp9LHaVrft8hM07Tq5GqyYDLZmpttA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddvuddgudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvufgjfffkgggtsehttdertddtredtnecuhfhrohhmpeffihhmrgcu mfhoghgrnhcuoehlihhsthhsseguihhmrgdrshgvtghrvghtshgruhgtvgdrnhgvtheqne cuffhomhgrihhnpegslhhotghkrdhorhhgnecukfhppeduledvrdduudelrddufedvrddv tdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlih hsthhsseguihhmrgdrshgvtghrvghtshgruhgtvgdrnhgvth X-ME-Proxy: Original-Received: from shorty.local (unknown [192.119.132.20]) by mail.messagingengine.com (Postfix) with ESMTPA id 56B713280063; Tue, 10 Mar 2020 19:44:47 -0400 (EDT) Original-Received: from dima by shorty.local with local (Exim 4.92.1) (envelope-from ) id 1jBoYH-0003CG-Nk; Tue, 10 Mar 2020 16:44:45 -0700 In-reply-to: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.123.25 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:245462 Archived-At: Stefan Monnier writes: >> Probably we'd want to make this into a variable? And the default maybe >> should be higher than 3000? > > I don't like having this 3000 hard-coded everywhere, so making > a variable makes sense. > > But encouraging large "Local Variables" blocks is a bad idea, IMO, so > I'd keep it at 3000 and I wouldn't care to document the var either. > I'd even be happy with a "--" in its name. OK. I can write such a patch. Is there an upside to not documenting it? If we REALLY don't want people touching this variable, then why not leave the hardcoded 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. > > Of course, you can use a short > > eval: (progn (re-search-backward "^(progn ;;local-config") (eval (read (current-buffer)))) > > and then put an arbitrarily long Elisp chunk anywhere else in the buffer > with a leading `(progn ;;local-config`. Oof. I COULD do that, but that feels like it makes an already-ugly thing even uglier. I sent a separate email to the org mailing list about maybe upstreaming some of the advices, but the general idea doesn't seem unreasonable to me: we already allow a block to define some custom variables, so customizing the behavior of some functions doesn't seem crazy.