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: forward-comment and syntax-ppss Date: Sat, 17 Dec 2016 02:08:52 +0200 Message-ID: <2351cbb3-afe1-e9eb-f545-1eb0bba32094@yandex.ru> References: <83fd1db0-7362-6117-c5cd-715398c0dea4@gmail.com> <20161207220447.GA4503@acm.fritz.box> <20161208201517.GB3120@acm.fritz.box> <20161209190747.GC2203@acm.fritz.box> <5a70902f-882e-f616-74b2-df6eb81fc70c@yandex.ru> <20161211101715.GA14084@acm.fritz.box> <51c0554f-40d0-37a5-b134-17058343aa3f@yandex.ru> <54c62db5-08e9-38bd-e6f7-c571039d376a@yandex.ru> <9c16a23c-252a-40a7-bdcc-479b1113e4cb@default> <3102f0a0-88de-b1e6-9966-c4ece13a61af@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1481933353 7282 195.159.176.226 (17 Dec 2016 00:09:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 17 Dec 2016 00:09:13 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 Cc: Stefan Monnier , emacs-devel@gnu.org To: Drew Adams , Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 17 01:09:07 2016 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 1cI2Yk-0000Ei-CY for ged-emacs-devel@m.gmane.org; Sat, 17 Dec 2016 01:09:06 +0100 Original-Received: from localhost ([::1]:34815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cI2Ym-0006vB-S2 for ged-emacs-devel@m.gmane.org; Fri, 16 Dec 2016 19:09:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cI2Ye-0006ij-Rw for emacs-devel@gnu.org; Fri, 16 Dec 2016 19:09:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cI2Yb-0000BU-Mc for emacs-devel@gnu.org; Fri, 16 Dec 2016 19:09:00 -0500 Original-Received: from mail-wj0-x243.google.com ([2a00:1450:400c:c01::243]:35568) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cI2Yb-0000Aq-GN for emacs-devel@gnu.org; Fri, 16 Dec 2016 19:08:57 -0500 Original-Received: by mail-wj0-x243.google.com with SMTP id he10so16334350wjc.2 for ; Fri, 16 Dec 2016 16:08:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=C1BuaeNDsVSn3pz3n+9r9YLDyjMQ5G6B16rypKE74xw=; b=vbpuswKcOJhhgdbpvk8nLqpzUYJ/JnXgwrx9nTag1eYiF+onEyYxJiv4t7G7jA/7Bp b8Kd6VVR70/jOOTF7q3imsUKjLSpNptmQZQuzQAK6PAOJinu0xkiwOWpWTm4oTgMH1QG GNiIC/pTEhizBGsdzVWIJOU8Quq2nclqSFPyTOUoXZ8q835POlO8C32rYJtEcPno2isI GmlBu4OeSnZRNqIaQj52QoRp8LlbYNnyC/xdBKjEO8XobCN4SeieD62VP28kFHe0Xaej AMVDzcfyqdJj9CdMXb1CBX1jHoodmCYPWDE+kveIrSeuUvE8UWPX1VM3/nMkK9+16aij ykAQ== 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:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=C1BuaeNDsVSn3pz3n+9r9YLDyjMQ5G6B16rypKE74xw=; b=sqL7SaePxrdmiShqC6WNTnRxkjpm3KFrE6a/K+wgRr+NDTDBsO3SkPW7zS4Z5B0nC/ Uy5ci2EXdGhGG4pS/pdM9CDiADdN0Obl0JAFZPuLRpOcPL8FMx2GcLmlreYpJrRfnE3r RKlViieaCRccmkh2IFrfa958wCZ8zHQvNGv7vae/vtCjuPviRTs7vqWgsg3UZGa2utXk XcbuRmpA5Kgy2p04jHT0+EBVrKnfKxwwWU8QpEU0k6K/jvKVVrAUHkMIVC2egmHyJcxQ r2OnNouJHHn/GxMv95n2W3z9VxF09qVZjhcb1wVd5RuTdaL6L/1A1JB1wVZAgPm80Ra4 sEVA== X-Gm-Message-State: AKaTC03K2HBBlp3Ol7D5TcVmhUys8t0+2BLTRJfBj6V2+kh/fsntvwV54NK8TKBthaI6KA== X-Received: by 10.194.203.135 with SMTP id kq7mr5610098wjc.26.1481933335024; Fri, 16 Dec 2016 16:08:55 -0800 (PST) Original-Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id pd2sm8946394wjb.31.2016.12.16.16.08.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Dec 2016 16:08:54 -0800 (PST) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c01::243 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:210560 Archived-At: On 17.12.2016 01:16, Drew Adams wrote: > The fault here is not from the "other code" narrowing or > widening. It is from the "current code" calling such > "other code". Code needs to choose wisely any "other code" > that it tries to use. We don't have a lot of choice if we want to avoid code duplication. Simply copying it over and removing the widen call is not an option. > But if the called code is indeed defective - if it should > in fact restore the initial buffer restriction after it > widens or narrows to do its work, then that should be > fixed. The point is that "its work" does not honor the narrowing. And we want it to. > And in particular, you need to know how it handles a buffer > restriction - at least if you are _counting on_ some particular > behavior wrt that. You need to know whether you need to wrap > its call (or some other bits of your code) in `save-restriction', > for example. Knowing doesn't help either. > Or to otherwise set and save some restriction limits, and then > restore them at the proper time. Restriction limits are just > buffer positions. Setting and saving them is not rocket science. Doesn't help. > It sounds like you are complaining that when you use function > `abcde' it doesn't behave as you would like. Maybe consider > not trying to expect it to do something that it does not do? You're so eager to type out heaps of condescending text. Maybe try reading carefully next time? > possibly enhance the > code you were thinking about calling unwisely,... What do you think these discussions are all about? Shrugging and complaining about our collective bad luck? Of course it's about improving code, as well as the guidelines to do so regarding the usage of narrowing.