unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#49160: 28.0.50; [PATCH] Uninitialized inhibit_buffer_hooks
@ 2021-06-21 19:39 dick
  2021-06-22 11:41 ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: dick @ 2021-06-21 19:39 UTC (permalink / raw)
  To: 49160

[-- Attachment #1: Type: text/plain, Size: 114 bytes --]


It's random whether buffers created outside `get-buffer-create`, i.e.,
indirect buffers, call kill-buffer hooks.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Uninitialized-inhibit-buffer-hooks.patch --]
[-- Type: text/x-diff, Size: 2433 bytes --]

From 84bee9ae521e702f0368d1cdf785252944a40574 Mon Sep 17 00:00:00 2001
From: dickmao <none>
Date: Mon, 21 Jun 2021 15:36:46 -0400
Subject: [PATCH] Uninitialized inhibit-buffer-hooks

It's random whether buffers created outside `get-buffer-create`, i.e.,
indirect buffers, call kill-buffer hooks.
* src/buffer.c (Fmake_indirect_buffer):
Match base buffer's inhibit-buffer-hooks.
* test/src/buffer-tests.el (buffer-tests-inhibit-buffer-hooks-indirect):
Add a test.
---
 src/buffer.c             |  1 +
 test/src/buffer-tests.el | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/src/buffer.c b/src/buffer.c
index 565577e75a..5ba1682606 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -834,6 +834,7 @@ DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer,
   b->pt_byte = b->base_buffer->pt_byte;
   b->begv_byte = b->base_buffer->begv_byte;
   b->zv_byte = b->base_buffer->zv_byte;
+  b->inhibit_buffer_hooks = b->base_buffer->inhibit_buffer_hooks;
 
   b->newline_cache = 0;
   b->width_run_cache = 0;
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el
index 123f2e8eab..0161927419 100644
--- a/test/src/buffer-tests.el
+++ b/test/src/buffer-tests.el
@@ -1361,4 +1361,28 @@ buffer-tests-inhibit-buffer-hooks
           (should run-kbqf))
       (remove-hook 'buffer-list-update-hook bluh))))
 
+(ert-deftest buffer-tests-inhibit-buffer-hooks-indirect ()
+  "Indirect buffers do not call `get-buffer-create'."
+  (dolist (inhibit '(nil t))
+    (let ((base (get-buffer-create "foo" inhibit)))
+      (unwind-protect
+          (dotimes (_i 11)
+            (let* (flag*
+                   (flag (lambda () (prog1 t (setq flag* t))))
+                   (indirect (make-indirect-buffer base "foo[indirect]")))
+              (unwind-protect
+                  (progn
+                    (with-current-buffer indirect
+                      (add-hook 'kill-buffer-query-functions flag nil t))
+                    (kill-buffer indirect)
+                    (if inhibit
+                        (should-not flag*)
+                      (should flag*)))
+                (let (kill-buffer-query-functions)
+                  (when (buffer-live-p indirect)
+                    (kill-buffer indirect))))))
+        (let (kill-buffer-query-functions)
+          (when (buffer-live-p base)
+            (kill-buffer base)))))))
+
 ;;; buffer-tests.el ends here
-- 
2.26.2


[-- Attachment #3: Type: text/plain, Size: 23359 bytes --]




In GNU Emacs 28.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.10)
 of 2021-06-16 built on dick
Repository revision: 1aece73f02724f283bea73e374f6f7f2b4af3b50
Repository branch: gnus-dev-28
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 18.04.4 LTS

Configured using:
 'configure --prefix=/home/dick/.local
 PKG_CONFIG_PATH=/home/dick/.local/lib/pkgconfig'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LCMS2
LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND
THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Magit Rev

Minor modes in effect:
  goto-address-mode: t
  async-bytecomp-package-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  bug-reference-mode: t
  show-paren-mode: t
  projectile-mode: t
  flx-ido-mode: t
  override-global-mode: t
  shell-dirtrack-mode: t
  beacon-mode: t
  global-hl-line-mode: t
  winner-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/dick/ESS/lisp/obsolete/ess-swv hides /home/dick/ESS/lisp/ess-swv
/home/dick/ESS/lisp/obsolete/ess-rutils hides /home/dick/ESS/lisp/ess-rutils
/home/dick/ESS/lisp/obsolete/ess-noweb hides /home/dick/ESS/lisp/ess-noweb
/home/dick/ESS/lisp/obsolete/mouseme hides /home/dick/ESS/lisp/mouseme
/home/dick/ESS/lisp/obsolete/ess-mouse hides /home/dick/ESS/lisp/ess-mouse
/home/dick/ESS/lisp/obsolete/ess-noweb-mode hides /home/dick/ESS/lisp/ess-noweb-mode
/home/dick/ESS/lisp/obsolete/make-regexp hides /home/dick/ESS/lisp/make-regexp
/home/dick/ESS/lisp/obsolete/ess-r-a hides /home/dick/ESS/lisp/ess-r-a
/home/dick/ESS/lisp/obsolete/ess-noweb-font-lock-mode hides /home/dick/ESS/lisp/ess-noweb-font-lock-mode
/home/dick/gomacro-mode/gomacro-mode hides /home/dick/.emacs.d/elpa/gomacro-mode-20200326.1103/gomacro-mode
/home/dick/ESS/lisp/julia-mode hides /home/dick/.emacs.d/elpa/julia-mode-20200717.1915/julia-mode
/home/dick/ESS/lisp/julia-mode-latexsubs hides /home/dick/.emacs.d/elpa/julia-mode-20200717.1915/julia-mode-latexsubs
/home/dick/.emacs.d/elpa/hydra-20170924.2259/lv hides /home/dick/.emacs.d/elpa/lv-20191106.1238/lv
/home/dick/org-gcal.el/org-gcal hides /home/dick/.emacs.d/elpa/org-gcal-0.3/org-gcal
/home/dick/.emacs.d/elpa/async-20200113.1745/async-autoloads hides /home/dick/.local/share/emacs/site-lisp/emacs-async/async-autoloads
/home/dick/.emacs.d/elpa/async-20200113.1745/async-bytecomp hides /home/dick/.local/share/emacs/site-lisp/emacs-async/async-bytecomp
/home/dick/.emacs.d/elpa/async-20200113.1745/smtpmail-async hides /home/dick/.local/share/emacs/site-lisp/emacs-async/smtpmail-async
/home/dick/.emacs.d/elpa/async-20200113.1745/dired-async hides /home/dick/.local/share/emacs/site-lisp/emacs-async/dired-async
/home/dick/.emacs.d/elpa/async-20200113.1745/async hides /home/dick/.local/share/emacs/site-lisp/emacs-async/async
/home/dick/.emacs.d/elpa/async-20200113.1745/async-pkg hides /home/dick/.local/share/emacs/site-lisp/emacs-async/async-pkg
/home/dick/.emacs.d/lisp/json hides /home/dick/.local/share/emacs/28.0.50/lisp/json
/home/dick/.emacs.d/elpa/transient-20210221.2251/transient hides /home/dick/.local/share/emacs/28.0.50/lisp/transient
/home/dick/.emacs.d/elpa/org-9.4.5/ob-eval hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-eval
/home/dick/.emacs.d/elpa/org-9.4.5/ob-perl hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-perl
/home/dick/.emacs.d/elpa/org-9.4.5/ob-eshell hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-eshell
/home/dick/.emacs.d/elpa/org-9.4.5/ob-abc hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-abc
/home/dick/.emacs.d/elpa/org-9.4.5/ob-tangle hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-tangle
/home/dick/.emacs.d/elpa/org-9.4.5/ob-vala hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-vala
/home/dick/.emacs.d/elpa/org-9.4.5/org-attach-git hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-attach-git
/home/dick/.emacs.d/elpa/org-9.4.5/org-ctags hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-ctags
/home/dick/.emacs.d/elpa/org-9.4.5/ob-table hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-table
/home/dick/.emacs.d/elpa/org-9.4.5/org-element hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-element
/home/dick/.emacs.d/elpa/org-9.4.5/org-colview hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-colview
/home/dick/.emacs.d/elpa/org-9.4.5/ol-mhe hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ol-mhe
/home/dick/.emacs.d/elpa/org-9.4.5/ob-stan hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-stan
/home/dick/.emacs.d/elpa/org-9.4.5/org-table hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-table
/home/dick/.emacs.d/elpa/org-9.4.5/org-keys hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-keys
/home/dick/.emacs.d/elpa/org-9.4.5/ol hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ol
/home/dick/.emacs.d/elpa/org-9.4.5/ob-dot hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-dot
/home/dick/.emacs.d/elpa/org-9.4.5/ob-js hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-js
/home/dick/.emacs.d/elpa/org-9.4.5/ob-clojure hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-clojure
/home/dick/.emacs.d/elpa/org-9.4.5/ob-fortran hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-fortran
/home/dick/.emacs.d/elpa/org-9.4.5/org-refile hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-refile
/home/dick/.emacs.d/elpa/org-9.4.5/org-clock hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-clock
/home/dick/.emacs.d/elpa/org-9.4.5/ob-sql hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-sql
/home/dick/.emacs.d/elpa/org-9.4.5/ob-exp hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-exp
/home/dick/.emacs.d/elpa/org-9.4.5/ob-asymptote hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-asymptote
/home/dick/.emacs.d/elpa/org-9.4.5/ob-org hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-org
/home/dick/.emacs.d/elpa/org-9.4.5/org-compat hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-compat
/home/dick/.emacs.d/elpa/org-9.4.5/ob-python hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-python
/home/dick/.emacs.d/elpa/org-9.4.5/ob-ref hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-ref
/home/dick/.emacs.d/elpa/org-9.4.5/ox hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ox
/home/dick/.emacs.d/elpa/org-9.4.5/ob-C hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-C
/home/dick/.emacs.d/elpa/org-9.4.5/ol-info hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ol-info
/home/dick/.emacs.d/elpa/org-9.4.5/org-tempo hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-tempo
/home/dick/.emacs.d/elpa/org-9.4.5/ox-md hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ox-md
/home/dick/.emacs.d/elpa/org-9.4.5/ob-screen hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-screen
/home/dick/.emacs.d/elpa/org-9.4.5/ob-lisp hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-lisp
/home/dick/.emacs.d/elpa/org-9.4.5/ob-lua hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-lua
/home/dick/.emacs.d/elpa/org-9.4.5/ob-matlab hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-matlab
/home/dick/.emacs.d/elpa/org-9.4.5/org-list hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-list
/home/dick/.emacs.d/elpa/org-9.4.5/ob-groovy hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-groovy
/home/dick/.emacs.d/elpa/org-9.4.5/ol-docview hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ol-docview
/home/dick/.emacs.d/elpa/org-9.4.5/ob-ebnf hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-ebnf
/home/dick/.emacs.d/elpa/org-9.4.5/ob-forth hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-forth
/home/dick/.emacs.d/elpa/org-9.4.5/ox-html hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ox-html
/home/dick/.emacs.d/elpa/org-9.4.5/ob-io hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-io
/home/dick/.emacs.d/elpa/org-9.4.5/org-faces hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-faces
/home/dick/.emacs.d/elpa/org-9.4.5/ob-emacs-lisp hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-emacs-lisp
/home/dick/.emacs.d/elpa/org-9.4.5/ob-ocaml hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-ocaml
/home/dick/.emacs.d/elpa/org-9.4.5/ol-bbdb hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ol-bbdb
/home/dick/.emacs.d/elpa/org-9.4.5/org-lint hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-lint
/home/dick/.emacs.d/elpa/org-9.4.5/ob-shen hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-shen
/home/dick/.emacs.d/elpa/org-9.4.5/org-loaddefs hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-loaddefs
/home/dick/.emacs.d/elpa/org-9.4.5/ob-scheme hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-scheme
/home/dick/.emacs.d/elpa/org-9.4.5/org-protocol hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-protocol
/home/dick/.emacs.d/elpa/org-9.4.5/ob-maxima hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-maxima
/home/dick/.emacs.d/elpa/org-9.4.5/ox-latex hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ox-latex
/home/dick/.emacs.d/elpa/org-9.4.5/ob-mscgen hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-mscgen
/home/dick/.emacs.d/elpa/org-9.4.5/ob-R hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-R
/home/dick/.emacs.d/elpa/org-9.4.5/ob-sed hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-sed
/home/dick/.emacs.d/elpa/org-9.4.5/org hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org
/home/dick/.emacs.d/elpa/org-9.4.5/org-plot hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-plot
/home/dick/.emacs.d/elpa/org-9.4.5/ox-beamer hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ox-beamer
/home/dick/.emacs.d/elpa/org-9.4.5/org-pcomplete hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-pcomplete
/home/dick/.emacs.d/elpa/org-9.4.5/ob-plantuml hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-plantuml
/home/dick/.emacs.d/elpa/org-9.4.5/ox-publish hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ox-publish
/home/dick/.emacs.d/elpa/org-9.4.5/ob-java hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-java
/home/dick/.emacs.d/elpa/org-9.4.5/ol-eww hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ol-eww
/home/dick/.emacs.d/elpa/org-9.4.5/org-macs hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-macs
/home/dick/.emacs.d/elpa/org-9.4.5/ol-eshell hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ol-eshell
/home/dick/.emacs.d/elpa/org-9.4.5/org-src hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-src
/home/dick/.emacs.d/elpa/org-9.4.5/ol-rmail hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ol-rmail
/home/dick/.emacs.d/elpa/org-9.4.5/org-datetree hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-datetree
/home/dick/.emacs.d/elpa/org-9.4.5/ob-J hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-J
/home/dick/.emacs.d/elpa/org-9.4.5/ob-shell hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-shell
/home/dick/.emacs.d/elpa/org-9.4.5/org-archive hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-archive
/home/dick/.emacs.d/elpa/org-9.4.5/org-habit hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-habit
/home/dick/.emacs.d/elpa/org-9.4.5/ob-picolisp hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-picolisp
/home/dick/.emacs.d/elpa/org-9.4.5/org-capture hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-capture
/home/dick/.emacs.d/elpa/org-9.4.5/ob-core hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-core
/home/dick/.emacs.d/elpa/org-9.4.5/ob-octave hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-octave
/home/dick/.emacs.d/elpa/org-9.4.5/org-mobile hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-mobile
/home/dick/.emacs.d/elpa/org-9.4.5/ol-bibtex hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ol-bibtex
/home/dick/.emacs.d/elpa/org-9.4.5/org-goto hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-goto
/home/dick/.emacs.d/elpa/org-9.4.5/ox-odt hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ox-odt
/home/dick/.emacs.d/elpa/org-9.4.5/ob-calc hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-calc
/home/dick/.emacs.d/elpa/org-9.4.5/ob-gnuplot hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-gnuplot
/home/dick/.emacs.d/elpa/org-9.4.5/org-macro hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-macro
/home/dick/.emacs.d/elpa/org-9.4.5/ob hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob
/home/dick/.emacs.d/elpa/org-9.4.5/ob-comint hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-comint
/home/dick/.emacs.d/elpa/org-9.4.5/ob-ditaa hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-ditaa
/home/dick/.emacs.d/elpa/org-9.4.5/org-duration hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-duration
/home/dick/.emacs.d/elpa/org-9.4.5/org-entities hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-entities
/home/dick/.emacs.d/elpa/org-9.4.5/org-agenda hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-agenda
/home/dick/.emacs.d/elpa/org-9.4.5/ox-ascii hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ox-ascii
/home/dick/.emacs.d/elpa/org-9.4.5/org-num hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-num
/home/dick/.emacs.d/elpa/org-9.4.5/ob-awk hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-awk
/home/dick/.emacs.d/elpa/org-9.4.5/ob-ruby hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-ruby
/home/dick/.emacs.d/elpa/org-9.4.5/ox-man hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ox-man
/home/dick/.emacs.d/elpa/org-9.4.5/ob-sqlite hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-sqlite
/home/dick/.emacs.d/elpa/org-9.4.5/ol-gnus hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ol-gnus
/home/dick/.emacs.d/elpa/org-9.4.5/org-attach hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-attach
/home/dick/.emacs.d/elpa/org-9.4.5/org-inlinetask hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-inlinetask
/home/dick/.emacs.d/elpa/org-9.4.5/ob-coq hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-coq
/home/dick/.emacs.d/elpa/org-9.4.5/org-feed hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-feed
/home/dick/.emacs.d/elpa/org-9.4.5/ob-hledger hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-hledger
/home/dick/.emacs.d/elpa/org-9.4.5/org-crypt hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-crypt
/home/dick/.emacs.d/elpa/org-9.4.5/ol-irc hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ol-irc
/home/dick/.emacs.d/elpa/org-9.4.5/ob-css hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-css
/home/dick/.emacs.d/elpa/org-9.4.5/ob-haskell hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-haskell
/home/dick/.emacs.d/elpa/org-9.4.5/org-footnote hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-footnote
/home/dick/.emacs.d/elpa/org-9.4.5/org-indent hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-indent
/home/dick/.emacs.d/elpa/org-9.4.5/ox-icalendar hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ox-icalendar
/home/dick/.emacs.d/elpa/org-9.4.5/ob-processing hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-processing
/home/dick/.emacs.d/elpa/org-9.4.5/ob-ledger hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-ledger
/home/dick/.emacs.d/elpa/org-9.4.5/org-id hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-id
/home/dick/.emacs.d/elpa/org-9.4.5/ox-org hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ox-org
/home/dick/.emacs.d/elpa/org-9.4.5/ob-lob hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-lob
/home/dick/.emacs.d/elpa/org-9.4.5/ob-latex hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-latex
/home/dick/.emacs.d/elpa/org-9.4.5/ol-w3m hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ol-w3m
/home/dick/.emacs.d/elpa/org-9.4.5/org-timer hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-timer
/home/dick/.emacs.d/elpa/org-9.4.5/ob-makefile hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-makefile
/home/dick/.emacs.d/elpa/org-9.4.5/ob-lilypond hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-lilypond
/home/dick/.emacs.d/elpa/org-9.4.5/ox-texinfo hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ox-texinfo
/home/dick/.emacs.d/elpa/org-9.4.5/ob-sass hides /home/dick/.local/share/emacs/28.0.50/lisp/org/ob-sass
/home/dick/.emacs.d/elpa/org-9.4.5/org-mouse hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-mouse
/home/dick/.emacs.d/elpa/org-9.4.5/org-version hides /home/dick/.local/share/emacs/28.0.50/lisp/org/org-version
/home/dick/.emacs.d/elpa/hierarchy-20171221.1151/hierarchy hides /home/dick/.local/share/emacs/28.0.50/lisp/emacs-lisp/hierarchy

Features:
(shadow sort flyspell ispell footnote mail-extr gnus-msg emacsbug git-rebase
rect eieio-compat package-x package-recipe make-mode ivy delsel colir
ivy-overlay ffap dumb-jump f debug backtrace goto-addr completion magit-extras
pulse vc-mtn vc-hg vc-bzr vc-src vc-sccs vc-cvs vc-rcs face-remap
magit-patch-changelog magit-patch magit-submodule magit-obsolete magit-popup
async-bytecomp async magit-blame magit-stash magit-reflog 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 imenu magit-diff smerge-mode diff git-commit
log-edit pcvs-util add-log magit-core magit-autorevert magit-margin
magit-transient magit-process with-editor server magit-mode transient
magit-git magit-section benchmark magit-utils crm ein-jupyter ein-dev
ein-notebook python tramp-sh ein-python-send ein-traceback ein-shared-output
ein-pytools ein-pager view ein-completer ein-notification ein-scratchsheet
ein-worksheet poly-ein display-line-numbers quail polymode poly-lock
polymode-base polymode-weave polymode-export polymode-compat polymode-methods
polymode-core polymode-classes eieio-custom eieio-base ein-kill-ring
ein-kernelinfo ein-file ein-notebooklist ein-contents-api eieio-opt speedbar
ezimage dframe shortdoc autoload lisp-mnt vc bug-reference google-c-style
tramp-archive tramp-gvfs tramp-cache zeroconf tramp tramp-loaddefs trampver
tramp-integration files-x tramp-compat ls-lisp cl-print help-fns radix-tree ag
vc-svn s misearch multi-isearch vc-git diff-mode vc-dispatcher paredit-ext
paredit mu4e mu4e-org mu4e-main mu4e-view mu4e-view-gnus gnus-art mm-uu
mml2015 mm-view mml-smime smime dig mu4e-view-common mu4e-headers mu4e-compose
mu4e-context mu4e-draft mu4e-actions rfc2368 smtpmail sendmail mu4e-mark
mu4e-proc mu4e-utils doc-view jka-compr image-mode exif mu4e-lists
mu4e-message flow-fill org-tempo tempo org org-macro org-footnote
org-pcomplete org-list org-faces org-entities org-version ob-R ob-emacs-lisp
ob-ein ein-cell ein-output-area ein-kernel ein-ipdb ein-query ein-events
ein-websocket websocket bindat ein-node ewoc ein-log ein-classes ein-core
request autorevert filenotify ein ein-utils deferred cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs ob ob-tangle
org-src ob-ref ob-lob ob-table ob-exp ob-comint ob-core ob-eval org-table ol
org-keys org-compat org-macs org-loaddefs find-func cal-menu calendar
cal-loaddefs gnus-sum shr kinsoku svg dom gnus-group mm-url gnus-undo
gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 netrc
nnoo parse-time iso8601 gnus-spec gnus-int gnus-range gnus-win mule-util
mu4e-vars message rmc puny rfc822 mml mml-sec epa epg epg-config mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
mu4e-meta subed subed-vtt subed-srt subed-common subed-mpv subed-debug
subed-config dired-x inf-ruby ruby-mode smie ht dash anaphora a
company haskell-interactive-mode haskell-presentation-mode haskell-process
haskell-session haskell-compile haskell-mode haskell-cabal haskell-utils
haskell-font-lock haskell-indentation haskell-string haskell-sort-imports
haskell-lexeme rx haskell-align-imports haskell-complete-module
haskell-ghc-support etags fileloop generator dabbrev haskell-customize hydra
lv use-package-ensure paren solarized-theme solarized-definitions projectile
skeleton ibuf-macs find-dired dired dired-loaddefs ibuf-ext ibuffer
ibuffer-loaddefs grep gnus nnheader gnus-util rmail rmail-loaddefs rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date flx-ido flx
google-translate-default-ui google-translate-core-ui facemenu color ido
google-translate-core google-translate-tk google-translate-backend
use-package-bind-key bind-key auto-complete advice popup cus-edit pp cus-load
wid-edit ess-r-mode ess-r-flymake flymake-proc flymake warnings thingatpt
ess-r-xref xref ess-trns ess-r-package shell pcomplete ess-r-completion
ess-roxy ess-r-syntax ess-rd noutline outline hideshow ess-s-lang ess-help
ess-mode ess-inf project format-spec ess-tracebug ess ess-utils ess-custom
compile text-property-search comint ansi-color emms-player-mplayer
emms-player-simple emms emms-compat cl-extra help-mode use-package-core
derived beacon easy-mmode pcase hl-line winner ring edmacro kmacro finder-inf
json-reformat-autoloads json-snatcher-autoloads sml-mode-autoloads
tornado-template-mode-autoloads info package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util
mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame
minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese composite charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule custom
widget hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 1151579 186123)
 (symbols 48 51323 67)
 (strings 32 203238 28952)
 (string-bytes 1 6569076)
 (vectors 16 93439)
 (vector-slots 8 2236684 175533)
 (floats 8 731 3660)
 (intervals 56 51935 8732)
 (buffers 992 56))

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* bug#49160: 28.0.50; [PATCH] Uninitialized inhibit_buffer_hooks
  2021-06-21 19:39 bug#49160: 28.0.50; [PATCH] Uninitialized inhibit_buffer_hooks dick
@ 2021-06-22 11:41 ` Eli Zaretskii
  2021-07-19 16:23   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2021-06-22 11:41 UTC (permalink / raw)
  To: dick; +Cc: 49160

> From: dick <dick.r.chiang@gmail.com>
> Date: Mon, 21 Jun 2021 15:39:26 -0400
> 
> It's random whether buffers created outside `get-buffer-create`, i.e.,
> indirect buffers, call kill-buffer hooks.

Please in the future try to be more explicit in describing the
problem.  "It is random" isn't explicit enough.

More to the point: since this attribute of a buffer cannot be changed
once the buffer is created, I think it might be okay to copy from the
base buffer, but we should also allow the caller to control that by
introducing an optional argument similar to that of get-buffer-create.
And if we do that, we could also consider making the default value be
nil, not necessarily a copy of that of the base buffer.

Thanks.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#49160: 28.0.50; [PATCH] Uninitialized inhibit_buffer_hooks
  2021-06-22 11:41 ` Eli Zaretskii
@ 2021-07-19 16:23   ` Lars Ingebrigtsen
  2021-07-19 16:47     ` Eli Zaretskii
  2023-01-11 20:13     ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 12+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-19 16:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 49160, dick

Eli Zaretskii <eliz@gnu.org> writes:

> More to the point: since this attribute of a buffer cannot be changed
> once the buffer is created, I think it might be okay to copy from the
> base buffer, but we should also allow the caller to control that by
> introducing an optional argument similar to that of get-buffer-create.
> And if we do that, we could also consider making the default value be
> nil, not necessarily a copy of that of the base buffer.

I've now applied Dick's patch, and then adjusted as you suggest.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#49160: 28.0.50; [PATCH] Uninitialized inhibit_buffer_hooks
  2021-07-19 16:23   ` Lars Ingebrigtsen
@ 2021-07-19 16:47     ` Eli Zaretskii
  2023-01-11 20:13     ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2021-07-19 16:47 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 49160, dick.r.chiang

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: dick <dick.r.chiang@gmail.com>,  49160@debbugs.gnu.org
> Date: Mon, 19 Jul 2021 18:23:36 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > More to the point: since this attribute of a buffer cannot be changed
> > once the buffer is created, I think it might be okay to copy from the
> > base buffer, but we should also allow the caller to control that by
> > introducing an optional argument similar to that of get-buffer-create.
> > And if we do that, we could also consider making the default value be
> > nil, not necessarily a copy of that of the base buffer.
> 
> I've now applied Dick's patch, and then adjusted as you suggest.

Thanks.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#49160: 28.0.50; [PATCH] Uninitialized inhibit_buffer_hooks
  2021-07-19 16:23   ` Lars Ingebrigtsen
  2021-07-19 16:47     ` Eli Zaretskii
@ 2023-01-11 20:13     ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-01-11 20:23       ` Eli Zaretskii
  1 sibling, 1 reply; 12+ messages in thread
From: Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-01-11 20:13 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Eli Zaretskii, 49160, dick

[-- Attachment #1: Type: text/plain, Size: 715 bytes --]

Lars Ingebrigtsen [2021-07-19 18:23 +0200] wrote:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>> More to the point: since this attribute of a buffer cannot be changed
>> once the buffer is created, I think it might be okay to copy from the
>> base buffer, but we should also allow the caller to control that by
>> introducing an optional argument similar to that of get-buffer-create.
>> And if we do that, we could also consider making the default value be
>> nil, not necessarily a copy of that of the base buffer.
>
> I've now applied Dick's patch, and then adjusted as you suggest.

Fmake_indirect_buffer continues to run buffer-list-update-hook
regardless of the new argument.  Any objections to changing that?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-buffer-list-update-hook-for-indirect-buffers.patch --]
[-- Type: text/x-diff, Size: 4922 bytes --]

From 0fdf0cb925088d0b5a019df2bbf803e550bebbd5 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
Date: Wed, 11 Jan 2023 16:34:07 +0000
Subject: [PATCH] Fix buffer-list-update-hook for indirect buffers

Fmake_indirect_buffer can be told whether to run buffer hooks since
bug#49160, but until now it ran buffer-list-update-hook irrespective
of this.

* src/buffer.c (Fmake_indirect_buffer): Don't run
buffer-list-update-hook when called with a non-nil
INHIBIT-BUFFER-HOOKS argument.
(run_buffer_list_update_hook): Don't special-case NULL argument, as
no such callers remain.

* test/src/buffer-tests.el
(buffer-tests-inhibit-buffer-hooks-indirect): Test whether indirect
buffer hooks are run regardless of whether base buffer hooks are
inhibited.  Check that all three buffer hooks, not just
kill-buffer-query-functions, are inhibited.
---
 src/buffer.c             | 10 ++++-----
 test/src/buffer-tests.el | 46 +++++++++++++++++++++++-----------------
 2 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/src/buffer.c b/src/buffer.c
index 100e42fc1f9..88ca69b0dd8 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -525,14 +525,14 @@ get_truename_buffer (register Lisp_Object filename)
   return Qnil;
 }
 
-/* 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.  */
+/* Run buffer-list-update-hook if Vrun_hooks is non-nil and BUF 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)))
+  eassert (buf);
+  if (! (NILP (Vrun_hooks) || buf->inhibit_buffer_hooks))
     call1 (Vrun_hooks, Qbuffer_list_update_hook);
 }
 
@@ -907,7 +907,7 @@ DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer,
       set_buffer_internal_1 (old_b);
     }
 
-  run_buffer_list_update_hook (NULL);
+  run_buffer_list_update_hook (b);
 
   return buf;
 }
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el
index e5de8f3464a..9d4bbf3e040 100644
--- a/test/src/buffer-tests.el
+++ b/test/src/buffer-tests.el
@@ -8315,29 +8315,35 @@ buffer-tests-inhibit-buffer-hooks
       (remove-hook 'buffer-list-update-hook bluh))))
 
 (ert-deftest buffer-tests-inhibit-buffer-hooks-indirect ()
-  "Indirect buffers do not call `get-buffer-create'."
-  (dolist (inhibit '(nil t))
-    (let ((base (get-buffer-create "foo" inhibit)))
+  "Test `make-indirect-buffer' argument INHIBIT-BUFFER-HOOKS."
+  (let* ( base run-bluh run-kbh run-kbqf
+          (bluh (lambda () (setq run-bluh t)))
+          (kbh  (lambda () (setq run-kbh  t)))
+          (kbqf (lambda () (setq run-kbqf t))))
+    (dolist (inhibit-base '(nil t))
       (unwind-protect
-          (dotimes (_i 11)
-            (let* (flag*
-                   (flag (lambda () (prog1 t (setq flag* t))))
-                   (indirect (make-indirect-buffer base "foo[indirect]" nil
-                                                   inhibit)))
-              (unwind-protect
-                  (progn
-                    (with-current-buffer indirect
-                      (add-hook 'kill-buffer-query-functions flag nil t))
-                    (kill-buffer indirect)
-                    (if inhibit
-                        (should-not flag*)
-                      (should flag*)))
-                (let (kill-buffer-query-functions)
+          (let (indirect)
+            (setq base (generate-new-buffer " base" inhibit-base))
+            (dolist (inhibit-indirect '(nil t))
+              (dotimes (_ 11)
+                (unwind-protect
+                    (let ((name (generate-new-buffer-name " indirect")))
+                      (setq run-bluh nil run-kbh nil run-kbqf nil)
+                      (add-hook 'buffer-list-update-hook bluh)
+                      (with-current-buffer
+                          (setq indirect (make-indirect-buffer
+                                          base name nil inhibit-indirect))
+                        (add-hook 'kill-buffer-hook kbh nil t)
+                        (add-hook 'kill-buffer-query-functions kbqf nil t)
+                        (kill-buffer))
+                      (should (xor inhibit-indirect run-bluh))
+                      (should (xor inhibit-indirect run-kbh))
+                      (should (xor inhibit-indirect run-kbqf)))
+                  (remove-hook 'buffer-list-update-hook bluh)
                   (when (buffer-live-p indirect)
                     (kill-buffer indirect))))))
-        (let (kill-buffer-query-functions)
-          (when (buffer-live-p base)
-            (kill-buffer base)))))))
+        (when (buffer-live-p base)
+          (kill-buffer base))))))
 
 (ert-deftest zero-length-overlays-and-not ()
   (with-temp-buffer
-- 
2.39.0


[-- Attachment #3: Type: text/plain, Size: 20 bytes --]


Thanks,

-- 
Basil

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* bug#49160: 28.0.50; [PATCH] Uninitialized inhibit_buffer_hooks
  2023-01-11 20:13     ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-01-11 20:23       ` Eli Zaretskii
  2023-01-11 21:16         ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2023-01-11 20:23 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: larsi, 49160, dick.r.chiang

> From: "Basil L. Contovounesios" <contovob@tcd.ie>
> Cc: Eli Zaretskii <eliz@gnu.org>,  49160@debbugs.gnu.org,  dick
>  <dick.r.chiang@gmail.com>
> Date: Wed, 11 Jan 2023 20:13:21 +0000
> 
> >> More to the point: since this attribute of a buffer cannot be changed
> >> once the buffer is created, I think it might be okay to copy from the
> >> base buffer, but we should also allow the caller to control that by
> >> introducing an optional argument similar to that of get-buffer-create.
> >> And if we do that, we could also consider making the default value be
> >> nil, not necessarily a copy of that of the base buffer.
> >
> > I've now applied Dick's patch, and then adjusted as you suggest.
> 
> Fmake_indirect_buffer continues to run buffer-list-update-hook
> regardless of the new argument.  Any objections to changing that?

buffer-list-update-hook is not a buffer-hook, strictly speaking.  So
I'm not sure we want this.  What is the real-life use case behind this
request?





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#49160: 28.0.50; [PATCH] Uninitialized inhibit_buffer_hooks
  2023-01-11 20:23       ` Eli Zaretskii
@ 2023-01-11 21:16         ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-01-12  7:39           ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-01-11 21:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: larsi, 49160, dick.r.chiang

Eli Zaretskii [2023-01-11 15:22 -0500] wrote:

>> From: "Basil L. Contovounesios" <contovob@tcd.ie>
>> Cc: Eli Zaretskii <eliz@gnu.org>,  49160@debbugs.gnu.org,  dick
>>  <dick.r.chiang@gmail.com>
>> Date: Wed, 11 Jan 2023 20:13:21 +0000
>> 
>> Fmake_indirect_buffer continues to run buffer-list-update-hook
>> regardless of the new argument.  Any objections to changing that?
>
> buffer-list-update-hook is not a buffer-hook, strictly speaking.

Right, but it's inhibited together with 'strict' buffer-hooks (and
documented as such) everywhere except for make-indirect-buffer: see
get-buffer-create, generate-new-buffer, struct buffer, "(elisp) Buffer
List", "(elisp) Creating Buffers", "(elisp) Buffer Internals", and
etc/NEWS.28.

In fact, "(elisp) Indirect Buffers" even says about
make-indirect-buffer:

     *Note Creating Buffers, for the meaning of INHIBIT-BUFFER-HOOKS.

Where "(elisp) Creating Buffers" elaborates:

     Both functions accept an optional argument INHIBIT-BUFFER-HOOKS.  If
  it is non-‘nil’, the buffer they create does not run the hooks
  ‘kill-buffer-hook’, ‘kill-buffer-query-functions’ (*note Killing
  Buffers), and ‘buffer-list-update-hook’ (*note Buffer List).  This
  avoids slowing down internal or temporary buffers that are never
  presented to users or passed on to other applications.

So while inhibit-buffer-hooks may be a slightly loose name, I think
make-indirect-buffer should nevertheless heed it for
buffer-list-update-hook as well, for the same reason this is done
everywhere else.

> So I'm not sure we want this.  What is the real-life use case behind
> this request?

The real-life use case is satisfying this bug report+patch from me,
fixing what seems like a simple oversight, and the ensuing peace of mind
that I will be grateful for, of course ;).

Thanks,

-- 
Basil





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#49160: 28.0.50; [PATCH] Uninitialized inhibit_buffer_hooks
  2023-01-11 21:16         ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-01-12  7:39           ` Eli Zaretskii
  2023-01-12 16:25             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2023-01-12  7:39 UTC (permalink / raw)
  To: Basil L. Contovounesios, Stefan Monnier; +Cc: larsi, 49160

> From: "Basil L. Contovounesios" <contovob@tcd.ie>
> Cc: larsi@gnus.org,  49160@debbugs.gnu.org,  dick.r.chiang@gmail.com
> Date: Wed, 11 Jan 2023 21:16:20 +0000
> 
> Eli Zaretskii [2023-01-11 15:22 -0500] wrote:
> 
> >> From: "Basil L. Contovounesios" <contovob@tcd.ie>
> >> Cc: Eli Zaretskii <eliz@gnu.org>,  49160@debbugs.gnu.org,  dick
> >>  <dick.r.chiang@gmail.com>
> >> Date: Wed, 11 Jan 2023 20:13:21 +0000
> >> 
> >> Fmake_indirect_buffer continues to run buffer-list-update-hook
> >> regardless of the new argument.  Any objections to changing that?
> >
> > buffer-list-update-hook is not a buffer-hook, strictly speaking.
> 
> Right, but it's inhibited together with 'strict' buffer-hooks (and
> documented as such) everywhere except for make-indirect-buffer: see
> get-buffer-create, generate-new-buffer, struct buffer, "(elisp) Buffer
> List", "(elisp) Creating Buffers", "(elisp) Buffer Internals", and
> etc/NEWS.28.
> 
> In fact, "(elisp) Indirect Buffers" even says about
> make-indirect-buffer:
> 
>      *Note Creating Buffers, for the meaning of INHIBIT-BUFFER-HOOKS.
> 
> Where "(elisp) Creating Buffers" elaborates:
> 
>      Both functions accept an optional argument INHIBIT-BUFFER-HOOKS.  If
>   it is non-‘nil’, the buffer they create does not run the hooks
>   ‘kill-buffer-hook’, ‘kill-buffer-query-functions’ (*note Killing
>   Buffers), and ‘buffer-list-update-hook’ (*note Buffer List).  This
>   avoids slowing down internal or temporary buffers that are never
>   presented to users or passed on to other applications.
> 
> So while inhibit-buffer-hooks may be a slightly loose name, I think
> make-indirect-buffer should nevertheless heed it for
> buffer-list-update-hook as well, for the same reason this is done
> everywhere else.
> 
> > So I'm not sure we want this.  What is the real-life use case behind
> > this request?
> 
> The real-life use case is satisfying this bug report+patch from me,
> fixing what seems like a simple oversight, and the ensuing peace of mind
> that I will be grateful for, of course ;).

Stefan, WDYT?





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#49160: 28.0.50; [PATCH] Uninitialized inhibit_buffer_hooks
  2023-01-12  7:39           ` Eli Zaretskii
@ 2023-01-12 16:25             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-01-14 13:20               ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-01-12 16:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Basil L. Contovounesios, larsi, 49160

>> > So I'm not sure we want this.  What is the real-life use case behind
>> > this request?
>> 
>> The real-life use case is satisfying this bug report+patch from me,
>> fixing what seems like a simple oversight, and the ensuing peace of mind
>> that I will be grateful for, of course ;).
>
> Stefan, WDYT?

It makes the code simpler and fixes a bug, I'm all for it.
I don't think it's urgent, so it's not super important whether it goes
into `emacs-29`, OTOH.


        Stefan






^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#49160: 28.0.50; [PATCH] Uninitialized inhibit_buffer_hooks
  2023-01-12 16:25             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-01-14 13:20               ` Eli Zaretskii
  2023-01-14 14:01                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-01-17 11:08                 ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 12+ messages in thread
From: Eli Zaretskii @ 2023-01-14 13:20 UTC (permalink / raw)
  To: Stefan Monnier, contovob; +Cc: larsi, 49160

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: "Basil L. Contovounesios" <contovob@tcd.ie>,  larsi@gnus.org,
>   49160@debbugs.gnu.org
> Date: Thu, 12 Jan 2023 11:25:40 -0500
> 
> >> > So I'm not sure we want this.  What is the real-life use case behind
> >> > this request?
> >> 
> >> The real-life use case is satisfying this bug report+patch from me,
> >> fixing what seems like a simple oversight, and the ensuing peace of mind
> >> that I will be grateful for, of course ;).
> >
> > Stefan, WDYT?
> 
> It makes the code simpler and fixes a bug, I'm all for it.
> I don't think it's urgent, so it's not super important whether it goes
> into `emacs-29`, OTOH.

Installing it means the buffer-list-update-hook will not run when we
generate an indirect buffer with this option.  Is that reasonable?

If you-two aren't averted by this effect, then let's install this on
the emacs-29 branch.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#49160: 28.0.50; [PATCH] Uninitialized inhibit_buffer_hooks
  2023-01-14 13:20               ` Eli Zaretskii
@ 2023-01-14 14:01                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-01-17 11:08                 ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 12+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-01-14 14:01 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: contovob, larsi, 49160

>> It makes the code simpler and fixes a bug, I'm all for it.
>> I don't think it's urgent, so it's not super important whether it goes
>> into `emacs-29`, OTOH.
>
> Installing it means the buffer-list-update-hook will not run when we
> generate an indirect buffer with this option.  Is that reasonable?

I think it's not just reasonable but is what I'd expect to happen.


        Stefan






^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#49160: 28.0.50; [PATCH] Uninitialized inhibit_buffer_hooks
  2023-01-14 13:20               ` Eli Zaretskii
  2023-01-14 14:01                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-01-17 11:08                 ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 12+ messages in thread
From: Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-01-17 11:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: larsi, 49160, Stefan Monnier

Eli Zaretskii [2023-01-14 15:20 +0200] wrote:

> Installing it means the buffer-list-update-hook will not run when we
> generate an indirect buffer with this option.  Is that reasonable?
>
> If you-two aren't averted by this effect, then let's install this on
> the emacs-29 branch.

Done, thanks.

Fix buffer-list-update-hook for indirect buffers
bd094207c76 2023-01-17 10:38:22 +0000
https://git.sv.gnu.org/cgit/emacs.git/commit/?id=bd094207c76

-- 
Basil





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-01-17 11:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21 19:39 bug#49160: 28.0.50; [PATCH] Uninitialized inhibit_buffer_hooks dick
2021-06-22 11:41 ` Eli Zaretskii
2021-07-19 16:23   ` Lars Ingebrigtsen
2021-07-19 16:47     ` Eli Zaretskii
2023-01-11 20:13     ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-11 20:23       ` Eli Zaretskii
2023-01-11 21:16         ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-12  7:39           ` Eli Zaretskii
2023-01-12 16:25             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-14 13:20               ` Eli Zaretskii
2023-01-14 14:01                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-17 11:08                 ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).