From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs) Date: Mon, 30 Mar 2020 15:21:10 -0400 Message-ID: References: <83o8sf3r7i.fsf@gnu.org> <2E218879-0F24-4A20-B210-263C8D0BEEA4@gmail.com> <87o8sdn0ot.fsf@gmail.com> <09E90C25-6119-44D4-85F2-A9CC4196FFE4@gmail.com> <83a73x3bh1.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="129767"; mail-complaints-to="usenet@ciao.gmane.io" Cc: akrl@sdf.org, =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= , Stefan Monnier , emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 30 21:21:55 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 1jIzyt-000XfS-Ny for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Mar 2020 21:21:55 +0200 Original-Received: from localhost ([::1]:55350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIzys-0000r8-Oe for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Mar 2020 15:21:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54184) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIzyF-0000Ka-Je for emacs-devel@gnu.org; Mon, 30 Mar 2020 15:21:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIzyE-0008NS-Gr for emacs-devel@gnu.org; Mon, 30 Mar 2020 15:21:15 -0400 Original-Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]:42214) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jIzyD-0008Ml-0h; Mon, 30 Mar 2020 15:21:13 -0400 Original-Received: by mail-qt1-x832.google.com with SMTP id t9so16147793qto.9; Mon, 30 Mar 2020 12:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=pgAiA7j+jZLlO6AO1VvCJea1xsF4hGHfem1geidr6+A=; b=fyeQbjagnbA/BH1I4troKkIpkQ8e2RvheEMYxujGooUUA+GvOFODZW5LIe3AOmGMzm eSnvDiZpqtAX29ETbyAuQCcdJ+kq6JWN6aL1NhYOYaO3v67KA7YOUHDooM3W2QOxTdvF U0CQ74KnMibbYxFhJQXCSXnXhxj4xG8GU20BfPt8RovjTlN/jd1A22sOaU6XlehretLD OHl7BrYDB9mQ9SpXFDBxjOzzyRUJ16gEAl7MJJij08mk465GJB6SPXH9SxJhn7tJpZVD oVf3MmDG/r8pB70iE/t+1HY2Yreiz+UB91HIxkgEy7PvMLFqCAE24fQG/DQQV4Qwe+k9 Akuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=pgAiA7j+jZLlO6AO1VvCJea1xsF4hGHfem1geidr6+A=; b=bwA6dQFb81n0w/Sv6Sv3TcwGaTeJC7CMz+IaHShRJNXEh1ts1A7TUdk6TD4eZ0Q2e+ cNWB9mYQJFG5WA890xXRbnN9tqrhOIFpRVULXw7XgHI8dk2Kq/LUFPOulvCrGQgRRa8h 8kIdwUjLV3oWDNVEkpLfOyw4T2yREAIR3L9wCuhnibSm1SAGfP1MYcwATYdyQ/w5xGN4 5v0CPoNQL5DxCsnpgo0/8ldxam0fWurMFlBC02bD/PZJ93H8OhphPTeCOX9bu6Usvk5N sbLt6PoLw0U2uvJiIoyVj1uoFGWYJy1Gx0JqAIk03P8sVGygDnnWGeTxyz91waNK8zxp I23A== X-Gm-Message-State: ANhLgQ1F4S8Ah3DaSwh1SXzy4qWU3ilaFiYUo1lp4eDxs1ubqKIVRcFq 1EIuVauRDpclaNTcWrZgP+kCNdK7GzPPwPOY X-Google-Smtp-Source: ADFU+vtTEtZySQYTLKrPIBs1ugSkhXdWr5zHazc5hCeosz2huQmy8QN/ShZRbfJ0K77GZUKgi6OzHg== X-Received: by 2002:ac8:6b4b:: with SMTP id x11mr1643345qts.118.1585596071874; Mon, 30 Mar 2020 12:21:11 -0700 (PDT) Original-Received: from [192.168.1.5] (c-174-60-229-153.hsd1.pa.comcast.net. [174.60.229.153]) by smtp.gmail.com with ESMTPSA id q15sm11898744qtj.83.2020.03.30.12.21.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Mar 2020 12:21:11 -0700 (PDT) In-Reply-To: <83a73x3bh1.fsf@gnu.org> X-Mailer: Apple Mail (2.3608.80.23.2.2) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::832 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:246063 Archived-At: > On Mar 30, 2020, at 3:10 PM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Mon, 30 Mar 2020 15:02:58 -0400 >> Cc: =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec , >> Eli Zaretskii , >> emacs-devel , >> Andrea Corallo >>=20 >>>> (In short, `dired-readin' binds `inhibit-modification-hooks' to t, = so >>>> the buffer changes caused by populating dired buffers are not = noticeable >>>> in `after-change-functions'.) >>>> I was wondering if I should report it as a bug, despite the = workaround >>>> not being particularly painful in this case (there's = `dired-after-readin-hook'). >>>=20 >>> I think it deserves a bug report, yes. >>>=20 >>>=20 >>> Stefan >>>=20 >>=20 >> Is it really a bug of dired-mode? Dired-mode probably has a good = reason to bind `inhibit-modification-hooks` to t. And if we provide such = feature (disabling after-change-functions), we should expect people = using it. Maybe there should be a reliable way to be informed of buffer = changes (that cannot be silenced). >=20 > I agree with Stefan: it's a bug. All dired-readin needs to do is call > the modification hooks after it's done reading in the directory. It's > just an optimization that it inhibits the hooks while it runs: read > the comments there and you will see why it is done. >=20 > IMO, inhibit-modification-hooks is for when some code makes a > temporary change, or a change that no one is supposed to care about, > like changing faces. Any other case is a bug. I see. Then I suggest mentioning it (when you should use the variable) = in the documentation of `inhibit-modification-hooks'. Yuan