2

I am trying to update the fairly old taskpaper major mode for Emacs found here to simply include the current date, whenever I mark a task as done. The line should then read:

- Task @done(2015-07-13) instead of just - Task @done.

  • I have just been pasting snippets I found in different major modes into the taskpaper.el file, but since I have very little experience programming nothing really worked. – montauk Jul 13 '15 at 11:10
0

How about changing line 124 from (insert " @done") to this instead?:

[The example assumes that the original poster has a current version of Emacs that already has (require 'org) somewhere built-in. If not, then add that statement to the .emacs file. The example is a modified excerpt from the built-in function org-insert-time-stamp.]

(let* ((inactive t)
       (with-hm t)
       (fmt (funcall (if with-hm 'cdr 'car) org-time-stamp-formats)))
  (when inactive (setq fmt (concat "[" (substring fmt 1 -1) "]")))
  (insert " @done" (format-time-string fmt (current-time))))

If the original poster prefers that the time-stamp be active, then change (inactive t) to (inactive nil).

If the original poster does not want hours/minutes, then change (with-hm t) to (with-hm nil).

  • How about simply (insert " @done (%s)" (format-time-string taskpaper-timestamp-format (current-time))) with a suitable definition of taskpaper-timestamp-format? I don't know what the rest of the code is for, but it sounds more complicated than what the OP asked for. And depending on org for inserting timestamps sounds like overkill, the relevant features are built-in emacs... – T. Verron Jul 13 '15 at 20:18
  • @T. Verron -- please post an alternative answer -- I am comfortable with mine just the way it is. – lawlist Jul 13 '15 at 20:34
  • Thanks for you reply! Sadly now the plugin doesn't load at all, and I get the following error when my Spacemacs loads: load-with-code-conversion: End of file during parsing: /home/ma/.emacs.d/taskpaper.el ad-handle-definition: 'tramp-read-passwd' got redefined – montauk Jul 14 '15 at 9:28
  • Sorry, never mind! The mistake was elsewhere. It's working great now! – montauk Jul 14 '15 at 9:40
  • I'm glad you got it working. The parsing error message usually means you forgot a parentheses or a double-quote somewhere. Using M-x check-parens is very useful to help pinpoint the location. – lawlist Jul 14 '15 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.