branch: externals/org
commit 031f9da0d6e255556baf8498bae2e483ef0970fb
Author: Slawomir Grochowski <[email protected]>
Commit: Slawomir Grochowski <[email protected]>
; org-colview: Extract `org-columns--update-agenda-single-file'
* lisp/org-colview.el (org-columns--update-agenda-single-file): New function
extracted from `org-columns--execute-and-update'.
(org-columns--execute-and-update): Use the new function.
The extracted function name clearly describes what it does, allowing
the removal of the explanatory comment from the code.
Refactoring: Extract Function.
No behavior change.
---
lisp/org-colview.el | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index a831278b4e..2fa63371cb 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -729,6 +729,16 @@ See info documentation about realizing a suitable
checkbox."
(assoc spec (get-text-property (line-beginning-position) 'org-summaries))
(error "This value is computed from the entry's children"))))
+(defun org-columns--update-agenda-single-file (pom)
+ "Update `org-agenda-columns' for the file containing POM.
+Preserves the current format and updates only the single file."
+ (let* ((org-overriding-columns-format org-columns-current-fmt)
+ (buffer (marker-buffer pom))
+ (org-agenda-contributing-files
+ (list (with-current-buffer buffer
+ (buffer-file-name (buffer-base-buffer))))))
+ (org-agenda-columns)))
+
(defun org-columns--execute-and-update (action pom key col)
"Execute ACTION and update column view.
POM is the point or marker for the heading.
@@ -737,14 +747,7 @@ COL is the column to move to after update."
(cond
((eq major-mode 'org-agenda-mode)
(org-columns--call action)
- ;; The following let preserves the current format, and makes sure
- ;; that in only a single file things need to be updated.
- (let* ((org-overriding-columns-format org-columns-current-fmt)
- (buffer (marker-buffer pom))
- (org-agenda-contributing-files
- (list (with-current-buffer buffer
- (buffer-file-name (buffer-base-buffer))))))
- (org-agenda-columns)))
+ (org-columns--update-agenda-single-file pom))
(t
(let ((inhibit-read-only t))
(with-silent-modifications