Charles Choi <kickingve...@gmail.com> writes: > Patch v4 (4b40a28d) of org-protocol.org rewrite.
Thank you very much for your careful attention to feedback, Charles! And thanks to Max for yesterday's careful review, which covered everything I spotted and quite a bit I didn't. I think this patch is ready to be applied, and that any further refinement can be done against Charles' rewrite as the new baseline. I'll merge it tomorrow night if there's no objection or new patch. >> >> I like "<<-EOF" shell feature for here-docs that allows to keep text >> block indented, but I do not consider zero indent in elisp strings >> as a really annoying issue. It is unclear to me what are >> complications with debugging. Do you mean that `string-join' allows >> to comment out specific lines by prepending them with ";"? > > > I do find zero indent strings to be annoying for readability, > particularly as this is used for a template. Also because this string > is a template, I find it annoying to audit embedded ā\nā characters. I > find that breaking it up into string fragments that can be joined > together makes it more comprehensible and maintainable. As a side > note, this practice was influenced by DOCT > (https://github.com/progfolio/doct) which allows for specification of > a list for a template. > > All that said, Max, are your concerns a block? For my part, I'm inclined to see this as a matter of taste and leave it up to you. For the reader, it may initially be confusing that the approach differs from the one shown in the manual, but on the other hand, it may be helpful to be shown more than one way to do it. Like Max, though, I think repeating the template twice feels redundant. Perhaps the same pedagogical effect could be achieved by keeping the longer example and demarcating the template sexp with a comment line? >> (add-hook 'org-mode-hook >> (lambda () >> (add-to-list 'org-capture-templates ;; The template follows >> '("capture" >> "Capture (Org Protocol)" >> entry >> (file "notes.org") >> (function (lambda () >> (string-join >> '("* %:description" >> ":PROPERTIES:" >> ":CREATED: %U" >> ":END:" >> "%:annotation" >> "%i" >> "" >> "%?") >> "\n"))) >> :prepend t >> :empty-lines 1) ;; end template >> ))) Btw, given that the car of a capture template is supposed to be a one- or two-character key for template selection, it's fascinating that the string "capture" works as a key for Org protocol capture (but fails to be shown in the interactive capture template selection dialog, which is convenient in this case). Yours, Christian