branch: externals-release/org
commit f5e41b4724de879634821ae2bfd78b7696172c76
Author: hrdl <g...@hrdl.eu>
Commit: Ihor Radchenko <yanta...@posteo.net>

    org-babel-result-names: Do not alter window configuration
    
    * lisp/ob-core.el (org-babel-result-names): Do not change
      visibility of windows when called.
    
    TINYCHANGE
---
 lisp/ob-core.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index e69ce4f1d1..b111ce86c8 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -1932,12 +1932,12 @@ buffer or nil if no such result exists."
 
 (defun org-babel-result-names (&optional file)
   "Return the names of results in FILE or the current buffer."
-  (save-excursion
-    (when file (find-file file)) (goto-char (point-min))
-    (let ((case-fold-search t) names)
+  (with-current-buffer (if file (find-file-noselect file) (current-buffer))
+    (org-with-point-at 1
+      (let ((case-fold-search t) names)
       (while (re-search-forward org-babel-result-w-name-regexp nil t)
        (setq names (cons (match-string-no-properties 9) names)))
-      names)))
+      names))))
 
 ;;;###autoload
 (defun org-babel-next-src-block (&optional arg)

Reply via email to