From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WKrwFoGuaWFBCwEAgWs5BA (envelope-from ) for ; Fri, 15 Oct 2021 18:38:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id WM6FEoGuaWGmUAAAbx9fmQ (envelope-from ) for ; Fri, 15 Oct 2021 16:38:25 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DDBA24E8F for ; Fri, 15 Oct 2021 18:38:24 +0200 (CEST) Received: from localhost ([::1]:35246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbQDv-00084g-0X for larch@yhetil.org; Fri, 15 Oct 2021 12:38:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbQDK-000831-P1 for emacs-orgmode@gnu.org; Fri, 15 Oct 2021 12:37:46 -0400 Received: from ciao.gmane.io ([116.202.254.214]:35944) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbQDH-0000xh-1G for emacs-orgmode@gnu.org; Fri, 15 Oct 2021 12:37:46 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mbQDE-0003Bs-Of for emacs-orgmode@gnu.org; Fri, 15 Oct 2021 18:37:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: [PATCH] [BUG] Org 9.5: org-goto UI seems broken Date: Fri, 15 Oct 2021 23:37:31 +0700 Message-ID: References: <87mtnovv7f.fsf@alphapapa.net> <87h7dvy70t.fsf@localhost> <87ee8zxwic.fsf@localhost> <878rz3ddet.fsf@gmail.com> <87czoaug5x.fsf@gmail.com> <87o87tso54.fsf@localhost> <87pms9mf7v.fsf@gmail.com> <878ryx14sd.fsf@ucl.ac.uk> <87fst46ifa.fsf@gmail.com> <87h7djdi7k.fsf@localhost> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------C63B8BDF244F1C5524C9A4AE" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1634315904; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=U+f1/hLo/O69sg9LKd64HQKR1cM1SFMRVVMqUj6O4iU=; b=VfuL3uu2pafNUYMkeEQTi95FPZ/08mU5fbB6Ll0V9VpiRCYc5udwV/TlIhRHMaQCz4oJow NqCdf9qefCqq6ZVOqOECAkRRgCIW/1e/6RV2Cal/jSxmqYZOViTZXsiyla4+fYQcOBH9df ulaAtgWgG9hWZ+KcEuFR0EBHb55qzKd4kNza5Iff8pfTCJLQzMb8vzcocqeHXNc8HIT/t5 3DomuNqLRQL1ldxuExcQeJpNvGLx+ERfcttork5eYgpb2sW9gJGScggyKGZgJqGwepe9Vh +VgLP+Nbph8jIVg6SoL+zbFdzdatPclmruDTCi8i4ghv4669+mFIDJvc7p/A4w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634315904; a=rsa-sha256; cv=none; b=JEK2cCaVsGHsRgMeP7mlQghTVevIw67dpX5r7rIYSf+TYg0XAFBJ5j7SO3vD9DbXG9/tIB XIXxoFDhb1B9vCpk2WPxXp+WLtmd7zm9ZA+4aXCyBMomdYIhuYbh47uCGSluPopzZb+2RV WaaDNtUc2hcNxSN0Ebdk0TwZdA7cOPMeueCZfZukQBQf/26dRBXvkiiIxsU0SubV1Vj43n yG6wUb30nTaYxZIFxuehOuAoIdkSE0ujPsYsrDw/RDq/uUvp4zkerDg4szlF+RODLT6A5n g3CStgjlA4Z3ZegXBLt0d+EA/EHCjZ1yZ+6COustr401uRkm2L7vqhgolC2T7A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -0.71 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: DDBA24E8F X-Spam-Score: -0.71 X-Migadu-Scanner: scn1.migadu.com X-TUID: bRp7/YzbBV4L This is a multi-part message in MIME format. --------------C63B8BDF244F1C5524C9A4AE Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 14/10/2021 22:44, Max Nikulin wrote: > > I think, something should be done with `org-no-popups'. Assume a user > who has (I have no idea concerning the goal though) > >   (setq pop-up-frames t) >   (setq display-buffer-base-action >         '((display-buffer-reuse-window display-buffer-pop-up-frame) >           (reusable-frames . 0))) > > With "emacs -Q" and above settings completion e.g. for "C-h f" does not > cause creation of a new frame. Org help windows appear in new frames > though. That is why `org-no-popups' should have more code. I was wrong, (setq pop-up-frames t) leads to creation of new frame for *Completion* buffer at least in Emacs-26.3. It seems, each case of `org-no-popups' may require specific code. I have tried to take some code related to completion. It overrides display-buffer-base-action, but something more is required for pop-up-frames. That code uses `with-current-buffer-window' while org-goto uses `with-output-to-temp-buffer'. I am unsure what variant is more suitable for org-goto. I am attaching my draft with minimal changes. I do not like to rely on internal functions but I have not found high level replacement to achieve the same result. Maybe emacs code has a better variant somewhere. --------------C63B8BDF244F1C5524C9A4AE Content-Type: text/x-patch; charset=UTF-8; name="org-goto-hack-1.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="org-goto-hack-1.patch" diff --git a/lisp/org-goto.el b/lisp/org-goto.el index 0a3470f54..26fc2b735 100644 --- a/lisp/org-goto.el +++ b/lisp/org-goto.el @@ -203,7 +203,6 @@ When nil, you can use these keybindings to navigate the buffer: "Let the user select a location in current buffer. This function uses a recursive edit. It returns the selected position or nil." - (org-no-popups (let ((isearch-mode-map org-goto-local-auto-isearch-map) (isearch-hide-immediately nil) (isearch-search-fun-function @@ -217,7 +216,35 @@ position or nil." (condition-case nil (make-indirect-buffer (current-buffer) "*org-goto*" t) (error (make-indirect-buffer (current-buffer) "*org-goto*" t)))) - (let (temp-buffer-show-function temp-buffer-show-hook) + (let (temp-buffer-show-hook + (temp-buffer-show-function + (lambda (buffer) + "Prevent new frame in the case of + + (setq display-buffer-base-action + '((display-buffer-reuse-window display-buffer-pop-up-frame) + (reusable-frames . 0))) + +It is not immune to + + (setq pop-up-frames t) + +just as \"*Completion*\" buffer. +The idea is borrowed from `minibuffer-completion-help'." + (display-buffer + buffer + `((display-buffer--maybe-same-window + display-buffer-reuse-window + ,(if (functionp 'display-buffer--maybe-pop-up-frame) + ;; Unavailable in emacs-26 + 'display-buffer--maybe-pop-up-frame + 'display-buffer--maybe-pop-up-frame-or-window) + display-buffer-below-selected) + ,(if temp-buffer-resize-mode + '(window-height . resize-temp-buffer-window) + '(window-height . fit-window-to-buffer)) + ,(when temp-buffer-resize-mode + '(preserve-size . (nil . t)))))))) (with-output-to-temp-buffer "*Org Help*" (princ (format help (if org-goto-auto-isearch " Just type for auto-isearch." @@ -236,7 +263,7 @@ position or nil." (use-local-map org-goto-map) (recursive-edit))) (kill-buffer "*org-goto*") - (cons org-goto-selected-point org-goto-exit-command)))) + (cons org-goto-selected-point org-goto-exit-command))) ;;;###autoload (defun org-goto (&optional alternative-interface) --------------C63B8BDF244F1C5524C9A4AE--