summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Rische <leon.rische@me.com>2020-05-06 23:02:48 +0200
committerLeon Rische <leon.rische@me.com>2020-05-06 23:02:48 +0200
commitc48c75469a760e6a2928ed95ef34605fd7a390f8 (patch)
tree9032886267fcdac3e3b2f91cb9b69342b65da243
parent32e01dbbf3459fed1b9315fdcd63c0966cff08d5 (diff)
Use `org-with-point-at` macro
-rw-r--r--org-fc.el11
1 files changed, 4 insertions, 7 deletions
diff --git a/org-fc.el b/org-fc.el
index dbd3c3e..6959dd4 100644
--- a/org-fc.el
+++ b/org-fc.el
@@ -905,8 +905,7 @@ Returns nil if there is no previous line."
(defun org-fc-overlay--point-after-title ()
"Value of point at the first line after the title keyword.
Returns nil if there is no title keyword."
- (save-excursion
- (goto-char (point-min))
+ (org-with-point-at (point-min)
(when (re-search-forward (rx bol "#+TITLE:") nil t)
(point-at-eol))))
@@ -1458,11 +1457,9 @@ END is the start of the line with :END: on it."
(defun org-fc-get-review-data ()
"Get a cards review data as a Lisp object."
- (let ((position (org-fc-review-data-position nil)))
- (if position
- (save-excursion
- (goto-char (car position))
- (cddr (org-table-to-lisp))))))
+ (if-let ((position (org-fc-review-data-position nil)))
+ (org-with-point-at (car position)
+ (cddr (org-table-to-lisp)))))
(defun org-fc-set-review-data (data)
"Set the cards review data to DATA."