Bruno Barbier writes: > I've pushed the update to my public branch. Thanks! I am attaching some minor edits I'd like to propose on top of your latest branch. Also, some more questions. > ;; (setq my-rlock > ;; (org-pending (cons (point) (mark)) > ;; (lambda (outcome) > ;; (pcase outcome > ;; (`(:success ,result) (goto-char END) (insert result)) > ;; (`(:failure ,err) (message "Failed: %s" err)))))) 1. It is more natural in Elisp to pass regions as two parameters: BEG and END, not a cons cell. 2. Note that (point) may be _after_ (mark). AFAIU, you code assumes that point is always before the mark. You may want to address this. 3. ON-OUTCOME is optional. What happens if none is provided? 4. In the `org-pending' docstring you say "ON-OUTCOME is non-nil, call it with the reglock and the outcome", but the example shows a lambda accepting a single argument. Something is off. I'm afraid that this example will not work if copy-pasted. > ;; (org-pending-send-update my-rlock (list :progress "Not ready yet.")) > ;; (org-pending-send-update my-rlock (list :progress "Coming soon.")) Should the progress message always be a string? > ;; (org-pending-send-update my-rlock (list :success 1)) What will org-pending do with :success 1? Will it replace region with "1" or will it do something else? > ;; (org-pending-send-update my-rlock (list :failure "Some error!")) I am slightly confused by this calling convention. Why not simply (org-pending-send-update my-rlock :failure "Some error!") > ;; (setf (org-pending-reglock-insert-details-function my-reglock) > ;; (lambda (rl _start _end) > ;; (insert (format "%s" (org-pending-reglock-property rl :my-prop))))) Are there any standard properties? It would be nice to list them in a table as well. Also, you can show an example of _setting_ :my-prop property. > ;; If the user kills a buffer, or, kills Emacs, some locks may have to > ;; be killed too. The library will ask the user to confirm if an > ;; operation requires to kill some locks. See the field > ;; `before-kill-function' of REGLOCK object, if you need to do > ;; something before a lock is really killed. For example, if you like > ;; to kill a MY-BUFFER before MY-LOCK is killed, you can do: > ;; > ;; (setf (org-pending-reglock-before-kill-function my-reglock) > ;; (lambda (_rl) (kill-buffer my-buffer))) It would be nice to have an example that will also send a signal to process, as it is probably the most commonly used way to utilize org-pending. From `org-pending' docstring: > If ON-OUTCOME returns > a region (a pair (start position . end position)), use it to report the > success/failure using visual hints on that region. If ON-OUTCOME > returns nothing, don't display outcome marks. What if ON-OUTCOME returns something that is not a cons cell and not nil?