Fix when user customization makes Org dialogues pop up in new frames
* lisp/ol.el (org-insert-link): * lisp/org-agenda.el (org-agenda-get-restriction-and-command): * lisp/org-attach.el (org-attach): * lisp/org-clock.el (org-clock-select-task): * lisp/org-goto.el (org-goto-location): * lisp/org-macs.el (org-mks): * lisp/org-table.el (org-table-fedit-finish): * lisp/org.el (org-offer-links-in-entry): * lisp/ox.el (org-export-dispatch): Arrange the dialogue window to be killed when it is displayed in a new frame. `save-window-configuration' is not enough in such scenarios. Use `quit-window' instead. * lisp/org-table.el (org-table-edit-formulas): Prohibit popping up table editor in a new frame. This is because the major mode for formula editing makes assumptions about where the editor window is located and does not work reliably in a separate frame. Reported-by: Björn Bidar <bjorn.bidar@thaodan.de> Link: https://orgmode.org/list/87jzlcoxuq.fsf@
This commit is contained in:
parent
129a18abf3
commit
78e9dd0c42
|
@ -2040,8 +2040,11 @@ non-interactively, don't allow to edit the default description."
|
||||||
(setq link (substring link 0 -1))))
|
(setq link (substring link 0 -1))))
|
||||||
(setq link (with-current-buffer origbuf
|
(setq link (with-current-buffer origbuf
|
||||||
(org-link--try-special-completion link)))))
|
(org-link--try-special-completion link)))))
|
||||||
|
(when-let ((window (get-buffer-window "*Org Links*" t)))
|
||||||
|
(quit-window 'kill window))
|
||||||
(set-window-configuration wcf)
|
(set-window-configuration wcf)
|
||||||
(kill-buffer "*Org Links*"))
|
(when (get-buffer "*Org Links*")
|
||||||
|
(kill-buffer "*Org Links*")))
|
||||||
(setq entry (assoc link org-stored-links))
|
(setq entry (assoc link org-stored-links))
|
||||||
(or entry (push link org-link--insert-history))
|
(or entry (push link org-link--insert-history))
|
||||||
(setq desc (or desc (nth 1 entry)))))
|
(setq desc (or desc (nth 1 entry)))))
|
||||||
|
|
|
@ -3312,7 +3312,7 @@ s Search for keywords S Like s, but only TODO entries
|
||||||
((equal c ?q) (user-error "Abort"))
|
((equal c ?q) (user-error "Abort"))
|
||||||
(t (user-error "Invalid key %c" c))))
|
(t (user-error "Invalid key %c" c))))
|
||||||
;; Close *Agenda Commands* window.
|
;; Close *Agenda Commands* window.
|
||||||
(quit-window))))))
|
(quit-window 'kill))))))
|
||||||
|
|
||||||
(defun org-agenda-fit-window-to-buffer ()
|
(defun org-agenda-fit-window-to-buffer ()
|
||||||
"Fit the window to the buffer size."
|
"Fit the window to the buffer size."
|
||||||
|
|
|
@ -350,13 +350,16 @@ Shows a list of commands and prompts for another key to execute a command."
|
||||||
"\n"))))
|
"\n"))))
|
||||||
(goto-char (point-min)))
|
(goto-char (point-min)))
|
||||||
(org-fit-window-to-buffer (get-buffer-window "*Org Attach*"))
|
(org-fit-window-to-buffer (get-buffer-window "*Org Attach*"))
|
||||||
(let ((msg (format "Select command: [%s]"
|
(unwind-protect
|
||||||
(concat (mapcar #'caar org-attach-commands)))))
|
(let ((msg (format "Select command: [%s]"
|
||||||
(message msg)
|
(concat (mapcar #'caar org-attach-commands)))))
|
||||||
(while (and (setq c (read-char-exclusive))
|
(message msg)
|
||||||
(memq c '(?\C-n ?\C-p ?\C-v ?\M-v)))
|
(while (and (setq c (read-char-exclusive))
|
||||||
(org-scroll c t)))
|
(memq c '(?\C-n ?\C-p ?\C-v ?\M-v)))
|
||||||
(and (get-buffer "*Org Attach*") (kill-buffer "*Org Attach*"))))
|
(org-scroll c t)))
|
||||||
|
(when-let ((window (get-buffer-window "*Org Attach*" t)))
|
||||||
|
(quit-window 'kill window))
|
||||||
|
(and (get-buffer "*Org Attach*") (kill-buffer "*Org Attach*")))))
|
||||||
(let ((command (cl-some (lambda (entry)
|
(let ((command (cl-some (lambda (entry)
|
||||||
(and (memq c (nth 0 entry)) (nth 1 entry)))
|
(and (memq c (nth 0 entry)) (nth 1 entry)))
|
||||||
org-attach-commands)))
|
org-attach-commands)))
|
||||||
|
|
|
@ -695,8 +695,11 @@ there is no recent clock to choose from."
|
||||||
;; `fit-window-to-buffer'
|
;; `fit-window-to-buffer'
|
||||||
(fit-window-to-buffer nil nil (if (< chl 10) chl (+ 5 chl)))
|
(fit-window-to-buffer nil nil (if (< chl 10) chl (+ 5 chl)))
|
||||||
(message (or prompt "Select task for clocking:"))
|
(message (or prompt "Select task for clocking:"))
|
||||||
(setq cursor-type nil rpl (read-char-exclusive))
|
(unwind-protect (setq cursor-type nil rpl (read-char-exclusive))
|
||||||
(kill-buffer)
|
(when-let ((window (get-buffer-window "*Clock Task Select*" t)))
|
||||||
|
(quit-window 'kill window))
|
||||||
|
(when (get-buffer "*Clock Task Select*")
|
||||||
|
(kill-buffer "*Clock Task Select*")))
|
||||||
(cond
|
(cond
|
||||||
((eq rpl ?q) nil)
|
((eq rpl ?q) nil)
|
||||||
((eq rpl ?x) nil)
|
((eq rpl ?x) nil)
|
||||||
|
|
|
@ -238,8 +238,10 @@ position or nil."
|
||||||
(let (org-special-ctrl-a/e) (org-beginning-of-line))
|
(let (org-special-ctrl-a/e) (org-beginning-of-line))
|
||||||
(message "Select location and press RET")
|
(message "Select location and press RET")
|
||||||
(use-local-map org-goto-map)
|
(use-local-map org-goto-map)
|
||||||
(recursive-edit)))
|
(unwind-protect (recursive-edit)
|
||||||
(kill-buffer "*org-goto*")
|
(when-let ((window (get-buffer-window "*Org Help*" t)))
|
||||||
|
(quit-window 'kill window)))))
|
||||||
|
(when (get-buffer "*org-goto*") (kill-buffer "*org-goto*"))
|
||||||
(cons org-goto-selected-point org-goto-exit-command)))
|
(cons org-goto-selected-point org-goto-exit-command)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
|
@ -572,8 +572,10 @@ is selected, only the bare key is returned."
|
||||||
;; selection prefix.
|
;; selection prefix.
|
||||||
((assoc current specials) (throw 'exit current))
|
((assoc current specials) (throw 'exit current))
|
||||||
(t (error "No entry available")))))))
|
(t (error "No entry available")))))))
|
||||||
(quit-window)
|
(when buffer
|
||||||
(when buffer (kill-buffer buffer))))))
|
(when-let ((window (get-buffer-window buffer t)))
|
||||||
|
(quit-window 'kill window))
|
||||||
|
(kill-buffer buffer))))))
|
||||||
|
|
||||||
|
|
||||||
;;; List manipulation
|
;;; List manipulation
|
||||||
|
|
|
@ -3369,7 +3369,10 @@ Parameters get priority."
|
||||||
(titles '((column . "# Column Formulas\n")
|
(titles '((column . "# Column Formulas\n")
|
||||||
(field . "# Field and Range Formulas\n")
|
(field . "# Field and Range Formulas\n")
|
||||||
(named . "# Named Field Formulas\n"))))
|
(named . "# Named Field Formulas\n"))))
|
||||||
(switch-to-buffer-other-window "*Edit Formulas*")
|
(let ((pop-up-frames nil))
|
||||||
|
;; We explicitly prohibit creating edit buffer in a new frame
|
||||||
|
;; - such configuration is not supported.
|
||||||
|
(switch-to-buffer-other-window "*Edit Formulas*"))
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
;; Keep global-font-lock-mode from turning on font-lock-mode
|
;; Keep global-font-lock-mode from turning on font-lock-mode
|
||||||
(let ((font-lock-global-modes '(not fundamental-mode)))
|
(let ((font-lock-global-modes '(not fundamental-mode)))
|
||||||
|
@ -3690,7 +3693,9 @@ With prefix ARG, apply the new formulas to the table."
|
||||||
(org-table-store-formulas eql)
|
(org-table-store-formulas eql)
|
||||||
(set-marker pos nil)
|
(set-marker pos nil)
|
||||||
(set-marker source nil)
|
(set-marker source nil)
|
||||||
(kill-buffer "*Edit Formulas*")
|
(when-let ((window (get-buffer-window "*Edit Formulas*" t)))
|
||||||
|
(quit-window 'kill window))
|
||||||
|
(when (get-buffer "*Edit Formulas*") (kill-buffer "*Edit Formulas*"))
|
||||||
(if arg
|
(if arg
|
||||||
(org-table-recalculate 'all)
|
(org-table-recalculate 'all)
|
||||||
(message "New formulas installed - press C-u C-c C-c to apply."))))
|
(message "New formulas installed - press C-u C-c C-c to apply."))))
|
||||||
|
|
|
@ -8788,6 +8788,8 @@ there is one, return it."
|
||||||
(org-fit-window-to-buffer (get-buffer-window "*Select Link*"))
|
(org-fit-window-to-buffer (get-buffer-window "*Select Link*"))
|
||||||
(message "Select link to open, RET to open all:")
|
(message "Select link to open, RET to open all:")
|
||||||
(unwind-protect (setq c (read-char-exclusive))
|
(unwind-protect (setq c (read-char-exclusive))
|
||||||
|
(and (get-buffer-window "*Select Link*" t)
|
||||||
|
(quit-window 'kill (get-buffer-window "*Select Link*" t)))
|
||||||
(and (get-buffer "*Select Link*") (kill-buffer "*Select Link*")))))
|
(and (get-buffer "*Select Link*") (kill-buffer "*Select Link*")))))
|
||||||
(when (equal c ?q) (user-error "Abort"))
|
(when (equal c ?q) (user-error "Abort"))
|
||||||
(if (equal c ?\C-m)
|
(if (equal c ?\C-m)
|
||||||
|
|
|
@ -7135,6 +7135,8 @@ asynchronous export stack."
|
||||||
(and org-export-in-background 'async))
|
(and org-export-in-background 'async))
|
||||||
nil
|
nil
|
||||||
org-export-dispatch-use-expert-ui)))
|
org-export-dispatch-use-expert-ui)))
|
||||||
|
(and (get-buffer-window "*Org Export Dispatcher*" t)
|
||||||
|
(quit-window 'kill (get-buffer-window "*Org Export Dispatcher*" t)))
|
||||||
(and (get-buffer "*Org Export Dispatcher*")
|
(and (get-buffer "*Org Export Dispatcher*")
|
||||||
(kill-buffer "*Org Export Dispatcher*"))))))
|
(kill-buffer "*Org Export Dispatcher*"))))))
|
||||||
(action (car input))
|
(action (car input))
|
||||||
|
|
Loading…
Reference in New Issue