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: Mon, 18 Dec 2017 16:50:04 +0200 Message-ID: <1113b16e-8fe5-b43b-160c-4d4df9ed960e@yandex.ru> References: <8e5adcd7-e085-e8d2-085f-398c660cd34d@yandex.ru> <578E6C44-1D80-42BF-91A2-94C44355A1D8@sap.com> 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 1513608996 3395 195.159.176.226 (18 Dec 2017 14:56:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 18 Dec 2017 14:56:36 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Thunderbird/58.0 To: "Wedler, Christoph" , Eli Zaretskii , "monnier@iro.umontreal.ca" , "emacs-devel@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 18 15:56:32 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 1eQwqD-0000J0-Bv for ged-emacs-devel@m.gmane.org; Mon, 18 Dec 2017 15:56:29 +0100 Original-Received: from localhost ([::1]:42448 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQwsA-0001sU-47 for ged-emacs-devel@m.gmane.org; Mon, 18 Dec 2017 09:58:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQwkC-00028v-2z for emacs-devel@gnu.org; Mon, 18 Dec 2017 09:50:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQwk6-0002VL-1u for emacs-devel@gnu.org; Mon, 18 Dec 2017 09:50:16 -0500 Original-Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:43871) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eQwk5-0002SZ-Qt; Mon, 18 Dec 2017 09:50:09 -0500 Original-Received: by mail-wm0-x22c.google.com with SMTP id n138so29634497wmg.2; Mon, 18 Dec 2017 06:50:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9xKRXDeQKvIqUh95cDVbmKKoKbY11TKFNq0Ocg1GLeA=; b=NS9QcJdF+OpKRUw4BirepHB6xpwAoO+q1mU61clTNqlEf4kPOd1sq36l6NJt+uSbYm UYAcsHvjPXruf2bTFa7+0YO2rfExRWpl5zktnC/XTgc25VV1YQCDY1PKWO4cWPFQxTab PiSzKBg8ZCbz1FXJmyNOzAvVKye8K9IF1AmT6Ap00g5GTO7eZuHCw+/eXRhFCFSdZG91 6FLAzGMBHCkI/0PL9mml/opZQnJUAK6ktRbEUkrNvDfxOtF91/LuIQZxKStbTsuDh398 c75ArP8bxuPwaApVAuk2N4MLupYSJ5AGI+WhMicCYzNZpp+snJGLqjkaJ5i6VMtrDZLP YAzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9xKRXDeQKvIqUh95cDVbmKKoKbY11TKFNq0Ocg1GLeA=; b=CMIoA/FpN5ZLtBogpc20d61VvDfwCB4QdbnWO7X92NRZQJrzS9Zl1I87H3iRxMbpkj uHsOFILS2OkYIMu1SAD1dEDddy93wE1vBkyc3JZupGut3lmUPJJHATOqiVkVf51VvvYk PnBh8903Bp55tDlW009Az1ID8mGA8W03EI3ByCMg4DT/JxhkxyJzUlz0CXVGaKVuWX6E sJSMULiQ5Ru2qpOY+Twme4jRxai5aFcrsrljDzFcKEK6CxGC1gpryk5bTYjPaaiWAT/C MDiDFsNjc4L2dvX1zaC4elzhxqCEMO8WNQ7PsJuaX7CE+N1Tz7lNePCyb2BK0n0W4j5o ARZw== X-Gm-Message-State: AKGB3mJ/UPxLoCrH3sh69Lk20FO5x/u+7btIstTZiuw7oHYYVmW/xQBD h9jOfYPCYeJrKfn3FjlyDHZKhBs+ X-Google-Smtp-Source: ACJfBosRO9a0x4opj/lT6cO/lT1qxRwJfL/xgNA1PFDsccMQtsW/+CxvOan81GlghAEAdkfcVRfATg== X-Received: by 10.80.150.70 with SMTP id y64mr130515eda.223.1513608608439; Mon, 18 Dec 2017 06:50:08 -0800 (PST) Original-Received: from [192.168.0.133] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by smtp.googlemail.com with ESMTPSA id m1sm10547745ede.74.2017.12.18.06.50.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 06:50:07 -0800 (PST) In-Reply-To: <578E6C44-1D80-42BF-91A2-94C44355A1D8@sap.com> 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::22c 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:221217 Archived-At: On 12/18/17 2:39 PM, Wedler, Christoph wrote: >> I'm attaching a patch with some minor cleanup, though. > > To be honest, I am not so sure about the cleanup. I think it is better > to dynamically bind `syntax-ppss-cache' and `syntax-ppss-last' while > letting python-mode do its thing: neither should python-mode use the > cache state set from the ANTLR syntax, nor should antlr-mode later use > the syntax state set by pathon-mode. Or do I miss something? It shouldn't matter much either way, but in Emacs 26 syntax-ppss already checks that point-min has not changed since the last invocation. And it uses two caches under the hood: one for the "full" buffer, and another for the most recent narrowing. >> Please try it with a build of Emacs from the 'widen-less' branch. Do you >> know how to build it? > > It seems to have worked, even on a MacOS - good! To do it without much > Additional installation for the moment, I used > ./configure --with-ns --without-makeinfo --with-gnutls=no Good. Did you use the same recipe when testing the widen-less branch, though? I'm pretty sure you can't simply run ./configure when building from development sources (not a pre-built tarball). > Are you sure that you use antlr-mode 3.1.5 (not the one from Emacs)? Yes. > Everything works for me with Emacs-26.0.90, too – I also tried an empty > init.el… I'm saying I don't know what to check. Indentation certainly doesn't work the same, e.g. because the examples use a non-default indentation offset. But I'm not sure that's all. >>> Now to a mode with non-widening indentation function: emacs-lisp mode: >>> Consider the following code >>> (defun foo () >>> (+ 1 3)) >>> >>> I would assume that the indentation of line 2 does not change >>> when I narrow to line 2 - but Emacs-25.1.1 now deletes the first 2 >>> spaces of line 2... (yes; I also need to update to a newer Emacs) > >> Try out the widen-less branch! > > Ehem, still the same... Are you sure you tried the right branch? It works differently over here (namely: doesn't change the indentation). > Yes, using `js-indent-line' is a better example. > `c-indent-line' (c-indent-defun looks like a typo) is tricky - see my > ugly function `antlr-indent-line' (but I have a TODO...) I've pushed that change. If you have any more comments on the manual entry and it's written now, please let me know. > P.S. I will probably "borrow" (aka "steal") from mhtml-mode.el later... Sounds good!