瀏覽代碼

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.
Ihor Radchenko 3 年之前
父節點
當前提交
399481bad1
共有 2 個文件被更改,包括 8 次插入7 次删除
  1. 7 6
      lisp/ol.el
  2. 1 1
      lisp/org-macs.el

+ 7 - 6
lisp/ol.el

@@ -1819,12 +1819,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)))

+ 1 - 1
lisp/org-macs.el

@@ -208,7 +208,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))