GNU bug report logs -
#48337
Fwd: 28.0.50; Emacs crashing randomly (possibly minibuffer activity related)
Previous Next
Full log
Message #59 received at 48337 <at> debbugs.gnu.org (full text, mbox):
Hello, Martin.
On Thu, May 13, 2021 at 11:54:37 +0000, Alan Mackenzie wrote:
> How about the following functions, in which minibuf.c now bypasses
> record-window-buffer, instead calling push-window-buffer-onto-prev
> direct? I'm still not convinced that the call to
> buffer-list-update-hooks belongs in record-window-buffer, but that
> doesn't seem too important any more. On preliminary testing, these
> appear to work:
OK, I've wrongly moved the with-current-buffer form in the first
function. I'm aware of this and will correct it. Also, I've forgotten
to amend the doc string of record-window-buffer. I'll correct that,
too.
> (defun push-window-buffer-onto-prev (&optional window)
> "Push entry for WINDOW's buffer onto WINDOW's prev-buffers list.
> WINDOW must be a live window and defaults to the selected one.
> Any duplicate entries for the buffer in the list are removed."
> (let* ((window (window-normalize-window window t))
> (buffer (window-buffer window))
> (w-list (window-prev-buffers window))
> (entry (assq buffer w-list)))
> (when entry
> (setq w-list (assq-delete-all buffer w-list)))
> (let ((start (window-start window))
> (point (window-point window)))
> (setq entry
> (cons buffer
> (if entry
> ;; We have an entry, update marker position.
> (list (set-marker (nth 1 entry) start)
> (set-marker (nth 2 entry) point))
> (list (copy-marker start)
> (copy-marker
> ;; Preserve window-point-insertion-type
> ;; (Bug#12855)
> point (with-current-buffer buffer
> window-point-insertion-type))))))
> (set-window-prev-buffers window (cons entry w-list)))))
--
Alan Mackenzie (Nuremberg, Germany).
This bug report was last modified 4 years and 63 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.