Loading ...
Sorry, an error occurred while loading the content.

Re: [todotxt] Re: hiding priority, context, project

Expand Messages
  • David A. Harding
    ... Good catch! I ran the whole section through expand(1) and it caught a pre-existing mis-format too: -t Prepend the current date to a task automatically
    Message 1 of 30 , Mar 2, 2009
    View Source
    • 0 Attachment
      On Tue, Mar 03, 2009 at 04:21:19AM -0000, thinkcriticallyandbefree wrote:
      > I did find only one issue -- the formatting of the new help lines is a
      > bit off. Their indentation is different from the other help text.

      Good catch! I ran the whole section through expand(1) and it caught
      a pre-existing mis-format too:

      -t
      Prepend the current date to a task automatically
      when it's added.

      Revised patch attached; the only thing that's different from the
      previous patch is the usage message: tabs were replaced with eight
      spaces.

      Thanks,

      -Dave
      --
      David A. Harding Website: http://dtrt.org/
      1 (609) 997-0765 Email: dave@...
      Jabber/XMPP: dharding@...
    • David A. Harding
      For those keeping track, I sent a pull request to Gina for the following two patches: 1. Hiding Priority, Context, and Project 2. Run .todo.actions.d Before
      Message 2 of 30 , Mar 7, 2009
      View Source
      • 0 Attachment
        For those keeping track, I sent a pull request to Gina for the following
        two patches:

        1. Hiding Priority, Context, and Project
        2. Run .todo.actions.d Before Builtins

        Thank you Greg for you guide to GitHub. You saved me a lot of research
        and trial and error.

        The complete logs for the two patches:

        commit 20e68927754017a9600f23054f05d9e7db5208f8
        Author: David A. Harding <dave@...>
        Date: Sat Mar 7 16:15:15 2009 -0500

        Run .todo.actions.d Before Builtins
        .
        Let users override default commands by creating a script in
        ~/.todo.actions.d/ with the same name as a default command. Idea by Don
        Harper and David A. Harding; patch by Harding.
        .
        The patch adds the following logic and increases the indent level for
        the case statement:
        .
        +if [ -d "$HOME/.todo.actions.d" -a -x "$HOME/.todo.actions.d/$action" ]
        +then
        + CFG_FILE="$CFG_FILE" "$HOME/.todo.actions.d/$action" "$@"
        +else
        + case $action in

        commit fd9b002ce13c10e2be13de193ac9f9911a9a6a28
        Author: David A. Harding <dave@...>
        Date: Sat Mar 7 13:05:40 2009 -0500

        Hiding Priority, Context, and Project
        .
        Adds three new switches that hide priorty, context, and project text in
        list output.
        .
        Changes proposed by Dave Hein. Original patch by Dave Hein. Revised
        patch by David A. Harding. Thread starts at
        http://tech.groups.yahoo.com/group/todotxt/message/1848

        -Dave
        --
        David A. Harding Website: http://dtrt.org/
        1 (609) 997-0765 Email: dave@...
        Jabber/XMPP: dharding@...
      • Philippe Teuwen
        ... It would have been simpler to exit rather than to increase the indentation of almost the entire file: +if [ -d $HOME/.todo.actions.d -a -x
        Message 3 of 30 , Mar 7, 2009
        View Source
        • 0 Attachment
          > The patch adds the following logic and increases the indent level for
          > the case statement:
          > .
          > +if [ -d "$HOME/.todo.actions.d" -a -x "$HOME/.todo.actions.d/$action" ]
          > +then
          > + CFG_FILE="$CFG_FILE" "$HOME/.todo.actions.d/$action" "$@"
          > +else
          > + case $action in

          It would have been simpler to exit rather than to increase the indentation of almost the entire file:
          +if [ -d "$HOME/.todo.actions.d" -a -x "$HOME/.todo.actions.d/$action" ]
          +then
          + CFG_FILE="$CFG_FILE" "$HOME/.todo.actions.d/$action" "$@"
          + exit 0
          +fi

          Phil
        • Dave Hein
          Dave, I found issues on the Mac (OS X 10.4). The standard sed does not support the + (one or more) regex syntax nor the | (alternation) regex syntax. To
          Message 4 of 30 , Mar 7, 2009
          View Source
          • 0 Attachment
            Dave,

            I found issues on the Mac (OS X 10.4). The standard 'sed' does not support the "+" (one or more) regex syntax nor the "|" (alternation) regex syntax. To use either one requires passing the "-E" option to sed; and that changes some of the other other syntax requirements.

            I'm attaching a patch (again to the original 2.1) with the changes. This works on Mac, and I expect it to work on Cygwin but I'm unable to test with cygwin (at least not for a couple days).

            [I know I said that the previous patch worked on Mac, but it looks like when I tested I was using a different version of sed, not the normal one. Apologies.]

            Have a look at this and see if it also works for you; if so, can you please check in these changes (maybe excluding the extra version info I added) so that it will work for Mac users.

            --
            Dave Hein <thinkcriticallyandbefree@...>


            From: David A. Harding <dave@...>
            To: todotxt@yahoogroups.com
            Sent: Monday, March 2, 2009 10:36:02 PM
            Subject: Re: [todotxt] Re: hiding priority, context, project

            On Tue, Mar 03, 2009 at 04:21:19AM -0000, thinkcriticallyandb efree wrote:
            > I did find only one issue -- the formatting of the new help lines is a
            > bit off. Their indentation is different from the other help text.

            Good catch! I ran the whole section through expand(1) and it caught
            a pre-existing mis-format too:

            -t
            Prepend the current date to a task automatically
            when it's added.

            Revised patch attached; the only thing that's different from the
            previous patch is the usage message: tabs were replaced with eight
            spaces.

            Thanks,

            -Dave
            --
            David A. Harding Website: http://dtrt. org/
            1 (609) 997-0765 Email: dave@...
            Jabber/XMPP: dharding@jabber. org


          • David A. Harding
            ... Excellent suggestion; I ll do that when I test Dave Hein s suggested changes. Gina, please disregard the pull request I sent you earlier. I ll send
            Message 5 of 30 , Mar 7, 2009
            View Source
            • 0 Attachment
              On Sat, Mar 07, 2009 at 10:48:24PM -0000, Philippe Teuwen wrote:
              > It would have been simpler to [...]
              > + CFG_FILE="$CFG_FILE" "$HOME/.todo.actions.d/$action" "$@"
              > + exit 0

              Excellent suggestion; I'll do that when I test Dave Hein's
              suggested changes.

              Gina, please disregard the pull request I sent you earlier. I'll send
              another pull request when I've done the above.

              Thanks,

              -Dave
              --
              David A. Harding Website: http://dtrt.org/
              1 (609) 997-0765 Email: dave@...
              Jabber/XMPP: dharding@...
            • David A. Harding
              ... Thanks, Dave. I ll work on this tonight or tomorrow afternoon. Can you tell me which sed is the default on Mac OS X 10.4? Is it the FreeBSD sed? -Dave --
              Message 6 of 30 , Mar 7, 2009
              View Source
              • 0 Attachment
                On Sat, Mar 07, 2009 at 03:03:20PM -0800, Dave Hein wrote:
                > on the Mac (OS X 10.4) [...] The standard 'sed' does not support the
                > "+" (one or more) regex syntax nor the "|" (alternation) regex syntax.

                Thanks, Dave. I'll work on this tonight or tomorrow afternoon.

                Can you tell me which sed is the default on Mac OS X 10.4? Is it the
                FreeBSD sed?

                -Dave
                --
                David A. Harding Website: http://dtrt.org/
                1 (609) 997-0765 Email: dave@...
                Jabber/XMPP: dharding@...
              • Dave Hein
                You are correct, it is the FreeBSD sed. And now I read in the man page that the -E option might be a FreeBSD-only option. :-( Feh. -- Dave Hein
                Message 7 of 30 , Mar 7, 2009
                View Source
                • 0 Attachment
                  You are correct, it is the FreeBSD sed.

                  And now I read in the man page that the "-E" option might be a FreeBSD-only option. :-(

                  Feh.

                  --
                  Dave Hein <thinkcriticallyandbefree@...>


                  From: David A. Harding <dave@...>
                  To: todotxt@yahoogroups.com
                  Sent: Saturday, March 7, 2009 6:47:09 PM
                  Subject: Re: [todotxt] Re: hiding priority, context, project

                  On Sat, Mar 07, 2009 at 03:03:20PM -0800, Dave Hein wrote:
                  > on the Mac (OS X 10.4) [...] The standard 'sed' does not support the
                  > "+" (one or more) regex syntax nor the "|" (alternation) regex syntax.

                  Thanks, Dave. I'll work on this tonight or tomorrow afternoon.

                  Can you tell me which sed is the default on Mac OS X 10.4? Is it the
                  FreeBSD sed?

                  -Dave
                  --
                  David A. Harding Website: http://dtrt. org/
                  1 (609) 997-0765 Email: dave@...
                  Jabber/XMPP: dharding@jabber. org


                • Gina Trapani
                  ... Roger that, will hold off, thanks Dave. -- http://ginatrapani.org
                  Message 8 of 30 , Mar 7, 2009
                  View Source
                  • 0 Attachment
                    On Sat, Mar 7, 2009 at 4:40 PM, David A. Harding <dave@...> wrote:
                    > Gina, please disregard the pull request I sent you earlier. I'll send
                    > another pull request when I've done the above.

                    Roger that, will hold off, thanks Dave.


                    --
                    http://ginatrapani.org
                  • Dave Hein
                    Dave, Try these with normal sed (no -E or -r option): HIDE_CONTEXTS_SUBSTITUTION= ([[:space:]] )@[^[:space:]] {1, }
                    Message 9 of 30 , Mar 7, 2009
                    View Source
                    • 0 Attachment
                      Dave,

                      Try these with normal sed (no -E or -r option):

                                  HIDE_CONTEXTS_SUBSTITUTION="\([[:space:]]\)@[^[:space:]]\{1,\}"
                                  HIDE_PROJECTS_SUBSTITUTION="\([[:space:]]\)[+][^[:space:]]\{1,\}"
                                  HIDE_PRIORITY_SUBSTITUTION="([A-Z])[[:space:]]"

                      they are working for me with FreeBSD sed (OS X) and should also work with Gnu sed (according to the documentation).

                      The "\{1,\}" is the equivalent of the "+", and we don't need the alternation because there will always be a leading space because all the lines start with a line number token (at that point in the script).

                      --
                      Dave Hein <thinkcriticallyandbefree@...>


                      From: David A. Harding <dave@...>
                      To: todotxt@yahoogroups.com
                      Sent: Saturday, March 7, 2009 6:47:09 PM
                      Subject: Re: [todotxt] Re: hiding priority, context, project

                      On Sat, Mar 07, 2009 at 03:03:20PM -0800, Dave Hein wrote:
                      > on the Mac (OS X 10.4) [...] The standard 'sed' does not support the
                      > "+" (one or more) regex syntax nor the "|" (alternation) regex syntax.

                      Thanks, Dave. I'll work on this tonight or tomorrow afternoon.

                      Can you tell me which sed is the default on Mac OS X 10.4? Is it the
                      FreeBSD sed?

                      -Dave
                      --
                      David A. Harding Website: http://dtrt. org/
                      1 (609) 997-0765 Email: dave@...
                      Jabber/XMPP: dharding@jabber. org


                    • David A. Harding
                      ... Can you please test the following command using the FreeBSD sed? echo -e @context foo nfoo @context ... You should get the following output: foo foo
                      Message 10 of 30 , Mar 7, 2009
                      View Source
                      • 0 Attachment
                        On Sat, Mar 07, 2009 at 05:14:27PM -0800, Dave Hein wrote:
                        > You are correct, it is the FreeBSD sed.

                        Can you please test the following command using the FreeBSD sed?

                        echo -e '@context foo\nfoo @context' \
                        | sed 's/^@[^[:space:]]\{1,\}[[:space:]]*//; s/@[^[:space:]\{1,\}[[:space:]]*//'

                        You should get the following output:

                        foo
                        foo

                        Thanks,

                        -Dave
                        --
                        David A. Harding Website: http://dtrt.org/
                        1 (609) 997-0765 Email: dave@...
                        Jabber/XMPP: dharding@...
                      • David A. Harding
                        ... Sorry; disregard this email: I didn t receive your previous email before sending it. Thanks, -Dave -- David A. Harding Website: http://dtrt.org/ 1
                        Message 11 of 30 , Mar 7, 2009
                        View Source
                        • 0 Attachment
                          On Sat, Mar 07, 2009 at 11:31:28PM -0500, David A. Harding wrote:
                          > Can you please test the following command using the FreeBSD sed?

                          Sorry; disregard this email: I didn't receive your previous email before
                          sending it.

                          Thanks,

                          -Dave
                          --
                          David A. Harding Website: http://dtrt.org/
                          1 (609) 997-0765 Email: dave@...
                          Jabber/XMPP: dharding@...
                        • Dave Hein
                          We also can do without the grouping, so: HIDE_CONTEXTS_SUBSTITUTION= [[:space:]]@[^[:space:]] {1, }
                          Message 12 of 30 , Mar 8, 2009
                          View Source
                          • 0 Attachment
                            We also can do without the grouping, so:

                                        HIDE_CONTEXTS_SUBSTITUTION="[[:space:]]@[^[:space:]]\{1,\}"
                                        HIDE_PROJECTS_SUBSTITUTION="[[:space:]][+][^[:space:]]\{1,\}"
                                        HIDE_PRIORITY_SUBSTITUTION="([A-Z])[[:space:]]"

                            --
                            Dave Hein


                            From: Dave Hein <thinkcriticallyandbefree@...>
                            To: todotxt@yahoogroups.com
                            Sent: Saturday, March 7, 2009 9:01:09 PM
                            Subject: Re: [todotxt] Re: hiding priority, context, project

                            Dave,

                            Try these with normal sed (no -E or -r option):

                                        HIDE_CONTEXTS_ SUBSTITUTION= "\([[:space: ]]\)@[^[: space:]]\ {1,\}"
                                        HIDE_PROJECTS_ SUBSTITUTION= "\([[:space: ]]\)[+][^ [:space:] ]\{1,\}"
                                        HIDE_PRIORITY_ SUBSTITUTION= "([A-Z])[ [:space:] ]"

                            they are working for me with FreeBSD sed (OS X) and should also work with Gnu sed (according to the documentation) .

                            The "\{1,\}" is the equivalent of the "+", and we don't need the alternation because there will always be a leading space because all the lines start with a line number token (at that point in the script).

                            --
                            Dave Hein <thinkcriticallyandb efree@yahoo. com>


                            From: David A. Harding <dave@...>
                            To: todotxt@yahoogroups .com
                            Sent: Saturday, March 7, 2009 6:47:09 PM
                            Subject: Re: [todotxt] Re: hiding priority, context, project

                            On Sat, Mar 07, 2009 at 03:03:20PM -0800, Dave Hein wrote:
                            > on the Mac (OS X 10.4) [...] The standard 'sed' does not support the
                            > "+" (one or more) regex syntax nor the "|" (alternation) regex syntax.

                            Thanks, Dave. I'll work on this tonight or tomorrow afternoon.

                            Can you tell me which sed is the default on Mac OS X 10.4? Is it the
                            FreeBSD sed?

                            -Dave
                            --
                            David A. Harding Website: http://dtrt. org/
                            1 (609) 997-0765 Email: dave@...
                            Jabber/XMPP: dharding@jabber. org



                          • David A. Harding
                            My branch for the following two features has been updated with the changes suggested by Philippe Teuwen and Dave Hein. 1. Hiding Priority, Context, and Project
                            Message 13 of 30 , Mar 8, 2009
                            View Source
                            • 0 Attachment
                              My branch for the following two features has been updated with the
                              changes suggested by Philippe Teuwen and Dave Hein.

                              1. Hiding Priority, Context, and Project
                              2. Run .todo.actions.d Before Builtins

                              You can find a color diff of all the changes to todo.sh in my branch at
                              the following URL:

                              http://tinyurl.com/bm5deh

                              If you have a moment, please test the changes. In particular, testing on
                              Mac OS X and Cygwin will be appreciated. (Note: You should always backup
                              your todo.txt file before testing.) Test these changes by applying the
                              above patch or by downloading the following todo.sh file.

                              http://git.dtrt.org/?p=todo.txt-cli.git;a=blob_plain;f=todo.sh

                              After you download the script and make it executable, please try the
                              following commands:

                              ## Hide the priority, context, and project while listing your tasks.
                              ## You should see all of your tasks but none of your priorities,
                              ## contexts, or projects.
                              ./todo.sh -@ -+ -P ls

                              ## Same base command as above, but hide the regular output so you
                              ## can see if there are any error messages. If you see any output,
                              ## something's wrong; email me the message you see.
                              ./todo.sh -@ -+ -P ls > /dev/null

                              ## List only tasks that contain the letter, "e".
                              ## You should see all of your tasks that contain the letter, "e".
                              ./todo.sh -@ -+ -P ls e

                              ## Same base command as above, but hide the regular output so you
                              ## can see if there are any error messages. If you see any output,
                              ## something's wrong; email me the message you see.
                              ./todo.sh -@ -+ -P ls e > /dev/null


                              ## Override a default command.
                              ## First, create the .todo.actions.d directory if it doesn't exist.
                              cd
                              [ -d .todo.actions.d ] || mkdir .todo.actions.d

                              ## Create and make executable a script in .todo.actions.d with the
                              ## same name as a default command.
                              echo -e '#!'"$(which bash)"' \n echo $CFG_FILE' > .todo.actions.d/ls
                              chmod +x .todo.actions.d/ls

                              ## Run the overridden command. You should see the location of your
                              ## configuration file. If you see the normal output of `todo.sh ls`,
                              ## please email me as many details as you can.
                              ./todo.sh ls

                              ## Remove the override command so you can use todo.sh normally.
                              rm .todo.actions.d/ls

                              If nobody reports any problems, I'll send Gina a pull request on GitHub
                              in a couple days.

                              Thanks,

                              -Dave
                              --
                              David A. Harding Website: http://dtrt.org/
                              1 (609) 997-0765 Email: dave@...
                              Jabber/XMPP: dharding@...
                            • Ed Blackman
                              ... For those of use following development with git, how would we pull in your changes (probably in a new branch)? Ed
                              Message 14 of 30 , Mar 8, 2009
                              View Source
                              • 0 Attachment
                                On Sun, Mar 08, 2009 at 02:03:55PM -0400, David A. Harding wrote:
                                >My branch for the following two features has been updated with the
                                >changes suggested by Philippe Teuwen and Dave Hein.
                                >
                                > 1. Hiding Priority, Context, and Project
                                > 2. Run .todo.actions.d Before Builtins
                                >
                                >You can find a color diff of all the changes to todo.sh in my branch at
                                >the following URL:
                                >
                                > http://tinyurl.com/bm5deh
                                >
                                >If you have a moment, please test the changes. In particular, testing on
                                >Mac OS X and Cygwin will be appreciated. (Note: You should always backup
                                >your todo.txt file before testing.) Test these changes by applying the
                                >above patch or by downloading the following todo.sh file.

                                For those of use following development with git, how would we pull in
                                your changes (probably in a new branch)?

                                Ed
                              • David A. Harding
                                ... Use the following commands in your repository: git remote add -f harding git://github.com/harding/todo.txt-cli.git git checkout -b harding/master git pull
                                Message 15 of 30 , Mar 8, 2009
                                View Source
                                • 0 Attachment
                                  On Sun, Mar 08, 2009 at 02:49:11PM -0400, Ed Blackman wrote:
                                  > For those of use following development with git, how would we pull in
                                  > your changes (probably in a new branch)?

                                  Use the following commands in your repository:

                                  git remote add -f harding git://github.com/harding/todo.txt-cli.git
                                  git checkout -b harding/master
                                  git pull harding master

                                  After you try the changes, you can switch back to your master branch:

                                  git checkout master

                                  -Dave
                                  --
                                  David A. Harding Website: http://dtrt.org/
                                  1 (609) 997-0765 Email: dave@...
                                  Jabber/XMPP: dharding@...
                                • Ed Blackman
                                  ... Not a problem, but the passing of CFG_FILE into the action environment (CFG_FILE= $CFG_FILE ...) is redundant with the export of all todo variables. The
                                  Message 16 of 30 , Mar 8, 2009
                                  View Source
                                  • 0 Attachment
                                    On Sun, Mar 08, 2009 at 02:03:55PM -0400, David A. Harding wrote:
                                    >If nobody reports any problems, I'll send Gina a pull request on GitHub
                                    >in a couple days.

                                    Not a problem, but the passing of CFG_FILE into the action environment
                                    (CFG_FILE="$CFG_FILE" ...) is redundant with the export of all todo
                                    variables.

                                    The attached patch removes the redundant export.

                                    David, I've also sent you a pull request via Git Hub.

                                    Ed
                                  • David A. Harding
                                    ... Applied, http://github.com/harding/todo.txt-cli/commit/47c7ba75b3ba651faadcf9223e414e5bc51d17ec Thanks, -Dave -- David A. Harding Website:
                                    Message 17 of 30 , Mar 8, 2009
                                    View Source
                                    • 0 Attachment
                                      On Sun, Mar 08, 2009 at 06:57:31PM -0400, Ed Blackman wrote:
                                      > the passing of CFG_FILE into the action environment is redundant with
                                      > the export of all todo variables.
                                      > The attached patch removes the redundant export.

                                      Applied,

                                      http://github.com/harding/todo.txt-cli/commit/47c7ba75b3ba651faadcf9223e414e5bc51d17ec

                                      Thanks,

                                      -Dave
                                      --
                                      David A. Harding Website: http://dtrt.org/
                                      1 (609) 997-0765 Email: dave@...
                                      Jabber/XMPP: dharding@...
                                    Your message has been successfully submitted and would be delivered to recipients shortly.