From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Patch] hard-widen-limits [was Re: Syntax tables for multiple modes [was: bug#22983: syntax-ppss returns wrong result.]] Date: Tue, 22 Mar 2016 22:22:57 -0400 Message-ID: References: <20160311151512.GD2888@acm.fritz.box> <874mc2dqtk.fsf@gmail.com> <87egb5cpmg.fsf@gmail.com> <87a8lsd4j3.fsf@gmail.com> <87mvpsbeok.fsf_-_@gmail.com> <87pounew9e.fsf@gmail.com> <87twjzda4h.fsf@gmail.com> <87lh5bd4ib.fsf@gmail.com> <87egb3ryjc.fsf@gmail.com> <877fgusum3.fsf@gmail.com> <8737risu8d.fsf@gmail.com> <87mvpqqxy7.fsf@gmail.com> <877fguqp8x.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1458699815 28787 80.91.229.3 (23 Mar 2016 02:23:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Mar 2016 02:23:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: Vitalie Spinu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 23 03:23:24 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aiYSC-00027w-Cr for ged-emacs-devel@m.gmane.org; Wed, 23 Mar 2016 03:23:24 +0100 Original-Received: from localhost ([::1]:40533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiYSB-0007CK-Em for ged-emacs-devel@m.gmane.org; Tue, 22 Mar 2016 22:23:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiYRx-0007BK-6d for emacs-devel@gnu.org; Tue, 22 Mar 2016 22:23:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiYRt-0000dq-13 for emacs-devel@gnu.org; Tue, 22 Mar 2016 22:23:09 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:52238) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiYRs-0000d3-S4 for emacs-devel@gnu.org; Tue, 22 Mar 2016 22:23:04 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CdDQA731xV/5a2xEVcgxCEAshgBAICgTw9EAEBAQEBAQGBCkEFg10BAQMBViMFCws0BwsUGA0kiDcIzyMBAQEHAQEBAR6LOoQtWAeELQEEnxeSFIIUgUUjgWZVgVkigTWBQwEBAQ X-IPAS-Result: A0CdDQA731xV/5a2xEVcgxCEAshgBAICgTw9EAEBAQEBAQGBCkEFg10BAQMBViMFCws0BwsUGA0kiDcIzyMBAQEHAQEBAR6LOoQtWAeELQEEnxeSFIIUgUUjgWZVgVkigTWBQwEBAQ X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="197856461" Original-Received: from 69-196-182-150.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.196.182.150]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Mar 2016 22:22:58 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id E10D0AE1F4; Tue, 22 Mar 2016 22:22:57 -0400 (EDT) In-Reply-To: <877fguqp8x.fsf@gmail.com> (Vitalie Spinu's message of "Tue, 22 Mar 2016 20:36:14 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:202121 Archived-At: > There is no real need to invent extra type of narrowing. It's a lot of extra > work with no additional benefit. I don't see any extra work. (narrow-to-region BEG END 'hard) would just be the API used to set your hard limits, and that's all there is to it. > If user typed within a hard region the hard narrowed region, will the > upper hard limit expand just as ZV does? This is indispensable, yes. No matter whether the hard limits are folded int narrow-to-region or any other way: the upper limit has to be a marker, and unless we strictly enforce that the hard limits can't be circumvented at all, the lower limit would probably have to be a marker as well. > My approach is simpler and leaves current narrowing functionality > alone. You set the limits and allow narrowing happening inside those > limits normally. That's also how I imagine (narrow-to-region BEG END 'hard) working. It just won't allow widening outside of those hard limits. > You might end up loosing text outside of the bounds if you modify the > buffer and then call widen, but that's by design and this is how it's > different from visual narrowing. Hard limits stay the same > irrespective of what happens to the buffer. Sounds like a wart. What's the benefit? >>> limits at the end. Problems will occur if major modes start using hard >>> limits in such contexts directly. >> I don't see any reason why problems *will* occur in that case (tho, of >> course, Murphy could be that reason). So until such problems do show up, >> I wouldn't worry. > The problem is not hypothetical. It's occurring right now. It can't because we don't have hard limits right now. Stefan