Updating Emacs

2022-08-22 Thread Gerardo Moro
Dear all,

I currently use Emacs 27.2 (9.0) and need to update to the last version.
No idea how my current Emacs was installed on my Mac.

In case this helps, when I do on Terminal:

§ which -a- emacs

/usr/local/bin/emacs
/opt/local/bin/emacs
/usr/local/bin/emacs

What would the way to go to update my emacs to the last version without
affecting any of my configuration or packages?

Thanks!
G.


Re: Taking notes of videos in Emacs

2022-07-09 Thread Gerardo Moro
Thank you, all, for the pointers!

As for your own package, Juan Manuel, I understand the main purpose is to
take screenshots of movies. Am I correct?
Thanks!


El vie, 8 jul 2022 a las 16:25, Juan Manuel Macías ()
escribió:

> Gerardo Moro writes:
>
> > Hi,
> >
> > I recently discover the Obsidian Media Extended plugin
> > (https://www.youtube.com/watch?v=GQXVWtNkeZw) to take notes while
> > watching videos / listening to audios with keybindings to stop the
> > video and create timestamps with link to the specific moment of the
> > video, etc.
> >
> > Is there something similar in Emacs?
>
> See org-media-note: https://github.com/yuchen-lea/org-media-note
>
> And, for something simpler, I shared here days ago this code:
>
> https://list.orgmode.org/871qvmt4xr@posteo.net/
>
> Best regards,
>
> Juan Manuel
>


Taking notes of videos in Emacs

2022-07-08 Thread Gerardo Moro
Hi,

I recently discover the Obsidian Media Extended plugin (
https://www.youtube.com/watch?v=GQXVWtNkeZw) to take notes while watching
videos / listening to audios with keybindings to stop the video and create
timestamps with link to the specific moment of the video, etc.

Is there something similar in Emacs?

Thank you!

G.


Re: Change both width and height of R plot in SRC block

2022-06-30 Thread Gerardo Moro
Oh my god, this works! I honestly tried everything but...
Apologies.
Where can I read more about the possible options at header in source blocks?
Thanks!

El jue, 30 jun 2022 a las 15:50, Ihor Radchenko ()
escribió:

> Gerardo Moro  writes:
>
> > I have been trying for over a year to change the output plot size when
> > using Orgmode SRC blocks with R. I have tried both using orgmode settings
> > and R settings.
>
> Have you tried :with and :height header arguments?
>
> > I have a table from which I take some values.
>
> It would be more helpful if you provided a completely reproducible
> example that others can also run.
>
> Best,
> Ihor
>


Change both width and height of R plot in SRC block

2022-06-30 Thread Gerardo Moro
Hi,

I have been trying for over a year to change the output plot size when
using Orgmode SRC blocks with R. I have tried both using orgmode settings
and R settings.

I have a table from which I take some values.

#+name: cost
#+begin_src R :results output file graphics :file imag/cost.jpg :var
tab=cost
library(ggplot2)

ggplot(tab, aes(x = date, y = cost)) +
geom_line(color="darkgreen") + geom_point() +
scale_x_date(date_breaks = "1 day",
date_labels = "%b %d") +
theme(axis.text.x = element_text(angle = 90)) +
scale_y_continuous(breaks=seq(100,200,1)) +
ylim(100, 200)
#+end_src

The resulting plot (only showing the x axis) is squared, so the resulting X
axis is not legible at all:

#+RESULTS: cost
[image: image.png]

I have spent months to try to figure out how to have a non-square plot
showing in Orgmode, to no avail.

This presses me to stop using Emacs for graphing altogether.

I have head that this has more to do with R than with Emacs, but I have
tried all the R code advice out there.

I also have tried of course the #+attr_org: :width 600px :height:300px, but
it only considers the width, so I end up with another square.

If any of you has a solution,  much appreciated!

Best,
G. Moro


Re: How to open a link to a folder/file in Finder, not Dired

2021-10-20 Thread Gerardo Moro
It works! Thanks so much!

El mié, 20 oct 2021 a las 19:08, Mark Barton ()
escribió:

>
>
> On Oct 20, 2021, at 1:36 AM, Gerardo Moro  wrote:
>
> I am having the same problem as reported here:
> https://emacs.stackexchange.com/questions/66593/how-to-open-a-link-to-a-folder-file-in-finder-not-dired
>
>
> I copy paste:
>
> I used to be able to create links with open-insert-link pointing to
> folders or files. When I clicked on them, I would be redirected to Finder.
> Lately, they are shown within Dired. How to control this behaviour? When
> I use either [[file:/users/Shared]] or [[file+emacs:/users/Shared]], and
> click on them, I get the dired buffer, not the Finder app.
>
> Thanks!
> G.M.
>
>
> According to the help for org-open-at-point it should work if you give a
> double prefix argument. I tried C-u C-u C-c C-o and it opened a link in
> finder.
>
> I normally prefer dired, but when I need finder, I use Keyboard Maestro to
> associate H-f to bring the finder to focus in a manner specific to the
> current application. So when emacs is the current application, Keyboard
> Maestro will send the following keystrokes to emacs to open finder in the
> directory associated with the current buffer:M-! open .
>
> For the case where other applications other than emacs are the current
> application, I can configure the macro to bring up finder using the various
> application specific menu options to show file in finder. If there are no
> specific configurations for the application, then it just switches to
> finder.
>
> Mark
>


How to open a link to a folder/file in Finder, not Dired

2021-10-20 Thread Gerardo Moro
I am having the same problem as reported here:
https://emacs.stackexchange.com/questions/66593/how-to-open-a-link-to-a-folder-file-in-finder-not-dired


I copy paste:

I used to be able to create links with open-insert-link pointing to folders
or files. When I clicked on them, I would be redirected to Finder. Lately,
they are shown within Dired. How to control this behaviour? When I use
either [[file:/users/Shared]] or [[file+emacs:/users/Shared]], and click on
them, I get the dired buffer, not the Finder app.

Thanks!
G.M.


Re: Possibility to copy text outside EMACS and send it to orgmode document

2021-01-06 Thread Gerardo Moro
Thanks. Then why is in
https://orgmode.org/worg/org-contrib/org-protocol.html#installation this
confusing bit?

Installation

   -

   To load org-protocol.el add the following to your .emacs:

   (server-start)
   (add-to-list 'load-path "~/path/to/org/protocol/")
   (require 'org-protocol)




El jue, 7 ene 2021 a las 8:17, Tom Gillespie () escribió:

> It is built into the core org distribution.
>


Re: Possibility to copy text outside EMACS and send it to orgmode document

2021-01-06 Thread Gerardo Moro
Thanks. I have been trying to set org-protocol up, but... I can't find
where this package is (silly, innit?).
Where is the official org-protocol page where to download it?
Thanks!

El jue, 7 ene 2021 a las 7:10, Ihor Radchenko ()
escribió:

> Gerardo Moro  writes:
>
> > Thanks, guys.
> > I'll have a look.
> > I understand that using org-protocol in combo with org-capture I would
> have
> > to visit the Emacs window for capturing the copied text or not?
> > Because this is crucial, as I aim to avoid this step.
> > Thanks!
>
> If your capture template has :immediate-finish setting set to t, the
> capture is done in background without raising Emacs frame.
> See  v org-capture-templates  for more details.
>
> Best,
> Ihor
>
>


Re: Possibility to copy text outside EMACS and send it to orgmode document

2021-01-06 Thread Gerardo Moro
This is very cool, thanks, and I very much use Automator.
I will have a look later, but it seems that you have to move focus to
Emacs, so it does not directly send something to a orgmode document
straight from the copy action in the browser.

El mié, 6 ene 2021 a las 17:56, Tim Visher ()
escribió:

> On Wed, Jan 6, 2021 at 1:43 AM Gerardo Moro 
> wrote:
>
>> Basically that: as I copy (Control-C) text from the browser (Chrome), I
>> would like those copied sentences to be sent to a ordered list in an
>> OrgMode document:
>>
>> - copied text 1
>> - copied text 2
>> - etc.
>>
>> Any ideas? This would be very useful.
>>
>
> On macOS I've done _similar_  things to this (albeit not exactly what
> you're asking) by simply generating org text for me to paste in.
>
> For instance I have an applescript `org-current-tab`:
>
> ```
> …
> on org_current_tab()
> tell application "Google Chrome"
> set the_title to title of active tab of front window
> set the_title to my replace_chars(the_title, "[", " ")
> set the_title to my replace_chars(the_title, "]", " ")
> return "[[" & URL of active tab of front window & "][" & the_title
> & "]]" as text
> end tell
> end org_current_tab
> ```
>
> Then from anywhere I can activate this applescript and all I need to do is
> whack `C-y` in emacs and I get the link pasted in.
>
> It's not hard then to extend this directly into emacs via the `osascript`
> executable:
>
> ```
> (defun org-current-tab
> ()
>   (interactive)
>   (unless (eq major-mode 'org-mode)
> (user-error "This command must be triggered in an org buffer."))
>   (let* ((output (with-temp-buffer
>(call-process
> "osascript" nil t nil
> "-e" "tell application \"Finder\" to set
> current_tab_handlers to (load script file \"current_tab_handlers.scpt\" of
> folder \"Dropbox\" of home as alias)"
> "-e" "tell current_tab_handlers to org_current_tab()")
>(substring-no-properties (thing-at-point 'line t) 0
> -1
> (insert output)))
> ```
>
> I'm not sure what environment you're in so you may not have access to a
> system's scripting tool like Applescript but depending on the scripting
> facilities of whatever you're targeting maybe you can get most of the way
> there. At the worst you could add whatever text you want to your clipboard
> and then write some elisp that processes it before writing it to your org
> buffer.
>


Re: Possibility to copy text outside EMACS and send it to orgmode document

2021-01-05 Thread Gerardo Moro
Thanks, guys.
I'll have a look.
I understand that using org-protocol in combo with org-capture I would have
to visit the Emacs window for capturing the copied text or not?
Because this is crucial, as I aim to avoid this step.
Thanks!

El mié, 6 ene 2021 a las 8:49, Tom Gillespie () escribió:

> You can achieve something a bit like this using
> org-protocol-capture-html
> https://github.com/alphapapa/org-protocol-capture-html. I'm not
> entirely sure whether you can bind the equivalent of a hook in
> javascript to run every time you C-c, but if you can, then it should
> be possible to match this exactly. You might also be able to wire up
> org-protocol to the X clipboard (if you are on linux).
>
> Best,
> Tom
>


Possibility to copy text outside EMACS and send it to orgmode document

2021-01-05 Thread Gerardo Moro
Basically that: as I copy (Control-C) text from the browser (Chrome), I
would like those copied sentences to be sent to a ordered list in an
OrgMode document:

- copied text 1
- copied text 2
- etc.

Any ideas? This would be very useful.
Thanks!


Re: Remembrance Agents

2020-11-30 Thread Gerardo Moro
> * Gerardo Moro  [2020-11-30 09:49]:
> > Thanks! I get an idea. Will try to use soon and let you know.
> > Thanks for the links, very helpful.
> > Question: when you say it uses emails, can it read any email database (I
> > have old ones from Microsoft outlook both Mac and Windows)? What if you
> > only use webmail, in which format shall you feed the RA?
>
> I think that all those formats can be converted to something you could
> be using centrally on your computer.
>
> I am recommending Maildir format. But that would depend of your email
> client that you use.
>

My emails are in format .emlx which is only readable by MAIL. I also have
used Windows' Microsoft Office which stores I think in PLIST format.
Is it possible to convert them to Maildir format? I don't know how any
search software could search within those files if they are not converted.

Best,
GM


Re: Remembrance Agents

2020-11-30 Thread Gerardo Moro
Ok, thanks. How do you specify the location and is the formatting ok when
showing you the relevance pieces of text from the local databases?

El lun, 30 nov 2020 a las 11:31, Eric S Fraga ()
escribió:

> On Monday, 30 Nov 2020 at 08:48, Gerardo Moro wrote:
> > Question: when you say it uses emails, can it read any email database (I
> > have old ones from Microsoft outlook both Mac and Windows)? What if you
> > only use webmail, in which format shall you feed the RA?
>
> No, I don't think the remembrance agent can access webmail of any
> sort.  It is file based.  In my case, all of my emails are stored
> locally (I use gnus nnml groups and POP3 to retrieve my emails from the
> mail host).
>
> --
> : Eric S Fraga via Emacs 28.0.50, Org release_9.4-143-g9a1549
>


Re: Remembrance Agents

2020-11-29 Thread Gerardo Moro
Thanks! I get an idea. Will try to use soon and let you know.
Thanks for the links, very helpful.
Question: when you say it uses emails, can it read any email database (I
have old ones from Microsoft outlook both Mac and Windows)? What if you
only use webmail, in which format shall you feed the RA?
Thanks

El dom, 29 nov 2020 a las 15:52, Eric S Fraga ()
escribió:

> On Sunday, 29 Nov 2020 at 15:07, Gerardo Moro wrote:
> > Has somebody installed it and tried it? It would be great to have a
> > screen recording demo.
>
> I've used it on and off in the past, within the past 2 years most
> recently.  I populate the database it uses with both emails and org
> files.  While writing, it shows lines from documents that match in a
> separate window (whose size can be customized).
>
> It does work but I find that I tend to forget about the remembrance
> window most of the time so eventually I turn it off.  I never seem to
> have enough screen real estate to justify its use (despite having 38"
> and 27" monitors side by side on my desk ;-)).
>
> There was a blog post early this year on this topic [1] which you might
> find interesting.  It talks mostly about recoll [2] which is not so much
> a remembrance agent but a search tool
>
> HTH,
> eric
>
> Footnotes:
> [1]  https://blog.jethro.dev/posts/remembrance_agents/
>
> [2]  https://www.lesbonscomptes.com/recoll/
>
> --
> : Eric S Fraga via Emacs 28.0.50, Org release_9.4-143-g9a1549
>


Re: Remembrance Agents

2020-11-29 Thread Gerardo Moro
Thanks, I had seen those pages. Seems an old project and I haven't used it.
The Github page is here https://github.com/emacsmirror/remem
Has somebody installed it and tried it? It would be great to have a
screen recording demo.
So as I see, it basically shows in the minibuffer documents that are
related to what you write.
Correct me if I'm wrong.
Your project sounds intriguing!
GM

El sáb, 28 nov 2020 a las 20:29, Jean Louis () escribió:

>  * Gerardo Moro  [2020-11-28 20:02]:
> > Is there currently any (good) implementation of the idea of the
> Remembrance
> > Agents in Emacs?
>
> According to this document:
>
> Hyperlink: https://alumni.media.mit.edu/~rhodes/Papers/remembrance.html
>
> the implementation was running already in Emacs!
>
> There is more to it:
>
> https://www.emacswiki.org/emacs/RemembranceAgents
>
> And picture: https://alumni.media.mit.edu/~rhodes/Papers/ra.small.gif
>
> As I am developing HyperScope that is to augment the knowledge, at
> least for those objects displayed within HyperScope but also in other
> context or modes I could invoke something similar as Speedbar on the
> side or in separate window that would show all relations to specific
> object. It could also look from time to time into what text is user
> writing and search relevant terms or tags to display such as
> hyperlinks that are accessible on the side. The more information user
> enters into the database and the more tags and relations have been
> created the better the relevance.
>
> In the context of web applications providing CRM Customer Relationship
> Management there are always various related objects hyperlinked on the
> same page. Same is valid for ERM or Enterprise Resource Management and
> similar systems as they are already based on the relational databases.
>
> Automatic hypertexting is another good feature that may be implemented
> within Emacs for any relevant terms.
>


Remembrance Agents

2020-11-28 Thread Gerardo Moro
Is there currently any (good) implementation of the idea of the Remembrance
Agents in Emacs?
Thanks!


Re: Bring up a screen giving option to open a series of orgmode files

2020-11-24 Thread Gerardo Moro
Hi,

See org-store-link and org-insert-link. org-store-link stores link in a
> link ring and the link/links can be later inserted using
> org-insert-link.
>

org-store-link would work only within Emacs, not for the case of copying
http links in the browser, right?


org-store-link


Re: Bring up a screen giving option to open a series of orgmode files

2020-11-23 Thread Gerardo Moro
 > Do you find that useful? Who does?
I definitely think it's very, very useful!
I constantly leave tabs open or use bookmarks, but it'd be great to add
them to ORG with a timestamp to watch later.
This way I wouldn't forget about them and they wouldn't take memory on the
browser if I don't bookmark them.


El lun, 23 nov 2020 a las 12:59, Jean Louis () escribió:

> * Ihor Radchenko  [2020-11-23 11:14]:
> > > Org provides hyperlinks and that useful feature may be used as
> > > on-the-fly information visualizer for many groups of smaller pieces of
> > > information which could be obtained from some structure or found in
> > > real time.
> >
> > Also, one could quickly select one of multiple links under heading by
> > invoking C-c C-o with point at heading.
>
> I did not know that. That is useful feature for Org.
>
> Side note: there shall be feature in Org that quickly
> captures the full link to the heading. Maybe it already
> exists. Instead of constructing links by hand like entering
> the file name, entering the heading for the link, there
> shall by some automated feature:
>
> Useful Feature A:
> =
>
> - watching 2 windows with 2 Org files
>
> - position cursor in first Org file to accept the hyperlink
>
> - move to 2nd Org file any heading
>
> - press key, and hyperlink is sent to 1st Org file properly
>   formatted for specific heading in second Org file.
>
> And then there shall be also collection of hyperlinks:
>
> Useful feature B to collect hyperlinks similar to above:
> 
>
> - user browses one Org file and thinks of collecting various
> multiple hyperlinks as such need to be referenced in other
> Org file and I refer to headings only for now.
>
> - user would just invoke the key in any heading and message
>   would be "Heading `** TODO Things' captured in the ring"
>
> - user would be able to browse various Org files and collect
>   hyperlinks in memory collection.
>
> - After several collections user could then go to other Org
> files and invoke key or command to insert the whole
> collection of hyperlinks.
>
> Do you find that useful? Who does?
>
> That is how I am implementing information in the personal
> program HyperScope, it will get published when polished and
> ripe.
>
> Collections are similar to Dired marking, user can mark the
> file and later decide what to do with it.
>
> Org headings can be or could be marked with later action on
> the whole collection of headings:
>
> - re-filing all of them at once
>
> - sending them all by email to other person (I do with Org)
>
> - sending hyperlinks in other Org file (I do in HyperScope)
>
> - creating new Org file with the collection of headings
>
> - assigning properties to collection of headings, tasks,
> todo or similar. I am often assigning tasks to people,
> collection would help me re-assign tasks instead of doing it
> one by one.
>
> > In the following example, C-c C-o would raise a buffer listing all
> > the links. Then, the links can be selected by pressing 1/2/3 (to
> > open first/second/third link):
>
> That is new to me and fine feature, thank you for reference.
>
> But this here, this chunk of various properties shows how
> Org users wish Org to be way more structured, that Org wants
> to become more than just plain text, it wants to become
> database.
>
> *** NEXT  Commit all the changes
> SCHEDULED: <2020-11-24 Tue .+1d>
> :PROPERTIES:
> :CREATED: [2019-04-18 Thu 09:40]
> :STYLE: habit
> :REPEAT_TO_STATE: NEXT
> :LOGGING: DONE(!)
> :ARCHIVE: %S_archive_%y.org::* Habits
> :ORG-TIME-BONUS: 0
> :LAST_REPEAT: [2020-11-23 Mon 14:10]
> :SHOWFROMDATE: 2020-11-09
> :RESET_CHECK_BOXES: t
> :END:
>
>


Re: Bring up a screen giving option to open a series of orgmode files

2020-11-23 Thread Gerardo Moro
Ok, thanks!

El lun, 23 nov 2020 a las 11:12, Ihor Radchenko ()
escribió:

> > One question: what does  do? Thanks
>
> Just wanted to indicate the cursor position.
>
> Best,
> Ihor
>
> Gerardo Moro  writes:
>
> > Excellent stuff.
> > One question: what does  do? Thanks
> >
> > El lun, 23 nov 2020 a las 10:13, Ihor Radchenko ()
> > escribió:
> >
> >> > Org provides hyperlinks and that useful feature may be used as
> >> > on-the-fly information visualizer for many groups of smaller pieces of
> >> > information which could be obtained from some structure or found in
> >> > real time.
> >>
> >> Also, one could quickly select one of multiple links under heading by
> >> invoking C-c C-o with point at heading.
> >>
> >> In the following example, C-c C-o would raise a buffer listing all the
> >> links. Then, the links can be selected by pressing 1/2/3 (to open
> >> first/second/third link):
> >>
> >> *** NEXT  Commit all the changes
> >> SCHEDULED: <2020-11-24 Tue .+1d>
> >> :PROPERTIES:
> >> :CREATED: [2019-04-18 Thu 09:40]
> >> :STYLE: habit
> >> :REPEAT_TO_STATE: NEXT
> >> :LOGGING: DONE(!)
> >> :ARCHIVE: %S_archive_%y.org::* Habits
> >> :ORG-TIME-BONUS: 0
> >> :LAST_REPEAT: [2020-11-23 Mon 14:10]
> >> :SHOWFROMDATE: 2020-11-09
> >> :RESET_CHECK_BOXES: t
> >> :END:
> >>
> >> - [[file:~/Org/]]
> >> - [[file:~/Knowledge_base/2016/Private/Get_started_with_org_mode/]]
> >> - file:/home/yantar92/Git/emacs-config
> >>
> >> Best,
> >> Ihor
> >>
> >> Jean Louis  writes:
> >>
> >> > * Gerardo Moro  [2020-11-23 07:00]:
> >> >> Thanks so much, now it works when using that elisp function.
> >> >
> >> > OK, it was your idea and I adopt the approach. If Elisp function
> >> > works, then shell command may not be important.
> >> >
> >> > Org provides hyperlinks and that useful feature may be used as
> >> > on-the-fly information visualizer for many groups of smaller pieces of
> >> > information which could be obtained from some structure or found in
> >> > real time.
> >> >
> >> > It is useful to think of Org as a meta hyperdocument visualizer and as
> >> > a self-helping and self-producing system. That would mean that few
> >> > simple functions could automate collection of pieces of information
> >> > for further human annotation and expansion.
> >> >
> >> > Memex
> >> > https://en.wikipedia.org/wiki/Memex
> >> >
> >> > Memacs
> >> > https://github.com/novoid/Memacs
> >> >
> >> > Semantic Synchrony
> >> > https://github.com/synchrony/smsn
> >>
>


Re: Bring up a screen giving option to open a series of orgmode files

2020-11-23 Thread Gerardo Moro
Excellent stuff.
One question: what does  do? Thanks

El lun, 23 nov 2020 a las 10:13, Ihor Radchenko ()
escribió:

> > Org provides hyperlinks and that useful feature may be used as
> > on-the-fly information visualizer for many groups of smaller pieces of
> > information which could be obtained from some structure or found in
> > real time.
>
> Also, one could quickly select one of multiple links under heading by
> invoking C-c C-o with point at heading.
>
> In the following example, C-c C-o would raise a buffer listing all the
> links. Then, the links can be selected by pressing 1/2/3 (to open
> first/second/third link):
>
> *** NEXT  Commit all the changes
> SCHEDULED: <2020-11-24 Tue .+1d>
> :PROPERTIES:
> :CREATED: [2019-04-18 Thu 09:40]
> :STYLE: habit
> :REPEAT_TO_STATE: NEXT
> :LOGGING: DONE(!)
> :ARCHIVE: %S_archive_%y.org::* Habits
> :ORG-TIME-BONUS: 0
> :LAST_REPEAT: [2020-11-23 Mon 14:10]
> :SHOWFROMDATE: 2020-11-09
> :RESET_CHECK_BOXES: t
> :END:
>
> - [[file:~/Org/]]
> - [[file:~/Knowledge_base/2016/Private/Get_started_with_org_mode/]]
> - file:/home/yantar92/Git/emacs-config
>
> Best,
> Ihor
>
> Jean Louis  writes:
>
> > * Gerardo Moro  [2020-11-23 07:00]:
> >> Thanks so much, now it works when using that elisp function.
> >
> > OK, it was your idea and I adopt the approach. If Elisp function
> > works, then shell command may not be important.
> >
> > Org provides hyperlinks and that useful feature may be used as
> > on-the-fly information visualizer for many groups of smaller pieces of
> > information which could be obtained from some structure or found in
> > real time.
> >
> > It is useful to think of Org as a meta hyperdocument visualizer and as
> > a self-helping and self-producing system. That would mean that few
> > simple functions could automate collection of pieces of information
> > for further human annotation and expansion.
> >
> > Memex
> > https://en.wikipedia.org/wiki/Memex
> >
> > Memacs
> > https://github.com/novoid/Memacs
> >
> > Semantic Synchrony
> > https://github.com/synchrony/smsn
>


Re: Bring up a screen giving option to open a series of orgmode files

2020-11-22 Thread Gerardo Moro
Thanks so much, now it works when using that elisp function.
One thing yet:

> I am confused. I don't understand the syntax. The line "find
Documents/Org/
> -type f -iname "*.org" -exec echo " * [[file:`realpath {}`][{}]]" >
> meta-org.org \;" should be a function of its own?

That was shell command. Like in bash, dash, zsh and similar.

You mean a shell command to be executed in M-x shell-command? I did so, but
the output was

<*.org" -exec echo " * [[file:`realpath {}`][{}]]" > meta-org.org \
Thanks,
GM

El dom, 22 nov 2020 a las 21:16, Jean Louis () escribió:

> * Gerardo Moro  [2020-11-22 22:04]:
> > Thanks to both of you,
> >
> > find Documents/Org/ -type f -iname "*.org" -exec echo " *
> [[file:`realpath
> > {}`][{}]]" > meta-org.org \;
> >
> > Instead of "Documents/Org/" you should put there your own top
> > directory where you keep Org files.
> >
> > Then open meta-org.org
> >
> >
> > I am confused. I don't understand the syntax. The line "find
> Documents/Org/
> > -type f -iname "*.org" -exec echo " * [[file:`realpath {}`][{}]]" >
> > meta-org.org \;" should be a function of its own?
>
> That was shell command. Like in bash, dash, zsh and similar.
>
> > M-x find-dired RET Documents/Org/ RET -iname "*.org" RET
> >
> > Once I press "RET", what does -iname mean? I am new in Emacs. You mean,
> > this is just using find-dired to browse the org files?
>
> For Emacs function it is like this one here:
>
> ;; setup here your main subtree
> (setq my-org-dir "~/Documents/Org")
>
> (defun my-meta-org ()
>   "Opens my meta-org.org on the fly with hyperlinks to other Org files."
>   (interactive)
>   (let ((org-files (directory-files my-org-dir t ".org"))
> (meta-buffer "meta-org.org"))
> (with-temp-buffer-window meta-buffer nil nil
>   (switch-to-buffer meta-buffer)
>   (org-mode)
>   (dolist (file org-files)
> (insert (format "- [[%s][%s]]\n" file (file-name-base file)))
>
> then run:
>
> M-x my-meta-org
>
>


Re: Bring up a screen giving option to open a series of orgmode files

2020-11-22 Thread Gerardo Moro
Thanks to both of you,

find Documents/Org/ -type f -iname "*.org" -exec echo " * [[file:`realpath
{}`][{}]]" > meta-org.org \;

Instead of "Documents/Org/" you should put there your own top
directory where you keep Org files.

Then open meta-org.org


I am confused. I don't understand the syntax. The line "find Documents/Org/
-type f -iname "*.org" -exec echo " * [[file:`realpath {}`][{}]]" >
meta-org.org \;" should be a function of its own?

M-x find-dired RET Documents/Org/ RET -iname "*.org" RET

Once I press "RET", what does -iname mean? I am new in Emacs. You mean,
this is just using find-dired to browse the org files?
Thank you both!


El dom, 22 nov 2020 a las 19:35, Berry, Charles ()
escribió:

>
>
> > On Nov 22, 2020, at 2:09 AM, Jean Louis  wrote:
> >
> > * Gerardo Moro  [2020-11-22 13:02]:
> >> Basically that :)
> >> I'm looking for some setup that allows me to open a menu with a list of
> >> files and shortcut access keys to open them.
> >>
> >> Probably somebody has done this before.
> >
> > Let me invent something for you:
> >
> > find Documents/Org/ -type f -iname "*.org" -exec echo " *
> [[file:`realpath {}`][{}]]" > meta-org.org \;
> >
> > Instead of "Documents/Org/" you should put there your own top
> > directory where you keep Org files.
> >
> > Then open meta-org.org
> >
>
> Nice.
>
> Or for a one-off solution:
>
> M-x find-dired RET Documents/Org/ RET -iname "*.org" RET
>
> And use the dired buffer to navigate.
>
> HTH,
>
> Chuck
>


Bring up a screen giving option to open a series of orgmode files

2020-11-22 Thread Gerardo Moro
Basically that :)
I'm looking for some setup that allows me to open a menu with a list of
files and shortcut access keys to open them.

Probably somebody has done this before.

Thank you,
GM


Re: Archiving repeated tasks under corresponding date tree for each repeated item

2020-11-18 Thread Gerardo Moro
Indeed. I will try to work on it in my spare time, it will take maybe up to
a year, but as soon as I have it, I will let the maillist know in case it's
of interest.
Again, thanks for all your help.
GM

El mié., 18 nov. 2020 a las 7:37, Ihor Radchenko ()
escribió:

> > So from now on, all the DONE tasks would be archived straight away on the
> > day they are DONE.
>
> Not all the tasks, but all the tasks with repeater.
>
> > Is there a way to do the same with all the logged items under the
> :LOGBOOK:
> > that have been DONE before?
>
> It is certainly possible, but require more complicated function.
>
> Best,
> Ihor
>
> Gerardo Moro  writes:
>
> > Thank you! Ok, now it works. I had to restart my Emacs, probably that was
> > the problem.
> >
> > So from now on, all the DONE tasks would be archived straight away on the
> > day they are DONE. What about the previously LOGGED tasks?
> > Is there a way to do the same with all the logged items under the
> :LOGBOOK:
> > that have been DONE before?
> >
> > I have thousands of such instances, and I wonder if a function would find
> > all those items inside the LOGBOOKS and archive them individually under
> > their own DONE date in the org archive file. Maybe too much to ask! :)
> > GM
> >
> >
> > El mar., 17 nov. 2020 a las 18:00, Ihor Radchenko ()
> > escribió:
> >
> >> > Now I get the error: "wrong number of arguments..." :D
> >>
> >> It does not happen in my Emacs. It would be helpful if you shared the
> >> whole error message.
> >>
> >> I used the following code for testing:
> >>
> >> (defun my/org-archive-without-delete ()
> >>   "Archive item at point, but do not actually delete it."
> >>   (cl-letf (((symbol-function 'org-cut-subtree) (lambda () nil)))
> >> (org-archive-subtree)))
> >>
> >> (defun org-archive-repeated-task (arg)
> >>   "Add a copy of the recurring task marked DONE to archive."
> >>   (when (and (eq (plist-get arg :type) 'todo-state-change)
> >>  (string= (plist-get arg :to) "DONE")) ;; The state is
> changed
> >> to DONE
> >>     (let* ((pos (plist-get arg :position))
> >>(repeater (org-with-point-at pos (org-get-repeat
> >>   (when repeater ;; Only consider tasks with repeater timestamp
> >> anywhere in the task body
> >> (my/org-archive-without-delete)
> >>
> >> (add-hook 'org-trigger-hook #'org-archive-repeated-task)
> >>
> >> Best,
> >> Ihor
> >>
> >> Gerardo Moro  writes:
> >>
> >> > Now I get the error: "wrong number of arguments..." :D
> >> >
> >> > El mar., 17 nov. 2020 a las 15:13, Ihor Radchenko (<
> yanta...@gmail.com>)
> >> > escribió:
> >> >
> >> >> > I tried this but I get: "symbol's function definition is void:
> >> >> >  org-trigger-doing"
> >> >>
> >> >> Oops. That's the old function name. Should be
> >> >>
> >> >> (add-hook 'org-trigger-hook #'org-archive-repeated-task)
> >> >>
> >> >> Best,
> >> >> Ihor
> >> >>
> >> >>
> >> >> Gerardo Moro  writes:
> >> >>
> >> >> > Thanks for the prompt reply!
> >> >> > I tried this but I get: "symbol's function definition is void:
> >> >> >  org-trigger-doing"
> >> >> >
> >> >> > El mar., 17 nov. 2020 a las 14:32, Ihor Radchenko (<
> >> yanta...@gmail.com>)
> >> >> > escribió:
> >> >> >
> >> >> >> > Thanks, I don't know how to go about doing that, so I would
> have to
> >> >> rely
> >> >> >> on
> >> >> >> > others wanting to help me if they consider this to be also
> useful
> >> to
> >> >> them
> >> >> >> > (which I definitely think it is!).
> >> >> >>
> >> >> >> Try the following code. It should archive any repeated task once
> it
> >> is
> >> >> >> marked DONE.
> >> >> >>
> >> >> >> (defun org-archive-repeated-task (arg)
> >> >> >>   "Add a copy of the recurring task marked DONE to archive."
> >> >> >>   (when (and (eq (plist-get arg :type) 'todo-state-change)
> >> >> >>  (string= (plist-get arg :to) "DONE")) ;; The state is
> >> >> changed
> >> >> >> to DONE
> >> >> >> (let* ((pos (plist-get arg :position))
> >> >> >>(repeater (org-with-point-at pos (org-get-repeat
> >> >> >>   (when repeater ;; Only consider tasks with repeater
> timestamp
> >> >> >> anywhere in the task body
> >> >> >> (my/org-archive-without-delete)
> >> >> >> (add-hook 'org-trigger-hook #'org-trigger-doing)
> >> >> >>
> >> >> >> Best,
> >> >> >> Ihor
> >> >> >>
> >> >>
> >>
>


Re: Archiving repeated tasks under corresponding date tree for each repeated item

2020-11-17 Thread Gerardo Moro
Thank you! Ok, now it works. I had to restart my Emacs, probably that was
the problem.

So from now on, all the DONE tasks would be archived straight away on the
day they are DONE. What about the previously LOGGED tasks?
Is there a way to do the same with all the logged items under the :LOGBOOK:
that have been DONE before?

I have thousands of such instances, and I wonder if a function would find
all those items inside the LOGBOOKS and archive them individually under
their own DONE date in the org archive file. Maybe too much to ask! :)
GM


El mar., 17 nov. 2020 a las 18:00, Ihor Radchenko ()
escribió:

> > Now I get the error: "wrong number of arguments..." :D
>
> It does not happen in my Emacs. It would be helpful if you shared the
> whole error message.
>
> I used the following code for testing:
>
> (defun my/org-archive-without-delete ()
>   "Archive item at point, but do not actually delete it."
>   (cl-letf (((symbol-function 'org-cut-subtree) (lambda () nil)))
> (org-archive-subtree)))
>
> (defun org-archive-repeated-task (arg)
>   "Add a copy of the recurring task marked DONE to archive."
>   (when (and (eq (plist-get arg :type) 'todo-state-change)
>  (string= (plist-get arg :to) "DONE")) ;; The state is changed
> to DONE
> (let* ((pos (plist-get arg :position))
>(repeater (org-with-point-at pos (org-get-repeat
>   (when repeater ;; Only consider tasks with repeater timestamp
> anywhere in the task body
> (my/org-archive-without-delete)
>
> (add-hook 'org-trigger-hook #'org-archive-repeated-task)
>
> Best,
> Ihor
>
> Gerardo Moro  writes:
>
> > Now I get the error: "wrong number of arguments..." :D
> >
> > El mar., 17 nov. 2020 a las 15:13, Ihor Radchenko ()
> > escribió:
> >
> >> > I tried this but I get: "symbol's function definition is void:
> >> >  org-trigger-doing"
> >>
> >> Oops. That's the old function name. Should be
> >>
> >> (add-hook 'org-trigger-hook #'org-archive-repeated-task)
> >>
> >> Best,
> >> Ihor
> >>
> >>
> >> Gerardo Moro  writes:
> >>
> >> > Thanks for the prompt reply!
> >> > I tried this but I get: "symbol's function definition is void:
> >> >  org-trigger-doing"
> >> >
> >> > El mar., 17 nov. 2020 a las 14:32, Ihor Radchenko (<
> yanta...@gmail.com>)
> >> > escribió:
> >> >
> >> >> > Thanks, I don't know how to go about doing that, so I would have to
> >> rely
> >> >> on
> >> >> > others wanting to help me if they consider this to be also useful
> to
> >> them
> >> >> > (which I definitely think it is!).
> >> >>
> >> >> Try the following code. It should archive any repeated task once it
> is
> >> >> marked DONE.
> >> >>
> >> >> (defun org-archive-repeated-task (arg)
> >> >>   "Add a copy of the recurring task marked DONE to archive."
> >> >>   (when (and (eq (plist-get arg :type) 'todo-state-change)
> >> >>  (string= (plist-get arg :to) "DONE")) ;; The state is
> >> changed
> >> >> to DONE
> >> >> (let* ((pos (plist-get arg :position))
> >> >>(repeater (org-with-point-at pos (org-get-repeat
> >> >>   (when repeater ;; Only consider tasks with repeater timestamp
> >> >> anywhere in the task body
> >> >> (my/org-archive-without-delete)
> >> >> (add-hook 'org-trigger-hook #'org-trigger-doing)
> >> >>
> >> >> Best,
> >> >> Ihor
> >> >>
> >>
>


Re: Archiving repeated tasks under corresponding date tree for each repeated item

2020-11-17 Thread Gerardo Moro
Now I get the error: "wrong number of arguments..." :D

El mar., 17 nov. 2020 a las 15:13, Ihor Radchenko ()
escribió:

> > I tried this but I get: "symbol's function definition is void:
> >  org-trigger-doing"
>
> Oops. That's the old function name. Should be
>
> (add-hook 'org-trigger-hook #'org-archive-repeated-task)
>
> Best,
> Ihor
>
>
> Gerardo Moro  writes:
>
> > Thanks for the prompt reply!
> > I tried this but I get: "symbol's function definition is void:
> >  org-trigger-doing"
> >
> > El mar., 17 nov. 2020 a las 14:32, Ihor Radchenko ()
> > escribió:
> >
> >> > Thanks, I don't know how to go about doing that, so I would have to
> rely
> >> on
> >> > others wanting to help me if they consider this to be also useful to
> them
> >> > (which I definitely think it is!).
> >>
> >> Try the following code. It should archive any repeated task once it is
> >> marked DONE.
> >>
> >> (defun org-archive-repeated-task (arg)
> >>   "Add a copy of the recurring task marked DONE to archive."
> >>   (when (and (eq (plist-get arg :type) 'todo-state-change)
> >>  (string= (plist-get arg :to) "DONE")) ;; The state is
> changed
> >> to DONE
> >> (let* ((pos (plist-get arg :position))
> >>(repeater (org-with-point-at pos (org-get-repeat
> >>   (when repeater ;; Only consider tasks with repeater timestamp
> >> anywhere in the task body
> >> (my/org-archive-without-delete)
> >> (add-hook 'org-trigger-hook #'org-trigger-doing)
> >>
> >> Best,
> >> Ihor
> >>
>


Re: Archiving repeated tasks under corresponding date tree for each repeated item

2020-11-17 Thread Gerardo Moro
Thanks for the prompt reply!
I tried this but I get: "symbol's function definition is void:
 org-trigger-doing"

El mar., 17 nov. 2020 a las 14:32, Ihor Radchenko ()
escribió:

> > Thanks, I don't know how to go about doing that, so I would have to rely
> on
> > others wanting to help me if they consider this to be also useful to them
> > (which I definitely think it is!).
>
> Try the following code. It should archive any repeated task once it is
> marked DONE.
>
> (defun org-archive-repeated-task (arg)
>   "Add a copy of the recurring task marked DONE to archive."
>   (when (and (eq (plist-get arg :type) 'todo-state-change)
>  (string= (plist-get arg :to) "DONE")) ;; The state is changed
> to DONE
> (let* ((pos (plist-get arg :position))
>(repeater (org-with-point-at pos (org-get-repeat
>   (when repeater ;; Only consider tasks with repeater timestamp
> anywhere in the task body
> (my/org-archive-without-delete)
> (add-hook 'org-trigger-hook #'org-trigger-doing)
>
> Best,
> Ihor
>
> Gerardo Moro  writes:
>
> > Thanks, I don't know how to go about doing that, so I would have to rely
> on
> > others wanting to help me if they consider this to be also useful to them
> > (which I definitely think it is!).
> >
> > El mar., 17 nov. 2020 a las 11:32, Ihor Radchenko ()
> > escribió:
> >
> >> > I actually now realized that your function will not unfortunately
> archive
> >> > each logged item (those located in the logbook) in its corresponding
> date
> >> > (!).
> >> > What it will do is to archive the whole tree under today's date
> without
> >> > deleting it from the original org file.
> >>
> >> You are right. It is expected behaviour. That's why I suggested to run
> >> it in org-trigger-hook, which will trigger at the day and time when you
> >> mark the task DONE.
> >>
> >> Best,
> >> Ihor
> >>
> >> Gerardo Moro  writes:
> >>
> >> > Hi again,
> >> >
> >> > I actually now realized that your function will not unfortunately
> archive
> >> > each logged item (those located in the logbook) in its corresponding
> date
> >> > (!).
> >> > What it will do is to archive the whole tree under today's date
> without
> >> > deleting it from the original org file.
> >> >
> >> > For instance,
> >> >
> >> > * TODO REPEATED TASK SAMPLE
> >> >   SCHEDULED: <2020-11-30 Mon +20d>
> >> >   :PROPERTIES:
> >> >   :STYLE:habit
> >> >   :LAST_REPEAT: [2020-11-09 Mon 22:28]
> >> >   :END:
> >> > :LOGBOOK:
> >> > - State "DONE"   from "TODO"   [2020-11-15 Sun 22:28]
> >> > - State "DONE"   from "STARTED"[2020-11-14 Sat 22:17]
> >> > - State "DONE"   from "STARTED"[2020-11-13 Fri 22:17]
> >> > - State "DONE"   from "STARTED"[2020-11-11 Wed 22:17]
> >> >
> >> > If I position myself in any point in this entry, when I execute the
> >> > function it will archive the whole tree+subtree under today's date
> (the
> >> > date when it was archived).
> >> > The behaviour I was expecting is to archive each of the logged tasks
> >> under
> >> > their corresponding date (on the 11th, 13th, 14th and 15th of
> November).
> >> > Just to be clear :)
> >> > G
> >> >
> >> > El lun., 16 nov. 2020 a las 17:21, Gerardo Moro (<
> >> gerardomor...@gmail.com>)
> >> > escribió:
> >> >
> >>
>


Re: Archiving repeated tasks under corresponding date tree for each repeated item

2020-11-17 Thread Gerardo Moro
Thanks, I don't know how to go about doing that, so I would have to rely on
others wanting to help me if they consider this to be also useful to them
(which I definitely think it is!).

El mar., 17 nov. 2020 a las 11:32, Ihor Radchenko ()
escribió:

> > I actually now realized that your function will not unfortunately archive
> > each logged item (those located in the logbook) in its corresponding date
> > (!).
> > What it will do is to archive the whole tree under today's date without
> > deleting it from the original org file.
>
> You are right. It is expected behaviour. That's why I suggested to run
> it in org-trigger-hook, which will trigger at the day and time when you
> mark the task DONE.
>
> Best,
> Ihor
>
> Gerardo Moro  writes:
>
> > Hi again,
> >
> > I actually now realized that your function will not unfortunately archive
> > each logged item (those located in the logbook) in its corresponding date
> > (!).
> > What it will do is to archive the whole tree under today's date without
> > deleting it from the original org file.
> >
> > For instance,
> >
> > * TODO REPEATED TASK SAMPLE
> >   SCHEDULED: <2020-11-30 Mon +20d>
> >   :PROPERTIES:
> >   :STYLE:habit
> >   :LAST_REPEAT: [2020-11-09 Mon 22:28]
> >   :END:
> > :LOGBOOK:
> > - State "DONE"   from "TODO"   [2020-11-15 Sun 22:28]
> > - State "DONE"   from "STARTED"[2020-11-14 Sat 22:17]
> > - State "DONE"   from "STARTED"[2020-11-13 Fri 22:17]
> > - State "DONE"   from "STARTED"[2020-11-11 Wed 22:17]
> >
> > If I position myself in any point in this entry, when I execute the
> > function it will archive the whole tree+subtree under today's date (the
> > date when it was archived).
> > The behaviour I was expecting is to archive each of the logged tasks
> under
> > their corresponding date (on the 11th, 13th, 14th and 15th of November).
> > Just to be clear :)
> > G
> >
> > El lun., 16 nov. 2020 a las 17:21, Gerardo Moro (<
> gerardomor...@gmail.com>)
> > escribió:
> >
>


Re: Archiving repeated tasks under corresponding date tree for each repeated item

2020-11-17 Thread Gerardo Moro
Hi again,

I actually now realized that your function will not unfortunately archive
each logged item (those located in the logbook) in its corresponding date
(!).
What it will do is to archive the whole tree under today's date without
deleting it from the original org file.

For instance,

* TODO REPEATED TASK SAMPLE
  SCHEDULED: <2020-11-30 Mon +20d>
  :PROPERTIES:
  :STYLE:habit
  :LAST_REPEAT: [2020-11-09 Mon 22:28]
  :END:
:LOGBOOK:
- State "DONE"   from "TODO"   [2020-11-15 Sun 22:28]
- State "DONE"   from "STARTED"[2020-11-14 Sat 22:17]
- State "DONE"   from "STARTED"[2020-11-13 Fri 22:17]
- State "DONE"   from "STARTED"[2020-11-11 Wed 22:17]

If I position myself in any point in this entry, when I execute the
function it will archive the whole tree+subtree under today's date (the
date when it was archived).
The behaviour I was expecting is to archive each of the logged tasks under
their corresponding date (on the 11th, 13th, 14th and 15th of November).
Just to be clear :)
G

El lun., 16 nov. 2020 a las 17:21, Gerardo Moro ()
escribió:

> Wow, I’m impressed by your help, you are very kind!
> I am also impressed by your researching skills, I gave a long go at trying
> to find some code online unsuccessfully.
>
> Yes, I agree that the agenda is a nice way to go to visualize my past
> events (with v A).
> My idea of not relying on the agenda interface is just to be free and have
> an archive org file with all my entries, easier to scroll from any device
> without the need of Emacs.
>
> As for the function to archive the individual repeated tasks into their
> corresponding tree:
> I’m not an emacs lisp programmer (or any kind of!). As I see, this
> function works only “at point”.
> The way I work is I mark tasks as DONE during a couple weeks, and then I
> call this function that tracks all my org file and archives all DONE /
> CANCELLED items.
> This is great because I don’t have to do it one by one.
>
> (defun my/org-archive-done-tasks-file ()
>   (interactive)
>   (org-map-entries
>(lambda ()
>  (org-archive-subtree)
>  (setq org-map-continue-from (outline-previous-heading)))
>  "TODO=\"DONE\"|TODO=\"CANCELED\\"" 'file))
>
> Do you think there is a way to combine these two functions so that when I
> call the fucntion, I get to archive all DONE/CANCELLED & repeated
> DONE/CANCELLED tasks (the latter without deleting the logged task or its
> respective heading)?
>
> Best,
> G.
>
> El jue., 12 nov. 2020 a las 12:28, Ihor Radchenko ()
> escribió:
>
>> > Hope it is clear now, thanks so much for any help!
>>
>> Sorry for not making my previous email more clear. I actually understood
>> what you want to achieve. My suggestion was rather an alternative
>> approach to "revisit the past" - you can always build agenda view for a
>> specific date (or range of dates) in the past. That way, you would not
>> need to look into archive file manually at all.
>>
>> On your actual question, I think I found some old reddit comment [1] that
>> may be relevant. The code provides a new command to archive an org
>> headline without actually deleting it. That way, you will get a copy of
>> your headline on the date of archival. Below is the original code with
>> me adding docstrings for more clarity.
>>
>> (defun my/org-archive-delete-logbook ()
>> "Delete LOGBOOK of the entry at point. It is obsolete once the copy of
>> the item is moved to the archive file."
>>   (save-excursion
>>(org-end-of-meta-data)
>>(let ((elm (org-element-at-point)))
>>  (when (and
>> (equal (org-element-type elm) 'drawer)
>> (equal (org-element-property :drawer-name elm) "LOGBOOK"))
>>(delete-region (org-element-property :begin elm)
>>   (org-element-property :end elm))
>>
>> (defun my/org-archive-without-delete ()
>> "Archive item at point, but do not actually delete it."
>>   (cl-letf (((symbol-function 'org-cut-subtree) (lambda () nil)))
>> (org-archive-subtree)))
>>
>> (defun my/org-archive-logbook ()
>> "Create an archive copy of subtree at point and delete LOGBOOK in the
>> first headline of the subtree."
>>   (interactive)
>>   (my/org-archive-without-delete)
>>   (my/org-archive-delete-logbook))
>>
>> I think you can modify the last function and call it in
>> org-trigger-hook, so that repeating items would be archived without
>> deleting every time you mark the item DONE.
>>
>> [1]
>

Re: Re: Agenda follow mode + indirect window settings

2020-11-17 Thread Gerardo Moro
Very nice! I don't know much elisp as I am a new Emacs user. What in short
would this code do? :)
Thanks a million!

El mar., 17 nov. 2020 a las 6:56, tumashu () escribió:

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> At 2020-11-17 12:52:06, "Kyle Meyer"  wrote:
> >Gerardo Moro writes:
> >
> >> Hi,
> >>
> >> I want my agenda to have follow-mode active when starting Emacs.
> >> I suppose this would do the trick?
> >>
> >> (setq org-agenda-start-with-follow-mode t)
> >> (setq org-agenda-follow-indirect t)
> >>
> >> 1) Do I need both? I have observed that having only the second one does
> not
> >> work.
> >
> >The first one causes new agenda buffers to start with
> >org-agenda-follow-mode enabled.  Even if it's not enabled initially, you
> >can toggle it with F.
> >
> >The second is in effect when org-agenda-follow-mode is enabled.
> >
> >> 2) Is there a way to make the "indirect" window populate the vertically
> >> existing window (I always work with the frame split in two vertically).
> >> Right now it shows in a very small window beneath the agenda.
> >
> >I think with the way things are written at the moment you're best bet
> >would be to try to rearrange afterwards (say with advice after
> >org-agenda-tree-to-indirect-buffer).  Ideally the current behavior would
> >be achieved in a way that would allow the user to control the result
> >with things like display-buffer-overriding-action and
> >display-buffer-alist, but I suspect that'd take a substantial rework.
>
> I use the below config, maybe useful...
>
>
> (define-key org-agenda-mode-map (kbd "SPC")
> 'eh-org-agenda-show-and-scroll-up)
> (define-key org-agenda-mode-map (kbd "")
> 'eh-org-agenda-show-and-scroll-up)
>
> (defvar eh-org-agenda-show-window-point nil)
> (defun eh-org-agenda-show-and-scroll-up ( arg)
>   (interactive "P")
>   (let ((win (selected-window)))
> (if (and (window-live-p org-agenda-show-window)
>  (eq this-command last-command))
> (progn
>   (select-window org-agenda-show-window)
>   (if (eq eh-org-agenda-show-window-point (window-point))
>   (progn
> (goto-char (point-min))
> (message "已经滚动到底,返回第一行!"))
> (ignore-errors (scroll-up))
> (setq eh-org-agenda-show-window-point (window-point
>   (org-agenda-goto t)
>   (org-show-entry)
>   (let ((org-indirect-buffer-display 'current-window))
> (org-tree-to-indirect-buffer)
> ;; 隐藏 indirect buffer
> (rename-buffer (concat " " (buffer-name
>   (if arg (org-cycle-hide-drawers 'children)
> (org-with-wide-buffer
>  (narrow-to-region (org-entry-beginning-position)
>(org-entry-end-position))
>  (org-show-all '(drawers
>   (setq org-agenda-show-window (selected-window)))
> (select-window win)))
>
>


Re: Agenda follow mode + indirect window settings

2020-11-17 Thread Gerardo Moro
Thanks a lot for this. Will think about it.

El mar., 17 nov. 2020 a las 6:52, Kyle Meyer () escribió:

> Gerardo Moro writes:
>
> > Hi,
> >
> > I want my agenda to have follow-mode active when starting Emacs.
> > I suppose this would do the trick?
> >
> > (setq org-agenda-start-with-follow-mode t)
> > (setq org-agenda-follow-indirect t)
> >
> > 1) Do I need both? I have observed that having only the second one does
> not
> > work.
>
> The first one causes new agenda buffers to start with
> org-agenda-follow-mode enabled.  Even if it's not enabled initially, you
> can toggle it with F.
>
> The second is in effect when org-agenda-follow-mode is enabled.
>
> > 2) Is there a way to make the "indirect" window populate the vertically
> > existing window (I always work with the frame split in two vertically).
> > Right now it shows in a very small window beneath the agenda.
>
> I think with the way things are written at the moment you're best bet
> would be to try to rearrange afterwards (say with advice after
> org-agenda-tree-to-indirect-buffer).  Ideally the current behavior would
> be achieved in a way that would allow the user to control the result
> with things like display-buffer-overriding-action and
> display-buffer-alist, but I suspect that'd take a substantial rework.
>


Re: Archiving repeated tasks under corresponding date tree for each repeated item

2020-11-16 Thread Gerardo Moro
Wow, I’m impressed by your help, you are very kind!
I am also impressed by your researching skills, I gave a long go at trying
to find some code online unsuccessfully.

Yes, I agree that the agenda is a nice way to go to visualize my past
events (with v A).
My idea of not relying on the agenda interface is just to be free and have
an archive org file with all my entries, easier to scroll from any device
without the need of Emacs.

As for the function to archive the individual repeated tasks into their
corresponding tree:
I’m not an emacs lisp programmer (or any kind of!). As I see, this function
works only “at point”.
The way I work is I mark tasks as DONE during a couple weeks, and then I
call this function that tracks all my org file and archives all DONE /
CANCELLED items.
This is great because I don’t have to do it one by one.

(defun my/org-archive-done-tasks-file ()
  (interactive)
  (org-map-entries
   (lambda ()
 (org-archive-subtree)
 (setq org-map-continue-from (outline-previous-heading)))
 "TODO=\"DONE\"|TODO=\"CANCELED\\"" 'file))

Do you think there is a way to combine these two functions so that when I
call the fucntion, I get to archive all DONE/CANCELLED & repeated
DONE/CANCELLED tasks (the latter without deleting the logged task or its
respective heading)?

Best,
G.

El jue., 12 nov. 2020 a las 12:28, Ihor Radchenko ()
escribió:

> > Hope it is clear now, thanks so much for any help!
>
> Sorry for not making my previous email more clear. I actually understood
> what you want to achieve. My suggestion was rather an alternative
> approach to "revisit the past" - you can always build agenda view for a
> specific date (or range of dates) in the past. That way, you would not
> need to look into archive file manually at all.
>
> On your actual question, I think I found some old reddit comment [1] that
> may be relevant. The code provides a new command to archive an org
> headline without actually deleting it. That way, you will get a copy of
> your headline on the date of archival. Below is the original code with
> me adding docstrings for more clarity.
>
> (defun my/org-archive-delete-logbook ()
> "Delete LOGBOOK of the entry at point. It is obsolete once the copy of
> the item is moved to the archive file."
>   (save-excursion
>(org-end-of-meta-data)
>(let ((elm (org-element-at-point)))
>  (when (and
> (equal (org-element-type elm) 'drawer)
> (equal (org-element-property :drawer-name elm) "LOGBOOK"))
>(delete-region (org-element-property :begin elm)
>   (org-element-property :end elm))
>
> (defun my/org-archive-without-delete ()
> "Archive item at point, but do not actually delete it."
>   (cl-letf (((symbol-function 'org-cut-subtree) (lambda () nil)))
> (org-archive-subtree)))
>
> (defun my/org-archive-logbook ()
> "Create an archive copy of subtree at point and delete LOGBOOK in the
> first headline of the subtree."
>   (interactive)
>   (my/org-archive-without-delete)
>   (my/org-archive-delete-logbook))
>
> I think you can modify the last function and call it in
> org-trigger-hook, so that repeating items would be archived without
> deleting every time you mark the item DONE.
>
> [1]
> https://old.reddit.com/r/orgmode/comments/dg43hs/can_i_archive_a_property_drawer/f3frk2n/
>
> Best,
> Ihor
>
> Gerardo Moro  writes:
>
> > Thanks, Ihor.
> > Indeed, that is an excellent feature of agenda. I use it sometimes  to
> > visualize what I have DONE during the week on the sopt.
> > What I aim to accomplish however is a more systematic log of all the DONE
> > tasks, this is, to have an archive file where to archive all tasks.
> > This file is in the format:
> >
> > 2020
> >2020-01-01 DONE task1
> >2020-01-12 DONE task2
> >2020-02-01 CANCELLED task3
> >
> > So it is indeed a datetree file where I can revisit the past :) if you
> will.
> > The problem with habits and repeated tasks is that they don't get
> archived
> > when DONE...
> > They get archived once the task is cancelled or completed as a whole, all
> > under the day the task stopped continuing, under which I have all the
> > logged individual completion.
> > It would be desirable to have each "completion" archived under its
> > corresponding datetree, it is more meaningful :)
> >
> > Hope it is clear now, thanks so much for any help!
> > GM
> > So even if I have beeng doing the task every wednesday for a year, it
> won't
> > be archived
> >
> > El mar., 3 nov. 2020 a las 7:53, Ihor Radchenko ()
> > escribió:
> >
> >

Agenda follow mode + indirect window settings

2020-11-12 Thread Gerardo Moro
Hi,

I want my agenda to have follow-mode active when starting Emacs.
I suppose this would do the trick?

(setq org-agenda-start-with-follow-mode t)
(setq org-agenda-follow-indirect t)

1) Do I need both? I have observed that having only the second one does not
work.
2) Is there a way to make the "indirect" window populate the vertically
existing window (I always work with the frame split in two vertically).
Right now it shows in a very small window beneath the agenda.

Thank you so much,
G


Re: Archiving repeated tasks under corresponding date tree for each repeated item

2020-11-12 Thread Gerardo Moro
Thanks, Ihor.
Indeed, that is an excellent feature of agenda. I use it sometimes  to
visualize what I have DONE during the week on the sopt.
What I aim to accomplish however is a more systematic log of all the DONE
tasks, this is, to have an archive file where to archive all tasks.
This file is in the format:

2020
   2020-01-01 DONE task1
   2020-01-12 DONE task2
   2020-02-01 CANCELLED task3

So it is indeed a datetree file where I can revisit the past :) if you will.
The problem with habits and repeated tasks is that they don't get archived
when DONE...
They get archived once the task is cancelled or completed as a whole, all
under the day the task stopped continuing, under which I have all the
logged individual completion.
It would be desirable to have each "completion" archived under its
corresponding datetree, it is more meaningful :)

Hope it is clear now, thanks so much for any help!
GM
So even if I have beeng doing the task every wednesday for a year, it won't
be archived

El mar., 3 nov. 2020 a las 7:53, Ihor Radchenko ()
escribió:

> > It would be great if each of these individual "task
> > happenings" were archived under the date and time they were completed
> > individually, and not just all as one block. This way I could get weekly
> > reviews that take those into account.
>
> What about trying to do your weekly review using org-agenda? You can
> show the task every day you complete it by enabling org-agenda-log-mode
> in your weekly agenda (v l). If your tasks are also archived regularly,
> you may also need "v A" to include archive files into agenda view.
>
> Best,
> Ihor
>
>
> Gerardo Moro  writes:
>
> > Dear all,
> >
> > I am resending this as I believe it's a useful concept to implement,
> > especially by those who track their tasks and do weekly/monthly reviews.
> >
> > When I archive a repeated task (let's say, a learning project of 15
> minutes
> > every Wednesday day for 2 months), the task gets archived in a date tree
> > all under the day it was closed (cancelled) as a whole. This means that
> all
> > the LOGGED individual instances of repetition are archived on the day the
> > project got completed. It would be great if each of these individual
> "task
> > happenings" were archived under the date and time they were completed
> > individually, and not just all as one block. This way I could get weekly
> > reviews that take those into account. Not sure if I made myself
> understood!
> > :))
> >
> > Thanks!
> > G
>


Archiving repeated tasks under corresponding date tree for each repeated item

2020-10-29 Thread Gerardo Moro
Dear all,

I am resending this as I believe it's a useful concept to implement,
especially by those who track their tasks and do weekly/monthly reviews.

When I archive a repeated task (let's say, a learning project of 15 minutes
every Wednesday day for 2 months), the task gets archived in a date tree
all under the day it was closed (cancelled) as a whole. This means that all
the LOGGED individual instances of repetition are archived on the day the
project got completed. It would be great if each of these individual "task
happenings" were archived under the date and time they were completed
individually, and not just all as one block. This way I could get weekly
reviews that take those into account. Not sure if I made myself understood!
:))

Thanks!
G


Archiving repeated tasks under corresponding date tree for each repeated item

2020-10-23 Thread Gerardo Moro
Dear all,

When I archive a repeated task (let's say, a learning project of 15 minutes
every Wednesday day for 2 months), the task gets archived in a date tree
all under the day it was closed (cancelled) as a whole. This means that all
the LOGGED individual instances of repetition are archived on the day the
project got completed. It would be great if each of these individual "task
happenings" were archived under the date and time they were completed
individually, and not just all as one block. This way I could get weekly
reviews that take those into account. Not sure if I made myself understood!
:))

Thanks!
G