Cannot manage to match property - org-mode

I have a orgmode file that looks like this :
* Amanda
:PROPERTIES:
:ID: Amanda
:AMTYPE_ALL: IMPROVEMENT DEBUG NewFUNCTIONS
:AMTOOLS_ALL: MINIDB DOCPUBLISH TABLES CONSOLIDATION
:AMMAN_ALL: HMI TOOLS PROCESS
:END:
** Todo
*** TODO Evensong's magisterial work on the Amazon :science:read:BIB:
SCHEDULED: <2010-11-20 Sat>
[2010-11-16 Tue 23:11]
:PROPERTIES:
:BIB_AUTHOR: Walter Evensong
:BIB_TITLE: Mysteries of the Amazon
:BIB_PAGES: 1234
:BIB_PUBLISHER: Humbug University Press
:END:
Lots of good stuff on Brazil.
*** TODO 2 :science:read:BIB:
SCHEDULED: <2010-11-20 Sat>
[2010-11-16 Tue 23:11]
:PROPERTIES:
:BIB_AUTHOR: Walter Evensong
:BIB_TITLE: Mysteries of the Amazon
:BIB_PAGES: 1234
:BIB_PUBLISHER: Humbug University Press
:END:
Lots of good stuff on Brazil.
I would like to search first for : BIB_AUTHOR="Walter Evensong" but the following sequence leads to a blank buffer :
C-c a m
Type in minibuffer :
BIB_AUTHOR="Walter Evensong"
Result :

Two things:
C-c a m acts on agenda files, so make sure that the file is an agenda file. If it is not, you can add it temporarily with C-c [. Use C-c ] to remove it from the agenda file list afterwards if desired.
IIRC, the search string has to be inside single quotes.

Related

Hide org todo state changes in drawer or properties

How do I setup my org tree to store the TODO state changes into a drawer. The Logbook drawer works fine. The problem is that when i do a repeating entry each day it logs that. Making a huge tree under the tasks. Anyone know how to store this in :PROPERTIES: or another such drawer so that I still have this data, but it is not visible automatically?
Here is an example of it in my org file.
** TODO Weekly Review/Inbox Review (Planning)
DEADLINE: <2020-09-21 Mon ++1w>
:PROPERTIES:
:LAST_REPEAT: [2020-09-08 Tue 09:22]
:Effort: 0:30
:END:
- State "DONE" from "TODO" [2020-09-08 Tue 09:22]
- State "DONE" from "TODO" [2020-09-02 Wed 09:02]
I wish this was formated like this
** TODO Weekly Review/Inbox Review (Planning)
DEADLINE: <2020-09-21 Mon ++1w>
:PROPERTIES:
:LAST_REPEAT: [2020-09-08 Tue 09:22]
:LOGTODOCHANGEDRAWER:
- State "DONE" from "TODO" [2020-09-08 Tue 09:22]
- State "DONE" from "TODO" [2020-09-02 Wed 09:02]
:Effort: 0:30
:END:
I don't care if it is in properties but I do not want these state changes listed 300times over again in plain text...it is very ugly
TLDR
M-x customize-variable [RET] org-log-into-drawer
Set value of org-log-into-drawer to "LOGBOOK"
Background
After Digging through the org manual I was able to come up with a solution. There is not an exact example within the manual, but by reading it you will likely get the understanding required to figure the solution out yourself. As always, just read through it if you have time and make sure that it all makes sense generally. Here is a link to page that is most closely related.
https://orgmode.org/org.html#Tracking-TODO-state-changes
https://orgmode.org/org.html#Drawers
When using org-mode the style of tacking I was using for repeating tasks was habit. In the example below I have applied that explicitly through the properties drawer.
When tracking a variable with org-habit there are 4 options for storage of logging. Each time the todo state change happens org-habit was logging the state change 'outside of a drawer'; which means that when the item is opened all of the state changes appear in plain text. By default this is the setup. There are 3 options currently available.
To view these options go to customize-variable buffer for the "Org Process Group" inside of that you will find "Org Log Into Drawer" to get the todo state changes to write to the "Logbook" simply change to "logbook"
In summary we could write out the initialization file to store in logbook using:
METHOD 1: define globally using init.el
;; write todo state changes into LOGBOOK drawer
(setq org-log-into-drawer LOGBOOK)
## METHOD 2: define for a specific tree
* TODO test
DEADLINE: <2020-09-22 Tue ++1w>
:PROPERTIES:
:STYLE: habit
:LOG_INTO_DRAWER: t
:LAST_REPEAT: [2020-09-08 Tue 10:41]
:END:
:LOGBOOK:
- State "DONE" from "TODO" [2020-09-08 Tue 10:41]
- State "DONE" from "TODO" [2020-09-08 Tue 10:40]
:END:
Method 3
set this as provided by other contributor and both the state changes and the timer logs are placed inside the drawer.
;;; inside init.el
(setq org-log-done t)
Normally I too would suggest the manual, but this actually is one example I found outside the manual. I found the answer:
(setq org-log-done t)
here.
Interestingly, t isn't even one of the options in the customization choices for this variable and yet it does work to put not only timelogs into the :LOGBOOK: drawer, but also state changes. Normally I go read the source code to see why that is the case, but I can't be bothered at the moment - it works. Prior to changing this myself, I was using one of the customization options of 'time to only put clocking (and not state changes) in :LOGBOOK:, but I prefer this setting to tidy things up.

org mode repeated task up to a certain date/after x number of occurrences

I am new to org-mode, and I am currently learning how to use the habit/TODO features. I would like to add a repeated task that will stop after a certain number of occurrences, or up to a certain date.
If I look here, it seems I can use :PROPERTIES: as in
** TODO Shave
SCHEDULED: <2009-10-17 Sat .+2d/4d>
:PROPERTIES:
:STYLE: habit
:LAST_REPEAT: [2009-10-19 Mon 00:36]
:END:
However, C-c C-x p does not give me LAST_REPEAT option, and I was wondering what I can do.
The "LAST_REPEAT" property records when the habit was last done, it isn't "repeat up to this date". AFAICT there isn't a way of specifying to repeat something N times or up until a specific date.
When you press TAB at the Property: prompt, you get a list of possible completions, but you are not limited to them. You can always type LAST_REPEAT at the Property: prompt (and it will add it to the completion list as well).

org-mode habit consistency graph not displaying

org-version 8.3.4 (elpa package, 20160530)
emacs 24.4.1 (Debian package, Installed: 24.4+1-4.1~bpo70+1)
When I started using org-mode from elpa, the habit consistency graph stopped showing. I was using a version of org-mode that comes with debian before, with emacs 23 and the graph showed.
I'm a beginner in emacs lisp, but anyway I tried stepping through the org-agenda-list function and found the org-agenda-finalize function where the org habit graph is supposed to be inserted via the org-habit-insert-consistency-graphs function. But it skips over that function, probably because this expression returns false:
(next-single-property-change (point-min) 'org-habit-p))
At this point, I don't know what to do to make habits show. This is the first time I've looked at org-mode code, I don't know what the above test is for.
Help, please?
UPDATE: 2016-06-25. I upgraded the org-mode package to elpa, 20160620 (still org-version 8.3.4). Still have the same behaviour. I am getting the package from elpa.gnu.org.
UPDATE 2: 2016-07-02: I did try pressing K (for org-habit-toggle-habits). It didn't change the contents of the buffer visibly. I also tried refreshing the buffer after typing K. And repeating the experiment, in case the K put emacs in the wrong mode the first time.
UPDATE 3: 2016-07-08: on the emacs-orgmode mailing list, I got advice to ensure that the structure of the entries with habits is:
headline
SCHEDULED
PROPERTIES
everything else
by using this function org-repair-property-drawers from this site:
http://orgmode.org/Changes.html
but that broke my weekly agenda display and also, once I fixed the entries, didn't make the habits work. Probably my entries were in worse shape than the function anticipated. But this method worked for Josiah who sent the advice. Including it here in case it helps someone else.
UPDATE 4: 2016-07-09: thanks Phil for the suggestion to make a minimal example of the problem. With the following .org file and no other, I see the problem:
** TODO daily customer meeting :SUPPORT:CUSTOMER:
:SCHEDULED: <2016-07-06 Wed 10:30 .+1d>
:PROPERTIES:
:LAST_REPEAT: [2016-07-05 Tue 12:00]
:STYLE: habit
:END:
:LOGBOOK:
- State "DONE" from "TODO" [2016-07-05 Tue 12:00]
- State "DONE" from "TODO" [2016-06-30 Thu 16:34]
- State "DONE" from "TODO" [2016-06-29 Wed 20:02]
- State "DONE" from "TODO" [2016-06-28 Tue 10:53]
- State "DONE" from "TODO" [2016-06-27 Mon 10:50]
- State "DONE" from "TODO" [2016-06-23 Thu 12:11]
- State "CANCELLED" from "TODO" [2016-06-21 Tue 13:43] \\
No meeting today, cancelled by Mmmm.
:END:
I'm using the minimal.emacs suggested in the link, namely:
(add-to-list 'load-path (expand-file-name "/home/bjb/.emacs.d/elpa/org-20160620"))
(add-to-list 'auto-mode-alist '("\\.\\(org\\ |org_archive\\|txt\\)$" . org-mode))
(setq org-agenda-files '("/home/bjb/.emacs.d/test/test.org"))
(require 'org-install)
(require 'org-habit)
;(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
;(global-set-key "\C-cb" 'org-iswitchb)
And showing the agenda with C-c a a.
I had added the leading colon to the SCHEDULED line... when I remove it, the graph shows up. However, I had added it (a while ago) because I was trying to solve other problems, which I don't remember what they were.
I will play with this, and see if I can get all my org files to load fully with habit-consistency-graphs. Thanks ... will report back with results.
Must note that when I looked at this particular item (which is a short version of an actual habit in my org-files) there were two PROPERTY drawers, one before LOGBOOK with just the LAST-REPEAT property, and one after LOGBOOK with the habit property. I merged the two property drawers to show you the failure, as I believe the PROPERTY drawer is supposed to be in one piece before the LOGBOOK drawer. So I have some maintenance to do on my org-files. I had tried to merge them into one piece in each habit before, but then agenda weekly view broke badly and I put it back the way it was. Will have to try harder.
UPDATE 5 2016-07-09: I had put in the leading colon before SCHEDULED: because I wanted to see when the 3-monthly items fell in the future ... I wanted to see them as scheduled items. That worked but when I upgraded org-mode the consistency graph went away. When I took off the leading colon on all the habits, the daily habits showed up, and I have confidence that the three-monthly items will show up when they fall on "today". But I won't get any notice of having to pay the interest ... it will just appear on the day it must be paid. Well that is for me to figure out.
Thanks everyone for considering and answering my question.
I had a similar problem today, and it turns out that somehow the habit module was turned off (but the recurrent tasks still stays in the agenda so I didn't make the connection). When I re-enable the module (M-x customize variable org-modules then tick on habit), the consistency graph displays as normal in the agenda's view.
This won't solve your issue but might help a bit:
http://orgmode.org/worg/org-faq.html#minimal-emacs
Maybe you have turned them off somehow? Does pressing 'K' in the agenda help?
I've had the same problem after upgrading org-mode from version 8.2.10 to 9.1.9 (because of this bug).
Here is what an entry was looked like (org-version = 8.2.10) :
** TODO Sleep in time
SCHEDULED: <2019-09-07 sam. 23:00 +1d>
- State "DONE" from "TODO" [2019-09-07 sam. 02:54]
- State "DONE" from "TODO" [2019-09-06 ven. 02:09]
- State "DONE" from "TODO" [2019-09-05 jeu. 00:29]
:PROPERTIES:
:STYLE: habit
:LAST_REPEAT: [2019-09-07 sam. 02:54]
:END:
... and what i've done so that the graph show up again (org-version = 9.1.9) :
** TODO Sleep in time
SCHEDULED: <2019-09-07 sam. 23:00 +1d>
:PROPERTIES:
:STYLE: habit
:LAST_REPEAT: [2019-09-07 sam. 02:54]
:END:
- State "DONE" from "TODO" [2019-09-07 sam. 02:54]
- State "DONE" from "TODO" [2019-09-06 ven. 02:09]
- State "DONE" from "TODO" [2019-09-05 jeu. 00:29]
As it's showed, I've swapped up the PROPERTIES drawer and the "log" list.
EDIT:
I just realised that this solution is exactly the same as #schmuu suggested (I don't use LOGBOOK drawer). I got the same conclusion by creating a repeating entry and marked it as done in the agenda view. The "log" item list had appeared after the PROPERTIES drawer.

How to view the taken "Notes" in a new buffer in Emacs Org Mode?

I use Emacs Org mode to deal with my daily staffs. Now I use Emacs to manage some research papers. When reading the papers, I would like to take some notes as the following using the shortcut key C-c C-z or only z in the Agenda View.
When taking a new note it looks like this:
However, after completing the note taking with C-c C-c, the note is stored in the LOGBOOK under where it was taken:
The first problem is that the note itself is not highlight. The second problem is that, if I would like to revise this note, I do not know how to display it as when it was taken(just as in the first picture above, in a new buffer with highlight). It seems that I could only revise this note under the "Note taken on ..." line with no highlight plain text.
However, I am not pleased with this editing method since it should be as the same as the first picture, i.e., when the note was first created.
Thanks for your attention and help.
In addition to using subtasks (as discussed in the comments underneath the initial question in this thread), here is an alternative approach that places the notes at the tail end of a task without any blank lines between sentences. The stock org-mode has the ability to handle this -- i.e., no modifications are required (other than keywords and priority settings)
** Active [#A] 0 # Ender's Game (Orson Scott Card). :lawlist:
DEADLINE: <2014-02-22 Sat 08:00> SCHEDULED: <2014-02-22 Sat>
:PROPERTIES:
:ToodledoID: 353081871
:ToodledoFolder: TASKS
:Hash: 680920196368d9f25c95c09063243a7f
:END:
• This novel was of particular interest because . . .
• Orson Scott Card has written other books . . .
• Compare and contrast Ender's brother and sister.
(source: lawlist.com)
(source: lawlist.com)

Show only notes in org-mode without org-mode-related info?

How can I get just the notes from org-mode heading without any "technical" stuff?
I mean, I want something like that
* Some project
- some note 1
- some note 2
** some chapter
- another note
- noooote
** TODO some big todo
- something to note for the task
- another thing
** some chapter
instead of that
* Some project
- some note 1
- some note 2
** some chapter
- another note
- noooote
** TODO some big todo
CLOSED: [2011-11-10 Thu 19:51]
- State "DONE" from "STARTED" [2011-11-10 Thu 19:51]
CLOCK: [2011-11-10 Thu 19:33]--[2011-11-10 Thu 19:51] => 0:18
CLOCK: [2011-11-04 Fri 15:29]--[2011-11-04 Fri 15:29] => 0:00
:PROPERTIES:
:Effort: 0:30
:END:
[2011-11-04 Fri 15:29]
- something to note for the task
- another thing
** some chapter
EDIT: I figured out I can accomplish that using exports (with #+OPTIONS: <:nil d:nil), but its not really convenient - I mean, I need to press Ctrl-c Ctrl-e u, then switch to new buffer Ctrl-b temp-buffer, then delete everything from it Ctrl-x h Ctrl-w, then add my export Ctrl-y Meta-y. Thats a LOT of keys to press.
Besides that, I couldn't get rid of stuff like - State "DONE" from "STARTED" [2011-11-10 Thu 19:51] because formally it is just a note - exactly the thing I "wanted" to keep.
Although you'll need to manually repair much of your existing org-document, the solution would be to use Logbook drawers.
To file your todo-state changes into a drawer (default to LOGBOOK) you can use (see Tracking TODO state changes): (setq org-log-into-drawer t) or :LOG_INTO_DRAWER: t as a property on the headline.
You can also use (setq org-clock-into-drawer t) to place all your CLOCK: lines into the :LOGBOOK: as well. If you want your clocking to go in a separate value, replace t with the string you want as your drawer title (e.g. (setq org-clock-int-drawer "CLOCK")
Then when you export your #+OPTIONS: d:nil will prevent any of those drawers from being exported, so none of that information will appear.