From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#36190: 27.0.50; `put-text-property' etc. with buffer argument calls current buffer's `after-change-functions' Date: Tue, 18 Jun 2019 17:14:09 +0000 Message-ID: References: <83h88tzbly.fsf@gnu.org> <835zp9z4oj.fsf@gnu.org> <83y325xnk0.fsf@gnu.org> <83lfy4y5wm.fsf@gnu.org> <83lfy0td86.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="117311"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 36190@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 18 19:33:27 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hdHz1-000UBI-Sc for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Jun 2019 19:33:23 +0200 Original-Received: from localhost ([::1]:60564 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdHyw-0007R7-Ax for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Jun 2019 13:33:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38395) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdHhJ-0005Fh-0E for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 13:15:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdHhH-0005EF-Pl for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 13:15:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60204) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdHhG-00059i-40 for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 13:15:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hdHhF-0002XH-R1 for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 13:15:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Jun 2019 17:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36190 X-GNU-PR-Package: emacs Original-Received: via spool by 36190-submit@debbugs.gnu.org id=B36190.15608780969714 (code B ref 36190); Tue, 18 Jun 2019 17:15:01 +0000 Original-Received: (at 36190) by debbugs.gnu.org; 18 Jun 2019 17:14:56 +0000 Original-Received: from localhost ([127.0.0.1]:45515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdHh9-0002WX-VJ for submit@debbugs.gnu.org; Tue, 18 Jun 2019 13:14:56 -0400 Original-Received: from mail-ot1-f44.google.com ([209.85.210.44]:35720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdHh8-0002WE-1t for 36190@debbugs.gnu.org; Tue, 18 Jun 2019 13:14:54 -0400 Original-Received: by mail-ot1-f44.google.com with SMTP id j19so16006228otq.2 for <36190@debbugs.gnu.org>; Tue, 18 Jun 2019 10:14:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7/ISic70R2TQMmX+um6hcYdIhPHie5Av95NkGTHNsHk=; b=FV3AZDIuhQidGXMIDTJ8wUNR6mhFyrt6fx5Zv/f5XlnPlKuV/5mhZkUtREQ0NltIs1 d4zHS25z4UzPkIkx5jK7lpgtjQhy9IvhWKFdINRjYGun+9y9nxXFqRWr/xC38D1T/+O6 OGuzYK03NsI3OcSVnjI0gvm6/mixkjMdBc88C3XvHfCDY6P82s9LSJ4/qhrGwXND99qi mXsrWojsUT70R+2xKsnBMHpPFsh58BFGcQ/IRQLNC6giQUZwBjZQy7PyqfsyqI6ftM2P uSVveZeZjC9LgMPaL4dLJW/fwf7wguKh8wiOO+rdlrXZViXTsEMxPwyxgT8eiO/QfIfP CEOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7/ISic70R2TQMmX+um6hcYdIhPHie5Av95NkGTHNsHk=; b=ltPS2Ipw71M040rgqJNmskm+uTKqhCknP5qRe+Ezyc/ySoRKSGrRueu+tDBZpjkhsR VUQYKe2VmT0bOxvsJ3JjVNy+QjWPgw8JZwLTbSZrrd0EOTb5/dKeycr8C4xAoDrdQ4Zk PkYve5uKfV3A/IR3NbewlqZ3Y5qN4Wu3YKjHqiH3g02suczHI0qi4PbZnHvS4U7UOw6F qf5FUkN0/UPZ33lMVHttheX/CDh6OZSmWtsn0W9cjhjApaghGBlYoUbGY+4IgDjCeUOZ bgcBfE4PGAjgdt4eY+HZsCFH4MOk6N0bc2FvNATyVaHFngm/3ag5j0Fnk1XKToTQYSSq BxfQ== X-Gm-Message-State: APjAAAXxFECDT/n0qzW+jQ/aY7nH2c5dggbVOODk/B8zF2zjyO+9V8JK MsK6jMEEe7R0JPp7yWHh2uHs8gTUb2DEfLJ7GqI= X-Google-Smtp-Source: APXvYqyayGe6AjOtwgtSS0ErSyZGpesyYIpV+p4UQxbktUb/j3ED+Si79RhQoIg05f8rrzqmEo+CQhj/6lSl+UJN77A= X-Received: by 2002:a9d:664c:: with SMTP id q12mr5995320otm.175.1560878088403; Tue, 18 Jun 2019 10:14:48 -0700 (PDT) In-Reply-To: <83lfy0td86.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:160781 Archived-At: On Mon, Jun 17, 2019 at 3:58 PM Eli Zaretskii wrote: > > From: Pip Cet > > Date: Mon, 17 Jun 2019 11:38:38 +0000 > > Cc: 36190@debbugs.gnu.org > > > > > I wish we had a better alternative. > > > > > > > > (Such as not calling regular modification hooks for text property changes?) > > > > > > I thought about that, but I don't think this would be acceptable. > > > > It's certainly not something to be done on the spur of the moment, but > > it is something I feel Emacs did wrongly, perhaps because XEmacs did > > things differently, if I understand correctly. I'm not sure I'm aware > > of even a single place where text properties are used for something > > that's integrally part of buffer text. > > I don't think this i a part of the problem: applications that don't > want the side effects of text properties can use overlays instead. I've seen performance problems with overlays, and the subtle API differences made switching, for me, difficult. You're right, though, that this is certainly not part of this bug report, which I think the latest patch I sent would fix for now (although I'd be happy to see it fixed any other way, too). > > when someone has time to test things properly, is to rewrite all > > buffer-modifying functions to look like this: > > > > Lisp_Object hooks = run_before_change_hooks (...); > > modify_buffer (); > > run_after_change_hooks (hooks, ...); > > I think that'd be a welcome refactoring, if indeed this paradigm > doesn't break in some subtle use case (Emacs internals are frequently > like that). It would almost certainly be an observable change in behavior, but I'm testing something and it doesn't seem to fall apart entirely, at least. > > > > It was out of genuine interest, because passing NULL to implicitly > > > > specify a default argument is something that people advocate against, > > > > > > Not to specify the default, but to indicate that no action is needed > > > at all wrt the buffer. It is similar to the last argument to > > > 'strtol', for example. > > > > The `base' argument, you mean? > > Sorry, meant the penultimate argument, ENDPTR. Thanks again for explaining, I'll think about it more.