diff --git a/lisp/ol.el b/lisp/ol.el index 75d002200..e4a5a278d 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -1815,12 +1815,13 @@ Use TAB to complete link prefixes, then RET for type-specific completion support (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 18ae642c7..bf1340b0a 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -209,7 +209,7 @@ because otherwise all these markers will point to nowhere." (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))