From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#51766: 29.0.50; Return value of buffer-chars-modified-tick changes when buffer text is not yet changed before inserting a character for non-latin input methods Date: Thu, 11 Nov 2021 23:50:31 +0800 Message-ID: <87k0helmig.fsf@localhost> References: <87mtmalrs1.fsf@localhost> <837dde200c.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27745"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51766@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 11 17:09:56 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1mlCeB-00070g-R9 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Nov 2021 17:09:55 +0100 Original-Received: from localhost ([::1]:40528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlCeA-0004ji-Ow for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Nov 2021 11:09:54 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlCKw-0007bp-IR for bug-gnu-emacs@gnu.org; Thu, 11 Nov 2021 10:50:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58716) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mlCKw-0007Ay-9D for bug-gnu-emacs@gnu.org; Thu, 11 Nov 2021 10:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mlCKw-0008Ac-2T for bug-gnu-emacs@gnu.org; Thu, 11 Nov 2021 10:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Nov 2021 15:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51766 X-GNU-PR-Package: emacs Original-Received: via spool by 51766-submit@debbugs.gnu.org id=B51766.163664575731325 (code B ref 51766); Thu, 11 Nov 2021 15:50:02 +0000 Original-Received: (at 51766) by debbugs.gnu.org; 11 Nov 2021 15:49:17 +0000 Original-Received: from localhost ([127.0.0.1]:42029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlCKD-00089B-4q for submit@debbugs.gnu.org; Thu, 11 Nov 2021 10:49:17 -0500 Original-Received: from mail-pj1-f41.google.com ([209.85.216.41]:56225) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlCK7-00088s-OJ for 51766@debbugs.gnu.org; Thu, 11 Nov 2021 10:49:15 -0500 Original-Received: by mail-pj1-f41.google.com with SMTP id v23so4459103pjr.5 for <51766@debbugs.gnu.org>; Thu, 11 Nov 2021 07:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=stPsO9Uj/afuVuM2CGEGXBXBbMBR3oFBqSfi2cpuZrk=; b=eNbTTujX4EcGr5ANOipI+F2LWLqiloezhkFgHnB/h94xFPaVR7omPJ8G7zG5zGrEB7 ZJlGIERrJTzAKECrB+ZknVlT1P6APiFo1u62bnhcGPizq01CDWx4KVHLkj4xUZEA2Zm+ uuT9DKkNXgRUtNjtEykHKXyjvCRvMPb973Ogkr3/6Lg6cdwyNUiEqwY4uc2Y9cZkLTvp XT7lf8in7m5b/brmdeLSpqfW8X6J3ifiiAMGjkq3gSZcZIeQME4AqNHLhOcxT2QkqjqY zOWKz3tkKaHesodsod8/1nCCOzl5RTwuGWgAgUdWhXng5KN8sR1iQtPRt7IL25Zg2rNt 7GXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=stPsO9Uj/afuVuM2CGEGXBXBbMBR3oFBqSfi2cpuZrk=; b=VSIHAS6N6KX7tEz/oQHoHRjW655ljhXT9FYBGA5zBPE5Ui/1uIzmb3HUXYH/3JSqxP 1lfV5A2Lh/FqWksstGQZ3pRhLUkKPIIoIV4ZIOAZaQ1FkVXJPa7isZpdH6xJyHGqCyd/ olGLScGug3XzySdD3sAeHoZN5soPlq1JbGSDMB/LPBs942cOxFP9FdbgH6X3+SxouqW+ upGEG8OOzPZVDTmEbJYjPknIXxSKALGXzuSjkANaseb+AhvSM9Xe3FATVOVPThF5DLFx 4WjQXCzL4GRCbNL/rNe8MVEaluNwDU1x7jBI5tJk/PU3YARJd3Pg+63X+FQS2mp9qO0X /ZVA== X-Gm-Message-State: AOAM532ACkBZ6xD2pdvzl7qjQwBScGpIRsELW4TfNaoBRZotGNn+ZRM0 plwG3aXNfHuPpQ6uQeIJyX0= X-Google-Smtp-Source: ABdhPJwbS6LER5rOMA4j77EBb+5iSTdEbxCgCMWAu1lo2WSe91Q+k6MRgkV6Omj4y8rY4IbO5G/GpA== X-Received: by 2002:a17:90a:1bc5:: with SMTP id r5mr9214610pjr.90.1636645745712; Thu, 11 Nov 2021 07:49:05 -0800 (PST) Original-Received: from localhost ([103.125.234.210]) by smtp.gmail.com with ESMTPSA id a8sm3803230pfv.176.2021.11.11.07.49.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 07:49:05 -0800 (PST) In-Reply-To: <837dde200c.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:219650 Archived-At: Eli Zaretskii writes: > How do you know there was no changes in the buffer? You call your > function from pre/post-command-hook, but why is it guaranteed that > there was no change in the buffer between post-command-hook and the > following pre-command-hook? I also tested the bug by setting debug-on-entry for self-insert-command. Try the following: 1. emacs -Q 2. M-\ russian-computer 3. M-\ 4. M-: (buffer-chars-modified-tick) . Note the return value. 5. M-x debug-on-entry self-insert-command 6. Insert ?a 7. The debugger window appears. ?a is not yet inserted 8. In the debugger window: e M-p (call buffer-chars-modified-tick). The return value should be the same with 4. 9. Continue execution of self-insert-command in the debugger (c). The ?a is inserted 10. Repeat 8. The return value correctly changes. Note the return value. 11. Continue execution to exit the debugger window (c) 12. Switch to russian input method (M-\) 13. Run M-: M-p . Note the return value. It is same with 10. 14. Run M-: (buffer-hash) . "(buffer-hash)" should by yanked to avoid triggering debugger. Note that hash value. 13. Type ?=D1=84 (?a on qwerty keyboard) 14. The debugger appears again. ?=D1=84 is _not_ yet inserted 15. Repeat 8. The return value is different from 10 even though the buffer text is not changed (and it can be confirmed if you run e (buffer-hash) ) Of course, there might be some kind of invisible change in buffer. I.e. text is added and immediately deleted from the buffer without redisplay. However, even if there is any change like that, before-change-functions and after-change-functions are not triggered. That would be another bug then. Best, Ihor