diff options
author | Leon Rische <leon.rische@me.com> | 2020-05-06 23:02:48 +0200 |
---|---|---|
committer | Leon Rische <leon.rische@me.com> | 2020-05-06 23:02:48 +0200 |
commit | c48c75469a760e6a2928ed95ef34605fd7a390f8 (patch) | |
tree | 9032886267fcdac3e3b2f91cb9b69342b65da243 | |
parent | 32e01dbbf3459fed1b9315fdcd63c0966cff08d5 (diff) |
Use `org-with-point-at` macro
-rw-r--r-- | org-fc.el | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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." |