From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] scratch/widen-less a4ba846: Replace prog-widen with consolidating widen calls Date: Thu, 30 Nov 2017 10:58:47 +0000 Message-ID: References: <20171129233237.27462.23351@vcs0.savannah.gnu.org> <20171129233238.504B5204F1@vcs0.savannah.gnu.org> <5d668ce5-1482-a3d4-c01b-7d996a532567@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1512039591 22681 195.159.176.226 (30 Nov 2017 10:59:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 30 Nov 2017 10:59:51 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Thunderbird/57.0 Cc: Tom Tromey , Vitalie Spinu To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 30 11:59:40 2017 Return-path: Envelope-to: ged-emacs-devel@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 1eKMZ4-0004ob-9Q for ged-emacs-devel@m.gmane.org; Thu, 30 Nov 2017 11:59:34 +0100 Original-Received: from localhost ([::1]:47325 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKMZB-0002Nc-Eu for ged-emacs-devel@m.gmane.org; Thu, 30 Nov 2017 05:59:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKMYX-0002NK-9q for emacs-devel@gnu.org; Thu, 30 Nov 2017 05:59:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKMYU-0006uu-7s for emacs-devel@gnu.org; Thu, 30 Nov 2017 05:59:01 -0500 Original-Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:44718) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eKMYU-0006ty-1H for emacs-devel@gnu.org; Thu, 30 Nov 2017 05:58:58 -0500 Original-Received: by mail-wm0-x22f.google.com with SMTP id t8so12178440wmc.3 for ; Thu, 30 Nov 2017 02:58:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=v3y9J3uMph7UsP6jqcsk8zoxiKXiweN3p+07yA7F/Yw=; b=rDZ9DlSgQznh92PQzVFrTgfhjM7EA1xFMHy/XkCkz/VUI3k6ETJ85aR2IeCB1sZ5Qt /7R2gI3hNI+NP2LzOh8b6aqv2Wl2thOCbGPh74MTxDdN0RjYZvJZb4aJ22FGKt1Npcnk zqPOhNGLt/RgwpVp45ST0yfHvUkcj+HHoGtupAW7V6cIRhbLUJfJbRplWnfU13jzni8N y6oteIQ40xRz6NBT5sIjwvC//0gNDm9G86cVGfL9KUto0bg8dmOWwkQu8K08sgzZg5CR zpuYFFuL1IYx9f+cFn1sv6LXwtG/4G6JejOY3CXXBzm0+OXNxPWIoK0BUK7g5WMHaZ52 ax/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:references:cc:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=v3y9J3uMph7UsP6jqcsk8zoxiKXiweN3p+07yA7F/Yw=; b=Mq1yiNSupl4EWFti7dA9XFkOno+I7y/feI2/KRhhsHkRWvJ20o+Uhb+a0KXVCh5gVt vluvVGtISFTug4NBdaDuQwap1FyskKMRohmqRs0YAKqTBOnsGWDZBUokN6gLpIh6kADc OCZfTcHxtQFEZ96Sz+8t3y2XZqgYQjaOUWYX9UV5pO2nqjqVtc0Boxzq0ZVtKC2cQ0vB wENHAkBteLWT/TOLKnaQXnPlJeNchJd1W7d9krQxAkew0aK0vU/LyZm8ffkcHdfykBs2 t4o250mUaOu2OEDFS3bHzH7BW5El28fkURf+/5TVgB9f+Y5YjBgzCuAvpn6qaVtRcq0n PSkQ== X-Gm-Message-State: AJaThX5Moev3VLRkbF9SqwvQDzkDtT8EYat0WbTnGKH/qotBjkhYIh5q 43jdkpRKpI7pHnQr4cECC/4= X-Google-Smtp-Source: AGs4zMYNlMhXFKX2rjU6T5Q6dWzI6xuA+WXhJDPSZHkguL4Nhshr4MDlLAGFmcUfFigDWyFtOtgfUg== X-Received: by 10.28.237.14 with SMTP id l14mr241250wmh.88.1512039536827; Thu, 30 Nov 2017 02:58:56 -0800 (PST) Original-Received: from [192.168.43.247] (46-52-237.wireless.cytamobile.com.cy. [46.199.52.237]) by smtp.googlemail.com with ESMTPSA id d73sm22216806wmh.3.2017.11.30.02.58.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Nov 2017 02:58:55 -0800 (PST) In-Reply-To: <5d668ce5-1482-a3d4-c01b-7d996a532567@yandex.ru> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:220536 Archived-At: On 11/30/17 8:59 AM, Dmitry Gutov wrote: > On 11/30/17 1:53 AM, Stefan Monnier wrote: >>>      Replace prog-widen with consolidating widen calls >> >> So, IIUC the idea is that the multi-major-mode framework will *have* to >> use narrowing to indicate to the sub-modes the boundaries of the current >> chunk, right? > > Yes. Just like it would *have* to bind prog-indentation-context to a > complex-ish value in the previous proposal. And while the difference isn't night and day, allow me to elaborate why I think this is a move in a good direction: - Major mode authors have been forgetting to widen in all the cases they actually have to. Or they would do that in indent-line-function, but forget in beginning-of-defun-function, etc. Now, they are *mandated* to obey the current narrowing (deleting code is easy, and some won't have delete anything at all). The indentation code might fail to work inside narrowing (like all of CC Mode, probably), but that's an orthogonal issue. - Multi-mode packages have been using narrowing for this purpose for years, so they won't have to change much. And, it's kind of funny, mhtml-indent-line which we've reviewed and added recently, uses narrow-to-region too. :-) While disregarding the second element of prog-indentation-context (which it set to the value "widen all you want"). Which works well enough because SMIE doesn't widen, and I've removed the `widen' call from js-mode indentation code 3.5 years ago. I'm adding Tom and Vitalie to Cc. Maybe they have something to add.