From unknown Fri Jun 20 07:14:37 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#34765 <34765@debbugs.gnu.org> To: bug#34765 <34765@debbugs.gnu.org> Subject: Status: 26.1; with-temp-buffer should not run buffer-list-update-hook Reply-To: bug#34765 <34765@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:14:37 +0000 retitle 34765 26.1; with-temp-buffer should not run buffer-list-update-hook reassign 34765 emacs submitter 34765 Alexander Miller severity 34765 normal tag 34765 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 05 17:57:40 2019 Received: (at submit) by debbugs.gnu.org; 5 Mar 2019 22:57:40 +0000 Received: from localhost ([127.0.0.1]:33586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1J0E-0004o3-RH for submit@debbugs.gnu.org; Tue, 05 Mar 2019 17:57:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44093) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1J0C-0004no-Ks for submit@debbugs.gnu.org; Tue, 05 Mar 2019 17:57:37 -0500 Received: from lists.gnu.org ([209.51.188.17]:39190) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1J07-0006zM-9B for submit@debbugs.gnu.org; Tue, 05 Mar 2019 17:57:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1J04-0001MR-53 for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2019 17:57:31 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1J01-0006wF-2K for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2019 17:57:28 -0500 Received: from mout.web.de ([212.227.15.4]:36871) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1J00-0006vL-Kc for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2019 17:57:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1551826641; bh=j8TLZvCj6QgAHcYm+DVu06o4eCtU804kiU2xM5a0wtk=; h=X-UI-Sender-Class:To:Subject:From:Date; b=pju5m4jUEsXvcI/6A3qaVJSavGpuHR28PYwMctH0pqNF/5yObFTyeJKzULmIOIxIx UluApEU6XMp705Vv5BKayooAlovz3RUnTkGpu4qa2W0qittSXQfe91PJFDn1477jBL UZMRzZse726f4hGvoC4Xf2EFgZN2DUBPeF+DED6k= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.178.29] ([188.98.52.150]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LkVZr-1hXsfD3RPf-00cQGh for ; Tue, 05 Mar 2019 23:57:21 +0100 To: bug-gnu-emacs@gnu.org Subject: 26.1; with-temp-buffer should not run buffer-list-update-hook From: Alexander Miller Message-ID: <1bbe1e09-57d3-d8f1-47a9-db62c1d2b0a9@web.de> Date: Tue, 5 Mar 2019 23:57:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Provags-ID: V03:K1:IgiOXC9617WivchhaJ7gFkpKr5hnFlEFkQimx4st7V0yOkRF847 3yP3TkkxLeD4o5xno95q6LSpUNtZ5kN0F0sPE6uFblIjuwRtPGgIEqARCVAmeysNxxnUHp1 H6osHrE66RXMtlP9GuJZcMV18sFd5QbYbV5psVmA+hx0xZUHtxwIq2h+y/E5VTuCRwzgjWX 3BtNH86cgWYJKmjyT1Atw== X-UI-Out-Filterresults: notjunk:1;V03:K0:/XWPVY+1URI=:ykQ/0EUlwtvoNMvgO3FrkX o/3gSy8lK8QMG3KIny0M+pSEYHliO+W4ovxEmQV7e+FMFsjUpViGyqlaAERa5acgFYkskLPGW G1HySXhCZIZ1rV7OsMXTFxv27Rwgv4iwlxTf3qt83LcFJs4GdOFtkODsLyMNFnCoZCY1QwKIg qoy7sVg7M0858+o0yPkAJtGAI4Z/u3+99O41P/bD7W8aznBNlo8zeMzwWc6JLQTyq8w+May7Z ulFyY8b4bq9B7ope7zPXKqdagWyiBbTjcvbfW43LjiKnE5IbTl1h+6GSzF7Ui6dtZzpq+k70t pgopDXwkPQAsfzTppWeaESpdumPRrAtKzKrpG5dMFTgcPoPaVk//ARgAe4zeeCaXPmqbjhbYC 1fVyPhoXBLvOBogJDyxcyIXI/yvUv423mqZ/++2beRX0z39ES9aP4ZbzYrUhPQauxSXlT0mhX vQP2XtHRZjZWwZ7vJO+C7UMmkSroV/mkE8pJstqh2MkOMoJ2hnNaV1onzG2kIY2eMBymhJbrX F9p8j0kRajORJQBkTGwvowDNYPdj/RITKacp/0HMs/dKM194Fnc8AI61P3Nu7V/g1eoGMuiwV tLuOCzYpPiVR1VcekVmRW6ou9htEo5SNqFNiyC5eQbzudO2SWFSBo8U4l1riFCPUWpuubAYCT UcnHcUcGn1/RfrUoL/6svgnRatBDYCf5oqlBq+lTYAOGXpfr1sVt5VAgOVg3Bgg6MndByD91S wknFEUfKhoyoO2Byee5YCaSsv+V+otT7mA0AzDKghVh/WeKczbtX16jOihKa7/XZ253vtJcXm 32reIxayzG5VgZUoenBn00anhy2Yl251eb1haE7uSW8qAQkbCFCqu/3xwK2wOqd56XSPtGcQQ 0k8UN39bK2GW+gu+STOgx7jlAsDMr3Fp9e8LCs+G2akHZGvpIabc2DkVE6l3IUPdDQ0XUFVcS UHau1rtKStw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) To quote from the documentation of select-window: Selections that "really count" are those causing a visible change in the next redisplay of WINDOW=E2=80=99s frame a= nd should be always recorded. So if you think of running a function each time a window gets selected put it on =E2=80=98buffer-list-update-hook=E2= =80=99. A temporary buffer hardly fits these criteria. The problem is not just theoretical either. I have now run multiple times into situations where use of a temp buffer caused a feedback loop that makes buffer-list-update-hook fire permanently. For example a function called by buffer-list-update-hook uses with-selected-window, this causes a recalculation of the frame title, that calls format-spec, which uses a temp-buffer and we are back to step one. Granted this case is very specific to spacemacs and I am unable to reproduce it from emacs -q (with-selected-window does not recalculate the frame title here), but this is already the second time I've run into this (first time it was magit). So yeah, with-temp-buffer correction aside, if you have any advice how to avoid the issue on my end without going back to advising select-window that'd be great. In GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-07-05 built on juergen Windowing system distributor 'The X.Org Foundation', version 11.0.12003000 Recent messages: eval((spacemacs/title-prepare "%I@%SXXX")) redisplay_internal\ \(C\ function\)() spacemacs/title-prepare Mark set Mark saved where search started Quit [2 times] Mark saved where search started uncompressing format-spec.el.gz...done Note: file is write protected Configured using: 'configure --prefix=3D/usr --sysconfdir=3D/etc --libexecdir=3D/usr/lib =2D-localstatedir=3D/var --with-x-toolkit=3Dgtk3 --with-xft --with-modules 'CFLAGS=3D-march=3Dx86-64 -mtune=3Dgeneric -O2 -pipe -fstack-protector-str= ong -fno-plt' CPPFLAGS=3D-D_FORTIFY_SOURCE=3D2 LDFLAGS=3D-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES THREADS LIBSYSTEMD LCMS2 Important settings: value of $LC_COLLATE: en_GB.UTF-8 value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: global-mu4e-conversation-mode: t mu4e-conversation-mode: t global-magit-file-mode: t magit-file-mode: t global-git-commit-mode: t async-bytecomp-package-mode: t framey-mode: t helm-descbinds-mode: t helm-mode: t helm-flx-mode: t global-evil-surround-mode: t evil-surround-mode: t recentf-mode: t diff-auto-refine-mode: t treemacs-filewatch-mode: t treemacs-git-mode: deferred treemacs-fringe-indicator-mode: t evil-escape-mode: t global-display-line-numbers-mode: t display-line-numbers-mode: t global-git-gutter-mode: t git-gutter-mode: t company-flx-mode: t global-company-mode: t company-mode: t auto-compile-mode: t elisp-slime-nav-mode: t rainbow-mode: t goto-address-prog-mode: t bug-reference-prog-mode: t flycheck-pos-tip-mode: t global-flycheck-mode: t flycheck-mode: t yas-global-mode: t yas-minor-mode: t rainbow-delimiters-mode: t eros-mode: t global-subword-mode: t subword-mode: t eldoc-in-minibuffer-mode: t show-smartparens-global-mode: t show-smartparens-mode: t smartparens-mode: t winum-mode: t shackle-mode: t eyebrowse-mode: t evil-goggles-mode: t winner-mode: t save-place-mode: t savehist-mode: t which-key-mode: t override-global-mode: t global-undo-tree-mode: t undo-tree-mode: t shell-dirtrack-mode: t evil-mode: t evil-local-mode: t spacemacs-leader-override-mode: t global-spacemacs-leader-override-mode: t xterm-mouse-mode: t global-auto-revert-mode: t ido-vertical-mode: t global-page-break-lines-mode: t page-break-lines-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t prettify-symbols-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t hs-minor-mode: t Load-path shadows: /home/a/.emacs.d/elpa/26.1/develop/lv-20181110.1740/lv hides /home/a/.emacs.d/elpa/26.1/develop/hydra-20181128.1716/lv /home/a/.emacs.d/elpa/26.1/develop/ht-20181216.1137/ht hides /home/a/.emacs.d/core/libs/ht /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-screen hides /usr/share/emacs/26.1/lisp/org/ob-screen /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-id hides /usr/share/emacs/26.1/lisp/org/org-id /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-sass hides /usr/share/emacs/26.1/lisp/org/ob-sass /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-R hides /usr/share/emacs/26.1/lisp/org/ob-R /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-inlinetas= k hides /usr/share/emacs/26.1/lisp/org/org-inlinetask /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-dot hides /usr/share/emacs/26.1/lisp/org/ob-dot /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ox-texinfo hides /usr/share/emacs/26.1/lisp/org/ox-texinfo /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-asymptote hides /usr/share/emacs/26.1/lisp/org/ob-asymptote /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-indent hides /usr/share/emacs/26.1/lisp/org/org-indent /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-shell hides /usr/share/emacs/26.1/lisp/org/ob-shell /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-C hides /usr/share/emacs/26.1/lisp/org/ob-C /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-lilypond hides /usr/share/emacs/26.1/lisp/org/ob-lilypond /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-eval hides /usr/share/emacs/26.1/lisp/org/ob-eval /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-comint hides /usr/share/emacs/26.1/lisp/org/ob-comint /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-perl hides /usr/share/emacs/26.1/lisp/org/ob-perl /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-capture hides /usr/share/emacs/26.1/lisp/org/org-capture /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-clojure hides /usr/share/emacs/26.1/lisp/org/ob-clojure /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-ebnf hides /usr/share/emacs/26.1/lisp/org/ob-ebnf /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-clock hides /usr/share/emacs/26.1/lisp/org/org-clock /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-latex hides /usr/share/emacs/26.1/lisp/org/ob-latex /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-calc hides /usr/share/emacs/26.1/lisp/org/ob-calc /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-pcomplete hides /usr/share/emacs/26.1/lisp/org/org-pcomplete /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-macro hides /usr/share/emacs/26.1/lisp/org/org-macro /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-footnote hides /usr/share/emacs/26.1/lisp/org/org-footnote /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-datetree hides /usr/share/emacs/26.1/lisp/org/org-datetree /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob hides /usr/share/emacs/26.1/lisp/org/ob /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ox-org hides /usr/share/emacs/26.1/lisp/org/ox-org /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ox-beamer hides /usr/share/emacs/26.1/lisp/org/ox-beamer /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-plot hides /usr/share/emacs/26.1/lisp/org/org-plot /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ox-md hides /usr/share/emacs/26.1/lisp/org/ox-md /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-timer hides /usr/share/emacs/26.1/lisp/org/org-timer /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-picolisp hides /usr/share/emacs/26.1/lisp/org/ob-picolisp /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-ditaa hides /usr/share/emacs/26.1/lisp/org/ob-ditaa /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-eshell hides /usr/share/emacs/26.1/lisp/org/org-eshell /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-tangle hides /usr/share/emacs/26.1/lisp/org/ob-tangle /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-gnus hides /usr/share/emacs/26.1/lisp/org/org-gnus /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ox-icalendar hides /usr/share/emacs/26.1/lisp/org/ox-icalendar /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-forth hides /usr/share/emacs/26.1/lisp/org/ob-forth /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-css hides /usr/share/emacs/26.1/lisp/org/ob-css /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-ref hides /usr/share/emacs/26.1/lisp/org/ob-ref /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-sed hides /usr/share/emacs/26.1/lisp/org/ob-sed /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-J hides /usr/share/emacs/26.1/lisp/org/ob-J /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-table hides /usr/share/emacs/26.1/lisp/org/org-table /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-plantuml hides /usr/share/emacs/26.1/lisp/org/ob-plantuml /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-compat hides /usr/share/emacs/26.1/lisp/org/org-compat /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org hides /usr/share/emacs/26.1/lisp/org/org /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-element hides /usr/share/emacs/26.1/lisp/org/org-element /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-bibtex hides /usr/share/emacs/26.1/lisp/org/org-bibtex /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-lisp hides /usr/share/emacs/26.1/lisp/org/ob-lisp /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-python hides /usr/share/emacs/26.1/lisp/org/ob-python /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-protocol hides /usr/share/emacs/26.1/lisp/org/org-protocol /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-java hides /usr/share/emacs/26.1/lisp/org/ob-java /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ox hides /usr/share/emacs/26.1/lisp/org/ox /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-entities hides /usr/share/emacs/26.1/lisp/org/org-entities /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-hledger hides /usr/share/emacs/26.1/lisp/org/ob-hledger /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-macs hides /usr/share/emacs/26.1/lisp/org/org-macs /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-sql hides /usr/share/emacs/26.1/lisp/org/ob-sql /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-irc hides /usr/share/emacs/26.1/lisp/org/org-irc /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-mouse hides /usr/share/emacs/26.1/lisp/org/org-mouse /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-core hides /usr/share/emacs/26.1/lisp/org/ob-core /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-matlab hides /usr/share/emacs/26.1/lisp/org/ob-matlab /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-crypt hides /usr/share/emacs/26.1/lisp/org/org-crypt /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-table hides /usr/share/emacs/26.1/lisp/org/ob-table /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-scheme hides /usr/share/emacs/26.1/lisp/org/ob-scheme /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-bbdb hides /usr/share/emacs/26.1/lisp/org/org-bbdb /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-habit hides /usr/share/emacs/26.1/lisp/org/org-habit /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-mhe hides /usr/share/emacs/26.1/lisp/org/org-mhe /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-octave hides /usr/share/emacs/26.1/lisp/org/ob-octave /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-org hides /usr/share/emacs/26.1/lisp/org/ob-org /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-rmail hides /usr/share/emacs/26.1/lisp/org/org-rmail /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-maxima hides /usr/share/emacs/26.1/lisp/org/ob-maxima /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ox-ascii hides /usr/share/emacs/26.1/lisp/org/ox-ascii /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-exp hides /usr/share/emacs/26.1/lisp/org/ob-exp /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-version hides /usr/share/emacs/26.1/lisp/org/org-version /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-io hides /usr/share/emacs/26.1/lisp/org/ob-io /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-agenda hides /usr/share/emacs/26.1/lisp/org/org-agenda /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-abc hides /usr/share/emacs/26.1/lisp/org/ob-abc /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-makefile hides /usr/share/emacs/26.1/lisp/org/ob-makefile /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-lint hides /usr/share/emacs/26.1/lisp/org/org-lint /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-js hides /usr/share/emacs/26.1/lisp/org/ob-js /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-loaddefs hides /usr/share/emacs/26.1/lisp/org/org-loaddefs /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ox-man hides /usr/share/emacs/26.1/lisp/org/ox-man /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-ruby hides /usr/share/emacs/26.1/lisp/org/ob-ruby /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-awk hides /usr/share/emacs/26.1/lisp/org/ob-awk /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-duration hides /usr/share/emacs/26.1/lisp/org/org-duration /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ox-odt hides /usr/share/emacs/26.1/lisp/org/ox-odt /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-mscgen hides /usr/share/emacs/26.1/lisp/org/ob-mscgen /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-keys hides /usr/share/emacs/26.1/lisp/org/ob-keys /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-archive hides /usr/share/emacs/26.1/lisp/org/org-archive /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-gnuplot hides /usr/share/emacs/26.1/lisp/org/ob-gnuplot /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-stan hides /usr/share/emacs/26.1/lisp/org/ob-stan /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-w3m hides /usr/share/emacs/26.1/lisp/org/org-w3m /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-colview hides /usr/share/emacs/26.1/lisp/org/org-colview /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ox-html hides /usr/share/emacs/26.1/lisp/org/ox-html /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-fortran hides /usr/share/emacs/26.1/lisp/org/ob-fortran /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-groovy hides /usr/share/emacs/26.1/lisp/org/ob-groovy /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-list hides /usr/share/emacs/26.1/lisp/org/org-list /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-faces hides /usr/share/emacs/26.1/lisp/org/org-faces /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-lob hides /usr/share/emacs/26.1/lisp/org/ob-lob /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-eww hides /usr/share/emacs/26.1/lisp/org/org-eww /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-lua hides /usr/share/emacs/26.1/lisp/org/ob-lua /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-feed hides /usr/share/emacs/26.1/lisp/org/org-feed /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-sqlite hides /usr/share/emacs/26.1/lisp/org/ob-sqlite /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-haskell hides /usr/share/emacs/26.1/lisp/org/ob-haskell /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-src hides /usr/share/emacs/26.1/lisp/org/org-src /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-install hides /usr/share/emacs/26.1/lisp/org/org-install /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-emacs-lisp hides /usr/share/emacs/26.1/lisp/org/ob-emacs-lisp /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-shen hides /usr/share/emacs/26.1/lisp/org/ob-shen /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ox-latex hides /usr/share/emacs/26.1/lisp/org/ox-latex /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-mobile hides /usr/share/emacs/26.1/lisp/org/org-mobile /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-processing hides /usr/share/emacs/26.1/lisp/org/ob-processing /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-attach hides /usr/share/emacs/26.1/lisp/org/org-attach /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-ledger hides /usr/share/emacs/26.1/lisp/org/ob-ledger /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-ctags hides /usr/share/emacs/26.1/lisp/org/org-ctags /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ox-publish hides /usr/share/emacs/26.1/lisp/org/ox-publish /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-ocaml hides /usr/share/emacs/26.1/lisp/org/ob-ocaml /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-vala hides /usr/share/emacs/26.1/lisp/org/ob-vala /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-info hides /usr/share/emacs/26.1/lisp/org/org-info /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/org-docview hides /usr/share/emacs/26.1/lisp/org/org-docview /home/a/.emacs.d/elpa/26.1/develop/org-plus-contrib-20181230/ob-coq hides /usr/share/emacs/26.1/lisp/org/ob-coq Features: (shadow sort mail-extr emacsbug helm-command evil-nerd-commenter evil-nerd-commenter-operator evil-nerd-commenter-sdk smartparens-html sgml-mode helm-xref semantic/symref/grep grep semantic/symref helm-ag helm-elisp helm-eval org-indent org-table company-shell fish-mode org-clock diary-lib diary-loaddefs cal-iso vc-mtn vc-hg org-eldoc ob-python ob-shell org-bullets org-download toc-org org-eww org-rmail org-mhe org-irc org-info org-gnus nnir gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range gnus-win gnus nnheader org-docview org-bibtex bibtex org-bbdb org-w3m smartparens-org org-habit german-holidays org-agenda org-mu4e mu4e-conversation shr svg dom gnus-dired mu4e desktop frameset mu4e-speedbar mu4e-main mu4e-view mu4e-headers mu4e-compose mu4e-context mu4e-draft mu4e-actions rfc2368 smtpmail sendmail mu4e-mark mu4e-message flow-fill html2text mu4e-proc mu4e-utils doc-view jka-compr image-mode mu4e-lists mu4e-vars mu4e-meta orgit org-element avl-tree generator org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint ob-keys org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp ob-core ob-eval org-compat org-macs org-loaddefs cal-menu calendar cal-loaddefs swiper ivy delsel colir ivy-overlay tabify debug macrostep semantic/find helm-semantic helm-imenu semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet mwim eieio-opt speedbar sb-image ezimage dframe face-remap gravatar url-cache ffap magit-gitflow treemacs-magit evil-magit git-rebase forge-list forge-commands forge-semi forge-bitbucket buck forge-gogs gogs forge-gitea gtea forge-gitlab glab forge-github ghub-graphql treepy graphql ghub let-alist forge-notify forge-revnote forge-pullreq forge-issue forge-topic forge-post forge-repo forge forge-core forge-db closql emacsql-sqlite emacsql emacsql-compiler magit-bookmark magit-submodule magit-obsolete magit-popup magit-blame magit-stash magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func magit-diff smerge-mode magit-core magit-autorevert magit-margin magit-transient magit-process magit-mode transient git-commit magit-git magit-section magit-utils crm log-edit message rfc822 mml mml-sec epa gnus-util rmail rmail-loaddefs mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log with-editor async-bytecomp flx dired dired-loaddefs helm-x-files helm-for-files helm-bookmark helm-adaptive helm-info helm-external helm-net browse-url xml framey helm-descbinds helm-mode helm-files helm-buffers helm-tags helm-locate helm-grep helm-regexp helm-utils helm-help helm-types helm-flx helm helm-source helm-multi-match helm-lib async cl-print evil-surround edebug lsp-treemacs recentf vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc vc-dispatcher company-lsp importmagic epc ctable concurrent deferred flycheck-rust lsp-ui-flycheck lsp-ui lsp-ui-doc smartparens-markdown markdown-mode lsp-ui-imenu lsp-ui-peek lsp-ui-sideline view lsp-clients dash-functional lsp lsp-mode tree-widget spinner network-stream starttls em-glob esh-util flymake-proc flymake hi-lock evil-matchit evil-matchit-sdk smartparens-python python tramp-sh tramp tramp-compat tramp-loaddefs trampver ucs-normalize parse-time vc-git diff-mode treemacs-evil treemacs treemacs-compatibility treemacs-mode treemacs-interface treemacs-extensions treemacs-persistence treemacs-mouse-interface treemacs-tag-follow-mode treemacs-filewatch-mode treemacs-tags imenu treemacs-follow-mode treemacs-rendering treemacs-async treemacs-faces treemacs-icons treemacs-workspaces treemacs-dom treemacs-visuals treemacs-fringe-indicator treemacs-impl treemacs-macros pfuture ace-window avy treemacs-customization bookmark pp evil-escape display-line-numbers git-gutter-fringe fringe-helper git-gutter company-flx company-files company-keywords company-etags company-gtags company-template company-dabbrev-code company-dabbrev company-yasnippet company-capf company-quickhelp company overseer pkg-info url-http tls gnutls url url-proxy url-privacy url-expand url-methods url-history mailcap url-auth url-cookie url-domsuf url-util url-gw nsm rmc puny epl compile auto-compile packed elisp-slime-nav etags xref rainbow-mode goto-addr bug-reference flycheck-pos-tip pos-tip flycheck-ledger flycheck json map find-func hideshow yasnippet-snippets yasnippet rainbow-delimiters elec-pair evil-cleverparens evil-cleverparens-text-objects evil-cleverparens-util paredit eros cap-words superword subword doom-modeline doom-modeline-segments doom-modeline-env doom-modeline-core project shrink-path eldoc-eval all-the-icons all-the-icons-faces data-material data-weathericons data-octicons data-fileicons data-faicons data-alltheicons memoize inline powerline powerline-separators color powerline-themes smartparens-config smartparens-text smartparens winum shackle trace eyebrowse evil-goggles pulse f s dash server winner xterm-color saveplace savehist noutline outline gh-common marshal hybrid-mode evil-evilified-state which-key use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key use-package-core hydra lv cus-edit cus-start cus-load evil evil-integration undo-tree diff evil-maps evil-commands reveal flyspell ispell evil-jumps evil-command-window evil-types evil-search evil-ex shell pcomplete comint ansi-color evil-macros evil-repeat evil-states evil-core evil-common windmove thingatpt rect evil-digraphs evil-vars ring bind-map quelpa mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045% From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 06 04:39:17 2019 Received: (at 34765) by debbugs.gnu.org; 6 Mar 2019 09:39:17 +0000 Received: from localhost ([127.0.0.1]:33749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1T1A-0005qC-O0 for submit@debbugs.gnu.org; Wed, 06 Mar 2019 04:39:16 -0500 Received: from mout.gmx.net ([212.227.17.20]:39539) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1T18-0005py-Um for 34765@debbugs.gnu.org; Wed, 06 Mar 2019 04:39:15 -0500 Received: from [192.168.1.101] ([212.95.5.147]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MD9uq-1gkzOi17Xg-00Gb52; Wed, 06 Mar 2019 10:39:08 +0100 Message-ID: <5C7F9535.204@gmx.at> Date: Wed, 06 Mar 2019 10:39:01 +0100 From: martin rudalics MIME-Version: 1.0 To: Alexander Miller , 34765@debbugs.gnu.org Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <1bbe1e09-57d3-d8f1-47a9-db62c1d2b0a9@web.de> In-Reply-To: <1bbe1e09-57d3-d8f1-47a9-db62c1d2b0a9@web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:LysVBaCH1q+7Px38F8p4R5ddxGpDZCRroHUh8UAVfQloLVonQ05 Mblwc+tWWcX3Wesd+Ot/8YIkFIRj5xXI8DXhv6CrlrRV1kpdPdD6BaZUcNxHcClk9fpNsxM o9820AgQ+oOJVGBkNAc8HhMTF7y0G8ojAwdkmvsdXvrY0w2l363ttBcoHyduwuofn/xFPgW dqPTywVS706DqmIQWgl/Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:S6kfbRIEJ8E=:2/X6/9OYUKJS591QTByqpv lG+oVE+ohnJNs6BvaiwNYcaIj0TTwQevVJdpkokeOy1xHGLma+5MMc1/F64+I+VFTWk+ui1Pj Oq0WNVYUya9fJanTeNcFelvQC1B6vsCvTonbeyGH4XTPyE19X21Lyz6dmZjz1A5SBk+ZR6cfz BWj+ylyAweVzgCYFvn/bNkW4M/Zuak9dldDQIj1rPZnQsTNpM3CbEQouIIuty/bkZAo5h3JY2 shQ9YYb1+6a0vyavHWBFnid1k4W9sf/BvV9m2wzS/QRUe+43H2Ohua53CwyA3hSmJcv+X859B Jd/atKIiZemyZ1FSUaGjGG59sw1l00qiKX60bpHCPdAh4gHKS432UXt8Gi4p6HQpbU1eOJoSe KcjbtDHncgJ2p7rlXhJzH1SALcrxPYvoMoualqwqCLiO3pekHu8emv0D7DGuW0xfscJln6GLQ fkKrXKqGyP3QJS7whdpx5AlXrIRQVm0T4wNegakuCtb8FIBj0nFiyHnTrVNg0FlQlLH2y1oqe S1H8crVX/prxDqzs6qzBnypQaLMOmE5awKWJ4j6dz6TIKo+BkCSdOdkCa3J48d5f5r0y3y7aH SyUV6kPiZeoFKRbQ86aXtCZYK2LU21KqqrdbhOOzF2Oe05iA175xrRLX63pRRRV+JMnKRmG1V TIlj3EUZY2cjf6rNNoY7/yWiW8YJVykxQPuXFuygzSqx3twmVbBHUnarm3GKIEzEoaC2Pz5oT fmi5/aslmPbOp+9BQCtjdq03Ktg9yQgFId8KLt9IrDeJX1IGPQ6vOcolKI3Fq+e5fvfCsK0nl TfQtfQEKmSlfuqp2ySEJ8WYeOl+UX6cfQ8mboKUN9AsauaPWmI3eBaHp6GxnkDdLaCb8R1aQ+ GYCmRIZzCbfa9z9G7LWqcJehAS9viZTVAC8n6AR+MIWyOgm5wLmtd3C2tmODbgcPdGEW+af79 pq+n42u+iUA== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > To quote from the documentation of select-window: > > Selections that "really count" are those > causing a visible change in the next redisplay of WINDOW=E2=80=99s fra= me and > should be always recorded. So if you think of running a function each > time a window gets selected put it on =E2=80=98buffer-list-update-hook= =E2=80=99. > > A temporary buffer hardly fits these criteria. You're probably right but there's not much we can do in this regard. When you show a temporary buffer and temporarily show another buffer in the same window, there must be a way to show the temporary buffer again. That's why we have to run 'buffer-list-update-hook' for them. > The problem is not just > theoretical either. I have now run multiple times into situations wher= e > use of a temp buffer caused a feedback loop that makes > buffer-list-update-hook fire permanently. For example a function calle= d > by buffer-list-update-hook uses with-selected-window, this causes a > recalculation of the frame title, that calls format-spec, which uses a= > temp-buffer and we are back to step one. Granted this case is very > specific to spacemacs and I am unable to reproduce it from emacs -q > (with-selected-window does not recalculate the frame title here), but > this is already the second time I've run into this 'with-selected-window' calls 'select-window' with NORECORD non-nil, so this should not be the culprit. I'm afraid you have to dig further to find out how 'buffer-list-update-hook' precisely gets called here. > (first time it was > magit). What was the issue there? > So yeah, with-temp-buffer correction aside, if you have any advice how= > to avoid the issue on my end without going back to advising > select-window that'd be great. Emacs 27 now has 'window-selection-change-functions', strongly tied to redisplay and triggering only when the window selection has changed since last redisplay. Maybe you could try that. martin From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 06 06:29:40 2019 Received: (at 34765) by debbugs.gnu.org; 6 Mar 2019 11:29:41 +0000 Received: from localhost ([127.0.0.1]:33786 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1Uk0-0008S8-Iq for submit@debbugs.gnu.org; Wed, 06 Mar 2019 06:29:40 -0500 Received: from mout.web.de ([212.227.17.12]:50707) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1Ujy-0008Rn-HF for 34765@debbugs.gnu.org; Wed, 06 Mar 2019 06:29:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1551871771; bh=0mc+zA3pT+cszthChA5z/LCcYEuJsVYmzGOasIUdP5g=; h=X-UI-Sender-Class:To:Cc:Subject:From:Date; b=NvXYoEkrpM7bY7W64F/zql25RdMxA8nWKFIrDkZFVReybRRbam2Zku2hVHv299TJk B1mtyZkydittj1QPb8llHBUIhmsHLyrlByYAv6mxEDC6/6aznLb/hbbLOSROrwaVbA 5kLP8BVOY0Qe3l+/rgqAK3VQ+VNUy/Fh86F+Op8E= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.178.29] ([94.216.180.250]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LyDdJ-1h4Qfe34Sr-015dhu; Wed, 06 Mar 2019 12:29:31 +0100 To: rudalics@gmx.at Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook From: Alexander Miller Message-ID: Date: Wed, 6 Mar 2019 12:29:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Provags-ID: V03:K1:KVO2NAqI2iyjrg6b0BCnNK2xmua2wiBggMdD59DGLIfzKR1G3m/ o8y9wY4Mv8/Tl5RGd3T3uUuaIgnGun22iyx36vKh5Ii2OIB5ehG3/an4WB6WowJk1vPg+rn 0YZt/ccAW9TeNm8uUawLd4Ke/FJFvayKDy8WgHmUz73teimHyJIB2O0fLMtAnvENc7LlsH7 8NnlQca5AUkRhPTF9b2zw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:AxCZrPT+/20=:W4aRx7q90yOgEZ0jtceIYM I6QwRWY/+ydo/KwTUhmtI6t3mLwKWhQSCRJ1xzWHHaWb745cqAZKcRyC8EZDoTlrGmv8Jg3Md W0ylN/q04LEJsCgcCwK5R+jmP46nagZFD3gDC+KQrvujeJIXn+fMhtv5+v/61wiHDCtZ/ic/E 9YaqfZ9pkthu1X6vdN3Tz2VssLiXF3kotYch6AxLuI0gpLrAg3r4pur+XX/TOy9Bu5iu0ERzx iYN8y+SSr6bt6u6Z2La7H0uweuB7w+pHgQeQfwcDUoex8yBigi7uXHwx9GKAuuIjydGJKimwP m+0cKKHbw2brLaiFbSWcXvig1veduYbBzXdSNYoNUwl6TGE06TdIFUsAZAcuS73PNLEcKml+0 PRqv+YW62ccxl6PZAO4heO0bQQxLxLGjaoJDIlrN4aA4ko1QKgSv+Zbz4PGHSEnvOJ+DJWt/q d3UpUUstxQk1DAWpzyCONEjJvmfZgZThxgw5GPCRErtYDnFLNabMlXZe6nSyRs7rji+7vsyI8 MK4DixIDuvuHB/HJQxj5VH0MjI1gFLBy7JRkdk8jFsRTZqevJYUXE+U74sZdLZ9Zo0nDAfFtl boG0u9jsnO5SpJCei1iIp+jNYCAXF4nwc+Tzoc24XJi1U7ZhJxbYzHHzej9zITRQeI/TCtrnq eipcGXzVVXYdeGp4jZmPl8JeuZ0KAY86P7vRd+ecg2weA4ITva0aeYY2EpPQE3HoXf2u2kn7m 1XWoSVNFJOsKctucBx95l3PERXOA/+bDDss+5ZEwlRVhQyMyoAI400fgkBDbsDJ223dRNWWhd x+XHXH9NM/u9yYBRWHw0HvndScbTnJII3pIVV7+3JNsx+dXMMghEIYUGRN2Uxc4vHKa8Kd7fD EckQOVk3tE2WaF0UfZtGZia7BAwDo8fYxNwibUaxJKqywbfOGMnDqdM1Ls92NRjEvSnYEF8Td HxKnbPVlYwQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > When you show a temporary buffer and temporarily show another > buffer in the same window, there must be a way to show the temporary > buffer again. I do no understand the use-case you have in mind here. with-temp-buffer serves to create a short-lived temporary buffer that is quickly disposed of again. When would such a buffer be shown anywhere? > I'm afraid you have to dig further to find out how > 'buffer-list-update-hook' precisely gets called here. Did that, turns out it's down to mode-line packages, both powerline and doom-modeline are advising select-window. I'll create PRs for both. > What was the issue there? Same feedback loop as described above, except it would only happen when a region was active in magit's status buffer. I had tracked the cause to a temp buffer deep inside magit's internals. Here's the github link: https://github.com/magit/magit/issues/3738#issuecomment-464520582 > Emacs 27 now has 'window-selection-change-functions', strongly > tied to redisplay and triggering only when the window selection has > changed since last redisplay. Maybe you could try that. This problem occurs in my treemacs package, so I cannot use a solution provided by a bleeding edge release, my modus operandi is to support the last 2 versions of emacs, so 25 and 26 (since stable distros like debian still use emacs 25). At any rate I have found the culprit in those modeline packages, so that point is solved. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 06 09:13:54 2019 Received: (at 34765) by debbugs.gnu.org; 6 Mar 2019 14:13:55 +0000 Received: from localhost ([127.0.0.1]:33858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1XIw-0005ys-Kd for submit@debbugs.gnu.org; Wed, 06 Mar 2019 09:13:54 -0500 Received: from mout.gmx.net ([212.227.17.22]:45599) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1XIu-0005yf-Hd for 34765@debbugs.gnu.org; Wed, 06 Mar 2019 09:13:53 -0500 Received: from [192.168.1.101] ([212.95.5.147]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M8MyE-1hDxoR1KAU-00vwBZ; Wed, 06 Mar 2019 15:13:45 +0100 Message-ID: <5C7FD591.9090505@gmx.at> Date: Wed, 06 Mar 2019 15:13:37 +0100 From: martin rudalics MIME-Version: 1.0 To: Alexander Miller Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:oBuwqfujmagiEID/lPH3WL7ydMsYZwZLtxdtFIoRph6jbk5amto fRZKLbn6AwI67z4wgGxzS2po/9stabLRSWjTkuCkzGjEjBnb+5BlBo1ZS4cWYl8E3fpa3Gw vgO2Gw2IGGxaDvrXDPQ6tavUnHY3r0z2BeZ8C3G6V03uzNYjtIoEZpW3lu+6/vG0GPPw2bU EBxr75fAPzKFcon+t4BFA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:nc1RLKjKdXI=:Jmvxmpwp9mO4bDbaOCe0ck tLpqqTvbB3U2PVCd6w8jMiHT/1S5EjOw4kM3Fvwr3r79mvX9f9orGYwA7l41Vk9AFbra33gsv yeswxogFPkhwDz9gWeahxB1RNng5m3pl8Nh552yFyiWUS6KCmORQ1mM0TL3ndyRowkj7K9NX/ PleGXsjXTBGsI0l7R5PX1Hy+1vOsn2RtNZo/xfXjo8WWOR/U8ZZZaLDSLdDqEbenhwZyTnict Rp5fQ3tAdQ4dWNGsMpCGUhls/Bx/cpWrlAaDWtWAPX5ER2oC1OTKqsJEybO5fUbSyfPggyhQb iTDPABwozUhLhSiUqXY/xEg7VqX5VNAJ2EJJ9NUCqGWm2GftlQHraH1m7ZAXaowGLjZf+AU8i IwwVpSmoKyPrqD+WB1vagH+nE/P+gqYOtEQeN9joYSzT3hZPA72/oN1+Pkgg49OJEMLVHFxcP SrhvDjdfA5f8nHyhvyF+kolOq7E7eLdRLFdlvXC82Rl6T9PwRhZ9CCYqWO38haliiYVLOy4H4 EOyq4ZsNIw3lF8psDya07/XMRVa6t8gVwEWQk3GBrtfOzXUTf0LOs0mHzKKHp4Fm5KaANOuuu iLzUCbYs5ENhvqXouQQ46vgcPWCsGQkqNXh06FQTtHmKDzIjdNoAYQRlH3VsBE05XNXRRChM1 ENwNoAbHOnV4iMhyXxMaARdTo+wuy6eP1CsZtspgA1nNUz0I/8HGzkU1a0V5ewUSPDMo7RyCX cZMPRyAQfR7l42vsERFIN7U+ih2m4VxZLMv/dSkFNwNexM2dnc4T6gB1Jh03fgg9wAMxAqPf3 nWAEhuPXH/Z49Yd+HdGshoPuL8mYEe6XyH4CzZWjmp8YR9jpJzyh0QBH9QX+upSoEz+CmF+e+ sZz6BFfem0IXQNW7EWep7EGR0Vt+bR0UlWlZqqnDfpCcIulKVyCDC9mea1n8qj2mxOrfiz7/U dJqQdxjp+IA== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > I do no understand the use-case you have in mind here. with-temp-buffer > serves to create a short-lived temporary buffer that is quickly disposed > of again. When would such a buffer be shown anywhere? I confused this 'with-output-to-temp-buffer'. Maybe we should indeed rebind 'buffer-list-update-hook' around the 'generate-new-buffer' and 'kill-buffer' calls of 'with-temp-buffer'. > > I'm afraid you have to dig further to find out how > > 'buffer-list-update-hook' precisely gets called here. > > Did that, turns out it's down to mode-line packages, both powerline and > doom-modeline are advising select-window. And do not preserve NORECORD? > I'll create PRs for both. > > > What was the issue there? > > Same feedback loop as described above, except it would only happen > when a region was active in magit's status buffer. I had tracked > the cause to a temp buffer deep inside magit's internals. Here's the > github link: > https://github.com/magit/magit/issues/3738#issuecomment-464520582 Maybe magit should simply try to reuse the same temporary buffer instead of recreating it excessively. Creating/killing temporary buffers does not come without some overhead. > > Emacs 27 now has 'window-selection-change-functions', strongly > > tied to redisplay and triggering only when the window selection has > > changed since last redisplay. Maybe you could try that. > > This problem occurs in my treemacs package, so I cannot use a solution > provided by a bleeding edge release, my modus operandi is to support the > last 2 versions of emacs, so 25 and 26 (since stable distros like debian > still use emacs 25). At any rate I have found the culprit in those modeline > packages, so that point is solved. I see. But please try 'window-selection-change-functions' sooner or later so we know whether it fixes these problems. martin From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 06 10:41:18 2019 Received: (at 34765) by debbugs.gnu.org; 6 Mar 2019 15:41:18 +0000 Received: from localhost ([127.0.0.1]:34590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1YfW-0001nf-0n for submit@debbugs.gnu.org; Wed, 06 Mar 2019 10:41:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46127) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1YfT-0001nR-BF for 34765@debbugs.gnu.org; Wed, 06 Mar 2019 10:41:15 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44096) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1YfL-0007xB-T4; Wed, 06 Mar 2019 10:41:08 -0500 Received: from [176.228.60.248] (port=2274 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h1YfL-0005sM-H3; Wed, 06 Mar 2019 10:41:07 -0500 Date: Wed, 06 Mar 2019 17:41:08 +0200 Message-Id: <83lg1sc8ob.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: <5C7FD591.9090505@gmx.at> (message from martin rudalics on Wed, 06 Mar 2019 15:13:37 +0100) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Date: Wed, 06 Mar 2019 15:13:37 +0100 > From: martin rudalics > Cc: 34765@debbugs.gnu.org > > Maybe we should indeed rebind 'buffer-list-update-hook' around the > 'generate-new-buffer' and 'kill-buffer' calls of 'with-temp-buffer'. Wouldn't that be a backward-incompatible change? How long did we call that hook for temporary buffers? Also, can generate-new-buffer and/or kill-buffer run some hooks which might modify other, non-temporary buffers? From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 06 12:57:28 2019 Received: (at 34765) by debbugs.gnu.org; 6 Mar 2019 17:57:28 +0000 Received: from localhost ([127.0.0.1]:34649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1anH-0007A0-Ku for submit@debbugs.gnu.org; Wed, 06 Mar 2019 12:57:27 -0500 Received: from mout.gmx.net ([212.227.15.18]:55969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1anF-00079m-OJ for 34765@debbugs.gnu.org; Wed, 06 Mar 2019 12:57:26 -0500 Received: from [192.168.1.100] ([213.162.73.163]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M8m7Q-1hDinS0dIq-00C9iZ; Wed, 06 Mar 2019 18:57:18 +0100 Message-ID: <5C8009F3.5000405@gmx.at> Date: Wed, 06 Mar 2019 18:57:07 +0100 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> In-Reply-To: <83lg1sc8ob.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:x5bVcPOxwV8CFW8CLJAyVdRuj2WCn4OweHdZ9bD/fF8YZYATCCj FLYHTHJTFZr2zMJdAQjE27785KrdnSh+FXAZF8VaWnzLluGJVx14evdfw+55qUJXRmdJ0Se 6utij+dmNgH83Gev/DikkXDbUQ8slf54+QehaNR8UkriT1uXjDe/jJrRjz0H5vng8ev/atN cZD0ZVvLGhwY4Pi3Q6Oug== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:jjdPIREU/vY=:C1thZr3QF6dtdf7qa5FcuM nvPQVDUvMcxSQjf4zNNdiFTbaszqSN6gExWmSboIuLHVz4bg4rQv5DRZyLm2Feh2Mghi5Hyqn fXkDMhnC/Ru2BEYJNXPXUUmEb3StFeBIfzdEnkqfDcLAE7j3XB0gy8mEgQoGiHfj/3/wzixe+ FQjKeiFScYhpboIzdKcn0/u6pbBNsUv0/Wm1IK3KVFGH9K/Pz1A3URzqK06TYp8S/9ESljvvv kFOS00gjQHtfCQ9LcCY0wMZBPSwBhjT0sfez9bIed8+p09kd/EJ3IUSi9RX2pZpvLYDRJWwkW fhUf05uUnCKnVDb/gP5VcnYrjlwdQqluDkwhlwM9M64bOaZ//7yfN/TMsrCjPjZm7xvvqrDHY sxB8GwkquN9B9TFgQwoODUj63KlE6OAu61PoAp+PjNcROWs0f8RaWCwtFdT4CwVEmE0QMKp9Y g3LI5hwLBtNjskgW0Uqo6bZpESYVo+IuFNumG3hv9QoqGbz3D/XWCBfAIYPenxthJiZd1gbip ARVyVjgftARzDuD7DZs114/2M4Cj34ycwOwTz8LiQA3owywVwVKBUpeGDckA+wWz2329JK/Fi BraidCRUpQZhwwlInud0vm2/IJxYVZbKILVHamLCQ6tWJFb1QtVeKxHFqordPU/hXmk+1E2fu n/arzjju7xeIuX/c5cSPhsIVnT1XVWy06KFKUvhczhwSIvHDlv3YmEsEA7Qp7RvPyHfJZUAuP cKTnn6VEZj23kv7Jp5jxmlAa0WWi0ZGfTatOKqmTB/0h6pW6uh50KbJ7omW2KdcdP7XS4uLib UuTsSFOAyr6qzfEt5SDmZKFaT3ik59myXR1v11W2gERVOCbMuSjvMO9NOSfAqrZEHX1OnoaBz w9Hu+Ucd470IIagRWXL9BUxpp5Dxia/eUZ/Um4msWLJCbz+EJHEmmbHhrXDRsORQqKKB1HozV H8+xZq/12Cg== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Maybe we should indeed rebind 'buffer-list-update-hook' around the >> 'generate-new-buffer' and 'kill-buffer' calls of 'with-temp-buffer'. > > Wouldn't that be a backward-incompatible change? It would be a backward-incompatible change. > How long did we call > that hook for temporary buffers? Ever since that hook existed. > Also, can generate-new-buffer and/or > kill-buffer run some hooks which might modify other, non-temporary > buffers? 'generate-new-buffer' calls 'get-buffer-create' and that one runs only 'buffer-list-update-hook'. 'kill-buffer' runs its usual hooks and if one of them runs 'kill-buffer' for another buffer we'd have a problem. An even more radical solution would be to never run 'buffer-list-update-hook' for buffers whose name starts with a space. Backward-incompatible as well but cleaner from a designer's POV. In either case it wouldn't help the OP since he probably (hopefully) won't need a solution for Emacs 27 (where he should be able to use 'window-selection-change-functions' instead) and we are certainly not going to change this for Emacs 26. martin From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 07 01:19:03 2019 Received: (at 34765) by debbugs.gnu.org; 7 Mar 2019 06:19:03 +0000 Received: from localhost ([127.0.0.1]:34870 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1mMx-0002gx-7M for submit@debbugs.gnu.org; Thu, 07 Mar 2019 01:19:03 -0500 Received: from mout.web.de ([212.227.15.14]:43301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1mMw-0002gU-3k for 34765@debbugs.gnu.org; Thu, 07 Mar 2019 01:19:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1551939535; bh=brm/pgzVPdI86L4JCAJLRn/r8g/y++wdCDD5IOJQtjs=; h=X-UI-Sender-Class:To:Cc:Subject:From:Date; b=nJQeMyBrKREig+WNJiXNYhNg77pV3kQIY+j3LSqekslmAiY2tGNPv0K1kU9KWyuvP LlgFs909+YQMLLTPDrckM/RJAf/y+mT6su5JPoMjRGnuyCCr31o6DeNC8C/b5Ub2iJ /S16900Z4G/7HdvzdiYBJU4ynb0zgDeE1x4gZ3DI= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.43.248] ([80.187.84.149]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MRD4x-1hWKyv3bCB-00Uduj; Thu, 07 Mar 2019 07:18:55 +0100 To: rudalics@gmx.at Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook From: Alexander Miller Message-ID: <939238bc-16a0-6679-bc80-043e0530f61e@web.de> Date: Thu, 7 Mar 2019 07:18:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Provags-ID: V03:K1:6wGm+3wtJDe/tzM8iH0Z9gsub9pWzhaHup05MymM8QTU4ofBNRi Tc692RHsntqtlzHu2Gl6EChHk9FALU7WzntcyK01WxL1hASHAEeammCzTQ7bJPz/44OqhdA rkE3PuZ1yRYP35HXjQXiX27TsbncdS2wZNCGFT7Z520Qu1XIH9nFkSBxSMZoV/pHOhA7jpU sSkLrQO50D0WAfRmORhVQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:c+Z0k0Sx6mE=:tXUT5tnyD5CcX3HOMzbHi4 4WS6C1ailGA3ZqdzyYQbz7bX6yB2BB7gAE/n9f6VKRqlVeFSOdtT5nGbC3i5Bw1LeYY3ZCNo8 RbPjmgdgK7ckmzDdP7mTkMRH4sNLL+ywPOCaIQ+C/17qz4TjQXf07JdARIK2CMiEs4IWSXWQ9 ++0Wa9yiQPIHaJCUh78t/qOow273rQp9ksD00fiNcL2CYRS7G73s+IIAfHy32pfCpn0HRCUjt SBaMB3WxSzuKv6XuF73Qd9zFeTf/9I6ifV8sjxbiLTm/jRzmawaNV3+1BGjnByNEzWZlDoVyr 3r5CRYf4BRG7poVjbMSz3V/Nr8XrgPYQs5SESizMqWwl2Cg8D5lZdU45Vv96tY2UvFC92gwZS OTuTc5/dZr2mTIVGMfxwJnLozzdBtLl5Y8+Nz9PotPx5pSHGHb+rI/MsTTyG1o7/MhbeKAwhK u+I67B7VToPWCRuQrVDJyuyJT80N7mW2KSEdSfpXYRz8jVgrMKow5OS1Akp16oLNLmST4sXoU vqEfG9rvw98+zmkE1qaiva2Lw6wF5Xx2w+qQUyUspD/FxUJQkPw8tnVaecIHlOdGOcrTbRTl/ GtsWrEc8xIec4q0RZQwKRI8it1TaKMTHk+CdGX7NhIaj8+LfgG3PeHbvf5Y1MSKr9/JY5p9YL A4nOZZ2XpH12HpsyrJSDb8NA9inIMIOVIcA0KLwfRBAh7sVSHnjWRhudmudDMTOZ16mhNJD6o n0rJKKQzKZmVAmDoJAooJp5Sq1dPnlzWDZ0X6kHWEAPSHHtLasS0ri9UhytMQrM0f8imS5Ni7 E+e7oRKFronxwm08zW8wvlqwW9swttLyPyD14/JZjcdrdLRv1HHLtBQuHOEVbPxHPlI002OJp bjYR++OZIr3NJn9CacIZY7bLXBoVJQloQrKwmDUPlcmNGMsaXbpIRDK3i4t440+AngZpYOOmw SRlwJrbO5Bg== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > And do not preserve NORECORD? They did. > Maybe magit should simply try to reuse the same temporary buffer > instead of recreating it excessively. Creating/killing temporary > buffers does not come without some overhead. It didn't. IIRC a temp buffer was created 2 or 3 times every time I would move point. The problem is that this *somehow* triggered a feedback loop with treemacs and magit feeding off each other. I haven't really understood what happened there as that would require some very deep digging inside magit's internals. There's a recipe for emacs -q in the github issue if you want to see this for yourself. > I see. But please try 'window-selection-change-functions' > sooner or later so we know whether it fixes these problems. Way ahead of you ;) https://github.com/Alexander-Miller/treemacs/issues/321 From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 07 03:29:51 2019 Received: (at 34765) by debbugs.gnu.org; 7 Mar 2019 08:29:51 +0000 Received: from localhost ([127.0.0.1]:34898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1oPW-0005qY-GQ for submit@debbugs.gnu.org; Thu, 07 Mar 2019 03:29:50 -0500 Received: from mout.gmx.net ([212.227.17.22]:48365) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1oPU-0005qE-7k for 34765@debbugs.gnu.org; Thu, 07 Mar 2019 03:29:48 -0500 Received: from [192.168.1.101] ([212.95.5.145]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LyR1G-1gyrnk0IqM-015qva; Thu, 07 Mar 2019 09:29:42 +0100 Message-ID: <5C80D66E.5000101@gmx.at> Date: Thu, 07 Mar 2019 09:29:34 +0100 From: martin rudalics MIME-Version: 1.0 To: Alexander Miller Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <939238bc-16a0-6679-bc80-043e0530f61e@web.de> In-Reply-To: <939238bc-16a0-6679-bc80-043e0530f61e@web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:YL3eTEFCbTwx1zSXluw2KOqVE2hCwL8SpPxDjTRkpA+GZdth7k6 SIVqMxahjfaNQrRHEeyVvb7KY/ae9A1xZb5m215llF6TGcl+cOmvqbaNtGduXvklc5aB8n1 3qoxDDqxo+E41BLkduRegRa1GDtG9Y0B0NL16UTHzESUyjf7tDWYJQ4MMzIEgffcXvETihC FEB2E8WQRDdcn0cE0xN3w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:H4our9ICO68=:pjwVNVvupSPh2unQLnIdo2 4lEFfaOq2Vx0b9U08v2Hbp7L04gFRAnDHqvPGNyDwVq7woXmmrXKGzqbTI6g1VAcceZee9FiB a3u3FebQQJIlOI3hlQSXsccwTpS1wQSKbVzSFVDuyVhGBMoAUxz5WH/U17osmrev1cJ7tndh2 byq4nRIGU1Vxdkyh2bPBu9Rq1hkRMkF8z2KS8c7YfXDvDkQavFtnQM5z5XUdvBosqHOKMJXXq QnwHc08en267wvUF+Ah5f7cgL9COqCQdDUqyGrN+FYKDXU/pxmTFnEI9WCKBOZ5GZoV2OGg1K fZAOiWmDQPxSSTZumqGCkz/W9BMAsl9OMELLz7p3gB6yk75UO20eKLm5wFZ5E98/K6a01vnjf /VAQa52IkA74+iMRNprQLCj33bxH6sVThS1ZCefXpKDP9Ur6gj3EGP3adyxQh2iq/MFvp2LVe DYqlc7bxz1vjfFIDrMeHUVLGvfHrNueYpUVM7peoafvfNIin5JTtmbfslyyT5A63gaebedyk8 zplZ/HOGWETv55Uc76ACcO7vImaYwcacsmq57zFJR0OPF1ykmZQ0TMggzFWyS4L7XDh/Fx5bW ycjj0gBZy+8JgYd/IOmZneGx6MsWlL34Sub7PEaJp7jR+0DFTbKB+12T3Ga69C/WuD1EEJiNR HO2x7lA+T0DpgyZ2HUiKoTZS4T1a9Y5QYgcqPGs3H6B4BnvZaAkMe3XI8+hilefkxVU9zrvu4 nwnu4cQwr/U/QAjXjXVVpgvFc3ha4QxfLezPL5lLfKjY77gcH4DsEZd+g453BL3fUTezKnQTc xloBDDzpjir7f9QVMByY1oZY4B7hJZ7GzNlgqIlIHqEQ6z1vE9YhO0WypY3l/q9D+fSlFyP3Y 7GHE1r7vl9NyRGyAcXAdwE3v4qi44tB7iKqSu6I9fBiH7+ovBNivdFou5Jaz2WcZaIZEy+kTs FHPujeCYXow== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > > And do not preserve NORECORD? > > They did. So what was the problem there? How did 'buffer-list-update-hook' get invoked in such a wild manner? > It didn't. IIRC a temp buffer was created 2 or 3 times every time > I would move point. This alone qualifies as a bug IMHO. > The problem is that this *somehow* triggered a > feedback loop with treemacs and magit feeding off each other. I > haven't really understood what happened there as that would require > some very deep digging inside magit's internals. I think that creating a new temporary buffer should always be the exception and never the rule. Does the point moving happen in the treemacs buffer or in that of a plain (probably git-controlled) buffer? > There's a recipe for > emacs -q in the github issue if you want to see this for yourself. Can you pass me a corresponding URL? > > I see. But please try 'window-selection-change-functions' > > sooner or later so we know whether it fixes these problems. > > Way ahead of you ;) > https://github.com/Alexander-Miller/treemacs/issues/321 Aha. martin From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 07 04:44:33 2019 Received: (at 34765) by debbugs.gnu.org; 7 Mar 2019 09:44:33 +0000 Received: from localhost ([127.0.0.1]:34932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1pZo-0007oK-PG for submit@debbugs.gnu.org; Thu, 07 Mar 2019 04:44:32 -0500 Received: from mout.web.de ([217.72.192.78]:51399) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1pZm-0007o4-QM for 34765@debbugs.gnu.org; Thu, 07 Mar 2019 04:44:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1551951863; bh=skK9PbVHyNBVicZOlcnTovT0aSoP03WMyI0H8jv6Xvg=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=lRqgU//DNfFRYldKquh+7XxnEnCvwRrc8sfSK+Wn7J2zpPX10ByhmKxXnsiV/u4nc 7ySTU4Cwa2E5WgSQRu4A6Ltprw/3hwnGUxL0PzfiSIfK3NX/MHZa3KxUtq5Dn/EJk1 D31wfkiF0PArloKJ8Z+Y1GqXn2CB9lVtnQ9LqNig= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [172.16.177.137] ([94.186.169.18]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MZlZK-1hNDFB1QC6-00LWHB; Thu, 07 Mar 2019 10:44:23 +0100 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: martin rudalics References: <939238bc-16a0-6679-bc80-043e0530f61e@web.de> <5C80D66E.5000101@gmx.at> From: Alexander Miller Message-ID: <9acc3402-312f-0c3b-c2aa-4d1e2bcb77d4@web.de> Date: Thu, 7 Mar 2019 10:44:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <5C80D66E.5000101@gmx.at> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Provags-ID: V03:K1:ZaVopRK7R7zkotBbzu/JSenzPrtEoQ+jV0nuN2ESNq8UHvUMeVl XY/hklKaSokvT+iffif4UtveUZCr2DXrJWU5qcSKG5j8HHYwg7Assyr+Mo2WLdTPz1rEncv aTewLIMqtRbl3BqCD/nQRIBg3dLJTK6ksoQaEQ9lUWfWBySmi9k1+wG+JVXLE6rE5gBOSMD IAz/2Leu6La11BW19/IxQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:8hJhQPEJHR0=:rjQ5PGvPQdStf+ts5RIudb 73QZdBXrj0wRMWeisZ6MlQ59AqrDVKbIy2uNF1TFI05AYpa48DZ1L+1D/90C3khSYbWnJEycT LZO6VL2P2JhdV/+w6F+pMUFLIz478DzwKwAdoojb/mPJ/MJOeXbnrr4GC7eYDhzO1ti5HaEvm pKq51TFKUtymXztJBWYa2AB9m7HjO7fxw5AK1kSfNYsjTJDoM3k3TY3AJlkoU04jiy8R0z7HR 28sBY8IVfyMig/aOMptDSVecZPvYYS1PRPB0RCSuDO5cklSgD8P7aKq7BtTZKCGXhtZbaPGYp OMCpnPErMV7Kd4Q1d87gfin2JtjDJjKCbnCezxxYFe3U75As5TLDi4nNbnwOx0BAd/lvt284j Yc10iuZj4tAep4Mw9Xt6rxyVD8zPSqyzEvfxIrCFygF6Dp1c0jLDVJ/J7CS5v/by8tX+7IWYj nRoA9Z9hXBZ6G2UuiH4WtAX5Y0PR/yCthbllNnngTYAO/T0MiVr/68RL/nTltTu93hJo7Ux2B FUiPIKYYErBg9T3KcFz3IqKyH7DXSrvGXOqWXEnfeuCkm5xAAJyUXwl8pDo6Ij8mUYQg0SXgs FToH+r0okN0d11KXSxqRAsVLOynzXRlkLFThEW402IrWf97kD0brTsFo91vl8eOGmSgD9oT5l hu6SqTgvKMTd/NrtA0o6Gkin9TRSV3QpkVTGZAhba+zK1gw2s0ZM2ce6oOQw3hBQF3/kQ703I 4BtS9iZZxFkGSfwd/81FEa7VfNpJgbK58RZZS2UvcDsDIyG+eE1divgHLIRY/FR3O7FOKFted yWaddEH+pAGA4qkESF9btKAeyaeCT9T9xtvT9191iOA4f92XbErtNIUbu6nDncPr9+MdlGGoW 4MUpoG7XZEmku3cnrSWC1bg6v5s7bA7kVxDHfH5QNC74ftwa6dQuAgwXgIkaFsxzU4oWWwR5I rSwevKqayUw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > So what was the problem there?=C2=A0 How did 'buffer-list-update-hook' = get > invoked in such a wild manner As I understand it: advising select-window served the purpose of remembering the current window so the modeline can be highlighted in tune with the selection. The advising code would also call force-mode-line-update, that in turn lead to a re-calculation of the frame title, in spacemacs this could in turn call format-spec, that would use a temp-buffer, that triggers buffer-list-update-hook, that triggers treemacs' follow-mode callback, that calls with-selected-window, that leads back to the modeline's select-window advice. That's more or less what the feedback loop looked like. Come to think of it, maybe just suppressing the hook during my own window-selection will do the trick. > This alone qualifies as a bug IMHO. You'll have to take that up with Jonas. I linked this discussion in github, so he'll probably read this. > I think that creating a new temporary buffer should always be the > exception and never the rule.=C2=A0 Does the point moving happen in the > treemacs buffer or in that of a plain (probably git-controlled) > buffer? You misunderstood. The issue only happened when the treemacs window was visible, but point was in magit's status buffer and a region was active (e.g. when you want to select single lines for staging or reverting). Non-magit buffers had no issues. > Can you pass me a corresponding URL? Did that already, Here it is again: https://github.com/magit/magit/issues/3738#issuecomment-464520582 From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 07 08:46:18 2019 Received: (at 34765) by debbugs.gnu.org; 7 Mar 2019 13:46:18 +0000 Received: from localhost ([127.0.0.1]:35050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1tLl-0007cj-MI for submit@debbugs.gnu.org; Thu, 07 Mar 2019 08:46:17 -0500 Received: from mout.gmx.net ([212.227.15.15]:54231) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1tLj-0007cW-Hf for 34765@debbugs.gnu.org; Thu, 07 Mar 2019 08:46:16 -0500 Received: from [192.168.1.101] ([212.95.5.145]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lmqxo-1gaYou2T52-00h3iu; Thu, 07 Mar 2019 14:46:08 +0100 Message-ID: <5C812098.8020907@gmx.at> Date: Thu, 07 Mar 2019 14:46:00 +0100 From: martin rudalics MIME-Version: 1.0 To: Alexander Miller Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <939238bc-16a0-6679-bc80-043e0530f61e@web.de> <5C80D66E.5000101@gmx.at> <9acc3402-312f-0c3b-c2aa-4d1e2bcb77d4@web.de> In-Reply-To: <9acc3402-312f-0c3b-c2aa-4d1e2bcb77d4@web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:gfjXDSUvy2X50yvHU9BKNgXYTw6jJOwvmzvMk/9/SMEM3mLaZbZ jnuBG8pi0PEnzfFoKxQRs+47lnkY6PiBLNJM5w5zwpncSBV/WPlSZaKVVvi7D1gNiFAXuv3 2eaXeHfh1S6eGl/+bFkiiJwxvRrjHxM6RYK80ul7/Xd6pTeWc6b+RbQGJc/lxuk4IwbAB3q CqFSudcHZlGFqWpMnFiAA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:MI6UJQq0jeY=:tVyIfViySgM0UH9ydwHPdY qe5znQT4UQlKQ1EmDim0bV9TVBCgJz04b1/d6UsDnuD0zVyeP2biNwJWiC7eQwKID0v3bVZH3 rDFEVRoB34szxL+v/mw/aI2JkzdcKGT+Ub/aoWdA++YUbHdgRVEoZ99EXIXvZl8DxFFPV0wpj JBtss55EqEqLGeJTjqZQXOMo6oHg47sraCKJMv7BdfG7iFSynyoW0BK4TGKnpqzGtQfW76njZ HImr4LMAy/DswWnAClby+0Z/Rwy/x14r63Sim26/ETEow4W6SCidKJbtFsKxjSsKvnPdQ91jU zL5jLGX9WQbFT+nHGmSKqifeu3jHhNhxNWu0wkMQ0VOTWZEuPUUPU3yWF0jyfqX0m+aRjsOYH h9UPpBLQFz291M0bLtXqbZddx8NZrY85JNBeceppA1S1G1H6IGcg6r/zPBGd7haLRb20VKwk5 pGazcVsOCD26Ppyx02A+43Y+1GQUvaWw/eKcif9DE+aIAbsWKHxM6S+v1zmFvJhYCFXPxjtMs CQhX6TPGKRVJHicGXhlXQ2l4o5nqQzFHztPRiAGX7VmQCUNdZnS7mKrwi7fgXmT4VgxDINemw 32Csi+xjbqXgV+cO+KyGRj9iTUT3W9maANZgAkMIZ6gEhfSat/up28oCCdIxAzj6+y5zjE4Hu EuewWsT9NSdOsr2n1y4XfE+BJ1S3o/6XAuUlxMPKV8Zu8IAG5tYhDpuO2mFdgZu0bV6JZQ7vp NKr9Y/RQa4wLPw/1f5awyciuaUajumBx7sv8TJN8DW9Ww12mFPCMjL3pE2G6lq9JUZeu2wK9G 6vEwXEx24U+mygpfXQVkE42eFUtQrGHw86P5sylJatMGdRF2XSl+QNcwaS2xRwhBXiRBmemxz aZLtV3tYoU5Nb7WntxwdIGi5cTKYV3qmhOhmk6nJSOAWUN5FOlXaT0a/SkUEJn+aDX7EhWXJk 8yTTRabcj9Q== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > As I understand it: advising select-window served the purpose of > remembering the > current window so the modeline can be highlighted in tune with the > selection. The > advising code would also call force-mode-line-update, that in turn lead > to a re-calculation > of the frame title, in spacemacs this could in turn call format-spec, > that would use a > temp-buffer, that triggers buffer-list-update-hook, that triggers > treemacs' follow-mode > callback, that calls with-selected-window, that leads back to the > modeline's select-window > advice. That's more or less what the feedback loop looked like. Thanks. IIUC this means that we'll have to put an extra warning in the doc-string of 'buffer-list-update-hook' to not kill, rename or create buffers or select another window with NORECORD nil in its functions. I listed all functions calling that hook in the hope that people would then avoid that but your example shows that such endless recursions can be quite tricky to detect. One major design goal of the new window change functions was to simply not invoke them recursively so such scenarios should not happen there (and was immediately proven wrong by the redisplay mechanism itself). > > Can you pass me a corresponding URL? > > Did that already, Here it is again: > https://github.com/magit/magit/issues/3738#issuecomment-464520582 I thought you had another one (with more insight into how that problem triggered). But the scenario above is sufficient to imagine what can happen ... martin From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 23 05:21:57 2019 Received: (at 34765) by debbugs.gnu.org; 23 Apr 2019 09:21:57 +0000 Received: from localhost ([127.0.0.1]:52359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIrci-0007ZN-UU for submit@debbugs.gnu.org; Tue, 23 Apr 2019 05:21:57 -0400 Received: from mout.gmx.net ([212.227.15.19]:45469) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIrcg-0007ZA-CY for 34765@debbugs.gnu.org; Tue, 23 Apr 2019 05:21:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1556011303; bh=WTYLzHmVq+gcI0JaXe78EAPGUWezDFJUpeDwEwEarMk=; h=X-UI-Sender-Class:Subject:From:To:Cc:References:Date:In-Reply-To; b=VjUZI+B7qzB5/rjWqA1coFi47K8eN2HN/abIVzfPLKLsiyiQ6G7ZMT7hkpf8kYyew ZQaGO5SwN/JfO363yQB0+q6ws7HuTFwBJ5t3c2fmDeJwSIraxbgEH4xhePhOxMSeGX LQYaAG7vC355Ffw4cCxinLgkpMXHkicUyXsuM6Ms= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([213.162.73.225]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Ma1pn-1hWofZ49YF-00Ljk9; Tue, 23 Apr 2019 11:21:43 +0200 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook From: martin rudalics To: Eli Zaretskii References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> Message-ID: <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> Date: Tue, 23 Apr 2019 11:21:45 +0200 MIME-Version: 1.0 In-Reply-To: <5C8009F3.5000405@gmx.at> Content-Type: multipart/mixed; boundary="------------61AE8C43FE2221FCE0B25FB5" Content-Language: de-DE X-Provags-ID: V03:K1:nUEnfwJTRTV01keCjFmpap4NSKVQFE9yAwFX786lXS/5O20GtYc NEonwHR0dCw47jghUuNFu/wcDQFtDB48fZUvpL34vlv4guQAfU3yxHL+1GRpsuevbpCaKis jtbbhig9L9NiMW9Mbrs1ae8h9Mk4xBXkKAzj+TSNdnXkv+HV/TTUoWwLNxg5mfjEZFQo4Wg Y7wjq0FJfXxwlbCkAT3yg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:AvrdNJQVuks=:X2LpBZvPMOJDf3tyZ8TDQ0 ZiyUwQgrfLRghCgyqxQ4t5NZ+V6wlcIfLERzdF4tBq/QG2bCERFMvJ5PkEgNvpV9e27TEKNkH Kj1D31ucKAQMd1eWR6Co3BT/sI/Z1eghIxsKj8ByvQMnXW41CeetWKLq6D9jfhNvJ6Aq8qBgj 0eZT6I9OBKOWLOCBHhLKmQmDtnZK3Ixq7H8srt2Nplu9HaJiYw/jQEQAYHjC9G+6c8TbmvBl0 Ah27K1rbplUwb8iHmJ0qUhkxL1VcDL7GjoE9OIUfBPUzbuSRkFgoeUVny6PrhiDnl2YUg1+0b Sq2/lR6WTZ5Gasxmo8kPrzNXMrIO2cAedOc6Udzjvco6ANLsFRIOm7aWdFrb4RT71J4wWlqPB ymV8YKiogOw8fPHAEJuomYR/etuHZu1S8er4VS8Gi25j3uwqnWsdz2o/atUeaWrwxhUprVXSq iBAo1W8KsY2kegElAxzM2X7ndjs6al7T8xAzbK0u+byjfU6MvF52aYCkc+XPoD0SaLQR0sdbs qlWegboJLyyVtIMyaBC+tTfYY1cN2zqlDSQYATkDJC9pe9OdC+SCKmkoOVsXAplNkvpnu8KVx 05JF11qgo2bdmkj4ab9lsct6ekSFWe2CO/Qz38NoxW5GD/aD1edLDFHFiV2q/m9fhccKOV/PU jPGAINd+HP6NWKGYH7WrYqp0os/DxBr/Jkw2nR/w5vxsY+rSh2yfDyGzxZwxDWnvBJwlue1zw w1jkDk8mniXDZq0j6nBAcrQUtfr+7fhQugQnSWciIpt6eUTfPor2+bLveG75I0RcXU9NNKZOo bTIa6E/Rp//dc6WrfHJ9IyewZzTqv1sfcAMfTy9SKce5F5u7f3FEV1caty1fr9HuemY9HG9nA mdcABRqgAKkx/xDw4pr2N2j/HSJmKhcDqCvhQrZR8ef/+re+G0yc2Y6rAJLBsH X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is a multi-part message in MIME format. --------------61AE8C43FE2221FCE0B25FB5 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit > >> Maybe we should indeed rebind 'buffer-list-update-hook' around the > >> 'generate-new-buffer' and 'kill-buffer' calls of 'with-temp-buffer'. > > > > Wouldn't that be a backward-incompatible change? > > It would be a backward-incompatible change. > > > How long did we call > > that hook for temporary buffers? > > Ever since that hook existed. > > > Also, can generate-new-buffer and/or > > kill-buffer run some hooks which might modify other, non-temporary > > buffers? > > 'generate-new-buffer' calls 'get-buffer-create' and that one runs only > 'buffer-list-update-hook'. 'kill-buffer' runs its usual hooks and if > one of them runs 'kill-buffer' for another buffer we'd have a problem. > > An even more radical solution would be to never run > 'buffer-list-update-hook' for buffers whose name starts with a space. > Backward-incompatible as well but cleaner from a designer's POV. > > In either case it wouldn't help the OP since he probably (hopefully) > won't need a solution for Emacs 27 (where he should be able to use > 'window-selection-change-functions' instead) and we are certainly not > going to change this for Emacs 26. Stefan asked me to add a variable 'inhibit-buffer-list-update-hook' and I came up with the attached. WDYT? martin --------------61AE8C43FE2221FCE0B25FB5 Content-Type: text/plain; charset=UTF-8; name="inhibit-buffer-list-update-hook.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="inhibit-buffer-list-update-hook.diff" ZGlmZiAtLWdpdCBhL2xpc3Avc3Vici5lbCBiL2xpc3Avc3Vici5lbAppbmRleCBmNjhmOWRk NDE5Li4zODg3MDViM2RlIDEwMDY0NAotLS0gYS9saXNwL3N1YnIuZWwKKysrIGIvbGlzcC9z dWJyLmVsCkBAIC0zNTY5LDEzICszNTY5LDE2IEBAIHdpdGgtdGVtcC1idWZmZXIKIFNlZSBh bHNvIGB3aXRoLXRlbXAtZmlsZScgYW5kIGB3aXRoLW91dHB1dC10by1zdHJpbmcnLiIKICAg KGRlY2xhcmUgKGluZGVudCAwKSAoZGVidWcgdCkpCiAgIChsZXQgKCh0ZW1wLWJ1ZmZlciAo bWFrZS1zeW1ib2wgInRlbXAtYnVmZmVyIikpKQotICAgIGAobGV0ICgoLHRlbXAtYnVmZmVy IChnZW5lcmF0ZS1uZXctYnVmZmVyICIgKnRlbXAqIikpKQorICAgIGAobGV0ICgoLHRlbXAt YnVmZmVyCisJICAgIChsZXQgKChpbmhpYml0LWJ1ZmZlci1saXN0LXVwZGF0ZS1ob29rIHQp KQorICAgICAgICAgICAgICAoZ2VuZXJhdGUtbmV3LWJ1ZmZlciAiICp0ZW1wKiIpKSkpCiAg ICAgICAgOzsgRklYTUU6IGtpbGwtYnVmZmVyIGNhbiBjaGFuZ2UgY3VycmVudC1idWZmZXIg aW4gc29tZSBvZGQgY2FzZXMuCiAgICAgICAgKHdpdGgtY3VycmVudC1idWZmZXIgLHRlbXAt YnVmZmVyCiAgICAgICAgICAodW53aW5kLXByb3RlY3QKIAkgICAgIChwcm9nbiAsQGJvZHkp CiAgICAgICAgICAgIChhbmQgKGJ1ZmZlci1uYW1lICx0ZW1wLWJ1ZmZlcikKLSAgICAgICAg ICAgICAgICAoa2lsbC1idWZmZXIgLHRlbXAtYnVmZmVyKSkpKSkpKQorCSAgICAgICAgKGxl dCAoKGluaGliaXQtYnVmZmVyLWxpc3QtdXBkYXRlLWhvb2sgdCkpCisgICAgICAgICAgICAg ICAgICAoa2lsbC1idWZmZXIgLHRlbXAtYnVmZmVyKSkpKSkpKSkKIAogKGRlZm1hY3JvIHdp dGgtc2lsZW50LW1vZGlmaWNhdGlvbnMgKCZyZXN0IGJvZHkpCiAgICJFeGVjdXRlIEJPRFks IHByZXRlbmRpbmcgaXQgZG9lcyBub3QgbW9kaWZ5IHRoZSBidWZmZXIuCmRpZmYgLS1naXQg YS9zcmMvYnVmZmVyLmMgYi9zcmMvYnVmZmVyLmMKaW5kZXggYWI0Nzc0ODE5MS4uODIyYjUy NjJkYyAxMDA2NDQKLS0tIGEvc3JjL2J1ZmZlci5jCisrKyBiL3NyYy9idWZmZXIuYwpAQCAt NTAwLDYgKzUwMCwzNiBAQCBnZXRfdHJ1ZW5hbWVfYnVmZmVyIChyZWdpc3RlciBMaXNwX09i amVjdCBmaWxlbmFtZSkKICAgcmV0dXJuIFFuaWw7CiB9CiAKKworLyoqCisgKiBydW5fYnVm ZmVyX2xpc3RfdXBkYXRlX2hvb2s6CisgKgorICogUnVuIGFueSBmdW5jdGlvbnMgb24gJ2J1 ZmZlci1saXN0LXVwZGF0ZS1ob29rJy4gIERvIG5vdCBydW4gdGhlCisgKiBmdW5jdGlvbnMg d2hlbiBCVUZGRVIgaXMgYSBidWZmZXIgYW5kIGl0cyBpbmhpYml0X2J1ZmZlcl9ob29rcwor ICogc3RydWN0dXJlIGVsZW1lbnQgaXMgc2V0LiAgRG8gbm90IHJ1biBhbnkgZnVuY3Rpb25z IGVpdGhlciB3aGVuIHdlCisgKiBhcmUgbm90IGFsbG93ZWQgdG8gcnVuIGhvb2tzIG9yICdp bmhpYml0LWJ1ZmZlci1saXN0LXVwZGF0ZS1ob29rJworICogaXMgbm9uLW5pbC4KKyAqCisg KiBXaGlsZSBydW5uaW5nIHRoZSBmdW5jdGlvbnMsIGJpbmQgJ2luaGliaXQtYnVmZmVyLWxp c3QtdXBkYXRlLWhvb2snCisgKiB0byB0IHRvIGF2b2lkIGludm9raW5nIG91cnNlbHZlcyBy ZWN1cnNpdmVseS4KKyAqLworc3RhdGljIHZvaWQKK3J1bl9idWZmZXJfbGlzdF91cGRhdGVf aG9vayAoTGlzcF9PYmplY3QgYnVmZmVyKQoreworICBpZiAoIU5JTFAgKFZydW5faG9va3Mp CisgICAgICAmJiAoIUJVRkZFUlAgKGJ1ZmZlcikgfHwgIVhCVUZGRVIgKGJ1ZmZlciktPmlu aGliaXRfYnVmZmVyX2hvb2tzKQorICAgICAgJiYgIWluaGliaXRfYnVmZmVyX2xpc3RfdXBk YXRlX2hvb2spCisgICAgeworICAgICAgcHRyZGlmZl90IGNvdW50ID0gU1BFQ1BETF9JTkRF WCAoKTsKKworICAgICAgcmVjb3JkX3Vud2luZF9jdXJyZW50X2J1ZmZlciAoKTsKKyAgICAg IHNwZWNiaW5kIChRaW5oaWJpdF9idWZmZXJfbGlzdF91cGRhdGVfaG9vaywgUXQpOworICAg ICAgY2FsbDEgKFZydW5faG9va3MsIFFidWZmZXJfbGlzdF91cGRhdGVfaG9vayk7CisgICAg ICB1bmJpbmRfdG8gKGNvdW50LCBRbmlsKTsKKyAgICB9Cit9CisKKwogREVGVU4gKCJnZXQt YnVmZmVyLWNyZWF0ZSIsIEZnZXRfYnVmZmVyX2NyZWF0ZSwgU2dldF9idWZmZXJfY3JlYXRl LCAxLCAxLCAwLAogICAgICAgIGRvYzogLyogUmV0dXJuIHRoZSBidWZmZXIgc3BlY2lmaWVk IGJ5IEJVRkZFUi1PUi1OQU1FLCBjcmVhdGluZyBhIG5ldyBvbmUgaWYgbmVlZGVkLgogSWYg QlVGRkVSLU9SLU5BTUUgaXMgYSBzdHJpbmcgYW5kIGEgbGl2ZSBidWZmZXIgd2l0aCB0aGF0 IG5hbWUgZXhpc3RzLApAQCAtNjAwLDkgKzYzMCw4IEBAIGV2ZW4gaWYgaXQgaXMgZGVhZC4g IFRoZSByZXR1cm4gdmFsdWUgaXMgbmV2ZXIgbmlsLiAgKi8pCiAgIC8qIFB1dCB0aGlzIGlu IHRoZSBhbGlzdCBvZiBhbGwgbGl2ZSBidWZmZXJzLiAgKi8KICAgWFNFVEJVRkZFUiAoYnVm ZmVyLCBiKTsKICAgVmJ1ZmZlcl9hbGlzdCA9IG5jb25jMiAoVmJ1ZmZlcl9hbGlzdCwgbGlz dDEgKEZjb25zIChuYW1lLCBidWZmZXIpKSk7Ci0gIC8qIEFuZCBydW4gYnVmZmVyLWxpc3Qt dXBkYXRlLWhvb2suICAqLwotICBpZiAoIU5JTFAgKFZydW5faG9va3MpICYmICFiLT5pbmhp Yml0X2J1ZmZlcl9ob29rcykKLSAgICBjYWxsMSAoVnJ1bl9ob29rcywgUWJ1ZmZlcl9saXN0 X3VwZGF0ZV9ob29rKTsKKyAgLyogUnVuIGJ1ZmZlci1saXN0LXVwZGF0ZS1ob29rLiAgKi8K KyAgcnVuX2J1ZmZlcl9saXN0X3VwZGF0ZV9ob29rIChidWZmZXIpOwogCiAgIHJldHVybiBi dWZmZXI7CiB9CkBAIC04NzEsOCArOTAwLDcgQEAgQ0xPTkUgbmlsIG1lYW5zIHRoZSBpbmRp cmVjdCBidWZmZXIncyBzdGF0ZSBpcyByZXNldCB0byBkZWZhdWx0IHZhbHVlcy4gICovKQog ICAgIH0KIAogICAvKiBSdW4gYnVmZmVyLWxpc3QtdXBkYXRlLWhvb2suICAqLwotICBpZiAo IU5JTFAgKFZydW5faG9va3MpKQotICAgIGNhbGwxIChWcnVuX2hvb2tzLCBRYnVmZmVyX2xp c3RfdXBkYXRlX2hvb2spOworICBydW5fYnVmZmVyX2xpc3RfdXBkYXRlX2hvb2sgKFFuaWwp OwogCiAgIHJldHVybiBidWY7CiB9CkBAIC0xNDk5LDggKzE1MjcsNyBAQCBUaGlzIGRvZXMg bm90IGNoYW5nZSB0aGUgbmFtZSBvZiB0aGUgdmlzaXRlZCBmaWxlIChpZiBhbnkpLiAgKi8p CiAgICAgY2FsbDAgKGludGVybiAoInJlbmFtZS1hdXRvLXNhdmUtZmlsZSIpKTsKIAogICAv KiBSdW4gYnVmZmVyLWxpc3QtdXBkYXRlLWhvb2suICAqLwotICBpZiAoIU5JTFAgKFZydW5f aG9va3MpICYmICFjdXJyZW50X2J1ZmZlci0+aW5oaWJpdF9idWZmZXJfaG9va3MpCi0gICAg Y2FsbDEgKFZydW5faG9va3MsIFFidWZmZXJfbGlzdF91cGRhdGVfaG9vayk7CisgIHJ1bl9i dWZmZXJfbGlzdF91cGRhdGVfaG9vayAoYnVmKTsKIAogICAvKiBSZWZldGNoIHNpbmNlIHRo YXQgbGFzdCBjYWxsIG1heSBoYXZlIGRvbmUgR0MuICAqLwogICByZXR1cm4gQlZBUiAoY3Vy cmVudF9idWZmZXIsIG5hbWUpOwpAQCAtMTkzOCw4ICsxOTY1LDcgQEAgY2xlYW5pbmcgdXAg YWxsIHdpbmRvd3MgY3VycmVudGx5IGRpc3BsYXlpbmcgdGhlIGJ1ZmZlciB0byBiZSBraWxs ZWQuICovKQogICBic2V0X3VuZG9fbGlzdCAoYiwgUW5pbCk7CiAKICAgLyogUnVuIGJ1ZmZl ci1saXN0LXVwZGF0ZS1ob29rLiAgKi8KLSAgaWYgKCFOSUxQIChWcnVuX2hvb2tzKSAmJiAh Yi0+aW5oaWJpdF9idWZmZXJfaG9va3MpCi0gICAgY2FsbDEgKFZydW5faG9va3MsIFFidWZm ZXJfbGlzdF91cGRhdGVfaG9vayk7CisgIHJ1bl9idWZmZXJfbGlzdF91cGRhdGVfaG9vayAo YnVmZmVyKTsKIAogICByZXR1cm4gUXQ7CiB9CkBAIC0xOTgwLDggKzIwMDYsNyBAQCByZWNv cmRfYnVmZmVyIChMaXNwX09iamVjdCBidWZmZXIpCiAgIGZzZXRfYnVyaWVkX2J1ZmZlcl9s aXN0IChmLCBGZGVscSAoYnVmZmVyLCBmLT5idXJpZWRfYnVmZmVyX2xpc3QpKTsKIAogICAv KiBSdW4gYnVmZmVyLWxpc3QtdXBkYXRlLWhvb2suICAqLwotICBpZiAoIU5JTFAgKFZydW5f aG9va3MpICYmICFYQlVGRkVSIChidWZmZXIpLT5pbmhpYml0X2J1ZmZlcl9ob29rcykKLSAg ICBjYWxsMSAoVnJ1bl9ob29rcywgUWJ1ZmZlcl9saXN0X3VwZGF0ZV9ob29rKTsKKyAgcnVu X2J1ZmZlcl9saXN0X3VwZGF0ZV9ob29rIChidWZmZXIpOwogfQogCiAKQEAgLTIwMTksOCAr MjA0NCw3IEBAIERFRlVOICgiYnVyeS1idWZmZXItaW50ZXJuYWwiLCBGYnVyeV9idWZmZXJf aW50ZXJuYWwsIFNidXJ5X2J1ZmZlcl9pbnRlcm5hbCwKICAgICAoZiwgRmNvbnMgKGJ1ZmZl ciwgRmRlbHEgKGJ1ZmZlciwgZi0+YnVyaWVkX2J1ZmZlcl9saXN0KSkpOwogCiAgIC8qIFJ1 biBidWZmZXItbGlzdC11cGRhdGUtaG9vay4gICovCi0gIGlmICghTklMUCAoVnJ1bl9ob29r cykgJiYgIVhCVUZGRVIgKGJ1ZmZlciktPmluaGliaXRfYnVmZmVyX2hvb2tzKQotICAgIGNh bGwxIChWcnVuX2hvb2tzLCBRYnVmZmVyX2xpc3RfdXBkYXRlX2hvb2spOworICBydW5fYnVm ZmVyX2xpc3RfdXBkYXRlX2hvb2sgKGJ1ZmZlcik7CiAKICAgcmV0dXJuIFFuaWw7CiB9CkBA IC02MjY4LDEyICs2MjkyLDE2IEBAIFRoZSBmdW5jdGlvbiBga2lsbC1hbGwtbG9jYWwtdmFy aWFibGVzJyBydW5zIHRoaXMgYmVmb3JlIGRvaW5nIGFueXRoaW5nIGVsc2UuICAqCiAJICAg ICAgIGRvYzogLyogSG9vayBydW4gd2hlbiB0aGUgYnVmZmVyIGxpc3QgY2hhbmdlcy4KIEZ1 bmN0aW9ucyAoaW1wbGljaXRseSkgcnVubmluZyB0aGlzIGhvb2sgYXJlIGBnZXQtYnVmZmVy LWNyZWF0ZScsCiBgbWFrZS1pbmRpcmVjdC1idWZmZXInLCBgcmVuYW1lLWJ1ZmZlcicsIGBr aWxsLWJ1ZmZlcicsIGBidXJ5LWJ1ZmZlcicKLWFuZCBgc2VsZWN0LXdpbmRvdycuICBGdW5j dGlvbnMgcnVuIGJ5IHRoaXMgaG9vayBzaG91bGQgYXZvaWQgY2FsbGluZwotYHNlbGVjdC13 aW5kb3cnIHdpdGggYSBuaWwgTk9SRUNPUkQgYXJndW1lbnQgb3IgYHdpdGgtdGVtcC1idWZm ZXInCi1zaW5jZSBlaXRoZXIgbWF5IGxlYWQgdG8gaW5maW5pdGUgcmVjdXJzaW9uLiAgKi8p OworYW5kIGBzZWxlY3Qtd2luZG93Jy4gIFRoaXMgaG9vayBpcyBub3QgcnVuIHdoZW4KK2Bp bmhpYml0LWJ1ZmZlci1saXN0LXVwZGF0ZS1ob29rJyBpcyBub24tbmlsLiAgKi8pOwogICBW YnVmZmVyX2xpc3RfdXBkYXRlX2hvb2sgPSBRbmlsOwogICBERUZTWU0gKFFidWZmZXJfbGlz dF91cGRhdGVfaG9vaywgImJ1ZmZlci1saXN0LXVwZGF0ZS1ob29rIik7CiAKKyAgREVGVkFS X0JPT0wgKCJpbmhpYml0LWJ1ZmZlci1saXN0LXVwZGF0ZS1ob29rIiwgaW5oaWJpdF9idWZm ZXJfbGlzdF91cGRhdGVfaG9vaywKKwkgICAgICAgZG9jOiAvKiBOb24tbmlsIG1lYW5zIGRv bid0IHJ1biBgYnVmZmVyLWxpc3QtdXBkYXRlLWhvb2snLiAgKi8pOworICBpbmhpYml0X2J1 ZmZlcl9saXN0X3VwZGF0ZV9ob29rID0gZmFsc2U7CisgIERFRlNZTSAoUWluaGliaXRfYnVm ZmVyX2xpc3RfdXBkYXRlX2hvb2ssICJpbmhpYml0LWJ1ZmZlci1saXN0LXVwZGF0ZS1ob29r Iik7CisKICAgZGVmc3ViciAoJlNidWZmZXJfbGl2ZV9wKTsKICAgZGVmc3ViciAoJlNidWZm ZXJfbGlzdCk7CiAgIGRlZnN1YnIgKCZTZ2V0X2J1ZmZlcik7Cgo= --------------61AE8C43FE2221FCE0B25FB5-- From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 23 06:36:30 2019 Received: (at 34765) by debbugs.gnu.org; 23 Apr 2019 10:36:30 +0000 Received: from localhost ([127.0.0.1]:52501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIsms-0000xv-GV for submit@debbugs.gnu.org; Tue, 23 Apr 2019 06:36:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIsmp-0000xh-Qe for 34765@debbugs.gnu.org; Tue, 23 Apr 2019 06:36:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIsmk-00081F-25; Tue, 23 Apr 2019 06:36:22 -0400 Received: from [176.228.60.248] (port=2480 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hIsmj-0005uk-EW; Tue, 23 Apr 2019 06:36:21 -0400 Date: Tue, 23 Apr 2019 13:36:14 +0300 Message-Id: <831s1t57q9.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> (message from martin rudalics on Tue, 23 Apr 2019 11:21:45 +0200) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: martin rudalics > Cc: 34765@debbugs.gnu.org, alexanderm@web.de, > Stefan Monnier > Date: Tue, 23 Apr 2019 11:21:45 +0200 > > Stefan asked me to add a variable 'inhibit-buffer-list-update-hook' > and I came up with the attached. WDYT? Did he also ask you to remove the inhibit_buffer_hooks flag of the buffer object? I'd rather prefer that you set that flag for temporary buffers. In any case, removing the flag will get back the problem with hidden buffers used by coding.c, right? I don't want to lose that. More generally, I don't understand the need for this variable. If we just want to inhibit the hooks for temporary buffers, we don't need to provide a variable, we can do that internally and unconditionally. The variable assumes there are other legitimate use cases where a Lisp program would want to inhibit the hooks, and that we agree to let Lisp programs do that. What are those use cases? From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 24 03:28:14 2019 Received: (at 34765) by debbugs.gnu.org; 24 Apr 2019 07:28:14 +0000 Received: from localhost ([127.0.0.1]:54919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJCKD-0006CL-Uj for submit@debbugs.gnu.org; Wed, 24 Apr 2019 03:28:14 -0400 Received: from mout.gmx.net ([212.227.15.19]:50143) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJCKC-0006C2-2c for 34765@debbugs.gnu.org; Wed, 24 Apr 2019 03:28:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1556090879; bh=XAxcpTg5Cc0KLd3g5AZDX+4rpK4FtscIsr708Tj3dGI=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=fQ1ekxXARL1chzTb8CTDlMcRrtv8DVtD3Nm1vsXBKxrTeY5Pxo166JvM1gJZlg9hI OBGtbpYTiEGAaAQ9hlo+V5FdU74ZKr1/vXKVF2HyR+hlASlyBjuOyLJPX1BKvff1hW uK7NGINwwM6rFZ60w1JIJB7b18jM1KNE5LJxW8kg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.219]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MX1hk-1hG0tf2s6u-00VxBY; Wed, 24 Apr 2019 09:27:59 +0200 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: Eli Zaretskii References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <831s1t57q9.fsf@gnu.org> From: martin rudalics Message-ID: <91d6aceb-5615-5706-99b8-d7f649c5ad87@gmx.at> Date: Wed, 24 Apr 2019 09:27:59 +0200 MIME-Version: 1.0 In-Reply-To: <831s1t57q9.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:eBCqxVXmB7LdWdFXrW1fhetqyeKOtIpACmDQ7fHHoQ0gb9bn+nu kEOFjTFK2ys9ef2rGYoFHctxeLtJdraJGkrW+TMb1hH5iDfMYyglCKnjDyNwLh5zrY9PX+r hceVRlGPJDHXKiY0OGiJgfHnkDpLarg08DFzzGdrE74qUYnjeHwy/qihLaShqvJw2jSPHxe XhcidPyVmVhg088ktDTsg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:pmX5zOVeTp4=:nZwL188a/WlPlJmAOGFHXd U9aXdwCxIoeYEDMu8P1wxnTPEOMUj+6ojgla0q9BC0X3ghLBpPKEiizmJvbO62711MbqduT5V 1DJN7QaKyzA5zjHxJFG947tlPOUsnBdc0UVk021ajwZIRBda+uKtIOChyXVny7wpyQE8tsjMR a9Qt4qtE9faPxZ/8RsPqTETB5AcRruKtlcFWJ6rAMOJC+HeBTffs95n4dKCUJUbP0u03227xW MBb4WK8vxGxde3z5Q5fS1qcCQ2Hr4P4kxR7VW7bEXsHZEiJ/qWsDNp2t7xUcMobuavPue/Ui2 Z8npymNE7qo1VnnbvUdgIu9e/fof3WRM/eRWE/DpjNIJHPMWOkZWyceoDWHkFD0ufzsJS+RAq MHCnjajFOsaPdhkIiaCVyUPJQsN9dRKUkKshIrryCm92ZlB4ckU3nPj/MID/Gs2SKo0MBdect g4WyBLd6C8kGEwxk6Ua2XMxV2vycuPg9Vl43v9RD5eg9fmKHtQfhnaWlX1wjEga50VhGqmD8Z 6bzKEDAbFPYqwpFHjZEd6NlTlqaCqyEU7UVZFgPpQWM2ngAay8BYlzZ7gBpbG3o+9Gxue01Ul EAsjIsLjM9nFSNb5wVjLbxTms8LaxRwykIBe/BKyVYRfdlo3iq09QB2N3ymp+UWdWl/OUZZC/ PqYXKRNS5gBX4rFPtVwWlyy573bErcv1/oLEfG6uuMxEpk9UJWPc8ELu5c4Y8OJpbBPj5Jh0M bQYzkHIw25tSVpLDO9rr+HoofjNd/iEVbECNDNzuc1FE45uNahV2AsdemIJ0fYOQw/w2vNgfn NhxuDd5X9Q6bUMblEfcEPku1XvTec4dL0NIcP1vVqq6rM1yJNDHZezwY6FvXpn38wTAQKa/89 /EY+gubkTpU7C5DtlYsua2Gu3+WRlFk8f4eQMIvFkp5jzEauwhQT1HYMgHvJWGMK4HaY8Lm3r gvXqDL1d5FA== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Stefan asked me to add a variable 'inhibit-buffer-list-update-hook' >> and I came up with the attached. WDYT? > > Did he also ask you to remove the inhibit_buffer_hooks flag of the > buffer object? I'd rather prefer that you set that flag for temporary > buffers. In any case, removing the flag will get back the problem > with hidden buffers used by coding.c, right? I don't want to lose > that. FWIW handling of the the inhibit_buffer_hooks flag is unaffected by my patch. Note that I special cased the call from 'make-indirect-buffer' which is the only one that doesn't check that flag. > More generally, I don't understand the need for this variable. If we > just want to inhibit the hooks for temporary buffers, we don't need to > provide a variable, we can do that internally and unconditionally. > The variable assumes there are other legitimate use cases where a Lisp > program would want to inhibit the hooks, and that we agree to let Lisp > programs do that. What are those use cases? I don't know. The one we care about in the case at hand is that of 'with-temp-buffer' which seems innocuous enough for being used in the body of a function run by 'buffer-list-update-hook'. Since that macro is in subr.el and as such cannnot easily set the inhibit_buffer_hooks flag, the 'inhibit-buffer-list-update-hook' variable provides a simple workaround. But maybe Stefan himself can explain the rationale for such a variable. IIUC his main motivation was that by rebinding 'inhibit-buffer-list-update-hook' to nil one can from Lisp relax the restrictions provided by my patch. martin From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 24 07:13:13 2019 Received: (at 34765) by debbugs.gnu.org; 24 Apr 2019 11:13:13 +0000 Received: from localhost ([127.0.0.1]:55158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJFpx-0005Fw-Hd for submit@debbugs.gnu.org; Wed, 24 Apr 2019 07:13:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36214) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJFpt-0005Fi-QI for 34765@debbugs.gnu.org; Wed, 24 Apr 2019 07:13:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJFpo-0004Qt-8C; Wed, 24 Apr 2019 07:13:04 -0400 Received: from [176.228.60.248] (port=2489 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hJFpn-0004dH-Mw; Wed, 24 Apr 2019 07:13:04 -0400 Date: Wed, 24 Apr 2019 14:12:59 +0300 Message-Id: <83k1fj3bd0.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: <91d6aceb-5615-5706-99b8-d7f649c5ad87@gmx.at> (message from martin rudalics on Wed, 24 Apr 2019 09:27:59 +0200) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <831s1t57q9.fsf@gnu.org> <91d6aceb-5615-5706-99b8-d7f649c5ad87@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA > From: martin rudalics > Date: Wed, 24 Apr 2019 09:27:59 +0200 > > >> Stefan asked me to add a variable 'inhibit-buffer-list-update-hook' > >> and I came up with the attached. WDYT? > > > > Did he also ask you to remove the inhibit_buffer_hooks flag of the > > buffer object? I'd rather prefer that you set that flag for temporary > > buffers. In any case, removing the flag will get back the problem > > with hidden buffers used by coding.c, right? I don't want to lose > > that. > > FWIW handling of the the inhibit_buffer_hooks flag is unaffected by my > patch. You are right, sorry. > > More generally, I don't understand the need for this variable. If we > > just want to inhibit the hooks for temporary buffers, we don't need to > > provide a variable, we can do that internally and unconditionally. > > The variable assumes there are other legitimate use cases where a Lisp > > program would want to inhibit the hooks, and that we agree to let Lisp > > programs do that. What are those use cases? > > I don't know. The one we care about in the case at hand is that of > 'with-temp-buffer' which seems innocuous enough for being used in the > body of a function run by 'buffer-list-update-hook'. Since that macro > is in subr.el and as such cannnot easily set the inhibit_buffer_hooks > flag, the 'inhibit-buffer-list-update-hook' variable provides a simple > workaround. I meant to suggest that get-buffer-create sets this flag when the name of the buffer fits the template of temporary buffers. Exactly like it does for code-conversion buffers now. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 24 08:56:01 2019 Received: (at 34765) by debbugs.gnu.org; 24 Apr 2019 12:56:01 +0000 Received: from localhost ([127.0.0.1]:55281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJHRR-0001Iy-6z for submit@debbugs.gnu.org; Wed, 24 Apr 2019 08:56:01 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:36463) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJHRO-0001Ik-Rh for 34765@debbugs.gnu.org; Wed, 24 Apr 2019 08:55:59 -0400 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id x3OCtuvT031346; Wed, 24 Apr 2019 08:55:56 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 0175466184; Wed, 24 Apr 2019 08:55:55 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook Message-ID: References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <831s1t57q9.fsf@gnu.org> <91d6aceb-5615-5706-99b8-d7f649c5ad87@gmx.at> <83k1fj3bd0.fsf@gnu.org> Date: Wed, 24 Apr 2019 08:55:55 -0400 In-Reply-To: <83k1fj3bd0.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 24 Apr 2019 14:12:59 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 3 Rules triggered GEN_SPAM_FEATRE=0.1, EDT_SA_DN_PASS=0, RV6531=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6531> : inlines <7059> : streams <1819591> : uri <2836499> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, martin rudalics , alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I meant to suggest that get-buffer-create sets this flag when the name > of the buffer fits the template of temporary buffers. That's a more drastic change, but it might be worth a try. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 04:06:36 2019 Received: (at 34765) by debbugs.gnu.org; 25 Apr 2019 08:06:36 +0000 Received: from localhost ([127.0.0.1]:57359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJZOu-0001iN-0i for submit@debbugs.gnu.org; Thu, 25 Apr 2019 04:06:36 -0400 Received: from mout.gmx.net ([212.227.15.19]:60207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJZOr-0001i9-K7 for 34765@debbugs.gnu.org; Thu, 25 Apr 2019 04:06:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1556179580; bh=7koq3iVkvjzKZG83T7ztwIT9uui8dXO5HlkYZEjJmek=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=WMLWaModUCxvCYayuWy+ovUmW49XC2TyGD3KCkLNS7PVd+1ELAFb+aAk/HKTrqLcL 0P47M98IgWwGDyp1mkym9/uZtev2PmbkbMw6+xy7vIG51urM1q1FqyicKcXlEKpXpe Y14CugTuojuIB05g20R7WCJg7hxItMxhf+rGlIbg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.199]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lp3x6-1gq2002HDw-00esfC; Thu, 25 Apr 2019 10:06:20 +0200 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: Eli Zaretskii References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <831s1t57q9.fsf@gnu.org> <91d6aceb-5615-5706-99b8-d7f649c5ad87@gmx.at> <83k1fj3bd0.fsf@gnu.org> From: martin rudalics Message-ID: <520f7a25-03ba-bab0-0826-1c03af207394@gmx.at> Date: Thu, 25 Apr 2019 10:06:18 +0200 MIME-Version: 1.0 In-Reply-To: <83k1fj3bd0.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:HBFjOrYMbkoZuY20FZ2qsSEUcz2ILjCwhkeR6jOI6gNFUCVxS0i QNA2mKzFwSOPLXbRhQvkbyeSrL16w3RsF4a7U9LwUWPAp/PnQFC7zljJICp/7i+9OKLeoSV 0bwl0xousAcJQ0koYp0jFaZeO0qqaeDfy2F21j8UTyGSBFg7Tox/ofcAQ4kJcku8QAGqPDv IUqI95/N6I3Up/Yg29Y3Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:zCpULXxmCzo=:A6ycGtqLa/aaj6spZ51vrH RhaRHE7i55xoWZAjuBh9akGEXQi8A3DkyRqADfMninlEQYDqvZP+5yAepHAm1Hu/u866cfJCN u+i0wN0wlXLosTCgwwhqyo093DpbF5xKTDULhsft0/HRrjzAlK2vbvMBj9IjaObleVBbATOXB D2nwWx5FsOd6JNbU1c8LWISOMJ1bVMN5YG53sismetbnWwzC5piYKFjl7RGbh2fM6EvRp8USr WJ0rPI6xzYa9p495h9azc2CiB41+OlGZEouLjwWXPnfiKAr5fHs3AwcEwXfaik/r1HfIG1AaT lGiotvQEBptYkmbB0QzIEBylVhAcxPIK2AmcdS9ARV695rmjdgdr1troJm7YwtaFBeM+6NFIS lPXTgHK3kUS6t9zNuesu+4nG6gF8MITy9hnC/qAQrQSx3lHuE4uc1cM70XeJ8QDZ6w/q4gShg YJq6FFUEXUwxcxWkFxdKdl61YO+9P164EdodA1AX+8Eea+WEarh34Oo2BTY5D99N481dzAd91 guIBgqomWAIJwQgePNaa8stmzo0ioPjTFxe/IuhNahqPdJbKb8+KYqok1OWvBnchVxy3nYHeL RE6ST9ci2zv/b62upR1KPJlh5m5OffNuP0hX106UmOAkBSKUupfVV2hF2aJwANYbnt0O8m3PN w1+bS+wXZafI9AVPo3DSVud3o/nfM+4prap6QxcTbsohcFCqsMw7XjQ9cbIImO5/hXtZ1VbBa YPEMH4PX2US9adilTC36Pzzrp/m4P8KvYI7d1vdQvKNGhpdZ8rmvycfNJiGT74pEXHNH1rT9O DDActoWhPM11HBgLve93rzq/XJKib/3suLTjVUSplFknurVZfrE8h023PVD8Bg+gHf8i0hYG7 OOAIqYMOmKlr8wz2hWQgj+LqkqwRplU853JNs/jiG5nsnXHXTPh0IXvpl6maZPK9b6ZuWjI36 aBqj5g36WrA== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > I meant to suggest that get-buffer-create sets this flag when the name > of the buffer fits the template of temporary buffers. Exactly like it > does for code-conversion buffers now. We don't have a "template of temporary buffers". For example, a buffer specified by the BUFNAME arg of 'with-output-to-temp-buffer' should not match such a template. But I'd favor a solution that skips all buffers whose name starts with a space as we do for 'other-buffer' or 'unbury-buffer'. We'd just have to document it, maybe provide an additional argument for 'buffer-list' to not return such buffers, decide what to do when we rename them, when they visit a file, get killed ... martin From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 04:51:25 2019 Received: (at 34765) by debbugs.gnu.org; 25 Apr 2019 08:51:25 +0000 Received: from localhost ([127.0.0.1]:57407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJa6H-0002js-53 for submit@debbugs.gnu.org; Thu, 25 Apr 2019 04:51:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJa6G-0002jh-8b for 34765@debbugs.gnu.org; Thu, 25 Apr 2019 04:51:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJa6A-0008A1-4F; Thu, 25 Apr 2019 04:51:18 -0400 Received: from [176.228.60.248] (port=3119 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hJa69-0005Sk-EP; Thu, 25 Apr 2019 04:51:17 -0400 Date: Thu, 25 Apr 2019 11:50:57 +0300 Message-Id: <83v9z2zcwe.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: <520f7a25-03ba-bab0-0826-1c03af207394@gmx.at> (message from martin rudalics on Thu, 25 Apr 2019 10:06:18 +0200) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <831s1t57q9.fsf@gnu.org> <91d6aceb-5615-5706-99b8-d7f649c5ad87@gmx.at> <83k1fj3bd0.fsf@gnu.org> <520f7a25-03ba-bab0-0826-1c03af207394@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA > From: martin rudalics > Date: Thu, 25 Apr 2019 10:06:18 +0200 > > > I meant to suggest that get-buffer-create sets this flag when the name > > of the buffer fits the template of temporary buffers. Exactly like it > > does for code-conversion buffers now. > > We don't have a "template of temporary buffers". Of course we do: with-temp-buffer produces buffer names that follow such a template. > For example, a buffer specified by the BUFNAME arg of > 'with-output-to-temp-buffer' should not match such a template. Such buffers should not necessarily be exempt from running the hooks, AFAIU. In any case, one can always bind the hook locally to nil in the body of the macro, right? > But I'd favor a solution that skips all buffers whose name starts > with a space as we do for 'other-buffer' or 'unbury-buffer'. I think this is too drastic a measure. We should only disable the hooks in buffers where no one in their right minds will ever want to run them. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 06:31:36 2019 Received: (at 34765) by debbugs.gnu.org; 25 Apr 2019 10:31:37 +0000 Received: from localhost ([127.0.0.1]:57576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJbfE-0005CL-N1 for submit@debbugs.gnu.org; Thu, 25 Apr 2019 06:31:36 -0400 Received: from mout.gmx.net ([212.227.17.20]:34417) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJbfC-0005C8-Ep for 34765@debbugs.gnu.org; Thu, 25 Apr 2019 06:31:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1556188282; bh=77xLoVFv0Zd07r8lY9Ncqe7jl0Jf6wW8fnwz87vGA0k=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=BAY4XG4X9E7+Y/kCs0851ouBn6FSccpKAmIPc/ZEaJiehqQq6fyK6h5gkMmGl8JG6 mrnirJ0lhA/QfN34da4tzVHJK3suk6LUwD4+eW2lQefavP3Jfi8G3sEe92+3WMa//q koQvK9z09/e2wvonfo6S/dr6A4RWXqKPqhoRDX9s= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.199]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MtOKc-1gWa2e1TI6-00unBE; Thu, 25 Apr 2019 12:31:22 +0200 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: Eli Zaretskii References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <831s1t57q9.fsf@gnu.org> <91d6aceb-5615-5706-99b8-d7f649c5ad87@gmx.at> <83k1fj3bd0.fsf@gnu.org> <520f7a25-03ba-bab0-0826-1c03af207394@gmx.at> <83v9z2zcwe.fsf@gnu.org> From: martin rudalics Message-ID: <8cc9317a-848f-53cb-4664-1c6e63fe7e11@gmx.at> Date: Thu, 25 Apr 2019 12:31:20 +0200 MIME-Version: 1.0 In-Reply-To: <83v9z2zcwe.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:GmKp+mqEFAnZcUGAOEgEUYJJ4pifQoXytNZ3IaGV/4XAPE0MWc9 XNE2lRAD1dGOLx0tnvO/YxOEvlluMh7YyBjCk34EA5QabjFC6U1/EGLquXP5bGR1CZm+lOv WHvAPWvgJsPNaC6cIQ6uxyiW+bax5O8D35rk+OR20f7fMplZiCAZYF1Bkdn2SQy9NeRVkzt UmbIJrePK2yDZbnLo0Vxw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:iWcP8s2MB7g=:5VzsV0z/tWGp+ATWOng55Z nlEPunBcqzihuK45F8/k7MmOX+ziDoRV0m2L382iIluMs7TlWc4NKroybxF5Bo4LfV6OBbFj3 cxhKDavqO7Tx0HSXiIBwidxWWnEWIyCozQBa3QJ/R34Q4EjS9TcTPyewX0gvYilF1oewcfeXe E1le9r2MGQp6xmMenwgxmzQJsG4NgEyKCK7w1zG9zIZaU4330Qf4mxRwDzuVJ6hfum/hMMecP 1leDMDzS5tItRuDAz6DDCC6pzowuW9GlMoSG57wRopTmvQEmSznA+3CEoU+TRLVhgY3qGcOoZ BGcimzOYQyJ2vNn7gr4YoVUT3Frrs0hxQVdA3X14kOt9bV0c4D0fCl/80XySKdwIK8hYfBKWj 4QrHpyMtnf25oy7aF7Wmo3iMg4pePfkdBu1+IuDg8BkQkdmJwojciITVMZUWPq1ZJ8RQQsAIw xHZRAUXGqpus3MU2ExYaHebxz53ThnLahDWmRBnUOMT38O3k3e0OLL2cRm970tDwPvdJXVMdM rijr23sJje+kQ/ICJ1vXNgxnCUnRPqhNCUPKoSe1AHmNj65lRZMzjt9Dg6TcDLX4deHwSdUzH JzUXC3IH7yKP98rX/5i3x/RWhWMzMZhiSwkdwcPtb5kzkNLOaDzb3fVl+/6eHT/7M2V+dktTt nnwZQwEP0zx+RRVoHEEKGVcB8aBN79ZKYYil4oivmDY/kwB0jf+zqkadSPoohPLuVRSZlTlWi VixK9iVkvwESbigfpglA0WM/ivXO9L9rxsfMS4pUUMzLRmPJ8hdCvWXmW+iBZkrEuUqKUxGoJ GBiYR9tTPR48DkznGbjjQHCo0qjuX+Q2VU8z7l3mCGbJXPgz/6b6RaWFtCVDhTI48Cb0mrfaP 4zf0DfLX17PmyQp+/30/XU+St4ihbcsRoUNwmOXa56D2TFISbWjAcb0EvmUrLJeTGjc9F/e8d YU10Jl6gwtw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> > I meant to suggest that get-buffer-create sets this flag when the name >> > of the buffer fits the template of temporary buffers. Exactly like it >> > does for code-conversion buffers now. >> >> We don't have a "template of temporary buffers". > > Of course we do: with-temp-buffer produces buffer names that follow > such a template. IIUC we'd need an expression similar to Vcode_conversion_workbuf_name to use in 'get-buffer-create' b->inhibit_buffer_hooks = (STRINGP (Vcode_conversion_workbuf_name) && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name), SBYTES (Vcode_conversion_workbuf_name)) == 0); So we could specify, for example, staticpro (&Vtemp_buffer_name); Vtemp_buffer_name = build_pure_c_string (" *temp*"); and rewrite the above assignment as b->inhibit_buffer_hooks = ((STRINGP (Vcode_conversion_workbuf_name) && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name), SBYTES (Vcode_conversion_workbuf_name)) == 0) || (STRINGP (Vtemp_buffer_name) && strncmp (SSDATA (name), SSDATA (Vtemp_buffer_name), SBYTES (Vtemp_buffer_name)) == 0)); >> For example, a buffer specified by the BUFNAME arg of >> 'with-output-to-temp-buffer' should not match such a template. > > Such buffers should not necessarily be exempt from running the hooks, > AFAIU. In any case, one can always bind the hook locally to nil in > the body of the macro, right? Unless the body changes the buffer list in some signifcant way, for example, by creating or deleting another buffer. >> But I'd favor a solution that skips all buffers whose name starts >> with a space as we do for 'other-buffer' or 'unbury-buffer'. > > I think this is too drastic a measure. We should only disable the > hooks in buffers where no one in their right minds will ever want to > run them. Then what about the buffers created by 'with-temp-file' or 'with-output-to-string'? martin From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 06:49:49 2019 Received: (at 34765) by debbugs.gnu.org; 25 Apr 2019 10:49:49 +0000 Received: from localhost ([127.0.0.1]:57594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJbwq-0005cn-MM for submit@debbugs.gnu.org; Thu, 25 Apr 2019 06:49:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39959) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJbwn-0005ca-SI for 34765@debbugs.gnu.org; Thu, 25 Apr 2019 06:49:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJbwi-0000EA-5E; Thu, 25 Apr 2019 06:49:40 -0400 Received: from [176.228.60.248] (port=2740 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hJbwh-0005FH-K4; Thu, 25 Apr 2019 06:49:39 -0400 Date: Thu, 25 Apr 2019 13:49:19 +0300 Message-Id: <83k1fiz7f4.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: <8cc9317a-848f-53cb-4664-1c6e63fe7e11@gmx.at> (message from martin rudalics on Thu, 25 Apr 2019 12:31:20 +0200) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <831s1t57q9.fsf@gnu.org> <91d6aceb-5615-5706-99b8-d7f649c5ad87@gmx.at> <83k1fj3bd0.fsf@gnu.org> <520f7a25-03ba-bab0-0826-1c03af207394@gmx.at> <83v9z2zcwe.fsf@gnu.org> <8cc9317a-848f-53cb-4664-1c6e63fe7e11@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA > From: martin rudalics > Date: Thu, 25 Apr 2019 12:31:20 +0200 > > >> > I meant to suggest that get-buffer-create sets this flag when the name > >> > of the buffer fits the template of temporary buffers. Exactly like it > >> > does for code-conversion buffers now. > >> > >> We don't have a "template of temporary buffers". > > > > Of course we do: with-temp-buffer produces buffer names that follow > > such a template. > > IIUC we'd need an expression similar to Vcode_conversion_workbuf_name > to use in 'get-buffer-create' That's what I meant, yes. > >> For example, a buffer specified by the BUFNAME arg of > >> 'with-output-to-temp-buffer' should not match such a template. > > > > Such buffers should not necessarily be exempt from running the hooks, > > AFAIU. In any case, one can always bind the hook locally to nil in > > the body of the macro, right? > > Unless the body changes the buffer list in some signifcant way, for > example, by creating or deleting another buffer. Sure, but that's why this should not be done unconditionally. > Then what about the buffers created by 'with-temp-file' or > 'with-output-to-string'? Fine with me. But the former already uses with-temp-buffer, so I don't think we need anything special for it. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 09:01:06 2019 Received: (at 34765) by debbugs.gnu.org; 25 Apr 2019 13:01:06 +0000 Received: from localhost ([127.0.0.1]:57715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJdzt-0002RN-UU for submit@debbugs.gnu.org; Thu, 25 Apr 2019 09:01:06 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:46379) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJdzr-0002RD-M6 for 34765@debbugs.gnu.org; Thu, 25 Apr 2019 09:01:04 -0400 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id x3PD11d0015946; Thu, 25 Apr 2019 09:01:01 -0400 Received: by pastel.home (Postfix, from userid 20848) id 2FB696AE07; Thu, 25 Apr 2019 09:01:01 -0400 (EDT) From: Stefan Monnier To: martin rudalics Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook Message-ID: References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> Date: Thu, 25 Apr 2019 09:01:01 -0400 In-Reply-To: <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> (martin rudalics's message of "Tue, 23 Apr 2019 11:21:45 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6533=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6533> : inlines <7059> : streams <1819686> : uri <2836902> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > - `(let ((,temp-buffer (generate-new-buffer " *temp*"))) > + `(let ((,temp-buffer > + (let ((inhibit-buffer-list-update-hook t)) > + (generate-new-buffer " *temp*")))) > ;; FIXME: kill-buffer can change current-buffer in some odd cases. > (with-current-buffer ,temp-buffer > (unwind-protect > (progn ,@body) > (and (buffer-name ,temp-buffer) > - (kill-buffer ,temp-buffer))))))) > + (let ((inhibit-buffer-list-update-hook t)) > + (kill-buffer ,temp-buffer)))))))) Hmm... I was thinking we could expose `inhibit_buffer_hooks` as a Lisp variable (so we can set it without having to match names, which I find ugly and brittle), but we'd want to `setq` it rather than let-bind it. But while it's easy to set it before running kill-buffer, we can't set it before calling generate-new-buffer :-( How 'bout adding an optional argument to `generate-new-buffer` to set `inhibit_buffer_hooks`? Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 10:35:38 2019 Received: (at 34765) by debbugs.gnu.org; 25 Apr 2019 14:35:38 +0000 Received: from localhost ([127.0.0.1]:59096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJfTO-0004yl-Ge for submit@debbugs.gnu.org; Thu, 25 Apr 2019 10:35:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJfTM-0004yY-24 for 34765@debbugs.gnu.org; Thu, 25 Apr 2019 10:35:36 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJfTC-0005Of-Jd; Thu, 25 Apr 2019 10:35:28 -0400 Received: from [176.228.60.248] (port=4762 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hJfSz-000553-Mz; Thu, 25 Apr 2019 10:35:23 -0400 Date: Thu, 25 Apr 2019 17:34:46 +0300 Message-Id: <83d0laywzd.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Thu, 25 Apr 2019 09:01:01 -0400) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Eli Zaretskii , 34765@debbugs.gnu.org, alexanderm@web.de > Date: Thu, 25 Apr 2019 09:01:01 -0400 > > How 'bout adding an optional argument to `generate-new-buffer` to set > `inhibit_buffer_hooks`? Fine with me, but aren't you afraid people will start abusing this? From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 26 03:41:07 2019 Received: (at 34765) by debbugs.gnu.org; 26 Apr 2019 07:41:07 +0000 Received: from localhost ([127.0.0.1]:59903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJvTm-0008GE-RN for submit@debbugs.gnu.org; Fri, 26 Apr 2019 03:41:07 -0400 Received: from mout.gmx.net ([212.227.17.20]:41447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJvTi-0008FX-JV for 34765@debbugs.gnu.org; Fri, 26 Apr 2019 03:41:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1556264449; bh=lFmMWjyrfpe862iphoquzNKOQMk7OVn/jF7j/Ppm2CI=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=amGnm8fZfhPaPxtjeTgG+JcbTQOP1n8P0jA1ZkRHnYwSNjXddJ/sKMymR1eDAwOqJ zF2Jf4izvesXxLP+biKWZHB28wxdYKbjLuHXJApkeZ7DLQJrwuoZ+2NpRRk+SlIfZZ RkaycKVyfK/r+eVzh9rClY1NF+b/+tEgf/hgSu7g= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([46.125.249.38]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MaW7Z-1h4sfI1juD-00K9mj; Fri, 26 Apr 2019 09:40:49 +0200 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: Eli Zaretskii References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <831s1t57q9.fsf@gnu.org> <91d6aceb-5615-5706-99b8-d7f649c5ad87@gmx.at> <83k1fj3bd0.fsf@gnu.org> <520f7a25-03ba-bab0-0826-1c03af207394@gmx.at> <83v9z2zcwe.fsf@gnu.org> <8cc9317a-848f-53cb-4664-1c6e63fe7e11@gmx.at> <83k1fiz7f4.fsf@gnu.org> From: martin rudalics Message-ID: <41423d7b-771d-faaa-7aa0-2b3eb8a00f5d@gmx.at> Date: Fri, 26 Apr 2019 09:40:48 +0200 MIME-Version: 1.0 In-Reply-To: <83k1fiz7f4.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:pZ7yvdngpXGtWp9RaV6zZRdjntw8hZLONLB9qAtCGSXHVAinHYf 0cBgHsMd2A9wjoRTi03aPSiKTc0ZzvfY8bzFoxV4UqAQfxt0xtvhCTO3JJ2pbG1BGunWiFZ Qk1J1B+ur/YqlBvb1hap4O4arnXAOPWr6Vgwt4AVOvpq2yi8bCXYAjvlAyC13frGI+S4Esd xWZh2+XkRLXQRkXSihUBw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:yRP2Zc4URqY=:iZAM2BPwhgt5dxssdzuQzz C6Ywx4Doqy9Ji8IFQbtR5yS6jJXGEXIpT8Ad4HANcvU9wVEzwHoAtjuQ9S8y7Zsq7wJOrfv6S to43sUyTM53+d86wDVhyznxqLc75iyefWMBU6bZODQNzNU5TW3U046jaX8tZlnvy+FNID+Py9 DgpBcazMiz0QlS0jml2wi9tRPtWJFBx6rszg/wbdzLnJIaEIrl+V9aHLAh9/1sKHc/nsXED5F IfpixrBwGlgpOqMBWXUYyApzEgbp3JFgaWqEYIsp0Ea7ejmay8I8T4IL+4Yf70V1eANfjujGY jMmyhFfQKhQExYEBFSC2i0vZtGrBeuJidJTHrUTfJof7IAYtHjVbXkLdDs7YQQITYpFPAq+d5 a7gchx5yxORNiZQ3ucrk2TmCC08wMBecGLJUTSmSI4p/6AsLRVFbbc8RxFqt9yIOoDHN18wKG 5aG0vAJ03Tyk7dFmqAwobyDIOOnCgWYwhW17uY5YTs4fo8x8KAYfoMJ7Z2AaRxpojxLIyHuEL kLdDIHftrI7CkKbLZiktKF5J2qRBfLezF5e+nhPHRSSZH4uLtlyuEjZXzoBCJvcgAuTdQLAK+ 5f8TAhE1boWv7w9a3V1pD3UIpw6V0wtSSpKYy0Rpl7eb4s1+0nq9J/FKcaxJn7qM61Q2mJfTl /0VHF7mmc+Fwoj6o4Szcm3d1MAYKIa4vFPSp46Z8bXz+YRJ/FGVScoxAea8+c1qFcTy2SIR/O FZwOcbydzCfH+ou3BUWsNm14YWDZvrQG6Q0jmS5QhXxs6XxX9rIY/0w6+k+PAony0d29fKeWd jIeezbXPXrD+gr02iIIdSRh+xtiIJzBqm7TuEJs2GAlpiQ8qmYUWp61p7UH6xV6/msvAK49gF EPVUBQXmky+bQVdvcmH3HIaQ017RRlaLWbhYZfGZzOYSJ8FzlmWgU5WFGxBXIEQKDYdFlAMrl zSUSKIFiZIg== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Then what about the buffers created by 'with-temp-file' or >> 'with-output-to-string'? > > Fine with me. But the former already uses with-temp-buffer, so I > don't think we need anything special for it. Here 'with-temp-file' uses (get-buffer-create (generate-new-buffer-name " *temp file*")) and 'with-output-to-string' (get-buffer-create (generate-new-buffer-name " *string-output*")) martin From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 26 03:41:11 2019 Received: (at 34765) by debbugs.gnu.org; 26 Apr 2019 07:41:11 +0000 Received: from localhost ([127.0.0.1]:59906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJvTr-0008GU-55 for submit@debbugs.gnu.org; Fri, 26 Apr 2019 03:41:11 -0400 Received: from mout.gmx.net ([212.227.17.20]:46179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJvTo-0008G5-U8 for 34765@debbugs.gnu.org; Fri, 26 Apr 2019 03:41:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1556264461; bh=NwGeEE8AuUKtydkShqfqeYgbYDMcI3tu+h+mv8R+nGQ=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=Yh9MERO4K4doqAdpZ4yHPaqMQ0qkrmKggdbfuXZI2WqIqRcvk6T6oJBUoIO/sIyli JOdJENfLXvSZs/3sMfGoga/gTxfoe/SZbJJ+rphYRmdhF0Osaa4QNqxhP3weSevPrt jUFaYMrDniixmOBjcAauASnmGtl4I43yAgjYO79I= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([46.125.249.38]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MBDnC-1hVRXX1Qqs-00ClQP; Fri, 26 Apr 2019 09:41:01 +0200 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: Stefan Monnier References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> From: martin rudalics Message-ID: <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> Date: Fri, 26 Apr 2019 09:41:02 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:aDfGW0ptlXjN0kLiXWAXD1LtHPx4m+la8Ik5DsqrrtySnayW05J pQ5jyKcGKdLXgxeX3XBZgo40oJDu3HGvmagtv24t7rnBsAKkrnsyhcK0Nn/gWzPDOH7R/+S Q0jXzvwRODa0Q2eDC0jX0v8Ym9UZjqOEJK36UmVpqXtT4B2Xs/8KewVf/tHTeApPl14fhSY qs0M84RqIUDvmfkUqBCyQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:eP6YMPLonm8=:qD023djQFErFwKKzY4qnUz hL3bLrVp5TeKh/iRQ5rdbhXor4ok3LcAt1pejajlHCGdnLN9j6T8WDJOZaOX55OKGqK1G2KcG 2fTOjgRlXTGfBcmxmMoPFNoMQrQQrba/N5PUcJOYf3r9pbcjO8bQ30rKL/zJL7xG9JYBgjBgs /qcU516uA5leW4n0vWvS2YKKmAeKtdsnGPxukio6IRCsaLkMEYP8IZaDLkGo8qiC+jTnu1vUM T5VDT+W+MeNsJXPO/1ENd476FhtP1ZqtWf1CY4C251sHLW1MNabCLkPlvDjszmUu0NiG2jMPK ITEpXihbuT4VNFHN5hx04Y2823LOtBBOUy8FkEK5ry10Nd8BuIhzOTTFislvwmBMsIqDNXONX GpVDrDYynBNtrULeyXiOi2XSklXSn+Uj+M8UboqLQRfNvR0k1Q80LpHWbfO0JAtf3qJUDbswL +UjM7YI/tsBn/X4U+RJRv+u43un4rLmTqyhiejd+M7T2BWouARUnPzWARImuQdLr0Zu/QDGmV iqYPQ6l4pB1CFxAqUDRreIwRAI5UarFQck9I5b350gdcD9pA54V7ZTTWq4FfvYhKDD+YkQwjg yDpbLMXNmcco0qxcmWq5tWMtjFJMRZgKR/H8lKpgsuarX4XKp2CwuMoa0dFstOaMymWeVa+CB gf3sTYaqvaFOi/STTXYudTagKVrtVZsTFawyEGqNfXZYEq8qqDOC9R/cvUOyHMoKNDKbNqq7a tFKUK8k6CPJnIuUM1nCBQtLG18nUnZE1IS9NeNPlj0GciJCFqQU+HUWAvfiVssUyvFIwWD3M2 4yyp6gUi97k//N25atBQFLnEJ/sCw/RWH8YyO0lPIYeKzNpAXa6Ts5RXpZcDs5bRBCN7hPLmT i8gwivftoSqO4lEG28AuQJjqIgU5X2cKB8iabW82anuotIOSpEVC7xowzBcK4N93ksXqq135R pKlHc1sZ8NA== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > How 'bout adding an optional argument to `generate-new-buffer` to set > `inhibit_buffer_hooks`? How about moving 'generate-new-buffer' to C to set that flag without exposing it to Lisp (and to avoid things like ;; We can't use `generate-new-buffer' because files.el ;; is not yet loaded. in 'load-with-code-conversion')? martin From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 26 03:41:21 2019 Received: (at 34765) by debbugs.gnu.org; 26 Apr 2019 07:41:21 +0000 Received: from localhost ([127.0.0.1]:59909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJvU1-0008Gs-FY for submit@debbugs.gnu.org; Fri, 26 Apr 2019 03:41:21 -0400 Received: from mout.gmx.net ([212.227.17.20]:56557) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJvU0-0008Gg-Kg for 34765@debbugs.gnu.org; Fri, 26 Apr 2019 03:41:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1556264473; bh=8L6kV8nfFGM73d4iU9puq2z8VC7A6j5ft4M8KZMzL8w=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=TjHfC07dJM4vpvQzv3FFMat/lDNbwe43yje6U5U9uvVnGKq/mb3GePLauEEav5AJQ n21Xq1cjbdy9WyDs3eKRVwkTXhb72SLprmXFwiSkiYKqcZlzwV5jFOWDdTosn5UK1i Xu3YewJWa5MVVoQICkIMYXVuYE3PTBD6WpBin53c= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([46.125.249.38]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MhD2Y-1goQDD0lFq-00eN1J; Fri, 26 Apr 2019 09:41:13 +0200 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: Eli Zaretskii , Stefan Monnier References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <83d0laywzd.fsf@gnu.org> From: martin rudalics Message-ID: Date: Fri, 26 Apr 2019 09:41:11 +0200 MIME-Version: 1.0 In-Reply-To: <83d0laywzd.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:Reer8CTdG9GUKUEONnu9VlYE7l8NgMnkwACl7gcOYLbvKp2/Xf7 nLE9n5F1ObNJb4jQPDqqErzJfwhm5V51D7XYbqGHD5SZqQfApG5sc5C2rPjK7L7Stc0HR/g tEB3sIMBqOoMfzZK4SMD+wkhS3LxsldziLM8CJwj5e63PRofx8DJFWJoSsgnmr6nR5qnH/J F2dg1kACNdU1DtvO60oQw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:oJfQZC4jByI=:HSzx5PTinyg6LigCcjl7n+ QFjrloYhI/iETTJuTv91yrOQBNpUxueyT+opWDUP9sEgelUpWFMrG3hduPW+ZRGi/9XxkMEbf sWibuJIsFVl/2fV6WPuIGoUxgE1jq5IZmWlXIMNpaVA3sn3oIzrl5lEburTiRNaD+SyGyxl+5 YVdNBzBGK9PquTMCJ7l4YNv5dF5gIZS4C/LJd9ZftnCEB2ey8eKovXc0bs4GvO4Go6PPp35+F o9Af5jTHL2ClCDH+C9eb41Fuw55H6Zjr7cANZnZNYvzlpVKrVocJMpRz9JPGXHnh2x2i5Vs5f A2twfVIPKV25W3pIgWdeEBW91F/PPh624aFu4/C60t+wjbDDqWXYs1oecpo6cL/ZwUHzvvzTB 5+ItgfI3oLOlxmxqvHhUTYDEDg1z5UgnNHlfwhUYdGC34yA12NZwzfmI+QbnsTBAwhDKGrnQ6 jOGUc4B9GJW7iPYT/l3OAfzfMhB22STVWLLOCkGG+e0F7Fe790gLDO0ZnoaJJBvi6RKAhSn8m nISAGKbHnPYb6TWmNx44yyIDGMFt8i9ctiLhdRRiHMZQHqiaLuj6xoCz0qd/OXUTmV8wHnT41 dhmeq+AE4xQnbpdRl1zboBKdbc+3ZKztpi9mo1XGRsNYEZXx2RIXf+Af6LNngXiMPZSTOoD4p g0YzA0oso+KiyLWTaq/BwKug2/+ylttHtCnn9qMA8hDr049eg4cvwsM+vjDVGnA7ltKajbP/o zr7gwWc3nQ1Ldv77Ct8zW3XXtMaZfO1hAw1i0dobanEvCyePk1cy4h/1dXxQ7ezaVFvZl2GCM B5L+We0SLH4h0W8lPzqHbWSZrBR1K2LXW4cHA/tAH1lnlvg5mChp+KFMBpv7WET1crf7ijjEC fLMnMtPJGFsG0/iEcueO4OCmuqCA4QmjHigW1INClXYbH3YZ7sdukosNef1nUJveKzeigy41N nA17J0ja96Q== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> How 'bout adding an optional argument to `generate-new-buffer` to set >> `inhibit_buffer_hooks`? > > Fine with me, but aren't you afraid people will start abusing this? I wouldn't pass an argument but rather set the flag unconditionally when NAME starts with a space ... martin From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 26 04:09:54 2019 Received: (at 34765) by debbugs.gnu.org; 26 Apr 2019 08:09:54 +0000 Received: from localhost ([127.0.0.1]:59963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJvvd-0000bb-Qi for submit@debbugs.gnu.org; Fri, 26 Apr 2019 04:09:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52624) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJvvb-0000bP-8q for 34765@debbugs.gnu.org; Fri, 26 Apr 2019 04:09:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36527) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJvvV-0005s5-8S; Fri, 26 Apr 2019 04:09:45 -0400 Received: from [176.228.60.248] (port=2161 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hJvvT-00021J-AJ; Fri, 26 Apr 2019 04:09:43 -0400 Date: Fri, 26 Apr 2019 11:09:26 +0300 Message-Id: <83a7gdxk5l.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: <41423d7b-771d-faaa-7aa0-2b3eb8a00f5d@gmx.at> (message from martin rudalics on Fri, 26 Apr 2019 09:40:48 +0200) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <831s1t57q9.fsf@gnu.org> <91d6aceb-5615-5706-99b8-d7f649c5ad87@gmx.at> <83k1fj3bd0.fsf@gnu.org> <520f7a25-03ba-bab0-0826-1c03af207394@gmx.at> <83v9z2zcwe.fsf@gnu.org> <8cc9317a-848f-53cb-4664-1c6e63fe7e11@gmx.at> <83k1fiz7f4.fsf@gnu.org> <41423d7b-771d-faaa-7aa0-2b3eb8a00f5d@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA > From: martin rudalics > Date: Fri, 26 Apr 2019 09:40:48 +0200 > > >> Then what about the buffers created by 'with-temp-file' or > >> 'with-output-to-string'? > > > > Fine with me. But the former already uses with-temp-buffer, so I > > don't think we need anything special for it. > > Here 'with-temp-file' uses > > (get-buffer-create (generate-new-buffer-name " *temp file*")) > > and 'with-output-to-string' > > (get-buffer-create (generate-new-buffer-name " *string-output*")) Oops. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 26 04:10:47 2019 Received: (at 34765) by debbugs.gnu.org; 26 Apr 2019 08:10:47 +0000 Received: from localhost ([127.0.0.1]:59967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJvwV-0000dJ-5J for submit@debbugs.gnu.org; Fri, 26 Apr 2019 04:10:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJvwT-0000d6-EL for 34765@debbugs.gnu.org; Fri, 26 Apr 2019 04:10:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36532) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJvwO-0006PE-Bi; Fri, 26 Apr 2019 04:10:40 -0400 Received: from [176.228.60.248] (port=2219 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hJvwN-00028j-T8; Fri, 26 Apr 2019 04:10:40 -0400 Date: Fri, 26 Apr 2019 11:10:22 +0300 Message-Id: <838svxxk41.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> (message from martin rudalics on Fri, 26 Apr 2019 09:41:02 +0200) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Eli Zaretskii , 34765@debbugs.gnu.org, alexanderm@web.de > From: martin rudalics > Date: Fri, 26 Apr 2019 09:41:02 +0200 > > > How 'bout adding an optional argument to `generate-new-buffer` to set > > `inhibit_buffer_hooks`? > > How about moving 'generate-new-buffer' to C to set that flag without > exposing it to Lisp (and to avoid things like > > ;; We can't use `generate-new-buffer' because files.el > ;; is not yet loaded. > > in 'load-with-code-conversion')? Fine with me. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 26 04:11:09 2019 Received: (at 34765) by debbugs.gnu.org; 26 Apr 2019 08:11:09 +0000 Received: from localhost ([127.0.0.1]:59978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJvwr-0000er-2v for submit@debbugs.gnu.org; Fri, 26 Apr 2019 04:11:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52977) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJvwj-0000db-Fv for 34765@debbugs.gnu.org; Fri, 26 Apr 2019 04:11:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJvwe-0006XN-5k; Fri, 26 Apr 2019 04:10:56 -0400 Received: from [176.228.60.248] (port=2236 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hJvwd-000291-H7; Fri, 26 Apr 2019 04:10:55 -0400 Date: Fri, 26 Apr 2019 11:10:38 +0300 Message-Id: <837ebhxk3l.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: (message from martin rudalics on Fri, 26 Apr 2019 09:41:11 +0200) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <83d0laywzd.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 34765@debbugs.gnu.org, alexanderm@web.de > From: martin rudalics > Date: Fri, 26 Apr 2019 09:41:11 +0200 > > >> How 'bout adding an optional argument to `generate-new-buffer` to set > >> `inhibit_buffer_hooks`? > > > > Fine with me, but aren't you afraid people will start abusing this? > > I wouldn't pass an argument but rather set the flag unconditionally > when NAME starts with a space ... Too radical, IMO. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 26 07:00:49 2019 Received: (at 34765) by debbugs.gnu.org; 26 Apr 2019 11:00:49 +0000 Received: from localhost ([127.0.0.1]:60160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJyb3-0004oS-02 for submit@debbugs.gnu.org; Fri, 26 Apr 2019 07:00:49 -0400 Received: from mout.gmx.net ([212.227.15.15]:35849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJyb0-0004oD-CG for 34765@debbugs.gnu.org; Fri, 26 Apr 2019 07:00:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1556276407; bh=yiftWcwwvdawrEP57s1uDHWidYqhEOzO4f44c53LUjw=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=KTPLDAx8ih53lvtSaAGFzEOt6XQBDiXi61wQ2WnBDlxQPL4PEuguFpI7Sj26bFNrx wSESnWvnlq4Hbi5jfbPxcKo3uqDaNmiZj2VTMBEc3V+YNRrFPy34v0fIzjsvVmzDAk 0MF9EowMPe8qsOcBV1SDs3KjLwRaC8W5BrmIt0b8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.85]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N3siA-1gbjol2RIe-00zpd7; Fri, 26 Apr 2019 13:00:07 +0200 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: Eli Zaretskii References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> From: martin rudalics Message-ID: <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> Date: Fri, 26 Apr 2019 13:00:06 +0200 MIME-Version: 1.0 In-Reply-To: <838svxxk41.fsf@gnu.org> Content-Type: multipart/mixed; boundary="------------EDB650DEBF03E33053E68131" Content-Language: de-DE X-Provags-ID: V03:K1:nbu2J7IAYyADBDhxYd3SOEYWTmrO1lgWzMlr/t/bVrg9rRsuxMp u8jay/IgL8PYgPZ1dLo0f4wArKLSGoULGtBWwtjgYlXCvZF/go6PVpytoCh1RYfhQoq/86V Oj+58es0mU8eG5bFfgwyQQBzwMhI0L1xGwb/a6x7jPU87TWBPuW8L8wfMLXh4Dh0FoypNUi eXIvdVQzyvubRlIn3Kpdw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:FcrjTwIGlWk=:AvT+gddadZDyfbBPVJ2hh+ XvUVJum5w3ejd1uOPKDEHQY2yygUdf3t7qPXRHhmc1M8X7hcvsUC8LxtbbZZ235JOzC82Da2E qg0ByT3HSdJBfeAZlPQfQzO1wOHpM90uCMlPZHrty28pXtg4TqU9pPP6xGKeCM0U/4GJqYSJS 4KmAYW9r+dU0TuPSaoAXebJ0HqZtMR6zx/rst+4x1hJo7WZ7zjP9uWDTzb3h/hJWDPMqc1XE5 lrgtBoIOJXOWTjTHoAYNRB0yBt0E6mEGa/Hn0vDbb9N2TmZPEyJG0zI/19cykjfyuZl6aPVTw Ufr87oE/ikkpJzqyecsSdMU8vUF2ghE6OVXmVXOTR7FQHx44LiqN1pOc/0KQ00edLsLokPB9l uZ90RG5Rryb93Wk6yVIKeDZS5pOBTeLR25nEt+kc4k3DNS3kfRNcHNw5aifcKuthlO8twJRxH 64uKOwJ8rA2CHg5Z/jve651yIOmSW69T5h2KmDyB1y77VYAV3GGcrHYhZfuNMslHaIQ7R567n jdNuxnp91GLS0Up8nW1v5PnM5cmx/BlyMbrUafGtBovvGCRdHSEdhfrtLl5f292B4uuhhyvjr hW2uzxlpriaODKsgN/zS8F+Y5CKYQ9Suiz9JAGG5RpQy0vOotJtsjD8sHwt1QLB+FuDtVfZwu rq+8BL8HjM6V/ukddbfSsxMQ28YaQL2tpvWAYV7q6X3ljTIyXloac/mZNl7ryEnwXmpmgX3bH s539m2Ej2+eytW6xFtJLH1Iqpr80cTrKo+LkbdsQAC34fYpx0rfYo1AArDriUqgef6BDf4HFo TvPW/r0fcdKJlgJ97JTFufW1XxpHiaS+AB1a7U5X7bd3st23AJ/1JxBZ2EGlhBFMpBrFu+dXR I6Y4hRArKiXYEVggZeooQ0aRyXTgQ2qJaRO0lBkPXVhzlfzMGGNdlQ5YUHM7OR X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is a multi-part message in MIME format. --------------EDB650DEBF03E33053E68131 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable >> > How 'bout adding an optional argument to `generate-new-buffer` to s= et >> > `inhibit_buffer_hooks`? >> >> How about moving 'generate-new-buffer' to C to set that flag without >> exposing it to Lisp (and to avoid things like >> >> ;; We can't use `generate-new-buffer' because files.el >> ;; is not yet loaded. >> >> in 'load-with-code-conversion')? > > Fine with me. I attach a preliminary patch. martin --------------EDB650DEBF03E33053E68131 Content-Type: text/plain; charset=UTF-8; name="inhibit-buffer-hooks.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="inhibit-buffer-hooks.diff" ZGlmZiAtLWdpdCBhL2xpc3AvZmlsZXMuZWwgYi9saXNwL2ZpbGVzLmVsCmluZGV4IGMwNWQ3 MGEwMGUuLmQ5MTk3OTMyNTEgMTAwNjQ0Ci0tLSBhL2xpc3AvZmlsZXMuZWwKKysrIGIvbGlz cC9maWxlcy5lbApAQCAtMTc3Nyw2ICsxNzc3LDkgQEAga2lsbC1idWZmZXItaG9vawogVGhl IGJ1ZmZlciBiZWluZyBraWxsZWQgaXMgY3VycmVudCB3aGlsZSB0aGUgaG9vayBpcyBydW5u aW5nLgogU2VlIGBraWxsLWJ1ZmZlcicuCiAKK1RoaXMgaG9vayBpcyBub3QgcnVuIGZvciBi dWZmZXJzIGNyZWF0ZWQgYnkgJ2dlbmVyYXRlLW5ldy1idWZmZXInCit3aXRoIHRoZSBzZWNv bmQgYXJndW1lbnQgJ2luaGliaXQtYnVmZmVyLWhvb2tzJyBub24tbmlsLgorCiBOb3RlOiBC ZSBjYXJlZnVsIHdpdGggbGV0LWJpbmRpbmcgdGhpcyBob29rIGNvbnNpZGVyaW5nIGl0IGlz CiBmcmVxdWVudGx5IHVzZWQgZm9yIGNsZWFudXAuIikKIApAQCAtMTg4MCwxMSArMTg4Myw2 IEBAIGNyZWF0ZS1maWxlLWJ1ZmZlcgogCQkJICAgICAoY29uY2F0ICJ8IiBsYXN0bmFtZSkK IAkJCSAgIGxhc3RuYW1lKSkpKQogCi0oZGVmdW4gZ2VuZXJhdGUtbmV3LWJ1ZmZlciAobmFt ZSkKLSAgIkNyZWF0ZSBhbmQgcmV0dXJuIGEgYnVmZmVyIHdpdGggYSBuYW1lIGJhc2VkIG9u IE5BTUUuCi1DaG9vc2UgdGhlIGJ1ZmZlcidzIG5hbWUgdXNpbmcgYGdlbmVyYXRlLW5ldy1i dWZmZXItbmFtZScuIgotICAoZ2V0LWJ1ZmZlci1jcmVhdGUgKGdlbmVyYXRlLW5ldy1idWZm ZXItbmFtZSBuYW1lKSkpCi0KIChkZWZjdXN0b20gYXV0b21vdW50LWRpci1wcmVmaXggKHB1 cmVjb3B5ICJeL3RtcF9tbnQvIikKICAgIlJlZ2V4cCB0byBtYXRjaCB0aGUgYXV0b21vdW50 ZXIgcHJlZml4IGluIGEgZGlyZWN0b3J5IG5hbWUuIgogICA6Z3JvdXAgJ2ZpbGVzCmRpZmYg LS1naXQgYS9saXNwL2ludGVybmF0aW9uYWwvbXVsZS5lbCBiL2xpc3AvaW50ZXJuYXRpb25h bC9tdWxlLmVsCmluZGV4IGJhMzBmZWU0OTYuLmQxNjhlZTlhMTYgMTAwNjQ0Ci0tLSBhL2xp c3AvaW50ZXJuYXRpb25hbC9tdWxlLmVsCisrKyBiL2xpc3AvaW50ZXJuYXRpb25hbC9tdWxl LmVsCkBAIC0zMDYsMTAgKzMwNiw3IEBAIGxvYWQtd2l0aC1jb2RlLWNvbnZlcnNpb24KICAg ICAgIChhbmQgKG51bGwgbm9lcnJvcikKIAkgICAoc2lnbmFsICdmaWxlLWVycm9yIChsaXN0 ICJDYW5ub3Qgb3BlbiBsb2FkIGZpbGUiIGZpbGUpKSkKICAgICA7OyBSZWFkIGZpbGUgd2l0 aCBjb2RlIGNvbnZlcnNpb24sIGFuZCB0aGVuIGV2YWwuCi0gICAgKGxldCogKChidWZmZXIK LSAgICAgICAgICAgIDs7IFdlIGNhbid0IHVzZSBgZ2VuZXJhdGUtbmV3LWJ1ZmZlcicgYmVj YXVzZSBmaWxlcy5lbAotICAgICAgICAgICAgOzsgaXMgbm90IHlldCBsb2FkZWQuCi0gICAg ICAgICAgICAoZ2V0LWJ1ZmZlci1jcmVhdGUgKGdlbmVyYXRlLW5ldy1idWZmZXItbmFtZSAi ICpsb2FkKiIpKSkKKyAgICAobGV0KiAoKGJ1ZmZlciAoZ2VuZXJhdGUtbmV3LWJ1ZmZlciAi ICpsb2FkKiIpKQogCSAgIChsb2FkLWluLXByb2dyZXNzIHQpCiAJICAgKHNvdXJjZSAoc2F2 ZS1tYXRjaC1kYXRhIChzdHJpbmctbWF0Y2ggIlxcLmVsXFwnIiBmdWxsbmFtZSkpKSkKICAg ICAgICh1bmxlc3Mgbm9tZXNzYWdlCmRpZmYgLS1naXQgYS9saXNwL3N1YnIuZWwgYi9saXNw L3N1YnIuZWwKaW5kZXggZjY4ZjlkZDQxOS4uNWYyYzQzYzc4YiAxMDA2NDQKLS0tIGEvbGlz cC9zdWJyLmVsCisrKyBiL2xpc3Avc3Vici5lbApAQCAtMzUzMCw4ICszNTMwLDcgQEAgd2l0 aC10ZW1wLWZpbGUKICAgKGxldCAoKHRlbXAtZmlsZSAobWFrZS1zeW1ib2wgInRlbXAtZmls ZSIpKQogCSh0ZW1wLWJ1ZmZlciAobWFrZS1zeW1ib2wgInRlbXAtYnVmZmVyIikpKQogICAg IGAobGV0ICgoLHRlbXAtZmlsZSAsZmlsZSkKLQkgICAoLHRlbXAtYnVmZmVyCi0JICAgIChn ZXQtYnVmZmVyLWNyZWF0ZSAoZ2VuZXJhdGUtbmV3LWJ1ZmZlci1uYW1lICIgKnRlbXAgZmls ZSoiKSkpKQorCSAgICgsdGVtcC1idWZmZXIgKGdlbmVyYXRlLW5ldy1idWZmZXIgIiAqdGVt cCBmaWxlKiIgdCkpKQogICAgICAgICh1bndpbmQtcHJvdGVjdAogCSAgIChwcm9nMQogCSAg ICAgICAod2l0aC1jdXJyZW50LWJ1ZmZlciAsdGVtcC1idWZmZXIKQEAgLTM1NjksNyArMzU2 OCw3IEBAIHdpdGgtdGVtcC1idWZmZXIKIFNlZSBhbHNvIGB3aXRoLXRlbXAtZmlsZScgYW5k IGB3aXRoLW91dHB1dC10by1zdHJpbmcnLiIKICAgKGRlY2xhcmUgKGluZGVudCAwKSAoZGVi dWcgdCkpCiAgIChsZXQgKCh0ZW1wLWJ1ZmZlciAobWFrZS1zeW1ib2wgInRlbXAtYnVmZmVy IikpKQotICAgIGAobGV0ICgoLHRlbXAtYnVmZmVyIChnZW5lcmF0ZS1uZXctYnVmZmVyICIg KnRlbXAqIikpKQorICAgIGAobGV0ICgoLHRlbXAtYnVmZmVyIChnZW5lcmF0ZS1uZXctYnVm ZmVyICIgKnRlbXAqIiB0KSkpCiAgICAgICAgOzsgRklYTUU6IGtpbGwtYnVmZmVyIGNhbiBj aGFuZ2UgY3VycmVudC1idWZmZXIgaW4gc29tZSBvZGQgY2FzZXMuCiAgICAgICAgKHdpdGgt Y3VycmVudC1idWZmZXIgLHRlbXAtYnVmZmVyCiAgICAgICAgICAodW53aW5kLXByb3RlY3QK QEAgLTM2MDQsOCArMzYwMyw3IEBAIHdpdGgtc2lsZW50LW1vZGlmaWNhdGlvbnMKIChkZWZt YWNybyB3aXRoLW91dHB1dC10by1zdHJpbmcgKCZyZXN0IGJvZHkpCiAgICJFeGVjdXRlIEJP RFksIHJldHVybiB0aGUgdGV4dCBpdCBzZW50IHRvIGBzdGFuZGFyZC1vdXRwdXQnLCBhcyBh IHN0cmluZy4iCiAgIChkZWNsYXJlIChpbmRlbnQgMCkgKGRlYnVnIHQpKQotICBgKGxldCAo KHN0YW5kYXJkLW91dHB1dAotCSAgKGdldC1idWZmZXItY3JlYXRlIChnZW5lcmF0ZS1uZXct YnVmZmVyLW5hbWUgIiAqc3RyaW5nLW91dHB1dCoiKSkpKQorICBgKGxldCAoKHN0YW5kYXJk LW91dHB1dCAoZ2VuZXJhdGUtbmV3LWJ1ZmZlciAiICpzdHJpbmctb3V0cHV0KiIgdCkpKQog ICAgICAodW53aW5kLXByb3RlY3QKIAkgKHByb2duCiAJICAgKGxldCAoKHN0YW5kYXJkLW91 dHB1dCBzdGFuZGFyZC1vdXRwdXQpKQpkaWZmIC0tZ2l0IGEvc3JjL2J1ZmZlci5jIGIvc3Jj L2J1ZmZlci5jCmluZGV4IGFiNDc3NDgxOTEuLjNlMTM1MTQ4ZmIgMTAwNjQ0Ci0tLSBhL3Ny Yy9idWZmZXIuYworKysgYi9zcmMvYnVmZmVyLmMKQEAgLTUwMCwxOSArNTAwLDQzIEBAIGdl dF90cnVlbmFtZV9idWZmZXIgKHJlZ2lzdGVyIExpc3BfT2JqZWN0IGZpbGVuYW1lKQogICBy ZXR1cm4gUW5pbDsKIH0KIAotREVGVU4gKCJnZXQtYnVmZmVyLWNyZWF0ZSIsIEZnZXRfYnVm ZmVyX2NyZWF0ZSwgU2dldF9idWZmZXJfY3JlYXRlLCAxLCAxLCAwLAotICAgICAgIGRvYzog LyogUmV0dXJuIHRoZSBidWZmZXIgc3BlY2lmaWVkIGJ5IEJVRkZFUi1PUi1OQU1FLCBjcmVh dGluZyBhIG5ldyBvbmUgaWYgbmVlZGVkLgotSWYgQlVGRkVSLU9SLU5BTUUgaXMgYSBzdHJp bmcgYW5kIGEgbGl2ZSBidWZmZXIgd2l0aCB0aGF0IG5hbWUgZXhpc3RzLAotcmV0dXJuIHRo YXQgYnVmZmVyLiAgSWYgbm8gc3VjaCBidWZmZXIgZXhpc3RzLCBjcmVhdGUgYSBuZXcgYnVm ZmVyIHdpdGgKLXRoYXQgbmFtZSBhbmQgcmV0dXJuIGl0LiAgSWYgQlVGRkVSLU9SLU5BTUUg c3RhcnRzIHdpdGggYSBzcGFjZSwgdGhlIG5ldwotYnVmZmVyIGRvZXMgbm90IGtlZXAgdW5k byBpbmZvcm1hdGlvbi4KIAotSWYgQlVGRkVSLU9SLU5BTUUgaXMgYSBidWZmZXIgaW5zdGVh ZCBvZiBhIHN0cmluZywgcmV0dXJuIGl0IGFzIGdpdmVuLAotZXZlbiBpZiBpdCBpcyBkZWFk LiAgVGhlIHJldHVybiB2YWx1ZSBpcyBuZXZlciBuaWwuICAqLykKLSAgKHJlZ2lzdGVyIExp c3BfT2JqZWN0IGJ1ZmZlcl9vcl9uYW1lKQorLyoqCisgKiBydW5fYnVmZmVyX2xpc3RfdXBk YXRlX2hvb2s6CisgKgorICogUnVuIGFueSBmdW5jdGlvbnMgb24gJ2J1ZmZlci1saXN0LXVw ZGF0ZS1ob29rJy4gIERvIG5vdCBydW4gdGhlCisgKiBmdW5jdGlvbnMgd2hlbiBCVUZGRVIg aXMgYSBidWZmZXIgYW5kIGl0cyBpbmhpYml0X2J1ZmZlcl9ob29rcworICogc3RydWN0dXJl IGVsZW1lbnQgaXMgc2V0LiAgRG8gbm90IHJ1biBhbnkgZnVuY3Rpb25zIGVpdGhlciB3aGVu IHdlCisgKiBhcmUgbm90IGFsbG93ZWQgdG8gcnVuIGhvb2tzLgorICovCitzdGF0aWMgdm9p ZAorcnVuX2J1ZmZlcl9saXN0X3VwZGF0ZV9ob29rIChMaXNwX09iamVjdCBidWZmZXIpCiB7 Ci0gIHJlZ2lzdGVyIExpc3BfT2JqZWN0IGJ1ZmZlciwgbmFtZTsKLSAgcmVnaXN0ZXIgc3Ry dWN0IGJ1ZmZlciAqYjsKKyAgaWYgKCFOSUxQIChWcnVuX2hvb2tzKQorICAgICAgJiYgKCFC VUZGRVJQIChidWZmZXIpIHx8ICFYQlVGRkVSIChidWZmZXIpLT5pbmhpYml0X2J1ZmZlcl9o b29rcykpCisgICAgeworICAgICAgcHRyZGlmZl90IGNvdW50ID0gU1BFQ1BETF9JTkRFWCAo KTsKKworICAgICAgcmVjb3JkX3Vud2luZF9jdXJyZW50X2J1ZmZlciAoKTsKKyAgICAgIGNh bGwxIChWcnVuX2hvb2tzLCBRYnVmZmVyX2xpc3RfdXBkYXRlX2hvb2spOworICAgICAgdW5i aW5kX3RvIChjb3VudCwgUW5pbCk7CisgICAgfQorfQorCisvKioKKyAqIGdldF9idWZmZXJf Y3JlYXRlOgorICoKKyAqIFJldHVybiBidWZmZXIgc3BlY2lmaWVkIGJ5IEJVRkZFUi1PUi1O QU1FLCBjcmVhdGluZyBhIG5ldyBvbmUgaWYKKyAqIG5lZWRlZC4gIFNlZSBGZ2V0X2J1ZmZl cl9jcmVhdGUgYmVsb3cgZm9yIG1vcmUgaW5mb3JtYXRpb24uCisgKgorICogU2Vjb25kIGFy Z3VtZW50IElOSElCSVRfQlVGRkVSX0hPT0tTIHRydWUgbWVhbnMgdG8gbm90IHJ1bgorICog J2J1ZmZlci1saXN0LXVwZGF0ZS1ob29rJy4KKyAqLworc3RhdGljIExpc3BfT2JqZWN0Citn ZXRfYnVmZmVyX2NyZWF0ZSAoTGlzcF9PYmplY3QgYnVmZmVyX29yX25hbWUsIGJvb2wgaW5o aWJpdF9idWZmZXJfaG9va3MpCit7CisgIExpc3BfT2JqZWN0IGJ1ZmZlciwgbmFtZTsKKyAg c3RydWN0IGJ1ZmZlciAqYjsKIAogICBidWZmZXIgPSBGZ2V0X2J1ZmZlciAoYnVmZmVyX29y X25hbWUpOwogICBpZiAoIU5JTFAgKGJ1ZmZlcikpCkBAIC02MDAsMTQgKzYyNCwyOSBAQCBl dmVuIGlmIGl0IGlzIGRlYWQuICBUaGUgcmV0dXJuIHZhbHVlIGlzIG5ldmVyIG5pbC4gICov KQogICAvKiBQdXQgdGhpcyBpbiB0aGUgYWxpc3Qgb2YgYWxsIGxpdmUgYnVmZmVycy4gICov CiAgIFhTRVRCVUZGRVIgKGJ1ZmZlciwgYik7CiAgIFZidWZmZXJfYWxpc3QgPSBuY29uYzIg KFZidWZmZXJfYWxpc3QsIGxpc3QxIChGY29ucyAobmFtZSwgYnVmZmVyKSkpOwotICAvKiBB bmQgcnVuIGJ1ZmZlci1saXN0LXVwZGF0ZS1ob29rLiAgKi8KLSAgaWYgKCFOSUxQIChWcnVu X2hvb2tzKSAmJiAhYi0+aW5oaWJpdF9idWZmZXJfaG9va3MpCi0gICAgY2FsbDEgKFZydW5f aG9va3MsIFFidWZmZXJfbGlzdF91cGRhdGVfaG9vayk7CisgIGlmICghaW5oaWJpdF9idWZm ZXJfaG9va3MpCisgICAgLyogUnVuIGJ1ZmZlci1saXN0LXVwZGF0ZS1ob29rLiAgKi8KKyAg ICBydW5fYnVmZmVyX2xpc3RfdXBkYXRlX2hvb2sgKGJ1ZmZlcik7CiAKICAgcmV0dXJuIGJ1 ZmZlcjsKIH0KIAogCitERUZVTiAoImdldC1idWZmZXItY3JlYXRlIiwgRmdldF9idWZmZXJf Y3JlYXRlLCBTZ2V0X2J1ZmZlcl9jcmVhdGUsIDEsIDEsIDAsCisgICAgICAgZG9jOiAvKiBS ZXR1cm4gdGhlIGJ1ZmZlciBzcGVjaWZpZWQgYnkgQlVGRkVSLU9SLU5BTUUsIGNyZWF0aW5n IGEgbmV3IG9uZSBpZiBuZWVkZWQuCitJZiBCVUZGRVItT1ItTkFNRSBpcyBhIHN0cmluZyBh bmQgYSBsaXZlIGJ1ZmZlciB3aXRoIHRoYXQgbmFtZSBleGlzdHMsCityZXR1cm4gdGhhdCBi dWZmZXIuICBJZiBubyBzdWNoIGJ1ZmZlciBleGlzdHMsIGNyZWF0ZSBhIG5ldyBidWZmZXIg d2l0aAordGhhdCBuYW1lIGFuZCByZXR1cm4gaXQuICBJZiBCVUZGRVItT1ItTkFNRSBzdGFy dHMgd2l0aCBhIHNwYWNlLCB0aGUgbmV3CitidWZmZXIgZG9lcyBub3Qga2VlcCB1bmRvIGlu Zm9ybWF0aW9uLgorCitJZiBCVUZGRVItT1ItTkFNRSBpcyBhIGJ1ZmZlciBpbnN0ZWFkIG9m IGEgc3RyaW5nLCByZXR1cm4gaXQgYXMgZ2l2ZW4sCitldmVuIGlmIGl0IGlzIGRlYWQuICBU aGUgcmV0dXJuIHZhbHVlIGlzIG5ldmVyIG5pbC4gICovKQorICAgICAoTGlzcF9PYmplY3Qg YnVmZmVyX29yX25hbWUpCit7CisgIHJldHVybiBnZXRfYnVmZmVyX2NyZWF0ZSAoYnVmZmVy X29yX25hbWUsIGZhbHNlKTsKK30KKworCiAvKiBSZXR1cm4gYSBsaXN0IG9mIG92ZXJsYXlz IHdoaWNoIGlzIGEgY29weSBvZiB0aGUgb3ZlcmxheSBsaXN0CiAgICBMSVNULCBidXQgZm9y IGJ1ZmZlciBCLiAgKi8KIApAQCAtODcxLDggKzkxMCw3IEBAIENMT05FIG5pbCBtZWFucyB0 aGUgaW5kaXJlY3QgYnVmZmVyJ3Mgc3RhdGUgaXMgcmVzZXQgdG8gZGVmYXVsdCB2YWx1ZXMu ICAqLykKICAgICB9CiAKICAgLyogUnVuIGJ1ZmZlci1saXN0LXVwZGF0ZS1ob29rLiAgKi8K LSAgaWYgKCFOSUxQIChWcnVuX2hvb2tzKSkKLSAgICBjYWxsMSAoVnJ1bl9ob29rcywgUWJ1 ZmZlcl9saXN0X3VwZGF0ZV9ob29rKTsKKyAgcnVuX2J1ZmZlcl9saXN0X3VwZGF0ZV9ob29r IChRbmlsKTsKIAogICByZXR1cm4gYnVmOwogfQpAQCAtMTEzNSw2ICsxMTczLDMxIEBAIGlz IGZpcnN0IGFwcGVuZGVkIHRvIE5BTUUsIHRvIHNwZWVkIHVwIGZpbmRpbmcgYSBub24tZXhp c3RlbnQgYnVmZmVyLiAgKi8pCiAgICAgfQogfQogCitERUZVTiAoImdlbmVyYXRlLW5ldy1i dWZmZXIiLCBGZ2VuZXJhdGVfbmV3X2J1ZmZlciwgU2dlbmVyYXRlX25ld19idWZmZXIsCisg ICAgICAgMSwgMiwgMCwKKyAgICAgICBkb2M6IC8qIENyZWF0ZSBhbmQgcmV0dXJuIGEgYnVm ZmVyIHdpdGggYSBuYW1lIGJhc2VkIG9uIE5BTUUuCitDaG9vc2UgdGhlIGJ1ZmZlcidzIG5h bWUgdXNpbmcgYGdlbmVyYXRlLW5ldy1idWZmZXItbmFtZScuCisKK09wdGlvbmFsIHNlY29u ZCBhcmd1bWVudCBJTkhJQklULUJVRkZFUi1IT09LUyBub24tbmlsIG1lYW5zIHRvIG5vdCBy dW4KK2FueSBidWZmZXIgaG9va3MgKCdraWxsLWJ1ZmZlci1ob29rJywgJ2J1ZmZlci1saXN0 LXVwZGF0ZS1ob29rJyBvcgorJ2tpbGwtYnVmZmVyLXF1ZXJ5LWZ1bmN0aW9ucycpIGZvciB0 aGlzIGJ1ZmZlci4gIFRoaXMgYXJndW1lbnQgc2hvdWxkCitiZSBzZXQgb25seSBmb3IgaW50 ZXJuYWwgYnVmZmVycyB0aGF0IGFyZSBuZXZlciBwcmVzZW50ZWQgdG8gdXNlcnMgb3IKK3Bh c3NlZCBvbiB0byBvdGhlciBhcHBsaWNhdGlvbnMuICAqLykKKyAgKExpc3BfT2JqZWN0IG5h bWUsIExpc3BfT2JqZWN0IGluaGliaXRfYnVmZmVyX2hvb2tzKQoreworICBMaXNwX09iamVj dCBidWZmZXJfbmFtZSA9IEZnZW5lcmF0ZV9uZXdfYnVmZmVyX25hbWUgKG5hbWUsIFFuaWwp OworICBMaXNwX09iamVjdCBidWZmZXIgPSBnZXRfYnVmZmVyX2NyZWF0ZSAoYnVmZmVyX25h bWUsCisJCQkJCSAgIU5JTFAgKGluaGliaXRfYnVmZmVyX2hvb2tzKSk7CisKKyAgaWYgKCFO SUxQIChpbmhpYml0X2J1ZmZlcl9ob29rcykpCisgICAgeworICAgICBzdHJ1Y3QgYnVmZmVy ICpiID0gWEJVRkZFUiAoYnVmZmVyKTsKKworICAgICBiLT5pbmhpYml0X2J1ZmZlcl9ob29r cyA9IHRydWU7CisgICAgfQorCisgIHJldHVybiBidWZmZXI7Cit9CiAMCiBERUZVTiAoImJ1 ZmZlci1uYW1lIiwgRmJ1ZmZlcl9uYW1lLCBTYnVmZmVyX25hbWUsIDAsIDEsIDAsCiAgICAg ICAgZG9jOiAvKiBSZXR1cm4gdGhlIG5hbWUgb2YgQlVGRkVSLCBhcyBhIHN0cmluZy4KQEAg LTE0OTksOCArMTU2Miw3IEBAIFRoaXMgZG9lcyBub3QgY2hhbmdlIHRoZSBuYW1lIG9mIHRo ZSB2aXNpdGVkIGZpbGUgKGlmIGFueSkuICAqLykKICAgICBjYWxsMCAoaW50ZXJuICgicmVu YW1lLWF1dG8tc2F2ZS1maWxlIikpOwogCiAgIC8qIFJ1biBidWZmZXItbGlzdC11cGRhdGUt aG9vay4gICovCi0gIGlmICghTklMUCAoVnJ1bl9ob29rcykgJiYgIWN1cnJlbnRfYnVmZmVy LT5pbmhpYml0X2J1ZmZlcl9ob29rcykKLSAgICBjYWxsMSAoVnJ1bl9ob29rcywgUWJ1ZmZl cl9saXN0X3VwZGF0ZV9ob29rKTsKKyAgcnVuX2J1ZmZlcl9saXN0X3VwZGF0ZV9ob29rIChi dWYpOwogCiAgIC8qIFJlZmV0Y2ggc2luY2UgdGhhdCBsYXN0IGNhbGwgbWF5IGhhdmUgZG9u ZSBHQy4gICovCiAgIHJldHVybiBCVkFSIChjdXJyZW50X2J1ZmZlciwgbmFtZSk7CkBAIC0x Njc3LDYgKzE3MzksMTAgQEAgYnVmZmVyIGlzIGFjdHVhbGx5IGtpbGxlZC4gIFRoZSBidWZm ZXIgYmVpbmcga2lsbGVkIHdpbGwgYmUgY3VycmVudAogd2hpbGUgdGhlIGhvb2sgaXMgcnVu bmluZy4gIEZ1bmN0aW9ucyBjYWxsZWQgYnkgYW55IG9mIHRoZXNlIGhvb2tzIGFyZQogc3Vw cG9zZWQgdG8gbm90IGNoYW5nZSB0aGUgY3VycmVudCBidWZmZXIuCiAKK05laXRoZXIgJ2tp bGwtYnVmZmVyLXF1ZXJ5LWZ1bmN0aW9ucycgbm9yICdraWxsLWJ1ZmZlci1ob29rJyBhcmUg cnVuCitmb3IgYnVmZmVycyBjcmVhdGVkIGJ5ICdnZW5lcmF0ZS1uZXctYnVmZmVyJyB3aXRo IHRoZSBzZWNvbmQgYXJndW1lbnQKKydpbmhpYml0LWJ1ZmZlci1ob29rcycgbm9uLW5pbC4K KwogQW55IHByb2Nlc3NlcyB0aGF0IGhhdmUgdGhpcyBidWZmZXIgYXMgdGhlIGBwcm9jZXNz LWJ1ZmZlcicgYXJlIGtpbGxlZAogd2l0aCBTSUdIVVAuICBUaGlzIGZ1bmN0aW9uIGNhbGxz IGByZXBsYWNlLWJ1ZmZlci1pbi13aW5kb3dzJyBmb3IKIGNsZWFuaW5nIHVwIGFsbCB3aW5k b3dzIGN1cnJlbnRseSBkaXNwbGF5aW5nIHRoZSBidWZmZXIgdG8gYmUga2lsbGVkLiAqLykK QEAgLTE5MzgsOCArMjAwNCw3IEBAIGNsZWFuaW5nIHVwIGFsbCB3aW5kb3dzIGN1cnJlbnRs eSBkaXNwbGF5aW5nIHRoZSBidWZmZXIgdG8gYmUga2lsbGVkLiAqLykKICAgYnNldF91bmRv X2xpc3QgKGIsIFFuaWwpOwogCiAgIC8qIFJ1biBidWZmZXItbGlzdC11cGRhdGUtaG9vay4g ICovCi0gIGlmICghTklMUCAoVnJ1bl9ob29rcykgJiYgIWItPmluaGliaXRfYnVmZmVyX2hv b2tzKQotICAgIGNhbGwxIChWcnVuX2hvb2tzLCBRYnVmZmVyX2xpc3RfdXBkYXRlX2hvb2sp OworICBydW5fYnVmZmVyX2xpc3RfdXBkYXRlX2hvb2sgKGJ1ZmZlcik7CiAKICAgcmV0dXJu IFF0OwogfQpAQCAtMTk4MCw4ICsyMDQ1LDcgQEAgcmVjb3JkX2J1ZmZlciAoTGlzcF9PYmpl Y3QgYnVmZmVyKQogICBmc2V0X2J1cmllZF9idWZmZXJfbGlzdCAoZiwgRmRlbHEgKGJ1ZmZl ciwgZi0+YnVyaWVkX2J1ZmZlcl9saXN0KSk7CiAKICAgLyogUnVuIGJ1ZmZlci1saXN0LXVw ZGF0ZS1ob29rLiAgKi8KLSAgaWYgKCFOSUxQIChWcnVuX2hvb2tzKSAmJiAhWEJVRkZFUiAo YnVmZmVyKS0+aW5oaWJpdF9idWZmZXJfaG9va3MpCi0gICAgY2FsbDEgKFZydW5faG9va3Ms IFFidWZmZXJfbGlzdF91cGRhdGVfaG9vayk7CisgIHJ1bl9idWZmZXJfbGlzdF91cGRhdGVf aG9vayAoYnVmZmVyKTsKIH0KIAogCkBAIC0yMDE5LDggKzIwODMsNyBAQCBERUZVTiAoImJ1 cnktYnVmZmVyLWludGVybmFsIiwgRmJ1cnlfYnVmZmVyX2ludGVybmFsLCBTYnVyeV9idWZm ZXJfaW50ZXJuYWwsCiAgICAgKGYsIEZjb25zIChidWZmZXIsIEZkZWxxIChidWZmZXIsIGYt PmJ1cmllZF9idWZmZXJfbGlzdCkpKTsKIAogICAvKiBSdW4gYnVmZmVyLWxpc3QtdXBkYXRl LWhvb2suICAqLwotICBpZiAoIU5JTFAgKFZydW5faG9va3MpICYmICFYQlVGRkVSIChidWZm ZXIpLT5pbmhpYml0X2J1ZmZlcl9ob29rcykKLSAgICBjYWxsMSAoVnJ1bl9ob29rcywgUWJ1 ZmZlcl9saXN0X3VwZGF0ZV9ob29rKTsKKyAgcnVuX2J1ZmZlcl9saXN0X3VwZGF0ZV9ob29r IChidWZmZXIpOwogCiAgIHJldHVybiBRbmlsOwogfQpAQCAtNjI1NSw3ICs2MzE4LDEwIEBA IFVzZSBDdXN0b20gdG8gc2V0IHRoaXMgdmFyaWFibGUgYW5kIHVwZGF0ZSB0aGUgZGlzcGxh eS4gICovKTsKIFRoZSBidWZmZXIgYmVpbmcga2lsbGVkIHdpbGwgYmUgY3VycmVudCB3aGls ZSB0aGUgZnVuY3Rpb25zIGFyZSBydW5uaW5nLgogCiBJZiBhbnkgb2YgdGhlbSByZXR1cm5z IG5pbCwgdGhlIGJ1ZmZlciBpcyBub3Qga2lsbGVkLiAgRnVuY3Rpb25zIHJ1biBieQotdGhp cyBob29rIGFyZSBzdXBwb3NlZCB0byBub3QgY2hhbmdlIHRoZSBjdXJyZW50IGJ1ZmZlci4g ICovKTsKK3RoaXMgaG9vayBhcmUgc3VwcG9zZWQgdG8gbm90IGNoYW5nZSB0aGUgY3VycmVu dCBidWZmZXIuCisKK1RoaXMgaG9vayBpcyBub3QgcnVuIGZvciBidWZmZXJzIGNyZWF0ZWQg YnkgJ2dlbmVyYXRlLW5ldy1idWZmZXInIHdpdGgKK3RoZSBzZWNvbmQgYXJndW1lbnQgJ2lu aGliaXQtYnVmZmVyLWhvb2tzJyBub24tbmlsLiAgKi8pOwogICBWa2lsbF9idWZmZXJfcXVl cnlfZnVuY3Rpb25zID0gUW5pbDsKIAogICBERUZWQVJfTElTUCAoImNoYW5nZS1tYWpvci1t b2RlLWhvb2siLCBWY2hhbmdlX21ham9yX21vZGVfaG9vaywKQEAgLTYyNjgsOSArNjMzNCw5 IEBAIFRoZSBmdW5jdGlvbiBga2lsbC1hbGwtbG9jYWwtdmFyaWFibGVzJyBydW5zIHRoaXMg YmVmb3JlIGRvaW5nIGFueXRoaW5nIGVsc2UuICAqCiAJICAgICAgIGRvYzogLyogSG9vayBy dW4gd2hlbiB0aGUgYnVmZmVyIGxpc3QgY2hhbmdlcy4KIEZ1bmN0aW9ucyAoaW1wbGljaXRs eSkgcnVubmluZyB0aGlzIGhvb2sgYXJlIGBnZXQtYnVmZmVyLWNyZWF0ZScsCiBgbWFrZS1p bmRpcmVjdC1idWZmZXInLCBgcmVuYW1lLWJ1ZmZlcicsIGBraWxsLWJ1ZmZlcicsIGBidXJ5 LWJ1ZmZlcicKLWFuZCBgc2VsZWN0LXdpbmRvdycuICBGdW5jdGlvbnMgcnVuIGJ5IHRoaXMg aG9vayBzaG91bGQgYXZvaWQgY2FsbGluZwotYHNlbGVjdC13aW5kb3cnIHdpdGggYSBuaWwg Tk9SRUNPUkQgYXJndW1lbnQgb3IgYHdpdGgtdGVtcC1idWZmZXInCi1zaW5jZSBlaXRoZXIg bWF5IGxlYWQgdG8gaW5maW5pdGUgcmVjdXJzaW9uLiAgKi8pOworYW5kIGBzZWxlY3Qtd2lu ZG93Jy4gIFRoaXMgaG9vayBpcyBub3QgcnVuIGZvciBidWZmZXJzIGNyZWF0ZWQgYnkKKydn ZW5lcmF0ZS1uZXctYnVmZmVyJyB3aXRoIHRoZSBzZWNvbmQgYXJndW1lbnQgJ2luaGliaXQt YnVmZmVyLWhvb2tzJworbm9uLW5pbC4gICovKTsKICAgVmJ1ZmZlcl9saXN0X3VwZGF0ZV9o b29rID0gUW5pbDsKICAgREVGU1lNIChRYnVmZmVyX2xpc3RfdXBkYXRlX2hvb2ssICJidWZm ZXItbGlzdC11cGRhdGUtaG9vayIpOwogCkBAIC02MjgxLDYgKzYzNDcsNyBAQCBzaW5jZSBl aXRoZXIgbWF5IGxlYWQgdG8gaW5maW5pdGUgcmVjdXJzaW9uLiAgKi8pOwogICBkZWZzdWJy ICgmU2dldF9idWZmZXJfY3JlYXRlKTsKICAgZGVmc3ViciAoJlNtYWtlX2luZGlyZWN0X2J1 ZmZlcik7CiAgIGRlZnN1YnIgKCZTZ2VuZXJhdGVfbmV3X2J1ZmZlcl9uYW1lKTsKKyAgZGVm c3ViciAoJlNnZW5lcmF0ZV9uZXdfYnVmZmVyKTsKICAgZGVmc3ViciAoJlNidWZmZXJfbmFt ZSk7CiAgIGRlZnN1YnIgKCZTYnVmZmVyX2ZpbGVfbmFtZSk7CiAgIGRlZnN1YnIgKCZTYnVm ZmVyX2Jhc2VfYnVmZmVyKTsKCg== --------------EDB650DEBF03E33053E68131-- From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 26 07:26:59 2019 Received: (at 34765) by debbugs.gnu.org; 26 Apr 2019 11:26:59 +0000 Received: from localhost ([127.0.0.1]:60204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJz0L-0005TO-8d for submit@debbugs.gnu.org; Fri, 26 Apr 2019 07:26:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJz0J-0005TB-1O for 34765@debbugs.gnu.org; Fri, 26 Apr 2019 07:26:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47743) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJz0D-0000a7-HK; Fri, 26 Apr 2019 07:26:49 -0400 Received: from [176.228.60.248] (port=2711 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hJz0C-0006nJ-SC; Fri, 26 Apr 2019 07:26:49 -0400 Date: Fri, 26 Apr 2019 14:26:31 +0300 Message-Id: <83y33xvwgo.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> (message from martin rudalics on Fri, 26 Apr 2019 13:00:06 +0200) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: monnier@IRO.UMontreal.CA, 34765@debbugs.gnu.org, alexanderm@web.de > From: martin rudalics > Date: Fri, 26 Apr 2019 13:00:06 +0200 > > > I attach a preliminary patch. Thanks. This will need documentation changes when pushed. > +/** > + * run_buffer_list_update_hook: > + * > + * Run any functions on 'buffer-list-update-hook'. Do not run the > + * functions when BUFFER is a buffer and its inhibit_buffer_hooks > + * structure element is set. Do not run any functions either when we > + * are not allowed to run hooks. > + */ Can we please use our style in commentary? We don't use bock comments in Emacs, so I'd like not to proliferate them. > + if (!inhibit_buffer_hooks) > + /* Run buffer-list-update-hook. */ > + run_buffer_list_update_hook (buffer); It is somewhat strange that part of the reasons for not running hooks are tested inside run_buffer_list_update_hook, and others explicitly here. Any special reasons for this inconsistency? > +DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0, > + doc: /* Return the buffer specified by BUFFER-OR-NAME, creating a new one if needed. > +If BUFFER-OR-NAME is a string and a live buffer with that name exists, > +return that buffer. If no such buffer exists, create a new buffer with > +that name and return it. If BUFFER-OR-NAME starts with a space, the new > +buffer does not keep undo information. > + > +If BUFFER-OR-NAME is a buffer instead of a string, return it as given, > +even if it is dead. The return value is never nil. */) > + (Lisp_Object buffer_or_name) > +{ > + return get_buffer_create (buffer_or_name, false); > +} Should this function also acquire an additional optional argument? If not, why not? > +Optional second argument INHIBIT-BUFFER-HOOKS non-nil means to not run > +any buffer hooks ('kill-buffer-hook', 'buffer-list-update-hook' or > +'kill-buffer-query-functions') for this buffer. This argument should The hooks should be quoted `like this', right? We do want them to become hyperlinks. > +be set only for internal buffers that are never presented to users or > +passed on to other applications. */) > + (Lisp_Object name, Lisp_Object inhibit_buffer_hooks) > +{ > + Lisp_Object buffer_name = Fgenerate_new_buffer_name (name, Qnil); > + Lisp_Object buffer = get_buffer_create (buffer_name, > + !NILP (inhibit_buffer_hooks)); > + > + if (!NILP (inhibit_buffer_hooks)) > + { > + struct buffer *b = XBUFFER (buffer); > + > + b->inhibit_buffer_hooks = true; > + } Should this flag be set inside get_buffer_create? > +Neither 'kill-buffer-query-functions' nor 'kill-buffer-hook' are run > +for buffers created by 'generate-new-buffer' with the second argument > +'inhibit-buffer-hooks' non-nil. Quoting again. > @@ -6268,9 +6334,9 @@ The function `kill-all-local-variables' runs this before doing anything else. * > doc: /* Hook run when the buffer list changes. > Functions (implicitly) running this hook are `get-buffer-create', > `make-indirect-buffer', `rename-buffer', `kill-buffer', `bury-buffer' > -and `select-window'. Functions run by this hook should avoid calling > -`select-window' with a nil NORECORD argument or `with-temp-buffer' > -since either may lead to infinite recursion. */); > +and `select-window'. This hook is not run for buffers created by > +'generate-new-buffer' with the second argument 'inhibit-buffer-hooks' > +non-nil. */); And here. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 26 13:14:18 2019 Received: (at 34765) by debbugs.gnu.org; 26 Apr 2019 17:14:18 +0000 Received: from localhost ([127.0.0.1]:33459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hK4QU-0003e7-5q for submit@debbugs.gnu.org; Fri, 26 Apr 2019 13:14:18 -0400 Received: from mail-ed1-f42.google.com ([209.85.208.42]:41484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hK4QR-0003ds-D7 for 34765@debbugs.gnu.org; Fri, 26 Apr 2019 13:14:16 -0400 Received: by mail-ed1-f42.google.com with SMTP id m4so3767627edd.8 for <34765@debbugs.gnu.org>; Fri, 26 Apr 2019 10:14:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=xK6xV6POq23J/6jssv5z1AQP1KjjgdCJatv7dUiu4TQ=; b=SrDc5tZvQ2AthDA9r0o5CaLmjj6hzvD6Tx3aoU9ZqTJt2hRM5VsSRZ0RfcihkYLZ2X nwi6SBuTWw7o6NHOZ+GHpfuw+nldvzCXeZEMqZz4AZpUfxi5vUgNPg2mTEKbyDGyned2 BgHYf8Nw+h8UzXSDyx0WCMw2kqJV21rVDoJLCeqAT1lsgDuuT4Xlj6jspKmjAkOjqfS3 cLhkdXf7BSlg+ZiNOqKiZw7c8/sYHOCZfINuBdFWJuvEvhmhRyuuwUf5GsHpZAghaCh2 0kDnrJFL44PjC4YeVghHr2HSALJ3/xvbIMuhkfg3zSuMFbdGqCHVf++0zJb7W4jBAtfa a8TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=xK6xV6POq23J/6jssv5z1AQP1KjjgdCJatv7dUiu4TQ=; b=Hm0TRTmUErXE7RfwnoLfNQAdaVLup5lw81+Ht87KKxkzK38NpAueYeKI6kF9KguEFc EDtqIIqqE8Ycz6GB79fBXVLudPgAytgJRZDIH6imZi5HXrE26eRXPdiTdC4kOa8qj0ir /gbGvMgM2OJOfbxspQQN0siTnqGnH9k4ehAIkl8+SUA1BS4jnoiTEEGeQP+rlDV+GvJa InblQyHa3keVi81qeRUTorExON4mn4GNNd51lihcuA2VOO6gm3CiWp3YoYcu/i76h/4T Oy6T/iU+UFEvyZI92gfrtkfMwPPDSBcYg9+uiG0kgbVtzTvszc4dxe8e6pUHP/Mq6XGm 9I/Q== X-Gm-Message-State: APjAAAUFoyiNeEDp+MWGuGmBT68sTwctIAPwQYX08bsaLSIM/thuQ+uG pjqOtXKxxpLlGbWsV/nVfAQIoQ== X-Google-Smtp-Source: APXvYqyaYdCNlcYBMXBTLL4q5Qg6WFbDNxW0UHZpDqAMbnVwUa0O4JAFV3z7xBnCQKV4gE/levxreg== X-Received: by 2002:a50:95e8:: with SMTP id x37mr28079387eda.215.1556298849598; Fri, 26 Apr 2019 10:14:09 -0700 (PDT) Received: from localhost ([2a02:8084:20e2:c380:8cad:ae29:555d:852d]) by smtp.gmail.com with ESMTPSA id v7sm3054631eja.87.2019.04.26.10.14.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Apr 2019 10:14:07 -0700 (PDT) From: "Basil L. Contovounesios" To: martin rudalics Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> Date: Fri, 26 Apr 2019 18:14:06 +0100 In-Reply-To: <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> (martin rudalics's message of "Fri, 26 Apr 2019 13:00:06 +0200") Message-ID: <87lfzwg04h.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Eli Zaretskii , monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.2 (-) --=-=-= Content-Type: text/plain martin rudalics writes: > I attach a preliminary patch. Your patch allows the following additional change, right? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=coding.diff diff --git a/src/coding.c b/src/coding.c index 2c6b2c4d05..3dd5f3b1c1 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7820,9 +7820,7 @@ code_conversion_save (bool with_work_buf, bool multibyte) { if (reused_workbuf_in_use) { - Lisp_Object name - = Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name, Qnil); - workbuf = Fget_buffer_create (name); + workbuf = Fgenerate_new_buffer (Vcode_conversion_workbuf_name, Qt); } else { --=-=-= Content-Type: text/plain Thanks, -- Basil --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 27 04:30:59 2019 Received: (at 34765) by debbugs.gnu.org; 27 Apr 2019 08:30:59 +0000 Received: from localhost ([127.0.0.1]:34256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKIja-0007s0-Ir for submit@debbugs.gnu.org; Sat, 27 Apr 2019 04:30:58 -0400 Received: from mout.gmx.net ([212.227.15.19]:39061) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKIjY-0007rm-SY for 34765@debbugs.gnu.org; Sat, 27 Apr 2019 04:30:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1556353844; bh=siEujE87TkvhrVkuAAktaj3wp/UFWJK4nvd2PcJf3hU=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=SvntCEE0t1dXL5QH7WBBmNb47Os5JR2oauYOaSg21yke8ZMY/uUASCMR1voQUC46G PItv9UziEY1aCOlauJOhZt0BgCQNDfTVjfMKGC+FvJQLNSvy/HDRg3OB8/ThW9dPdB X6P4FMR5RXUpcLQ+vpOvKXShVcSZtNW2w1/3jJqM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.70]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MfmWy-1h63f61sxw-00N8om; Sat, 27 Apr 2019 10:30:44 +0200 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: Eli Zaretskii References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <83y33xvwgo.fsf@gnu.org> From: martin rudalics Message-ID: Date: Sat, 27 Apr 2019 10:30:43 +0200 MIME-Version: 1.0 In-Reply-To: <83y33xvwgo.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:edxr+r83PP6mWOHSHK1uO1qDv4mtXkrPUL4voxVbioALNfnzTKC 71GmSUAMJkTW+Sg6vATK411Alvd3bujkhlC0ew2jKpF2EuJwht/So+C7hbnSBRWzPH40DSQ 9RHEX884ndht9O5UcjsVpxEX4TlEQOb1/5vF0OnTx/hxiQhtQz9cH6gsaboWsVHmBXE93mL 3OCWjk4PExNwCK5asWjKA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:q8RJZ39l5is=:FPVw2a0dApPk1R8jke5pxZ GZaPtdY/QQfvuam3vg0qRENc+owyvl2ix5cYQGG1003jLjPz+EDWqTLQLhLT0AcZqf+vkGw8Z nhmH6EAZYzJY7Kc2jWWMWMeYr9y2/pFAikrGbdrIASY/WIwhqovDvCXs1p3ui+FRASscmG4Jg JGi3bMphHSw6A8L4ysbrJXlVkSGd9eWcCtDQvuF5jdNTV5T8jWHjD+0lqRzUzpxkZUs6Yhx/s fi7g8FY+UfX1UZ2Xc99BOVZatjHfof7Kt0TzY39Q6e+gpg3g0uArSw1uu31ToDl2Q3A+3oXaF OVc63nMe7ruyfBlrYj+dqETmro1aRXS7+ihK4P+vKhkXZXsbZPUSF/Fe+Gwl0DiJHcTORkvI7 CQfpVATZ7YU8l20JYPFGYWqj5+e71p7Je6Njsk6J0pWMoQaxBildtxcJpZhoTCw7yJauwHKMI FANt1+VgeIEphf+IVCT6osq0i3HNEUA2eCLJRMDDT85GMzgxKjqigsMR7GQmXXVRL3ujuYQM4 4ewFd5+kE4eXtECWR9hrIkZ5w3GHvKBi2GY3POuCq3lh3jxXQnlA3ctxLbww/G6PgTze5luoq Wxvb9De6luqg0zVtUs/zC+HiAz1UzJEEddNLv2twAu5g8Pt64ofbUVSB9kUGlyUDia1SvMOVJ rBMPFOGGTVcBhiAN3fWY52AiaAWmrgGa9itdig59OavQycGjQ3NjpSUoaqNPsLzaZM1/goP1D mpOo1oj+ZMD/AwNznP9dsqM5CirwYVXZV+OGiCGJyB+be6iddQS76sgkkimonRWVrrn8FYhGu DJOjTmeT7huMl6qVwwxU/5GEc90Fh3kvr/KLxpwJ/z4bwQpHohHGFLmkz2k9jtU//+pXxHFgt jSFfXz99TorBAAVR50c6P779RoRVymRRIdZJ4JhBirqZW2dQJlMEvj1ncz6YpeEeus0f9rcmU rI3Uvm8fxIg== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Can we please use our style in commentary? We don't use bock comments > in Emacs, so I'd like not to proliferate them. Actually it's not a comment but a doc-string and if you customize 'font-lock-doc-face' you will notice. These were part of a project of mine to improve handling and readability of Emacs primitives' doc-strings (including font locking, Lisp syntax with completion and eldoc support, correct filling, exporting/importing from C to Lisp to texinfo and the like). But since I never managed to write some of these components, the project has stalled. I'll stop proliferating that style now. >> + if (!inhibit_buffer_hooks) >> + /* Run buffer-list-update-hook. */ >> + run_buffer_list_update_hook (buffer); > > It is somewhat strange that part of the reasons for not running hooks > are tested inside run_buffer_list_update_hook, and others explicitly > here. Any special reasons for this inconsistency? See below. >> +DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0, >> + doc: /* Return the buffer specified by BUFFER-OR-NAME, creating a new one if needed. >> +If BUFFER-OR-NAME is a string and a live buffer with that name exists, >> +return that buffer. If no such buffer exists, create a new buffer with >> +that name and return it. If BUFFER-OR-NAME starts with a space, the new >> +buffer does not keep undo information. >> + >> +If BUFFER-OR-NAME is a buffer instead of a string, return it as given, >> +even if it is dead. The return value is never nil. */) >> + (Lisp_Object buffer_or_name) >> +{ >> + return get_buffer_create (buffer_or_name, false); >> +} > > Should this function also acquire an additional optional argument? If > not, why not? You mean 'get-buffer-create'? I had that in a first version. But since you earlier expressed concerns about people abusing the extra argument of 'generate-new-buffer' I thought 'get-buffer-create' would be even more critical in this regard. In either case I'll do what you (or others) consider best. >> +Optional second argument INHIBIT-BUFFER-HOOKS non-nil means to not run >> +any buffer hooks ('kill-buffer-hook', 'buffer-list-update-hook' or >> +'kill-buffer-query-functions') for this buffer. This argument should > > The hooks should be quoted `like this', right? We do want them to > become hyperlinks. Right. >> +be set only for internal buffers that are never presented to users or >> +passed on to other applications. */) >> + (Lisp_Object name, Lisp_Object inhibit_buffer_hooks) >> +{ >> + Lisp_Object buffer_name = Fgenerate_new_buffer_name (name, Qnil); >> + Lisp_Object buffer = get_buffer_create (buffer_name, >> + !NILP (inhibit_buffer_hooks)); >> + >> + if (!NILP (inhibit_buffer_hooks)) >> + { >> + struct buffer *b = XBUFFER (buffer); >> + >> + b->inhibit_buffer_hooks = true; >> + } > > Should this flag be set inside get_buffer_create? If we do that, it would also resolve the "inconsistency" you bemoan above. So the answer is probably yes. > Quoting again. [...] > And here. Right. At least I show signs of consistency when adopting silly style. Thanks, martin From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 27 04:31:28 2019 Received: (at 34765) by debbugs.gnu.org; 27 Apr 2019 08:31:28 +0000 Received: from localhost ([127.0.0.1]:34261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKIk4-0007tE-1R for submit@debbugs.gnu.org; Sat, 27 Apr 2019 04:31:28 -0400 Received: from mout.gmx.net ([212.227.15.15]:59617) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKIk1-0007t0-T3 for 34765@debbugs.gnu.org; Sat, 27 Apr 2019 04:31:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1556353875; bh=2IDB+M7sd0dhLNQVsRgjOCC5bR5AORphr7cdbJYlT8A=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=GBCl+rbOg+EFKuur7KLw/9NuwV2re/TmcuV3HnaL5etqAR+wMUK+3ofDLjOaxwd6j H3ax+8b2LedZk0cO31SFr61GUXmT7bOi9wMvMOOuxs+qU0bUWN1205YKfO6cbOvtLL ZoFtnknXEHPL9ytP3MxWcg/CMJEApc9SOfGydfko= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.70]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MaIPo-1h4ymR16LY-00JoDc; Sat, 27 Apr 2019 10:31:15 +0200 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: "Basil L. Contovounesios" References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87lfzwg04h.fsf@tcd.ie> From: martin rudalics Message-ID: Date: Sat, 27 Apr 2019 10:31:15 +0200 MIME-Version: 1.0 In-Reply-To: <87lfzwg04h.fsf@tcd.ie> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:DR7I/Zw0DsRmxyOwM6cKjzVujtWsImXbJ+F4r720sQulAfmo35v oGCWZdn8cBmsX1GLm2IenkwZNJKaq14F42JcEkI4wpFaDuXN9k3WCfWKyUdZvF5HefHrDyx aojSuZXIEsiHm+NJYE/wIrp6kHg5tkKa37NBjIOt/cct+yvDwdq6yd7hrG3J2FUqpa19DH6 1RU5CWtdMLuP/nHcFyeSw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Up3Llbs4Y8s=:GWWp9/NG2HApty3OYDTHR/ 9vmqgBruKkPYyAPIhrK6on0hXY7rP5yGdSKKUqexPwnYiFaWxs0wsrMM7wgm9ZbJMeVVtGW8C k2s7oZ8ViNKihf2T2YgZEogJKlPbbGhfh8GbtY+GPgr9wOZoYh4/qy+PJjN3WAb7BKiF21hf6 UzJB/eWNJCMITSSUIYzZHS9ZTIS5UE4YyUhlpwOfly9l6bLV0Cn+nuxyhjBaJ2Wj0bzl5dpAW SkviQSuXSUz7QOcB+6TqxpQA3DtY7eXxHPOYwlWNjaR2wkss0csNDlu4COz0z7ilig1a/ok0M V8dQ4RqZBJsiytE+8IvGGCWP3Qn8vR/nrCTw7kjtLPTsGXtjPP9RpkwCY1Gpta3xDEcOgj3SX KP/OLlIFm37vxTUeAalrum0Cbi6qIIk6OGtOVMnglGKyJlqVXxBm8ZtTnr+38NeSIiyO0SXwS cYk3ntMvmBP0Whl3/fxSuSLQpptwmj8C5lHB6nV78TDtD3K5CdQiD7FatXSrwM7LxhUjKFSGX wzmw882e3PXBSgfLiuisXmA8VT7jMprzG/O1HVoH+9vF2GUCmqmD5sv/d4mJLZUdnJO0WO6Py 2sg7CvdeE17OW8DNZmtfn9OuUF8TFSTotftz+ii9+PJW1dVtsNlzFM+IXnDkC8u+6vpYP7Hvw w4otmoD9FZjCGWuAWhp203cDMGDy3VEej+oxj7k9uSaPq5oIi3kV0Ma319re/veqKrS8b7ffk vSBFnb0Dmx7lzpESEqU/Vc7gboZKeiwvAFVKqx8aJdVaJ4QRU9j+cfpa5XMymL/Yhh9azdPsS XIhUJLwG0igNanbv3zeIflCCaPcxTTFGsSvicQkDBYlPXHLLE6Mtv+7TS4nLOyDxWQYuCYnHt 9BHx/5a8lrXQiEBZCzk/aynyaOeGZ+3yxRUcV+wXEhldGOZ1C0loXP7lmeJLCvjzCXZ0N/GUv O5mzruDC5Ow== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Eli Zaretskii , monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Your patch allows the following additional change, right? I suppose so. I'm not sure about the Fget_buffer_create in the else branch of that if, though. It would be nice to get rid of the entire b->inhibit_buffer_hooks = (STRINGP (Vcode_conversion_workbuf_name) && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name), SBYTES (Vcode_conversion_workbuf_name)) == 0); form in 'get-buffer-create'. Any ideas? Thanks, martin From debbugs-submit-bounces@debbugs.gnu.org Mon May 20 09:42:29 2019 Received: (at 34765) by debbugs.gnu.org; 20 May 2019 13:42:29 +0000 Received: from localhost ([127.0.0.1]:36180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSiYe-0006mw-Qj for submit@debbugs.gnu.org; Mon, 20 May 2019 09:42:29 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:40282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSiYc-0006mi-LI for 34765@debbugs.gnu.org; Mon, 20 May 2019 09:42:27 -0400 Received: by mail-ed1-f66.google.com with SMTP id j12so23950226eds.7 for <34765@debbugs.gnu.org>; Mon, 20 May 2019 06:42:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=RyPO5LJaEmYkjeeOi2vw0wD3aSPYbXJHD35flaMQe7c=; b=T695/FBZt0krRhSVbvTzvGEWx7rk17tgtcH8tvJHduLmADixCs9Iw2l/YD6SLljSXq +bdj4cvJeMzjcAdAMuuWJM8cxZ0hA5tk3Sl0q1Jt2qAaqdyzkym8DdtMwghfc0h00mVc efbfo3D8xxucwW60wzXEpJ0niM/SIuNPeS2OnJjYWdeuYOgy3yL38TTfEXdyJ/46vUuQ +G5yp2Ppp0ihSEdUHPIWT2nRdLMHpngvKsLx81xGranMVRuRPGg+xxQzTaae0Kk3j8LS bp0H6qZ8NMc+HKxTshmzcwslAGWm9DdmGpdcc+Ik7W0DuKrdaIfzazn5O+q3PP9gB8iu S92g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=RyPO5LJaEmYkjeeOi2vw0wD3aSPYbXJHD35flaMQe7c=; b=Ca4TVI4eLGegSjXusU6ayTRCYNdhb8X3Ty1Q9GooZSyEuYzPu3VPnOL6j5mSqAQhGk zmgfypQTQhrhP+XNc0xBQbfsFQe5AwMt54kiyqSsQWKIV/BnYTA28gOplFvMKdlrYFqe JnT6+3fuHSHbgczdPQVWw3eK6kWc59saJtOfO/n7in+uT5WEGNszQ/MXfPnvIVGpnc1j cMUjGAKpwqmauNYbMNyIotFbDhBW9w04r4e3u/R7CF52DSXUlCLtvmQ47lmw7d9+h3BK 6o+TmuqWcC8ZN5LpxRx9B/xc85BnehVoJSVcp02WLhYWgR6aatXggy51l2oWbXyOB1w6 k9eg== X-Gm-Message-State: APjAAAVCI1TPeZN0LPPhjzOIny5T6zgwfQaFZnNw9KgLIN9KoY7P7OHH Vc/9JwcmvcYfmdXbPQicPPjr8A== X-Google-Smtp-Source: APXvYqzgYYGu1OtcvaXf6GwqNqQbZazHzDw4UyYHFpevgAcl2Stc+wqiIpxac5ULo3HhSto+2YBLXw== X-Received: by 2002:a17:907:20cd:: with SMTP id qq13mr33685857ejb.170.1558359740531; Mon, 20 May 2019 06:42:20 -0700 (PDT) Received: from localhost ([2a02:8084:20e2:c380:6fa:38d6:1fce:ddb3]) by smtp.gmail.com with ESMTPSA id c26sm5672086ede.32.2019.05.20.06.42.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 20 May 2019 06:42:19 -0700 (PDT) From: "Basil L. Contovounesios" To: martin rudalics Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87lfzwg04h.fsf@tcd.ie> Date: Mon, 20 May 2019 14:42:13 +0100 In-Reply-To: (martin rudalics's message of "Sat, 27 Apr 2019 10:31:15 +0200") Message-ID: <87ftp9jl8q.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Eli Zaretskii , monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) martin rudalics writes: >> Your patch allows the following additional change, right? > > I suppose so. I'm not sure about the Fget_buffer_create in the else > branch of that if, though. WDYM? > It would be nice to get rid of the entire > > b->inhibit_buffer_hooks > = (STRINGP (Vcode_conversion_workbuf_name) > && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name), > SBYTES (Vcode_conversion_workbuf_name)) == 0); > > form in 'get-buffer-create'. Any ideas? Doesn't your patch in https://debbugs.gnu.org/34765#86 already eliminate the need for it? Thanks, -- Basil From debbugs-submit-bounces@debbugs.gnu.org Tue May 21 03:32:44 2019 Received: (at 34765) by debbugs.gnu.org; 21 May 2019 07:32:44 +0000 Received: from localhost ([127.0.0.1]:38502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSzGN-0002NE-Pc for submit@debbugs.gnu.org; Tue, 21 May 2019 03:32:44 -0400 Received: from mout.gmx.net ([212.227.15.19]:49569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSzGL-0002Mz-Bc for 34765@debbugs.gnu.org; Tue, 21 May 2019 03:32:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1558423949; bh=ip0Umv20qHj/TegfREMM8z1pDU/QIcvM5E4Ksjj+K80=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=k1+3vfxXQwS4EOcIOxbsRWxQ+dh9UWVXMXJWYhv5DlUR+kd4lvQbqmRQQ4GBjL0bd E+pd9YodbIEqBi3hFkqutMstKLK0cLsUtKnh3/3gULE4+xSe1tWgcgSzcEDm9eRyIX 1g7KIdwadrLR8cvfJgCRL4EB9fASfUbn9XwZX30o= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.239]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LwJFG-1gaS6l2gxS-0182yQ; Tue, 21 May 2019 09:32:29 +0200 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: "Basil L. Contovounesios" References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87lfzwg04h.fsf@tcd.ie> <87ftp9jl8q.fsf@tcd.ie> From: martin rudalics Message-ID: <5f39dc18-e4d4-dfbc-3bed-18542a10aedb@gmx.at> Date: Tue, 21 May 2019 09:32:29 +0200 MIME-Version: 1.0 In-Reply-To: <87ftp9jl8q.fsf@tcd.ie> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:Nk6eJ+eLdjnkVp8XBJwJTdJFOy7M9uEibl0nBwaRRrZGDeGEmYY +SDYuRMoOX7CZYpxs9n5geKbyOTiWKsZ6Oxw9VpKSy9zlRleM5qFdRHFhg3LutXXCIR1eLe RFtQuoq5C0DaMYbrdygsBVCNQV3JmOHuIj1RAsJpaNvJCSUdeXj4iHwzWFLvgEP/RdtKzgC zva4IuanFq1Gn3mRbxfDw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:uCMNMuaB+2A=:JnfRrtotFjdOvbqazX1fFf pgl/j8pZiQDTQc+JuiDr2QLqlJwvVOiOJ7V14urKTG7s8lZCl0wjr0zidNkj0iirrHGlOq3j6 B8+G6URFluuGgj0UtJ5IsZRP5TRbXCIOsUhM6RIUXQe96xQXmkW8aCigWYGLcjS+ZJpTLnekz BttLVR7131Bsb2u2rEzxesdTEST7HxqI/OTe3AoDI3l/Ity8fmWY8xB1SfNM5J+yihBan0kdg JvmaYpIyuDce4MYtczMKzoY9TSWsAaE6DGsCViBcOaGfwdZdm9Pfox9bAGG6AWewFUWI2AqBK lTJhJjJdwsRO2McPXEtycbMipyEwkJE1vhAghikFXI3oRGcq+U0HmHc0boL8Ok5a8EDNXLkmD 9sANx2cLjzs5K4d1Ky0w26iqoJkrHLbrbFdMnRDy61iQvvN6/rWlBP64lp97Gy5O3uAe1hNCR mH2c72DD4HFv6NiSVs+dsHvoBRZSo807eVQC7WFnqGAFgNlXK9HGVTavWJbwrg/9xNj2ClqY3 1OKg+789ccngoSTZcfKP2Kp1GAxRDc9RZbZjI7NgeBNvo0qrbpS1fNRF1x/90yNZoXuaSej5K cmDVkiQVWYvyU8mwxixafzAjvRBLDqWYFIFKKmjaiW2e0pKRkn/AgQqFYj5f0p1U3xOFHTYCq ihfac3ImMaKxwQuy5uXJYUDPTZtESCsEPinPFfI09TxSpnK/MxDKmZC7Or3tulHUHADAMDYzx p1x5xUrexphIhJapcG/af9/5EeALNZVqniVaCoKpoPuf1jxiqgpmRQZTkRR72CV/xOuAg0FjV CYsKNPeJUxr1jFrLp9KWPq9DjaZWivf3jRChTQSpuTFWv83Wxm8jVaoXd3B+23k7z948K4ye1 Q8ysA39j7ivr3EQt54yWI/Qry8J4uwK4mSVAl14pqxoHHJGQCZS6Vi2VE66EvzXlNv0JQM7L2 gkgSedAMOcsNnZassgI6qT6PBiibwNyS+YGMuMql9hldX2/M3tsR4 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Eli Zaretskii , monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> It would be nice to get rid of the entire >> >> b->inhibit_buffer_hooks >> = (STRINGP (Vcode_conversion_workbuf_name) >> && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name), >> SBYTES (Vcode_conversion_workbuf_name)) == 0); >> >> form in 'get-buffer-create'. Any ideas? > > Doesn't your patch in https://debbugs.gnu.org/34765#86 already eliminate > the need for it? FWIW no, it leaves that form in place. And 'get-buffer-create' should not have to worry about delving any deeper into the name than down to its first character to check for ' ' or '*'. But I'm not happy with my patch anyway. Something more elegant is needed. martin From debbugs-submit-bounces@debbugs.gnu.org Tue May 21 03:58:27 2019 Received: (at 34765) by debbugs.gnu.org; 21 May 2019 07:58:27 +0000 Received: from localhost ([127.0.0.1]:38514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSzfG-0002yg-Og for submit@debbugs.gnu.org; Tue, 21 May 2019 03:58:26 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:46899) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSzfE-0002yS-Ub for 34765@debbugs.gnu.org; Tue, 21 May 2019 03:58:25 -0400 Received: by mail-ed1-f68.google.com with SMTP id f37so27885813edb.13 for <34765@debbugs.gnu.org>; Tue, 21 May 2019 00:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=pPSXJhaOBgL3vsr/jAB4vBRCFnqQATNxvuCVHarcDs8=; b=bAU5ZYc8Bm4BDY+NMEAuC9mPuuRw8l5jknVIwiHama+k89M5YFBhInJsy3qw7Wb7fg RqyY4tFNlJvS7WyMqgnKQH9rzHlkNO0gncbOmjMNGO3McOhqnaKWr8wO70eOBRSpd7m9 h99vfGDQWPtx+VvT9oWzvL+Gnsi4V2ymwZlyOZ+f/L32eP4Ggg/pdyZRKUO3LIEd5n4v D0izi2ocf/zS7xXvlvySFbYc3BdA9Y2titnq4cCfb6xEFQzt3pfvOWwM+rtL5J3dfocM nQT0uM67SeDhKxJsYWobZOmHEgptfo/Y1x2nBv5Yff6s6HXwekcjjsTSVh/HJfFV9NVa IP6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=pPSXJhaOBgL3vsr/jAB4vBRCFnqQATNxvuCVHarcDs8=; b=t1/4MML0pvDYPtsxiptZ284o6uH1XRkZyv+wbOj+f9w1XvcXIXq1+dtOL0Z3qZrPrI HzAFKiiXF2lqoWvG4DDzgfGP6YSQPIno+qY4dsErkbl03wYmZLgxkP1NYk+p79Fch2zh VQMNWtDd3tsm//Hd6n3M3DbTGMi8Soc4HcCuM0lVuOIryToHdaDX7rX5Hbrghl7gTgIJ ZF6amtLlmjK/7noTvGN81odL4SpNFzzWfFyYmXIqiegV2AKkRYNS+gmlBdqTNkfxTExN f/wCEHFMCr0uBy+m/6kBXgF8MK6X41HhoJ497ZOL/RcwYWUwdHJuI38pDRF3/QWn/2Zj xVRQ== X-Gm-Message-State: APjAAAULJ38PRAzoM0xImabHyVGg97VDyOH/p1mzZqR6ofHC3S5fRv9e wZoXv4JYgl926bLuYvZ6KR3bPw== X-Google-Smtp-Source: APXvYqym0i+iXe+ZNGldinA8cMkM/8ZctRbfJbSr9DEfTMqm/92csKGHm3QFuyTnBZARsyG9ivodPQ== X-Received: by 2002:a17:906:27d7:: with SMTP id k23mr53313392ejc.37.1558425498986; Tue, 21 May 2019 00:58:18 -0700 (PDT) Received: from localhost ([2a02:8084:20e2:c380:8cad:ae29:555d:852d]) by smtp.gmail.com with ESMTPSA id p27sm3383804ejf.65.2019.05.21.00.58.17 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 21 May 2019 00:58:18 -0700 (PDT) From: "Basil L. Contovounesios" To: martin rudalics Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87lfzwg04h.fsf@tcd.ie> <87ftp9jl8q.fsf@tcd.ie> <5f39dc18-e4d4-dfbc-3bed-18542a10aedb@gmx.at> Date: Tue, 21 May 2019 08:58:17 +0100 In-Reply-To: <5f39dc18-e4d4-dfbc-3bed-18542a10aedb@gmx.at> (martin rudalics's message of "Tue, 21 May 2019 09:32:29 +0200") Message-ID: <87v9y4p7c6.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Eli Zaretskii , monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) martin rudalics writes: >>> It would be nice to get rid of the entire >>> >>> b->inhibit_buffer_hooks >>> = (STRINGP (Vcode_conversion_workbuf_name) >>> && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name), >>> SBYTES (Vcode_conversion_workbuf_name)) == 0); >>> >>> form in 'get-buffer-create'. Any ideas? >> >> Doesn't your patch in https://debbugs.gnu.org/34765#86 already eliminate >> the need for it? > > FWIW no, it leaves that form in place. I know, my emphasis was on eliminating the *need* for it. > And 'get-buffer-create' should not have to worry about delving any > deeper into the name than down to its first character to check for ' ' > or '*'. > > But I'm not happy with my patch anyway. Something more elegant is > needed. The possibilities for the buffer creation subroutine are either to act specially on certain buffer name prefixes, or to accept an extra argument indicating what to do, no? Are there any others? There was mention of exposing a buffer-local variable to Elisp, but IIRC setting that after creating the buffer would already be too late. Buffer names starting with spaces are already special in some contexts, so extending that idea for inhibiting buffer hooks doesn't sound too bad, but the extra flag seems equally elegant and more backward-compatible. Am I missing something? Thanks, -- Basil From debbugs-submit-bounces@debbugs.gnu.org Tue May 21 06:05:01 2019 Received: (at 34765) by debbugs.gnu.org; 21 May 2019 10:05:01 +0000 Received: from localhost ([127.0.0.1]:38718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT1dk-0008P0-T0 for submit@debbugs.gnu.org; Tue, 21 May 2019 06:05:01 -0400 Received: from mout.gmx.net ([212.227.17.22]:41845) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT1di-0008Oi-Dk for 34765@debbugs.gnu.org; Tue, 21 May 2019 06:04:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1558433087; bh=0IilPE0SmL2cZswkOcdpSsypiFw73Hg04DLZ2/XT8TI=; h=X-UI-Sender-Class:From:Subject:To:Cc:References:Date:In-Reply-To; b=WPUjCAyNUWKn2xDnw3x6virwNh0tOO9j+f6gCovewBbkyaX6qZi82P+Mg8u0KtRGU +1yMWGfGS31CgknoLRCMEwEYYPE4g7f8RzFcExiFdsSgEAFVVXRm0XPKBBqM8w5qfa Gl6On09g8V7bOeeMkw/w9FSQng3ya3n30skvkTto= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.239]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MKYpv-1hTIU40AzP-0020cu; Tue, 21 May 2019 12:04:47 +0200 From: martin rudalics Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: "Basil L. Contovounesios" References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87lfzwg04h.fsf@tcd.ie> <87ftp9jl8q.fsf@tcd.ie> <5f39dc18-e4d4-dfbc-3bed-18542a10aedb@gmx.at> <87v9y4p7c6.fsf@tcd.ie> Message-ID: Date: Tue, 21 May 2019 12:04:46 +0200 MIME-Version: 1.0 In-Reply-To: <87v9y4p7c6.fsf@tcd.ie> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:I71FdhfhOZZARggtqGwcqpc24FgG0eov219TGAdEpjEW/ur3wmh i3FsnyPVbp41o9BGAnVRAWy2ooi9GJl881oSUTfe4FG+mWKWcwxtBe1JwSfx0PtAfWWJHwt cqHJB/hdTlqj4uxsw2t6BCCN2zjer0bLygJSp0t4sBGRa1xnfN7OgCi770yBq/MsKY7Cpwn w1LvQEC2W0DEMKC9ZXOnA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Rnsw9WOrJhk=:+jFGT/S8xCtLLdUz8fFhmn zOllcrAOxz1PU74rRO2vnJy4KIkMh3kT4KEZhWfsVtizRM9+2YIMfD2u+fow9+ix98214yLsU UrAOTuCOzVr7GATkHVedPak4V7aD60OvhA3qHXKQda5Iwz3uAoCL+AE9eLdgUxxQic1EFr4lU AK3cNjWkxVxUlox3eYs9LDJTQfS3TE8F2jwoN0++L62t2SYWJFucNUUT7u/CYkC2VhraM804K qis5/nVE0LhDYXFVOzftoluNVqHISmu9sceeirmovrkG/TP+UAscq0z3kstKKYeGsEohpgvTK kno2tTe6C6yjNRKLNfr548hAj2NPjld8aZGZoO+kpXfdro/XmNfzYtJ+lr1t8Fd0G4XcMODpk QtLxY35NfKtKwMlo5wTIljP9pFJ6GiXufILJXMX6Mu4NTV01xHqMazXgzwGuhhMTIm8smtbdJ T5Mx1W6VTrcCCZy/s70lZn6IUb/7mRvLvHjiIQPkY9gn+c7U3yCc5WEdy9xSMiNfxdvvFV3F7 5z7MEJisWQstKG9bH3Lduk0QbC4nm6odTJ6FMVB/8A7nR16PjW7PfbDEspgEM9eC/0+4mRPXm zpbsfAiPbPj80NkakeLZEaYv6R1iK0CfcoNqfIrH84KgSuOOKUbZkO4pNmNhK6XzO5/yjJzbm xiQllygTHh/jFhRw1MFxT2geI3DeVNfk5xhlL+olbkf9adVaGLDRbUh7ZuGmmqco4UhiK3Qnl th/KFyIuGPdSFSCJVq5XUBvgAjBLbtfROoElY8Qrgwu3uHj8y38e+yU+XqNzDsClAJMK+ULic fNvZwbqMpSubRj820XI08QnnVrqaCuEdrEFz8PpSShWrsw+gXUZdVmt67oG3Fmm5UqQgqAzkw by0rU9tG4RcIOcZu0y+JOweA/n1GUx4H/nH4x3RnaOqlum6ifZok4y2tUanIsT/IwCMhI/F+n 3Jof8dOGv8KyMrRMh1kU6JyJRcW4Gp5G5JLi4w3eoXNT3nCsnUKVG X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Eli Zaretskii , monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>> It would be nice to get rid of the entire >>>> >>>> b->inhibit_buffer_hooks >>>> = (STRINGP (Vcode_conversion_workbuf_name) >>>> && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name), >>>> SBYTES (Vcode_conversion_workbuf_name)) == 0); >>>> >>>> form in 'get-buffer-create'. Any ideas? >>> >>> Doesn't your patch in https://debbugs.gnu.org/34765#86 already eliminate >>> the need for it? >> >> FWIW no, it leaves that form in place. > > I know, my emphasis was on eliminating the *need* for it. That's what I meant with the above. In code_conversion_save we should get rid of _both_ Fget_buffer_create instances but but I have not managed to understand the Vcode_conversion_workbuf_name vs Vcode_conversion_reused_workbuf rigmarole yet. > The possibilities for the buffer creation subroutine are either to act > specially on certain buffer name prefixes, or to accept an extra > argument indicating what to do, no? Are there any others? There was > mention of exposing a buffer-local variable to Elisp, but IIRC setting > that after creating the buffer would already be too late. So far there is no extra argument, the entire analysis is based on examining the proposed name argument. > Buffer names starting with spaces are already special in some contexts, > so extending that idea for inhibiting buffer hooks doesn't sound too > bad, Eli thinks that "this is too drastic a measure". > but the extra flag seems equally elegant and more > backward-compatible. Am I missing something? The piece we are discussing here namely how to get rid of the stuff at the top of this mail. And issues Eli raised earlier - whether 'get-buffer-create' should accept an extra argument or whether it should set b->inhibit_buffer_hooks = true. martin From debbugs-submit-bounces@debbugs.gnu.org Wed May 22 03:21:36 2019 Received: (at 34765) by debbugs.gnu.org; 22 May 2019 07:21:36 +0000 Received: from localhost ([127.0.0.1]:41479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTLZA-0007zf-F0 for submit@debbugs.gnu.org; Wed, 22 May 2019 03:21:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTLZ8-0007zU-Uq for 34765@debbugs.gnu.org; Wed, 22 May 2019 03:21:35 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:32788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTLZ2-0007Vy-Vf; Wed, 22 May 2019 03:21:29 -0400 Received: from [176.228.60.248] (port=1550 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hTLZ2-0002IT-3A; Wed, 22 May 2019 03:21:28 -0400 Date: Wed, 22 May 2019 10:21:32 +0300 Message-Id: <83blzv7y4j.fsf@gnu.org> From: Eli Zaretskii To: "Basil L. Contovounesios" In-reply-to: <87v9y4p7c6.fsf@tcd.ie> (contovob@tcd.ie) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87lfzwg04h.fsf@tcd.ie> <87ftp9jl8q.fsf@tcd.ie> <5f39dc18-e4d4-dfbc-3bed-18542a10aedb@gmx.at> <87v9y4p7c6.fsf@tcd.ie> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: "Basil L. Contovounesios" > Cc: Eli Zaretskii , 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA > Date: Tue, 21 May 2019 08:58:17 +0100 > > The possibilities for the buffer creation subroutine are either to act > specially on certain buffer name prefixes, or to accept an extra > argument indicating what to do, no? Are there any others? There was > mention of exposing a buffer-local variable to Elisp, but IIRC setting > that after creating the buffer would already be too late. > > Buffer names starting with spaces are already special in some contexts, > so extending that idea for inhibiting buffer hooks doesn't sound too > bad, but the extra flag seems equally elegant and more > backward-compatible. Am I missing something? The flag in the C structure has the advantage that it can be easily set and reset from C without the need to temporarily bind Lisp variables, which then involves unwind-protect forms etc., and as a side effect makes the entire operation slower. Also, a flag can be set/reset regardless of whether the buffer already finished being created, whereas buffer-local variables must have a live buffer. From debbugs-submit-bounces@debbugs.gnu.org Wed May 22 03:30:01 2019 Received: (at 34765) by debbugs.gnu.org; 22 May 2019 07:30:01 +0000 Received: from localhost ([127.0.0.1]:41488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTLhI-0008E1-O0 for submit@debbugs.gnu.org; Wed, 22 May 2019 03:30:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34641) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTLhH-0008Dn-S9 for 34765@debbugs.gnu.org; Wed, 22 May 2019 03:30:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:32856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTLhC-0008UV-KO; Wed, 22 May 2019 03:29:54 -0400 Received: from [176.228.60.248] (port=2064 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hTLh9-0000P7-Ff; Wed, 22 May 2019 03:29:52 -0400 Date: Wed, 22 May 2019 10:29:57 +0300 Message-Id: <838suz7xqi.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: (message from martin rudalics on Tue, 21 May 2019 12:04:46 +0200) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87lfzwg04h.fsf@tcd.ie> <87ftp9jl8q.fsf@tcd.ie> <5f39dc18-e4d4-dfbc-3bed-18542a10aedb@gmx.at> <87v9y4p7c6.fsf@tcd.ie> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: contovob@tcd.ie, 34765@debbugs.gnu.org, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: martin rudalics > Cc: Eli Zaretskii , 34765@debbugs.gnu.org, alexanderm@web.de, > monnier@IRO.UMontreal.CA > Date: Tue, 21 May 2019 12:04:46 +0200 > > I have not managed to understand the Vcode_conversion_workbuf_name > vs Vcode_conversion_reused_workbuf rigmarole yet. The latter is a fixed buffer, created once and never killed. So the buffer hooks never run for it, and never affect Emacs. By contrast, the former is a buffer created when the reused buffer is busy and cannot be reused. We then kill Vcode_conversion_workbuf_name when we no longer need it. Thus, buffer hooks run for these work buffers all the time, and for a code-conversion intensive code they could slow down Emacs, specially if the list of buffer hooks is long. > > The possibilities for the buffer creation subroutine are either to act > > specially on certain buffer name prefixes, or to accept an extra > > argument indicating what to do, no? Are there any others? There was > > mention of exposing a buffer-local variable to Elisp, but IIRC setting > > that after creating the buffer would already be too late. > > So far there is no extra argument, the entire analysis is based on > examining the proposed name argument. Since we currently keep this special treatment limited to a small number of buffer names, I'm not sure there's a need to expose this facility to Lisp. > > Buffer names starting with spaces are already special in some contexts, > > so extending that idea for inhibiting buffer hooks doesn't sound too > > bad, > > Eli thinks that "this is too drastic a measure". Yes. No one said buffer hooks must _never_ run for temporary buffers. There could be legitimate Lisp programs which want those hooks to run in that case. From debbugs-submit-bounces@debbugs.gnu.org Wed May 22 04:32:51 2019 Received: (at 34765) by debbugs.gnu.org; 22 May 2019 08:32:51 +0000 Received: from localhost ([127.0.0.1]:41539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTMg7-0001jc-I4 for submit@debbugs.gnu.org; Wed, 22 May 2019 04:32:51 -0400 Received: from mout.gmx.net ([212.227.17.21]:45751) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTMg5-0001jQ-QS for 34765@debbugs.gnu.org; Wed, 22 May 2019 04:32:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1558513960; bh=R4irTNJ8XUYtU5nPiPETj6mCqncQllIsl36Poq/HfKQ=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=CBR1K+VSYM67djDYMLhKL36M3Glnu80VJ0i8igY4TjaF0PS+icxNtEdi3nlUMZODI rYWpXFfcyIp/iIMfu4tvbg1naoZtKxiVavT+2RZhWdLUlbVrq36A9JWo+32rP/x9fU Ta54xJttq5WUs+4jFmEFnvWnKHBnzZ97qb2p6cwE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([213.162.73.150]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LdYSM-1gm5lK0lWc-00inVU; Wed, 22 May 2019 10:32:40 +0200 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: Eli Zaretskii References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87lfzwg04h.fsf@tcd.ie> <87ftp9jl8q.fsf@tcd.ie> <5f39dc18-e4d4-dfbc-3bed-18542a10aedb@gmx.at> <87v9y4p7c6.fsf@tcd.ie> <838suz7xqi.fsf@gnu.org> From: martin rudalics Message-ID: <89140fef-3447-078f-32fe-8c9206e14c59@gmx.at> Date: Wed, 22 May 2019 10:32:39 +0200 MIME-Version: 1.0 In-Reply-To: <838suz7xqi.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:Br4/lEkvotIkz0+h7WXKDmor/0E4BlcGil16Hzhe7+z46Xd+E4O 0GZ5P9G0wyGFWqd5QSsTXQxEqA7aOOyn8JUoaoEBzYyosq4zED+TlEX650MLskvS7tFP5x+ NIUbBIBPl0FLdglK/TZKrmsPg5rJlvlY2IlkYgszalcZ+GeJgSDL7xNxnJimqEzzjx94XHf 3BC9A1/vAdcp/EFdBaOKg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:vb3Bywh4SQ4=:E2bENi4JoMIy7P9ZUukiyR lper9fHJUz2gxLVEXZf5HRgjoCjFpP+Vs/ZBHNZhwCyiBADQBprFv3eVvYJO7/9jOkG0nGglO TcNyvEFj2VgAqm9mdk9zCEGNAa7HrHDbsJiI+Sx3iztEOODQVmzRLSBTVVhoB010hGJfGkRBD 4bPNFy68Xf7orzYdd+BCWUFsahTO6A348QYnfbNqrf9k6ffrABBdkJP2Eph5W39mw9DUh0eUT dAtsvuS0cNchUJAxXBlIODlbDHkynI7g5Ka5N8FjWZig/zE3d8qfIgWbCaFLoF4jH0UULVdwG y2oAN7eV1bJOzhN/rtG9tr0i+Ls/Lah887yVNffKJ57O4NOl35FHgGtuVUAecdqeCKmHTYxEw z4d8rpN4JuQ4HRyHQkEuBPAMmv1K8II1ZLXoRjwI8xkSw+qGOarxydkt1n8t+EIFC4DMsTWkH YX25ky7Aa5DHH89DKJ8iWTvbjamWnnSVxxiyQ1qNWhOftCtNYmsZCeSXqdB4ykibb2oUAsoC8 GfRW1Zo0p/eCiB8DNgU7q8zeo3TjOQUk6zEe8poPbrSBIvlQx5ey5rVuaerr7YjB2TdK5tbZp txz/f2Ew6d6ESl5ndIuSqEBrs0lGfeden7RR5jNzEOHeMpYIuIePIBOs/SeYW0nWSCvtl/xe/ FvpaizT0/I5yUER/TjtxU/71azITe2zPrM3Q87L/KUc+5x/6PcXq4b0GvpxckgD5GDYl+3t4m u42OgqNpIR9VCh22wd37DjYqTYOKxphA4eS2ZnTdwxb3NFIhEjIbw7ckr+VvvI04/1erOeWje 3at9sFRrBJSV4gskJe+riZw2O1NdqL1oJF7BZCbXUxT9GsidHG7qIvjuqxWCiTc7jpW3Ceo/W mahCKvxVS8QqL29Tkry8Af2+o0LRc729PrgDlvbg1y4dnIDvZw3ocZSIBO/4fURDS8ZgZBhQh 6g62vqGRYSwWyaZghTrWVXt/2eRsqgNk0zPZWUdDI5N8DJvkgylUL X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: contovob@tcd.ie, 34765@debbugs.gnu.org, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> I have not managed to understand the Vcode_conversion_workbuf_name >> vs Vcode_conversion_reused_workbuf rigmarole yet. > > The latter is a fixed buffer, created once and never killed. So the > buffer hooks never run for it, and never affect Emacs. By contrast, > the former is a buffer created when the reused buffer is busy and > cannot be reused. We then kill Vcode_conversion_workbuf_name when we > no longer need it. Thus, buffer hooks run for these work buffers all > the time, and for a code-conversion intensive code they could slow > down Emacs, specially if the list of buffer hooks is long. Thanks, I hope I understand it now. Could you pretty please add the (instructive for me) "a buffer created when the reused buffer is busy and cannot be reused" somewhere to the comments maybe together with a reference to reused_workbuf_in_use. Hopefully this also means that we can use _something like_ Fgenerate_new_buffer to replace both instances of Fget_buffer_create in code_conversion_restore. > Since we currently keep this special treatment limited to a small > number of buffer names, I'm not sure there's a need to expose this > facility to Lisp. I'm not sure either. >>> Buffer names starting with spaces are already special in some contexts, >>> so extending that idea for inhibiting buffer hooks doesn't sound too >>> bad, >> >> Eli thinks that "this is too drastic a measure". > > Yes. No one said buffer hooks must _never_ run for temporary buffers. > There could be legitimate Lisp programs which want those hooks to run > in that case. I have to agree. martin From debbugs-submit-bounces@debbugs.gnu.org Wed May 22 06:06:52 2019 Received: (at 34765) by debbugs.gnu.org; 22 May 2019 10:06:52 +0000 Received: from localhost ([127.0.0.1]:41587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTO95-0004Kd-SR for submit@debbugs.gnu.org; Wed, 22 May 2019 06:06:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37337) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTO92-0004KP-Ph for 34765@debbugs.gnu.org; Wed, 22 May 2019 06:06:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTO8x-0003FM-4y; Wed, 22 May 2019 06:06:43 -0400 Received: from [176.228.60.248] (port=4094 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hTO8w-0003hn-Eh; Wed, 22 May 2019 06:06:42 -0400 Date: Wed, 22 May 2019 13:06:48 +0300 Message-Id: <83woii7qh3.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: <89140fef-3447-078f-32fe-8c9206e14c59@gmx.at> (message from martin rudalics on Wed, 22 May 2019 10:32:39 +0200) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87lfzwg04h.fsf@tcd.ie> <87ftp9jl8q.fsf@tcd.ie> <5f39dc18-e4d4-dfbc-3bed-18542a10aedb@gmx.at> <87v9y4p7c6.fsf@tcd.ie> <838suz7xqi.fsf@gnu.org> <89140fef-3447-078f-32fe-8c9206e14c59@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: contovob@tcd.ie, 34765@debbugs.gnu.org, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: contovob@tcd.ie, 34765@debbugs.gnu.org, alexanderm@web.de, > monnier@IRO.UMontreal.CA > From: martin rudalics > Date: Wed, 22 May 2019 10:32:39 +0200 > > >> I have not managed to understand the Vcode_conversion_workbuf_name > >> vs Vcode_conversion_reused_workbuf rigmarole yet. > > > > The latter is a fixed buffer, created once and never killed. So the > > buffer hooks never run for it, and never affect Emacs. By contrast, > > the former is a buffer created when the reused buffer is busy and > > cannot be reused. We then kill Vcode_conversion_workbuf_name when we > > no longer need it. Thus, buffer hooks run for these work buffers all > > the time, and for a code-conversion intensive code they could slow > > down Emacs, specially if the list of buffer hooks is long. > > Thanks, I hope I understand it now. Could you pretty please add the > (instructive for me) "a buffer created when the reused buffer is busy > and cannot be reused" somewhere to the comments maybe together with a > reference to reused_workbuf_in_use. Not sure where you want to add this. coding.c already says: /* Name (or base name) of work buffer for code conversion. */ Lisp_Object Vcode_conversion_workbuf_name; /* A working buffer used by the top level conversion. Once it is created, it is never destroyed. It has the name Vcode_conversion_workbuf_name. The other working buffers are destroyed after the use is finished, and their names are modified versions of Vcode_conversion_workbuf_name. */ static Lisp_Object Vcode_conversion_reused_workbuf; /* True iff Vcode_conversion_reused_workbuf is already in use. */ static bool reused_workbuf_in_use; is that what you wanted to see? > Hopefully this also means that we can use _something like_ > Fgenerate_new_buffer to replace both instances of Fget_buffer_create > in code_conversion_restore. You mean code_conversion_save, I presume. One of those calls to Fget_buffer_create shouldn't generate a new name, though. It should always use a fixed name. From debbugs-submit-bounces@debbugs.gnu.org Wed May 22 10:12:48 2019 Received: (at 34765) by debbugs.gnu.org; 22 May 2019 14:12:48 +0000 Received: from localhost ([127.0.0.1]:42638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTRz5-000577-U9 for submit@debbugs.gnu.org; Wed, 22 May 2019 10:12:48 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:65448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTRz4-00056s-1y for 34765@debbugs.gnu.org; Wed, 22 May 2019 10:12:46 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 06A4B100A37; Wed, 22 May 2019 10:12:40 -0400 (EDT) Received: from mail02.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8484C1007B5; Wed, 22 May 2019 10:12:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1558534358; bh=/lA1Dr7f13xhpfSHu91a9JX9xi1LS5LX9MDxmf0Ydu0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Obj8ra4c5LmCY342PJvsotPMOuIgBA+6TfkyHsJdIpfo5A/U/I8mY42gwwTeZIDS8 k9Qm+RU8rNhKzCF9UB5O+O9W4byC11z/L2KxSKuousTsHWeFBKOOjOpghjJuYf14t9 Hr6KAI+DbVlMYzmONY4OnT2lswgTld6E/maQPtn/H1iqQeoC8KHopAAfsoSre2139D yBxZSwcDgr3OZApnYkbtiP8Aw5mBp9HXxEWPaCPgnUuCmoefz+JslUYWErmm7psvYC 8X2f4uK/BIl9CmOaJbeEBM/FDX6i96icpb0aoWsGmlmOVVcX9Tazbzv7EwRjflO6Tq 4L2/J8YGv+HvQ== Received: from pastel (unknown [216.154.3.168]) by mail02.iro.umontreal.ca (Postfix) with ESMTPSA id 3B4701201F1; Wed, 22 May 2019 10:12:38 -0400 (EDT) From: Stefan Monnier To: martin rudalics Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook Message-ID: References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87lfzwg04h.fsf@tcd.ie> <87ftp9jl8q.fsf@tcd.ie> <5f39dc18-e4d4-dfbc-3bed-18542a10aedb@gmx.at> <87v9y4p7c6.fsf@tcd.ie> <838suz7xqi.fsf@gnu.org> <89140fef-3447-078f-32fe-8c9206e14c59@gmx.at> Date: Wed, 22 May 2019 10:12:36 -0400 In-Reply-To: <89140fef-3447-078f-32fe-8c9206e14c59@gmx.at> (martin rudalics's message of "Wed, 22 May 2019 10:32:39 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.026 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: contovob@tcd.ie, 34765@debbugs.gnu.org, Eli Zaretskii , alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> Since we currently keep this special treatment limited to a small >> number of buffer names, I'm not sure there's a need to expose this >> facility to Lisp. > I'm not sure either. How 'bout this: additionally to "hidden buffers" which start with a SPC character, we introduce the notion of "internal buffers" whose name starts with another special first char or with two SPC chars and disable those buffers's hooks. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed May 22 11:50:23 2019 Received: (at 34765) by debbugs.gnu.org; 22 May 2019 15:50:23 +0000 Received: from localhost ([127.0.0.1]:42745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTTVX-0007ac-38 for submit@debbugs.gnu.org; Wed, 22 May 2019 11:50:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTTVT-0007aL-Ur for 34765@debbugs.gnu.org; Wed, 22 May 2019 11:50:21 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTTVO-0000es-KT; Wed, 22 May 2019 11:50:14 -0400 Received: from [176.228.60.248] (port=2380 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hTTVK-00062o-Mr; Wed, 22 May 2019 11:50:13 -0400 Date: Wed, 22 May 2019 18:50:17 +0300 Message-Id: <83pnoa7akm.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Wed, 22 May 2019 10:12:36 -0400) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87lfzwg04h.fsf@tcd.ie> <87ftp9jl8q.fsf@tcd.ie> <5f39dc18-e4d4-dfbc-3bed-18542a10aedb@gmx.at> <87v9y4p7c6.fsf@tcd.ie> <838suz7xqi.fsf@gnu.org> <89140fef-3447-078f-32fe-8c9206e14c59@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: contovob@tcd.ie, rudalics@gmx.at, alexanderm@web.de, 34765@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Eli Zaretskii , contovob@tcd.ie, 34765@debbugs.gnu.org, alexanderm@web.de > Date: Wed, 22 May 2019 10:12:36 -0400 > > How 'bout this: additionally to "hidden buffers" which start with a SPC > character, we introduce the notion of "internal buffers" whose name > starts with another special first char or with two SPC chars and disable > those buffers's hooks. It's possible, if there's a frequent enough use case for such automatic disabling. Is there? In general, since the hook can be disabled in each buffer individually, we'd need a very good reason to provide another facility. From debbugs-submit-bounces@debbugs.gnu.org Thu May 23 04:39:02 2019 Received: (at 34765) by debbugs.gnu.org; 23 May 2019 08:39:02 +0000 Received: from localhost ([127.0.0.1]:43853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTjFd-0000zb-VR for submit@debbugs.gnu.org; Thu, 23 May 2019 04:39:02 -0400 Received: from mout.gmx.net ([212.227.15.15]:60663) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTjFb-0000zJ-OZ for 34765@debbugs.gnu.org; Thu, 23 May 2019 04:39:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1558600724; bh=NbacNRaRkCm9zlZvsRd7iRU7EItH6Cln9Nv9Vg3gHGo=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=ftAZFlbyARvaip/DrMZgg+YzfRfzuQp1C7GlO34Xk9zh/He+Mx9SpxSiEOhnJYjjb U7kxIdMZn1v1Jbj2rrPMnrH6SkLhKgch2JO0F+nMZjR9zuuM2fUVCpMh/M3lXDDCvZ XBkdGkCFZUZQk6NHjOj53R36OnQHZrnAGLR8lI+4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.15]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MS3ir-1h5DSK38xP-00TVs9; Thu, 23 May 2019 10:38:43 +0200 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: Eli Zaretskii References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87lfzwg04h.fsf@tcd.ie> <87ftp9jl8q.fsf@tcd.ie> <5f39dc18-e4d4-dfbc-3bed-18542a10aedb@gmx.at> <87v9y4p7c6.fsf@tcd.ie> <838suz7xqi.fsf@gnu.org> <89140fef-3447-078f-32fe-8c9206e14c59@gmx.at> <83woii7qh3.fsf@gnu.org> From: martin rudalics Message-ID: Date: Thu, 23 May 2019 10:38:38 +0200 MIME-Version: 1.0 In-Reply-To: <83woii7qh3.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:WP4c56bSCtryC0GNyebisFtFg7IxKT5iXVkFjK/olnVeTBGjBkc xxSs/n8hwILtx65lgVvhxC8jeZZC8O4gy7Stqg7kRrlwXHXGL7s1xh9c17XpCfE8Y9ECLxi UP315LmEw1+fpc3Pxy1LKpNIE9tPzc+4Ppt8AxnfKGd92vxi2hw5vOiBWiOacCI/mcuMcDi CGoNw73wYbdL04cjsIjVg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:6NuMmA2zwno=:HtOG8Eu+IyuB9Cqo4OsHqw u2M1REJ+KSHQtrHgTpkgi5vX3G1/SAZOSTOoiqYF1B7YTDt6nT6lqsBEt5FZKM+d3jpFPR3Yk 5ccJfum/Kxy6JAfJcHPcNXi7CaBN/BiVGJayvSAFoUgtVNREB8/+ADTtnF9shfs/8eGe11Aa3 hLn+8Gg5fNilY7luRcVvuPkDUqr5q2/jfVX+nrpW7/OrqagK1QDxayvQwq+wRUQ6dnYjmEcoN 0sCW1H3kdz12fDXEAL0nlND3erWmPLSBcxUDdiB3d9Dzylu5XHx9yGlJa31sszhPojBORO5FX TP61Iw72s7nR45AtJjVYPrPYtYuaK6fFYnhyP62isVwWE9LasA+h0T9ZXW9Alt30wTFuldFsW /tAD3Dz42RgXFnYDQlQiB35OCi5MsE5c7aIFkXv8Bot0XDBsA7uW8iKQ9J/Lf1FoxpgDmKiW4 056lOZKOzBnxxk5e5LKU13Yuhq7BroRqNynyWriE3ANeRChZYgGZTElPseHRSrILj8apDiqTs 2gp09PTk8WS2Zl8Izml1UqqXIf+l+KKMShZLNPvt0bVhMHaYtNWUwxqURzjzIxTZ8rGWEaPyO l/aVHCfdunFJM3ybHjDMNSFmRWFSSjxDYkymMM/elnjE66fQ6fWMgEt9wifC3REtqCMQZ+hBR hQanY3C2Ugtg3fwyTqi2x2wP0LfcHaFGo6crS+SvUyGFX3nUGXKaroLgfJSOSFjVkd4kcQEF+ CBjr/l2vbYLgVx/KWMNhR70nDnw6acktEd6I6+LavO/GUemVGxGcowRUddUW4pkUQJKCqg03a uGAXpsfuPhUeB7sOWC7ZHGO7OlEmfr0fh2vIq3KX+irTlGWZSmMaPiAaKddCj1yvJrmU2tGAz 6+EGxUfMGV7da63cZzg8vVxYXm5lp0VtPbm81AgXpwttVzkA/37as4LcCMJa/V40C4bv6l5eF lJPhCvwcZ6b7e/xcZVuj5XzeBbxt2Dog4CALYEPQFiEOgLWBs8U7n X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: contovob@tcd.ie, 34765@debbugs.gnu.org, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Thanks, I hope I understand it now. Could you pretty please add the >> (instructive for me) "a buffer created when the reused buffer is busy >> and cannot be reused" somewhere to the comments maybe together with a >> reference to reused_workbuf_in_use. > > Not sure where you want to add this. coding.c already says: That's what I've read and did not understand. It's a bit too concise. > /* Name (or base name) of work buffer for code conversion. */ > Lisp_Object Vcode_conversion_workbuf_name; This comment insinuates that there is only one such buffer. > /* A working buffer used by the top level conversion. What is the "top level conversion"? > Once it is > created, it is never destroyed. It has the name > Vcode_conversion_workbuf_name. The other working buffers are > destroyed after the use is finished, and their names are modified > versions of Vcode_conversion_workbuf_name. */ > static Lisp_Object Vcode_conversion_reused_workbuf; > > /* True iff Vcode_conversion_reused_workbuf is already in use. */ > static bool reused_workbuf_in_use; > > is that what you wanted to see? I'd prefer something like a common comment for all these variables going as /* The internal work buffers for code conversion are created lazily on demand. The name of the first buffer created that way is specified by Vcode_conversion_workbuf_name. Once created, this buffer is no more deleted in the current Emacs session. While this buffer is in use, the boolean variable reused_workbuf_in_use is true. This buffer is reused for new conversions whenever reused_workbuf_in_use is false. When reused_workbuf_in_use is true and more code conversion work has to be done, a new buffer is created. The name of that new buffer is generated by Fgenerate_new_buffer_name, using Vcode_conversion_workbuf_name as base name. Any such buffer is destroyed immediately as soon as it is no more used. */ >> Hopefully this also means that we can use _something like_ >> Fgenerate_new_buffer to replace both instances of Fget_buffer_create >> in code_conversion_restore. > > You mean code_conversion_save, I presume. You presume correctly. > One of those calls to Fget_buffer_create shouldn't generate a new > name, though. It should always use a fixed name. Fgenerate_new_buffer_name should do that: "If there is no live buffer named NAME, then return NAME.". Concludingly, what we need in the present context is a function - to create a buffer whose name is generated from a base name argument, - to set the new buffer's inhibit_buffer_hooks flag according to a corresponding argument and to not run any hooks when that flag should be set and the buffer is created, - that is as internal as possible to avoid that applications misuse it (it can't be entirely internal since macros like 'with-temp-buffer' will need it). martin From debbugs-submit-bounces@debbugs.gnu.org Thu May 23 10:37:11 2019 Received: (at 34765) by debbugs.gnu.org; 23 May 2019 14:37:11 +0000 Received: from localhost ([127.0.0.1]:45006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hToqE-0005lF-Ty for submit@debbugs.gnu.org; Thu, 23 May 2019 10:37:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hToqC-0005l2-CH for 34765@debbugs.gnu.org; Thu, 23 May 2019 10:37:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hToq6-0000iY-Kc; Thu, 23 May 2019 10:37:02 -0400 Received: from [176.228.60.248] (port=3860 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hToq5-0004FU-2c; Thu, 23 May 2019 10:37:01 -0400 Date: Thu, 23 May 2019 17:37:10 +0300 Message-Id: <83zhnd5jah.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: (message from martin rudalics on Thu, 23 May 2019 10:38:38 +0200) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87lfzwg04h.fsf@tcd.ie> <87ftp9jl8q.fsf@tcd.ie> <5f39dc18-e4d4-dfbc-3bed-18542a10aedb@gmx.at> <87v9y4p7c6.fsf@tcd.ie> <838suz7xqi.fsf@gnu.org> <89140fef-3447-078f-32fe-8c9206e14c59@gmx.at> <83woii7qh3.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: contovob@tcd.ie, 34765@debbugs.gnu.org, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: contovob@tcd.ie, 34765@debbugs.gnu.org, alexanderm@web.de, > monnier@IRO.UMontreal.CA > From: martin rudalics > Date: Thu, 23 May 2019 10:38:38 +0200 > > I'd prefer something like a common comment for all these variables > going as Your wish is my command. Done. From debbugs-submit-bounces@debbugs.gnu.org Fri May 24 04:01:46 2019 Received: (at 34765) by debbugs.gnu.org; 24 May 2019 08:01:47 +0000 Received: from localhost ([127.0.0.1]:46033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hU598-0005fl-MS for submit@debbugs.gnu.org; Fri, 24 May 2019 04:01:46 -0400 Received: from mout.gmx.net ([212.227.15.15]:41779) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hU597-0005fY-90 for 34765@debbugs.gnu.org; Fri, 24 May 2019 04:01:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1558684889; bh=OQqfqHNTdHaOTxkTI3ljDyvUO3UWXix/aXdrIT0iNUQ=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=MyyIIHrYxIfp4tNPcD6ObDFOoFnyokdYzRhr+axRhmJ+odhXH2hQubCpJKXdk8b49 5Gf6SQux1fX95ieMC2bIPCUA7cOiZ73hkr/T36libuUPKXCkZFHRe6dR5X85GoXKU9 HRR2riCJyuur3z5qcTBUNEzxzBdNsK6kZeUMB3wI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.198]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M1psI-1hWI410Ypc-002E2I; Fri, 24 May 2019 10:01:29 +0200 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: Eli Zaretskii References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87lfzwg04h.fsf@tcd.ie> <87ftp9jl8q.fsf@tcd.ie> <5f39dc18-e4d4-dfbc-3bed-18542a10aedb@gmx.at> <87v9y4p7c6.fsf@tcd.ie> <838suz7xqi.fsf@gnu.org> <89140fef-3447-078f-32fe-8c9206e14c59@gmx.at> <83woii7qh3.fsf@gnu.org> <83zhnd5jah.fsf@gnu.org> From: martin rudalics Message-ID: <1e4e9dba-6f43-b29f-69ac-7b00e08870af@gmx.at> Date: Fri, 24 May 2019 10:01:26 +0200 MIME-Version: 1.0 In-Reply-To: <83zhnd5jah.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:lCQZon7SVy7ksfwDCxitCP2hqFSL4gBuZ98jIM7YGCn8a0ctDSe GMfn+L1QrDOFY8a6dEeIYqltqgKB8pfTFalNC04BqSJlA9g+9XhjGUHzuclTcLFcIOCLifR 21MStADq6BbtqyzmatGmoAlbCalSwimL8LLxhwd50wvXmsftUJACCe5ntk2rXVo3uySxNWt +QGXqxRqtc8gUmRVERy3Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:+KZPbBGnU9M=:oS4utW3PGNCJ+jn903/yz5 IcdqG5JXbkMM4yKAIiV2FKjbmfocu+Ar8sDvwcGiRRIEl4cO6RYv+vMZJ9jYvGFgGT1nQa/J3 BB8IOcO8OmdWxtzmWytGt6rTJ2uJjq1GPtv0vFn/yqy5XzfIdFe7GoSugtpZV7y2v1I3k2OR/ 0wID5dVyvEwOsvnjCEEYJi8HasbuBL/ozKQQ9+n1EImclTCmyoKboQFRw7VQDWyXBU/TH/B5M iNw8p0dtdXV/Rjb/UEGE2gdKY/oMDUsazzdnsROD0gVrIIevR8RFinUcpQDzhB05etzRxeP1E +9KtBEPVOQstwuahmQFUetWh/1I1OACU61xbbvRwStDIwuUIqth4CmkUF6OKz16mRYqvP+DA3 iuOgbV3kwOBBSfN2W5yeoqvaScCS2QsutJDJnSzlPopb0CbsKFrlNYibL6oaEqFb/+Osx3/Kf 4jhtVXyGE3YGeS4gbg//JRVXEniaxqnLk6+TNkp32a5S9u2UYo7PFfjja/QWBVig7yfebIIiy KyYD4LXIEgafMPuT3pkVYza7lu5TCyc6rmUzpeOjPbl/I2dKDoTWKzrNH4OCJb3Zs6KKwUr0P mYkoaz7Hv+2rexP91vOyQ/6V5s770syWvCCORU8JbKGmO2DnZLvPsdl9YLTKx0L88sB6g/zAQ KRI3QMVj4G0lXef8Rm6Ab00Rn8VyPZekmUTdFVc+/iQ2kZTu9pt2ZkJaLigf/2II0K+Vq/1SQ BRZNjl46o/wJOjPMOcBRTfXNYpOMGXAEjdAmeuDqQo9/79TBLlcdFOCtMcID110yVHLAT0PoU /NVmZQAUwtN1oQ27zqn/WgehgxvAXCHO06nlmQQBTPZTSORvXSnDcU4TKFJMZjrvnaxIyMfz1 3LAT5Lqaxw5BiHsN7jeDKURYnI6AyKU3J4D5C7b3b36gxtfnLRKK31TscLChHkp4MDKWwc2M9 MPN1zk2v8ZuoduwibWYsSj43eBkDVHiRCy2swhYmAq0XxxdB271ke X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: contovob@tcd.ie, 34765@debbugs.gnu.org, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Your wish is my command. Done. Perfect! Many thanks, martin From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 26 07:06:32 2020 Received: (at 34765) by debbugs.gnu.org; 26 Aug 2020 11:06:32 +0000 Received: from localhost ([127.0.0.1]:37524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAtGB-0005qQ-TO for submit@debbugs.gnu.org; Wed, 26 Aug 2020 07:06:32 -0400 Received: from quimby.gnus.org ([95.216.78.240]:54162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAtG8-0005qB-05 for 34765@debbugs.gnu.org; Wed, 26 Aug 2020 07:06:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=dkRBld/V1+zNg8XcION6TmRrpR+DAAE9cIkr5sFBmKw=; b=qIfKlMVwke26utXzwEwZ2Cd8iI 7bhQphAM/30jLcycJTGXMqa85YgKNdWIUydStehC8v0MT4YscLoaOPp37HkauHvIAs6MaSaQrSvu1 Adqb35fbQ5zqQcXR2S06MgVf+tyxuj5DOzUU8widTKtMim1Czu9wBLydYPmxODPZB57k=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAtFu-0004ha-Uh; Wed, 26 Aug 2020 13:06:20 +0200 From: Lars Ingebrigtsen To: martin rudalics Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> X-Now-Playing: Various's _Kaleidoscope (2)_: "SEED Ensemble - Mirrors" Date: Wed, 26 Aug 2020 13:06:13 +0200 In-Reply-To: <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> (martin rudalics's message of "Fri, 26 Apr 2019 13:00:06 +0200") Message-ID: <87h7sp1xay.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: martin rudalics writes: > I attach a preliminary patch. [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Eli Zaretskii , monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) martin rudalics writes: > I attach a preliminary patch. [...] > +DEFUN ("generate-new-buffer", Fgenerate_new_buffer, Sgenerate_new_buffer, > + 1, 2, 0, > + doc: /* Create and return a buffer with a name based on NAME. > +Choose the buffer's name using `generate-new-buffer-name'. > + > +Optional second argument INHIBIT-BUFFER-HOOKS non-nil means to not run > +any buffer hooks ('kill-buffer-hook', 'buffer-list-update-hook' or > +'kill-buffer-query-functions') for this buffer. This argument should > +be set only for internal buffers that are never presented to users or > +passed on to other applications. */) Reading this thread, it seemed like everybody agreed that this patch (in itself) was a good change, and then the discussion turned to other ways of specifying "internal" Emacs buffers (that shouldn't have the hooks run as well, as double-spacing " *temp*", etc). The latter may be a nice addition, but the patch here is pretty much necessary for implementing something like that, so was there any reason the patch wasn't applied? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 05 03:06:07 2020 Received: (at 34765) by debbugs.gnu.org; 5 Sep 2020 07:06:07 +0000 Received: from localhost ([127.0.0.1]:41431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kESH0-0003ac-OE for submit@debbugs.gnu.org; Sat, 05 Sep 2020 03:06:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kESGz-0003a9-8z for 34765@debbugs.gnu.org; Sat, 05 Sep 2020 03:06:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59355) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kESGt-0007uv-2f; Sat, 05 Sep 2020 03:05:59 -0400 Received: from [176.228.60.248] (port=1954 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kESGs-0002iK-I4; Sat, 05 Sep 2020 03:05:58 -0400 Date: Sat, 05 Sep 2020 10:05:50 +0300 Message-Id: <83r1rgpusx.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-Reply-To: <87h7sp1xay.fsf@gnus.org> (message from Lars Ingebrigtsen on Wed, 26 Aug 2020 13:06:13 +0200) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Cc: Eli Zaretskii , 34765@debbugs.gnu.org, > alexanderm@web.de, monnier@IRO.UMontreal.CA > Date: Wed, 26 Aug 2020 13:06:13 +0200 > > martin rudalics writes: > > > I attach a preliminary patch. > > [...] > > > +DEFUN ("generate-new-buffer", Fgenerate_new_buffer, Sgenerate_new_buffer, > > + 1, 2, 0, > > + doc: /* Create and return a buffer with a name based on NAME. > > +Choose the buffer's name using `generate-new-buffer-name'. > > + > > +Optional second argument INHIBIT-BUFFER-HOOKS non-nil means to not run > > +any buffer hooks ('kill-buffer-hook', 'buffer-list-update-hook' or > > +'kill-buffer-query-functions') for this buffer. This argument should > > +be set only for internal buffers that are never presented to users or > > +passed on to other applications. */) > > Reading this thread, it seemed like everybody agreed that this patch (in > itself) was a good change, and then the discussion turned to other ways > of specifying "internal" Emacs buffers (that shouldn't have the hooks > run as well, as double-spacing " *temp*", etc). > > The latter may be a nice addition, but the patch here is pretty much > necessary for implementing something like that, so was there any reason > the patch wasn't applied? AFAIU, the patch was never finalized after the review comments. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 06 23:28:12 2020 Received: (at 34765) by debbugs.gnu.org; 7 Oct 2020 03:28:12 +0000 Received: from localhost ([127.0.0.1]:54680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQ07g-0004Tp-7O for submit@debbugs.gnu.org; Tue, 06 Oct 2020 23:28:12 -0400 Received: from quimby.gnus.org ([95.216.78.240]:39410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQ07e-0004TW-VO for 34765@debbugs.gnu.org; Tue, 06 Oct 2020 23:28:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xzHB9+peOGEDTZhWpFMz4LE1w18OHfqLkELt5rJuZnQ=; b=N8HBN52sDibM8Aar9LsZEv4F3U wEUMF3uEHv54a8yC35rjnGltjaeaCVpPPWkLldO1T1/Pz6uRmDjqMmUM+pIUTuCPY5rsFNFyfCzjz txTi32w5LSFnZHsig1Fa0Yw3CmySsYMUpebq+QTmn5S7pwkA4ofYj7EV5tCF/F2KYyWc=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQ07S-0000Zc-MM; Wed, 07 Oct 2020 05:28:02 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> X-Now-Playing: Spektrum's _Enter The Spektrum_: "Freefall" Date: Wed, 07 Oct 2020 05:27:57 +0200 In-Reply-To: <83r1rgpusx.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 05 Sep 2020 10:05:50 +0300") Message-ID: <87pn5u7m0y.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: >> The latter may be a nice addition, but the patch here is pretty much >> necessary for implementing something like that, so was there any reason >> the patch wasn't applied? > > AFAIU, the patch was [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> The latter may be a nice addition, but the patch here is pretty much >> necessary for implementing something like that, so was there any reason >> the patch wasn't applied? > > AFAIU, the patch was never finalized after the review comments. Right. Martin, did you finish up this patch? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 07 03:59:10 2020 Received: (at 34765) by debbugs.gnu.org; 7 Oct 2020 07:59:10 +0000 Received: from localhost ([127.0.0.1]:55126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQ4Lu-0005M2-1F for submit@debbugs.gnu.org; Wed, 07 Oct 2020 03:59:10 -0400 Received: from mout.gmx.net ([212.227.17.20]:46767) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQ4Lr-0005Lb-MF for 34765@debbugs.gnu.org; Wed, 07 Oct 2020 03:59:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1602057537; bh=cSxM7ViYiKR4uL/X9FNTqfSAe8GWt0e31tfXClIWaDA=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=UJyPxvTEHlFSPC/q07qPM6yYrY3xKRvGeJSZF4fQ+eYEfrWFES8NIHIvHInQD3Mos WBqVyoewoyHf9M2JdbglOQucYqJpRRsxlKuH1ux/QyHQOoeBrBlFdcOZzAhEms/0Sa Y/OJNDmb9Oz0ximbwrk5WmRlJ12DyRDdhhzuZdkw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([46.125.249.19]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MatVb-1kxUQU2paN-00cMxx; Wed, 07 Oct 2020 09:58:57 +0200 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: Lars Ingebrigtsen , Eli Zaretskii References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> From: martin rudalics Message-ID: <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> Date: Wed, 7 Oct 2020 09:58:55 +0200 MIME-Version: 1.0 In-Reply-To: <87pn5u7m0y.fsf@gnus.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:xEfrSmbeCabfhCQata13fcARzL0VaK33Fqqg5mLnHiiQo1crIIn IUi+5wpdeCPgyIxM5UAaHpAFuUge9paIlB8Vx60hyGjBfnVvjltsJb5pXQTgqmm5ru/wNM/ RlDtEvc8fNGhC4iZsuqJj0VpSHjvZJFc++DVXXZorT4eCCQL7S/w1c9AJGfJx++G35S/9NU +4r3o3vCEm33lBwvj8QIw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:1XGa0eq/jGs=:4W/EimE/bCoqAFmGl8SXCu 1DnAQ+GMX3JAE9a29/7r0Zhxq4DFcLZ/QJCd6H9bGbI5RzCWv8gH8zFJGfjqwPoHztRO/lyES Auc+huJE2x7R44mw+LT8xM402MOB/LEQIYmfe0RSo3xbEf6NJjJqCxOArrbiKCIucnEQBZedD GUp8lXDTcVfwL9shROxW6oBbGtYyDf/1/0ZK4AJb8QctGQE402xVxwhsk2JIWPS6+DWC4X53i ddIi5Nc4hsYxMe9KiZkRzEHZHUo369HBZxmIrPoEqjqRz+sa28BpgRdMslLzjKPUhJU7J2B3l bCcsVMg+ZgxSpm9eHiWbqPu6SCwi2TwI208oAhbQOl7Ie0q/EQ1cJGzCOnEAF4GSzlkFrdCQG 97h/daf/Ne77/hvtXRBiHC9G6gnYJOT6v0HXb4WzmPjbA018u5fkKrFqRFGgYked2gDqC50/D RT3K9MTVJdp6vxMvtVaX4/KV4etOvhZexgH9KK0kup99m6aRAlMhIzdEJhw16uJU2tQ9jRin0 YVpScd9W3YInPD2ibFiJX8JtoZbdmi1UrAtsrJICqmCVeEnqQoz3lJXkr8OyYMJ5F6MrvxEzv IpS0C70nv4VaFwZLxfEQy6t9QQB4cy+Ts3mJZeQ3hI36xD47dka4LR3y9p0pRAAiSaCQSwJM6 E3h/RjNh1ZMVqL4Kq4Gl+F+i9ZNaeAotPVT9iFs4DP46k+cKzhaBcscq9piFLLm9C87wDXPN8 1yQ2Vj5v5f9Lmi5H4/5+yG+tnso52ENeDk3rT5VFCioOT9i2Y0EfPsJ/jWvPeW33I5VJqvMr4 4RsW6egU+fdHCizq66iV9RO86Ii6RZG3gpXidKQ3mSITh+Z1B22l0PIigSIvQ+DY2XEIm5Zcg GWEVfCgSK1oOhwowq2sbRcFYU6MLG6kMSCmhAV0sOZdCeflgJ8Y4u6JOyGkOKnI+u0qMIhTLY LlF+FNNkRy59I1eENROFkg+/QrUxgRpdISWQizFU/I4DEW9JPJH4dSDIkVVFX5vgxaWRmSBAa f3Zfc9vIE9kJRq+E5laxv+alyHEaxQlOWS5aB14akKqrKBc2y9VXU/SaqH/+xWiHZ1JbzSZfF iXl9zcaLzV/qrNaN97vIxm/fgqkz25BgfK+ptkAiIZ8ErYuRHwjJWpQR6n/gaBMRIX3PDNXX6 YOHCViBUTLrW2Cp6toywKaztajRztRMtBbp17Q2LW2QpNjXa/Td4ueJTsgVRd5l8HL53n+CCh ju+kBzK/f1bLvcKp2 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> The latter may be a nice addition, but the patch here is pretty much >>> necessary for implementing something like that, so was there any reason >>> the patch wasn't applied? >> >> AFAIU, the patch was never finalized after the review comments. > > Right. Martin, did you finish up this patch? No. IIRC some issues were never resolved and Basil also wanted to add something. If you can make heads or tails of it ... martin From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 29 16:03:52 2020 Received: (at 34765) by debbugs.gnu.org; 29 Nov 2020 21:03:53 +0000 Received: from localhost ([127.0.0.1]:52760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjTrM-0000Kl-Ou for submit@debbugs.gnu.org; Sun, 29 Nov 2020 16:03:52 -0500 Received: from mail-wm1-f45.google.com ([209.85.128.45]:38781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjTrL-0000KW-0e for 34765@debbugs.gnu.org; Sun, 29 Nov 2020 16:03:51 -0500 Received: by mail-wm1-f45.google.com with SMTP id g185so11056927wmf.3 for <34765@debbugs.gnu.org>; Sun, 29 Nov 2020 13:03:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Tn14tOjQZZj/ie+KlAaL5BEVpgqr0zIhbQ+r8sgZhsc=; b=Cf9i4Ck53lseW1oN8LHhuK+B7NZFYTExAkV1/SebVE9O9Dm5tisnse5husWhgcLl0m 0QlFyiQ7K7HWYj7jg+AlAa9VOksaOO3na1L6fJzgVf5nSUOx5PACceGhfeYcj+JNHv3z c1SzecwwgPOvOEPuFC17H5Wm5DazKYWNrm87fzXySQngov2OebnSaH+xziL6XuByPyie 2XisL0kxGhJBuwq007Kb/6enNAWhoP3iAMNAtMK6I0K7iZMbLyvnhYgBncraM+ikcMIJ BWrfuCoJivwyd/ynRU/Ghb6W+uVgBAfvGOFCR4N7jUQpUePA6zKOjKn01xvUk3m/NK0H S+Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Tn14tOjQZZj/ie+KlAaL5BEVpgqr0zIhbQ+r8sgZhsc=; b=hgM9zJrhUoan5T7V44jHcnyM2hb1idOn6SWQzJPmODoyt1VmiIS+zdKaQwwnWykIbe +O9SXdxI+vdl07Qem0O8QDa3gHhz115QGxoQipprSdNgAZlBcyGSU/Y0rnngN9YmO3iz vhvZL5xFD5bM2usupdVeLjGy8qvWc1uSBwT5gzVXLOcad9t7BUBCTxef5cped5WvGOFw VgwXMskDvjnEVHC9ARj76hmz2q+cy7OcMXb6GDcXtlEZkPF7qw5+VmMiYG2yroECVQdx xH6sHVY/WUkefJF3OMD2oG+URteNaYhanbOuN3DkTg62JVvv4tbyqUSiZ+pQ27qbewtm Gl0w== X-Gm-Message-State: AOAM530Zn/4U/YS3zH43WUNzx4igpy5QyYyDzNLciJmdtBQra2bzSF/Y s0pXr7aJ5Gx6nUgWZyav3KbS5g== X-Google-Smtp-Source: ABdhPJwgHEueggB7vd5qFCJPrKOF5143GK4Ty3zUXz/cFG5f87Ps+iLgkLVfi1/EaOFH1VFskbwMUQ== X-Received: by 2002:a1c:2d47:: with SMTP id t68mr20260697wmt.148.1606683825031; Sun, 29 Nov 2020 13:03:45 -0800 (PST) Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id n10sm24079633wrv.77.2020.11.29.13.03.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2020 13:03:44 -0800 (PST) From: "Basil L. Contovounesios" To: martin rudalics Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> Date: Sun, 29 Nov 2020 21:03:43 +0000 In-Reply-To: <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> (martin rudalics's message of "Wed, 7 Oct 2020 09:58:55 +0200") Message-ID: <87a6uzan9s.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Lars Ingebrigtsen , Eli Zaretskii , monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) martin rudalics writes: >>>> The latter may be a nice addition, but the patch here is pretty much >>>> necessary for implementing something like that, so was there any reason >>>> the patch wasn't applied? >>> >>> AFAIU, the patch was never finalized after the review comments. >> >> Right. Martin, did you finish up this patch? > > No. IIRC some issues were never resolved and Basil also wanted to add > something. Did I? AFAICT I was only pointing out the trivial simplification of Fgenerate_new_buffer_name + Fget_buffer_create = Fgenerate_new_buffer once Fgenerate_new_buffer can be called from C. I was otherwise happy with the patch and either of the proposed approaches to setting inhibit_buffer_hooks. > If you can make heads or tails of it ... Depends: is it an animal or a coin? -- Basil From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 30 04:06:12 2020 Received: (at 34765) by debbugs.gnu.org; 30 Nov 2020 09:06:12 +0000 Received: from localhost ([127.0.0.1]:53418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjf8O-0005it-Aw for submit@debbugs.gnu.org; Mon, 30 Nov 2020 04:06:12 -0500 Received: from mout.gmx.net ([212.227.15.15]:54993) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjf8M-0005iO-Oi for 34765@debbugs.gnu.org; Mon, 30 Nov 2020 04:06:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606727161; bh=GEsa4am5iIGfqw5+mAOhNvTG2gbZ2bQmUQF7hpOgFho=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=hZOEPSPVBV6EBFU3VttWm7WcL0yPQSCkEq+e3KFU/2/SVKMbFq8N9cYTssHdBWvk1 N1+hPwGmL2Npg5SqQvgcDQDH7HEpyXNfGOVcgrNCKWrOVjigeLAijCksS3hkiKFXvS u2IV6hGbYfd4ni16TFiT7vLbGviTVOyCtNX5Y9y4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.100] ([212.95.5.17]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N5G9n-1k0jNM10Sb-01191w; Mon, 30 Nov 2020 10:06:01 +0100 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: "Basil L. Contovounesios" References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> From: martin rudalics Message-ID: <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> Date: Mon, 30 Nov 2020 10:05:59 +0100 MIME-Version: 1.0 In-Reply-To: <87a6uzan9s.fsf@tcd.ie> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:NZAyjKnRJRZUgk+partmFslXDdC4OrikL+OgtPWySL3FuKEfyEC QzdeYpqnRv8KyV+QYbAE2pi3kpuW/D4jNJXAbehl32aXCOeNfJ2e9XMMRQ37c8M4Kjp6VnJ dnuKHgKSKBUy6qOyTSq2N/Kb532nxMhz9OFQpVucN40CUBl+v/khqDnqImZLMAHJKb5s1LP FaeoN+3A5QYkRhIMo8uZg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:IZ+8dOQOBBE=:ewSmmNpUSC4QgnWCMkFDIi LjeI2A99tttHLhAfdrG7pAd27jMFrm0C5Zu6Wu/BPerrERAvVIjyUoYccCRksWPH3ca6u2nCE gXscI3Mkh82KGUwNBUmduaua/C4AITyqFkLKst1cjyLVv7JyrGUoKfPEOerNdEyJ/FAUPQsIR BajDi+aF3MmGoaVSDJIWbhH/PTyG10g7370J5SDJ4CAvcg/Ho1hZSlWlDzpaa/u5j3swi4CBz afdAGg/hb2YYWzZjTW/SCfbhaNPhF4+irxPedWJnBUM9OvhDh9WyY4fg6gb357Lu79izTSlmo tKXuXoHNOWCdKqwxiwa8nNgXwIClEa1YsBIEDFXJ/Y9dmZi4lkpOxi9q5K28TRscB4eCR5V5b aA+JDPrj52nArAIkAx6iGv0HJ1kC8LcS1+/R641Nazm9lXB4oKmng3I/B09XCC8usTvj7DXQ2 1IhyfkOdy8qNejA7xW9w8OPRk/KDQVePt0mP6Uen8UjYSBwrl0fUBsCVZCeQN4eHiIIGv3BE/ b70BZsb+6jgKr9V0zlZIA4eMQwbphhNM0Nfd24tXV/xAoEqzaap6uHtJBGykjIZi8S0+raRWM KSaN4kYu+eXxMLx9F2LIzA7voiB2Kd5tNIt7qdwyrQZnQkidhDpfZ+FSxCdTvbwdsNzRxhQ2H ZAWZ1QqhjvyvwmYcE06xLvS8nPH7vubykQkF1bcRFkwzK2zOOxSnywmOSM14FRcQwfBG0iAHp xa/ashGgRL55+Ql2guSQDDX6KL7YFoC748zXlJ4yRtpvhUpK34eRK979fO/vnRWHoVwvqG+fx CQAvTbaA/pziFu6840fvT1kTqkikTUxOSEDCOQQNBCE1OMT2dxt8F3G9osXr/R9lQXXimTPaM Eq85Xsn1sjp0CLmhM6PQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Lars Ingebrigtsen , Eli Zaretskii , monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>>> The latter may be a nice addition, but the patch here is pretty much >>>>> necessary for implementing something like that, so was there any reason >>>>> the patch wasn't applied? >>>> >>>> AFAIU, the patch was never finalized after the review comments. >>> >>> Right. Martin, did you finish up this patch? >> >> No. IIRC some issues were never resolved and Basil also wanted to add >> something. > > Did I? AFAICT I was only pointing out the trivial simplification of > Fgenerate_new_buffer_name + Fget_buffer_create = Fgenerate_new_buffer > once Fgenerate_new_buffer can be called from C. > > I was otherwise happy with the patch and either of the proposed > approaches to setting inhibit_buffer_hooks. > >> If you can make heads or tails of it ... > > Depends: is it an animal or a coin? Both, probably. If you think that patch is of some use, please try to polish it up and push it. Honestly, I've forgotten all about it. And also tell us why 'buffer-list-update-hook' would be still needed now that we have 'window-selection-change-functions'. Thanks, martin From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 30 13:07:22 2020 Received: (at 34765) by debbugs.gnu.org; 30 Nov 2020 18:07:22 +0000 Received: from localhost ([127.0.0.1]:56613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjna6-0006o1-DJ for submit@debbugs.gnu.org; Mon, 30 Nov 2020 13:07:22 -0500 Received: from mail-wm1-f51.google.com ([209.85.128.51]:54467) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjna4-0006no-Nx for 34765@debbugs.gnu.org; Mon, 30 Nov 2020 13:07:21 -0500 Received: by mail-wm1-f51.google.com with SMTP id d3so123657wmb.4 for <34765@debbugs.gnu.org>; Mon, 30 Nov 2020 10:07:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=jGGRbrJ4foQX7CCYQMc9g7j8uh3xnhZIDFfKiwNPMaU=; b=yFdsnkliy7cCDK24OOYQVaEdQN+uABOG9uP6sAwGWoMyJ27hFTjU4yewZTueCPqeNX W4gVT8tcLLmTPlNx2U352VQ9nyrCfxxOpEKBZFXlVWmVO2pJYJrMp2ZyV/v76uSgng0g cmzJYEAYSYABefdCUasj4RoY97SdqznuDfWdD43S08dDslMMbEaJ0egMrevBZinehcPa ARNbsY6/zi7pxaoe3zD2uHrI0AAk4LHtYJela5be3/GeP7dDDu96uLb756HK3emGKsnq 7L06R0K2zoHuO0fGcmyrOxyemevJ1v011fkiuapFybQEDBtHlZduDdGLtD9r81cg5KYP /7iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=jGGRbrJ4foQX7CCYQMc9g7j8uh3xnhZIDFfKiwNPMaU=; b=qk425HqPnXMUEF8kPCas4SO3vpoboSb5Wd/Y5onEK6IbuHhOHWUBmZ9aoeDL++mMBx nsWEAWld0CTA3S8NGq70ziH3a3cXwnQFtlzoUc3pnBKB3vc8Hc1a3wVGGdI8XOUaZCxQ OXrdloP3RFlLx0kxvYh8/p6dna1ebU859Vd7oixwpQ/7noOBndwIG5/NekXHjs3F1Vg9 Q85IMJ2Y8XcTRrtOMGWv0bPlXss0C9GnonjESWdq5faWI2VzeVIJX3uzIzRCqcuPS19t nAhpuf4toZwZvLKXvrm4IAdmdrQosGrfPU1qjz6DfNboDIcu4e55+MGGarE+AUT2JafC Owmg== X-Gm-Message-State: AOAM5321tfvpC+NzsUhL9kmZU2gj3HIvcIhePDy+3bBVVGDR2XTG7hVk vgYxrwHcfl/NKi+toYRzTYvdbg== X-Google-Smtp-Source: ABdhPJxlTv0YEtAgyDzPYO/h304uk6snEZr3ojR8XAo1nRnCSswgbqNGhB6PGC+82lZ5EL7SNMqEVA== X-Received: by 2002:a1c:44d4:: with SMTP id r203mr57568wma.60.1606759634829; Mon, 30 Nov 2020 10:07:14 -0800 (PST) Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id y130sm127654wmc.22.2020.11.30.10.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2020 10:07:13 -0800 (PST) From: "Basil L. Contovounesios" To: martin rudalics Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> Date: Mon, 30 Nov 2020 18:07:12 +0000 In-Reply-To: <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> (martin rudalics's message of "Mon, 30 Nov 2020 10:05:59 +0100") Message-ID: <87lfeioh0v.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Lars Ingebrigtsen , Eli Zaretskii , monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) martin rudalics writes: > If you think that patch is of some use, please try to > polish it up and push it. Honestly, I've forgotten all about it. Sure, I'll give it a go. I'm slightly confused about the conclusion of this thread, though. You and Eli said it was too radical to set inhibit_buffer_hooks based on whether a buffer name starts with a space, as there may be legitimate cases where those hooks should run in a temporary buffer. I accept this, but I don't see how setting inhibit_buffer_hooks based on a new optional argument to Fgenerate_new_buffer (and/or Fget_buffer_create) solves the problem entirely. If I create a temporary buffer with the proposed (generate-new-buffer "foo" t) then how do I later tell Emacs that this buffer's hooks should run? In other words, can we be sure that the buffers we choose to create with inhibit_buffer_hooks set will *never* need to later unset it? Should we expose a getter or setter for this buffer member, or is that opening ourselves up to abuse? I suppose if someone *really* wanted to un-temporarify a buffer with inhibit_buffer_hooks set, they could create a new, non-temporary buffer and swap buffer contents, or something to that effect? Am I wildly misunderstanding something here? > And also tell us why 'buffer-list-update-hook' would be still needed now > that we have 'window-selection-change-functions'. I've yet to look into these hooks and their precise semantics, but are you suggesting that one might obsolete the other, in which case we should deprecate the old one? Thanks, -- Basil From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 30 14:02:02 2020 Received: (at 34765) by debbugs.gnu.org; 30 Nov 2020 19:02:02 +0000 Received: from localhost ([127.0.0.1]:56666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjoR0-0008Jk-Ie for submit@debbugs.gnu.org; Mon, 30 Nov 2020 14:02:02 -0500 Received: from mout.gmx.net ([212.227.17.21]:48615) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjoQy-0008JE-7C for 34765@debbugs.gnu.org; Mon, 30 Nov 2020 14:02:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606762910; bh=duReucDFI/xRxrxfPhmhVeB5b1C5ERqCA4wrDA7DdPM=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=lClxIA98Q4xRmTm+tddsI5B3bOWcoa6X7tT6KTcQmbhRImn7C2xZaati/uzCQnGc9 8FjwTn1XjBgNW59JNZhXro9/DkLdHEMDBLdfjmHfjuZQ74EaTMjg/KTW2kK4viEZWV TZQLKCoN1SqXhfGGkkz9/eXY/tovrKb2NX7rjNQM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([46.125.249.88]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MOiHf-1kXx0T2Nw7-00QFMF; Mon, 30 Nov 2020 20:01:50 +0100 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: "Basil L. Contovounesios" References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> From: martin rudalics Message-ID: Date: Mon, 30 Nov 2020 20:01:48 +0100 MIME-Version: 1.0 In-Reply-To: <87lfeioh0v.fsf@tcd.ie> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:jm/Sx6NDGwTR0kBpDMgR/zVC0NjKxby7qEOzx5Aal2OBA1xb76Q FZmNFZSOljGo+cdQUidGTMtcCZaBGdD0p3wbtpdIz1Ru1qJ2j1nvKOezih6GGoC7m82TfwO +4CfsyGccmcdxd9e7MCnGr5P882SFTLlyOkUxW4SXnZvvwLdD6bQOX0nTIhdSppmh94HsYi sR7axDPJpNQeg4CIYozFg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:sHgGe7k8YOk=:rNfEnXdbo3jWv5X2pxk3VI pYLaAVT6D6AHTS/1MVRoEYdHqk5UEnsgUM6tlUApgf54UpJfZvW+ytAwgUC7eABR9HB7O9kHb KEnPTHTauQZrKnFQ8mguGOR4S1rasazKd4AkxqURsPLuHQo+LxsecU6ZVDJjBLph0Gv982DXO iKRMvN5GJQnfVkAJzWTj7dDq6xIsnF0jNptcM/AaE730WKVJCialw5C3Tm29ZCEOUNKgmdG6D tqATk0NNHYSiCsSCfpU3GQJggz/6eUm3rWcSElfOtBNt5lr2mFqMae07P1BnueqeaZWKQw3lB SFhZcKcwGjwDsGG4BgTf6wCM90b+LbecxObbDyXJfphFJYGHK3857drRWrq4xuf+g4zGjXGan PrhgvMyfFuWc5+zGcmnAfBab2qkhVLVp3y9cOB0U5VFVhfw6yNbDv+nKd5j+yFP8BYjpAW+u2 uzhX9DR0jouoklzk1qu3cM9eu5TEICpEf3iLfpdws0QYqfv3cT+K75aFtJB0w0tZWQ2hmCmsY hWVkr6wJM1dxoceFUb+Rumj4j4COwaTJsVT1ps0759PwFxhc6bcdhKrgQSrIX2q+VhCEi0P5F kTqvT2627D8DyO0AMRtkCbbbyIpGqQh7i3OvyCYx4lrqrEF/2HyH1MNzzdgxXBm2gKTp9qpg2 68NX7KkOqr4yPnXfGn7B++Fr0Qtupel/q/eU9XkWs4JD9TTIwd9CVGsjSR+0pCDPGVPF65ix0 VMEicfTrFjde/T7I+cFtX/zGQWgzKefOvWC2MzUkISuOibvGd7KXAW4j7YszvnKwytyau974m ulAzJQxbkvIhj23YjeiyfBif5IYid/Yujc3q4hkqZIY0BE8AzmkMwi+0APqM5y5SPh8su2/JU kic06fKY54yRNcElyEJA== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Lars Ingebrigtsen , Eli Zaretskii , monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > I'm slightly confused about the conclusion of this thread, though. > You and Eli said it was too radical to set inhibit_buffer_hooks based > on whether a buffer name starts with a space, as there may be legitimate > cases where those hooks should run in a temporary buffer. Yes. > I accept this, but I don't see how setting inhibit_buffer_hooks based on > a new optional argument to Fgenerate_new_buffer (and/or > Fget_buffer_create) solves the problem entirely. > > If I create a temporary buffer with the proposed > > (generate-new-buffer "foo" t) > > then how do I later tell Emacs that this buffer's hooks should run? > > In other words, can we be sure that the buffers we choose to create with > inhibit_buffer_hooks set will *never* need to later unset it? > > Should we expose a getter or setter for this buffer member, or is that > opening ourselves up to abuse? I'm not sure. But if we do that, we can get rid of the rest: We'd just generate the new buffer and set/reset its hook inhibitor afterwards. > I suppose if someone *really* wanted to un-temporarify a buffer with > inhibit_buffer_hooks set, they could create a new, non-temporary buffer > and swap buffer contents, or something to that effect? Admittedly clumsy. > Am I wildly misunderstanding something here? I don't think so. >> And also tell us why 'buffer-list-update-hook' would be still needed now >> that we have 'window-selection-change-functions'. > > I've yet to look into these hooks and their precise semantics, but are > you suggesting that one might obsolete the other, in which case we > should deprecate the old one? People usually don't care about the buffer lists, they always wanted to run a hook when a window got selected in a more permanent fashion. At the time of adding 'buffer-list-update-hook', I thought that it fulfilled some of the criteria wanted for a 'select-window-hook' and added text in that sense to the manual. So if you care about the buffer lists, 'buffer-list-update-hook' is the one to use. If you care about window selection, 'window-selection-change-functions' is the one. martin From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 30 14:43:07 2020 Received: (at 34765) by debbugs.gnu.org; 30 Nov 2020 19:43:07 +0000 Received: from localhost ([127.0.0.1]:56733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjp4k-0000us-Mq for submit@debbugs.gnu.org; Mon, 30 Nov 2020 14:43:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjp4j-0000uP-7V for 34765@debbugs.gnu.org; Mon, 30 Nov 2020 14:43:05 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35590) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjp4c-0003pJ-QK; Mon, 30 Nov 2020 14:42:58 -0500 Received: from [176.228.60.248] (port=3467 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kjp4c-0001Sc-4K; Mon, 30 Nov 2020 14:42:58 -0500 Date: Mon, 30 Nov 2020 21:42:50 +0200 Message-Id: <83tut6iqbp.fsf@gnu.org> From: Eli Zaretskii To: "Basil L. Contovounesios" In-Reply-To: <87lfeioh0v.fsf@tcd.ie> (contovob@tcd.ie) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, larsi@gnus.org, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: "Basil L. Contovounesios" > Cc: Lars Ingebrigtsen , Eli Zaretskii , > 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA > Date: Mon, 30 Nov 2020 18:07:12 +0000 > > I'm slightly confused about the conclusion of this thread, though. > You and Eli said it was too radical to set inhibit_buffer_hooks based > on whether a buffer name starts with a space, as there may be legitimate > cases where those hooks should run in a temporary buffer. > > I accept this, but I don't see how setting inhibit_buffer_hooks based on > a new optional argument to Fgenerate_new_buffer (and/or > Fget_buffer_create) solves the problem entirely. > > If I create a temporary buffer with the proposed > > (generate-new-buffer "foo" t) > > then how do I later tell Emacs that this buffer's hooks should run? The assumption is that you don't want to. Recall that the original idea was to turn the hooks off unconditionally based on the buffer's name. The above is a less drastic measure: it allows the code which creates the buffer to request that regardless of the name. But the original motivation, that there are buffers where we want to never run the hooks, is still valid. > In other words, can we be sure that the buffers we choose to create with > inhibit_buffer_hooks set will *never* need to later unset it? We didn't see examples of such buffers, so we pretend they don't exist. > Should we expose a getter or setter for this buffer member Not until someone comes up crying that this is needed, and presents a convincing use case, IMO. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 30 15:33:11 2020 Received: (at 34765) by debbugs.gnu.org; 30 Nov 2020 20:33:11 +0000 Received: from localhost ([127.0.0.1]:56816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjprD-0002AQ-5b for submit@debbugs.gnu.org; Mon, 30 Nov 2020 15:33:11 -0500 Received: from mail-wr1-f47.google.com ([209.85.221.47]:43473) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjprB-0002AE-VA for 34765@debbugs.gnu.org; Mon, 30 Nov 2020 15:33:10 -0500 Received: by mail-wr1-f47.google.com with SMTP id s8so18004415wrw.10 for <34765@debbugs.gnu.org>; Mon, 30 Nov 2020 12:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=490vGAAVbqNxynY78hXIMsOWIVb61vo+FTF1SuNxmqA=; b=iZhinfPSwwMCIzu6O8vmYtzh0RsbDa4PbGshi6GzP0UZO8nRZxrp6p/rWMVJxbo5GS PYWWmLJ3sCDQQJ4FMQUOl9SCZ1fRd6YuXqEZ0f3VetrWuMlsF0G4G/NpxLdmtpARyxHt xX3u6FutQvg4UiROEW/qSYYwNNiRQalCO7RMSpxazrI5RromIGqWQFc6gZzddWf2B0Sd ytcn01jWzJw6vaHEQMIPOaRy8noghHpVT1JBwBsHUHS3O+PItqzUwMD6HcQZepGB0DjS 6vKnHOEZe7t5wYSVjDjglVK6KOubk/HsbhFusNKRtK6t/dmxLZ1oCYtH+A7CVXsubwtS tDTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=490vGAAVbqNxynY78hXIMsOWIVb61vo+FTF1SuNxmqA=; b=MiU0qshlDvaU3GuUq4KJ9AQ6IfIfYMtUDu7n9iez5ptZLw9kxAyBQg+B/saDfSbYD7 PPg+I6zNUY1yEJwXUhusWheoH9ex+T1SkEHEPKpTVJt71Mmywa7/xtoBsIW2VYVJ4dzO /uGihx/NAJCHT0k9bZobQ+whiWD5NsDXMg0l6046W5wJ0Evo+xywxiAXMYuM+TPCeigh rBBCh2nstdltJ1qSX0dLV3h5cooMhRURnGm3oE6T86RBak7L14c+o5neNfIR+C+YSeDG zEIx+v56rRolnPD/WLNCdI/JML8xkNqGinNHTapb5Myn49J1HCxbFn3VIab8krxxF8yx pGpw== X-Gm-Message-State: AOAM533UMk0zVorxbcrxRh9XF0llGMoYR7/N5S1h+mb81ckXliPvLlK0 iVzzRHcBEZYa3CbwrAHePnbsEA== X-Google-Smtp-Source: ABdhPJzk4EV7fKMyh+lmumLqJy+z4vc7wWbxa6EaOIfj+72JazmBOYIWCrRT09v858D9bnnuj72M+w== X-Received: by 2002:a5d:668c:: with SMTP id l12mr5369575wru.334.1606768383983; Mon, 30 Nov 2020 12:33:03 -0800 (PST) Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id o2sm19176771wrq.37.2020.11.30.12.33.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2020 12:33:02 -0800 (PST) From: "Basil L. Contovounesios" To: martin rudalics Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> Date: Mon, 30 Nov 2020 20:33:01 +0000 In-Reply-To: (martin rudalics's message of "Mon, 30 Nov 2020 20:01:48 +0100") Message-ID: <87a6uyoa9u.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Lars Ingebrigtsen , Eli Zaretskii , monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) martin rudalics writes: >> Should we expose a getter or setter for this buffer member, or is that >> opening ourselves up to abuse? > > I'm not sure. But if we do that, we can get rid of the rest: We'd just > generate the new buffer and set/reset its hook inhibitor afterwards. Not necessarily, because Fget_buffer_create still has to run the hook before returning the buffer. >>> And also tell us why 'buffer-list-update-hook' would be still needed now >>> that we have 'window-selection-change-functions'. >> >> I've yet to look into these hooks and their precise semantics, but are >> you suggesting that one might obsolete the other, in which case we >> should deprecate the old one? > > People usually don't care about the buffer lists, they always wanted to > run a hook when a window got selected in a more permanent fashion. At > the time of adding 'buffer-list-update-hook', I thought that it > fulfilled some of the criteria wanted for a 'select-window-hook' and > added text in that sense to the manual. So if you care about the buffer > lists, 'buffer-list-update-hook' is the one to use. If you care about > window selection, 'window-selection-change-functions' is the one. Thanks, then it sounds to me like there's nothing to be done, other than recommend the right hook for the right job. Right? -- Basil From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 30 15:35:04 2020 Received: (at 34765) by debbugs.gnu.org; 30 Nov 2020 20:35:04 +0000 Received: from localhost ([127.0.0.1]:56820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjpt2-0002Df-Gr for submit@debbugs.gnu.org; Mon, 30 Nov 2020 15:35:04 -0500 Received: from mail-wm1-f49.google.com ([209.85.128.49]:37121) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjpt0-0002D7-Qy for 34765@debbugs.gnu.org; Mon, 30 Nov 2020 15:35:03 -0500 Received: by mail-wm1-f49.google.com with SMTP id h21so1067267wmb.2 for <34765@debbugs.gnu.org>; Mon, 30 Nov 2020 12:35:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=mzUNwvzk7rX1a+3mO1m4ACyrBSYnx7/2D5djIzZBpyE=; b=z7/TBK5/UEUM6L+uIiwSZgJCLskTbiHaREvxI71aRZS81Mjk1YEup4aCxW2BwHetfB JsnSwge2Xnf+DxGt5TC4czOOj6/YAre/5WbMeKjYoNwMD8mKuTDyvyPZy0QpdN179Vzw +dH4Ul/Le/CledfqgAvKRdQGNLj3o/4KvdTIZrnvtB3Wu5KDl5/z2Jnclk5YIAuX3gqU IHd8rSChErDzLe8bO9ABcoX0B/Wylgq4FpCq9QbGVNjJsn1yQS0aoK4WEtiao7B+dLrV K2Gd+sxz3gDNl8/8nxfzTxFa6r5SlLyZOiMxcoLvWrMbBVqMiol6EXbZRVSqwcDlLZUG vkJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=mzUNwvzk7rX1a+3mO1m4ACyrBSYnx7/2D5djIzZBpyE=; b=VQ+NhsX2v94ARkagq0IHUaDRVUHFGaDNAGRACvNYZaYH89Q+M2fUqZ0lFz2cm74vNL 8kIncnwRAcWUVjN90vniHSdDq5FwDBGyhkIdHwbKzdXdfw/fXNV8pu7TqKO6z7skFNb3 n+7Mh6M+K2iSrdAVPMmrQeXVfbI7w0NE9T30s/JLZ80N6O+KWs8zVHA2Efu8YeKYqRZK iIAZ5XX4450ZCK7wbf7jBLzpVAc4Ly/tDvp6wx6SKjQrgFbS77bFnwtW/jMNgtI15KED nxV0HJbI6wQbTMA37jhs5zKc1oadZcttEWrvTrLwvIaZYUnYj1hUuwzLUE3YbBRkfRjU BsGg== X-Gm-Message-State: AOAM532Q2akVJijyorF7O53kMULjFTbb0z6VuNmkhwypZJWaGuU6+rHl NCic37yUmlrzDm2vzVWq8SFSFg== X-Google-Smtp-Source: ABdhPJw6dZwXCfx7GDeELFo+CoiqHmcLibYtujWo5B3YECXFXX0uluDHUK4TrjeVWIPV2ZYplwW/XA== X-Received: by 2002:a1c:1bcd:: with SMTP id b196mr540340wmb.70.1606768497099; Mon, 30 Nov 2020 12:34:57 -0800 (PST) Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id v20sm528217wml.34.2020.11.30.12.34.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2020 12:34:56 -0800 (PST) From: "Basil L. Contovounesios" To: Eli Zaretskii Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> Date: Mon, 30 Nov 2020 20:34:55 +0000 In-Reply-To: <83tut6iqbp.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 30 Nov 2020 21:42:50 +0200") Message-ID: <87360qoa6o.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, larsi@gnus.org, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: "Basil L. Contovounesios" >> Cc: Lars Ingebrigtsen , Eli Zaretskii , >> 34765@debbugs.gnu.org, alexanderm@web.de, monnier@IRO.UMontreal.CA >> Date: Mon, 30 Nov 2020 18:07:12 +0000 >> >> If I create a temporary buffer with the proposed >> >> (generate-new-buffer "foo" t) >> >> then how do I later tell Emacs that this buffer's hooks should run? > > The assumption is that you don't want to. Recall that the original > idea was to turn the hooks off unconditionally based on the buffer's > name. The above is a less drastic measure: it allows the code which > creates the buffer to request that regardless of the name. But the > original motivation, that there are buffers where we want to never run > the hooks, is still valid. > >> In other words, can we be sure that the buffers we choose to create with >> inhibit_buffer_hooks set will *never* need to later unset it? > > We didn't see examples of such buffers, so we pretend they don't > exist. > >> Should we expose a getter or setter for this buffer member > > Not until someone comes up crying that this is needed, and presents a > convincing use case, IMO. WFM. I'll finish up Martin's patch with some docs then. Thanks, -- Basil From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 01 04:34:20 2020 Received: (at 34765) by debbugs.gnu.org; 1 Dec 2020 09:34:20 +0000 Received: from localhost ([127.0.0.1]:57837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kk239-0006fj-UN for submit@debbugs.gnu.org; Tue, 01 Dec 2020 04:34:20 -0500 Received: from mout.gmx.net ([212.227.17.21]:59743) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kk238-0006fU-Pc for 34765@debbugs.gnu.org; Tue, 01 Dec 2020 04:34:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606815248; bh=QfJO0hU3NwPIfRU3swG9wjpcxJV05OnUREoA1ti+CTY=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=l8MZPyS7CkiTN1gXcMF9klWcy74PJEvA6+yhnHy+82FnJG584BqD5D7w8IWhz5r/W x8oZB5NVI4Ne6iW1KUxY+qhy+aksuBBH38MBVlB7NoYW4nKnjfnoIOsEs5Cn9KbZsS OJmxygnE3f3WzS31BFEcZdGbw46X6VDaMwhcP1cY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.100] ([212.95.5.163]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MCbIx-1ksadX1o5j-009d2B; Tue, 01 Dec 2020 10:34:08 +0100 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: "Basil L. Contovounesios" References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <87a6uyoa9u.fsf@tcd.ie> From: martin rudalics Message-ID: <52733034-82a1-377d-beae-8e135da0fb2c@gmx.at> Date: Tue, 1 Dec 2020 10:34:06 +0100 MIME-Version: 1.0 In-Reply-To: <87a6uyoa9u.fsf@tcd.ie> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:GQOluMqaCSJ4467JF2BDUOMO58WJMef8UP1+meGmIkGFCPttIFE DXvOimiu3jvcJ1neA9sapg9mU6uY7YwGY2AULLceUoobCFl6WNVpIBkyhj7NWAEqcV3B3Nv sPmuImuZ+QMMM0OCC8/gMcXQIG8UyPuMUdTtX3jL2ZzlU6Cy5JPfXs+Z1BYljKQMRdOX2r4 SfxcVNOR/E6mzrqUnozIA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:QLsNu2eHfC0=:ptUdCZJB4Fo53uF9U/sjMu FIqtwNauTqdLRVabvU7wKjKU/iTNzJ1rT1OX7yl2rI6Uu4cRlfh+9uSaHjsCRkdfimA8T9mSE 6V7EPgT1gwl2dJBX89hTN4p93mNdOSrT+9nxvStP1mX5JMqygvXyx5zy3mTsMUj+Mt2Gr0cAd eTTPFpDm5AaI9p8KiUrWKc8k11VUKDc3BjwivU4hHQbAlpEUP0Lv3fvydzsMrUR0HOcrTOzJv xG1PWjVHm07/zi8bHLC/S56VJ6DQdUh/ljFj6SftbL83RzsfXFjKkyEYV9m1fmkK/iOY9r2cg YDygGsjZLuP5VA/8gtZ9DtrrxOLx6pMUqI5C6HN9btYIzZLr2McH7/ly3TO6U0bp0RabPYf2B FIRe5tVohxSZmBRpmooAGFkak9IvkMXq77RzckXzMdqpxw4vLMm2wSsf/tCYZNSs5RHLsmg/y b3A+EETSvnbE5Nsq8Z+GyIJRDoc7Y9asgIO62XiZLtcRj5nczM16dc0SFMQf8I5TwrJPJfa0I gyIaKNF1OS9ShApF46lqpg7DdQuE20jxMLiAWjYEomZwUu0hPI8lmHJDmRTDqVb6Bu5zqOqqs IPIWh5a65x8EqsR0VHAyjnnUfRZ1fkX/TJAwKbtYFBBXVnlA4di06TEAaJrcCTGIsedtvJG9i OmUWih1WtWzG7D0hmFr0rw/GtcKccXCtWccueZRqKMKZCVxAIwzB7CQEkxdx5OAhAimPCqpHW UnCDguwMHxfguxcd0DSG1sTZaFbmWbrZHqAG40LmWArZYQhlkEdFeZKb2l/l2+H6vFN9HwUy+ isL7C2lJSRFZFa7Hv+8vXltWeshH/rCQ4wHWZrARvSkmm3jlQ2UCFHXlt4tFQZLu/L6lu1GOS ILphrx57BrKsUkqLxj8w== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Lars Ingebrigtsen , Eli Zaretskii , monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Thanks, then it sounds to me like there's nothing to be done, other than > recommend the right hook for the right job. Right? Right. martin From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 07 17:16:37 2020 Received: (at 34765) by debbugs.gnu.org; 7 Dec 2020 22:16:37 +0000 Received: from localhost ([127.0.0.1]:55764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmOo7-0003lk-Dp for submit@debbugs.gnu.org; Mon, 07 Dec 2020 17:16:37 -0500 Received: from mail-wr1-f41.google.com ([209.85.221.41]:43155) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmOo3-0003lU-GH for 34765@debbugs.gnu.org; Mon, 07 Dec 2020 17:16:33 -0500 Received: by mail-wr1-f41.google.com with SMTP id y17so4887863wrr.10 for <34765@debbugs.gnu.org>; Mon, 07 Dec 2020 14:16:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=oCpH+DKnNHpk9fk/pjjwYrgunpUFNhqP4LZcamrq8gs=; b=EMLWXC759c/RAgC0hA67SmExJGivH3UOcM4hAWmHF7BcKwVL0W1bXbTrR+bWAblQQ2 sfkf1NyhnUHtswTrlD/glDJZ+SIHyZUGaVmZqfBFZkfWjNQE372PJIHbOXkNQCWKarbU Nk8cJ8RMNgfFE4Lo7PTDRcYU+y31zqyeippcMwROzqsPFf3iu+xBonbC/WBJZBudwMIZ qJBBVQ9HL6v6fa484N0dNSuhSEZtW/Gp976l8ElOpYINCfxYZr8Gn2Iw5A+wAY+OQbiG HxmGlS6LnC0m09ZkakbZBB0Ao+l5WAC9a6t67d3zXj6ZLWhcp12GU3Cj17QorLMhM1Nw Pltw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=oCpH+DKnNHpk9fk/pjjwYrgunpUFNhqP4LZcamrq8gs=; b=F9OTNU1sS1ZhOIkrqxHOkiZHLIY6b4oTX/E4mnDZKToJbRfjbKx8kdEfv5SDOg1o/o XXAumhSbuswJj+Vwi06NpWdKrfe3CEEIHkJ4TiuxeehKFo7AFOcq3eT515jv9Wn4bWcr X6dnp5ERv+SyjGcJJ+/7Qg0FtFqPEZiZOzdqYAikxOsOPqIkyssefhdsv6pCAJaxuHpx icZQrSWYQvG0wMe87LBUyAvmy4nNW1s1Mp5CPJCAsSLHx7aeb5wtkKUdr4w/zPBZptu3 g7u1ZWFgkvngayTva39A8BmbBFyq2r3sWJB9QKdfdDGE1ccJCeJYSBnM2oNdQjKnyT6k H0qQ== X-Gm-Message-State: AOAM532OTtmwVpgc4J7V8yan+CTgbB+MpuxwVaY7BqmWeOhLNN1v2ECX 0cVQe+PCjHjNaUgphVtL/i3m0g== X-Google-Smtp-Source: ABdhPJziVKivqfX/iMdpN4S/jeHGS6wzCad3SQdpzZDsv2IrRGuce215hxPLYsQyCixOT8bLV9KUPQ== X-Received: by 2002:adf:dc84:: with SMTP id r4mr7533680wrj.232.1607379385763; Mon, 07 Dec 2020 14:16:25 -0800 (PST) Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id j15sm11995663wrr.85.2020.12.07.14.16.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 14:16:24 -0800 (PST) From: "Basil L. Contovounesios" To: Eli Zaretskii Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> <87360qoa6o.fsf@tcd.ie> Date: Mon, 07 Dec 2020 22:16:23 +0000 In-Reply-To: <87360qoa6o.fsf@tcd.ie> (Basil L. Contovounesios's message of "Mon, 30 Nov 2020 20:34:55 +0000") Message-ID: <878sa9cle0.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, larsi@gnus.org, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain "Basil L. Contovounesios" writes: > I'll finish up Martin's patch with some docs then. How's the attached? The gist of it is that get-buffer-create and generate-new-buffer gain a new argument for inhibiting buffer hooks, which is set in with-temp-buffer, with-temp-file, with-output-to-string, insert-file-contents, Vprin1_to_string_buffer, and code_conversion_save. Arising questions: 0. Why isn't kill-buffer-hook defined as a DEFVAR_LISP? Is it because it has to be defined in init_buffer_once? If so, why is that the case? 1. Is it okay for with-temp-buffer, with-temp-file, and with-output-to-string to unconditionally inhibit buffer hooks, or should this be controlled by e.g. a global variable? Thanks, -- Basil --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Inhibit-buffer-hooks-in-temporary-buffers.patch >From 6847a28e105094d6e024b1239520d45498ff8653 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 1 Dec 2020 01:12:32 +0000 Subject: [PATCH] Inhibit buffer hooks in temporary buffers Give get-buffer-create an optional argument to inhibit buffer hooks in internal or temporary buffers for efficiency (bug#34765). * .dir-locals.el (c-mode): Enforce existing indent-tabs-mode policy. * etc/NEWS: Announce new parameter of get-buffer-create and generate-new-buffer, and that with-temp-buffer and with-temp-file now inhibit buffer hooks. * doc/lispref/buffers.texi (Buffer Names): Fix typo. (Creating Buffers): Document new parameter of get-buffer-create and generate-new-buffer. (Buffer List, Killing Buffers): Document when buffer hooks are inhibited. (Current Buffer): * doc/lispref/files.texi (Writing to Files): Document that with-temp-buffer and with-temp-file inhibit buffer hooks. * doc/lispref/internals.texi (Buffer Internals): Document inhibit_buffer_hooks flag. Remove stale comment. * doc/misc/gnus-faq.texi (FAQ 5-8): * lisp/simple.el (shell-command-on-region): Fix indentation. * lisp/files.el (kill-buffer-hook): Document when hook is inhibited. (create-file-buffer): * lisp/gnus/gnus-uu.el (gnus-uu-unshar-article): * lisp/international/mule.el (load-with-code-conversion): * lisp/mh-e/mh-xface.el (mh-x-image-url-fetch-image): * lisp/net/imap.el (imap-open): * lisp/net/mailcap.el (mailcap-maybe-eval): * lisp/progmodes/flymake-proc.el (flymake-proc--read-file-to-temp-buffer) (flymake-proc--copy-buffer-to-temp-buffer): Simplify. * lisp/subr.el (generate-new-buffer): Forward new optional argument to inhibit buffer hooks to get-buffer-create. (with-temp-buffer, with-temp-file, with-output-to-string): Inhibit buffer hooks in created buffer. * src/buffer.c (run_buffer_list_update_hook): New helper function. (Fget_buffer_create): Use it. Add optional argument to set inhibit_buffer_hooks flag instead of comparing the buffer name to Vcode_conversion_workbuf_name. All callers changed. (Fmake_indirect_buffer, Frename_buffer, Fbury_buffer_internal) (record_buffer): Use run_buffer_list_update_hook. (Fkill_buffer): Document when buffer hooks are inhibited. Use run_buffer_list_update_hook. (init_buffer_once): Inhibit buffer hooks in Vprin1_to_string_buffer. (Vkill_buffer_query_functions, Vbuffer_list_update_hook): Document when hooks are inhibited. * src/buffer.h (struct buffer): Update inhibit_buffer_hooks commentary. * src/coding.h (Vcode_conversion_workbuf_name): * src/coding.c (Vcode_conversion_workbuf_name): Make static again since it is no longer needed in src/buffer.c. (code_conversion_restore, code_conversion_save, syms_of_coding): Prefer boolean over integer constants. * src/fileio.c (Finsert_file_contents): Inhibit buffer hooks in " *code-converting-work*" buffer. * src/window.c (Fselect_window): Fix grammar. Mention window-selection-change-functions alongside buffer-list-update-hook. * test/src/buffer-tests.el: Fix requires. (buffer-tests-inhibit-buffer-hooks): New test. --- .dir-locals.el | 1 + doc/lispref/buffers.texi | 55 ++++++++++++++++------ doc/lispref/files.texi | 7 ++- doc/lispref/internals.texi | 11 ++++- doc/misc/gnus-faq.texi | 8 ++-- etc/NEWS | 16 +++++++ lisp/files.el | 6 ++- lisp/gnus/gnus-uu.el | 3 +- lisp/international/mule.el | 9 ++-- lisp/mh-e/mh-xface.el | 3 +- lisp/net/imap.el | 3 +- lisp/net/mailcap.el | 3 +- lisp/progmodes/flymake-proc.el | 13 +++-- lisp/simple.el | 3 +- lisp/subr.el | 54 ++++++++++----------- src/buffer.c | 86 +++++++++++++++++++--------------- src/buffer.h | 10 ++-- src/callproc.c | 5 +- src/coding.c | 12 ++--- src/coding.h | 3 -- src/fileio.c | 2 +- src/minibuf.c | 2 +- src/print.c | 2 +- src/process.c | 12 ++--- src/w32fns.c | 2 +- src/window.c | 7 +-- src/xdisp.c | 4 +- src/xfns.c | 2 +- src/xwidget.c | 3 +- test/src/buffer-tests.el | 33 +++++++++++-- 30 files changed, 228 insertions(+), 152 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el index 27d50c6069..b313945936 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -9,6 +9,7 @@ (c-noise-macro-names . ("INLINE" "ATTRIBUTE_NO_SANITIZE_UNDEFINED" "UNINIT" "CALLBACK" "ALIGN_STACK")) (electric-quote-comment . nil) (electric-quote-string . nil) + (indent-tabs-mode . t) (mode . bug-reference-prog))) (objc-mode . ((c-file-style . "GNU") (electric-quote-comment . nil) diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index 2860343628..c8c4852e30 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi @@ -225,13 +225,18 @@ Current Buffer @defmac with-temp-buffer body@dots{} @anchor{Definition of with-temp-buffer} -The @code{with-temp-buffer} macro evaluates the @var{body} forms -with a temporary buffer as the current buffer. It saves the identity of +The @code{with-temp-buffer} macro evaluates the @var{body} forms with +a temporary buffer as the current buffer. It saves the identity of the current buffer, creates a temporary buffer and makes it current, evaluates the @var{body} forms, and finally restores the previous -current buffer while killing the temporary buffer. By default, undo -information (@pxref{Undo}) is not recorded in the buffer created by -this macro (but @var{body} can enable that, if needed). +current buffer while killing the temporary buffer. + +By default, undo information (@pxref{Undo}) is not recorded in the +buffer created by this macro (but @var{body} can enable that, if +needed). The temporary buffer also does not run the hooks +@code{kill-buffer-hook}, @code{kill-buffer-query-functions} +(@pxref{Killing Buffers}), and @code{buffer-list-update-hook} +(@pxref{Buffer List}). The return value is the value of the last form in @var{body}. You can return the contents of the temporary buffer by using @@ -345,9 +350,9 @@ Buffer Names If the optional second argument @var{ignore} is non-@code{nil}, it should be a string, a potential buffer name. It means to consider -that potential buffer acceptable, if it is tried, even it is the name -of an existing buffer (which would normally be rejected). Thus, if -buffers named @samp{foo}, @samp{foo<2>}, @samp{foo<3>} and +that potential buffer acceptable, if it is tried, even if it is the +name of an existing buffer (which would normally be rejected). Thus, +if buffers named @samp{foo}, @samp{foo<2>}, @samp{foo<3>} and @samp{foo<4>} exist, @example @@ -932,13 +937,17 @@ Buffer List @defvar buffer-list-update-hook This is a normal hook run whenever the buffer list changes. Functions (implicitly) running this hook are @code{get-buffer-create} -(@pxref{Creating Buffers}), @code{rename-buffer} (@pxref{Buffer Names}), -@code{kill-buffer} (@pxref{Killing Buffers}), @code{bury-buffer} (see -above) and @code{select-window} (@pxref{Selecting Windows}). +(@pxref{Creating Buffers}), @code{rename-buffer} (@pxref{Buffer +Names}), @code{kill-buffer} (@pxref{Killing Buffers}), +@code{bury-buffer} (see above), and @code{select-window} +(@pxref{Selecting Windows}). This hook is not run for internal or +temporary buffers created by @code{get-buffer-create} or +@code{generate-new-buffer} with a non-@code{nil} argument +@var{inhibit-buffer-hooks}. Functions run by this hook should avoid calling @code{select-window} -with a nil @var{norecord} argument or @code{with-temp-buffer} since -either may lead to infinite recursion. +with a @code{nil} @var{norecord} argument since this may lead to +infinite recursion. @end defvar @node Creating Buffers @@ -951,12 +960,20 @@ Creating Buffers with the specified name; @code{generate-new-buffer} always creates a new buffer and gives it a unique name. + Both functions accept an optional argument @var{inhibit-buffer-hooks}. +If it is non-@code{nil}, the buffer they create does not run the hooks +@code{kill-buffer-hook}, @code{kill-buffer-query-functions} +(@pxref{Killing Buffers}), and @code{buffer-list-update-hook} +(@pxref{Buffer List}). This avoids slowing down internal or temporary +buffers that are never presented to users or passed on to other +applications. + Other functions you can use to create buffers include @code{with-output-to-temp-buffer} (@pxref{Temporary Displays}) and @code{create-file-buffer} (@pxref{Visiting Files}). Starting a subprocess can also create a buffer (@pxref{Processes}). -@defun get-buffer-create buffer-or-name +@defun get-buffer-create buffer-or-name &optional inhibit-buffer-hooks This function returns a buffer named @var{buffer-or-name}. The buffer returned does not become the current buffer---this function does not change which buffer is current. @@ -980,7 +997,7 @@ Creating Buffers buffer initially disables undo information recording (@pxref{Undo}). @end defun -@defun generate-new-buffer name +@defun generate-new-buffer name &optional inhibit-buffer-hooks This function returns a newly created, empty buffer, but does not make it current. The name of the buffer is generated by passing @var{name} to the function @code{generate-new-buffer-name} (@pxref{Buffer @@ -1092,6 +1109,10 @@ Killing Buffers they are called. The idea of this feature is that these functions will ask for confirmation from the user. If any of them returns @code{nil}, @code{kill-buffer} spares the buffer's life. + +This hook is not run for internal or temporary buffers created by +@code{get-buffer-create} or @code{generate-new-buffer} with a +non-@code{nil} argument @var{inhibit-buffer-hooks}. @end defvar @defvar kill-buffer-hook @@ -1100,6 +1121,10 @@ Killing Buffers The buffer to be killed is current when the hook functions run. @xref{Hooks}. This variable is a permanent local, so its local binding is not cleared by changing major modes. + +This hook is not run for internal or temporary buffers created by +@code{get-buffer-create} or @code{generate-new-buffer} with a +non-@code{nil} argument @var{inhibit-buffer-hooks}. @end defvar @defopt buffer-offer-save diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index d49ac42bb4..6949ca29c6 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -701,8 +701,11 @@ Writing to Files The current buffer is restored even in case of an abnormal exit via @code{throw} or error (@pxref{Nonlocal Exits}). -See also @code{with-temp-buffer} in @ref{Definition of -with-temp-buffer,, The Current Buffer}. +Like @code{with-temp-buffer} (@pxref{Definition of with-temp-buffer,, +Current Buffer}), the temporary buffer used by this macro does not run +the hooks @code{kill-buffer-hook}, @code{kill-buffer-query-functions} +(@pxref{Killing Buffers}), and @code{buffer-list-update-hook} +(@pxref{Buffer List}). @end defmac @node File Locks diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index bb25983aa4..3ba59298f1 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -2375,6 +2375,15 @@ Buffer Internals This flag indicates that redisplay optimizations should not be used to display this buffer. +@item inhibit_buffer_hooks +This flag indicates that the buffer should not run the hooks +@code{kill-buffer-hook}, @code{kill-buffer-query-functions} +(@pxref{Killing Buffers}), and @code{buffer-list-update-hook} +(@pxref{Buffer List}). It is set at buffer creation (@pxref{Creating +Buffers}), and avoids slowing down internally used temporary buffers, +such as those created by @code{with-temp-buffer} (@pxref{Definition of +with-temp-buffer,, Current Buffer}). + @item overlay_center This field holds the current overlay center position. @xref{Managing Overlays}. @@ -2388,8 +2397,6 @@ Buffer Internals and @code{overlays_after} is sorted in order of increasing beginning position. -@c FIXME? the following are now all Lisp_Object BUFFER_INTERNAL_FIELD (foo). - @item name A Lisp string that names the buffer. It is guaranteed to be unique. @xref{Buffer Names}. This and the following fields have their names diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi index adb812f572..c30e80ff56 100644 --- a/doc/misc/gnus-faq.texi +++ b/doc/misc/gnus-faq.texi @@ -1523,10 +1523,10 @@ FAQ 5-8 @example (setq message-default-headers - (with-temp-buffer - (insert "X-Face: ") - (insert-file-contents "~/.xface") - (buffer-string))) + (with-temp-buffer + (insert "X-Face: ") + (insert-file-contents "~/.xface") + (buffer-string))) @end example @noindent diff --git a/etc/NEWS b/etc/NEWS index d796a4cdbc..6e2b92fed2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1735,6 +1735,13 @@ modifies the string's text properties; instead, it uses and returns a copy of the string. This helps avoid trouble when strings are shared or constants. ++++ +** Temporary buffers no longer run certain buffer hooks. +The macros 'with-temp-buffer' and 'with-temp-file' no longer run the +hooks 'kill-buffer-hook', 'kill-buffer-query-functions', and +'buffer-list-update-hook' for the temporary buffers they create. This +avoids slowing them down when a lot of these hooks are defined. + --- ** The obsolete function 'thread-alive-p' has been removed. @@ -2077,6 +2084,15 @@ and 'play-sound-file'. If this variable is non-nil, character syntax is used for printing numbers when this makes sense, such as '?A' for 65. ++++ +** Buffers can now be created with certain hooks disabled. +The functions 'get-buffer-create' and 'generate-new-buffer' accept a +new optional argument 'inhibit-buffer-hooks'. If non-nil, the new +buffer does not run the hooks 'kill-buffer-hook', +'kill-buffer-query-functions', and 'buffer-list-update-hook'. This +avoids slowing down internal or temporary buffers that are never +presented to users or passed on to other applications. + * Changes in Emacs 28.1 on Non-Free Operating Systems diff --git a/lisp/files.el b/lisp/files.el index 2cf77d5d7e..97316f0f1e 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1850,6 +1850,10 @@ kill-buffer-hook The buffer being killed is current while the hook is running. See `kill-buffer'. +This hook is not run for internal or temporary buffers created by +`get-buffer-create' or `generate-new-buffer' with argument +INHIBIT-BUFFER-HOOKS non-nil. + Note: Be careful with let-binding this hook considering it is frequently used for cleanup.") @@ -1951,7 +1955,7 @@ create-file-buffer (let ((lastname (file-name-nondirectory filename))) (if (string= lastname "") (setq lastname filename)) - (generate-new-buffer (if (string-match-p "\\` " lastname) + (generate-new-buffer (if (string-prefix-p " " lastname) (concat "|" lastname) lastname)))) diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index 70aeac00d7..00ca430cc5 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el @@ -1587,8 +1587,7 @@ gnus-uu-unshar-article (save-excursion (switch-to-buffer (current-buffer)) (delete-other-windows) - (let ((buffer (get-buffer-create (generate-new-buffer-name - "*Warning*")))) + (let ((buffer (generate-new-buffer "*Warning*"))) (unless (unwind-protect (with-current-buffer buffer diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 212e7232b4..6571454dff 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -307,12 +307,9 @@ load-with-code-conversion (and (null noerror) (signal 'file-error (list "Cannot open load file" file))) ;; Read file with code conversion, and then eval. - (let* ((buffer - ;; We can't use `generate-new-buffer' because files.el - ;; is not yet loaded. - (get-buffer-create (generate-new-buffer-name " *load*"))) - (load-in-progress t) - (source (save-match-data (string-match "\\.el\\'" fullname)))) + (let ((buffer (generate-new-buffer " *load*")) + (load-in-progress t) + (source (string-suffix-p ".el" fullname))) (unless nomessage (if source (message "Loading %s (source)..." file) diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el index 909f1fe95d..65039310e7 100644 --- a/lisp/mh-e/mh-xface.el +++ b/lisp/mh-e/mh-xface.el @@ -425,8 +425,7 @@ mh-x-image-url-fetch-image be displayed in a buffer and position specified by MARKER. The actual display is carried out by the SENTINEL function." (if mh-wget-executable - (let ((buffer (get-buffer-create (generate-new-buffer-name - mh-temp-fetch-buffer))) + (let ((buffer (generate-new-buffer mh-temp-fetch-buffer)) (filename (or (mh-funcall-if-exists make-temp-file "mhe-fetch") (expand-file-name (make-temp-name "~/mhe-fetch"))))) (with-current-buffer buffer diff --git a/lisp/net/imap.el b/lisp/net/imap.el index 0394f0efea..50b08d9612 100644 --- a/lisp/net/imap.el +++ b/lisp/net/imap.el @@ -1033,8 +1033,7 @@ imap-open (when (funcall (nth 1 (assq stream imap-stream-alist)) buffer) ;; Stream changed? (if (not (eq imap-default-stream stream)) - (with-current-buffer (get-buffer-create - (generate-new-buffer-name " *temp*")) + (with-current-buffer (generate-new-buffer " *temp*") (mapc 'make-local-variable imap-local-variables) (set-buffer-multibyte nil) (buffer-disable-undo) diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index d0f8c1272d..bc99f02fe3 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -386,8 +386,7 @@ mailcap-maybe-eval (when (save-window-excursion (delete-other-windows) - (let ((buffer (get-buffer-create (generate-new-buffer-name - "*Warning*")))) + (let ((buffer (generate-new-buffer "*Warning*"))) (unwind-protect (with-current-buffer buffer (insert (substitute-command-keys diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el index 152dc725c7..e9d5018f30 100644 --- a/lisp/progmodes/flymake-proc.el +++ b/lisp/progmodes/flymake-proc.el @@ -429,16 +429,15 @@ flymake-proc--replace-region (defun flymake-proc--read-file-to-temp-buffer (file-name) "Insert contents of FILE-NAME into newly created temp buffer." - (let* ((temp-buffer (get-buffer-create (generate-new-buffer-name (concat "flymake:" (file-name-nondirectory file-name)))))) - (with-current-buffer temp-buffer - (insert-file-contents file-name)) - temp-buffer)) + (with-current-buffer (generate-new-buffer + (concat "flymake:" (file-name-nondirectory file-name))) + (insert-file-contents file-name) + (current-buffer))) (defun flymake-proc--copy-buffer-to-temp-buffer (buffer) "Copy contents of BUFFER into newly created temp buffer." - (with-current-buffer - (get-buffer-create (generate-new-buffer-name - (concat "flymake:" (buffer-name buffer)))) + (with-current-buffer (generate-new-buffer + (concat "flymake:" (buffer-name buffer))) (insert-buffer-substring buffer) (current-buffer))) diff --git a/lisp/simple.el b/lisp/simple.el index 3c4f756230..7781a1e91a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4301,8 +4301,7 @@ shell-command-on-region (defun shell-command-to-string (command) "Execute shell command COMMAND and return its output as a string." (with-output-to-string - (with-current-buffer - standard-output + (with-current-buffer standard-output (shell-command command t)))) (defun process-file (program &optional infile buffer display &rest args) diff --git a/lisp/subr.el b/lisp/subr.el index c28807f694..0daceb6869 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3692,10 +3692,11 @@ internal--after-with-selected-window (when (window-live-p (nth 1 state)) (select-window (nth 1 state) 'norecord))) -(defun generate-new-buffer (name) +(defun generate-new-buffer (name &optional inhibit-buffer-hooks) "Create and return a buffer with a name based on NAME. -Choose the buffer's name using `generate-new-buffer-name'." - (get-buffer-create (generate-new-buffer-name name))) +Choose the buffer's name using `generate-new-buffer-name'. +See `get-buffer-create' for the meaning of INHIBIT-BUFFER-HOOKS." + (get-buffer-create (generate-new-buffer-name name) inhibit-buffer-hooks)) (defmacro with-selected-window (window &rest body) "Execute the forms in BODY with WINDOW as the selected window. @@ -3854,23 +3855,29 @@ with-output-to-temp-buffer (prog1 (progn ,@body) (internal-temp-output-buffer-show ,buf))))) +(defmacro with-temp-buffer (&rest body) + "Create a temporary buffer, and evaluate BODY there like `progn'. +The buffer does not run the hooks `kill-buffer-hook', +`kill-buffer-query-functions', and `buffer-list-update-hook'. +See also `with-temp-file' and `with-output-to-string'." + (declare (indent 0) (debug t)) + (let ((temp-buffer (make-symbol "temp-buffer"))) + `(let ((,temp-buffer (generate-new-buffer " *temp*" t))) + ;; `kill-buffer' can change current-buffer in some odd cases. + (with-current-buffer ,temp-buffer + (unwind-protect + (progn ,@body) + (and (buffer-name ,temp-buffer) + (kill-buffer ,temp-buffer))))))) + (defmacro with-temp-file (file &rest body) "Create a new buffer, evaluate BODY there, and write the buffer to FILE. The value returned is the value of the last form in BODY. -See also `with-temp-buffer'." +The buffer is created using `with-temp-buffer', which see." (declare (indent 1) (debug t)) - (let ((temp-file (make-symbol "temp-file")) - (temp-buffer (make-symbol "temp-buffer"))) - `(let ((,temp-file ,file) - (,temp-buffer (generate-new-buffer " *temp file*"))) - (unwind-protect - (prog1 - (with-current-buffer ,temp-buffer - ,@body) - (with-current-buffer ,temp-buffer - (write-region nil nil ,temp-file nil 0))) - (and (buffer-name ,temp-buffer) - (kill-buffer ,temp-buffer)))))) + `(with-temp-buffer + (prog1 (progn ,@body) + (write-region nil nil ,file nil 0)))) (defmacro with-temp-message (message &rest body) "Display MESSAGE temporarily if non-nil while BODY is evaluated. @@ -3895,19 +3902,6 @@ with-temp-message (message "%s" ,current-message) (message nil))))))) -(defmacro with-temp-buffer (&rest body) - "Create a temporary buffer, and evaluate BODY there like `progn'. -See also `with-temp-file' and `with-output-to-string'." - (declare (indent 0) (debug t)) - (let ((temp-buffer (make-symbol "temp-buffer"))) - `(let ((,temp-buffer (generate-new-buffer " *temp*"))) - ;; `kill-buffer' can change current-buffer in some odd cases. - (with-current-buffer ,temp-buffer - (unwind-protect - (progn ,@body) - (and (buffer-name ,temp-buffer) - (kill-buffer ,temp-buffer))))))) - (defmacro with-silent-modifications (&rest body) "Execute BODY, pretending it does not modify the buffer. This macro is typically used around modifications of @@ -3935,7 +3929,7 @@ with-silent-modifications (defmacro with-output-to-string (&rest body) "Execute BODY, return the text it sent to `standard-output', as a string." (declare (indent 0) (debug t)) - `(let ((standard-output (generate-new-buffer " *string-output*"))) + `(let ((standard-output (generate-new-buffer " *string-output*" t))) (unwind-protect (progn (let ((standard-output standard-output)) diff --git a/src/buffer.c b/src/buffer.c index 4215acbf1d..926fbc8f09 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -37,7 +37,6 @@ Copyright (C) 1985-1989, 1993-1995, 1997-2020 Free Software Foundation, #include "window.h" #include "commands.h" #include "character.h" -#include "coding.h" #include "buffer.h" #include "region-cache.h" #include "indent.h" @@ -514,16 +513,31 @@ get_truename_buffer (register Lisp_Object filename) return Qnil; } -DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0, +/* Run 'buffer-list-update-hook' if Vrun_hooks is non-nil, and BUF is + either NULL or does not have buffer hooks inhibited. */ + +static void +run_buffer_list_update_hook (struct buffer *buf) { + if (! (NILP (Vrun_hooks) || (buf && buf->inhibit_buffer_hooks))) + call1 (Vrun_hooks, Qbuffer_list_update_hook); +} + +DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 2, 0, doc: /* Return the buffer specified by BUFFER-OR-NAME, creating a new one if needed. If BUFFER-OR-NAME is a string and a live buffer with that name exists, return that buffer. If no such buffer exists, create a new buffer with -that name and return it. If BUFFER-OR-NAME starts with a space, the new -buffer does not keep undo information. +that name and return it. + +If BUFFER-OR-NAME starts with a space, the new buffer does not keep undo +information. If optional argument INHIBIT-BUFFER-HOOKS is non-nil, the +new buffer does not run the hooks `kill-buffer-hook', +`kill-buffer-query-functions', and `buffer-list-update-hook'. This +avoids slowing down internal or temporary buffers that are never +presented to users or passed on to other applications. If BUFFER-OR-NAME is a buffer instead of a string, return it as given, even if it is dead. The return value is never nil. */) - (register Lisp_Object buffer_or_name) + (register Lisp_Object buffer_or_name, Lisp_Object inhibit_buffer_hooks) { register Lisp_Object buffer, name; register struct buffer *b; @@ -598,11 +612,7 @@ DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0, set_string_intervals (name, NULL); bset_name (b, name); - b->inhibit_buffer_hooks - = (STRINGP (Vcode_conversion_workbuf_name) - && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name), - SBYTES (Vcode_conversion_workbuf_name)) == 0); - + b->inhibit_buffer_hooks = !NILP (inhibit_buffer_hooks); bset_undo_list (b, SREF (name, 0) != ' ' ? Qnil : Qt); reset_buffer (b); @@ -614,9 +624,8 @@ DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0, /* Put this in the alist of all live buffers. */ XSETBUFFER (buffer, b); Vbuffer_alist = nconc2 (Vbuffer_alist, list1 (Fcons (name, buffer))); - /* And run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks) && !b->inhibit_buffer_hooks) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + + run_buffer_list_update_hook (b); return buffer; } @@ -890,9 +899,7 @@ DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer, set_buffer_internal_1 (old_b); } - /* Run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks)) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + run_buffer_list_update_hook (NULL); return buf; } @@ -1536,9 +1543,7 @@ DEFUN ("rename-buffer", Frename_buffer, Srename_buffer, 1, 2, && !NILP (BVAR (current_buffer, auto_save_file_name))) call0 (intern ("rename-auto-save-file")); - /* Run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks) && !current_buffer->inhibit_buffer_hooks) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + run_buffer_list_update_hook (current_buffer); /* Refetch since that last call may have done GC. */ return BVAR (current_buffer, name); @@ -1612,7 +1617,7 @@ DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 3, 0, buf = Fget_buffer (scratch); if (NILP (buf)) { - buf = Fget_buffer_create (scratch); + buf = Fget_buffer_create (scratch, Qnil); Fset_buffer_major_mode (buf); } return buf; @@ -1636,7 +1641,7 @@ other_buffer_safely (Lisp_Object buffer) buf = Fget_buffer (scratch); if (NILP (buf)) { - buf = Fget_buffer_create (scratch); + buf = Fget_buffer_create (scratch, Qnil); Fset_buffer_major_mode (buf); } @@ -1713,7 +1718,9 @@ DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 0, 1, "bKill buffer: ", the buffer is not killed. The hook `kill-buffer-hook' is run before the buffer is actually killed. The buffer being killed will be current while the hook is running. Functions called by any of these hooks are -supposed to not change the current buffer. +supposed to not change the current buffer. Neither hook is run for +internal or temporary buffers created by `get-buffer-create' or +`generate-new-buffer' with argument INHIBIT-BUFFER-HOOKS non-nil. Any processes that have this buffer as the `process-buffer' are killed with SIGHUP. This function calls `replace-buffer-in-windows' for @@ -1973,9 +1980,7 @@ DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 0, 1, "bKill buffer: ", bset_width_table (b, Qnil); unblock_input (); - /* Run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks) && !b->inhibit_buffer_hooks) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + run_buffer_list_update_hook (b); return Qt; } @@ -2015,9 +2020,7 @@ record_buffer (Lisp_Object buffer) fset_buffer_list (f, Fcons (buffer, Fdelq (buffer, f->buffer_list))); fset_buried_buffer_list (f, Fdelq (buffer, f->buried_buffer_list)); - /* Run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks) && !XBUFFER (buffer)->inhibit_buffer_hooks) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + run_buffer_list_update_hook (XBUFFER (buffer)); } @@ -2054,9 +2057,7 @@ DEFUN ("bury-buffer-internal", Fbury_buffer_internal, Sbury_buffer_internal, fset_buried_buffer_list (f, Fcons (buffer, Fdelq (buffer, f->buried_buffer_list))); - /* Run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks) && !XBUFFER (buffer)->inhibit_buffer_hooks) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + run_buffer_list_update_hook (XBUFFER (buffer)); return Qnil; } @@ -5349,10 +5350,11 @@ init_buffer_once (void) Fput (Qkill_buffer_hook, Qpermanent_local, Qt); /* Super-magic invisible buffer. */ - Vprin1_to_string_buffer = Fget_buffer_create (build_pure_c_string (" prin1")); + Vprin1_to_string_buffer = + Fget_buffer_create (build_pure_c_string (" prin1"), Qt); Vbuffer_alist = Qnil; - Fset_buffer (Fget_buffer_create (build_pure_c_string ("*scratch*"))); + Fset_buffer (Fget_buffer_create (build_pure_c_string ("*scratch*"), Qnil)); inhibit_modification_hooks = 0; } @@ -5397,7 +5399,7 @@ init_buffer (void) #endif /* USE_MMAP_FOR_BUFFERS */ AUTO_STRING (scratch, "*scratch*"); - Fset_buffer (Fget_buffer_create (scratch)); + Fset_buffer (Fget_buffer_create (scratch, Qnil)); if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters))) Fset_buffer_multibyte (Qnil); @@ -6300,9 +6302,14 @@ from (abs POSITION). If POSITION is positive, point was at the front DEFVAR_LISP ("kill-buffer-query-functions", Vkill_buffer_query_functions, doc: /* List of functions called with no args to query before killing a buffer. The buffer being killed will be current while the functions are running. +See `kill-buffer'. If any of them returns nil, the buffer is not killed. Functions run by -this hook are supposed to not change the current buffer. */); +this hook are supposed to not change the current buffer. + +This hook is not run for internal or temporary buffers created by +`get-buffer-create' or `generate-new-buffer' with argument +INHIBIT-BUFFER-HOOKS non-nil. */); Vkill_buffer_query_functions = Qnil; DEFVAR_LISP ("change-major-mode-hook", Vchange_major_mode_hook, @@ -6315,9 +6322,12 @@ from (abs POSITION). If POSITION is positive, point was at the front doc: /* Hook run when the buffer list changes. Functions (implicitly) running this hook are `get-buffer-create', `make-indirect-buffer', `rename-buffer', `kill-buffer', `bury-buffer' -and `select-window'. Functions run by this hook should avoid calling -`select-window' with a nil NORECORD argument or `with-temp-buffer' -since either may lead to infinite recursion. */); +and `select-window'. This hook is not run for internal or temporary +buffers created by `get-buffer-create' or `generate-new-buffer' with +argument INHIBIT-BUFFER-HOOKS non-nil. + +Functions run by this hook should avoid calling `select-window' with a +nil NORECORD argument since it may lead to infinite recursion. */); Vbuffer_list_update_hook = Qnil; DEFSYM (Qbuffer_list_update_hook, "buffer-list-update-hook"); diff --git a/src/buffer.h b/src/buffer.h index fe549c5dac..b8c5162be4 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -663,11 +663,11 @@ #define BVAR(buf, field) ((buf)->field ## _) /* Non-zero whenever the narrowing is changed in this buffer. */ bool_bf clip_changed : 1; - /* Non-zero for internally used temporary buffers that don't need to - run hooks kill-buffer-hook, buffer-list-update-hook, and - kill-buffer-query-functions. This is used in coding.c to avoid - slowing down en/decoding when there are a lot of these hooks - defined. */ + /* Non-zero for internal or temporary buffers that don't need to + run hooks kill-buffer-hook, kill-buffer-query-functions, and + buffer-list-update-hook. This is used in coding.c to avoid + slowing down en/decoding when a lot of these hooks are + defined, as well as by with-temp-buffer, for example. */ bool_bf inhibit_buffer_hooks : 1; /* List of overlays that end at or before the current center, diff --git a/src/callproc.c b/src/callproc.c index e3346e2eab..4bca1e5ebd 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -405,9 +405,8 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, if (! (NILP (buffer) || EQ (buffer, Qt) || FIXNUMP (buffer))) { - Lisp_Object spec_buffer; - spec_buffer = buffer; - buffer = Fget_buffer_create (buffer); + Lisp_Object spec_buffer = buffer; + buffer = Fget_buffer_create (buffer, Qnil); /* Mention the buffer name for a better error message. */ if (NILP (buffer)) CHECK_BUFFER (spec_buffer); diff --git a/src/coding.c b/src/coding.c index 2142e7fa51..1afa4aa474 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7821,7 +7821,7 @@ encode_coding (struct coding_system *coding) /* A string that serves as name of the reusable work buffer, and as base name of temporary work buffers used for code-conversion operations. */ -Lisp_Object Vcode_conversion_workbuf_name; +static Lisp_Object Vcode_conversion_workbuf_name; /* The reusable working buffer, created once and never killed. */ static Lisp_Object Vcode_conversion_reused_workbuf; @@ -7839,7 +7839,7 @@ code_conversion_restore (Lisp_Object arg) if (! NILP (workbuf)) { if (EQ (workbuf, Vcode_conversion_reused_workbuf)) - reused_workbuf_in_use = 0; + reused_workbuf_in_use = false; else Fkill_buffer (workbuf); } @@ -7857,13 +7857,13 @@ code_conversion_save (bool with_work_buf, bool multibyte) { Lisp_Object name = Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name, Qnil); - workbuf = Fget_buffer_create (name); + workbuf = Fget_buffer_create (name, Qt); } else { if (NILP (Fbuffer_live_p (Vcode_conversion_reused_workbuf))) Vcode_conversion_reused_workbuf - = Fget_buffer_create (Vcode_conversion_workbuf_name); + = Fget_buffer_create (Vcode_conversion_workbuf_name, Qt); workbuf = Vcode_conversion_reused_workbuf; } } @@ -7881,7 +7881,7 @@ code_conversion_save (bool with_work_buf, bool multibyte) bset_undo_list (current_buffer, Qt); bset_enable_multibyte_characters (current_buffer, multibyte ? Qt : Qnil); if (EQ (workbuf, Vcode_conversion_reused_workbuf)) - reused_workbuf_in_use = 1; + reused_workbuf_in_use = true; set_buffer_internal (current); } @@ -11639,7 +11639,7 @@ syms_of_coding (void) staticpro (&Vcode_conversion_workbuf_name); Vcode_conversion_workbuf_name = build_pure_c_string (" *code-conversion-work*"); - reused_workbuf_in_use = 0; + reused_workbuf_in_use = false; PDUMPER_REMEMBER_SCALAR (reused_workbuf_in_use); DEFSYM (Qcharset, "charset"); diff --git a/src/coding.h b/src/coding.h index 4973cf89eb..9ad1e954f8 100644 --- a/src/coding.h +++ b/src/coding.h @@ -97,9 +97,6 @@ #define EMACS_CODING_H extern Lisp_Object Vcoding_system_hash_table; -/* Name (or base name) of work buffer for code conversion. */ -extern Lisp_Object Vcode_conversion_workbuf_name; - /* Enumeration of index to an attribute vector of a coding system. */ enum coding_attr_index diff --git a/src/fileio.c b/src/fileio.c index 283813ff89..c8d2e923a0 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4003,7 +4003,7 @@ because (1) it preserves some marker positions and (2) it puts less data record_unwind_current_buffer (); - workbuf = Fget_buffer_create (name); + workbuf = Fget_buffer_create (name, Qt); buf = XBUFFER (workbuf); delete_all_overlays (buf); diff --git a/src/minibuf.c b/src/minibuf.c index fc3fd92a88..1940564a80 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -809,7 +809,7 @@ get_minibuffer (EMACS_INT depth) static char const name_fmt[] = " *Minibuf-%"pI"d*"; char name[sizeof name_fmt + INT_STRLEN_BOUND (EMACS_INT)]; AUTO_STRING_WITH_LEN (lname, name, sprintf (name, name_fmt, depth)); - buf = Fget_buffer_create (lname); + buf = Fget_buffer_create (lname, Qnil); /* Although the buffer's name starts with a space, undo should be enabled in it. */ diff --git a/src/print.c b/src/print.c index 008bf5e639..ec271d914c 100644 --- a/src/print.c +++ b/src/print.c @@ -562,7 +562,7 @@ temp_output_buffer_setup (const char *bufname) record_unwind_current_buffer (); - Fset_buffer (Fget_buffer_create (build_string (bufname))); + Fset_buffer (Fget_buffer_create (build_string (bufname), Qnil)); Fkill_all_local_variables (); delete_all_overlays (current_buffer); diff --git a/src/process.c b/src/process.c index bf64ead24e..6dc7d4b647 100644 --- a/src/process.c +++ b/src/process.c @@ -1731,7 +1731,7 @@ DEFUN ("make-process", Fmake_process, Smake_process, 0, MANY, 0, buffer = Fplist_get (contact, QCbuffer); if (!NILP (buffer)) - buffer = Fget_buffer_create (buffer); + buffer = Fget_buffer_create (buffer, Qnil); /* Make sure that the child will be able to chdir to the current buffer's current directory, or its unhandled equivalent. We @@ -1768,7 +1768,7 @@ DEFUN ("make-process", Fmake_process, Smake_process, 0, MANY, 0, QCname, concat2 (name, build_string (" stderr")), QCbuffer, - Fget_buffer_create (xstderr), + Fget_buffer_create (xstderr, Qnil), QCnoquery, query_on_exit ? Qnil : Qt); } @@ -2443,7 +2443,7 @@ DEFUN ("make-pipe-process", Fmake_pipe_process, Smake_pipe_process, buffer = Fplist_get (contact, QCbuffer); if (NILP (buffer)) buffer = name; - buffer = Fget_buffer_create (buffer); + buffer = Fget_buffer_create (buffer, Qnil); pset_buffer (p, buffer); pset_childp (p, contact); @@ -3173,7 +3173,7 @@ DEFUN ("make-serial-process", Fmake_serial_process, Smake_serial_process, buffer = Fplist_get (contact, QCbuffer); if (NILP (buffer)) buffer = name; - buffer = Fget_buffer_create (buffer); + buffer = Fget_buffer_create (buffer, Qnil); pset_buffer (p, buffer); pset_childp (p, contact); @@ -4188,7 +4188,7 @@ DEFUN ("make-network-process", Fmake_network_process, Smake_network_process, open_socket: if (!NILP (buffer)) - buffer = Fget_buffer_create (buffer); + buffer = Fget_buffer_create (buffer, Qnil); /* Unwind bind_polling_period. */ unbind_to (count, Qnil); @@ -4961,7 +4961,7 @@ server_accept_connection (Lisp_Object server, int channel) if (!NILP (buffer)) { args[1] = buffer; - buffer = Fget_buffer_create (Fformat (nargs, args)); + buffer = Fget_buffer_create (Fformat (nargs, args), Qnil); } } diff --git a/src/w32fns.c b/src/w32fns.c index a840f0e122..36bee0676b 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7372,7 +7372,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, tip_f = XFRAME (tip_frame); window = FRAME_ROOT_WINDOW (tip_f); - tip_buf = Fget_buffer_create (tip); + tip_buf = Fget_buffer_create (tip, Qnil); /* We will mark the tip window a "pseudo-window" below, and such windows cannot have display margins. */ bset_left_margin_cols (XBUFFER (tip_buf), make_fixnum (0)); diff --git a/src/window.c b/src/window.c index 6cd3122b43..4dd11eb857 100644 --- a/src/window.c +++ b/src/window.c @@ -617,11 +617,12 @@ DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, Run `buffer-list-update-hook' unless NORECORD is non-nil. Note that applications and internal routines often select a window temporarily for various purposes; mostly, to simplify coding. As a rule, such -selections should be not recorded and therefore will not pollute +selections should not be recorded and therefore will not pollute `buffer-list-update-hook'. Selections that "really count" are those causing a visible change in the next redisplay of WINDOW's frame and -should be always recorded. So if you think of running a function each -time a window gets selected put it on `buffer-list-update-hook'. +should always be recorded. So if you think of running a function each +time a window gets selected, put it on `buffer-list-update-hook' or +`window-selection-change-functions'. Also note that the main editor command loop sets the current buffer to the buffer of the selected window before each command. */) diff --git a/src/xdisp.c b/src/xdisp.c index ed1d4761b9..22d33f4a1f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10853,7 +10853,7 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte) /* Ensure the Messages buffer exists, and switch to it. If we created it, set the major-mode. */ bool newbuffer = NILP (Fget_buffer (Vmessages_buffer_name)); - Fset_buffer (Fget_buffer_create (Vmessages_buffer_name)); + Fset_buffer (Fget_buffer_create (Vmessages_buffer_name, Qnil)); if (newbuffer && !NILP (Ffboundp (intern ("messages-buffer-mode")))) call0 (intern ("messages-buffer-mode")); @@ -11339,7 +11339,7 @@ ensure_echo_area_buffers (void) static char const name_fmt[] = " *Echo Area %d*"; char name[sizeof name_fmt + INT_STRLEN_BOUND (int)]; AUTO_STRING_WITH_LEN (lname, name, sprintf (name, name_fmt, i)); - echo_buffer[i] = Fget_buffer_create (lname); + echo_buffer[i] = Fget_buffer_create (lname, Qnil); bset_truncate_lines (XBUFFER (echo_buffer[i]), Qnil); /* to force word wrap in echo area - it was decided to postpone this*/ diff --git a/src/xfns.c b/src/xfns.c index 46e4bd73a6..abe293e903 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -7041,7 +7041,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, tip_f = XFRAME (tip_frame); window = FRAME_ROOT_WINDOW (tip_f); - tip_buf = Fget_buffer_create (tip); + tip_buf = Fget_buffer_create (tip, Qnil); /* We will mark the tip window a "pseudo-window" below, and such windows cannot have display margins. */ bset_left_margin_cols (XBUFFER (tip_buf), make_fixnum (0)); diff --git a/src/xwidget.c b/src/xwidget.c index e078a28a35..accde65b52 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -100,7 +100,8 @@ DEFUN ("make-xwidget", Lisp_Object val; xw->type = type; xw->title = title; - xw->buffer = NILP (buffer) ? Fcurrent_buffer () : Fget_buffer_create (buffer); + xw->buffer = (NILP (buffer) ? Fcurrent_buffer () + : Fget_buffer_create (buffer, Qnil)); xw->height = XFIXNAT (height); xw->width = XFIXNAT (width); xw->kill_without_query = false; diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el index 0db66f9751..dd8927457a 100644 --- a/test/src/buffer-tests.el +++ b/test/src/buffer-tests.el @@ -19,9 +19,7 @@ ;;; Code: -(require 'ert) -(require 'seq) -(eval-when-compile (require 'cl-lib)) +(require 'cl-lib) (ert-deftest overlay-modification-hooks-message-other-buf () "Test for bug#21824. @@ -1334,4 +1332,33 @@ buffer-tests-buffer-local-variables-undo (with-temp-buffer (should (assq 'buffer-undo-list (buffer-local-variables))))) +(ert-deftest buffer-tests-inhibit-buffer-hooks () + "Test `get-buffer-create' argument INHIBIT-BUFFER-HOOKS." + (let* (run-bluh (bluh (lambda () (setq run-bluh t)))) + (unwind-protect + (let* ( run-kbh (kbh (lambda () (setq run-kbh t))) + run-kbqf (kbqf (lambda () (setq run-kbqf t))) ) + + ;; Inhibited. + (add-hook 'buffer-list-update-hook bluh) + (with-current-buffer (generate-new-buffer " foo" t) + (add-hook 'kill-buffer-hook kbh nil t) + (add-hook 'kill-buffer-query-functions kbqf nil t) + (kill-buffer)) + (with-temp-buffer) + (with-output-to-string) + (should-not run-bluh) + (should-not run-kbh) + (should-not run-kbqf) + + ;; Not inhibited. + (with-current-buffer (generate-new-buffer " foo") + (should run-bluh) + (add-hook 'kill-buffer-hook kbh nil t) + (add-hook 'kill-buffer-query-functions kbqf nil t) + (kill-buffer)) + (should run-kbh) + (should run-kbqf)) + (remove-hook 'buffer-list-update-hook bluh)))) + ;;; buffer-tests.el ends here -- 2.29.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 07 17:37:21 2020 Received: (at 34765) by debbugs.gnu.org; 7 Dec 2020 22:37:21 +0000 Received: from localhost ([127.0.0.1]:55780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmP8D-0004HT-6r for submit@debbugs.gnu.org; Mon, 07 Dec 2020 17:37:21 -0500 Received: from mail-wr1-f45.google.com ([209.85.221.45]:44995) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmP89-0004HD-AR for 34765@debbugs.gnu.org; Mon, 07 Dec 2020 17:37:19 -0500 Received: by mail-wr1-f45.google.com with SMTP id x6so10416180wro.11 for <34765@debbugs.gnu.org>; Mon, 07 Dec 2020 14:37:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=9N3JUa1OStIABvXT9WGPf52BdrehSA/iJJl8eUcNSa8=; b=doEC8KolJbVqcQFBhHVHpDzaARxRyIjjMYT23U1gvZb3Z8Z33t3b8NnCiac3jn0eDF l72iqF8osfje02XW75OZRo7J4RpwioRwfp3HwsiOitIHrdZgkX+nL3eThBVbfiZ9oJgy ep4wUHiH0jS9Gyuv2lKEbEI4TiPMSyM+FyKtDSiSLemWdDi2NNgoNQ/drJ91oKAWyJB0 h52oSMRcJ/tO7LIaJlbneNJU4XHMJkuKXBzjxK3aj+p+ZNexcQz9sc1ZRG/idVjvVpjp WUmHHKM1W+plfSvh3A/4/XrqrfsSeqcMHqlQ8uXc2C5vCUaT6DWhJlrCYp/AmgTXaKki EAQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=9N3JUa1OStIABvXT9WGPf52BdrehSA/iJJl8eUcNSa8=; b=jrmpc9QK67AQHSUbZuOkGgYhGP2Hzm1uOk4U+E1GnCTT+42uk6wsXOoUONi7mnaSOq bfDe6ZMo5HVQUt4Crdpp35WnVzto2Mb+RRHH0t2BnTvkOKb+jpQp+ruQuaPlTSEEPx4O dn6q8W+LyRlC6F1shnHd72qSBm6/lNXDlnGudMjE6tr+Jrnzz0S6uEQliXIQwf9abnIH PAqVrTN3t4yzkecQS8dK3W13VeALtpdMDXLQw+XfjAHG2UXKYoKR7+xcucezb4KKOSbO OGsBE6zLcOlNelnjefY8XIPQroz47djC2ePs8IIbyTC6ClImfkePKekzWuPNo+SmwKIJ EfEA== X-Gm-Message-State: AOAM5339nv78xe5JUNeoqpeIsSuD/o05t9uLCiVRLdGdWMauB4vEwiHR 5goE9MhtfdJplEGaapnxp01zeQ== X-Google-Smtp-Source: ABdhPJwTJ9iU2TwgAXzm83O0H2ej42uLaMr67Ki76Z6b95X82C7RWltFR4g9vnj4FmCb5/p2ytQUlQ== X-Received: by 2002:adf:cc86:: with SMTP id p6mr21867674wrj.76.1607380631318; Mon, 07 Dec 2020 14:37:11 -0800 (PST) Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id d15sm18013596wrx.93.2020.12.07.14.37.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 14:37:10 -0800 (PST) From: "Basil L. Contovounesios" To: Eli Zaretskii Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> <87360qoa6o.fsf@tcd.ie> <878sa9cle0.fsf@tcd.ie> Date: Mon, 07 Dec 2020 22:37:09 +0000 In-Reply-To: <878sa9cle0.fsf@tcd.ie> (Basil L. Contovounesios's message of "Mon, 07 Dec 2020 22:16:23 +0000") Message-ID: <87360hckfe.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, larsi@gnus.org, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) "Basil L. Contovounesios" writes: > +/* Run 'buffer-list-update-hook' if Vrun_hooks is non-nil, and BUF is > + either NULL or does not have buffer hooks inhibited. */ > + > +static void > +run_buffer_list_update_hook (struct buffer *buf) { ^^ Oops, will fix style locally. > + if (! (NILP (Vrun_hooks) || (buf && buf->inhibit_buffer_hooks))) > + call1 (Vrun_hooks, Qbuffer_list_update_hook); > +} -- Basil From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 08 03:09:27 2020 Received: (at 34765) by debbugs.gnu.org; 8 Dec 2020 08:09:27 +0000 Received: from localhost ([127.0.0.1]:56459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmY3r-0003pi-9R for submit@debbugs.gnu.org; Tue, 08 Dec 2020 03:09:27 -0500 Received: from mout.gmx.net ([212.227.15.18]:47481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmY3m-0003pR-PF for 34765@debbugs.gnu.org; Tue, 08 Dec 2020 03:09:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1607414950; bh=hdKQyg7QOs0NacY/y8yd/ldPEB2Fq/UjVrLBS8Agohw=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=SDrDyOmMUH1ortDNGu5Ux3vW1HrQVM8RmEvXthgqErbz6Nzi+dvNXW8jxlI5F3Ft/ eQ1uBJgOobesjzcBZrAsgVGOOHKT6q11JCQv6yWdOi9wWSUScTLPUDNw2N/EKIUF/H 3qJg7Y7JyBPnf4Xp8x3A7eNI7OGF2VntLn0f7pZA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.100] ([46.125.249.58]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MCbEf-1kuUXG3zDX-009gjT; Tue, 08 Dec 2020 09:09:10 +0100 Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook To: "Basil L. Contovounesios" , Eli Zaretskii References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> <87360qoa6o.fsf@tcd.ie> <878sa9cle0.fsf@tcd.ie> <87360hckfe.fsf@tcd.ie> From: martin rudalics Message-ID: <232420c9-18fa-ae93-13d6-97b914bdf949@gmx.at> Date: Tue, 8 Dec 2020 09:09:07 +0100 MIME-Version: 1.0 In-Reply-To: <87360hckfe.fsf@tcd.ie> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:VCwUNlaRw/1Z6KmBQaKlThqgGC9TlQ3aFYvFnS5FznAXZvf64vt ESHwljryMv94HRh+GJ0cN24KzZJJpHZR06SC2CKhGuTP8YLJ3oOV251Y8o6nIoy7HBslnI7 jVAPyO+7r7WTac5wmdTdCkT1mhwet1Z/LZA90jVSfGpxI+CLha7DOJuvpn38roGZv4cJx8S 7OMfSNTzAcsX2Nv4lBgjQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:efT+uUyxCIE=:J+CJr7Sn0tMxdpX7Jr+/kO 6zgfByCmpCFGVgF3u4AGrO0KgbOcJHYsikE7lqS4kG6aYQYnUWZnuAttBo/tFV/ZKEDcbAduL 36VHZD7HcIsRBF/0b9EYJv21sVxGDFfc6n35y04JVd2PINrx7Bu7LMqrr9kVQ8bXvNAsw+b4D V3f4rmFh7+A46h9cg1YJZXK+IDt7JIohyxLe+/zSKUCsXgtsreRTp9ptZ9BNkaMjDlfufBvwp BKIikB1YCGIhh5FB/EpeaTtgf6r7TCKyXaXJvkLyVEp6+hLfVYstVDX2xsghny5UiUYnsJFWv 4IgbO61jK7Z4Y41bRrqp2NP6Urh4Y+IlYUwOkubNBOmNaTpPsoiHUfQ1JaNEnbNwzGR9Vk7JM fM9D1fBHGNS8oedoCBfaGa6HDDLiXurbEeQuheXI15GKuvBuq5vVBj3fKU4ll2u8k0hLQk9gv tuapQwP7vcRBtgfoEGnzgLK6jLEW0xE2AOYZDcPVPuyeJoijBLAWKC2VixIFijrf3Fm8hlWf/ FgzoBarXRabff2Jn+imBPbA8bnEJhKImrZcAayjBlvArHgaxt9DrpR5zpOMxl467nWloGfUp0 iQwbfpnICnemIJex7H7//aIC6H42VI5YNyOoKldAK/5WtalcQEXoE7GE7HWREALz0tCTCYSfZ 1yFGFHRiMID9zNA5p+yW/wpZ1N0NkATfpof8m1WZIF5N9IfXaKrJtQ4YooxUVWkx+XmeRdpSi EzqEARfDoN2DLnu6rHjzx8BHZSkwdJUDQqWUvFlWD4f4Pf6nU+U09c/18GlSp3uYwlr1BtECg n4h5ItaV9ih/GGCfXEiuOR69UDJwPUZZsmn73kRS3QXx3WIOqLTTqRDS9PZeFSZK9EYAz2eVC QHHxCIrfmJESevNjHzLg== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, larsi@gnus.org, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> +run_buffer_list_update_hook (struct buffer *buf) { > ^^ > Oops, will fix style locally. Incidentally, that was the only thing I found. The rest looks good to me. Thank you, martin From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 14 16:03:27 2020 Received: (at 34765) by debbugs.gnu.org; 14 Dec 2020 21:03:28 +0000 Received: from localhost ([127.0.0.1]:54706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kov0B-0005ed-Nb for submit@debbugs.gnu.org; Mon, 14 Dec 2020 16:03:27 -0500 Received: from mail-wr1-f43.google.com ([209.85.221.43]:44160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kov09-0005eO-AN for 34765@debbugs.gnu.org; Mon, 14 Dec 2020 16:03:27 -0500 Received: by mail-wr1-f43.google.com with SMTP id w5so14075322wrm.11 for <34765@debbugs.gnu.org>; Mon, 14 Dec 2020 13:03:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=D1X/gzA+YSlDJ+cyBjr+FWeg9SQXVWZbqim8l4V/c/I=; b=iQ0XdyAf7R7SwYnb+6ZqtQgJnLtEBbKBEBKcxzZr8bBhwxXGcUOoSofX5ZaXxexw2N kABb9f/u4f/86qWAfKDxurTDU/mipO+8Y3sra+5fCGkFP1oF40uZyO/JLhARuhhpFJ9g mAilcF2OlV2jClZFEANipNAtBLinuQnFZttAjpJjsE4fje1dGsg93EW/71XeDaTP9r93 5/oYCv9n/mrtCiFffSdIsQVdaNMJgNRXBO92iBOubt/YjJQrTMan7aoudgdpm9vJUcDC rm4DtuCL60Sy6nYDNZnuPx5psVoHBJvMGCunocTk4b6zL+lGqSgELEoeeSSyUIESty94 2nIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=D1X/gzA+YSlDJ+cyBjr+FWeg9SQXVWZbqim8l4V/c/I=; b=G5OyuC8H4HpKLxiuUTl3CUAmNOJVSyMsEmfmdf92swWs94eQ9UaNtPJwjSzTf1c3vo 0s3ih2AcQTam8SccaPJ9E8Tcu9N7nhyZn9jY5VgPT4i30ZOuoqA0f2IE64eKpshmG5SM LsTqREPvOifsZJAIgVFH6ewGxZDow9qTrHz3dowEXz5pkfZYj2YsQ3r0eSaa19n1ujnf y9aTOuExorr7GTl+WGw8VjYtC4wzgDhZGlUPEcIQiwKkDyDqYDXyvOdg7XuQqARrNp42 Vm/om5TNkgdsB4pzjlW2XU5tQRx29wwuTNz2L1Msp/gsiaJJPVRfcOGmBs4/BJ8w4POd lfGw== X-Gm-Message-State: AOAM532JCJlHak0d/PUP3Ja6JiLNzN/M01S1mEhF6b40tniyLsXEwO9W kY4ImIfCygAMbF3jeMCWxq6XLA== X-Google-Smtp-Source: ABdhPJyEuwKtosrX4bMugWPHeoLnzZ6ahW+GTIHHcBiQnDqcGR2mHVg9b0ikitsRyzVN1LuDKBOO3A== X-Received: by 2002:adf:cd8f:: with SMTP id q15mr29965284wrj.79.1607979799034; Mon, 14 Dec 2020 13:03:19 -0800 (PST) Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id j7sm32635487wmb.40.2020.12.14.13.03.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 13:03:18 -0800 (PST) From: "Basil L. Contovounesios" To: martin rudalics Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> <87360qoa6o.fsf@tcd.ie> <878sa9cle0.fsf@tcd.ie> <87360hckfe.fsf@tcd.ie> <232420c9-18fa-ae93-13d6-97b914bdf949@gmx.at> Date: Mon, 14 Dec 2020 21:03:16 +0000 In-Reply-To: <232420c9-18fa-ae93-13d6-97b914bdf949@gmx.at> (martin rudalics's message of "Tue, 8 Dec 2020 09:09:07 +0100") Message-ID: <87sg889k2z.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, alexanderm@web.de, Eli Zaretskii , larsi@gnus.org, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) martin rudalics writes: >>> +run_buffer_list_update_hook (struct buffer *buf) { >> ^^ >> Oops, will fix style locally. > > Incidentally, that was the only thing I found. The rest looks good to > me. Thanks. I'll give it a few more days in case Eli, Lars, or anyone else has any comments/objections before pushing. -- Basil From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 15 11:04:22 2020 Received: (at 34765) by debbugs.gnu.org; 15 Dec 2020 16:04:22 +0000 Received: from localhost ([127.0.0.1]:58900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpCo9-00031L-8b for submit@debbugs.gnu.org; Tue, 15 Dec 2020 11:04:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpCo5-000311-Kb for 34765@debbugs.gnu.org; Tue, 15 Dec 2020 11:04:11 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53252) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpCnz-0008NE-9L; Tue, 15 Dec 2020 11:04:03 -0500 Received: from [176.228.60.248] (port=4351 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kpCny-00067F-AY; Tue, 15 Dec 2020 11:04:03 -0500 Date: Tue, 15 Dec 2020 18:03:55 +0200 Message-Id: <83eejrawes.fsf@gnu.org> From: Eli Zaretskii To: "Basil L. Contovounesios" In-Reply-To: <87sg889k2z.fsf@tcd.ie> (contovob@tcd.ie) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> <87360qoa6o.fsf@tcd.ie> <878sa9cle0.fsf@tcd.ie> <87360hckfe.fsf@tcd.ie> <232420c9-18fa-ae93-13d6-97b914bdf949@gmx.at> <87sg889k2z.fsf@tcd.ie> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, larsi@gnus.org, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > From: "Basil L. Contovounesios" > Cc: Eli Zaretskii , larsi@gnus.org, 34765@debbugs.gnu.org, > alexanderm@web.de, monnier@IRO.UMontreal.CA > Date: Mon, 14 Dec 2020 21:03:16 +0000 > > martin rudalics writes: > > >>> +run_buffer_list_update_hook (struct buffer *buf) { > >> ^^ > >> Oops, will fix style locally. > > > > Incidentally, that was the only thing I found. The rest looks good to > > me. > > Thanks. I'll give it a few more days in case Eli, Lars, or anyone else > has any comments/objections before pushing. I will review it soon. Sorry for the delay. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 15 11:24:42 2020 Received: (at 34765) by debbugs.gnu.org; 15 Dec 2020 16:24:42 +0000 Received: from localhost ([127.0.0.1]:58934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpD7x-0003WL-Oo for submit@debbugs.gnu.org; Tue, 15 Dec 2020 11:24:42 -0500 Received: from mail-wr1-f54.google.com ([209.85.221.54]:45809) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpD7v-0003W8-EP for 34765@debbugs.gnu.org; Tue, 15 Dec 2020 11:24:40 -0500 Received: by mail-wr1-f54.google.com with SMTP id d26so7239542wrb.12 for <34765@debbugs.gnu.org>; Tue, 15 Dec 2020 08:24:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=MAExkPzFkYrUkPFetAp0S43Gbe9WAKsvLulq9JzBZDI=; b=QZ7/fJf0TuY4Ce/yNS51EU0FozYDKn0kxqKRShsseI8ZeNlMpRyhMXtrHOS/inhcRz TMC3fvkLPpQpAIlhm8al7XFWmcbiysXjIxh4uzE9eMv+P+BdbjCG1gBXP1GBp0aqxMC+ 51WbLHJ+Px0FfVgkb8lbj4l4uj4czGpnQniiL9npUKKKUHjlx6D62YLauiavmDXnu+TR 6FMpn7UWq8jOUrH8ctqK9pZ6o5l2u0v3rsMGwbwn5xWo18aM+n8YQgcEjAZvq/RLeSBu bc5ZXq9d7Ssi8nw1iliC/o+xxOK5qsbe/PlObencCbndgCJlfaU51eh5Z1OymcdDGP0w KL4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=MAExkPzFkYrUkPFetAp0S43Gbe9WAKsvLulq9JzBZDI=; b=SOq/xPPbbppMtKGEEcf4QCSif+0UvAj3mF/8BUscVtML6K+dG5W6xgSPRDj3Y5U7oN ZU9gxdY2QdgJSM8L7lBCnWcUySm0RoLtSO46cpaF7i9wc2XjM2W9mCJIMv0ReoUw2PlP 8Pbue3x/0MEotgAOKeJqrL9mGfSlJP9LposQLeph2XHg4UC0ze6Sw3O9e/xzxBwodjee jCzvhFuQkqvirs5Q46oNmglouLh0D1AzLzO6PVpOC8fbbqPXQkNgO4FTkcwysSCUA5+A nFLt+GqocjURU7/i9aGHL/DlmCSHTQPdNpd3ZrvxglEMVDTdaOXxFUVCkSst/i8EbNSL j8Cw== X-Gm-Message-State: AOAM533wVgSV2IGB7Jzp0EV7tnmSXhd7/Y4uL+7wewFXvyExIyzmsb7T oksEW5dnybgLnLN3u6mhxyAIWA== X-Google-Smtp-Source: ABdhPJzY90QwYn8P2CkqptpJcVGuo6yt+EYy8m2uKH0n5tw3SqEfyfo9tEGEjZg7FKZWzlArc3BDFw== X-Received: by 2002:adf:e48d:: with SMTP id i13mr3564057wrm.48.1608049473280; Tue, 15 Dec 2020 08:24:33 -0800 (PST) Received: from localhost ([2a02:8084:20e2:c380:1f68:7ff5:120d:64e]) by smtp.gmail.com with ESMTPSA id m81sm39101872wmf.29.2020.12.15.08.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Dec 2020 08:24:32 -0800 (PST) From: "Basil L. Contovounesios" To: Eli Zaretskii Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> <87360qoa6o.fsf@tcd.ie> <878sa9cle0.fsf@tcd.ie> <87360hckfe.fsf@tcd.ie> <232420c9-18fa-ae93-13d6-97b914bdf949@gmx.at> <87sg889k2z.fsf@tcd.ie> <83eejrawes.fsf@gnu.org> Date: Tue, 15 Dec 2020 16:24:31 +0000 In-Reply-To: <83eejrawes.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 15 Dec 2020 18:03:55 +0200") Message-ID: <87wnxjt4u8.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, larsi@gnus.org, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > I will review it soon. Sorry for the delay. No need to apologise, there's no rush on my end. Thanks, -- Basil From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 18 09:57:36 2020 Received: (at 34765) by debbugs.gnu.org; 18 Dec 2020 14:57:36 +0000 Received: from localhost ([127.0.0.1]:39523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqHCK-0001ci-6X for submit@debbugs.gnu.org; Fri, 18 Dec 2020 09:57:36 -0500 Received: from mail-wm1-f52.google.com ([209.85.128.52]:51666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqHCI-0001cW-S4 for 34765@debbugs.gnu.org; Fri, 18 Dec 2020 09:57:35 -0500 Received: by mail-wm1-f52.google.com with SMTP id v14so2604542wml.1 for <34765@debbugs.gnu.org>; Fri, 18 Dec 2020 06:57:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=y7zUArwx2Oml4Fs1lKZkU9d6Djx9m6nKICIFOOrDgkQ=; b=iGy8vISLcL0h5ab1EILPrTVA9LpzNFrqkI4R/0Lgz/FJ1bwzfadcjZK+HwR31wvxgh ftnjsRq6ScSz/0oaMt3LKrfWdUyQ4QUoBCvA67FzP0GEq/Y/+WzGW7Oelq7gDNL9wGx+ M6vQnz2DFlH63LumOSCMqz5/O59PE0xI1rLUjFZ7r9/L4ONcfA9Odl/cn6do2D38uA3W qAN14miJsATAyUnYNnbMpJtHANe+NXJMcN6u5oZc8F5xfB7MflS31xJXRfUzqyDG5Dee DU4nmx9K7rU3Q07tLFm/czyGwjCPVu72ImwJsakGcmeeKUZ0JjLR8ShW8ojQeowO3Jhj HNmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=y7zUArwx2Oml4Fs1lKZkU9d6Djx9m6nKICIFOOrDgkQ=; b=mFEUT+FfA+6Jz3vq2ec7WS7SA1nd6x6RfwxVsfYEon+HJL3N8KvAMX1CVChE5fGTa9 tMdsqviXUDQHmFD7mvJuPfKGtaOPh+BzPq7IQu5hMep4VVqOtJ9fRHmEcyseTl7E4dNC ItLN/aNJZb0GxOpJ47WBWKrQDZShclgBtlBctR88b4FGK0LQ4x1lTCUwQzPptq7c9QHi I/4tPl1VGHVCUZP9HsLDNyhVMw7cC13VNk9juLM5GNqGdEMUcyLpk2hrjbm7g39Bo/Ar 0brYA+5EXGBnN4kLCFBpf/bkoLpehdsEBivoVfq791LTbm+H7K3i5x4pfsG0eP3raKn5 Rk+g== X-Gm-Message-State: AOAM53293KhQhqOTjhSBBPG4mWPpNpJ2VjzSgDT65CENqko9QfIYUkId esbOrYd0VLTPcooM6QVtZWkUTw== X-Google-Smtp-Source: ABdhPJxBYewGMoTCW+6ils8tTuSAy+lar3tGPuK6GCfAFEJfAYvAAD9O/DPb1qAjNHi2GhPuiRozaA== X-Received: by 2002:a7b:c055:: with SMTP id u21mr4629558wmc.130.1608303448773; Fri, 18 Dec 2020 06:57:28 -0800 (PST) Received: from localhost ([2a02:8084:20e2:c380:1f68:7ff5:120d:64e]) by smtp.gmail.com with ESMTPSA id q1sm13372308wrj.8.2020.12.18.06.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 06:57:27 -0800 (PST) From: "Basil L. Contovounesios" To: Eli Zaretskii Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> <87360qoa6o.fsf@tcd.ie> <878sa9cle0.fsf@tcd.ie> Date: Fri, 18 Dec 2020 14:57:26 +0000 In-Reply-To: <878sa9cle0.fsf@tcd.ie> (Basil L. Contovounesios's message of "Mon, 07 Dec 2020 22:16:23 +0000") Message-ID: <87r1nnb1rd.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, larsi@gnus.org, monnier@IRO.UMontreal.CA, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) "Basil L. Contovounesios" writes: > (defmacro with-temp-file (file &rest body) > "Create a new buffer, evaluate BODY there, and write the buffer to FILE. > The value returned is the value of the last form in BODY. > -See also `with-temp-buffer'." > +The buffer is created using `with-temp-buffer', which see." > (declare (indent 1) (debug t)) > - (let ((temp-file (make-symbol "temp-file")) > - (temp-buffer (make-symbol "temp-buffer"))) > - `(let ((,temp-file ,file) > - (,temp-buffer (generate-new-buffer " *temp file*"))) > - (unwind-protect > - (prog1 > - (with-current-buffer ,temp-buffer > - ,@body) > - (with-current-buffer ,temp-buffer > - (write-region nil nil ,temp-file nil 0))) > - (and (buffer-name ,temp-buffer) > - (kill-buffer ,temp-buffer)))))) > + `(with-temp-buffer > + (prog1 (progn ,@body) > + (write-region nil nil ,file nil 0)))) Reading another thread made me realise that this changes the argument evaluation order, so I'll fix that too. -- Basil From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 18 10:36:33 2020 Received: (at 34765) by debbugs.gnu.org; 18 Dec 2020 15:36:33 +0000 Received: from localhost ([127.0.0.1]:39670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqHo0-0004nw-PF for submit@debbugs.gnu.org; Fri, 18 Dec 2020 10:36:32 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:38312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqHny-0004ni-BO for 34765@debbugs.gnu.org; Fri, 18 Dec 2020 10:36:31 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0C8E210022E; Fri, 18 Dec 2020 10:36:25 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 904D9100018; Fri, 18 Dec 2020 10:36:23 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1608305783; bh=R5Ag/7oNxu7+I19SjOXpAXdh0c7tPpLo7I8Ez4MTcS0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ZcjfJTQ4gvqWdblLE8ddoubEc2i67LAY8+C4YnWTZHSghqOl2ViEW/lNvRTy0U4Id v9ghvjPPSt9ZTP/LB5wiI4Sncfx5D+wgO8Sl1fn9Az+SEOjLuRZ5FTqONJyqMais8I VAnXz4r1FidSD9MBwLZrrwDvuZQkW8oXW5qSFZXCbbqQFkxG4cEkPYblnZ++nkK5ON c4O9keJUzmLUikAm+bKaUIx3qQ1HFKlt+apDozEJef3glkpVuNWf9iwOvtqJYnAjEj c6DskDuT7J88kKlCCtmWCpGCYYN+B8/1OlEM+00wfKTdu6A7ObzhmjuCv7HPfFwvo8 fbvJ5Sxb9JesA== Received: from alfajor (69-165-136-52.dsl.teksavvy.com [69.165.136.52]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 44DA512030D; Fri, 18 Dec 2020 10:36:23 -0500 (EST) From: Stefan Monnier To: "Basil L. Contovounesios" Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook Message-ID: References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> <87360qoa6o.fsf@tcd.ie> <878sa9cle0.fsf@tcd.ie> Date: Fri, 18 Dec 2020 10:36:22 -0500 In-Reply-To: <878sa9cle0.fsf@tcd.ie> (Basil L. Contovounesios's message of "Mon, 07 Dec 2020 22:16:23 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.088 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, Eli Zaretskii , larsi@gnus.org, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > (defmacro with-temp-file (file &rest body) > "Create a new buffer, evaluate BODY there, and write the buffer to FILE. > The value returned is the value of the last form in BODY. > -See also `with-temp-buffer'." > +The buffer is created using `with-temp-buffer', which see." > (declare (indent 1) (debug t)) > - (let ((temp-file (make-symbol "temp-file")) > - (temp-buffer (make-symbol "temp-buffer"))) > - `(let ((,temp-file ,file) > - (,temp-buffer (generate-new-buffer " *temp file*"))) > - (unwind-protect > - (prog1 > - (with-current-buffer ,temp-buffer > - ,@body) > - (with-current-buffer ,temp-buffer > - (write-region nil nil ,temp-file nil 0))) > - (and (buffer-name ,temp-buffer) > - (kill-buffer ,temp-buffer)))))) > + `(with-temp-buffer > + (prog1 (progn ,@body) > + (write-region nil nil ,file nil 0)))) You lost the `(with-current-buffer ,temp-buffer` around `write-region` so your new code will break if `body` doesn't preserve current-buffer. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 18 13:50:07 2020 Received: (at 34765) by debbugs.gnu.org; 18 Dec 2020 18:50:07 +0000 Received: from localhost ([127.0.0.1]:39901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqKpJ-00014j-55 for submit@debbugs.gnu.org; Fri, 18 Dec 2020 13:50:07 -0500 Received: from mail-wm1-f48.google.com ([209.85.128.48]:55594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqKpF-000146-A3 for 34765@debbugs.gnu.org; Fri, 18 Dec 2020 13:50:03 -0500 Received: by mail-wm1-f48.google.com with SMTP id x22so3309142wmc.5 for <34765@debbugs.gnu.org>; Fri, 18 Dec 2020 10:50:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=1Pa77EZvlVVqkMdukoczLBx+xXOFiCSm/zRwm5vNPzc=; b=dkmixFg7tgOyGHvAdk19AhDRAun57nitr8nczltk0cV/+lJS3UX4X6dcJJ9+suTs8a pL/CU+rkELENYq46T5xVyT+VbGstDE4f6GV0JqhvtZ9hi/2aTelkvCfRR2nSrgje1DeE vmcXozHkW9dkbRJisU8lARJp5kJNJA0Jn6AiBvnLxjlGDooi8LKZqO6x7Y4XU+bMf5Rp jw/XSBnBSPqQ+wNAzdpowcqG0NyjkEJ8Jt8P6WgCQwet/v3B7/N0uS4taiY4tHCAgOQh 5J5w2AgLDtyfK+nxuIPH0KLDDX9E8Yn9hUs1JwaUOrExJwZI7rvkfbWSBX8W6zvsCpeT aTqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=1Pa77EZvlVVqkMdukoczLBx+xXOFiCSm/zRwm5vNPzc=; b=e7Xwxc9Iwg/kABPQTfOkZTWGa+x/QQZ/GvgRdKBuZP3nSgcTkWhrnlbtesXwNLbdiC Jk9tZTr3FHSkBY65zumr0rZm61H4eAyBivXOLba7+R9lvmesRZ0uGL0vjgiN7pR5Vfgi 388ZaiPh6EhgG6aXS9X562CbFM8zLfiKz9ptV/fZgdlBhp8nhYndqsM7N1xMxY9f3kDc u1lZryZfO90ZRGcOkDmHKwgQM14VlM3yX3YIGwi7QST3We3x6ZB/S/jJ1x/n10kpka+I a4LUAcT0ckeNuXW/pI49DT+m2ZWLCy1/JawKpEPo6iflmgOOE+nfkCdc0v3VIRPNznRI YLQQ== X-Gm-Message-State: AOAM532+iBc2wWrAOINNyIToZZyRkBYZl/y/gWr32lNGJ7kdGmmBAe+5 av6JhaYojagOlivG9NUDPYSgEQ== X-Google-Smtp-Source: ABdhPJwZKdHNyd4YKmk0Ci6D82ySIf01wlPNdGbcrCEU0id0/sKb8twcRwLnFMsDjILvsqB/pN05uQ== X-Received: by 2002:a1c:3b02:: with SMTP id i2mr5289534wma.141.1608317395123; Fri, 18 Dec 2020 10:49:55 -0800 (PST) Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id i16sm14383916wrx.89.2020.12.18.10.49.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 10:49:53 -0800 (PST) From: "Basil L. Contovounesios" To: Stefan Monnier Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> <87360qoa6o.fsf@tcd.ie> <878sa9cle0.fsf@tcd.ie> Date: Fri, 18 Dec 2020 18:49:52 +0000 In-Reply-To: (Stefan Monnier's message of "Fri, 18 Dec 2020 10:36:22 -0500") Message-ID: <87eejnaqzz.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, Eli Zaretskii , larsi@gnus.org, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Stefan Monnier writes: > You lost the `(with-current-buffer ,temp-buffer` around `write-region` > so your new code will break if `body` doesn't preserve current-buffer. Ugh, I thought the caller couldn't kill the buffer because it's later written, but I didn't think of excursions. I've now attached an updated patch. Thanks, -- Basil --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Inhibit-buffer-hooks-in-temporary-buffers.patch >From d2b2648efa51343a3b7dd84ada89110e84aa8658 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 1 Dec 2020 01:12:32 +0000 Subject: [PATCH] Inhibit buffer hooks in temporary buffers Give get-buffer-create an optional argument to inhibit buffer hooks in internal or temporary buffers for efficiency (bug#34765). * .dir-locals.el (c-mode): Enforce existing indent-tabs-mode policy. * etc/NEWS: Announce new parameter of get-buffer-create and generate-new-buffer, and that with-temp-buffer and with-temp-file now inhibit buffer hooks. * doc/lispref/buffers.texi (Buffer Names): Fix typo. (Creating Buffers): Document new parameter of get-buffer-create and generate-new-buffer. (Buffer List, Killing Buffers): Document when buffer hooks are inhibited. (Current Buffer): * doc/lispref/files.texi (Writing to Files): Document that with-temp-buffer and with-temp-file inhibit buffer hooks. * doc/lispref/internals.texi (Buffer Internals): Document inhibit_buffer_hooks flag. Remove stale comment. * doc/misc/gnus-faq.texi (FAQ 5-8): * lisp/simple.el (shell-command-on-region): Fix indentation. * lisp/files.el (kill-buffer-hook): Document when hook is inhibited. (create-file-buffer): * lisp/gnus/gnus-uu.el (gnus-uu-unshar-article): * lisp/international/mule.el (load-with-code-conversion): * lisp/mh-e/mh-xface.el (mh-x-image-url-fetch-image): * lisp/net/imap.el (imap-open): * lisp/net/mailcap.el (mailcap-maybe-eval): * lisp/progmodes/flymake-proc.el (flymake-proc--read-file-to-temp-buffer) (flymake-proc--copy-buffer-to-temp-buffer): Simplify. * lisp/subr.el (generate-new-buffer): Forward new optional argument to inhibit buffer hooks to get-buffer-create. (with-temp-file, with-temp-buffer, with-output-to-string): * lisp/json.el (json-encode-string): Inhibit buffer hooks in buffer used. * src/buffer.c (run_buffer_list_update_hook): New helper function. (Fget_buffer_create): Use it. Add optional argument to set inhibit_buffer_hooks flag instead of comparing the buffer name to Vcode_conversion_workbuf_name. All callers changed. (Fmake_indirect_buffer, Frename_buffer, Fbury_buffer_internal) (record_buffer): Use run_buffer_list_update_hook. (Fkill_buffer): Document when buffer hooks are inhibited. Use run_buffer_list_update_hook. (init_buffer_once): Inhibit buffer hooks in Vprin1_to_string_buffer. (Vkill_buffer_query_functions, Vbuffer_list_update_hook): Document when hooks are inhibited. * src/buffer.h (struct buffer): Update inhibit_buffer_hooks commentary. * src/coding.h (Vcode_conversion_workbuf_name): * src/coding.c (Vcode_conversion_workbuf_name): Make static again since it is no longer needed in src/buffer.c. (code_conversion_restore, code_conversion_save, syms_of_coding): Prefer boolean over integer constants. * src/fileio.c (Finsert_file_contents): Inhibit buffer hooks in " *code-converting-work*" buffer. * src/window.c (Fselect_window): Fix grammar. Mention window-selection-change-functions alongside buffer-list-update-hook. * test/src/buffer-tests.el: Fix requires. (buffer-tests-inhibit-buffer-hooks): New test. --- .dir-locals.el | 1 + doc/lispref/buffers.texi | 55 +++++++++++++++------ doc/lispref/files.texi | 7 ++- doc/lispref/internals.texi | 11 ++++- doc/misc/gnus-faq.texi | 8 ++-- etc/NEWS | 16 +++++++ lisp/files.el | 6 ++- lisp/gnus/gnus-uu.el | 3 +- lisp/international/mule.el | 9 ++-- lisp/json.el | 2 +- lisp/mh-e/mh-xface.el | 3 +- lisp/net/imap.el | 3 +- lisp/net/mailcap.el | 3 +- lisp/progmodes/flymake-proc.el | 13 +++-- lisp/simple.el | 3 +- lisp/subr.el | 17 ++++--- src/buffer.c | 87 +++++++++++++++++++--------------- src/buffer.h | 10 ++-- src/callproc.c | 5 +- src/coding.c | 12 ++--- src/coding.h | 3 -- src/fileio.c | 2 +- src/minibuf.c | 2 +- src/print.c | 2 +- src/process.c | 12 ++--- src/w32fns.c | 2 +- src/window.c | 7 +-- src/xdisp.c | 4 +- src/xfns.c | 2 +- src/xwidget.c | 3 +- test/src/buffer-tests.el | 33 +++++++++++-- 31 files changed, 217 insertions(+), 129 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el index 27d50c6069..b313945936 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -9,6 +9,7 @@ (c-noise-macro-names . ("INLINE" "ATTRIBUTE_NO_SANITIZE_UNDEFINED" "UNINIT" "CALLBACK" "ALIGN_STACK")) (electric-quote-comment . nil) (electric-quote-string . nil) + (indent-tabs-mode . t) (mode . bug-reference-prog))) (objc-mode . ((c-file-style . "GNU") (electric-quote-comment . nil) diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index 2860343628..c8c4852e30 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi @@ -225,13 +225,18 @@ Current Buffer @defmac with-temp-buffer body@dots{} @anchor{Definition of with-temp-buffer} -The @code{with-temp-buffer} macro evaluates the @var{body} forms -with a temporary buffer as the current buffer. It saves the identity of +The @code{with-temp-buffer} macro evaluates the @var{body} forms with +a temporary buffer as the current buffer. It saves the identity of the current buffer, creates a temporary buffer and makes it current, evaluates the @var{body} forms, and finally restores the previous -current buffer while killing the temporary buffer. By default, undo -information (@pxref{Undo}) is not recorded in the buffer created by -this macro (but @var{body} can enable that, if needed). +current buffer while killing the temporary buffer. + +By default, undo information (@pxref{Undo}) is not recorded in the +buffer created by this macro (but @var{body} can enable that, if +needed). The temporary buffer also does not run the hooks +@code{kill-buffer-hook}, @code{kill-buffer-query-functions} +(@pxref{Killing Buffers}), and @code{buffer-list-update-hook} +(@pxref{Buffer List}). The return value is the value of the last form in @var{body}. You can return the contents of the temporary buffer by using @@ -345,9 +350,9 @@ Buffer Names If the optional second argument @var{ignore} is non-@code{nil}, it should be a string, a potential buffer name. It means to consider -that potential buffer acceptable, if it is tried, even it is the name -of an existing buffer (which would normally be rejected). Thus, if -buffers named @samp{foo}, @samp{foo<2>}, @samp{foo<3>} and +that potential buffer acceptable, if it is tried, even if it is the +name of an existing buffer (which would normally be rejected). Thus, +if buffers named @samp{foo}, @samp{foo<2>}, @samp{foo<3>} and @samp{foo<4>} exist, @example @@ -932,13 +937,17 @@ Buffer List @defvar buffer-list-update-hook This is a normal hook run whenever the buffer list changes. Functions (implicitly) running this hook are @code{get-buffer-create} -(@pxref{Creating Buffers}), @code{rename-buffer} (@pxref{Buffer Names}), -@code{kill-buffer} (@pxref{Killing Buffers}), @code{bury-buffer} (see -above) and @code{select-window} (@pxref{Selecting Windows}). +(@pxref{Creating Buffers}), @code{rename-buffer} (@pxref{Buffer +Names}), @code{kill-buffer} (@pxref{Killing Buffers}), +@code{bury-buffer} (see above), and @code{select-window} +(@pxref{Selecting Windows}). This hook is not run for internal or +temporary buffers created by @code{get-buffer-create} or +@code{generate-new-buffer} with a non-@code{nil} argument +@var{inhibit-buffer-hooks}. Functions run by this hook should avoid calling @code{select-window} -with a nil @var{norecord} argument or @code{with-temp-buffer} since -either may lead to infinite recursion. +with a @code{nil} @var{norecord} argument since this may lead to +infinite recursion. @end defvar @node Creating Buffers @@ -951,12 +960,20 @@ Creating Buffers with the specified name; @code{generate-new-buffer} always creates a new buffer and gives it a unique name. + Both functions accept an optional argument @var{inhibit-buffer-hooks}. +If it is non-@code{nil}, the buffer they create does not run the hooks +@code{kill-buffer-hook}, @code{kill-buffer-query-functions} +(@pxref{Killing Buffers}), and @code{buffer-list-update-hook} +(@pxref{Buffer List}). This avoids slowing down internal or temporary +buffers that are never presented to users or passed on to other +applications. + Other functions you can use to create buffers include @code{with-output-to-temp-buffer} (@pxref{Temporary Displays}) and @code{create-file-buffer} (@pxref{Visiting Files}). Starting a subprocess can also create a buffer (@pxref{Processes}). -@defun get-buffer-create buffer-or-name +@defun get-buffer-create buffer-or-name &optional inhibit-buffer-hooks This function returns a buffer named @var{buffer-or-name}. The buffer returned does not become the current buffer---this function does not change which buffer is current. @@ -980,7 +997,7 @@ Creating Buffers buffer initially disables undo information recording (@pxref{Undo}). @end defun -@defun generate-new-buffer name +@defun generate-new-buffer name &optional inhibit-buffer-hooks This function returns a newly created, empty buffer, but does not make it current. The name of the buffer is generated by passing @var{name} to the function @code{generate-new-buffer-name} (@pxref{Buffer @@ -1092,6 +1109,10 @@ Killing Buffers they are called. The idea of this feature is that these functions will ask for confirmation from the user. If any of them returns @code{nil}, @code{kill-buffer} spares the buffer's life. + +This hook is not run for internal or temporary buffers created by +@code{get-buffer-create} or @code{generate-new-buffer} with a +non-@code{nil} argument @var{inhibit-buffer-hooks}. @end defvar @defvar kill-buffer-hook @@ -1100,6 +1121,10 @@ Killing Buffers The buffer to be killed is current when the hook functions run. @xref{Hooks}. This variable is a permanent local, so its local binding is not cleared by changing major modes. + +This hook is not run for internal or temporary buffers created by +@code{get-buffer-create} or @code{generate-new-buffer} with a +non-@code{nil} argument @var{inhibit-buffer-hooks}. @end defvar @defopt buffer-offer-save diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index d49ac42bb4..6949ca29c6 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -701,8 +701,11 @@ Writing to Files The current buffer is restored even in case of an abnormal exit via @code{throw} or error (@pxref{Nonlocal Exits}). -See also @code{with-temp-buffer} in @ref{Definition of -with-temp-buffer,, The Current Buffer}. +Like @code{with-temp-buffer} (@pxref{Definition of with-temp-buffer,, +Current Buffer}), the temporary buffer used by this macro does not run +the hooks @code{kill-buffer-hook}, @code{kill-buffer-query-functions} +(@pxref{Killing Buffers}), and @code{buffer-list-update-hook} +(@pxref{Buffer List}). @end defmac @node File Locks diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 28a5fdb349..757368bc98 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -2391,6 +2391,15 @@ Buffer Internals This flag indicates that redisplay optimizations should not be used to display this buffer. +@item inhibit_buffer_hooks +This flag indicates that the buffer should not run the hooks +@code{kill-buffer-hook}, @code{kill-buffer-query-functions} +(@pxref{Killing Buffers}), and @code{buffer-list-update-hook} +(@pxref{Buffer List}). It is set at buffer creation (@pxref{Creating +Buffers}), and avoids slowing down internal or temporary buffers, such +as those created by @code{with-temp-buffer} (@pxref{Definition of +with-temp-buffer,, Current Buffer}). + @item overlay_center This field holds the current overlay center position. @xref{Managing Overlays}. @@ -2404,8 +2413,6 @@ Buffer Internals and @code{overlays_after} is sorted in order of increasing beginning position. -@c FIXME? the following are now all Lisp_Object BUFFER_INTERNAL_FIELD (foo). - @item name A Lisp string that names the buffer. It is guaranteed to be unique. @xref{Buffer Names}. This and the following fields have their names diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi index adb812f572..c30e80ff56 100644 --- a/doc/misc/gnus-faq.texi +++ b/doc/misc/gnus-faq.texi @@ -1523,10 +1523,10 @@ FAQ 5-8 @example (setq message-default-headers - (with-temp-buffer - (insert "X-Face: ") - (insert-file-contents "~/.xface") - (buffer-string))) + (with-temp-buffer + (insert "X-Face: ") + (insert-file-contents "~/.xface") + (buffer-string))) @end example @noindent diff --git a/etc/NEWS b/etc/NEWS index 87463372d5..217b0b76a1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1817,6 +1817,13 @@ modifies the string's text properties; instead, it uses and returns a copy of the string. This helps avoid trouble when strings are shared or constants. ++++ +** Temporary buffers no longer run certain buffer hooks. +The macros 'with-temp-buffer' and 'with-temp-file' no longer run the +hooks 'kill-buffer-hook', 'kill-buffer-query-functions', and +'buffer-list-update-hook' for the temporary buffers they create. This +avoids slowing them down when a lot of these hooks are defined. + --- ** The obsolete function 'thread-alive-p' has been removed. @@ -2173,6 +2180,15 @@ Until it is solved you could ignore such errors by performing ** The error 'ftp-error' belongs also to category 'remote-file-error'. ++++ +** Buffers can now be created with certain hooks disabled. +The functions 'get-buffer-create' and 'generate-new-buffer' accept a +new optional argument 'inhibit-buffer-hooks'. If non-nil, the new +buffer does not run the hooks 'kill-buffer-hook', +'kill-buffer-query-functions', and 'buffer-list-update-hook'. This +avoids slowing down internal or temporary buffers that are never +presented to users or passed on to other applications. + * Changes in Emacs 28.1 on Non-Free Operating Systems diff --git a/lisp/files.el b/lisp/files.el index 093b5f92e5..70d451cccf 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1850,6 +1850,10 @@ kill-buffer-hook The buffer being killed is current while the hook is running. See `kill-buffer'. +This hook is not run for internal or temporary buffers created by +`get-buffer-create' or `generate-new-buffer' with argument +INHIBIT-BUFFER-HOOKS non-nil. + Note: Be careful with let-binding this hook considering it is frequently used for cleanup.") @@ -1951,7 +1955,7 @@ create-file-buffer (let ((lastname (file-name-nondirectory filename))) (if (string= lastname "") (setq lastname filename)) - (generate-new-buffer (if (string-match-p "\\` " lastname) + (generate-new-buffer (if (string-prefix-p " " lastname) (concat "|" lastname) lastname)))) diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index 70aeac00d7..00ca430cc5 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el @@ -1587,8 +1587,7 @@ gnus-uu-unshar-article (save-excursion (switch-to-buffer (current-buffer)) (delete-other-windows) - (let ((buffer (get-buffer-create (generate-new-buffer-name - "*Warning*")))) + (let ((buffer (generate-new-buffer "*Warning*"))) (unless (unwind-protect (with-current-buffer buffer diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 212e7232b4..6571454dff 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -307,12 +307,9 @@ load-with-code-conversion (and (null noerror) (signal 'file-error (list "Cannot open load file" file))) ;; Read file with code conversion, and then eval. - (let* ((buffer - ;; We can't use `generate-new-buffer' because files.el - ;; is not yet loaded. - (get-buffer-create (generate-new-buffer-name " *load*"))) - (load-in-progress t) - (source (save-match-data (string-match "\\.el\\'" fullname)))) + (let ((buffer (generate-new-buffer " *load*")) + (load-in-progress t) + (source (string-suffix-p ".el" fullname))) (unless nomessage (if source (message "Loading %s (source)..." file) diff --git a/lisp/json.el b/lisp/json.el index c2fc1574fa..5f512b94cd 100644 --- a/lisp/json.el +++ b/lisp/json.el @@ -435,7 +435,7 @@ json-encode-string (concat "\"" (substring-no-properties string) "\"") (with-current-buffer (or json--string-buffer - (with-current-buffer (generate-new-buffer " *json-string*") + (with-current-buffer (generate-new-buffer " *json-string*" t) ;; This seems to afford decent performance gains. (setq-local inhibit-modification-hooks t) (setq json--string-buffer (current-buffer)))) diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el index 909f1fe95d..65039310e7 100644 --- a/lisp/mh-e/mh-xface.el +++ b/lisp/mh-e/mh-xface.el @@ -425,8 +425,7 @@ mh-x-image-url-fetch-image be displayed in a buffer and position specified by MARKER. The actual display is carried out by the SENTINEL function." (if mh-wget-executable - (let ((buffer (get-buffer-create (generate-new-buffer-name - mh-temp-fetch-buffer))) + (let ((buffer (generate-new-buffer mh-temp-fetch-buffer)) (filename (or (mh-funcall-if-exists make-temp-file "mhe-fetch") (expand-file-name (make-temp-name "~/mhe-fetch"))))) (with-current-buffer buffer diff --git a/lisp/net/imap.el b/lisp/net/imap.el index 0394f0efea..50b08d9612 100644 --- a/lisp/net/imap.el +++ b/lisp/net/imap.el @@ -1033,8 +1033,7 @@ imap-open (when (funcall (nth 1 (assq stream imap-stream-alist)) buffer) ;; Stream changed? (if (not (eq imap-default-stream stream)) - (with-current-buffer (get-buffer-create - (generate-new-buffer-name " *temp*")) + (with-current-buffer (generate-new-buffer " *temp*") (mapc 'make-local-variable imap-local-variables) (set-buffer-multibyte nil) (buffer-disable-undo) diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index d0f8c1272d..bc99f02fe3 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -386,8 +386,7 @@ mailcap-maybe-eval (when (save-window-excursion (delete-other-windows) - (let ((buffer (get-buffer-create (generate-new-buffer-name - "*Warning*")))) + (let ((buffer (generate-new-buffer "*Warning*"))) (unwind-protect (with-current-buffer buffer (insert (substitute-command-keys diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el index 152dc725c7..e9d5018f30 100644 --- a/lisp/progmodes/flymake-proc.el +++ b/lisp/progmodes/flymake-proc.el @@ -429,16 +429,15 @@ flymake-proc--replace-region (defun flymake-proc--read-file-to-temp-buffer (file-name) "Insert contents of FILE-NAME into newly created temp buffer." - (let* ((temp-buffer (get-buffer-create (generate-new-buffer-name (concat "flymake:" (file-name-nondirectory file-name)))))) - (with-current-buffer temp-buffer - (insert-file-contents file-name)) - temp-buffer)) + (with-current-buffer (generate-new-buffer + (concat "flymake:" (file-name-nondirectory file-name))) + (insert-file-contents file-name) + (current-buffer))) (defun flymake-proc--copy-buffer-to-temp-buffer (buffer) "Copy contents of BUFFER into newly created temp buffer." - (with-current-buffer - (get-buffer-create (generate-new-buffer-name - (concat "flymake:" (buffer-name buffer)))) + (with-current-buffer (generate-new-buffer + (concat "flymake:" (buffer-name buffer))) (insert-buffer-substring buffer) (current-buffer))) diff --git a/lisp/simple.el b/lisp/simple.el index 090162b973..aab650e98a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4306,8 +4306,7 @@ shell-command-on-region (defun shell-command-to-string (command) "Execute shell command COMMAND and return its output as a string." (with-output-to-string - (with-current-buffer - standard-output + (with-current-buffer standard-output (shell-command command t)))) (defun process-file (program &optional infile buffer display &rest args) diff --git a/lisp/subr.el b/lisp/subr.el index 77c19c5bbf..6d5d7b4bac 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3701,10 +3701,11 @@ internal--after-with-selected-window (when (window-live-p (nth 1 state)) (select-window (nth 1 state) 'norecord))) -(defun generate-new-buffer (name) +(defun generate-new-buffer (name &optional inhibit-buffer-hooks) "Create and return a buffer with a name based on NAME. -Choose the buffer's name using `generate-new-buffer-name'." - (get-buffer-create (generate-new-buffer-name name))) +Choose the buffer's name using `generate-new-buffer-name'. +See `get-buffer-create' for the meaning of INHIBIT-BUFFER-HOOKS." + (get-buffer-create (generate-new-buffer-name name) inhibit-buffer-hooks)) (defmacro with-selected-window (window &rest body) "Execute the forms in BODY with WINDOW as the selected window. @@ -3866,12 +3867,14 @@ with-output-to-temp-buffer (defmacro with-temp-file (file &rest body) "Create a new buffer, evaluate BODY there, and write the buffer to FILE. The value returned is the value of the last form in BODY. +The buffer does not run the hooks `kill-buffer-hook', +`kill-buffer-query-functions', and `buffer-list-update-hook'. See also `with-temp-buffer'." (declare (indent 1) (debug t)) (let ((temp-file (make-symbol "temp-file")) (temp-buffer (make-symbol "temp-buffer"))) `(let ((,temp-file ,file) - (,temp-buffer (generate-new-buffer " *temp file*"))) + (,temp-buffer (generate-new-buffer " *temp file*" t))) (unwind-protect (prog1 (with-current-buffer ,temp-buffer @@ -3906,10 +3909,12 @@ with-temp-message (defmacro with-temp-buffer (&rest body) "Create a temporary buffer, and evaluate BODY there like `progn'. +The buffer does not run the hooks `kill-buffer-hook', +`kill-buffer-query-functions', and `buffer-list-update-hook'. See also `with-temp-file' and `with-output-to-string'." (declare (indent 0) (debug t)) (let ((temp-buffer (make-symbol "temp-buffer"))) - `(let ((,temp-buffer (generate-new-buffer " *temp*"))) + `(let ((,temp-buffer (generate-new-buffer " *temp*" t))) ;; `kill-buffer' can change current-buffer in some odd cases. (with-current-buffer ,temp-buffer (unwind-protect @@ -3944,7 +3949,7 @@ with-silent-modifications (defmacro with-output-to-string (&rest body) "Execute BODY, return the text it sent to `standard-output', as a string." (declare (indent 0) (debug t)) - `(let ((standard-output (generate-new-buffer " *string-output*"))) + `(let ((standard-output (generate-new-buffer " *string-output*" t))) (unwind-protect (progn (let ((standard-output standard-output)) diff --git a/src/buffer.c b/src/buffer.c index dfc34faf6e..9564f66096 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -37,7 +37,6 @@ Copyright (C) 1985-1989, 1993-1995, 1997-2020 Free Software Foundation, #include "window.h" #include "commands.h" #include "character.h" -#include "coding.h" #include "buffer.h" #include "region-cache.h" #include "indent.h" @@ -514,16 +513,32 @@ get_truename_buffer (register Lisp_Object filename) return Qnil; } -DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0, +/* Run 'buffer-list-update-hook' if Vrun_hooks is non-nil, and BUF is + either NULL or does not have buffer hooks inhibited. */ + +static void +run_buffer_list_update_hook (struct buffer *buf) +{ + if (! (NILP (Vrun_hooks) || (buf && buf->inhibit_buffer_hooks))) + call1 (Vrun_hooks, Qbuffer_list_update_hook); +} + +DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 2, 0, doc: /* Return the buffer specified by BUFFER-OR-NAME, creating a new one if needed. If BUFFER-OR-NAME is a string and a live buffer with that name exists, return that buffer. If no such buffer exists, create a new buffer with -that name and return it. If BUFFER-OR-NAME starts with a space, the new -buffer does not keep undo information. +that name and return it. + +If BUFFER-OR-NAME starts with a space, the new buffer does not keep undo +information. If optional argument INHIBIT-BUFFER-HOOKS is non-nil, the +new buffer does not run the hooks `kill-buffer-hook', +`kill-buffer-query-functions', and `buffer-list-update-hook'. This +avoids slowing down internal or temporary buffers that are never +presented to users or passed on to other applications. If BUFFER-OR-NAME is a buffer instead of a string, return it as given, even if it is dead. The return value is never nil. */) - (register Lisp_Object buffer_or_name) + (register Lisp_Object buffer_or_name, Lisp_Object inhibit_buffer_hooks) { register Lisp_Object buffer, name; register struct buffer *b; @@ -598,11 +613,7 @@ DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0, set_string_intervals (name, NULL); bset_name (b, name); - b->inhibit_buffer_hooks - = (STRINGP (Vcode_conversion_workbuf_name) - && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name), - SBYTES (Vcode_conversion_workbuf_name)) == 0); - + b->inhibit_buffer_hooks = !NILP (inhibit_buffer_hooks); bset_undo_list (b, SREF (name, 0) != ' ' ? Qnil : Qt); reset_buffer (b); @@ -614,9 +625,8 @@ DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0, /* Put this in the alist of all live buffers. */ XSETBUFFER (buffer, b); Vbuffer_alist = nconc2 (Vbuffer_alist, list1 (Fcons (name, buffer))); - /* And run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks) && !b->inhibit_buffer_hooks) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + + run_buffer_list_update_hook (b); return buffer; } @@ -890,9 +900,7 @@ DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer, set_buffer_internal_1 (old_b); } - /* Run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks)) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + run_buffer_list_update_hook (NULL); return buf; } @@ -1536,9 +1544,7 @@ DEFUN ("rename-buffer", Frename_buffer, Srename_buffer, 1, 2, && !NILP (BVAR (current_buffer, auto_save_file_name))) call0 (intern ("rename-auto-save-file")); - /* Run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks) && !current_buffer->inhibit_buffer_hooks) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + run_buffer_list_update_hook (current_buffer); /* Refetch since that last call may have done GC. */ return BVAR (current_buffer, name); @@ -1612,7 +1618,7 @@ DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 3, 0, buf = Fget_buffer (scratch); if (NILP (buf)) { - buf = Fget_buffer_create (scratch); + buf = Fget_buffer_create (scratch, Qnil); Fset_buffer_major_mode (buf); } return buf; @@ -1636,7 +1642,7 @@ other_buffer_safely (Lisp_Object buffer) buf = Fget_buffer (scratch); if (NILP (buf)) { - buf = Fget_buffer_create (scratch); + buf = Fget_buffer_create (scratch, Qnil); Fset_buffer_major_mode (buf); } @@ -1713,7 +1719,9 @@ DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 0, 1, "bKill buffer: ", the buffer is not killed. The hook `kill-buffer-hook' is run before the buffer is actually killed. The buffer being killed will be current while the hook is running. Functions called by any of these hooks are -supposed to not change the current buffer. +supposed to not change the current buffer. Neither hook is run for +internal or temporary buffers created by `get-buffer-create' or +`generate-new-buffer' with argument INHIBIT-BUFFER-HOOKS non-nil. Any processes that have this buffer as the `process-buffer' are killed with SIGHUP. This function calls `replace-buffer-in-windows' for @@ -1973,9 +1981,7 @@ DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 0, 1, "bKill buffer: ", bset_width_table (b, Qnil); unblock_input (); - /* Run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks) && !b->inhibit_buffer_hooks) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + run_buffer_list_update_hook (b); return Qt; } @@ -2015,9 +2021,7 @@ record_buffer (Lisp_Object buffer) fset_buffer_list (f, Fcons (buffer, Fdelq (buffer, f->buffer_list))); fset_buried_buffer_list (f, Fdelq (buffer, f->buried_buffer_list)); - /* Run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks) && !XBUFFER (buffer)->inhibit_buffer_hooks) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + run_buffer_list_update_hook (XBUFFER (buffer)); } @@ -2054,9 +2058,7 @@ DEFUN ("bury-buffer-internal", Fbury_buffer_internal, Sbury_buffer_internal, fset_buried_buffer_list (f, Fcons (buffer, Fdelq (buffer, f->buried_buffer_list))); - /* Run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks) && !XBUFFER (buffer)->inhibit_buffer_hooks) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + run_buffer_list_update_hook (XBUFFER (buffer)); return Qnil; } @@ -5349,10 +5351,11 @@ init_buffer_once (void) Fput (Qkill_buffer_hook, Qpermanent_local, Qt); /* Super-magic invisible buffer. */ - Vprin1_to_string_buffer = Fget_buffer_create (build_pure_c_string (" prin1")); + Vprin1_to_string_buffer = + Fget_buffer_create (build_pure_c_string (" prin1"), Qt); Vbuffer_alist = Qnil; - Fset_buffer (Fget_buffer_create (build_pure_c_string ("*scratch*"))); + Fset_buffer (Fget_buffer_create (build_pure_c_string ("*scratch*"), Qnil)); inhibit_modification_hooks = 0; } @@ -5397,7 +5400,7 @@ init_buffer (void) #endif /* USE_MMAP_FOR_BUFFERS */ AUTO_STRING (scratch, "*scratch*"); - Fset_buffer (Fget_buffer_create (scratch)); + Fset_buffer (Fget_buffer_create (scratch, Qnil)); if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters))) Fset_buffer_multibyte (Qnil); @@ -6300,9 +6303,14 @@ from (abs POSITION). If POSITION is positive, point was at the front DEFVAR_LISP ("kill-buffer-query-functions", Vkill_buffer_query_functions, doc: /* List of functions called with no args to query before killing a buffer. The buffer being killed will be current while the functions are running. +See `kill-buffer'. If any of them returns nil, the buffer is not killed. Functions run by -this hook are supposed to not change the current buffer. */); +this hook are supposed to not change the current buffer. + +This hook is not run for internal or temporary buffers created by +`get-buffer-create' or `generate-new-buffer' with argument +INHIBIT-BUFFER-HOOKS non-nil. */); Vkill_buffer_query_functions = Qnil; DEFVAR_LISP ("change-major-mode-hook", Vchange_major_mode_hook, @@ -6315,9 +6323,12 @@ from (abs POSITION). If POSITION is positive, point was at the front doc: /* Hook run when the buffer list changes. Functions (implicitly) running this hook are `get-buffer-create', `make-indirect-buffer', `rename-buffer', `kill-buffer', `bury-buffer' -and `select-window'. Functions run by this hook should avoid calling -`select-window' with a nil NORECORD argument or `with-temp-buffer' -since either may lead to infinite recursion. */); +and `select-window'. This hook is not run for internal or temporary +buffers created by `get-buffer-create' or `generate-new-buffer' with +argument INHIBIT-BUFFER-HOOKS non-nil. + +Functions run by this hook should avoid calling `select-window' with a +nil NORECORD argument since it may lead to infinite recursion. */); Vbuffer_list_update_hook = Qnil; DEFSYM (Qbuffer_list_update_hook, "buffer-list-update-hook"); diff --git a/src/buffer.h b/src/buffer.h index fe549c5dac..b8c5162be4 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -663,11 +663,11 @@ #define BVAR(buf, field) ((buf)->field ## _) /* Non-zero whenever the narrowing is changed in this buffer. */ bool_bf clip_changed : 1; - /* Non-zero for internally used temporary buffers that don't need to - run hooks kill-buffer-hook, buffer-list-update-hook, and - kill-buffer-query-functions. This is used in coding.c to avoid - slowing down en/decoding when there are a lot of these hooks - defined. */ + /* Non-zero for internal or temporary buffers that don't need to + run hooks kill-buffer-hook, kill-buffer-query-functions, and + buffer-list-update-hook. This is used in coding.c to avoid + slowing down en/decoding when a lot of these hooks are + defined, as well as by with-temp-buffer, for example. */ bool_bf inhibit_buffer_hooks : 1; /* List of overlays that end at or before the current center, diff --git a/src/callproc.c b/src/callproc.c index e3346e2eab..4bca1e5ebd 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -405,9 +405,8 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, if (! (NILP (buffer) || EQ (buffer, Qt) || FIXNUMP (buffer))) { - Lisp_Object spec_buffer; - spec_buffer = buffer; - buffer = Fget_buffer_create (buffer); + Lisp_Object spec_buffer = buffer; + buffer = Fget_buffer_create (buffer, Qnil); /* Mention the buffer name for a better error message. */ if (NILP (buffer)) CHECK_BUFFER (spec_buffer); diff --git a/src/coding.c b/src/coding.c index 2142e7fa51..1afa4aa474 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7821,7 +7821,7 @@ encode_coding (struct coding_system *coding) /* A string that serves as name of the reusable work buffer, and as base name of temporary work buffers used for code-conversion operations. */ -Lisp_Object Vcode_conversion_workbuf_name; +static Lisp_Object Vcode_conversion_workbuf_name; /* The reusable working buffer, created once and never killed. */ static Lisp_Object Vcode_conversion_reused_workbuf; @@ -7839,7 +7839,7 @@ code_conversion_restore (Lisp_Object arg) if (! NILP (workbuf)) { if (EQ (workbuf, Vcode_conversion_reused_workbuf)) - reused_workbuf_in_use = 0; + reused_workbuf_in_use = false; else Fkill_buffer (workbuf); } @@ -7857,13 +7857,13 @@ code_conversion_save (bool with_work_buf, bool multibyte) { Lisp_Object name = Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name, Qnil); - workbuf = Fget_buffer_create (name); + workbuf = Fget_buffer_create (name, Qt); } else { if (NILP (Fbuffer_live_p (Vcode_conversion_reused_workbuf))) Vcode_conversion_reused_workbuf - = Fget_buffer_create (Vcode_conversion_workbuf_name); + = Fget_buffer_create (Vcode_conversion_workbuf_name, Qt); workbuf = Vcode_conversion_reused_workbuf; } } @@ -7881,7 +7881,7 @@ code_conversion_save (bool with_work_buf, bool multibyte) bset_undo_list (current_buffer, Qt); bset_enable_multibyte_characters (current_buffer, multibyte ? Qt : Qnil); if (EQ (workbuf, Vcode_conversion_reused_workbuf)) - reused_workbuf_in_use = 1; + reused_workbuf_in_use = true; set_buffer_internal (current); } @@ -11639,7 +11639,7 @@ syms_of_coding (void) staticpro (&Vcode_conversion_workbuf_name); Vcode_conversion_workbuf_name = build_pure_c_string (" *code-conversion-work*"); - reused_workbuf_in_use = 0; + reused_workbuf_in_use = false; PDUMPER_REMEMBER_SCALAR (reused_workbuf_in_use); DEFSYM (Qcharset, "charset"); diff --git a/src/coding.h b/src/coding.h index 4973cf89eb..9ad1e954f8 100644 --- a/src/coding.h +++ b/src/coding.h @@ -97,9 +97,6 @@ #define EMACS_CODING_H extern Lisp_Object Vcoding_system_hash_table; -/* Name (or base name) of work buffer for code conversion. */ -extern Lisp_Object Vcode_conversion_workbuf_name; - /* Enumeration of index to an attribute vector of a coding system. */ enum coding_attr_index diff --git a/src/fileio.c b/src/fileio.c index c97f4daf20..51f12e104e 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4004,7 +4004,7 @@ because (1) it preserves some marker positions (in unchanged portions record_unwind_current_buffer (); - workbuf = Fget_buffer_create (name); + workbuf = Fget_buffer_create (name, Qt); buf = XBUFFER (workbuf); delete_all_overlays (buf); diff --git a/src/minibuf.c b/src/minibuf.c index fc3fd92a88..1940564a80 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -809,7 +809,7 @@ get_minibuffer (EMACS_INT depth) static char const name_fmt[] = " *Minibuf-%"pI"d*"; char name[sizeof name_fmt + INT_STRLEN_BOUND (EMACS_INT)]; AUTO_STRING_WITH_LEN (lname, name, sprintf (name, name_fmt, depth)); - buf = Fget_buffer_create (lname); + buf = Fget_buffer_create (lname, Qnil); /* Although the buffer's name starts with a space, undo should be enabled in it. */ diff --git a/src/print.c b/src/print.c index 008bf5e639..ec271d914c 100644 --- a/src/print.c +++ b/src/print.c @@ -562,7 +562,7 @@ temp_output_buffer_setup (const char *bufname) record_unwind_current_buffer (); - Fset_buffer (Fget_buffer_create (build_string (bufname))); + Fset_buffer (Fget_buffer_create (build_string (bufname), Qnil)); Fkill_all_local_variables (); delete_all_overlays (current_buffer); diff --git a/src/process.c b/src/process.c index 4fe8ac7fc0..9efefb1de7 100644 --- a/src/process.c +++ b/src/process.c @@ -1731,7 +1731,7 @@ DEFUN ("make-process", Fmake_process, Smake_process, 0, MANY, 0, buffer = Fplist_get (contact, QCbuffer); if (!NILP (buffer)) - buffer = Fget_buffer_create (buffer); + buffer = Fget_buffer_create (buffer, Qnil); /* Make sure that the child will be able to chdir to the current buffer's current directory, or its unhandled equivalent. We @@ -1768,7 +1768,7 @@ DEFUN ("make-process", Fmake_process, Smake_process, 0, MANY, 0, QCname, concat2 (name, build_string (" stderr")), QCbuffer, - Fget_buffer_create (xstderr), + Fget_buffer_create (xstderr, Qnil), QCnoquery, query_on_exit ? Qnil : Qt); } @@ -2443,7 +2443,7 @@ DEFUN ("make-pipe-process", Fmake_pipe_process, Smake_pipe_process, buffer = Fplist_get (contact, QCbuffer); if (NILP (buffer)) buffer = name; - buffer = Fget_buffer_create (buffer); + buffer = Fget_buffer_create (buffer, Qnil); pset_buffer (p, buffer); pset_childp (p, contact); @@ -3173,7 +3173,7 @@ DEFUN ("make-serial-process", Fmake_serial_process, Smake_serial_process, buffer = Fplist_get (contact, QCbuffer); if (NILP (buffer)) buffer = name; - buffer = Fget_buffer_create (buffer); + buffer = Fget_buffer_create (buffer, Qnil); pset_buffer (p, buffer); pset_childp (p, contact); @@ -4188,7 +4188,7 @@ DEFUN ("make-network-process", Fmake_network_process, Smake_network_process, open_socket: if (!NILP (buffer)) - buffer = Fget_buffer_create (buffer); + buffer = Fget_buffer_create (buffer, Qnil); /* Unwind bind_polling_period. */ unbind_to (count, Qnil); @@ -4961,7 +4961,7 @@ server_accept_connection (Lisp_Object server, int channel) if (!NILP (buffer)) { args[1] = buffer; - buffer = Fget_buffer_create (Fformat (nargs, args)); + buffer = Fget_buffer_create (Fformat (nargs, args), Qnil); } } diff --git a/src/w32fns.c b/src/w32fns.c index a840f0e122..36bee0676b 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7372,7 +7372,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, tip_f = XFRAME (tip_frame); window = FRAME_ROOT_WINDOW (tip_f); - tip_buf = Fget_buffer_create (tip); + tip_buf = Fget_buffer_create (tip, Qnil); /* We will mark the tip window a "pseudo-window" below, and such windows cannot have display margins. */ bset_left_margin_cols (XBUFFER (tip_buf), make_fixnum (0)); diff --git a/src/window.c b/src/window.c index bcc989b5a7..5db166e345 100644 --- a/src/window.c +++ b/src/window.c @@ -617,11 +617,12 @@ DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, Run `buffer-list-update-hook' unless NORECORD is non-nil. Note that applications and internal routines often select a window temporarily for various purposes; mostly, to simplify coding. As a rule, such -selections should be not recorded and therefore will not pollute +selections should not be recorded and therefore will not pollute `buffer-list-update-hook'. Selections that "really count" are those causing a visible change in the next redisplay of WINDOW's frame and -should be always recorded. So if you think of running a function each -time a window gets selected put it on `buffer-list-update-hook'. +should always be recorded. So if you think of running a function each +time a window gets selected, put it on `buffer-list-update-hook' or +`window-selection-change-functions'. Also note that the main editor command loop sets the current buffer to the buffer of the selected window before each command. */) diff --git a/src/xdisp.c b/src/xdisp.c index 0fd5ec5ec5..b5adee5105 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10880,7 +10880,7 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte) /* Ensure the Messages buffer exists, and switch to it. If we created it, set the major-mode. */ bool newbuffer = NILP (Fget_buffer (Vmessages_buffer_name)); - Fset_buffer (Fget_buffer_create (Vmessages_buffer_name)); + Fset_buffer (Fget_buffer_create (Vmessages_buffer_name, Qnil)); if (newbuffer && !NILP (Ffboundp (intern ("messages-buffer-mode")))) call0 (intern ("messages-buffer-mode")); @@ -11366,7 +11366,7 @@ ensure_echo_area_buffers (void) static char const name_fmt[] = " *Echo Area %d*"; char name[sizeof name_fmt + INT_STRLEN_BOUND (int)]; AUTO_STRING_WITH_LEN (lname, name, sprintf (name, name_fmt, i)); - echo_buffer[i] = Fget_buffer_create (lname); + echo_buffer[i] = Fget_buffer_create (lname, Qnil); bset_truncate_lines (XBUFFER (echo_buffer[i]), Qnil); /* to force word wrap in echo area - it was decided to postpone this*/ diff --git a/src/xfns.c b/src/xfns.c index 46e4bd73a6..abe293e903 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -7041,7 +7041,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, tip_f = XFRAME (tip_frame); window = FRAME_ROOT_WINDOW (tip_f); - tip_buf = Fget_buffer_create (tip); + tip_buf = Fget_buffer_create (tip, Qnil); /* We will mark the tip window a "pseudo-window" below, and such windows cannot have display margins. */ bset_left_margin_cols (XBUFFER (tip_buf), make_fixnum (0)); diff --git a/src/xwidget.c b/src/xwidget.c index e078a28a35..accde65b52 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -100,7 +100,8 @@ DEFUN ("make-xwidget", Lisp_Object val; xw->type = type; xw->title = title; - xw->buffer = NILP (buffer) ? Fcurrent_buffer () : Fget_buffer_create (buffer); + xw->buffer = (NILP (buffer) ? Fcurrent_buffer () + : Fget_buffer_create (buffer, Qnil)); xw->height = XFIXNAT (height); xw->width = XFIXNAT (width); xw->kill_without_query = false; diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el index 0db66f9751..dd8927457a 100644 --- a/test/src/buffer-tests.el +++ b/test/src/buffer-tests.el @@ -19,9 +19,7 @@ ;;; Code: -(require 'ert) -(require 'seq) -(eval-when-compile (require 'cl-lib)) +(require 'cl-lib) (ert-deftest overlay-modification-hooks-message-other-buf () "Test for bug#21824. @@ -1334,4 +1332,33 @@ buffer-tests-buffer-local-variables-undo (with-temp-buffer (should (assq 'buffer-undo-list (buffer-local-variables))))) +(ert-deftest buffer-tests-inhibit-buffer-hooks () + "Test `get-buffer-create' argument INHIBIT-BUFFER-HOOKS." + (let* (run-bluh (bluh (lambda () (setq run-bluh t)))) + (unwind-protect + (let* ( run-kbh (kbh (lambda () (setq run-kbh t))) + run-kbqf (kbqf (lambda () (setq run-kbqf t))) ) + + ;; Inhibited. + (add-hook 'buffer-list-update-hook bluh) + (with-current-buffer (generate-new-buffer " foo" t) + (add-hook 'kill-buffer-hook kbh nil t) + (add-hook 'kill-buffer-query-functions kbqf nil t) + (kill-buffer)) + (with-temp-buffer) + (with-output-to-string) + (should-not run-bluh) + (should-not run-kbh) + (should-not run-kbqf) + + ;; Not inhibited. + (with-current-buffer (generate-new-buffer " foo") + (should run-bluh) + (add-hook 'kill-buffer-hook kbh nil t) + (add-hook 'kill-buffer-query-functions kbqf nil t) + (kill-buffer)) + (should run-kbh) + (should run-kbqf)) + (remove-hook 'buffer-list-update-hook bluh)))) + ;;; buffer-tests.el ends here -- 2.29.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 19 05:34:04 2020 Received: (at 34765) by debbugs.gnu.org; 19 Dec 2020 10:34:04 +0000 Received: from localhost ([127.0.0.1]:40856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqZYq-0001dh-5F for submit@debbugs.gnu.org; Sat, 19 Dec 2020 05:34:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqZYo-0001dE-Lt for 34765@debbugs.gnu.org; Sat, 19 Dec 2020 05:34:03 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53993) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqZYh-0008PI-Oz; Sat, 19 Dec 2020 05:33:55 -0500 Received: from [176.228.60.248] (port=3728 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kqZYg-0003Bd-TG; Sat, 19 Dec 2020 05:33:55 -0500 Date: Sat, 19 Dec 2020 12:33:36 +0200 Message-Id: <831rfmultr.fsf@gnu.org> From: Eli Zaretskii To: "Basil L. Contovounesios" In-Reply-To: <87eejnaqzz.fsf@tcd.ie> (contovob@tcd.ie) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <5C7FD591.9090505@gmx.at> <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> <87360qoa6o.fsf@tcd.ie> <878sa9cle0.fsf@tcd.ie> <87eejnaqzz.fsf@tcd.ie> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, larsi@gnus.org, monnier@iro.umontreal.ca, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: "Basil L. Contovounesios" > Cc: Eli Zaretskii , rudalics@gmx.at, larsi@gnus.org, > 34765@debbugs.gnu.org, alexanderm@web.de > Date: Fri, 18 Dec 2020 18:49:52 +0000 > > * .dir-locals.el (c-mode): Enforce existing indent-tabs-mode policy. This should be in a separate commit, IMO. > +By default, undo information (@pxref{Undo}) is not recorded in the > +buffer created by this macro (but @var{body} can enable that, if > +needed). The temporary buffer also does not run the hooks > +@code{kill-buffer-hook}, @code{kill-buffer-query-functions} > +(@pxref{Killing Buffers}), and @code{buffer-list-update-hook} > +(@pxref{Buffer List}). It would be good to have here index entries about undo and those hooks not being used by default in temporary buffers. > +Like @code{with-temp-buffer} (@pxref{Definition of with-temp-buffer,, ^^^^^^^^^^ I think this word will look better if not capitalized. > +static void > +run_buffer_list_update_hook (struct buffer *buf) > +{ > + if (! (NILP (Vrun_hooks) || (buf && buf->inhibit_buffer_hooks))) ^^^ Why this test? is it possible for this function to be called with buf a NULL pointer? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 19 09:15:42 2020 Received: (at 34765) by debbugs.gnu.org; 19 Dec 2020 14:15:42 +0000 Received: from localhost ([127.0.0.1]:41082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqd1K-00010p-5p for submit@debbugs.gnu.org; Sat, 19 Dec 2020 09:15:42 -0500 Received: from mail-wm1-f51.google.com ([209.85.128.51]:50230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqd1G-00010a-NG for 34765@debbugs.gnu.org; Sat, 19 Dec 2020 09:15:40 -0500 Received: by mail-wm1-f51.google.com with SMTP id 190so5508700wmz.0 for <34765@debbugs.gnu.org>; Sat, 19 Dec 2020 06:15:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=WopIZ+WUKH9ojptc2h4Du5B3T6+n/w8RYynKnR0ztBg=; b=bOFEq6rkwiq54picJSaM5TccW770YsB3WWoaoxTlsdRtc90ilKLTwXjKemEdI0tKiL D5+9q7Bcx7fhr1B2jaYdMJNQfJe/FJ6+kVHEemQ6rt+g0xOC7WN6Mer8/C5QJKrM3ulw PWEjkSvYzVpblb5Wan9H6xyvQJQtiR73pL4RHYo/SSPB5CLYJblb3dyPqJu7H3bg4dFI QwnyeZUBSkvql/Zpr2nTF6Fhw29q2S94cSno8lh1tOmkVYbhpBjy6aFENl5BdhJJAg5J 8caunf6E18jkUhzM+qJP7xaTs3C5LxheCFjfJdu5OxL22DxdKqwsDh6q4uvlpguGb4pJ eYXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=WopIZ+WUKH9ojptc2h4Du5B3T6+n/w8RYynKnR0ztBg=; b=Kg1WKyji4wwZqN8/XKsgv/yY0C+4OJCxaf20YyJktrsBIE9lCQsng3CXYZWOKUUfAn 3XvAi5YhNba3XHn/mkxbRb6ICqSc312IdSGLeBLq0ZEuA3KfNZcP8QSQnSmPl8NlF+fS BSOZb7qdgsiqG2CF7d6qk+EDV5GXPtM/qWzTtFnhV37zxP9/AmLh/Hl6ES4GAjzbGCGz gG0+8bVTa4vvXB5Hme0A/3Wc00pig3e13FKp4RKb3eAUDu/vxA8MuKxILt/APY785ZZz RG02DlzjwxrUASm+vSf6HIlPqnmRNDhMi3T/Cufw6QI4Zpa+d+QIAT9aIntHU+7ujxTW B/1w== X-Gm-Message-State: AOAM532/OsmIgCmwwe3KVdX4vH71h/JK6TibRVSvUtvJbq00puX7HYD/ 9QKvjHTSaMMGnpNik4q/vqff8w== X-Google-Smtp-Source: ABdhPJyIFmw3Bn+qYA18cCFBhhwHGeEbGa2V7LxmW5xWNT7qPGbNqMCO4E1Fhym3YhjKtYP8wNLVug== X-Received: by 2002:a7b:c091:: with SMTP id r17mr8532633wmh.129.1608387332649; Sat, 19 Dec 2020 06:15:32 -0800 (PST) Received: from localhost ([2a02:8084:20e2:c380:877b:77af:3b46:790d]) by smtp.gmail.com with ESMTPSA id i18sm18636120wrp.74.2020.12.19.06.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 06:15:31 -0800 (PST) From: "Basil L. Contovounesios" To: Eli Zaretskii Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> <87360qoa6o.fsf@tcd.ie> <878sa9cle0.fsf@tcd.ie> <87eejnaqzz.fsf@tcd.ie> <831rfmultr.fsf@gnu.org> Date: Sat, 19 Dec 2020 14:15:30 +0000 In-Reply-To: <831rfmultr.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 Dec 2020 12:33:36 +0200") Message-ID: <878s9t6fwd.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, larsi@gnus.org, monnier@iro.umontreal.ca, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: "Basil L. Contovounesios" >> Cc: Eli Zaretskii , rudalics@gmx.at, larsi@gnus.org, >> 34765@debbugs.gnu.org, alexanderm@web.de >> Date: Fri, 18 Dec 2020 18:49:52 +0000 >> >> * .dir-locals.el (c-mode): Enforce existing indent-tabs-mode policy. > > This should be in a separate commit, IMO. Okay, I pushed it separately. >> +By default, undo information (@pxref{Undo}) is not recorded in the >> +buffer created by this macro (but @var{body} can enable that, if >> +needed). The temporary buffer also does not run the hooks >> +@code{kill-buffer-hook}, @code{kill-buffer-query-functions} >> +(@pxref{Killing Buffers}), and @code{buffer-list-update-hook} >> +(@pxref{Buffer List}). > > It would be good to have here index entries about undo and those hooks > not being used by default in temporary buffers. Something like this? @cindex undo in temporary buffers @cindex @code{kill-buffer-hook} in temporary buffers @cindex @code{kill-buffer-query-functions} in temporary buffers @cindex @code{buffer-list-update-hook} in temporary buffers >> +Like @code{with-temp-buffer} (@pxref{Definition of with-temp-buffer,, > ^^^^^^^^^^ > I think this word will look better if not capitalized. The printed label "see Current Buffer" should be displayed instead of this word, which is part of the anchor. Is that okay? >> +static void >> +run_buffer_list_update_hook (struct buffer *buf) >> +{ >> + if (! (NILP (Vrun_hooks) || (buf && buf->inhibit_buffer_hooks))) > ^^^ > Why this test? is it possible for this function to be called with buf > a NULL pointer? Yes, in Fmake_indirect_buffer, which doesn't check inhibit_buffer_hooks. The alternatives would be for Fmake_indirect_buffer to not call run_buffer_list_update_hook, or to not bother adding run_buffer_list_update_hook at all. Do you have a preference? Thanks, -- Basil From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 19 11:06:44 2020 Received: (at 34765) by debbugs.gnu.org; 19 Dec 2020 16:06:44 +0000 Received: from localhost ([127.0.0.1]:43013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqeki-00049B-Ai for submit@debbugs.gnu.org; Sat, 19 Dec 2020 11:06:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqekf-00048x-Qw for 34765@debbugs.gnu.org; Sat, 19 Dec 2020 11:06:38 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57449) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqekZ-0001Xl-Ch; Sat, 19 Dec 2020 11:06:31 -0500 Received: from [176.228.60.248] (port=4173 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kqekY-0003Rs-JO; Sat, 19 Dec 2020 11:06:31 -0500 Date: Sat, 19 Dec 2020 18:06:04 +0200 Message-Id: <83mty9u6fn.fsf@gnu.org> From: Eli Zaretskii To: "Basil L. Contovounesios" In-Reply-To: <878s9t6fwd.fsf@tcd.ie> (contovob@tcd.ie) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <83lg1sc8ob.fsf@gnu.org> <5C8009F3.5000405@gmx.at> <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> <87360qoa6o.fsf@tcd.ie> <878sa9cle0.fsf@tcd.ie> <87eejnaqzz.fsf@tcd.ie> <831rfmultr.fsf@gnu.org> <878s9t6fwd.fsf@tcd.ie> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, larsi@gnus.org, monnier@iro.umontreal.ca, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > From: "Basil L. Contovounesios" > Cc: monnier@iro.umontreal.ca, rudalics@gmx.at, larsi@gnus.org, > 34765@debbugs.gnu.org, alexanderm@web.de > Date: Sat, 19 Dec 2020 14:15:30 +0000 > > >> +By default, undo information (@pxref{Undo}) is not recorded in the > >> +buffer created by this macro (but @var{body} can enable that, if > >> +needed). The temporary buffer also does not run the hooks > >> +@code{kill-buffer-hook}, @code{kill-buffer-query-functions} > >> +(@pxref{Killing Buffers}), and @code{buffer-list-update-hook} > >> +(@pxref{Buffer List}). > > > > It would be good to have here index entries about undo and those hooks > > not being used by default in temporary buffers. > > Something like this? > > @cindex undo in temporary buffers > @cindex @code{kill-buffer-hook} in temporary buffers > @cindex @code{kill-buffer-query-functions} in temporary buffers > @cindex @code{buffer-list-update-hook} in temporary buffers Yes. > >> +Like @code{with-temp-buffer} (@pxref{Definition of with-temp-buffer,, > > ^^^^^^^^^^ > > I think this word will look better if not capitalized. > > The printed label "see Current Buffer" should be displayed instead of > this word, which is part of the anchor. Is that okay? Sorry, I didn't see that this is an anchor. So I think the anchor should not start with a capital letter, as it reads more naturally that way, I think. And then the name should be used without capitalization in the cross-references. Obviously, this is a minor nit. > >> +static void > >> +run_buffer_list_update_hook (struct buffer *buf) > >> +{ > >> + if (! (NILP (Vrun_hooks) || (buf && buf->inhibit_buffer_hooks))) > > ^^^ > > Why this test? is it possible for this function to be called with buf > > a NULL pointer? > > Yes, in Fmake_indirect_buffer, which doesn't check inhibit_buffer_hooks. > > The alternatives would be for Fmake_indirect_buffer to not call > run_buffer_list_update_hook, or to not bother adding > run_buffer_list_update_hook at all. Do you have a preference? I think just having a comment there saying that make-indirect-buffer calls this with NULL argument should be okay. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 19 16:10:27 2020 Received: (at 34765) by debbugs.gnu.org; 19 Dec 2020 21:10:27 +0000 Received: from localhost ([127.0.0.1]:43294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqjUf-0007OI-W9 for submit@debbugs.gnu.org; Sat, 19 Dec 2020 16:10:27 -0500 Received: from mail-wm1-f48.google.com ([209.85.128.48]:33031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqjUc-0007O1-5V for 34765@debbugs.gnu.org; Sat, 19 Dec 2020 16:10:24 -0500 Received: by mail-wm1-f48.google.com with SMTP id n16so8037138wmc.0 for <34765@debbugs.gnu.org>; Sat, 19 Dec 2020 13:10:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=4XaYkn4/noaszsvErEt8U+1KdrkvqMu0ohoCcX72iq8=; b=wrQY5ozoV5fzodgPkBFku+3Pd2y3563/3pngr0ZAY4m1BW83+rxcmiT/1aApm9CfKt TZCnrP2zHzFUBqLqFUjlAtAlQ+iFS3e/QVRkLTSu9TVX11ybAnTdgLUsIaib0D0KdVVk KFrewe44m9CWMgd8NrKaGD2GYbRTGoNUhgJywZM2yJl3s9rXErJjgQrvS3o7MT2zB9gS R9oSyAagnyRYHvCjaO0vqdlE6PRdjjyGws4uo915b2he0RvaFHGR9MHy+URpufeorroP TmzjG9L43EYDEYqiaqnV9h5OvLHZKvKGgFHD7n7hCtqJGKI6KLoAlb63BRG+Zis661zn xtXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=4XaYkn4/noaszsvErEt8U+1KdrkvqMu0ohoCcX72iq8=; b=OmLNonrafeVSvfyweTUbwexVUsvszf0HbX5lKQP0F35py6qbvgIy/QHRnJsgMOc+J8 fH/Sgcdm5aoESHoFsRkFf1yqXQQPBWQFULJEIta+pI0QYk8eXefQ0arIGy8RBm2nZdKC gQNsF9/TXqpKOSlbGcWBc8SV+1jiMMIzhS2a4Twx+o90NW958syk+EsfXmjDHh1kk2tz El4vep6OTrsOdq4QZMFBkSTWAU7r8cLhwK2nIB4WWm2yWHd9kdt2D0GJ7yMfc2dUOgtw hW5K69JBdmok5NHk8c9TNC5m72U7oRCNL26DnuBBePmr+P1a/P33n53UmW3qBe0kpUJq 7jqQ== X-Gm-Message-State: AOAM5305UehqGADfufSGNC9eXJDIzCfuuklPdFhs3GvWBwIl33AcePIt dHYFlHkfHs839FuDq/4TCVxwNg== X-Google-Smtp-Source: ABdhPJzc3LBChlRapIKqBkpibG9W1G31p4eygPbZ+jzMcDolvF3yt9IvqcjP1J1c7wQmQvgsQP+f7A== X-Received: by 2002:a1c:f405:: with SMTP id z5mr9344949wma.93.1608412216228; Sat, 19 Dec 2020 13:10:16 -0800 (PST) Received: from localhost ([2a02:8084:20e2:c380:877b:77af:3b46:790d]) by smtp.gmail.com with ESMTPSA id y6sm16448213wmg.39.2020.12.19.13.10.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 13:10:14 -0800 (PST) From: "Basil L. Contovounesios" To: Eli Zaretskii Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> <87360qoa6o.fsf@tcd.ie> <878sa9cle0.fsf@tcd.ie> <87eejnaqzz.fsf@tcd.ie> <831rfmultr.fsf@gnu.org> <878s9t6fwd.fsf@tcd.ie> <83mty9u6fn.fsf@gnu.org> Date: Sat, 19 Dec 2020 21:10:13 +0000 In-Reply-To: <83mty9u6fn.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 Dec 2020 18:06:04 +0200") Message-ID: <87zh2933ka.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, larsi@gnus.org, monnier@iro.umontreal.ca, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> Something like this? >> >> @cindex undo in temporary buffers >> @cindex @code{kill-buffer-hook} in temporary buffers >> @cindex @code{kill-buffer-query-functions} in temporary buffers >> @cindex @code{buffer-list-update-hook} in temporary buffers > > Yes. Done. >> >> +Like @code{with-temp-buffer} (@pxref{Definition of with-temp-buffer,, >> > ^^^^^^^^^^ >> > I think this word will look better if not capitalized. >> >> The printed label "see Current Buffer" should be displayed instead of >> this word, which is part of the anchor. Is that okay? > > Sorry, I didn't see that this is an anchor. So I think the anchor > should not start with a capital letter, as it reads more naturally > that way, I think. And then the name should be used without > capitalization in the cross-references. Obviously, this is a minor > nit. I'm hesitant to change the anchor because all 37 such "Definition of..." anchors in the tree are capitalised, as are the printed labels of all their refs. I'm happy to downcase them, but maybe this should be done wholesale in a separate commit? >> >> +static void >> >> +run_buffer_list_update_hook (struct buffer *buf) >> >> +{ >> >> + if (! (NILP (Vrun_hooks) || (buf && buf->inhibit_buffer_hooks))) >> > ^^^ >> > Why this test? is it possible for this function to be called with buf >> > a NULL pointer? >> >> Yes, in Fmake_indirect_buffer, which doesn't check inhibit_buffer_hooks. >> >> The alternatives would be for Fmake_indirect_buffer to not call >> run_buffer_list_update_hook, or to not bother adding >> run_buffer_list_update_hook at all. Do you have a preference? > > I think just having a comment there saying that make-indirect-buffer > calls this with NULL argument should be okay. How's the attached? Thanks, -- Basil --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Inhibit-buffer-hooks-in-temporary-buffers.patch >From 5ad1cc0d3f67ba3077d34949412990fb6e4b50a6 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sat, 19 Dec 2020 12:39:45 +0000 Subject: [PATCH] Inhibit buffer hooks in temporary buffers Give get-buffer-create an optional argument to inhibit buffer hooks in internal or temporary buffers for efficiency (bug#34765). * etc/NEWS: Announce new parameter of get-buffer-create and generate-new-buffer, and that with-temp-buffer and with-temp-file now inhibit buffer hooks. * doc/lispref/buffers.texi (Buffer Names): Fix typo. (Creating Buffers): Document new parameter of get-buffer-create and generate-new-buffer. (Buffer List, Killing Buffers): Document when buffer hooks are inhibited. (Current Buffer): * doc/lispref/files.texi (Writing to Files): Document that with-temp-buffer and with-temp-file inhibit buffer hooks. * doc/lispref/internals.texi (Buffer Internals): Document inhibit_buffer_hooks flag. Remove stale comment. * doc/misc/gnus-faq.texi (FAQ 5-8): * lisp/simple.el (shell-command-on-region): Fix indentation. * lisp/files.el (kill-buffer-hook): Document when hook is inhibited. (create-file-buffer): * lisp/gnus/gnus-uu.el (gnus-uu-unshar-article): * lisp/international/mule.el (load-with-code-conversion): * lisp/mh-e/mh-xface.el (mh-x-image-url-fetch-image): * lisp/net/imap.el (imap-open): * lisp/net/mailcap.el (mailcap-maybe-eval): * lisp/progmodes/flymake-proc.el (flymake-proc--read-file-to-temp-buffer) (flymake-proc--copy-buffer-to-temp-buffer): Simplify. * lisp/subr.el (generate-new-buffer): Forward new optional argument to inhibit buffer hooks to get-buffer-create. (with-temp-file, with-temp-buffer, with-output-to-string): * lisp/json.el (json-encode-string): Inhibit buffer hooks in buffer used. * src/buffer.c (run_buffer_list_update_hook): New helper function. (Fget_buffer_create): Use it. Add optional argument to set inhibit_buffer_hooks flag instead of comparing the buffer name to Vcode_conversion_workbuf_name. All callers changed. (Fmake_indirect_buffer, Frename_buffer, Fbury_buffer_internal) (record_buffer): Use run_buffer_list_update_hook. (Fkill_buffer): Document when buffer hooks are inhibited. Use run_buffer_list_update_hook. (init_buffer_once): Inhibit buffer hooks in Vprin1_to_string_buffer. (Vkill_buffer_query_functions, Vbuffer_list_update_hook): Document when hooks are inhibited. * src/buffer.h (struct buffer): Update inhibit_buffer_hooks commentary. * src/coding.h (Vcode_conversion_workbuf_name): * src/coding.c (Vcode_conversion_workbuf_name): Make static again since it is no longer needed in src/buffer.c. (code_conversion_restore, code_conversion_save, syms_of_coding): Prefer boolean over integer constants. * src/fileio.c (Finsert_file_contents): Inhibit buffer hooks in " *code-converting-work*" buffer. * src/window.c (Fselect_window): Fix grammar. Mention window-selection-change-functions alongside buffer-list-update-hook. * test/src/buffer-tests.el: Fix requires. (buffer-tests-inhibit-buffer-hooks): New test. --- doc/lispref/buffers.texi | 59 +++++++++++++++++------ doc/lispref/files.texi | 7 ++- doc/lispref/internals.texi | 11 ++++- doc/misc/gnus-faq.texi | 8 ++-- etc/NEWS | 16 +++++++ lisp/files.el | 6 ++- lisp/gnus/gnus-uu.el | 3 +- lisp/international/mule.el | 9 ++-- lisp/json.el | 2 +- lisp/mh-e/mh-xface.el | 3 +- lisp/net/imap.el | 3 +- lisp/net/mailcap.el | 3 +- lisp/progmodes/flymake-proc.el | 13 +++-- lisp/simple.el | 3 +- lisp/subr.el | 17 ++++--- src/buffer.c | 88 +++++++++++++++++++--------------- src/buffer.h | 10 ++-- src/callproc.c | 5 +- src/coding.c | 12 ++--- src/coding.h | 3 -- src/fileio.c | 2 +- src/minibuf.c | 2 +- src/print.c | 2 +- src/process.c | 12 ++--- src/w32fns.c | 2 +- src/window.c | 7 +-- src/xdisp.c | 4 +- src/xfns.c | 2 +- src/xwidget.c | 3 +- test/src/buffer-tests.el | 33 +++++++++++-- 30 files changed, 221 insertions(+), 129 deletions(-) diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index 2860343628..33eb23984d 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi @@ -225,13 +225,22 @@ Current Buffer @defmac with-temp-buffer body@dots{} @anchor{Definition of with-temp-buffer} -The @code{with-temp-buffer} macro evaluates the @var{body} forms -with a temporary buffer as the current buffer. It saves the identity of +The @code{with-temp-buffer} macro evaluates the @var{body} forms with +a temporary buffer as the current buffer. It saves the identity of the current buffer, creates a temporary buffer and makes it current, evaluates the @var{body} forms, and finally restores the previous -current buffer while killing the temporary buffer. By default, undo -information (@pxref{Undo}) is not recorded in the buffer created by -this macro (but @var{body} can enable that, if needed). +current buffer while killing the temporary buffer. + +@cindex undo in temporary buffers +@cindex @code{kill-buffer-hook} in temporary buffers +@cindex @code{kill-buffer-query-functions} in temporary buffers +@cindex @code{buffer-list-update-hook} in temporary buffers +By default, undo information (@pxref{Undo}) is not recorded in the +buffer created by this macro (but @var{body} can enable that, if +needed). The temporary buffer also does not run the hooks +@code{kill-buffer-hook}, @code{kill-buffer-query-functions} +(@pxref{Killing Buffers}), and @code{buffer-list-update-hook} +(@pxref{Buffer List}). The return value is the value of the last form in @var{body}. You can return the contents of the temporary buffer by using @@ -345,9 +354,9 @@ Buffer Names If the optional second argument @var{ignore} is non-@code{nil}, it should be a string, a potential buffer name. It means to consider -that potential buffer acceptable, if it is tried, even it is the name -of an existing buffer (which would normally be rejected). Thus, if -buffers named @samp{foo}, @samp{foo<2>}, @samp{foo<3>} and +that potential buffer acceptable, if it is tried, even if it is the +name of an existing buffer (which would normally be rejected). Thus, +if buffers named @samp{foo}, @samp{foo<2>}, @samp{foo<3>} and @samp{foo<4>} exist, @example @@ -932,13 +941,17 @@ Buffer List @defvar buffer-list-update-hook This is a normal hook run whenever the buffer list changes. Functions (implicitly) running this hook are @code{get-buffer-create} -(@pxref{Creating Buffers}), @code{rename-buffer} (@pxref{Buffer Names}), -@code{kill-buffer} (@pxref{Killing Buffers}), @code{bury-buffer} (see -above) and @code{select-window} (@pxref{Selecting Windows}). +(@pxref{Creating Buffers}), @code{rename-buffer} (@pxref{Buffer +Names}), @code{kill-buffer} (@pxref{Killing Buffers}), +@code{bury-buffer} (see above), and @code{select-window} +(@pxref{Selecting Windows}). This hook is not run for internal or +temporary buffers created by @code{get-buffer-create} or +@code{generate-new-buffer} with a non-@code{nil} argument +@var{inhibit-buffer-hooks}. Functions run by this hook should avoid calling @code{select-window} -with a nil @var{norecord} argument or @code{with-temp-buffer} since -either may lead to infinite recursion. +with a @code{nil} @var{norecord} argument since this may lead to +infinite recursion. @end defvar @node Creating Buffers @@ -951,12 +964,20 @@ Creating Buffers with the specified name; @code{generate-new-buffer} always creates a new buffer and gives it a unique name. + Both functions accept an optional argument @var{inhibit-buffer-hooks}. +If it is non-@code{nil}, the buffer they create does not run the hooks +@code{kill-buffer-hook}, @code{kill-buffer-query-functions} +(@pxref{Killing Buffers}), and @code{buffer-list-update-hook} +(@pxref{Buffer List}). This avoids slowing down internal or temporary +buffers that are never presented to users or passed on to other +applications. + Other functions you can use to create buffers include @code{with-output-to-temp-buffer} (@pxref{Temporary Displays}) and @code{create-file-buffer} (@pxref{Visiting Files}). Starting a subprocess can also create a buffer (@pxref{Processes}). -@defun get-buffer-create buffer-or-name +@defun get-buffer-create buffer-or-name &optional inhibit-buffer-hooks This function returns a buffer named @var{buffer-or-name}. The buffer returned does not become the current buffer---this function does not change which buffer is current. @@ -980,7 +1001,7 @@ Creating Buffers buffer initially disables undo information recording (@pxref{Undo}). @end defun -@defun generate-new-buffer name +@defun generate-new-buffer name &optional inhibit-buffer-hooks This function returns a newly created, empty buffer, but does not make it current. The name of the buffer is generated by passing @var{name} to the function @code{generate-new-buffer-name} (@pxref{Buffer @@ -1092,6 +1113,10 @@ Killing Buffers they are called. The idea of this feature is that these functions will ask for confirmation from the user. If any of them returns @code{nil}, @code{kill-buffer} spares the buffer's life. + +This hook is not run for internal or temporary buffers created by +@code{get-buffer-create} or @code{generate-new-buffer} with a +non-@code{nil} argument @var{inhibit-buffer-hooks}. @end defvar @defvar kill-buffer-hook @@ -1100,6 +1125,10 @@ Killing Buffers The buffer to be killed is current when the hook functions run. @xref{Hooks}. This variable is a permanent local, so its local binding is not cleared by changing major modes. + +This hook is not run for internal or temporary buffers created by +@code{get-buffer-create} or @code{generate-new-buffer} with a +non-@code{nil} argument @var{inhibit-buffer-hooks}. @end defvar @defopt buffer-offer-save diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index d49ac42bb4..6949ca29c6 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -701,8 +701,11 @@ Writing to Files The current buffer is restored even in case of an abnormal exit via @code{throw} or error (@pxref{Nonlocal Exits}). -See also @code{with-temp-buffer} in @ref{Definition of -with-temp-buffer,, The Current Buffer}. +Like @code{with-temp-buffer} (@pxref{Definition of with-temp-buffer,, +Current Buffer}), the temporary buffer used by this macro does not run +the hooks @code{kill-buffer-hook}, @code{kill-buffer-query-functions} +(@pxref{Killing Buffers}), and @code{buffer-list-update-hook} +(@pxref{Buffer List}). @end defmac @node File Locks diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index fa3dacbb7a..0adbef33ca 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -2391,6 +2391,15 @@ Buffer Internals This flag indicates that redisplay optimizations should not be used to display this buffer. +@item inhibit_buffer_hooks +This flag indicates that the buffer should not run the hooks +@code{kill-buffer-hook}, @code{kill-buffer-query-functions} +(@pxref{Killing Buffers}), and @code{buffer-list-update-hook} +(@pxref{Buffer List}). It is set at buffer creation (@pxref{Creating +Buffers}), and avoids slowing down internal or temporary buffers, such +as those created by @code{with-temp-buffer} (@pxref{Definition of +with-temp-buffer,, Current Buffer}). + @item overlay_center This field holds the current overlay center position. @xref{Managing Overlays}. @@ -2404,8 +2413,6 @@ Buffer Internals and @code{overlays_after} is sorted in order of increasing beginning position. -@c FIXME? the following are now all Lisp_Object BUFFER_INTERNAL_FIELD (foo). - @item name A Lisp string that names the buffer. It is guaranteed to be unique. @xref{Buffer Names}. This and the following fields have their names diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi index adb812f572..c30e80ff56 100644 --- a/doc/misc/gnus-faq.texi +++ b/doc/misc/gnus-faq.texi @@ -1523,10 +1523,10 @@ FAQ 5-8 @example (setq message-default-headers - (with-temp-buffer - (insert "X-Face: ") - (insert-file-contents "~/.xface") - (buffer-string))) + (with-temp-buffer + (insert "X-Face: ") + (insert-file-contents "~/.xface") + (buffer-string))) @end example @noindent diff --git a/etc/NEWS b/etc/NEWS index 4a8e70e6a6..1b4c21cb45 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1821,6 +1821,13 @@ modifies the string's text properties; instead, it uses and returns a copy of the string. This helps avoid trouble when strings are shared or constants. ++++ +** Temporary buffers no longer run certain buffer hooks. +The macros 'with-temp-buffer' and 'with-temp-file' no longer run the +hooks 'kill-buffer-hook', 'kill-buffer-query-functions', and +'buffer-list-update-hook' for the temporary buffers they create. This +avoids slowing them down when a lot of these hooks are defined. + --- ** The obsolete function 'thread-alive-p' has been removed. @@ -2177,6 +2184,15 @@ Until it is solved you could ignore such errors by performing ** The error 'ftp-error' belongs also to category 'remote-file-error'. ++++ +** Buffers can now be created with certain hooks disabled. +The functions 'get-buffer-create' and 'generate-new-buffer' accept a +new optional argument 'inhibit-buffer-hooks'. If non-nil, the new +buffer does not run the hooks 'kill-buffer-hook', +'kill-buffer-query-functions', and 'buffer-list-update-hook'. This +avoids slowing down internal or temporary buffers that are never +presented to users or passed on to other applications. + * Changes in Emacs 28.1 on Non-Free Operating Systems diff --git a/lisp/files.el b/lisp/files.el index 093b5f92e5..70d451cccf 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1850,6 +1850,10 @@ kill-buffer-hook The buffer being killed is current while the hook is running. See `kill-buffer'. +This hook is not run for internal or temporary buffers created by +`get-buffer-create' or `generate-new-buffer' with argument +INHIBIT-BUFFER-HOOKS non-nil. + Note: Be careful with let-binding this hook considering it is frequently used for cleanup.") @@ -1951,7 +1955,7 @@ create-file-buffer (let ((lastname (file-name-nondirectory filename))) (if (string= lastname "") (setq lastname filename)) - (generate-new-buffer (if (string-match-p "\\` " lastname) + (generate-new-buffer (if (string-prefix-p " " lastname) (concat "|" lastname) lastname)))) diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index 70aeac00d7..00ca430cc5 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el @@ -1587,8 +1587,7 @@ gnus-uu-unshar-article (save-excursion (switch-to-buffer (current-buffer)) (delete-other-windows) - (let ((buffer (get-buffer-create (generate-new-buffer-name - "*Warning*")))) + (let ((buffer (generate-new-buffer "*Warning*"))) (unless (unwind-protect (with-current-buffer buffer diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 212e7232b4..6571454dff 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -307,12 +307,9 @@ load-with-code-conversion (and (null noerror) (signal 'file-error (list "Cannot open load file" file))) ;; Read file with code conversion, and then eval. - (let* ((buffer - ;; We can't use `generate-new-buffer' because files.el - ;; is not yet loaded. - (get-buffer-create (generate-new-buffer-name " *load*"))) - (load-in-progress t) - (source (save-match-data (string-match "\\.el\\'" fullname)))) + (let ((buffer (generate-new-buffer " *load*")) + (load-in-progress t) + (source (string-suffix-p ".el" fullname))) (unless nomessage (if source (message "Loading %s (source)..." file) diff --git a/lisp/json.el b/lisp/json.el index c2fc1574fa..5f512b94cd 100644 --- a/lisp/json.el +++ b/lisp/json.el @@ -435,7 +435,7 @@ json-encode-string (concat "\"" (substring-no-properties string) "\"") (with-current-buffer (or json--string-buffer - (with-current-buffer (generate-new-buffer " *json-string*") + (with-current-buffer (generate-new-buffer " *json-string*" t) ;; This seems to afford decent performance gains. (setq-local inhibit-modification-hooks t) (setq json--string-buffer (current-buffer)))) diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el index 909f1fe95d..65039310e7 100644 --- a/lisp/mh-e/mh-xface.el +++ b/lisp/mh-e/mh-xface.el @@ -425,8 +425,7 @@ mh-x-image-url-fetch-image be displayed in a buffer and position specified by MARKER. The actual display is carried out by the SENTINEL function." (if mh-wget-executable - (let ((buffer (get-buffer-create (generate-new-buffer-name - mh-temp-fetch-buffer))) + (let ((buffer (generate-new-buffer mh-temp-fetch-buffer)) (filename (or (mh-funcall-if-exists make-temp-file "mhe-fetch") (expand-file-name (make-temp-name "~/mhe-fetch"))))) (with-current-buffer buffer diff --git a/lisp/net/imap.el b/lisp/net/imap.el index 0394f0efea..50b08d9612 100644 --- a/lisp/net/imap.el +++ b/lisp/net/imap.el @@ -1033,8 +1033,7 @@ imap-open (when (funcall (nth 1 (assq stream imap-stream-alist)) buffer) ;; Stream changed? (if (not (eq imap-default-stream stream)) - (with-current-buffer (get-buffer-create - (generate-new-buffer-name " *temp*")) + (with-current-buffer (generate-new-buffer " *temp*") (mapc 'make-local-variable imap-local-variables) (set-buffer-multibyte nil) (buffer-disable-undo) diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index d0f8c1272d..bc99f02fe3 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -386,8 +386,7 @@ mailcap-maybe-eval (when (save-window-excursion (delete-other-windows) - (let ((buffer (get-buffer-create (generate-new-buffer-name - "*Warning*")))) + (let ((buffer (generate-new-buffer "*Warning*"))) (unwind-protect (with-current-buffer buffer (insert (substitute-command-keys diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el index 152dc725c7..e9d5018f30 100644 --- a/lisp/progmodes/flymake-proc.el +++ b/lisp/progmodes/flymake-proc.el @@ -429,16 +429,15 @@ flymake-proc--replace-region (defun flymake-proc--read-file-to-temp-buffer (file-name) "Insert contents of FILE-NAME into newly created temp buffer." - (let* ((temp-buffer (get-buffer-create (generate-new-buffer-name (concat "flymake:" (file-name-nondirectory file-name)))))) - (with-current-buffer temp-buffer - (insert-file-contents file-name)) - temp-buffer)) + (with-current-buffer (generate-new-buffer + (concat "flymake:" (file-name-nondirectory file-name))) + (insert-file-contents file-name) + (current-buffer))) (defun flymake-proc--copy-buffer-to-temp-buffer (buffer) "Copy contents of BUFFER into newly created temp buffer." - (with-current-buffer - (get-buffer-create (generate-new-buffer-name - (concat "flymake:" (buffer-name buffer)))) + (with-current-buffer (generate-new-buffer + (concat "flymake:" (buffer-name buffer))) (insert-buffer-substring buffer) (current-buffer))) diff --git a/lisp/simple.el b/lisp/simple.el index 090162b973..aab650e98a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4306,8 +4306,7 @@ shell-command-on-region (defun shell-command-to-string (command) "Execute shell command COMMAND and return its output as a string." (with-output-to-string - (with-current-buffer - standard-output + (with-current-buffer standard-output (shell-command command t)))) (defun process-file (program &optional infile buffer display &rest args) diff --git a/lisp/subr.el b/lisp/subr.el index 77c19c5bbf..6d5d7b4bac 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3701,10 +3701,11 @@ internal--after-with-selected-window (when (window-live-p (nth 1 state)) (select-window (nth 1 state) 'norecord))) -(defun generate-new-buffer (name) +(defun generate-new-buffer (name &optional inhibit-buffer-hooks) "Create and return a buffer with a name based on NAME. -Choose the buffer's name using `generate-new-buffer-name'." - (get-buffer-create (generate-new-buffer-name name))) +Choose the buffer's name using `generate-new-buffer-name'. +See `get-buffer-create' for the meaning of INHIBIT-BUFFER-HOOKS." + (get-buffer-create (generate-new-buffer-name name) inhibit-buffer-hooks)) (defmacro with-selected-window (window &rest body) "Execute the forms in BODY with WINDOW as the selected window. @@ -3866,12 +3867,14 @@ with-output-to-temp-buffer (defmacro with-temp-file (file &rest body) "Create a new buffer, evaluate BODY there, and write the buffer to FILE. The value returned is the value of the last form in BODY. +The buffer does not run the hooks `kill-buffer-hook', +`kill-buffer-query-functions', and `buffer-list-update-hook'. See also `with-temp-buffer'." (declare (indent 1) (debug t)) (let ((temp-file (make-symbol "temp-file")) (temp-buffer (make-symbol "temp-buffer"))) `(let ((,temp-file ,file) - (,temp-buffer (generate-new-buffer " *temp file*"))) + (,temp-buffer (generate-new-buffer " *temp file*" t))) (unwind-protect (prog1 (with-current-buffer ,temp-buffer @@ -3906,10 +3909,12 @@ with-temp-message (defmacro with-temp-buffer (&rest body) "Create a temporary buffer, and evaluate BODY there like `progn'. +The buffer does not run the hooks `kill-buffer-hook', +`kill-buffer-query-functions', and `buffer-list-update-hook'. See also `with-temp-file' and `with-output-to-string'." (declare (indent 0) (debug t)) (let ((temp-buffer (make-symbol "temp-buffer"))) - `(let ((,temp-buffer (generate-new-buffer " *temp*"))) + `(let ((,temp-buffer (generate-new-buffer " *temp*" t))) ;; `kill-buffer' can change current-buffer in some odd cases. (with-current-buffer ,temp-buffer (unwind-protect @@ -3944,7 +3949,7 @@ with-silent-modifications (defmacro with-output-to-string (&rest body) "Execute BODY, return the text it sent to `standard-output', as a string." (declare (indent 0) (debug t)) - `(let ((standard-output (generate-new-buffer " *string-output*"))) + `(let ((standard-output (generate-new-buffer " *string-output*" t))) (unwind-protect (progn (let ((standard-output standard-output)) diff --git a/src/buffer.c b/src/buffer.c index dfc34faf6e..9e44345616 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -37,7 +37,6 @@ Copyright (C) 1985-1989, 1993-1995, 1997-2020 Free Software Foundation, #include "window.h" #include "commands.h" #include "character.h" -#include "coding.h" #include "buffer.h" #include "region-cache.h" #include "indent.h" @@ -514,16 +513,33 @@ get_truename_buffer (register Lisp_Object filename) return Qnil; } -DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0, +/* Run buffer-list-update-hook if Vrun_hooks is non-nil, and BUF is NULL + or does not have buffer hooks inhibited. BUF is NULL when called by + make-indirect-buffer, since it does not inhibit buffer hooks. */ + +static void +run_buffer_list_update_hook (struct buffer *buf) +{ + if (! (NILP (Vrun_hooks) || (buf && buf->inhibit_buffer_hooks))) + call1 (Vrun_hooks, Qbuffer_list_update_hook); +} + +DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 2, 0, doc: /* Return the buffer specified by BUFFER-OR-NAME, creating a new one if needed. If BUFFER-OR-NAME is a string and a live buffer with that name exists, return that buffer. If no such buffer exists, create a new buffer with -that name and return it. If BUFFER-OR-NAME starts with a space, the new -buffer does not keep undo information. +that name and return it. + +If BUFFER-OR-NAME starts with a space, the new buffer does not keep undo +information. If optional argument INHIBIT-BUFFER-HOOKS is non-nil, the +new buffer does not run the hooks `kill-buffer-hook', +`kill-buffer-query-functions', and `buffer-list-update-hook'. This +avoids slowing down internal or temporary buffers that are never +presented to users or passed on to other applications. If BUFFER-OR-NAME is a buffer instead of a string, return it as given, even if it is dead. The return value is never nil. */) - (register Lisp_Object buffer_or_name) + (register Lisp_Object buffer_or_name, Lisp_Object inhibit_buffer_hooks) { register Lisp_Object buffer, name; register struct buffer *b; @@ -598,11 +614,7 @@ DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0, set_string_intervals (name, NULL); bset_name (b, name); - b->inhibit_buffer_hooks - = (STRINGP (Vcode_conversion_workbuf_name) - && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name), - SBYTES (Vcode_conversion_workbuf_name)) == 0); - + b->inhibit_buffer_hooks = !NILP (inhibit_buffer_hooks); bset_undo_list (b, SREF (name, 0) != ' ' ? Qnil : Qt); reset_buffer (b); @@ -614,9 +626,8 @@ DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0, /* Put this in the alist of all live buffers. */ XSETBUFFER (buffer, b); Vbuffer_alist = nconc2 (Vbuffer_alist, list1 (Fcons (name, buffer))); - /* And run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks) && !b->inhibit_buffer_hooks) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + + run_buffer_list_update_hook (b); return buffer; } @@ -890,9 +901,7 @@ DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer, set_buffer_internal_1 (old_b); } - /* Run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks)) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + run_buffer_list_update_hook (NULL); return buf; } @@ -1536,9 +1545,7 @@ DEFUN ("rename-buffer", Frename_buffer, Srename_buffer, 1, 2, && !NILP (BVAR (current_buffer, auto_save_file_name))) call0 (intern ("rename-auto-save-file")); - /* Run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks) && !current_buffer->inhibit_buffer_hooks) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + run_buffer_list_update_hook (current_buffer); /* Refetch since that last call may have done GC. */ return BVAR (current_buffer, name); @@ -1612,7 +1619,7 @@ DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 3, 0, buf = Fget_buffer (scratch); if (NILP (buf)) { - buf = Fget_buffer_create (scratch); + buf = Fget_buffer_create (scratch, Qnil); Fset_buffer_major_mode (buf); } return buf; @@ -1636,7 +1643,7 @@ other_buffer_safely (Lisp_Object buffer) buf = Fget_buffer (scratch); if (NILP (buf)) { - buf = Fget_buffer_create (scratch); + buf = Fget_buffer_create (scratch, Qnil); Fset_buffer_major_mode (buf); } @@ -1713,7 +1720,9 @@ DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 0, 1, "bKill buffer: ", the buffer is not killed. The hook `kill-buffer-hook' is run before the buffer is actually killed. The buffer being killed will be current while the hook is running. Functions called by any of these hooks are -supposed to not change the current buffer. +supposed to not change the current buffer. Neither hook is run for +internal or temporary buffers created by `get-buffer-create' or +`generate-new-buffer' with argument INHIBIT-BUFFER-HOOKS non-nil. Any processes that have this buffer as the `process-buffer' are killed with SIGHUP. This function calls `replace-buffer-in-windows' for @@ -1973,9 +1982,7 @@ DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 0, 1, "bKill buffer: ", bset_width_table (b, Qnil); unblock_input (); - /* Run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks) && !b->inhibit_buffer_hooks) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + run_buffer_list_update_hook (b); return Qt; } @@ -2015,9 +2022,7 @@ record_buffer (Lisp_Object buffer) fset_buffer_list (f, Fcons (buffer, Fdelq (buffer, f->buffer_list))); fset_buried_buffer_list (f, Fdelq (buffer, f->buried_buffer_list)); - /* Run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks) && !XBUFFER (buffer)->inhibit_buffer_hooks) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + run_buffer_list_update_hook (XBUFFER (buffer)); } @@ -2054,9 +2059,7 @@ DEFUN ("bury-buffer-internal", Fbury_buffer_internal, Sbury_buffer_internal, fset_buried_buffer_list (f, Fcons (buffer, Fdelq (buffer, f->buried_buffer_list))); - /* Run buffer-list-update-hook. */ - if (!NILP (Vrun_hooks) && !XBUFFER (buffer)->inhibit_buffer_hooks) - call1 (Vrun_hooks, Qbuffer_list_update_hook); + run_buffer_list_update_hook (XBUFFER (buffer)); return Qnil; } @@ -5349,10 +5352,11 @@ init_buffer_once (void) Fput (Qkill_buffer_hook, Qpermanent_local, Qt); /* Super-magic invisible buffer. */ - Vprin1_to_string_buffer = Fget_buffer_create (build_pure_c_string (" prin1")); + Vprin1_to_string_buffer = + Fget_buffer_create (build_pure_c_string (" prin1"), Qt); Vbuffer_alist = Qnil; - Fset_buffer (Fget_buffer_create (build_pure_c_string ("*scratch*"))); + Fset_buffer (Fget_buffer_create (build_pure_c_string ("*scratch*"), Qnil)); inhibit_modification_hooks = 0; } @@ -5397,7 +5401,7 @@ init_buffer (void) #endif /* USE_MMAP_FOR_BUFFERS */ AUTO_STRING (scratch, "*scratch*"); - Fset_buffer (Fget_buffer_create (scratch)); + Fset_buffer (Fget_buffer_create (scratch, Qnil)); if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters))) Fset_buffer_multibyte (Qnil); @@ -6300,9 +6304,14 @@ from (abs POSITION). If POSITION is positive, point was at the front DEFVAR_LISP ("kill-buffer-query-functions", Vkill_buffer_query_functions, doc: /* List of functions called with no args to query before killing a buffer. The buffer being killed will be current while the functions are running. +See `kill-buffer'. If any of them returns nil, the buffer is not killed. Functions run by -this hook are supposed to not change the current buffer. */); +this hook are supposed to not change the current buffer. + +This hook is not run for internal or temporary buffers created by +`get-buffer-create' or `generate-new-buffer' with argument +INHIBIT-BUFFER-HOOKS non-nil. */); Vkill_buffer_query_functions = Qnil; DEFVAR_LISP ("change-major-mode-hook", Vchange_major_mode_hook, @@ -6315,9 +6324,12 @@ from (abs POSITION). If POSITION is positive, point was at the front doc: /* Hook run when the buffer list changes. Functions (implicitly) running this hook are `get-buffer-create', `make-indirect-buffer', `rename-buffer', `kill-buffer', `bury-buffer' -and `select-window'. Functions run by this hook should avoid calling -`select-window' with a nil NORECORD argument or `with-temp-buffer' -since either may lead to infinite recursion. */); +and `select-window'. This hook is not run for internal or temporary +buffers created by `get-buffer-create' or `generate-new-buffer' with +argument INHIBIT-BUFFER-HOOKS non-nil. + +Functions run by this hook should avoid calling `select-window' with a +nil NORECORD argument since it may lead to infinite recursion. */); Vbuffer_list_update_hook = Qnil; DEFSYM (Qbuffer_list_update_hook, "buffer-list-update-hook"); diff --git a/src/buffer.h b/src/buffer.h index fe549c5dac..b8c5162be4 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -663,11 +663,11 @@ #define BVAR(buf, field) ((buf)->field ## _) /* Non-zero whenever the narrowing is changed in this buffer. */ bool_bf clip_changed : 1; - /* Non-zero for internally used temporary buffers that don't need to - run hooks kill-buffer-hook, buffer-list-update-hook, and - kill-buffer-query-functions. This is used in coding.c to avoid - slowing down en/decoding when there are a lot of these hooks - defined. */ + /* Non-zero for internal or temporary buffers that don't need to + run hooks kill-buffer-hook, kill-buffer-query-functions, and + buffer-list-update-hook. This is used in coding.c to avoid + slowing down en/decoding when a lot of these hooks are + defined, as well as by with-temp-buffer, for example. */ bool_bf inhibit_buffer_hooks : 1; /* List of overlays that end at or before the current center, diff --git a/src/callproc.c b/src/callproc.c index e3346e2eab..4bca1e5ebd 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -405,9 +405,8 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, if (! (NILP (buffer) || EQ (buffer, Qt) || FIXNUMP (buffer))) { - Lisp_Object spec_buffer; - spec_buffer = buffer; - buffer = Fget_buffer_create (buffer); + Lisp_Object spec_buffer = buffer; + buffer = Fget_buffer_create (buffer, Qnil); /* Mention the buffer name for a better error message. */ if (NILP (buffer)) CHECK_BUFFER (spec_buffer); diff --git a/src/coding.c b/src/coding.c index 2142e7fa51..1afa4aa474 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7821,7 +7821,7 @@ encode_coding (struct coding_system *coding) /* A string that serves as name of the reusable work buffer, and as base name of temporary work buffers used for code-conversion operations. */ -Lisp_Object Vcode_conversion_workbuf_name; +static Lisp_Object Vcode_conversion_workbuf_name; /* The reusable working buffer, created once and never killed. */ static Lisp_Object Vcode_conversion_reused_workbuf; @@ -7839,7 +7839,7 @@ code_conversion_restore (Lisp_Object arg) if (! NILP (workbuf)) { if (EQ (workbuf, Vcode_conversion_reused_workbuf)) - reused_workbuf_in_use = 0; + reused_workbuf_in_use = false; else Fkill_buffer (workbuf); } @@ -7857,13 +7857,13 @@ code_conversion_save (bool with_work_buf, bool multibyte) { Lisp_Object name = Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name, Qnil); - workbuf = Fget_buffer_create (name); + workbuf = Fget_buffer_create (name, Qt); } else { if (NILP (Fbuffer_live_p (Vcode_conversion_reused_workbuf))) Vcode_conversion_reused_workbuf - = Fget_buffer_create (Vcode_conversion_workbuf_name); + = Fget_buffer_create (Vcode_conversion_workbuf_name, Qt); workbuf = Vcode_conversion_reused_workbuf; } } @@ -7881,7 +7881,7 @@ code_conversion_save (bool with_work_buf, bool multibyte) bset_undo_list (current_buffer, Qt); bset_enable_multibyte_characters (current_buffer, multibyte ? Qt : Qnil); if (EQ (workbuf, Vcode_conversion_reused_workbuf)) - reused_workbuf_in_use = 1; + reused_workbuf_in_use = true; set_buffer_internal (current); } @@ -11639,7 +11639,7 @@ syms_of_coding (void) staticpro (&Vcode_conversion_workbuf_name); Vcode_conversion_workbuf_name = build_pure_c_string (" *code-conversion-work*"); - reused_workbuf_in_use = 0; + reused_workbuf_in_use = false; PDUMPER_REMEMBER_SCALAR (reused_workbuf_in_use); DEFSYM (Qcharset, "charset"); diff --git a/src/coding.h b/src/coding.h index 4973cf89eb..9ad1e954f8 100644 --- a/src/coding.h +++ b/src/coding.h @@ -97,9 +97,6 @@ #define EMACS_CODING_H extern Lisp_Object Vcoding_system_hash_table; -/* Name (or base name) of work buffer for code conversion. */ -extern Lisp_Object Vcode_conversion_workbuf_name; - /* Enumeration of index to an attribute vector of a coding system. */ enum coding_attr_index diff --git a/src/fileio.c b/src/fileio.c index c97f4daf20..51f12e104e 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4004,7 +4004,7 @@ because (1) it preserves some marker positions (in unchanged portions record_unwind_current_buffer (); - workbuf = Fget_buffer_create (name); + workbuf = Fget_buffer_create (name, Qt); buf = XBUFFER (workbuf); delete_all_overlays (buf); diff --git a/src/minibuf.c b/src/minibuf.c index fc3fd92a88..1940564a80 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -809,7 +809,7 @@ get_minibuffer (EMACS_INT depth) static char const name_fmt[] = " *Minibuf-%"pI"d*"; char name[sizeof name_fmt + INT_STRLEN_BOUND (EMACS_INT)]; AUTO_STRING_WITH_LEN (lname, name, sprintf (name, name_fmt, depth)); - buf = Fget_buffer_create (lname); + buf = Fget_buffer_create (lname, Qnil); /* Although the buffer's name starts with a space, undo should be enabled in it. */ diff --git a/src/print.c b/src/print.c index 008bf5e639..ec271d914c 100644 --- a/src/print.c +++ b/src/print.c @@ -562,7 +562,7 @@ temp_output_buffer_setup (const char *bufname) record_unwind_current_buffer (); - Fset_buffer (Fget_buffer_create (build_string (bufname))); + Fset_buffer (Fget_buffer_create (build_string (bufname), Qnil)); Fkill_all_local_variables (); delete_all_overlays (current_buffer); diff --git a/src/process.c b/src/process.c index 4fe8ac7fc0..9efefb1de7 100644 --- a/src/process.c +++ b/src/process.c @@ -1731,7 +1731,7 @@ DEFUN ("make-process", Fmake_process, Smake_process, 0, MANY, 0, buffer = Fplist_get (contact, QCbuffer); if (!NILP (buffer)) - buffer = Fget_buffer_create (buffer); + buffer = Fget_buffer_create (buffer, Qnil); /* Make sure that the child will be able to chdir to the current buffer's current directory, or its unhandled equivalent. We @@ -1768,7 +1768,7 @@ DEFUN ("make-process", Fmake_process, Smake_process, 0, MANY, 0, QCname, concat2 (name, build_string (" stderr")), QCbuffer, - Fget_buffer_create (xstderr), + Fget_buffer_create (xstderr, Qnil), QCnoquery, query_on_exit ? Qnil : Qt); } @@ -2443,7 +2443,7 @@ DEFUN ("make-pipe-process", Fmake_pipe_process, Smake_pipe_process, buffer = Fplist_get (contact, QCbuffer); if (NILP (buffer)) buffer = name; - buffer = Fget_buffer_create (buffer); + buffer = Fget_buffer_create (buffer, Qnil); pset_buffer (p, buffer); pset_childp (p, contact); @@ -3173,7 +3173,7 @@ DEFUN ("make-serial-process", Fmake_serial_process, Smake_serial_process, buffer = Fplist_get (contact, QCbuffer); if (NILP (buffer)) buffer = name; - buffer = Fget_buffer_create (buffer); + buffer = Fget_buffer_create (buffer, Qnil); pset_buffer (p, buffer); pset_childp (p, contact); @@ -4188,7 +4188,7 @@ DEFUN ("make-network-process", Fmake_network_process, Smake_network_process, open_socket: if (!NILP (buffer)) - buffer = Fget_buffer_create (buffer); + buffer = Fget_buffer_create (buffer, Qnil); /* Unwind bind_polling_period. */ unbind_to (count, Qnil); @@ -4961,7 +4961,7 @@ server_accept_connection (Lisp_Object server, int channel) if (!NILP (buffer)) { args[1] = buffer; - buffer = Fget_buffer_create (Fformat (nargs, args)); + buffer = Fget_buffer_create (Fformat (nargs, args), Qnil); } } diff --git a/src/w32fns.c b/src/w32fns.c index a840f0e122..36bee0676b 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7372,7 +7372,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, tip_f = XFRAME (tip_frame); window = FRAME_ROOT_WINDOW (tip_f); - tip_buf = Fget_buffer_create (tip); + tip_buf = Fget_buffer_create (tip, Qnil); /* We will mark the tip window a "pseudo-window" below, and such windows cannot have display margins. */ bset_left_margin_cols (XBUFFER (tip_buf), make_fixnum (0)); diff --git a/src/window.c b/src/window.c index bcc989b5a7..5db166e345 100644 --- a/src/window.c +++ b/src/window.c @@ -617,11 +617,12 @@ DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, Run `buffer-list-update-hook' unless NORECORD is non-nil. Note that applications and internal routines often select a window temporarily for various purposes; mostly, to simplify coding. As a rule, such -selections should be not recorded and therefore will not pollute +selections should not be recorded and therefore will not pollute `buffer-list-update-hook'. Selections that "really count" are those causing a visible change in the next redisplay of WINDOW's frame and -should be always recorded. So if you think of running a function each -time a window gets selected put it on `buffer-list-update-hook'. +should always be recorded. So if you think of running a function each +time a window gets selected, put it on `buffer-list-update-hook' or +`window-selection-change-functions'. Also note that the main editor command loop sets the current buffer to the buffer of the selected window before each command. */) diff --git a/src/xdisp.c b/src/xdisp.c index 0fd5ec5ec5..b5adee5105 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10880,7 +10880,7 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte) /* Ensure the Messages buffer exists, and switch to it. If we created it, set the major-mode. */ bool newbuffer = NILP (Fget_buffer (Vmessages_buffer_name)); - Fset_buffer (Fget_buffer_create (Vmessages_buffer_name)); + Fset_buffer (Fget_buffer_create (Vmessages_buffer_name, Qnil)); if (newbuffer && !NILP (Ffboundp (intern ("messages-buffer-mode")))) call0 (intern ("messages-buffer-mode")); @@ -11366,7 +11366,7 @@ ensure_echo_area_buffers (void) static char const name_fmt[] = " *Echo Area %d*"; char name[sizeof name_fmt + INT_STRLEN_BOUND (int)]; AUTO_STRING_WITH_LEN (lname, name, sprintf (name, name_fmt, i)); - echo_buffer[i] = Fget_buffer_create (lname); + echo_buffer[i] = Fget_buffer_create (lname, Qnil); bset_truncate_lines (XBUFFER (echo_buffer[i]), Qnil); /* to force word wrap in echo area - it was decided to postpone this*/ diff --git a/src/xfns.c b/src/xfns.c index 46e4bd73a6..abe293e903 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -7041,7 +7041,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, tip_f = XFRAME (tip_frame); window = FRAME_ROOT_WINDOW (tip_f); - tip_buf = Fget_buffer_create (tip); + tip_buf = Fget_buffer_create (tip, Qnil); /* We will mark the tip window a "pseudo-window" below, and such windows cannot have display margins. */ bset_left_margin_cols (XBUFFER (tip_buf), make_fixnum (0)); diff --git a/src/xwidget.c b/src/xwidget.c index e078a28a35..accde65b52 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -100,7 +100,8 @@ DEFUN ("make-xwidget", Lisp_Object val; xw->type = type; xw->title = title; - xw->buffer = NILP (buffer) ? Fcurrent_buffer () : Fget_buffer_create (buffer); + xw->buffer = (NILP (buffer) ? Fcurrent_buffer () + : Fget_buffer_create (buffer, Qnil)); xw->height = XFIXNAT (height); xw->width = XFIXNAT (width); xw->kill_without_query = false; diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el index 0db66f9751..dd8927457a 100644 --- a/test/src/buffer-tests.el +++ b/test/src/buffer-tests.el @@ -19,9 +19,7 @@ ;;; Code: -(require 'ert) -(require 'seq) -(eval-when-compile (require 'cl-lib)) +(require 'cl-lib) (ert-deftest overlay-modification-hooks-message-other-buf () "Test for bug#21824. @@ -1334,4 +1332,33 @@ buffer-tests-buffer-local-variables-undo (with-temp-buffer (should (assq 'buffer-undo-list (buffer-local-variables))))) +(ert-deftest buffer-tests-inhibit-buffer-hooks () + "Test `get-buffer-create' argument INHIBIT-BUFFER-HOOKS." + (let* (run-bluh (bluh (lambda () (setq run-bluh t)))) + (unwind-protect + (let* ( run-kbh (kbh (lambda () (setq run-kbh t))) + run-kbqf (kbqf (lambda () (setq run-kbqf t))) ) + + ;; Inhibited. + (add-hook 'buffer-list-update-hook bluh) + (with-current-buffer (generate-new-buffer " foo" t) + (add-hook 'kill-buffer-hook kbh nil t) + (add-hook 'kill-buffer-query-functions kbqf nil t) + (kill-buffer)) + (with-temp-buffer) + (with-output-to-string) + (should-not run-bluh) + (should-not run-kbh) + (should-not run-kbqf) + + ;; Not inhibited. + (with-current-buffer (generate-new-buffer " foo") + (should run-bluh) + (add-hook 'kill-buffer-hook kbh nil t) + (add-hook 'kill-buffer-query-functions kbqf nil t) + (kill-buffer)) + (should run-kbh) + (should run-kbqf)) + (remove-hook 'buffer-list-update-hook bluh)))) + ;;; buffer-tests.el ends here -- 2.29.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 20 10:05:47 2020 Received: (at 34765) by debbugs.gnu.org; 20 Dec 2020 15:05:47 +0000 Received: from localhost ([127.0.0.1]:45343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kr0HG-0006mY-VP for submit@debbugs.gnu.org; Sun, 20 Dec 2020 10:05:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kr0HE-0006mL-Lc for 34765@debbugs.gnu.org; Sun, 20 Dec 2020 10:05:41 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47338) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kr0H7-0001kR-Et; Sun, 20 Dec 2020 10:05:33 -0500 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1247 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kr0H6-0005XX-Pf; Sun, 20 Dec 2020 10:05:33 -0500 Date: Sun, 20 Dec 2020 17:05:15 +0200 Message-Id: <833600tt5g.fsf@gnu.org> From: Eli Zaretskii To: "Basil L. Contovounesios" In-Reply-To: <87zh2933ka.fsf@tcd.ie> (contovob@tcd.ie) Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <767e1b59-6ac2-cd11-076e-82a56ac53e29@gmx.at> <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> <87360qoa6o.fsf@tcd.ie> <878sa9cle0.fsf@tcd.ie> <87eejnaqzz.fsf@tcd.ie> <831rfmultr.fsf@gnu.org> <878s9t6fwd.fsf@tcd.ie> <83mty9u6fn.fsf@gnu.org> <87zh2933ka.fsf@tcd.ie> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34765 Cc: 34765@debbugs.gnu.org, rudalics@gmx.at, larsi@gnus.org, monnier@iro.umontreal.ca, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: "Basil L. Contovounesios" > Cc: monnier@iro.umontreal.ca, rudalics@gmx.at, larsi@gnus.org, > 34765@debbugs.gnu.org, alexanderm@web.de > Date: Sat, 19 Dec 2020 21:10:13 +0000 > > >> The printed label "see Current Buffer" should be displayed instead of > >> this word, which is part of the anchor. Is that okay? > > > > Sorry, I didn't see that this is an anchor. So I think the anchor > > should not start with a capital letter, as it reads more naturally > > that way, I think. And then the name should be used without > > capitalization in the cross-references. Obviously, this is a minor > > nit. > > I'm hesitant to change the anchor because all 37 such "Definition of..." > anchors in the tree are capitalised, as are the printed labels of all > their refs. > > I'm happy to downcase them, but maybe this should be done wholesale in a > separate commit? That's okay, let's leave the anchor capitalization alone for now. > >> The alternatives would be for Fmake_indirect_buffer to not call > >> run_buffer_list_update_hook, or to not bother adding > >> run_buffer_list_update_hook at all. Do you have a preference? > > > > I think just having a comment there saying that make-indirect-buffer > > calls this with NULL argument should be okay. > > How's the attached? LGTM, thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 20 12:57:32 2020 Received: (at control) by debbugs.gnu.org; 20 Dec 2020 17:57:32 +0000 Received: from localhost ([127.0.0.1]:45563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kr2xR-0004f5-8H for submit@debbugs.gnu.org; Sun, 20 Dec 2020 12:57:32 -0500 Received: from mail-wm1-f48.google.com ([209.85.128.48]:38060) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kr2xP-0004ei-AD for control@debbugs.gnu.org; Sun, 20 Dec 2020 12:57:23 -0500 Received: by mail-wm1-f48.google.com with SMTP id g185so8501218wmf.3 for ; Sun, 20 Dec 2020 09:57:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:message-id:user-agent :mime-version; bh=ylpGbhxvjOqOIV0phrBdidiTW3KSIvfAiuWBoqlm4LI=; b=eEfQZU3KEu7KujvhFbsVczW1+tVdvWFH9/deAvOiDcN3XcBU82CEemiZR5msbW0xa5 powt2QmK8iWTZawl76aeZ9Y2GhyY52uvISS20CtO1JccSYUOS5jlMl6Ld3LPwY6hzGg1 oDkANs1ht4/SS/zviQUGTdwkzkWIBuxpKEOePoqDIOQLPgIgMinq3CsP82NZ/nM1AubW dU1C7/RibdTwNOsduXvkaZnwdSSgRccvrO4+hq07HJDvU1q68vYs6we4lhLz2pMnfGND s0v3pzUHpuWDzapxNpqePj12n7h++gDhDRnDIkeicjiVJ9keo7LrxOaB+b82j9200Pfj JpVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:message-id :user-agent:mime-version; bh=ylpGbhxvjOqOIV0phrBdidiTW3KSIvfAiuWBoqlm4LI=; b=qnxfFgYA9ELE6VC8l1+NHRTilFs2SYLwa8zeRH4JMpyHLPdFuPf2Kq/u1MzUTCQ620 AQbBu67VygRKU5Hni1qNSfAUEe+cYLvsmE/tQodR5/OCblXCxrlZYUaYEm4YevgbckSS kEGSsBTZOAc8udVd+QTgNqZgNbmmeZqClpbUnC8EN1LtlqPnaFTgRkOAltwXsUrwJXNr uLIzUsgpBUyBHSdyFNLHGKq0dnIn63Oyv4YvSB1TBLGfC0i4wJezbIuGM1mWy0Z2myIt UIW2h08iSZ4XjI1/EdiWQx3lNStOkoR1zwgem20WrKGCN9xdj5Le2/0CeEZcPBJj24qT SMQg== X-Gm-Message-State: AOAM532cmKtDBddsEKNkzbdY9FkR6trMoa/drBOCU9ezJJtjio8U0R6/ AaRNBOu3KwN+32Fc1khpfFZ1sA== X-Google-Smtp-Source: ABdhPJxOTw2oG7a1/yJl/lkldUAq/UOqNkLqLPx3Y6v1pT7aNmRYZ4JLcFzQ7nfffPuspdMOI35BTw== X-Received: by 2002:a1c:3d55:: with SMTP id k82mr12751131wma.57.1608487037189; Sun, 20 Dec 2020 09:57:17 -0800 (PST) Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id x66sm19346862wmg.26.2020.12.20.09.57.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Dec 2020 09:57:16 -0800 (PST) From: "Basil L. Contovounesios" To: Eli Zaretskii Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook References: <11be4631-b087-52a3-92fe-4cbd5248908d@gmx.at> <838svxxk41.fsf@gnu.org> <49c11920-0909-dcc2-4a39-4cdcfaf20453@gmx.at> <87h7sp1xay.fsf@gnus.org> <83r1rgpusx.fsf@gnu.org> <87pn5u7m0y.fsf@gnus.org> <5bdc73dd-af73-1b9a-9bb4-e154787e1976@gmx.at> <87a6uzan9s.fsf@tcd.ie> <71b78484-b0a7-3e0e-a999-afa07f8b4832@gmx.at> <87lfeioh0v.fsf@tcd.ie> <83tut6iqbp.fsf@gnu.org> <87360qoa6o.fsf@tcd.ie> <878sa9cle0.fsf@tcd.ie> <87eejnaqzz.fsf@tcd.ie> <831rfmultr.fsf@gnu.org> <878s9t6fwd.fsf@tcd.ie> <83mty9u6fn.fsf@gnu.org> <87zh2933ka.fsf@tcd.ie> <833600tt5g.fsf@gnu.org> Date: Sun, 20 Dec 2020 17:57:15 +0000 Message-ID: <87a6u8icn8.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control Cc: 34765-done@debbugs.gnu.org, rudalics@gmx.at, larsi@gnus.org, monnier@iro.umontreal.ca, alexanderm@web.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 34765 fixed close 34765 28.1 quit Eli Zaretskii writes: >> From: "Basil L. Contovounesios" >> Cc: monnier@iro.umontreal.ca, rudalics@gmx.at, larsi@gnus.org, >> 34765@debbugs.gnu.org, alexanderm@web.de >> Date: Sat, 19 Dec 2020 21:10:13 +0000 >> >> How's the attached? > > LGTM, thanks. Thanks. Pushed to master, and closing. Inhibit buffer hooks in temporary buffers 1a0a11f7d2 2020-12-20 17:32:24 +0000 https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=1a0a11f7d2d1dbecb9f754b1e129d50e489058e6 -- Basil From unknown Fri Jun 20 07:14:37 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 18 Jan 2021 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator