From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: master b2150e0: Preserve point under 'dired-auto-revert-buffer' (second case) Date: Tue, 18 Jul 2017 16:03:49 +0200 Message-ID: <87a841c056.fsf@rosalinde> References: <20170717091700.5734.53572@vcs0.savannah.gnu.org> <20170717091702.497B522E0A@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1500386864 30357 195.159.176.226 (18 Jul 2017 14:07:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 18 Jul 2017 14:07:44 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: martin rudalics , emacs-devel@gnu.org To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 18 16:07:38 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXTA2-0007ak-5i for ged-emacs-devel@m.gmane.org; Tue, 18 Jul 2017 16:07:38 +0200 Original-Received: from localhost ([::1]:56721 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTA5-0001kK-Da for ged-emacs-devel@m.gmane.org; Tue, 18 Jul 2017 10:07:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXT6W-0007oi-Be for emacs-devel@gnu.org; Tue, 18 Jul 2017 10:04:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXT6U-0004HA-SF for emacs-devel@gnu.org; Tue, 18 Jul 2017 10:04:00 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:59742) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dXT6Q-0004AC-1v; Tue, 18 Jul 2017 10:03:54 -0400 Original-Received: from rosalinde ([83.135.16.220]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lh7M3-1e12ll2j8Z-00oW0H; Tue, 18 Jul 2017 16:03:50 +0200 In-Reply-To: (Glenn Morris's message of "Mon, 17 Jul 2017 19:58:53 -0400") X-Provags-ID: V03:K0:rpwo77SyXGWn7lHmLW/SSL3EhrihDYZRzcRZdo0ajphwe1H4fez M6ezjtNLLYNGHfbgqJ0JePY6lfUIc0PYTij+LzKMydB18CR0q4ft+9+Zyjy960sUs2J4+Ot ZrxGJpIwZLUZpPaf9/mUu0v63AR0XoG9KHHNEX1djIXOROAANn4LeXZKsKnRZxFXkCmHUVt PudEwzUO4dVVzjMdCfekw== X-UI-Out-Filterresults: notjunk:1;V01:K0:aKI6Pp31D8I=:8DOTp5bXUq9tJFYi0vzIuF f/b8jSVM9zTeynSlQMbdvgZ/hs0vYx4z59FsklAgbTLEkRYawqnO2JVv4Waust1gLlwPJpJCF gcUQv24MkN8VC8GS5zTERZ5ZX5rZScIMBEwmtEaezYn8EISEcesAX3PZWl2BHpA8PiNTFkh0S 3gnsb9XWtIjavhRi0n+K2CbSqWTc71jufkSw1NN9axmnfd9m3fJhCOPi4ofoIY3GGwhN/f7JA Yhh2UMmuIBn0fFAniaCyWXCAkWlg5VGu1Y+vMRLXhZA7F5joH5ej3chTbLMXWYSrE2TxDB92Z 3c/KJoykStmlUbZCYAyLKMFIbu7sV9SDQiDDIDDllbvWMgXMYKTg16z9J75HE7cCqnfdreQ40 fsh5+p85CnZ4MRsUbowFNsd5mvx92KtqEYlfz+UR+pjBjYBkUaScwtX3OvHyzH+1NkLyHKNrJ ypVRnmPOuULcO72mUGQ0jCVUWYogqrleHBNTGzx43m+zjNuRnU2FFwsmwyby6IQi9HtNhcQl/ 34l+Pl/mj21xJXoDL+gx98IwcR5h1fpzTdZP5vYL+yHU5c4fC9obiJ0Z3HASuHoRH2ygfyxA3 hadkVlMcHi9urjTDYiclPTcaB0xjqdQPu8KfXGyMaDJZHO342EwcADB7TH4iC4X4e1qEJ97mr EoTLgZFA209TBWXe2cLle9eXUiONv/dP1pAuqkFFyTx+jwwKLVE5HBjfU4bHhfVmR+RovUAXO xZmQzbWHcKU9iR1EgSVraQM/7fVh7a0GR3W7ei/mO/5xQ6GJ1zHdwtYicRNZKqqO/Q44ivHm X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:216832 Archived-At: On Mon, 17 Jul 2017 19:58:53 -0400 Glenn Morris wrote: > Stephen Berman wrote: > >> branch: master >> commit b2150e0b02fa4a7ad4c1461e0b4ff8fd632c0fb8 > > This change causes todo-test-todo-quit02 (which uses dired) to fail. > > Ref eg http://hydra.nixos.org/build/56529421 Sorry about that; I swear to Saint IGNUcius I'll always run `make check' before pushing any future test changes. I think I see what the problem is, but I don't know what to do about it. The test fails now because, after the change to dired (replacing switch-to-buffer by pop-to-buffer-same-window), calling quit-window in the directory results in buffer-list returning a different order of the buffers than the order returned before the change, and the test assumes the previous order (as does todo-quit, which is what is being tested here). If I debugged this correctly, it seems that the crucial difference is that, on calling quit-window after pop-to-buffer-same-window, the window displaying the directory has a non-nil quit-restore window parameter (in fact, its value contains the buffer visiting the todo-file), while on calling quit-window after switch-to-buffer, the quit-restore window parameter is nil. Is this correct (cc'ing Martin)? Here is a recipe that shows the same effect without using todo-mode or dired: Start Emacs with -Q and evaluate the following sexp: (progn (require 'cl-lib) (defun bl (l) (cl-remove-if (lambda (x) (string-match " \\*" (buffer-name x))) l)) (message "First: %S" (bl (buffer-list))) (set-window-buffer (selected-window) (set-buffer (find-file-noselect "bla"))) (message "After s-w-b 1: %S" (bl (buffer-list))) (pop-to-buffer-same-window default-directory) (message "After pop: %S" (bl (buffer-list))) ;; (switch-to-buffer default-directory) ;; (message "After switch: %S" (bl (buffer-list))) (set-window-buffer (selected-window) (set-buffer (find-file-noselect "bla"))) (message "After s-w-b 2: %S" (bl (buffer-list))) (bury-buffer) (message "After bury-buffer: %S" (bl (buffer-list))) (quit-window) (message "After quit-window: %S" (bl (buffer-list)))) This is what *Messages* shows: First: (# #) (New file) After s-w-b 1: (# # #) After pop: (# # # #) After s-w-b 2: (# # # #) After bury-buffer: (# # # #) After quit-window: (# # # #) Now start Emacs with -Q again, yank in the above sexp, uncomment the two commented out lines and comment out the two lines preceding these (so switch-to-buffer and the appropriate message are used), then evaluate the sexp; now *Messages* shows this: First: (# #) (New file) After s-w-b 1: (# # #) After switch: (# # # #) After s-w-b 2: (# # # #) After bury-buffer: (# # # #) After quit-window: (# # # #) The only difference in the buffer lists of the two outputs is after quit-window (the last line in each output). Is this difference due to the different quit-restore window parameter values? If so, I'm not sure what the best course of action is. This is what's supposed to happen (what the test tests for): (1) the todo-mode buffer is displayed in a window; (2) calling dired makes the window display a directory; (3) calling todo-show makes the window display the todo-mode buffer again; (4) calling todo-quit buries the todo-mode buffer, so the window displays the directory again; (5) now immediately calling quit-window in the directory should not make the window display the todo-mode buffer again, if there is an alternative. This worked when dired used switch-to-buffer, but no longer works now that dired uses pop-to-buffer-same-window. I'd be grateful for any advice. Steve Berman