Hi Nicolas, Thanks a lot for these very helpful comments. I'll take them into account. I have a couple questions of my own now.
On 2014-04-25 08:51, Nicolas Goaziou <n.goaz...@gmail.com> writes: >> I would like to propose to add this to the contrib directory, but >> I don't know the procedure to submit this code. > > You simply copy the file in the contrib/lisp/ directory, edit > contrib/README and edit `org-modules' defcustom in "org.el". I guess I should have asked: who decides what goes in contrib? Is this mature/useful enough to be included? If so, I'll edit these as you suggest. >> ;; Example use. >> ;; > > Trailing whitespace. After this many violations, I've added #+begin_src emacs-lisp (setq-default show-trailing-whitespace t) #+end_src to my configuration ;-) >> (defun org-review-insert-last-review (&optional prompt) >> "Insert the current date as last review. If prefix argument: >> prompt the user for the date." >> (interactive "P") >> (let* ((ts (if prompt >> (concat "<" (org-read-date) ">") >> (format-time-string (car org-time-stamp-formats))))) >> (save-excursion > > I don't think this `save-excursion' is needed. Indeed. I copied this from org-expiry. Looking at the code for `org-entry-put', I see that it uses `org-with-point' that also uses save-excursion inside. >> (defun org-review-skip () >> "Skip entries that are not scheduled to be reviewed." >> (save-restriction >> (widen) >> (let ((next-headline (save-excursion (or (outline-next-heading) >> (point-max))))) >> (cond >> ((org-review-toreview-p) nil) >> (t next-headline))))) > > This function doesn't move point (so it skips nothing), is it > expected? It works, so I guess it's not supposed to move the point. It's to be used with `org-agenda-skip-function', which says: ,----------------------------------------------------------------------- | Function to be called at each match during agenda construction. | If this function returns nil, the current match should not be skipped. | Otherwise, the function must return a position from where the search | should be continued. `----------------------------------------------------------------------- Thanks again, Alan