Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide "edit" command #2

Closed
mruwek opened this issue Jan 6, 2015 · 7 comments
Closed

Provide "edit" command #2

mruwek opened this issue Jan 6, 2015 · 7 comments

Comments

@mruwek
Copy link
Contributor

mruwek commented Jan 6, 2015

It would be nice to have possibility to edit todo.txt in $EDITOR. I can imagine 3 ways of using this command:

  1. todo edit - open todo.txt in $EDITOR
  2. todo edit archive - open done.txt
  3. todo edit <NUMBER> - open todo.txt and go to specified task/line

Bottom line: inspired by work of Dave Hein @dhein
http://github.com/dhein/todo.txt-cli/blob/pub-addons-new_export2/edit

@bram85
Copy link
Member

bram85 commented Jan 7, 2015

Didn't know that extension by Dave Hein, but I was actually already working on this.
In a local branch that, I didn't push yet, I already have an 'edit' subcommand that implements item 1 in your list.

I had a different implementation of "edit " in mind, being to open a temporary file with that specified todo item. You could be able to specify more numbers, or maybe even a +Project to edit all items in that project. That last item is not implemented yet.

Regarding item 2, I'd say to use a flag (-d) instead a full word. "archive" could also be a regular expression that matches items with the word archive in it.

@mruwek
Copy link
Contributor Author

mruwek commented Jan 7, 2015

I was actually already working on this.

Great :) I'm waiting then for the update.

You could be able to specify more numbers, or maybe even a +Project to edit all items in that project.

That would be very useful. Any ETA on this?

Regarding item 2, I'd say to use a flag (-d) instead a full word.

Agreed.

@bram85
Copy link
Member

bram85 commented Jan 7, 2015

You could be able to specify more numbers, or maybe even a +Project to edit all items in that project.

That would be very useful. Any ETA on this?

ETA is difficult to tell. I could deliver functionality 1) very soon to master because that's basically ready. I just waited because I assumed to be the only user :)

At the moment I'm a bit busy with other things, but item 3) is something I miss myself in my day-to-day work so probably I'll scratch that itch somewhere this month or next month.

bram85 added a commit that referenced this issue Jan 8, 2015
Feature is not ready yet, but since it's a part of issue #2 I already went
ahead and pushed the first part.
@kidpixo
Copy link
Contributor

kidpixo commented Mar 5, 2015

+1 on this!

mruwek added a commit to mruwek/topydo that referenced this issue Mar 27, 2015
implements topydo#2

- `topydo edit` will still open todofile in $EDITOR
- `topydo edit 1 2 3` will open tmpfile with corresponding todos
@mruwek
Copy link
Contributor Author

mruwek commented Mar 27, 2015

I really believe that code above is not ready for merge, but hey, it works!

Waiting for insights, comments and patches :)

or maybe even a +Project to edit all items in that project

For that to happen we need to implement it in TodoListBase.todo function. pri, postpone, do, del would also benefit from such extension.

mruwek referenced this issue in mruwek/topydo Apr 8, 2015
On some systems EDITOR is unset by default, so in such situation topydo
would throw KeyError exception instead of opening todo.txt in vi.
mruwek added a commit to mruwek/topydo that referenced this issue Apr 9, 2015
implements topydo#2

- `topydo edit` will still open todofile in $EDITOR
- `topydo edit 1 2 3` will open tmpfile with corresponding todos
mruwek added a commit to mruwek/topydo that referenced this issue Apr 17, 2015
implements topydo#2

- `topydo edit` will still open todofile in $EDITOR
- `topydo edit 1 2 3` will open tmpfile with corresponding todos
mruwek added a commit to mruwek/topydo that referenced this issue May 2, 2015
implements topydo#2

- `topydo edit` will still open todofile in $EDITOR
- `topydo edit 1 2 3` will open tmpfile with corresponding todos
- `topydo edit -e @Home due:today` will open tmpfile with todos matching
   the expression
@bram85
Copy link
Member

bram85 commented May 2, 2015

I'll leave this issue open since the archive option is not implemented (use case 2 in your original report). It's up to you what to do: close this issue, now the edit subcommand is merged, or leave it open in case you'd like to implement the archive case.

mruwek added a commit to mruwek/topydo that referenced this issue May 4, 2015
This implements archive option from topydo#2.
@mruwek
Copy link
Contributor Author

mruwek commented May 4, 2015

Closing as it is fully implemented now and merged in master.

@mruwek mruwek closed this as completed May 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants