From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MHDIBbDbtGA4oAAAgWs5BA (envelope-from ) for ; Mon, 31 May 2021 14:50:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id eDvYALDbtGD8UAAAbx9fmQ (envelope-from ) for ; Mon, 31 May 2021 12:50:56 +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 22C1016E48 for ; Mon, 31 May 2021 14:50:55 +0200 (CEST) Received: from localhost ([::1]:57410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnhNc-0008Lc-RE for larch@yhetil.org; Mon, 31 May 2021 08:50:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnhMe-0008LI-Hn for emacs-orgmode@gnu.org; Mon, 31 May 2021 08:49:53 -0400 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]:34736) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lnhMa-00084d-Fq for emacs-orgmode@gnu.org; Mon, 31 May 2021 08:49:52 -0400 Received: by mail-lj1-x22a.google.com with SMTP id bn21so7552751ljb.1 for ; Mon, 31 May 2021 05:49:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:cc:date:message-id :mime-version; bh=dP16i0W40+JbzByI7awnvUriS5dqi0o6o0Q+D4OE+DY=; b=iXXGzTb+LQO/hvzvJrK091pSImpGdGVz0U1gLbB3m/4sKswKzCdtIeQUxzmHCfu1VX k9liF5rjYpMdQihroYjPzleUk8gporF+EjnuQGgOm5lX9lvlXgtBKb61/55oIgJdNNka qWpyjZchtkJSevrPF/Oomn0SDh9rqgAv5cm/blm04nhjDLhVsEIu+yiD8L77RBMXslH/ pf0i5kik6LcOfxV9i2mbSVdnSDzDkSOdGGLC/5fYj3yGbMjHl8mWNZhJJdY7mAq2ewd7 J3/neYRf3vd8wNJAAWK6aY9qcpb9BF8lUSXMrJMg25EqV38hRE2s1UyfLdv37Ys41Vxp NREQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:cc:date :message-id:mime-version; bh=dP16i0W40+JbzByI7awnvUriS5dqi0o6o0Q+D4OE+DY=; b=DkOpIfiUZLEIsjPBmOCU43wb384mOkjvdjYeyNL02VnAaWK5ySul295Os6/L2AQ+0A 5TDQStFNLK+EQV2TN+Nt8yDt8BbQ8twN8gVBVxcZ6oDxKarSoF+aUXJU02mr2Ewclh62 fC/QgrH6IEjOWKMBAzcX3SoHDrfGMoyRM60FW0hsFEfyz+7k74EfPIMfTYlhcOvOuNof qh+WJ+9egS8a8IFu9qmawxb7g3wfe/+D00aBs5vmH3KB0TxRPnmCYA/vCgGp8jtydSs/ SQwMU53Q7ltA00blXGb+UC/k6ux9QiJ8JBEySGkpnfZwylrs0czuQHoNe6m3jKast13L 8w5w== X-Gm-Message-State: AOAM531X1K7sNixuwa6oNdd/1EJV7CeSfq4Bl3l9zHmQTtBXTSSnYXCG eKXDBcNFac5OoCkk19jqHInlsrn3MO1pNw== X-Google-Smtp-Source: ABdhPJzLcnLg2zTXzodwzZW0+8mg6hpcpUivn0ynQ0LahXgx2iUMUEzy7KqESOtQa8UtVYnZ8mFWOA== X-Received: by 2002:a2e:a0c6:: with SMTP id f6mr5956528ljm.357.1622465385910; Mon, 31 May 2021 05:49:45 -0700 (PDT) Received: from localhost ([158.255.2.9]) by smtp.gmail.com with ESMTPSA id x14sm293740lff.19.2021.05.31.05.49.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 05:49:44 -0700 (PDT) From: Ihor Radchenko To: Shiyao MA Subject: Re: How to hide *Org Links* buffer when insert new links? In-Reply-To: References: X-Woof-Patch: yes Date: Mon, 31 May 2021 20:54:27 +0800 Message-ID: <87h7ij12t8.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::22a; envelope-from=yantar92@gmail.com; helo=mail-lj1-x22a.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Cc: emacs-org list 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=1622465455; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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:dkim-signature; bh=ld5wHoeUrkzkAvFU1PoKU5EQLmE7L6h/3HT1SxE+GNA=; b=Mn0BhlvLfm+xyFILSef9mINI1U7aFNHnqPaH1mdbjpoqQmShgCKBr9l0L4Mbzw2dtLJTqX gGa8d7KeCMOrI2Y85KIKePFGi7uvfeWVfEnnOatMEZSEd8NI8VRQaPDeJC2Ef3ZioasG42 1096njBYqW3tDPxCXz3YTl9aoIGVpYGJemJmgOhHU6iip+ruSq6W6D+DGWzqx1pBVJh7Xb bgbwqhZRee7HYYOVY6PUhzcI+tmZXj+PLDrKCgHOkD6YmQBv+xicdTCoB2wvKhAx5PgCZ6 GUE9WoJffPd5J8tmY3HPmmPfFjYuvYnxUn2ah9FVUmauhjLCvb3CAl8jZYi5Pg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622465455; a=rsa-sha256; cv=none; b=Yrs1KnxZvFaUHe467bn7M4zDlPxYhO8eU9rFVmLIlPupvTNvzZCvvdQV9NjuvPRZX8xi4t V77+85dj0pJYpvBZmYxkjokjl3dGSYnQlEV6fPDnn0VQ0Kis14vVoM+MNlzQf05okILlW5 Tk7xJtaKLKCGzrCKKXHSTcCUrmqqxnETJ4stO/EXV2wMBydWK782GOCXUoTj22enI2cZbI gBZveLyA3ro8e7RXnKv2quaseF6Zi3ZDnFaJZ0wfWPjMXPFzQqA3Y5CJD6LZt8jqzMyO1k heSrJaD5xo5bdWLzkn6CbN2zkjY5iaG5tm6jgIZTGb0d75kVLNuWSmHIx21pHA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=iXXGzTb+; dmarc=fail reason="SPF not aligned (relaxed)" 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: 1.77 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=iXXGzTb+; dmarc=fail reason="SPF not aligned (relaxed)" 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: 22C1016E48 X-Spam-Score: 1.77 X-Migadu-Scanner: scn0.migadu.com X-TUID: h1OdVf80I3ev --=-=-= Content-Type: text/plain Shiyao MA writes: > Hi, > > When insert org links with org-insert-link, an Org Links buffer is created. > > How can I hide it? You cannot prevent it from being created. It is hard-coded. However, you should be able to prevent Emacs from showing the buffer window by modifying your display-buffer-alist: (add-to-list 'display-buffer-alist '(("Org Links" display-buffer-no-window (allow-no-window . t)))) ... except you cannot. Apparently, Org mode is being too aggressive and ignores display-buffer-alist. I do not think that it is supposed to happen. The patch fixing current aggressive behaviour and allowing the above code to work is attached. Dear All, I do not think that unconditionally setting display-buffer-alist to nil in org-no-popups macro is the right thing to do. I updated the macro using pop-up-windows setting to nil instead of completely trashing user-defined display-buffer-alist. The latter is nil by default and if not, the user should know what he/she is doing. Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Do-not-ignore-user-defined-display-buffer-alist-in-o.patch >From c598f0208738f16b6d00c05a7338c226d15f5d12 Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Mon, 31 May 2021 20:47:45 +0800 Subject: [PATCH] Do not ignore user-defined display-buffer-alist in org-insert-link * lisp/ol.el (org-insert-link): Handle case when *Org Links* window is not created. * lisp/org-macs.el (org-no-popups): Do not override `display-buffer-alist'. Use `pop-up-windows' instead. --- lisp/ol.el | 13 +++++++------ lisp/org-macs.el | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lisp/ol.el b/lisp/ol.el index a2cf872b8..ae0177695 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -1856,12 +1856,13 @@ (defun org-insert-link (&optional complete-file link-location description) (reverse org-stored-links) "\n"))) (goto-char (point-min))) - (let ((cw (selected-window))) - (select-window (get-buffer-window "*Org Links*" 'visible)) - (with-current-buffer "*Org Links*" (setq truncate-lines t)) - (unless (pos-visible-in-window-p (point-max)) - (org-fit-window-to-buffer)) - (and (window-live-p cw) (select-window cw))) + (when (get-buffer-window "*Org Links*" 'visible) + (let ((cw (selected-window))) + (select-window (get-buffer-window "*Org Links*" 'visible)) + (with-current-buffer "*Org Links*" (setq truncate-lines t)) + (unless (pos-visible-in-window-p (point-max)) + (org-fit-window-to-buffer)) + (and (window-live-p cw) (select-window cw)))) (setq all-prefixes (append (mapcar #'car abbrevs) (mapcar #'car org-link-abbrev-alist) (org-link-types))) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index d56fc3bce..133960fea 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -170,7 +170,7 @@ (defmacro org-preserve-local-variables (&rest body) (defmacro org-no-popups (&rest body) "Suppress popup windows and evaluate BODY." - `(let (pop-up-frames display-buffer-alist) + `(let (pop-up-frames pop-up-windows) ,@body)) -- 2.26.3 --=-=-=--