From d08822c6148cf7942ae3953c363257b9a7cc92ab Mon Sep 17 00:00:00 2001 From: Maxi Wolff Date: Wed, 18 Jan 2023 06:30:08 +0100 Subject: [PATCH] Fixing side effects of org version mismatch hotfix Fixes #15887 --- core/core-spacemacs-buffer.el | 12 +++++++----- core/core-spacemacs.el | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/core-spacemacs-buffer.el b/core/core-spacemacs-buffer.el index 6875ec774..c88192ad9 100644 --- a/core/core-spacemacs-buffer.el +++ b/core/core-spacemacs-buffer.el @@ -1553,9 +1553,10 @@ can be adjusted with the variable: (force-mode-line-update) (spacemacs-buffer/goto-link-line))) -(defun spacemacs-buffer/goto-buffer (&optional refresh) - "Create the special buffer for `spacemacs-buffer-mode' and switch to it. -REFRESH if the buffer should be redrawn. +(defun spacemacs-buffer/goto-buffer (&optional refresh do-not-switch) + "Create the special buffer for `spacemacs-buffer-mode'. +REFRESH if the buffer should be redrawn. This will automatically +switch to the buffer unless DO-NOT-SWITCH is non nil. If a prefix argument is given, switch to it in an other, possibly new window." (interactive) @@ -1597,8 +1598,9 @@ If a prefix argument is given, switch to it in an other, possibly new window." (forward-line (1- save-line)) (forward-to-indentation 0)) (spacemacs-buffer/goto-link-line))) - (if current-prefix-arg - (switch-to-buffer-other-window spacemacs-buffer-name) + (unless do-not-switch + (if current-prefix-arg + (switch-to-buffer-other-window spacemacs-buffer-name)) (switch-to-buffer spacemacs-buffer-name)) (spacemacs//redisplay)))) diff --git a/core/core-spacemacs.el b/core/core-spacemacs.el index 731dbe6a9..8145a5c35 100644 --- a/core/core-spacemacs.el +++ b/core/core-spacemacs.el @@ -263,7 +263,7 @@ Note: the hooked function is not executed when in dumped mode." ;; Redraw the spacemacs buffer with full org support ;; Before it must be drawn without org related features to ;; avoid loading build in org in emacs >= 29 - (spacemacs-buffer/goto-buffer t))) + (spacemacs-buffer/goto-buffer t t))) (if dotspacemacs-byte-compile (when (> 1 (spacemacs//dir-byte-compile-state