Re: [O] keyword :html-postamble-format seems to not be used

2018-05-03 Thread Brady Trainor
Brady Trainor  writes:
> [...]

However, since `:html-postamble` accepts a function, I found it straightforward 
to take a bit from the source code and write the following,

#+begin_src emacs-lisp
:html-postamble
(lambda (info) (format
"%s: %s\n"
(org-html--translate "Created" info)
(format-time-string
 (plist-get info :html-metadata-timestamp-format
#+end_src

-- 
Brady



[O] keyword :html-postamble-format seems to not be used

2018-05-03 Thread Brady Trainor
Looking at source of `org-html--build-pre/postamble`, I think `:html-postamble 
t` does check `org-html-postamble-format`, but I'd like it to check 
`:html-postamble-format` as well.

I encountered this problem as I'm trying to remove the validate string in the 
postamble, which `:html-postamble auto` will always include.

Not sure if there's a way to still keep the result of `:time-stamp-file` with 
`:html-postamble t`. That is, retain the inserted `Created: ...` string.

-- 
Brady



Re: [O] Bug: org-capture template expansion "%x" stopped working

2018-04-21 Thread Brady Trainor

Nicolas Goaziou  writes:


I think this is now fixed. Thank you.


Yes, I see it as fixed, tested with git clone which gave me:

Org mode version 9.1.10 (release_9.1.10-619-g02e290 @ 
/Users/iam/.emacs.d/lisp/org-mode/lisp/)


Thank you.

--
Brady



[O] Bug: org-capture template expansion "%x" stopped working

2018-04-21 Thread Brady Trainor

The issue at following thread seems to have resurfaced

https://lists.gnu.org/archive/html/emacs-orgmode/2016-07/msg00490.html

If I run the following

--8<---cut here---start->8---
emacs -Q -nw --eval "(progn (setq org-capture-templates '((\"t\" 
\"Task\" entry (file \"/tmp/test.org\") \"%x\"))) (org-capture nil 
\"t\"))"

--8<---cut here---end--->8---

I see in Messages

--8<---cut here---start->8---
org-capture: Capture abort: (wrong-type-argument char-or-string-p 
nil)

--8<---cut here---end--->8---

Emacs and org versions

--8<---cut here---start->8---
GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin17.4.0, NS 
appkit-1561.20 Version 10.13.3 (Build 17D102)) of 2018-04-11
Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ 
/usr/local/Cellar/emacs/HEAD-57442b6/share/emacs/27.0.50/lisp/org/)

--8<---cut here---end--->8---

Thank you,

--
Brady



Re: [O] Rescheduling timestamps on a headline (not the next line)

2015-10-22 Thread Brady Trainor

Michael Hoffman  writes:
>
> Thanks Matt. Is there a supported way to have planning info show up on
> the same line as the headline in the org file itself (rather than in
> an agenda)? This can be very handy when organizing a lot of items to
> have them all show up on the screen.

One option is column view. 

For overview of relevant info, try (info "(org) Properties and Columns").

Can get there with C-h i d m org RET 7.

The section (info "(org) Column view") you'll find information on column view, 
and (info "(org) Special properties") you'll find a list of properties 
available.

TLDR version:

C-c C-x C-v to enable column view. S-M- to insert a column. Press TAB 
after S-M- to get autocompletion list, where you'll see items like 
TIMESTAMP, SCHEDULED and DEADLINE.

You can still TAB on headlines to cycle visibility and edit section bodies. 

HTH :)

--
Brady




[O] feature request: simulate agenda view as if another day

2015-09-16 Thread Brady Trainor
Hello,

For some reason, thought crossed my mind to use this in trying out agenda 
views. And I thought for some reason this functionality existed, though I was 
probably thinking of something else I had seen about a year ago. But so, ideas 
are ideas, so I offer it here.

So the feature I am imagining, is that you can view the agenda view /as if/ it 
was another day. Not so much the ability to view another day, but for instance, 
even to view /today's/ schedule, as if it was /tomorrow/ for example.

I guess some hack could be made with Emacs' `current-time', but I didn't go 
hacking, and someone suggested at least to offer the idea on the mailing list.

So there we are.

Regards! 

--
Brady




Re: [O] org-html-use-unicode-chars breaks source code blocks

2015-08-17 Thread Brady Trainor
Hello,

Nicolas Goaziou  writes:

> Hello,
>
> Brady Trainor  writes:
>
>> Speaking of COMMENT, I had noticed some strange behavior if I have a
>> state like COMMENTED_OUT.
>>
>> If I have a header like =#+TODO: TODO COMMENTED_OUT | DONE=, and cycle
>> through state with S-, it gets pretty wonky.
>
> Could you elaborate a bit? I cannot reproduce anything suspicious except
> a minor fontification glitch.
>
>
> Regards,

Ah, I should have checked 8.3... This is on 8.2.10 that it was doing this. In 
8.2.10, as states were passed through, I could see several different all-caps 
states in one headline at once, though only one would be highlighted.

I guess on 8.3, it is just that COMMENT of COMMENTED_OUT would be highlighted, 
leaving ED_OUT unhighlighted. I am guessing that is what you are seeing. 

--
Brady






Re: [O] org-html-use-unicode-chars breaks source code blocks

2015-08-16 Thread Brady Trainor
Speaking of COMMENT, I had noticed some strange behavior if I have a state like 
COMMENTED_OUT. 

If I have a header like =#+TODO: TODO COMMENTED_OUT | DONE=, and cycle through 
state with S-, it gets pretty wonky. For now, I simply use COMMENT 
when I have a section I want to consider as commented out, but ideally this can 
behavior can be different? 

Always true, but I haven't been on the mailing list for a spell, so, big thanks 
to all who contribute to this software. 

Bastien Guerry  writes:

> Andreas Leha  writes:
>
>> So, even if there is probably not a high risk for the COMMENT keyword to
>> be dropped I just wanted to express my support for it.
>
> COMMENT will stay, for sure.

-- 
Brady




[O] Get html links relative to base directory for Jekyll site

2014-11-21 Thread Brady Trainor

Can I get org publishing to change paths of links? Jekyll system seems to work 
better if image links start from base. 

I want

#+BEGIN_SRC org
file:../img/jekyll.png
#+END_SRC

(or something similar, "../img/" could be "img/" or "./img/")

to become

#+BEGIN_HTML

#+END_HTML

in the published HTML file. 

That is, the address should start "/img/".

Or perhaps another solution, a function which makes org contents

#+BEGIN_SRC org
file:../img/jekyll.png
#+END_SRC

become

#+BEGIN_SRC org
file:../img/jekyll.png

,#+BEGIN_HTML

,#+END_HTML
#+END_SRC

In other words, can I get the HTML link as a result in the org buffer. Simply 
adding a "/" here would be simple. Or somethink like cd-latex for html links?

Or does anyone have another solution for including links in a Jekyll site? I 
really like to have the inline org file: link as then I can use inline images 
while I'm drafting. 

--
Brady




Re: [O] Customize org-todo-repeat-to-state to return to previous TODO state

2014-11-21 Thread Brady Trainor
Grant Schissler  writes:

> Hi Org-mode Users,
>
> I am trying to change the behavior of marking a repeated task as DONE.  I 
> would like the task to return to the current TODO state rather than the first 
> in 
> the TODO sequence or a fixed state.  For example,
>
> ** APPT Lunch with Mallorie
> <2014-12-04 Thu 12:00 +1w>
>
> should return to APPT, not TODO or some other predefined state as in the 
> current behavior:
>
> TODO Lunch with Mallorie
> - State "DONE"   from "APPT"   [2014-11-21 Fri 10:56]
> <2014-12-11 Thu 12:00 +1w>
>
> I am sure that customizing the org-todo-repeat-to-state will do the trick, 
> but 
> sadly, I have had the time to learn elisp well enough to perform this.
>
> Any help would be much appreciated.  Please let me know if you have 
> questions.
>
> Thanks for the support and to all those that make org-mode great!
> Grant

I haven't tried any of the following, and there may be better solutions, but...

It looks like the variable you mention reads as (via C-h v 
org-todo-repeat-to-state RET and follow link to source), 

#+BEGIN_SRC emacs-lisp
(defcustom org-todo-repeat-to-state nil
  "The TODO state to which a repeater should return the repeating task.
By default this is the first task in a TODO sequence, or the previous state
in a TODO_TYP set.  But you can specify another task here.
alternatively, set the :REPEAT_TO_STATE: property of the entry."
  :group 'org-todo
  :version "24.1"
  :type '(choice (const :tag "Head of sequence" nil)
 (string :tag "Specific state")))

#+END_SRC

It looks like this variable will not allow to recall the previous TODO state. 
But you could make a separate TODO_TYP set.

Depending on whether you define your TODO states in an init file or per-file 
base, you could try an extra line in your org file "header",

#+BEGIN_SRC org
,#+TYP_TODO: APPT | DONE
#+END_SRC

or an extra block in your org-todo-keywords variable

#+BEGIN_SRC emacs-lisp
(setq org-todo-keywords '((type "APPT" "|" "DONE")))
#+END_SRC

Another solution according to the above would be to use a property drawer, 

#+BEGIN_SRC org
,** APPT Lunch with Mallorie
<2014-12-04 Thu 12:00 +1w>
:PROPERTIES:
:REPEAT_TO_STATE: APPT
:END:
#+END_SRC

You can get this via C-c C-x p repeat_to_state RET APPT RET.

Interestingly, there is a function in the same source file, 
org-auto-repeat-maybe, which suggests that it does exactly what you ask for. 

#+BEGIN_EXAMPLE
org-auto-repeat-maybe is a compiled Lisp function in `org.el'.

(org-auto-repeat-maybe DONE-WORD)

Check if the current headline contains a repeated deadline/schedule.
If yes, set TODO state back to what it was and change the base date
of repeating deadline/scheduled time stamps to new date.
This function is run automatically after each state change to a DONE state.

[back]
#+END_EXAMPLE

I can see in the definition of the function it has an expression 
org-last-state, so maybe that suggests there is a way built-in (or intended 
to?), but I only took that quick look at the source. 

--
Brady



Re: [O] Executing org shell blocks on remote machine over ssh

2014-11-18 Thread Brady Trainor
Ista Zahn  writes:

[snip]
> I guess I'm missing something (like why the OP want's to run a shell
> in a separate window), but why not just
>
> #+BEGIN_SRC sh :results output :dir /ssh:lycastus:/home/bviren :session 
> *shell*
>   /bin/pwd
>   echo $HOSTNAME
>   ls -l foo.sh
>   echo "---"
>   cat foo.sh
>   echo "---"
>   source ./foo.sh
>   echo $FOO
> #+END_SRC

Tangentially related... 

*term* looks nice too (M-x term instead of M-x shell). This `term' is like a 
more literal terminal embedded in Emacs. Even key-bindings are hijacked. 
(Amusingly, readline utility gives bash some Emacs-like key-bindings.) In a 
stackoverflow question, it is pointed out that *term* versus *shell*, you miss 
out on features like isearch (C-s, C-r etc.). Then, switching around a lot is 
hindered, since C-x o (other-window) is hijacked (but the suggested windmove 
binding still works). 

--
Brady




Re: [O] org-mode pretty entities has \perp but not \parallel

2014-11-18 Thread Brady Trainor
Rasmus  writes:

> Brady Trainor  writes:
>
[ snip ]
>> #+BEGIN_SRC emacs-lisp
>> ("parallel" "\\parallel" t "∥" "||" "||" "%")
>> #+END_SRC
>
> Except the ∥ that was somehow eaten in your snip (but OK below).

Hmm, not sure where that happened, I'll have to look out for that when I'm 
emailing unicode parallel lines again. :)

>
>> I also tried to add something like
>>
>> #+BEGIN_SRC 
>> ("|" "\\\|" t "∥" "||" "||" "%")
>> #+END_SRC
>>
>> with "\\\|" or "\\|", but it wasn't working for me. I didn't see any
>> non-alphabetical entities ("name") in the variable org-entities-user,
>> so I was guessing it wouldn't work with a one-line edit.
>
> I think they are not the same.  I'd use $\|x\|_2$ for a norm, say.
> Parallel is a relation: $a\parallel b$.

Ah yes. Now this \| makes more sense. 

>
>> Is the patch okay? I simply used C-x s d (C-g C-x b *Diff* RET).
>
> If you want to go "all in", which is a lot of fun, you have to submit a
> TINY PATCH:
>
>  http://orgmode.org/worg/org-contribute.html
>
> Otherwise, I'm happy to submit it for you (though I'm not sure if
> something like this would go to maint or master...?)
>
> —Rasmus

Yes please do submit when you have the time, though I will try to get closer to 
being setup for this when I can. (E.g., I'm currently on Elpa Org-mode... and 
my commits are mostly linear for personal files.) 



Re: [O] org-mode pretty entities has \perp but not \parallel

2014-11-18 Thread Brady Trainor
Rasmus  writes:

> Would you be interested in providing a patch?  You would have to add it
> to org-entities.el, e.g. after the perp entity and then send the patch
> to this list.
>

I think this works, I did try it, with M-x org-toggle-pretty-entities. (Re: 5th 
and 6th argument: Is "||" a good ASCII/Latin1 representation?) 

#+BEGIN_SRC emacs-lisp
("parallel" "\\parallel" t "∥" "||" "||" "∥")
#+END_SRC

I also tried to add something like

#+BEGIN_SRC 
("|" "\\\|" t "∥" "||" "||" "∥")
#+END_SRC

with "\\\|" or "\\|", but it wasn't working for me. I didn't see any 
non-alphabetical entities ("name") in the variable org-entities-user, so I was 
guessing it wouldn't work with a one-line edit. 

Is the patch okay? I simply used C-x s d (C-g C-x b *Diff* RET).

--
Brady

diff -c --label /home/iam/.emacs.d/elpa/org-20141027/org-entities.el --label 
\#\ 
/home/iam/.emacs.d/elpa/org-20141027/org-entities.el 
/tmp/buffer-content-1773597i
*** /home/iam/.emacs.d/elpa/org-20141027/org-entities.el
--- #
***
*** 394,399 
--- 394,400 
  ("ang" "\\angle" t "∠" "[angle]" "[angle]" "∠")
  ("angle" "\\angle" t "∠" "[angle]" "[angle]" "∠")
  ("perp" "\\perp" t "⊥" "[up tack]" "[up tack]" "⊥")
+ ("parallel" "\\parallel" t "∥" "||" "||" "∥")
  ("sdot" "\\cdot" t "⋅" "[dot]" "[dot]" "⋅")
  ("cdot" "\\cdot" t "⋅" "[dot]" "[dot]" "⋅")
  ("lceil" "\\lceil" t "⌈" "[left ceiling]" "[left ceiling]" "⌈")

Diff finished.  Tue Nov 18 00:35:31 2014




Re: [O] org-mode pretty entities has \perp but not \parallel

2014-11-17 Thread Brady Trainor

Hello, 

Rasmus  writes:

> Brady Trainor  writes:
>
>> Hi, I expected \parallel to work after success with \perp. That is,
>> I've executed in buffer M-x org-toggle-pretty-entities RET, and I
>> expected to see \parallel as unicode ∥, since \perp is overlayed
>> (correct term?) with ⟂.
>
> \parallel should be added IMO as it's supported by vanilla LaTeX.
>
> Would you be interested in providing a patch?  You would have to add it
> to org-entities.el, e.g. after the perp entity and then send the patch
> to this list.

I will start on this. 

--
Brady

>
>>  Though, the former is pretty hard to see, so maybe it was decided
>> against.
>
> Maybe you don't have a good font?  My Emacs picks it up from Biolinum.
>
> —Rasmus



Re: [O] cannot get an agenda showing logged todos, scheduled todos and clockcheck items at the same time

2014-11-17 Thread Brady Trainor

Hello, 

Rainer Stengele  writes:

> (agenda "todays agenda"
> (
>  (org-agenda-span 'day)
>  (org-agenda-log-mode 'clockcheck)
>  (org-agenda-start-with-log-mode t)
>  (org-agenda-overriding-header "Today's Agenda")))

I am not using this, so I won't be able to test it but... I did google 
clockcheck and check some of your variables. 

If I execute M-x apropos RET org agenda log mode RET, it appears this is a 
command not a variable, at least in my org-mode version 8.2.10.

A few lines down (in the apropos findings) I see `org-agenda-log-mode-items', 
which I think it should be a list, so for example

#+BEGIN_SRC emacs-lisp
(org-agenda-log-mode-items '(closed clock state))
#+END_SRC

Consider your thread http://thread.gmane.org/gmane.emacs.orgmode/74599 from 
July. There, Sebastien Vauban suggested the variable assignment

#+BEGIN_SRC emacs-lisp
(org-agenda-log-mode 'clockcheck)
#+END_SRC

Perhaps this is what you meant above. Or Mike McLean suggests, 

#+BEGIN_SRC emacs-lisp
(org-agenda-show-log 'clockcheck)
#+END_SRC

Then, at the end of the thread, Carsten Dominick advises against using these, 
and suggest instead to use these in the global section of your custom command. 

#+BEGIN_SRC 
(org-agenda-start-with-log-mode 'clockcheck)
(org-agenda-start-with-clockreport-mode t)
#+END_SRC

In summary, maybe you should have this:

#+BEGIN_SRC emacs-lisp
(setq org-agenda-custom-commands
  '(("Z" "todays agenda"
 ((agenda ""))
 ((org-agenda-span 'day)
  (org-agenda-start-with-log-mode 'clockcheck)
  (org-agenda-start-with-clockreport-mode t)
  (org-agenda-log-mode-items '(closed clock state))
  (org-agenda-overriding-header "Today's Agenda")
#+END_SRC

Further, I shifted some of the terms around. Note the `agenda' block usually 
takes the empty string, but it seems you gave it the name of the command. 

HTH

--
Brady

>
> Thank you.
> Regards, Rainer



[O] org-mode pretty entities has \perp but not \parallel

2014-11-16 Thread Brady Trainor

Hi, I expected \parallel to work after success with \perp. That is, I've 
executed in buffer M-x org-toggle-pretty-entities RET, and I expected to see 
\parallel as unicode ∥, since \perp is overlayed (correct term?) with ⟂. 
Though, the former is pretty hard to see, so maybe it was decided against.

I just tried exporting to HTML (and MathJax), and it looks like the LaTeX 
delimited symbols should be either $\parallel$ or $\|$. So simply writing $||$ 
in ones' notes would /not/ be the same.

,
| Org-mode version 8.2.10
| (8.2.10-1-g8b63dc-elpa
| @ /home/iam/.emacs.d/elpa/org-20141027/)
`

--
Brady




[O] project-explorer package forcing new frame... better solution than mine?

2014-11-14 Thread Brady Trainor

Hi, I'm trying the project-explorer package. It uses a persistent window for a 
browsing tree.

This causes a new frame when using any of org-export-dispatch, org-agenda-view 
menu, ibuffer-other-window, and org-insert-link. (My C-c C-e, C-c C-a, C-x C-b, 
C-c C-l.) 

I've made a solution for the export-dispatch (since I use project-explorer and 
org-export quite a bit for my Jekyll site). The solution is as follows:

#+BEGIN_SRC emacs-lisp
(add-hook 'project-explorer-mode-hook
  (lambda ()
(make-variable-frame-local 'org-export-dispatch-use-expert-ui)
(modify-frame-parameters nil '((org-export-dispatch-use-expert-ui . 
t)
#+END_SRC

The author of project-explorer asserts that this may be a problem with Org-mode 
or Emacs. 

Since this also appears with ibuffer-other-window, is this necessarily worth 
mentioning to the Emacs newsgroup?

Any ideas on a simpler solution than mine? 

--
Brady




[O] Newb me wrote bash script for TOC, for Org-mode in Github repos.

2014-11-11 Thread Brady Trainor

I think I have an okay bash script (below) for producing a TOC for notes I keep 
in Github in Org-mode format. It produce bulleted links like

#+BEGIN_SRC org
 - [[./fileA.org][fileA.org]]
 - [[./dir][dir/]]
  - [[./dir/fileB.org][fileB.org]]
#+END_SRC

I run this script from a README.org file in my Github repo. My interaction with 
Github is a little frustrating, I think an extra blank line after =#+RESULTS:= 
prevents Github from omitting the entire list.

Here is the script, it's more-or-less a very early program in my side project 
to learn programming. I think I have some inconsistencies in choosing to "" 
quote things. But it doesn't seem to be a problem. Hopefully I can learn Perl 
one day so I can do it in one line ;).

I would have written it in Emacs Lisp since that is where I intended to use it, 
but I am still a little intimidated to learn this. Perhaps I will try to 
convert this to Emacs Lisp as an exercise at some point.

Any comments are appreciated! (The choice of indentation as spaces is not the 
Org-mode convention (1,2,3... instead of 0,2,4...), but I choose simplicity in 
my scripts for now.) 

#+BEGIN_SRC emacs-lisp
(setq org-babel-sh-command "bash")
#+END_SRC

#+BEGIN_SRC sh :results scalar raw replace
#!/bin/bash
echo
PrevDepth=1
PrevDir="."
find -regex '.*\.org' |
while read file
do
Slashes="${file//[^\/]}"
Depth="${#Slashes}"
Dir=${file%/*}
if [[ $Depth -eq $PrevDepth &&  "$Dir" != "$PrevDir" ]] || \
   [[ $Depth -gt $PrevDepth ]]
then
for (( i=1 ; i <= Depth-1 ; i++ )); do echo -n ' '; done
echo "- [[$Dir][${Dir##*/}/]]"
fi
for (( i=1; i<=Depth; i++ )); do echo -n ' '; done
echo -n "- [[$file][${file##*/}]]"
echo
PrevDepth=$Depth
PrevDir=$Dir
done
#+END_SRC


--
Brady




Re: [O] What happened to ODT export?

2014-11-10 Thread Brady Trainor

Hello, 

Christopher Culver  writes:

> I am running org-mode 8.2.10 from elpa on Emacs 24.4. When I try to
> export to ODT format with the keystrokes described here:
>
> http://orgmode.org/manual/ODT-export-commands.html
>
> I get an error. Indeed, when I press C-c C-e, ODT is not even mentioned
> among the formats that I can export to, I am offered only iCalender,
> HTML, plaintext and LaTeX. I remember being able to easily export to ODT
> in the past. Has this functionality been removed or moved to a separate
> package?

I find the following: 

, [ C-h v org-export-backends RET ]
| org-export-backends is a variable defined in `org.el'.
| Its value is (ascii html icalendar latex md odt)
| Original value was 
| (ascii html icalendar latex)
`

In my init file, I have

--8<---cut here---start->8---
(setq org-export-backends 
  '(ascii
html
icalendar
latex
md
odt
))
--8<---cut here---end--->8---

Also, at top of buffer, I see

,
| Use SPC, DEL, C-n, or C-p to navigate.
`

Helpful if additional options are not visible. 

HTH

--
Brady



Re: [O] (noob) interactive template? how?

2014-11-05 Thread Brady Trainor
s a Bonsai tree. 

HTH

--
Brady


> Thanks to you, I was able to introduce an Org file to my recipe project
> and I am happy to have another use case for Org.
>
> Cheers! Sven.
>
> Am 04.11.2014 um 00:21 schrieb Brady Trainor:
>> Sven Ehret  writes:
>>
>>> Hello,
>>>
>>> sorry for my noob question. I searched the list but cannot find anything
>>> that would fit.
>>>
>> It's not clear how noob you are? To Emacs? To Org-mode?
>>
>> Do you know how to execute the emacs-lisp? Or otherwise insert into
>> your init file?
>>
>> Do you know that these functions are commands because of the
>> "(interactive)" lines, so can be called with M-x? Do you know the
>> M-x ALT+x deal?
>>
>> The functions look for a headline "* Recipe", so your org buffer
>> should have that first. M-x recipe-template will prompt for Titel
>> due to "read-string" (I type "M-x describe-function" with cursor on
>> "read-string" to read the documentation, or the more brief "C-h f").
>>
>> The command "food/gen-shopping-list" seems to look for an entry "*
>> Einkaufsliste", and headlines with "TOCOOK" state, but I did not
>> succeed in getting the command to work. Perhaps I should have had
>> some tabular data like can be found at
>> http://sachachua.com/blog/2012/06/emacs-org-grocery-lists-batch-cooking/.
>>
>> Hope this helps reshape your question at least. 
>>
>>> My question is: How would I use the template(s) on
>>> http://lebensverrueckt.haktar.org/articles/org-mode-Food/ ?
>>>
>>> Thank you for your attention!
>>>
>>> Best, Sven.



Re: [O] Sagemath with org-babel?

2014-11-04 Thread Brady Trainor
John Hendy  writes:

> (require 'sage-mode)

Thank you, this enabled me to at least have sage code blocks to mix into files 
for blog publishing. 

> #+begin_src test.org
>
> * header
>
> #+begin_src sage
> print "Hello World"
> print 2^3
> #+end_src
>
> #+end_src
>
> =C-c '= on the block gets me to a typical Org babel buffer, and I can
> =C-c C-c= in it and get results output to *Sage-main*.
>

I had to modify org-babel-load-languages to get C-c C-c to do something. But 
I'm not really sure what it did, or how to get it to work. But maybe this could 
wait till more people are showing interest here. 

>> (org-babel-do-load-languages 'org-babel-load-languages
>>  '((sage . t)
>>(emacs-lisp . t)
>>(latex . t)
>>(sh . t)))

--
Brady




Re: [O] Sagemath with org-babel?

2014-11-04 Thread Brady Trainor
Darlan Cavalcante Moreira  writes:

> I have done this in the past, I don't have the files anymore. However, as
> Tom says it is very easy to modify the templates to make org work with
> sage. I remember I only needed some search and replace to make it work.
>
> Also, you may want to have a look at sage-mode first if you haven't
> already.
> http://wiki.sagemath.org/sage-mode
>
> With sage mode installed its is a simple matter to make "C-c '" edit the
> source code in sage-mode.
>

I have tried "C-c '", but it did not work.

My attempt:

As suggested at https://bitbucket.org/gvol/sage-mode/src, I try

#+BEGIN_SRC sh
sudo sage -f sage_mode
#+END_SRC

After running this, the end of message includes the suggestion to add

#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path 
"/usr/lib/sagemath/local/share/emacs/site-lisp/sage-mode")
(require 'sage "sage")
(setq sage-command "/usr/lib/sagemath/sage")
#+END_SRC

But if I try =C-c '= in a block like

#+BEGIN_SRC sage
f(x) = x^2
integrate(f(x), 1, 3).n() 
#+END_SRC

I get

,
| org-edit-src-code: No such language mode: sage-mode
`

Also, I cannot publish to html in this way. 

_I tried copying ob-python.el to a file ob-sage.el and replacing all instances 
of "python" and "py" with "sage"._

I also tried

#+BEGIN_SRC emacs-lisp
(add-to-list 'org-src-lang-modes '("sage" . sage))
(org-babel-do-load-languages 'org-babel-load-languages
 '((sage . t)
   (emacs-lisp . t)
   (latex . t)
   (sh . t)))
#+END_SRC

But it still tells me "No such language mode: sage-mode". 

Thoughts? 

--
Brady


>
> --
> Darlan
>
> At Mon, 06 Aug 2012 11:33:47 -1000,
> t...@tsdye.com (Thomas S. Dye) wrote:
>> 
>> Aloha Johan,
>> 
>> Babel can be configured to support new languages, see
>> http://orgmode.org/worg/org-contrib/babel/languages.html#develop
>> 
>> Someone will need to write language specific functions to support code
>> block evaluation in sage.  There is a template for this.  The functions
>> written for other languages provide good examples of what the
>> sage-specific functions might look like.  
>> 
>> hth,
>> Tom
>> 
>> 
>> 
>> Johan Ekh  writes:
>> 
>> > Hi all,
>> > sage is not listed under languages that can be used with
>> > org-babel. But it is based on
>> > Python, is it possible to use it with org-babel?
>> >
>> > /Johan
>> >
>> > Sent from my iPad
>> >
>> 
>> -- 
>> Thomas S. Dye
>> http://www.tsdye.com
>> 



Re: [O] (noob) interactive template? how?

2014-11-03 Thread Brady Trainor
Sven Ehret  writes:

> Hello,
>
> sorry for my noob question. I searched the list but cannot find anything
> that would fit.
>

It's not clear how noob you are? To Emacs? To Org-mode?

Do you know how to execute the emacs-lisp? Or otherwise insert into your init 
file?

Do you know that these functions are commands because of the "(interactive)" 
lines, so can be called with M-x? Do you know the M-x ALT+x deal?

The functions look for a headline "* Recipe", so your org buffer should have 
that first. M-x recipe-template will prompt for Titel due to "read-string" (I 
type "M-x describe-function" with cursor on "read-string" to read the 
documentation, or the more brief "C-h f").

The command "food/gen-shopping-list" seems to look for an entry "* 
Einkaufsliste", and headlines with "TOCOOK" state, but I did not succeed in 
getting the command to work. Perhaps I should have had some tabular data like 
can be found at 
http://sachachua.com/blog/2012/06/emacs-org-grocery-lists-batch-cooking/. 

Hope this helps reshape your question at least. 

> My question is: How would I use the template(s) on
> http://lebensverrueckt.haktar.org/articles/org-mode-Food/ ?
>
> Thank you for your attention!
>
> Best, Sven.



Re: [O] syntax highlighting of inline LaTeX fragments

2014-11-03 Thread Brady Trainor
Rasmus  writes:

> The variable `org-highlight-latex-and-related' should allow you to
> highlight inline math.

Thank you.

Takes care of all,
- $..$
- $$..$$ (w/ newlines)
- \(..\)
- \[..\] (w/ newlines)
- \begin{equation}..\end{equation} (w/ newlines)

--
Brady




Re: [O] syntax highlighting of inline LaTeX fragments

2014-11-02 Thread Brady Trainor
Ilya Shlyakhter  writes:

> dear org-moders,
> is it possible to syntax-highlight inline LaTeX fragments,
> such as $V$ or \cite{smith2012generating} ?
> I know you can highlight LaTeX code blocks, but I'm looking
> specifically for highlighting of inline fragments.
> thanks for help,
> ilya

:bump:

[feature-request]

I would also like this.

I may have to try out mmm-mode.

One solution is to use M-x latex-mode, then M-x orgstruct-mode, but headlines 
lose their syntax highlighting.

There is also a blob from 
[[http://stackoverflow.com/a/25048304/2533127][org-mode buffer latex syntax 
highlighting - Stack Overflow]], but I've so far only improved it to the 
following state:

#+BEGIN_SRC emacs-lisp
(font-lock-add-keywords
 'org-mode
 `(("\\$.+?\\$" . font-lock-keyword-face)
   ("\\$\\$.+\\$\\$" . font-lock-keyword-face)
   (,(concat "" "\\["   ; \[
 "\\("  ; \(
 "." "\\|" "\n" ; .|\n
 "\\)" "*"  ; \)*
 "" "\\]")  ; \]
. font-lock-keyword-face)))
#+END_SRC

So I now get some syntax highlighting on articles written in org like

#+BEGIN_SRC org
$$ W_{net} = \Delta KE. $$

On the other hand, the $i^{th}$ contribution to the work due to the $i^{th}$ 
force is /always/ 

\[
W_i = \int_{\textbf{a}}^{\textbf{b}} 
  \textbf{F}_i \cdot d\textbf{r}. 
\]
#+END_SRC

It's a little broken, for instance it doesn't react to changes in the buffer. 

Some links discussing similar issues include: 

- 
http://www.gnu.org/software/emacs/manual/html_node/elisp/Multiline-Font-Lock.html
- 
http://stackoverflow.com/questions/9452615/emacs-is-there-a-clear-example-of-multi-line-font-locking
- 
http://stackoverflow.com/questions/19623503/emacs-major-mode-font-lock-only-occurs-when-first-loading-file
- http://www.emacswiki.org/emacs/MultilineRegexp

--
Brady




Re: [O] How do you interact with org src blocks for your gmane.emacs.orgmode correspondence?

2014-10-31 Thread Brady Trainor

Brady Trainor  writes:

> ... Here is my
> present workflow, and I hope there is some simple or complex solution
> where others have a better workflow they can share:
>
> 1. Cut some pieces from my .el or .org files, 
> 2. Paste into the scratch buffer,
> 3. Convert scratch buffer to Major mode org, 
> 4. Add src blocks using org-mode shortcuts (" 5. Edit as needed for email, for instance taking advantage of indenting etc. 
> in "C-c '" mode
> 6. Cut and paste from scratch buffer to email draft
> 7. Edit email
> 8. If extensive editing of src blocks is needed while drafting, may
> consider switching back to scratch buffer including further cutting
> and pasting
> ...

I think I have found a rather peculiar solution (to my lengthy workflow). 

A normal solution:
  Based off a simple solution, of simply changing the mode of the email-draft 
(message) buffer to org-mode. Than C-c ' to edit in another mode, C-c ' to 
return, and M-x message-mode RET to view the normal message-mode hightlighting 
of headers and quoted messages. 

Strangish solution:
  C-x 4 c to clone the buffer, then switch to org-mode. But strangely, the 
syntax highlighting of message-mode is preserved! Simultaneously I get both 
modes' syntax highlighting, and 

[O] How do you interact with org src blocks for your gmane.emacs.orgmode correspondence?

2014-10-31 Thread Brady Trainor

When reading articles /from/ gmane.emacs.orgmode /in/ Gnus, I've observed that 
source blocks such as 

#+BEGIN_SRC emacs-lisp
(if this
(then that))
#+END_SRC

and 

#+BEGIN_SRC org
,* TODO some headlines and:atag:
SCHEDULED: <2014-10-29 Wed>
- [ ] some other org-mode stuff
#+END_SRC

do receive syntax highlighting. But to take advantage of this and to write 
articles in this way my workflow is very awkward. Here is my present workflow, 
and I hope there is some simple or complex solution where others have a better 
workflow they can share: 

1. Cut some pieces from my .el or .org files, 
2. Paste into the scratch buffer,
3. Convert scratch buffer to Major mode org, 
4. Add src blocks using org-mode shortcuts ("

Re: [O] extra newlines in TYPE checkitem for capture-templates

2014-10-23 Thread Brady Trainor
Brady Trainor  writes:
>
> A solution would be to use file+headline, then not using :prepend
> prevents an extra line, but my headline is the date and varies.
>

I solved my problem this way by modifying the function 
insert-date-N-days-from-current to print instead of insert. Now I can use 
file+headline and avoid :prepend. 

#+BEGIN_SRC emacs-lisp
(defun print-date-N-days-from-current (&optional days)
  "Print date that is DAYS from current."
  (interactive "p*")
  (print
   (calendar-date-string
(calendar-gregorian-from-absolute
 (+ (calendar-absolute-from-gregorian (calendar-current-date))
days)

(setq org-capture-templates
  `(("p" "pomodoro, checklist"
 checkitem (file+headline ,pomodoro ,(print-date-N-days-from-current 0))
 ""))) 
#+END_SRC

--
Brady




[O] extra newlines in TYPE checkitem for capture-templates

2014-10-23 Thread Brady Trainor


I am prepending a checkboxed plain list item to a file named "pomodoro.org" 
(I'm not really doing pomodoro here anymore, it started as this but the unique 
filename stuck, and it is my ad-hoc datetree). It is organized much like a 
datetree, but flatter and newest first, thus the use of prepend. However, the 
capture buffer includes two extra newlines, which I must get rid of before or 
after completing the capture. 

Is this desired behavior for capture-templates TYPE checkitem? 

I am still on ELPA version of org, 8.2.10. 

Here is my 

#+BEGIN_SRC emacs-lisp
(setq pomodoro "~/pomodoro.org")
(setq org-capture-templates
  `(("p" "pomodoro, checklist" checkitem (file ,pomodoro)
 ""
 :prepend t
 :empty-lines 0
 :empty-lines-before 0
 :empty-lines-after 0
 ;; :unnarrowed t
 )))
#+END_SRC

The result of consecutive captures looks like: 

#+BEGIN_SRC org

- [ ] a second capture

- [ ] a first capture

#+END

The spacing is doubled if I use `:unnarrowed t'. 

I have also tried `(file+regexp ,pomodoro "- \\[")', but I still get the extra 
line. 

A solution would be to use file+headline, then not using :prepend prevents an 
extra line, but my headline is the date and varies. 

Thank you, 

--
Brady




Re: [O] Paper Size for Exported LaTeX

2014-10-21 Thread Brady Trainor
Andreas Kiermeier  writes:

>
> #+LATEX_HEADER: \usepackage[various options]{geometry}
>

Here is an example I am using to cram a lot of lists/notes onto a peice of 
paper to fold into eighths. 

#+BEGIN_SRC org
#+LaTeX_CLASS_OPTIONS: [landscape]
#+LaTeX_HEADER: 
\usepackage[top=.1in,bottom=.125in,left=0in,right=.125in]{geometry}
#+LaTeX_HEADER: \usepackage{amssymb} % for org checkboxes -> $\square$
#+LaTeX_HEADER: \usepackage{nopageno}% no page number
#+LaTeX_HEADER: \usepackage{multicol}% slice page into arbitrary columns
#+LaTeX_HEADER: \setlength\columnsep{.35in}  % set column separation
#+LaTeX_HEADER: \usepackage{paralist}% reduce spacing in lists
#+LaTeX_HEADER: \let\itemize\compactitem
#+LATEX_HEADER: \let\enumerate\compactenum
#+LATEX_HEADER: \let\description\compactdesc
#+LaTeX_HEADER: \let\centering\relax % prevent centering of tables
#+TITLE:
#+END_SRC

(I setup TeXLive to default to letter.)

I originally started with a uniform 

: #+LaTeX_HEADER: \usepackage[margin=.125in]{geometry}

but had to massage out the edges due to the printer (or something?) adding a 
margin on the left, and basically use a ruler to get the column separation to 
work in concert. 

I also throw in 

#+BEGIN_SRC org
#+BEGIN_LaTeX
\begin{multicols*}{4}
#+END_LaTeX
#+END_SRC

The `*' is for allowing uneven heights of columns. 

To break a column, I use 

: \vfill
: \columnbreak

--
Brady




Re: [O] Org-mode Habit with Varying Description

2014-10-20 Thread Brady Trainor
Daya Atapattu  writes:

> Is there a way to create a habit that picks-up the description from a
> list?
>
> I like to schedule studying a book: It would be scheduled as "Read
> pages 100-125." Then the next day it should read "Read pages 126-150."
> The description of the habit varies; org-mode picks that up
> sequentially from a list.
>
> Is that possible?
>
> Regards,
>
> - Daya


I was scheduling all my TODOs for the day and using agenda view to clock my 
progress through them. But I've been skimming once again through org-mode 
users' descriptions of how they use org-mode, and one mentioned only to use 
scheduling for things like appointments. 

So my advice will step around your use of habits, although I do this without 
recently haing adopted org-habits into my workflow, so maybe I am missing 
something. 

So instead of scheduling, I would have you tag these headlines, or similarly 
set them under a tree with a CATEGORY, and simly toggle their TODO state as you 
want to work on them. Here is an example of a custom-command: 

#+BEGIN_SRC emacs-lisp
(setq org-agenda-custom-commands
  '(("B" "Books"
 ((tags-todo "-nofilter"))
 ((org-agenda-category-filter-preset '("+read"))
  ;; or
  ;; (org-agenda-tags-filter-preset '("+read"))
))
#+END_SRC

So if you think you will keep the reading notes in a few concentrated places, 
then CATEGORY should do, whereas if you think you would have related headlines 
strewn about, the tag-filter may be better. 

Here is an example org-file: 

#+BEGIN_SRC org

#+TODO: TODO(t) NEXT | DONE
#+TAGS: read(r) other

* book reading
:PROPERTIES:
:CATEGORY: read
:VISIBILITY: children
:END:
** DONE pages 100-125 :read:
** NEXT pages 125-150 :read:
** TODO pages 150-175 :read:

#+END_SRC

If you'd like to experiment with an additional agenda view for clocking, try

#+BEGIN_SRC emacs-lisp
(agenda ""
(org-agenda-span 'day)
(org-agenda-log-mode-items '(closed clock state))
(org-agenda-start-with-log-mode t)
(org-agenda-skip-scheduled-if-done t))
#+END_SRC

You may want to tweak so that you can get a view of total clocked or just a 
view of those days where you read. It's not org-habits, but it could still 
potentially show you your progress in way that can motivate. 

--
Brady




[O] After org-agenda-tag-filter-preset, (search ".") seems to break.

2014-10-20 Thread Brady Trainor

For a global search, the result of custom command `g' seems to work,
while the custom command `f' fails. I am guessing this has to do with
`search' block is not tied in strongly to the greater set of custom
command tools, but wanted to bring it to your attention in case it was
found to be unwanted behavior.

#+BEGIN_SRC emacs-lisp
(setq org-agenda-custom-commands
  '(("g" "Global search"
 ((search ".")))
("f" "Global search after tag filter"
 ((search "."))
 ((org-agenda-tag-filter-preset '("+work"))
#+END_SRC

In other words, the regexp wildcard `.' works with `(search ".")'
alone, but seems to fail after a tag-filter, i.e. only headlines with
periods in them work.

--
Brady




Re: [O] New key binding C-Tab -- how to not use it

2014-10-19 Thread Brady Trainor
Bastien  writes:

> Thorsten Jolitz  writes:
>
>> ,
>> | (org-defkey org-mode-map "\C-TAB" 'undefined)
>> `
>>
>> not sure if the TAB is correct here, maybe try , , etc if it
>> does not work.
>
> I think this should be one of these:
>
> (org-defkey org-mode-map "\C-\t" 'undefined)
> (org-defkey org-mode-map [(control tab)] 'undefined)
> (org-defkey org-mode-map (kbd "C-TAB") 'undefined)
>
> You may also want to check `local-unset-key' that you can use
> within `org-mode-hook'.

Sometimes I use `C-h k', describe-key, which gives me  as
another candidate. This can help as it can vary between OS', for
instance Ctl+Scroll-up does vary here.

(My strategy propogates from Xah Lee's blog.) 

--
Brady




[O] Append a second agenda view then refresh; this kills first agenda view.

2014-10-18 Thread Brady Trainor

If I append (A) a second agenda-view to a first, then refresh for
clocking (g), the first agenda-view vanishes and I am left with the
second. 

Is there any way to keep both agenda-views upon refresh? For now I will
simply adjust my custom-commands, but my reaction was that this should
be natural. But then maybe a pain to code. 

--
Brady




Re: [O] Text above first headline is being exported, despite :export: tag being used.

2014-10-18 Thread Brady Trainor
Charles Berry  writes:

> Brady Trainor  uw.edu> writes:
>
>> But I have trees tagged for export, while text above first headline is
>> being exported. Can anyone confirm? 
>
> It works for me. Can you provide an ECM[1]?
>

I have in a file simply:

--8<---cut here---start->8---
Text above first headline. 

* first headline for export  :export:
--8<---cut here---end--->8---

I start Emacs with =emacs -q=, and apply =M-x package-initialize=. 

With =M-x version RET= and =M-x org-version RET=, I find

,
| GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of
| 2014-03-07 on lamiak, modified by Debian
| 
| Org-mode version 8.2.10 (8.2.10-elpa @
| /home/iam/.emacs.d/elpa/org-20141013/)
`

With =C-c C-e l l=, the associated .tex file includes

,
| \begin{document}
| 
| \maketitle
| \tableofcontents
| 
| Text above first headline. 
| 
| \section{first headline for export}
| \label{sec-1}
| % Emacs 24.3.1 (Org mode 8.2.10)
| \end{document}
`

or for completeness, the entire contents are

--8<---cut here---start->8---
% Created 2014-10-18 Sat 15:11
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{amssymb}
\usepackage{hyperref}
\tolerance=1000
\author{iam}
\date{\today}
\title{ecm}
\hypersetup{
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs 24.3.1 (Org mode 8.2.10)}}
\begin{document}

\maketitle
\tableofcontents

Text above first headline. 

\section{first headline for export}
\label{sec-1}
% Emacs 24.3.1 (Org mode 8.2.10)
\end{document}
--8<---cut here---end--->8---


--
Brady




[O] Text above first headline is being exported, despite :export: tag being used.

2014-10-16 Thread Brady Trainor

At

http://orgmode.org/manual/Export-settings.html

I read

,
| ‘SELECT_TAGS’ 
| The tags that select a tree for export (org-export-select-tags). The
| default value is :export:. Within a subtree tagged with :export:,
| you can still exclude entries with :noexport: (see below). When
| headlines are selectively exported with :export: anywhere in a file,
| text before the first headline is ignored.
`

But I have trees tagged for export, while text above first headline is
being exported. Can anyone confirm? 

--
Brady




[O] org agenda custom command: "search" block, cannot sort by priority?

2014-10-13 Thread Brady Trainor

Can I expect sorting by priority to be easily usable in the `search'
block for `org-agenda-custom-commands'? 

Here is a minimal example, where I can pull all headlines by using a tag
filter on a nonsense tag, whereas the search for all headlines doesn't
seem to be sortable. Should I be aware of the limitations of the
`search' block? 

#+BEGIN_SRC emacs-lisp
(setq org-agenda-custom-commands
  `(("g" "Global view of items"
 ((tags  "-asdfjkl;"))
 )
("G" "Global view of items"
 ((search "."
  ((org-agenda-sorting-strategy '(priority-down)
 ((org-agenda-sorting-strategy '(priority-down)))
 )
))
#+END_SRC





Re: [O] org-mode for knowledge management

2014-10-11 Thread Brady Trainor
Daniel Clemente  writes:

>   About links: in org-mode they all look the same, but semantically there are 
> many types, like:
> - *is-a*: „this is a concrete implementation of [[that generic knowledge]]“
> - *related*: „related to this is: [[that]]“
> - *same-as*: „this and [[that]] are exactly the same topic, so write
> only under that header, not here“ ← this is poor man's transclusion,
> or more like „symbolic links“ in ext4. With it, a header seems to be
> present in many places at the same time; in reality the content is
> only in one place and the rest are links. The good thing is, it
> doesn't really matter /where/ exactly is that tree, because you'll
> find it anyway by following maximum 1 link. X can link to Y, or Y can
> link the X; what's important is that reading both X or Y you'll find
> exactly the same thing (not copy+pasted contents).
>
> Daniel

I don't think I am aware of the "*sameas*" type of link in org-mode, can
you give an example please? 

--
Brady




[O] Possible bug, installing outshine before outorg

2014-10-09 Thread Brady Trainor

Newb bug report: 

I think if I have a brand new Emacs setup, installing org with an "emacs
-q", then installing outshine.el (all with built-in package manager),
that there is some problems created, possibly because of outorg to
install (IIRC, a "silent-notifications" type of problem). 

If I start over (deleting ".emacs.d/elpa/" contents) and install org,
then outorg, then outshine, the problem I think is resolved. 

Can anyone confirm? 


--
Brady




Re: [O] [org-publish] Error exporting my project

2014-10-01 Thread Brady Trainor
Nicolas Goaziou  writes:

> Hello,
>
> Leandro Noferini  writes:
>
>> Yes, I have on Debian unstable, either emacs24 and org-mode package: how
>> could I choose to use only org-mode package?


Do you use the built-in package manager? I do, so I think I simply need
(package-initialize) before anything calls org.


>
> You have to make sure that newer Org is loaded before bundled one, i.e.,
> nothing in your config requires (or autoloads) the bundled Org.
>
>
> Regards,


--
Brady




Re: [O] Exporter dispatcher bug?

2014-09-24 Thread Brady Trainor

Charles Millar  writes:

> Brady Trainor wrote:
>> Charles Millar  writes:
>>
>>> Today, using C-c C-e, the dispatcher shows only the LaTeX and
>>> Publisher options.
>>>
>> What is the result C-h v org-export-backends?
>>
> -- snip --
> Its value is (ascii html icalendar latex)
> -- snip --
>
> Charlie

Looks normal! Wild guess, had to try :)


Brady




Re: [O] Exporter dispatcher bug?

2014-09-24 Thread Brady Trainor

Charles Millar  writes:

>
> Today, using C-c C-e, the dispatcher shows only the LaTeX and
> Publisher options.
>

What is the result C-h v org-export-backends? 


Brady




Re: [O] resizing windows from an org buffer, reqest for org-shiftcontrol-final-hook

2014-09-23 Thread Brady Trainor
Aaron Ecay  writes:

> Hi Bradley,
>
> 2014ko irailak 16an, Brady Trainor-ek idatzi zuen:
>> 
>> I have
>> 
>> (global-set-key (kbd "S-C-") 'shrink-window-horizontally)
>> (global-set-key (kbd "S-C-") 'enlarge-window-horizontally)
>> (global-set-key (kbd "S-C-") 'shrink-window)
>> (global-set-key (kbd "S-C-") 'enlarge-window)
>> 
>> in my init file, as suggested at 
>> http://www.emacswiki.org/emacs-en/WindowResize. However, when I am in an 
>> org file, the binding fails.
>> 
>> I had hoped that (setq org-support-shift-select t) would fix this, but 
>> it only seems to want to allow selection.
>> 
>> A solution might be similar to the one ...
>
> How’s your elisp?  Would you feel up to trying to create such a patch?

My elisp is not such that I can stop looking for work to tackle this.
(Negligible programming experience.) Though, I might certainly find
other excuses once I find gainful employment ;)


Brady




Re: [O] CV in orgmode for export to pdf (and html?)

2014-09-19 Thread Brady Trainor

On 9/19/2014 2:18 AM, Rainer M Krug wrote:

Hi

- How do you do it (I don't assume you write your CVs in Word?), or are
you using LaTeX directly?


Nice question, I will enjoy reading all the examples in this thread.

For a bit, I tried to make org do everything, like export resumes to 
Word, Writer, LaTeX and ASCII from one tree. Eventually, I couldn't 
justify managing all the moving parts, but maybe one day...


So I abandoned the export to word processors, though I had succeeded in 
applying template files. Too much going on behind the scenes for me, and 
requests for Word resumes should be rare enough that I just have notes 
on how to quickly format a resume there. After all, with so many OS and 
fonts, sending a Word document across OS can have unpredictable results. 
PDF or plain text is the way to go. (Interpretive dance is okay too.)


And I did have a decent export to LaTeX resume from org, but after 
discovering moderncv, I've switched, though I will be curious to read 
others' methods of org-to-moderncv export.


But what I do still use is export to ASCII, as editing an ASCII resume 
layout is a pain. Here is the crux of my template for that


#+OPTIONS: toc:nil num:nil
#+NAME: setup # I have no idea what this line is for, I found it on worg
#+BEGIN_SRC emacs-lisp :results silent :exports none
(setq org-ascii-headline-spacing '(0 . 1))
(setq org-ascii-inner-margin 5)
(setq org-ascii-underline '((ascii nil ?= nil)))
#+END_SRC

* resume :export:

#+BEGIN_CENTER
Brady Trainor\\
algeb...@uw.edu -- (206) 898-4124
#+END_CENTER

** Experience
*** Jan -Present Position
Location\\
Job description.

... etc.

This is nice for sites that seem to prefer plain text, or demand it. I'm 
considering removing the centering, as some sites seem to remove the 
whitespace up to first character (B).


Brady




[O] resizing windows from an org buffer, reqest for org-shiftcontrol-final-hook

2014-09-16 Thread Brady Trainor



I have

(global-set-key (kbd "S-C-") 'shrink-window-horizontally)
(global-set-key (kbd "S-C-") 'enlarge-window-horizontally)
(global-set-key (kbd "S-C-") 'shrink-window)
(global-set-key (kbd "S-C-") 'enlarge-window)

in my init file, as suggested at 
http://www.emacswiki.org/emacs-en/WindowResize. However, when I am in an 
org file, the binding fails.


I had hoped that (setq org-support-shift-select t) would fix this, but 
it only seems to want to allow selection.


A solution might be similar to the one

;; quick keys for switching windows
(windmove-default-keybindings)
;; fix windmove in org-mode
(add-hook 'org-shiftup-final-hook 'windmove-up)
(add-hook 'org-shiftleft-final-hook 'windmove-left)
(add-hook 'org-shiftdown-final-hook 'windmove-down)
(add-hook 'org-shiftright-final-hook 'windmove-right)

as suggested at http://orgmode.org/manual/Conflicts.html.

Looking at the code in org.el, it seems org-shiftcontrolup and the like 
were not so lucky to get such a final-hook. Can this be added? I am 
currently using package.el org-mode, so I may not immediately get to try 
it out, but would look forward to adding it to my workflow soon.


Or do others have another solution to resizing windows in org-mode?

Brady




[O] agenda view custom command, restrict buffer

2014-09-14 Thread Brady Trainor

Today I realized how simple a command I liked in C-c a < a d. 

This would give an agenda-view of the current buffer and current day. So I 
thought, let's practice translating such key sequences to custom-commands. 
And I hit a speed bump. 

It seems not everything available in the agenda command menu is available 
as an existing variable for custom commands. I naively tried the following, 
but I don't think it works. 
(setq org-agenda-custom-commands
  `(("c" "View today's clocking"
 ((agenda "")
  )
 ((org-agenda-span 'day)
  (org-agenda-restrict (current-buffer))
  ))
))

Perhaps a function could be written, but more so I was just surprised that 
custom-commands seemed to be missing an option available in the agenda-view 
menu. 

For now, I will just try to rely on simpler alternatives, such as

(setq org-agenda-custom-commands
  `(("c" "View today's clocking"
 ((agenda "")
  )
 ((org-agenda-span 'day)
  (org-agenda-files `(,repeats))
  ))
))


Brady




Re: [O] [[latex:textsc][some text]] becomes \texttt{some text}

2014-08-31 Thread Brady Trainor

On 8/31/2014 1:20 AM, Nicolas Goaziou wrote:

Hello,

Brady Trainor  writes:


I would have expected

 [[latex:textsc][some text]]

to become

 \textsc{some text}


Why would you expect that?


Regards,



My mistake, I got mixed up by multiple mentions and difficulty with 
google. It is solved now.


From 
[[http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-10-3][LaTeX 
Export for Org Mode  8_0 / 10.3 Inline Markup]]


(org-add-link-type
 "latex" nil
 (lambda (path desc format)
   (cond
((eq format 'html)
 (format "%s" path desc))
((eq format 'latex)
 (format "\\%s{%s}" path desc)


Brady

(Might need an =(eval-after-load 'org '(blah...= or similar.





Re: [O] Moving my init.el to Org

2014-08-31 Thread Brady Trainor

On 8/31/2014 1:37 AM, Marcin Borkowski wrote:


I know that I could use org-babel-load-file, or outshine.  What are
other possibilities?  What are the caveats (and advantages) of both
(other?) ways?


Another pro for `outshine`, I've made a folding expression for Vim that 
respects `outshine` behavior, as far as I use it.


augroup filetype_lisp
au!
au FileType lisp setlocal foldmethod=expr foldexpr=ELispLevel()
augroup END

function! ELispLevel()
let n = len(matchstr(getline(v:lnum), '^;\+'))
let l = n - 2
if n >= 3
return ">" . l
else
return "="
endif
endfunction

From Vim, typing `:help fold-expr RET` will give a clue as to the ">" 
and "=" expressions.


I tried the init.org for a while, it was fun so you should try it for a 
while, but I've been trying to reduce how many conversions I have in my 
projects. And I finally succumbed to the convention of breaking some 
parts of my init file into parts (nav, org, etc). Trying to keep my init 
files easy to drop-in and understand was a factor, as I'm always trying 
to convert people to Emacs and org-mode (success zero so far). And 
troubleshooting may be considered easier.


More specifically, consider that if you try to convert someone to Emacs 
and org-mode via an init.org file, they will have to deal with three new 
problems at once.


1. The order of loading org, babel, and the .org file, and any possible 
issues with old versions of org builtin to Emacs
2. As you show them the emacs-lisp, they may get distracted by all the 
#+BEGIN_SRC emacs-lisp etc., wondering simultaneously how everything 
fits together

3. Learning org-mode and .emacs in an intertwined way


Brady




[O] [[latex:textsc][some text]] becomes \texttt{some text}

2014-08-30 Thread Brady Trainor



I would have expected

[[latex:textsc][some text]]

to become

\textsc{some text}

Instead, it becomes

\texttt{some text}

My hackish fix is to modify a variable,

(setq org-latex-link-with-unknown-path-format "\\textsc{%s}")

Is there a better way?


Brady
Org-mode version 8.2.7c (8.2.7c-51-g896fa6-elpa @ 
/home/iam/.emacs.d/elpa/org-20140825/)





[O] narrow window, tag prompt partially obscured

2014-08-23 Thread Brady Trainor

I am using org-version 7.9.3f-17-g7524ef.

When the window is narrow, and I use C-c C-c to set tags in headline, 
the tag-selection prompt does not show all candidates.


Is there a way around this? I'm using a narrow org buffer to mirror my 
directory structure for visualization, and org tags is part of this 
workflow.





Re: [O] Remove the build-in orgmode

2014-06-01 Thread Brady Trainor
Shiyuan wrote:

> Hi,
> I updated Org-mode from ELPA. If I start emacs normally, M-x
> org-version does show the new version(8.2.6). But if I start emacs  with
> -Q, emacs will still run the built-in version(7.9.3). This is not
> convenient for debugging purpose. Is there anyway to remove the built-in
> version 7.9.3 completely so that even if I start emacs with -Q, emacs
> still
> use the new version 8.2.6 from ELPA.  Thanks.
> 
> Shiyuan


I have 

   (setq load-path (delete "/usr/share/emacs/24.3/lisp/org" load-path))
   (setq load-path (delete "c:/Program Files (x86)/emacs-24.3/lisp/org" 
load-path))

in my notes, for when I was trying to get the most recent maint repository 
version of org working. There is a better version of these lines somewhere 
at stack exchange... here it is: http://stackoverflow.com/a/20616703/2533127

You could potentially have this in a ~/debugorg.el, and use 

emacs -q -l "~/debugorg.el"

For more exploring, try =cd /usr/share/emacs/=, and =ls=. Also, try =C-h v 
load-path RET C-x o C-s org=. In other words, have Emacs describe the =load-
path= variable, switch to that window and do a search for the term "org". 

(It is somewhere discouraged to remove the built-in org, but hopefully 
someone will give you steps and tips anyway. (Would it simply suffice to 
temporarily move the emacs/24.3/lisp/org directory described above?)) 


Brady






Re: [O] (OT) How to follow a mailing list with very high activity (like this one here)?

2014-05-29 Thread Brady Trainor

Necromancy, ~1.5 months

On 04/17/2014 08:45 PM, Brady Trainor wrote:


TLDR version:  I've decided to go with newsgroup rather than subscribe,
and Thunderbird rather than GNUS.

have we established the following ?
3 routes:
  - subscribe to mailing list with your email address
  - simply view the newsgroup
  - RSS
Some apps:
  - Gmane website
  - MS Entourage
  - Emacs GNUS
  - Wanderlust
  - Thunderbird


Just wanted to add two more apps I've discovered and been experimenting 
with:


In KDE, there is knode for newsgroups, and kmail for mail.

I think aspects of the KDE project are even ported to some other OS'.

Brady







Re: [O] org-agenda List Items with Priority A

2014-05-23 Thread Brady Trainor

(my first `follow-up' from GNUS)

I am trying to reduce the amount of custom-commands I use, so that my
use of org-mode can evolve to be more adaptive and take more advantage
of defaults. 

The functions below are for DONE items, but I'm sure you could tweak
them to apply to priority. 

They allow you to use the hotkeys in agenda-view, via the `org-defkey'
function (which is why I have to "require 'org-agenda"). 

With M-=, I get the result of `C-u =' with fewer keystrokes, at which
point I can type DONE for quick removal. You could probably try `= #a'
for quick filtering. (The `=' hotkey already exists in your default
agenda-view.)

With C-=, I toggle whether DONE items appear quickly (the second source
block below). 

#+BEGIN_SRC emacs-lisp
(require 'org-agenda)
(defun org-agenda-filter-by-regexp-inverse ()
  (interactive)
  (org-agenda-filter-by-regexp '(4)))
(org-defkey org-agenda-mode-map "\M-=" 'org-agenda-filter-by-regexp-inverse)
#+END_SRC

* toggle "skip timestamp if done"

#+BEGIN_SRC emacs-lisp
(require 'org-agenda)
(defun toggle-org-agenda-skip-timestamp-if-done ()
  (interactive)
  (cond ((eq org-agenda-skip-timestamp-if-done nil)
 (setq org-agenda-skip-timestamp-if-done t))
((eq org-agenda-skip-timestamp-if-done t)
 (setq org-agenda-skip-timestamp-if-done nil)))
(org-agenda-redo))
(org-defkey org-agenda-mode-map [?\C-=] 
'toggle-org-agenda-skip-timestamp-if-done)
#+END_SRC



{{{ Brady }}}



I am self-proclaimed newb, so if anyone has any org-defaults suggestions
or coding style, please let me know. (Learning "autoloads" is on my
list, so maybe that is one thing, but I recently installed a new linux,
and Emacs is opening super fast.) 




[O] export to org, header args disappear

2014-05-15 Thread Brady Trainor



I have code blocks such as

#+BEGIN_SRC emacs-lisp :tangle no
...
#+END_SRC

and when I export the file to org, it becomes

#+BEGIN_SRC emacs-lisp
...
#+END_SRC

Is there an option to include the header args on export?

Thank you,

Brady




Re: [O] Is org-protocol working on Fedora?

2014-05-01 Thread Brady Trainor

On 04/30/2014 05:55 PM, Brady Trainor wrote:

Hi, I was curious if anyone had org-protocol working on Fedora.

...

 It's working in Opera on Fedora.

Brady





[O] Is org-protocol working on Fedora?

2014-04-30 Thread Brady Trainor

Hi, I was curious if anyone had org-protocol working on Fedora.

I have had it working when I tried Ubuntu some months ago, and I have it 
working now in Windows with Firefox. But I have not been able to get it 
to work in Fedora. (It has worked in Fedora on Emacs' w3m.)




Brady




Re: [O] struggle with using variable org-agenda-*-filter* properly

2014-04-29 Thread Brady Trainor

On 04/29/2014 04:51 AM, Bastien wrote:
> Hi Brady,
:
> Filters are applied on the headlines, not on their contents,
> because they are applied *after* the agenda is generated.
:
> Hope this clarifies things up,

Yes, greatly. Thank you.


Brady





Re: [O] struggle with using variable org-agenda-*-filter* properly

2014-04-28 Thread Brady Trainor

On 4/28/2014 2:58 PM, Brady Trainor wrote:




Maybe I should have included version:

Org-mode version 8.2.6 (8.2.6-6-gfc37d1-elpa @ 
c:/Users/user-name/AppData/Roaming/.emacs.d/elpa/org-20140428/)







[O] struggle with using variable org-agenda-*-filter* properly

2014-04-28 Thread Brady Trainor


I am often having difficulties with the various org-agenda filter 
settings, for creating org-agenda-custom-commands. There is not much 
documentation, especially, examples for those new to for instance 
regexp, and Emacs' regexp, and how these work with org's syntax.


In the following agenda-custom-command, I tried to use regexp in 
regexp-filter and tag-filter, but could not succeed. I did successfully 
get the skip-function to work, but I was hoping to clarify if I should 
expect the other variables to work, now or in the future, and/or if you 
could help me understand how to use them properly.



(org-add-agenda-custom-command
 '("h" "habits"
   agenda ""
   ((org-agenda-files '("/e/org/agendas-main.org"))
(org-agenda-skip-function
 '(org-agenda-skip-entry-if 'notregexp ":STYLE:.+habit"))
(org-agenda-span 'day)
;; (org-agenda-regexp-filter-preset '(":STYLE:.+habit"))
;; (org-agenda-tag-filter-preset '("+STYLE=\"habit\""))
)
   ))

I have tried various permutations of the syntax, but could not make the 
latter two variables work.




Leads:
 - http://orgmode.org/manual/Matching-tags-and-properties.html
   - which links to, 
http://orgmode.org/manual/Special-agenda-views.html#x-agenda-skip-entry-regexp, 
perhaps the intended solution at this time

 - http://orgmode.org/worg/org-tutorials/advanced-searching.html
 - http://www.emacswiki.org/emacs/RegularExpression


Thank you,

Brady







Re: [O] Tried to use `org-agenda-top-headline-filter' in agenda block

2014-04-26 Thread Brady Trainor

On 04/26/2014 07:45 AM, Brady Trainor wrote:

On 04/22/2014 11:12 PM, Bastien wrote:

 > Brady Trainor  writes:
 >



 >>
 >> I tried to use `org-agenda-top-headline-filter'.

 >
 > There was a bug here, please try again from a fresh pull of the maint
 > or master branch.

When I try

 (org-agenda-top-headline-filter "diary-sunrise, diary-sunset")

...

Hmm, I saw some mention of this at

http://permalink.gmane.org/gmane.emacs.orgmode/85221

So that provoked me to consider trying to create an MWE.

I will try to test this more later, but the problem changes when I make 
a more minimal working example.


Now, it's filtering, but it seems to only filter by the file. So now, 
according to headline, it's filtered, but only by file.


(This is a rushed email, but I think my MWE is more or less using the 
above filter by itself in a custom-command.)


And if I try ^ (org-agenda-filter-by-top-headline) in agenda view, it 
complains that there is no top-level category (but I think there is).


Please let me know if I can do anything to clarify.


Brady







Re: [O] Tried to use `org-agenda-top-headline-filter' in agenda block

2014-04-26 Thread Brady Trainor

On 04/22/2014 11:12 PM, Bastien wrote:

> Brady Trainor  writes:
>
>> Org-mode version 8.2.5h (8.2.5h-137-gc7812f-elpa @
>> /home/iam/.emacs.d/elpa/org-20140421/)
>>
>> I tried to use `org-agenda-top-headline-filter'.

>
> There was a bug here, please try again from a fresh pull of the maint
> or master branch.


Org-mode version 8.2.6 (release_8.2.6-918-g36b497 @ 
/e/emacs-config/packagesfromtheinternet/org-mode/lisp/)


When I try

(org-agenda-top-headline-filter "diary-sunrise, diary-sunset")

in org-agenda-custom-commands, for `* diary-sunrise, diary-sunset', it 
does not filter (I have also tried a single word headline). Maybe I am 
just not using the syntax correctly?



Maybe this variable was not designed for use in agenda-custom-commands. 
It may have been an assumption, I probably took a strange route 
searching for options for custom-commands, by digging through 
org-agenda.el.





Re: [O] Trying to separate clocked time /ranges/ from scheduled times in a clean-ish view.

2014-04-24 Thread Brady Trainor

On 4/23/2014 8:09 PM, Brady Trainor wrote:

On 4/23/2014 5:47 PM, Brady Trainor wrote:


...



I really don't think I am using it the intended way, please disregard, 
there is plenty of other functionality I can continue to discover and 
leverage to my needs.


Sorry for the noise.


Brady



(I should consider using reschedule or making time-stamp inactive, etc., 
for what I was trying to do.)





Re: [O] Trying to separate clocked time /ranges/ from scheduled times in a clean-ish view.

2014-04-23 Thread Brady Trainor

On 4/23/2014 5:47 PM, Brady Trainor wrote:


Day-agenda (W17):
Wednesday  23 April 2014
   agendatest:  7:45- 7:48 Clocked:   (0:03) backflips:routine::
   agendatest:  7:45- 7:50 Scheduled:  backflips  :routine::
   agendatest:  7:48- 7:52 Clocked:   (0:04) somersaults  :routine::
   agendatest:  7:50- 8:00 Scheduled:  somersaults:routine::
   agendatest:  7:52- 8:10 Clocked:   (0:18) tell fortune  :routine:
   agendatest:  8:00- 8:20 Scheduled:  tell fortune:routine:
8:00.. 
   10:00.. 



Even if I could make this a little more vertically aligned, like somehow 
entering the effort.



Day-agenda (W17):
Wednesday  23 April 2014
   agendatest:  7:45- 7:48 Clocked:   (0:03) backflips:routine::
   agendatest:  7:45- 7:50 Scheduled: [0:05] backflips:routine::
   agendatest:  7:48- 7:52 Clocked:   (0:04) somersaults  :routine::
   agendatest:  7:50- 8:00 Scheduled: [0:10] somersaults  :routine::
   agendatest:  7:52- 8:10 Clocked:   (0:18) tell fortune  :routine:
   agendatest:  8:00- 8:20 Scheduled: [0:20] tell fortune  :routine:
8:00.. 
   10:00.. 

could make it a bit more readable for me. (Maybe this would be made to 
only turn on with `l' in the agenda.) But my synapses are fully extended 
to get here, so I am not seeing how to do this either.



Brady






[O] Trying to separate clocked time /ranges/ from scheduled times in a clean-ish view.

2014-04-23 Thread Brady Trainor



I can't see how to get a clean view of clocked time ranges. Not just the 
length of time, but the actual start and end times. I would like to 
share my attempts to give you an idea.


If I include

(org-agenda-start-with-log-mode '(closed clock state))

in my agenda block, then I can see them, but unfortunately I am clocking 
on items I've scheduled for myself, so they mix in and it is hard to 
read quickly. That is, I have


#+BEGIN_SRC
** example
*** circus act:routine:
 backflips
CLOCK: [2014-04-23 Wed 07:45]--[2014-04-23 Wed 07:48] =>  0:03
SCHEDULED: <2014-04-23 Wed 07:45-07:50>
:PROPERTIES:
:Effort:   0:05
:END:
 somersaults
SCHEDULED: <2014-04-23 Wed 07:50-08:00>
CLOCK: [2014-04-23 Wed 07:48]--[2014-04-23 Wed 07:52] =>  0:04
:PROPERTIES:
:Effort:   0:10
:END:
 front flips
:PROPERTIES:
:Effort:   0:10
:END:
*** feed elephant :routine:
SCHEDULED: <2014-04-23 Wed 21:10-21:30>
:PROPERTIES:
:Effort:   0:20
:END:
*** tell fortune  :routine:
SCHEDULED: <2014-04-23 Wed 08:00-08:20>
CLOCK: [2014-04-23 Wed 07:52]--[2014-04-23 Wed 08:10] =>  0:18
:PROPERTIES:
:Effort:   0:20
:END:
#+END_SRC

In an `agenda' block, I have tried to filter the scheduled lines out, 
and keep the clock lines, but filters seem to work before deciding to 
include the clocking, so the pair, scheduled and clocked will vanish 
together. (If I could get a view of just clock time ranges, I might use 
a sticky buffer to see one agenda block with scheduled time ranges, and 
another agenda block with clocked time ranges.)


I tried using a clock report table, but I can't see how to get the 
actual clocked time, instead of the timestamp range. Via


(org-agenda-start-with-clockreport-mode t)

I've looked at column view as a possibility, but again, the clock time 
does not seem to be available.


I tried to use the `search' block, but did not think of a way to display 
only clock times there.


Here are the results of my best tries at an agenda view. (I found it a 
little awkward to compare clocked times to scheduled times as they are 
mixed in here.)



 _
/ 
/


Day-agenda (W17):
Wednesday  23 April 2014
  agendatest:  7:45- 7:48 Clocked:   (0:03) backflips:routine::
  agendatest:  7:45- 7:50 Scheduled:  backflips  :routine::
  agendatest:  7:48- 7:52 Clocked:   (0:04) somersaults  :routine::
  agendatest:  7:50- 8:00 Scheduled:  somersaults:routine::
  agendatest:  7:52- 8:10 Clocked:   (0:18) tell fortune  :routine:
  agendatest:  8:00- 8:20 Scheduled:  tell fortune:routine:
   8:00.. 
  10:00.. 
  12:00.. 
  14:00.. 
  16:00.. 
  17:15.. now - - - - - - - - - - - - - - - - - - - - -
  18:00.. 
  20:00.. 
  agendatest: 21:10-21:30 Scheduled:  feed elephant   :routine:
| Timestamp  | Effort | Headline| Time   |
|++-++--
| ALL|| *Total time*| *0:25* |
|++-++--
||| *File time* | *0:25* |
||| circus act  | 0:07   |
| 2014-04-23 Wed 07:45-07:50 |   0:05 | \__ backflips   || 0:03
| 2014-04-23 Wed 07:50-08:00 |   0:10 | \__ somersaults || 0:04
| 2014-04-23 Wed 08:00-08:20 |   0:20 | tell fortune| 0:18   |

=
Search words: CLOCK
  agendatest: backflips  :routine::
  agendatest: somersaults:routine::
  agendatest: tell fortune:routine:


\
\


Finally, here is my custom-command that I have been working on:

#+BEGIN_SRC emacs-lisp

(org-add-agenda-custom-command
 '("r" "routine"
   ((agenda ""
(
 (org-clocktable-defaults
  '(
:timestamp t
:properties ("Effort")
:indent t
))
 )
)
(search "CLOCK")
)
   (
(org-agenda-files '("/e/org/agendatest.org"))
(org-agenda-span 'day)
(org-agenda-start-with-clockreport-mode t)
(org-agenda-start-with-log-mode '(closed clock state))
(org-agenda-tag-filter-preset '("+routine"))
)
   ))

#+END_SRC

To give a visual of what I am trying to do,


Day-agenda (W17):
Wednesday  23 April 2014
  agendatest:  7:45- 7:48 Clocked:   (0:03) backflips:rout

[O] My first union in an agenda block

2014-04-22 Thread Brady Trainor


I struggled to get union of cases in an agenda block. I was able to work 
from examples by Bernt Hansen at


http://doc.norang.ca/org-mode.html#CustomAgendaViewSetup

and

http://doc.norang.ca/org-mode.html#Projects,

and make the following small example, which may be useful to folks just 
getting into Org-mode and Emacs, and want to be aware of how you can 
combine cases into your agenda block. (Union as opposed to intersection, 
OR vs AND.)


It should be straightforward to make various cases, or even finally get 
familiar with the agenda filtering commands at


http://orgmode.org/manual/Filtering_002flimiting-agenda-items.html.


#+BEGIN_SRC emacs-lisp
(defun appts-nil-not-appt-next-headline ()
  (let ((next-headline (save-excursion (outline-next-heading
(if (or ;; (string= "circus-act" (org-get-org-file))
(string= "circus-act" (org-get-category))
(member "appt" (org-get-tags-at))
(member "plans" (org-get-tags-at))
(member "social" (org-get-tags-at)))
nil
  next-headline)))
#+END_SRC

(You may need this so that function org-add-agenda-custom-commands does 
not create error.)

#+BEGIN_SRC emacs-lisp
(require 'org-agenda)
#+END_SRC

#+BEGIN_SRC emacs-lisp
(org-add-agenda-custom-command
 '("c" "calendar"
   agenda ""
   ((org-agenda-skip-function 'appts-nil-not-appt-next-headline)
)))
#+END_SRC

Please let me know if you see any changes I should make in my strategy 
or code. (I've not made it a priority, but I think I shouldn't have the 
three occurrences of `(member "" (org-get-tags-at))'.)


Also, no telling when I'll get the chance to understand the examples at


http://stackoverflow.com/questions/20715106/org-agenda-regexp-search-categories



Brady




[O] Tried to use `org-agenda-top-headline-filter' in agenda block

2014-04-22 Thread Brady Trainor


Org-mode version 8.2.5h (8.2.5h-137-gc7812f-elpa @ 
/home/iam/.emacs.d/elpa/org-20140421/)


I tried to use `org-agenda-top-headline-filter'.

I have a tree as follows:
  
 /
|   * diary-sunrise, diary-sunset
|   %%(diary-sunrise)
|   %%(diary-sunset)
 \


The syntax I tried was:

(org-agenda-top-headline-filter "diary-sunrise, diary-sunset")

That is, in the following: (might need `(require 'org-agenda)'.)

#+BEGIN_SRC emacs-lisp
(org-add-agenda-custom-command
 '("zs" "sunrise, sunset"
   agenda ""
   ((org-agenda-files '("/e/org/zeus.org"))
(org-agenda-prefix-format "%t %s")
(org-agenda-span 'week)
(org-agenda-start-on-weekday nil)
(org-agenda-use-time-grid 'nil)
(org-agenda-top-headline-filter '("diary-sunrise, diary-sunset"))
)
   ))
#+END_SRC

I'm sure I could easily use a tag, category etc, but I like being able 
to consider all the possibilities as I develop my agenda-views.



%%(Thank you always),

Brady








Re: [O] showing up twice in customize group, "Org Agenda Match View"

2014-04-21 Thread Brady Trainor

On 04/21/2014 01:28 PM, Nick Dokos wrote:

> If you look at the subsequent lines, you'll see that the next group was
> probably cut-n-pasted from this one and has the wrong tag:

> | (defgroup org-agenda-search-view nil

> |   :tag "Org Agenda Match View"

> Nick


Thank you! It's reassuring that I sort of was getting it.

With your find, I've been able to view the missing 
org-agenda-search-view-* vars that I didn't yet have in my grouped list 
of agenda-view/sparse-tree relevant variables.


(They did exist somewhere in my notes, as I made a list of such options 
a while back by looking through every custom-commands example on the 
internet.)


I think these variables should also be missing from the Variable Index 
(a list I'm just rediscovering) in the info pages for Org. Just guessing 
that they should be there.


Brady






[O] showing up twice in customize group, "Org Agenda Match View"

2014-04-21 Thread Brady Trainor


This shouldn't take any priority I imagine, but I am curious what causes 
it.


If you execute

M-x customize-group org-agenda RET

at bottom you will find two appearances of subgroup `Org Agenda Match 
View', which I assume is not desired result.


I think this must somehow result from Emacs' auto-documentation.

Traveling through describe-function (for the contents 
"org-agenda-tags-todo-honor-ignore-options"), I arrive at agenda.el, and 
do some grepping. I found this, but I can't see anything wrong with it's 
lone appearance,

 
/

(defgroup org-agenda-match-view nil
  "Options concerning the general tags/property/todo match agenda view."
  :tag "Org Agenda Match View"
  :group 'org-agenda)

\

Maybe I should have been doing some grepping elsewhere, but I'm lazy to 
go digging through Emacs source, which is probably in compiled form on 
this install (Linux. In my Windows install, default is for the source to 
be conveniently (inefficiently?) adjacent to the compiled.).



Brady




Re: [O] calfw-org, view single org file; very ugly hack

2014-04-21 Thread Brady Trainor

On 04/19/2014 11:33 PM, Bastien wrote:

Brady Trainor  writes:


Was there a better way (outside of joining development of
calfw-org)?


PS: Joining forces for development always seems like a good idea :)




Of course, Bastien you have answered this question well in 2007. Link:

http://lists.gnu.org/archive/html/help-gnu-emacs/2007-10/msg00708.html

That is, I tried several things, and I'm ending up with pretty much the 
recipe you describe.



I can use icalendar.el to simply convert .ics files to diary format.

I can cut and paste between a diary and org-mode file if I want to. I 
can simply edit the .ics calendar from another app if I feel it's 
easier. I could even view the .ics file in Emacs with calfw-ical. I 
could compare these dates with plain text (diary and org-mode), 
calfw-ical, calfw-cal, calfw-org, and agenda-view.


I found the org-caldav too limiting in the syntax, as I'd like the 
freedom to use more diary sexp in my org files (won't allow times with 
diary sexp at this time). My use of org-mode is just to organic right 
now, so I prefer less restrictions by my use of .ics files. There seem 
to be many ical2org scripts out there, but I think I'd prefer at this 
point to just shoot for a cleaner break between .ics and Emacs formats.


I do find the conversion from .ics to diary to be sufficient, and will 
probably use this to empty out my .ics files from time to time and keep 
records in plain text diary format.


I think this is more or less a simple enough and effective system for my 
needs for now. And it should be flexible enough as well, if I want to 
try a different calendaring system down the road.



Brady



#+BEGIN_SRC dot :file ./gv/caldiagram.png :cache yes :cmdline -Tpng
digraph {
{ rank = same
orgmode
diary
}
gcal -> ics [ dir = "both" label = "GCALDaemon (sync)" ]
// owncloud -> ics2 [ dir = "both" ]
// ics2 -> orgmode [ dir = "both" label = "org-caldav" ]
// ics2 [ label = "ics" ]
ics -> diary [ dir = "both"
  label = "icalendar.el (manual)"
  ]
diary -> agendaview
// orgmode -> ics [ constraint = false
// label = 
"org-export-icalendar-combine-agenda-files"

// ]
orgmode -> agendaview
// diary -> calendar
diary -> calfw
ics -> calfw
orgmode -> calfw [ constraint = false ]
}
#+END_SRC




[O] sifted for agenda-view, sparse-tree underlying commands

2014-04-20 Thread Brady Trainor


goal: to make better use of agenda-views and sparse-trees

strategy: to better understand what customization would be possible, 
should I need to consider them at some point (or even to be able to 
think about what commands they each are based on)


difficulty: planning out exactly how I'll use them

strategy: to have made the notes I made today, and keep them for 
reference as I slowly increase my use of these functionalities


action: send a copy of my notes from today to the gmane list, to feel a 
sense of accomplishment, pick a point at which to put this on the 
backburner, and put something up that I think I would have found useful 
as I was developing my use of these.


funny observation: would have been a while before I noticed what happens 
if you hit `C-c / c c c c c c c c c ...'


complement me: please feel free to find a way to parse this perspective 
into the worg or similar, or reinterpret for us.


(oops if someone already did this)

--

** the short list of relevant commands encountered in org-agenda, 
org-agenda-custom-commands and org-sparse-tree:


_org-agenda_
org-agenda-list
org-search-view
org-todo-list
org-tags-view
org-store-agenda-views

_org-agenda-custom-commands:_
org-agenda-list
org-todo-list
org-search-view
org-agenda-list-stuck-projects
org-tags-view
org-match-sparse-tree
org-occur

_org-sparse-tree_
org-sparse-tree
org-check-deadlines
org-check-before-date
org-check-after-date
org-check-dates-range
org-show-todo-tree
org-match-sparse-tree
org-occur

_unmentioned_
org-occur-in-agenda-files

** org-agenda (C-c a)

a org-agenda-list
s org-search-view
S org-search-view
t org-todo-list
T org-todo-list
m org-tags-view
M org-tags-view
e org-store-agenda-views
? org-tags-view nil "+FLAGGED"

** org-agenda-custom-commands (setq)

agenda  org-agenda-list
agenda* org-agenda-list
alltodo org-todo-list
search  org-search-view
stuck   org-agenda-list-stuck-projects
tagsorg-tags-view
tags-todo   org-tags-view
todoorg-todo-list
tags-tree   org-match-sparse-tree
todo-tree   org-occur
occur-tree  org-occur

** org-sparse-tree (C-c /)

corg-sparse-tree (to cycle)
dorg-check-deadlines
borg-check-before-date
aorg-check-after-date
Dorg-check-dates-range
torg-show-todo-tree
Torg-show-todo-tree
T, m org-match-sparse-tree
p, P org-match-sparse-tree
r, R org-occur

*** describe function

t  Show all TODO entries.
T  Show entries with a specific TODO keyword.
m  Show entries selected by a tags/property match.
p  Enter a property name and its value (both with completion on existing
   names/values) and show entries with that property.
r  Show entries matching a regular expression (`/' can be used as well).
b  Show deadlines and scheduled items before a date.
a  Show deadlines and scheduled items after a date.
d  Show deadlines due within `org-deadline-warning-days'.
D  Show deadlines and scheduled items between a date range.

*** brief description in mini-buffer

[/]regexp
[t]odo
[T]odo-kwd
[m]atch
[p]roperty
[d]eadlines
[b]efore-date
[a]fter-date
[D]ates range
[c]ycle through date types:
all"all timestamps"
scheduled  "only scheduled"
deadline   "only deadline"
active "only active timestamps"
inactive   "only inactive timestamps"
scheduled-or-deadline  "scheduled/deadline"
closed "with a closed time-stamp"
nil?   "scheduled/deadline"

--



Brady


PS org markup test: /italics/ _underline_ *bold*




[O] Insignificant typo re: `C-c / T' coded cases?

2014-04-20 Thread Brady Trainor


Org-mode version 8.2.5h (8.2.5h-106-gfaa170-elpa @ 
c:/Users/user-name/AppData/Roaming/.emacs.d/elpa/org-20140414/)


TLDR version: Should `?T' not appear twice?

 
/

(defun org-sparse-tree (&optional arg type)
...
(cond
...
 ((equal ans ?T)
  (org-show-todo-tree '(4)))
 ((member ans '(?T ?m))
  (call-interactively 'org-match-sparse-tree))
 ((member ans '(?p ?P))
...

\


Longer version: (if my confusion was not clear yet.)

In the above code from org.el, I don't understand what the (?T ?m) pair 
are doing, as there is a ?T in the previous block.


Wouldn't the second appearance of T never be checked for? If I press T, 
I should just get

"Show entries with a specific TODO keyword."
and not
"Show entries selected by a tags/property match."
which the m would give. (Sentences from describe function.)

Am I reading the code correctly?



Brady




Re: [O] (OT) How to follow a mailing list with very high activity (like this one here)?

2014-04-17 Thread Brady Trainor

On 04/16/2014 12:28 PM, M wrote:

This is off-topic, but I hope that someone can give me some good advice:


TLDR version:  I've decided to go with newsgroup rather than subscribe, 
and Thunderbird rather than GNUS.


have we established the following ?
3 routes:
 - subscribe to mailing list with your email address
 - simply view the newsgroup
 - RSS
Some apps:
 - Gmane website
 - MS Entourage
 - Emacs GNUS
 - Wanderlust
 - Thunderbird

It was right on topic for me, I was thinking about writing a similar 
question for the last week or so.


However, I don't think I'll make it all the way to mailing list sorcerer 
in one fell swoop.


I did finally get Emacs GNUS working yesterday (ugh, in January I 
decided it wasn't possible with my account), but I couldn't get 
comfortable in it fast enough. I'm tentative about subscribing, so I 
tried to learn how to be a GNUS _newsgroup_ sorcerer. But before I made 
much progress, I found mention that Thunderbird could operate as a 
newsreader, so I'm now using that, and it's nice enough for me, for now.


I would like to learn to better use GNUS at some point.


Brady

The extended version:

I was using almost exclusively the Gmane website, which was fine as it 
was easy to encounter during google searches, but it was not great for 
emailing the list. For one, it seemed to be double spacing my carefully 
crafted messages.


I do like the easy fashion in which I can star messages in Thunderbird, 
and I can take a gradual approach to the learning curve as far as 
controlling which messages I can see or exist, while using the 
beginner-friendly CUA style.


But now that I've achieved a vast improvement over using just the Gmane 
website, I will be reading carefully for set ups that work even better.









[O] sharing my firsts, org babel tangle and "init" .org file

2014-04-17 Thread Brady Trainor


Have you migrated your init files into .org file(s)? What's your setup?

Below is my first setup for fellow newbs, or for the interested 
developer. And please let me know if I'm missing some logic or 
conventions/practices.


In the short history of my Emacs init file evolution (~ oct '13), I had 
considered packages like dot-emacs.org, but for some reason had not 
succeeded (I thought it had demanded Emacs 24.3.50+, but I don't see 
that in the description now).


So when I recently felt motivated to try such a .org Literation of my 
init files (my project of making agenda custom commands and capture 
templates was starting to topple), I tried let's say a more basic approach.


I worked mostly from the tutorial in
Babel: Introduction / Emacs Initialization with Babel

http://orgmode.org/worg/org-contrib/babel/intro.html#emacs-initialization

It took just a little wrestling with a clean tty2 Emacs, but here is my 
interpretation of a "minimal" setup for initializing via org babel 
tangling:


 
/

 make sure org has been installed in an "emacs -q"

(require 'package)
(package-initialize)
(require 'org)

;; declare org indentation before we might manually open org to tangle
(setq org-startup-indented t)
(setq org-hide-block-startup t)
;; declare source indentation before we might manually open org to tangle
(setq org-src-fontify-natively t)
(setq org-edit-src-content-indentation 0)

;; default I/O in windows is undecided-dos/unix for de/encoding respectively
(prefer-coding-system 'utf-8-unix)

;; load org initialization files
(require 'ob-tangle)
(org-babel-load-file "/e/emacs-config/dot-emacs-test.org")

\


Some of those aren't necessary but for aesthetics before manually 
stepping through lines for testing the initialization (starting emacs -q 
tangling and/or executing one-by-one).


The character encoding is there as I have some utf-8 Fahrenheit symbols 
in my (.org) init file.


Initially (while troubleshooting) I had some dired customizations 
(vertical omit, horizontal hide), font family and color-theming in this 
code block, as I have a hard time looking at plain Emacs for too long.


You may also want to toggle some tangles in your (first ever) init file, 
this can be done per file, subtree or source block, via


#+PROPERTY: header-args :tangle yes
 or
:PROPERTIES:
:header-args: :tangle no
:END:
 or
#+BEGIN_SRC emacs-lisp :tangle no

And the latter take precendence.


TWIMC, HTH

Brady




[O] undocumented? struggled with category filter on daily/weekly agenda view custom command.

2014-04-15 Thread Brady Trainor


Goal: To make an agenda view custom command that will filter a daily/weekly
view by category. 


I tried to use the documented `org-agenda-category-filter-preset', similar
to functionality of the analogous tag variable,
`org-agenda-tag-filter-preset'. It does not seem to work. However, a word
search in the `org-agenda.el' file uncovered an undocumented variable
`org-agenda-category-filter', which seemed to do the job for me. 

(That is, `C-h v' on the latter leads to "Not documented as a variable.") 

Am I using the right variable for the job? I do not really understand the
"preset" nomenclature. Does this mean it should only be used on the global
block, as opposed to say inside of `(agenda "" ...)'? 



Here are some minimal examples I used to work out where my issue was: 

 
/

(setq 
 org-agenda-custom-commands 
 '(("r" 
"the real test" (
 (agenda "")
 (todo "")
;; +CATEGORY=\"acat\"
 )(
   (org-agenda-files
'("/e/emacs-config/therealagendatest.org"))
   ;; (org-agenda-filter-preset '("+acat"))
   (org-agenda-category-filter '("+acat"))
   

\
/

* TODO an appt
<2014-04-15 Tue>
* TODO a test todo :acat:
:PROPERTIES:
:CATEGORY: acat
:END:

\


- Brady







Re: [O] New headline after no content (empty headline)

2014-04-01 Thread Brady Trainor


On 3/30/2014 10:55 PM, Bastien wrote:

Hi Brady,

Brady Trainor  writes:


For `org-insert-heading' (M-RET), I wanted the following action on empty
headlines:

"* " |--> "* \n* ", rather than "*\n* ".


I'm not sure I understand this, can you make it more explicit?

Thanks!



I mean that if I use org-insert heading on an empty headline, it removes 
the space after asterisk(s). This then means that what was previously an 
empty heading (with a space), becomes just asterisk(s) no longer 
interpreted by org-mode as a heading.


I concluded that the space was removed by 
org-N-empty-lines-before-current function, where `(unless (looking-back 
"\* \n")...` prevents `org-N-...` from removing that space.


Thank you,

Brady



Re: [O] [PATCH] No title in org-export-as-odt

2014-03-27 Thread Brady Trainor
Bastien  gnu.org> writes:

> Brady Trainor  uw.edu> writes:
> 
> > For my solution, I changed insert to ignore. 
> 
> Can you provide your change in the form of a patch?
> 

> 4. in Emacs, hit `C-x v =' from the file to create the patch


I wanted to return to this and attempt it, here is my first patch ever: 


diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index da2ca3f..8c7f0fe 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -1491,7 +1491,7 @@ original parsed data.  INFO is a plist holding export 
options."
   (goto-char (match-beginning 0))

   ;; Preamble - Title, Author, Date etc.
-  (insert
+  (ignore
(let* ((title (org-export-data (plist-get info :title) info))
   (author (and (plist-get info :with-author)
(let ((auth (plist-get info :author)))


I installed a fresh version of org-mode from Elpa or Melpa before doing 
this. (I am just now looking a little into the maint branch.)

In the long-long run, when I go to insert the code, I wonder why we don't 
make removing the title an option in ox.el. Otherwise, I might've 
considered figuring out how to expose the above ad-hoc solution as a 
variable in the customize group. I don't know what the use cases are for 
the title. So, a temporary solution might go, org-odt-export-preamble off 
and on.

(ETA: then, perhaps the individual exporters should be focused on, before 
considering pulling variables back to ox.el.) 

Thank you always for org-mode,

Brady

P.S., so... I went ahead and tried the exposed variable fix, and that is 
below: (This was my first shot at making a Emacs customizable variable, 
blindly with no RTFM, and... I don't think it works as is.) 

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index da2ca3f..c2b4609 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -351,6 +351,16 @@ the entity.  See `org-odt--enumerate'.")
   :group 'org-export)


+ Insert Preamble (Title, Author...)
+
+(defcustom org-odt-insert-preamble 'nil
+  "Choose whether title and author preamble appears in export."
+  :group 'org-export-odt
+  :version "24.1"
+  :type 'boolean
+  )
+
+
  Debugging

 (defcustom org-odt-prettify-xml nil
@@ -1491,6 +1501,7 @@ original parsed data.  INFO is a plist holding export 
options."
   (goto-char (match-beginning 0))

   ;; Preamble - Title, Author, Date etc.
+  (if org-odt-insert-preamble
   (insert
(let* ((title (org-export-data (plist-get info :title) info))
   (author (and (plist-get info :with-author)
@@ -1543,7 +1554,7 @@ original parsed data.  INFO is a plist holding export 
options."
(org-odt--format-timestamp (car date))
  (org-export-data (plist-get info :date) info)))
;; Separator
-   ""))
+   "")))
   ;; Table of Contents
   (let* ((with-toc (plist-get info :with-toc))
  (depth (and with-toc (if (wholenump with-toc)







Re: [O] New headline after no content (empty headline)

2014-03-27 Thread Brady Trainor

Bastien  gnu.org> writes:

> ---does the Org version that comes from the maint branch 
> still needs a fix?  If so, can you describe the problem
> again?


I did test the `maint` branch today. The behavior was not ideal for my 
funny use-case.

For `org-insert-heading' (M-RET), I wanted the following action on empty 
headlines:

"* " |--> "* \n* ", rather than "*\n* ".

This patch may be suitable:

(org.el)

==

diff --git a/lisp/org.el b/lisp/org.el
index 6d6fbeb..86eb347 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7685,9 +7685,10 @@ This is important for non-interactive uses of the 
command."
 So this will delete or add empty lines."
   (save-excursion
 (goto-char (point-at-bol))
-(if (looking-back "\\s-+" nil 'greedy)
-(replace-match ""))
-(or (bobp) (insert "\n"))
+(unless (looking-back "\* \n")
+  (if (looking-back "\\s-+" nil 'greedy)
+  (replace-match ""))
+  (or (bobp) (insert "\n")))
 (while (> N 0)
   (insert "\n")
   (setq N (1- N)

==

Thank you!

Brady










Re: [O] New headline after no content (empty headline)

2014-03-22 Thread Brady Trainor
Bastien  gnu.org> writes:

> 
> Hi Brady,
> 
> Brady Trainor  uw.edu> writes:

> >   (when respect-content

> > (and (looking-at "[ \t]+") (replace-match ""))

> > I thought to try substituting "[ \t]+" with "[\t]+", and byte compiled the 
> > file. But this did not solve.

> What you want is not to remove only tabs, but to prevent removing
> whitespaces when the string before the point matches "^\*+" -- so
> that's what I did with this patch:
> 
> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=afffe03d

Thank you much for taking the time to fix my fix and add the patch. 

However, my fix was wrong, I should not have been looking inside the
=respect content= case. My original intention was to modify the
=insert-org-heading=, not =org-insert-heading-respect-content=. I was that
lost. 

Your help and encouragement pushed me to find the `source` of my problem. 
For this, I looked for ways to step through the code, ala some type of
debugger, and I fell upon Emacs' default, Edebugger. (Simply reading org.el
was, um, not efficient by itself.)

So, I "instrumented" the =defun=s, in the end both of =org-insert-heading=
and =org-N-empty-lines-before-current= (via =C-u C-M-x=) and deleting
org.elc. This way, testing =M-RET= in an org file, I could =SPACE= through
org.el while watching the org file buffer for changes (and *Messages*,
though that was more or less awkward for me). 

So, here are my changes that give me my desired behavior, modifying in the
function =org-N-empty-lines-before-current= which follows right after
function =org-insert-heading=. 

Originally

(if (looking-back "\\s-+" nil 'greedy)
(replace-match ""))
(or (bobp) (insert "\n"))

I changed this to 

(unless (looking-back "\* \n") ; don't damage empty headlines
  (if (looking-back "\\s-+" nil 'greedy)
  (replace-match ""))
  (or (bobp) (insert "\n"))
  )

This feels a bit ad-hoc, as I don't completely understand all the stuff even
in =defun org-insert-heading...=, and likely a fix should be made taking
into account all desired functionality (but I'd worry to break something
else). Let's call it organic! /Someday/, I'd like to understand the org.el
better. 

I haven't learned how to patch, I've barely started gitting about a month
ago for backing up files. I guess I should clone the Org-mode source soon,
for starters. 

Thanks again! 

Brady




[O] New headline after no content (empty headline)

2014-03-15 Thread Brady Trainor


I am revisiting a workflow that I have a hard time letting go of, despite 
it's unintended use in Org-mode. 

That is, I like to visually separate groups of headlines by simply having a 
couple of empty headlines. This allows more nimble and simple use-case of 
manually sorting buildup of headlines by quick and flexible tagging (and 
easy removal of such), and minimal visual aid of a couple empty headlines. 

This way, I can so sorting and orienting of tasks without much commitment, 
allowing me to start the process all over again quickly if I feel I 
didn't "rotate my space" the right way. 

My problem is that using the default new headline commands, it removes the 
whitespace from previous lines, so "* " becomes "*\n* ", instead of my 
desired "* \n* ". 

So, I started trying to read the org.el file. I thought I had found 
the "offending" line, (my L7614,) finding 

  ;; If we insert after content, move there and clean up whitespace
  (when respect-content
(org-end-of-subtree nil t)
(skip-chars-backward " \r\n")
(and (looking-at "[ \t]+") (replace-match ""))
(unless (eobp) (forward-char 1))
(when (looking-at "^\\*")
  (unless (bobp) (backward-char 1))
  (insert "\n")))

I thought to try substituting "[ \t]+" with "[\t]+", and byte compiled the 
file. But this did not solve. 

So, I never like to ask a question without having an answer myself, so I 
learned a little more enough about keyboard macros to generate the 
following somewhat simple and natural solution (natural in that it uses a 
similar unused key chord): 

(fset 'new-starred-line
  [return ?* ? ])
(global-set-key (kbd "C-M-") 'new-starred-line)


So, what is my question? What am I lacking in my .el package reading 
skills? Why did my first fix not work? As a newb program hacker, am I 
approaching this right? Maybe best case is to understand more of the entire 
org.el file, but was trying to hack just enough. What would you have done? 


Regards, 

Brady








Re: [O] No title in org-export-as-odt

2014-01-26 Thread Brady Trainor
Miguel Ruiz  yahoo.es> writes:

> > > Any hint to get rid of the title in a org-export-as-odt
> > session?

I had the same problem. I noticed a lot of new lines, `\n', so I tried to
remove more than "just title". For my solution, I changed insert to ignore. 


  ;; Preamble - Title, Author, Date etc.
  (ignore 

changed insert to ignore
   (let* ((title (org-export-data (plist-get info :title) info))
  (author (and (plist-get info :with-author)
   (let ((auth (plist-get info :author)))
 (and auth (org-export-data auth info)
  (email (plist-get info :email))
  ;; Switch on or off above vars based on user settings
  (author (and (plist-get info :with-author) (or author email)))
  (email (and (plist-get info :with-email) email)))
 (concat
  ;; Title.
  (when title
(concat
 (format "\n%s"
 "OrgTitle" (format "\n%s" title))
 ;; Separator.
 "\n"))



This was in .emacs.d/elpa/org-[...]/ox-odt.el, that is, org export to odt.
Also, not sure if it was necessary, but I deleted ox-odt.elc, the compiled
version. 


Brady 


> 
> org-odt-format-preamble function says:
> 
> ...
> (when title
>(concat
> (org-odt-format-stylized-paragraph
>  'title (org-odt-format-tags
>  '("" . "") title))
> ;; separator
> ""))
> ...
> 
> So I only need to find a way to assign nil to title variable inside the
document.
> 
> Also I might define a new option with org-export-inbuffer-options-extra,
but the elaboration of the
> function is beyond my knowledge.
> 
> I would appreciate any idea.
> 






[O] Which `odt-content' variable should I use? Why are there two?

2014-01-26 Thread Brady Trainor

I was browsing the customize group org-export-odt. 

I found two variables that seem to do the same thing. 

In org-odt.el, we have
  org-export-odt-content-template-file

while in ox-odt.el, we have 
  org-odt-content-template-file

Do I need to worry about this. Will org-export check both locations, or will
one take precedence somehow? (As in, if one is `nil', will it more or less
have no effect on the other?) 

I imagine I could do some print variable testing to discover on my own, but
also wanted to see if comments would be enlightening to my understanding in
general. 

- Brady 

(learning Emacs because I found Org-mode; "programmer") 




[O] Capture for beginners. Dissecting the default template.

2013-12-19 Thread Brady Trainor
Basically, this is a brain dump. Please offer any advices you think of. 



In efforts to learn to use capture, I decided to try to understand the 
defaults. I will mention the location defaults, and the default template. 



At this time, all of my org-files are in one folder, so I decided to start 
with a tester file for captures in the same folder, with name: 



org-default-notes-file "./capturetest.org"



(for total newbs, the dot slash refers to the current folder). 



I also went with the common suggestion for the key binding of 



(define-key global-map "\C-cc" 'org-capture)



(added directly to .emacs file). 



I then attempted to understand how the default template worked, and how to 
recreate it in the Customize interface buffer. 



- key: t

- description: Task

- type: entry

- target location: File & Headline

  - File:  

  - Headline: Tasks

- Template: here was the tricky part. 



First I had to realize that the * was necessary (skimming for examples in 
the documentation). Then, I struggled to figure out how to get the newline 
in there. I could go to the .emacs file and add \n manually, but how to add 
it in the customize buffer. My current solution is to use M-x newline  
(not sure if there is a default key binding for this). 



Thus, I believe the default template can be arrived at via: 



* TODO M-x newline  %t M-x newline  %a 



I now feel more ready to start making my own templates, for instance, my 
first templates might be entries with certain headlines, prompt for tags, 
the date added, but for now still heading to the capturetest file. 



That is, for instance, 



- Headline: tech-related

- Template: * %^G\n%t



Brady








[O] ("Cannot open load file" "org-fstree") vs (babel, windows, shell)

2013-12-13 Thread Brady Trainor
* ("Cannot open load file" "org-fstree") vs (babel, windows, shell)



long story short, fstree strategy leads to "cannot open load path", babel 
route is only explained for I believe Linux version. Ad-hoc solution with 
Windows command prompt, cut and paste directory structure. 



** org tree issues



was trying to have a view of some folder structures from within org-mode

found this: 

http://thread.gmane.org/gmane.emacs.orgmode/17527/

Saw two strategies based on two replies, will detail my attempts

*** Matt Lundin's

http://thread.gmane.org/gmane.emacs.orgmode/17527/focus=17538

Not sure what it will look like, found this image, but not sure if 
additional function will be available in fstree

http://digit.lk/old/beta5/sites/default/files/Gaveen-fstree.png

here are my attempts: 

 debugging fstree install

* first attempt

** steps taken: 

- followed directions at

  - http://thread.gmane.org/gmane.emacs.orgmode/17527/focus=17768

  - http://burtzlaff.de/org-fstree/ and

  - http://burtzlaff.de/org-fstree/README.org

that is, I used list-packages to find package and install it, 

then found location, added it to .emacs file, as displayed in following 
section

** code added to .emacs file: 

(setq load-path (cons "~\.emacs.d\elpa\org-fstree-20090723.819\org-
fstree.el" load-path)) 

(require 'org-fstree)

** error report

Debugger entered--Lisp error: (file-error "Cannot open load file" "org-
fstree")

  require(org-fstree)

  eval-buffer(# nil "c:/Users/user-
name/AppData/Roaming/.emacs" nil t)  ; Reading at buffer position 1833

  load-with-code-conversion("c:/Users/user-
name/AppData/Roaming/.emacs" "c:/Users/user-name/AppData/Roaming/.emacs" t 
t)

  load("~/.emacs" t t)

  #[0 "\205\262

* second attempt:

** download manually into:

.emacs.d

** modify load path in .emacs file

** see if there is an error on initialization

indeed, get: 



Debugger entered--Lisp error: (file-error "Cannot open load file" "org-
fstree")

  require(org-fstree)

  eval-buffer(# nil "c:/Users/user-
name/AppData/Roaming/.emacs" nil t)  ; Reading at buffer position 1837

  load-with-code-conversion("c:/Users/user-
name/AppData/Roaming/.emacs" "c:/Users/user-name/AppData/Roaming/.emacs" t 
t)

  load("~/.emacs" t t)

  #[0 "\205\262



*** Sebastian Rose's

http://thread.gmane.org/gmane.emacs.orgmode/17527/focus=17768

 babel cmd-type attempt

problem seems to be that windows does not have same shell, so i try it 
manually next

#+begin_src sh :results output :exports results

  echo "Directory structure:"

  tree ~/.emacs.d/

#+end_src

 cmd line: tree /A > tree.txt

which results in (copying and pasting into environment): 

#+BEGIN_EXAMPLE

Folder PATH listing for volume something

Volume serial number is something

C:.

+---something

|   +---something

|   |   +---something

|   |   |   \---something

|   |   \---something

|   \---something

|   +---something

|   |   \---something

|   \---something

+---something



#+END_EXAMPLE

 is there any way to get this going in windows? perhaps with python or 
another language that can get to windows folder structure





** P.S. 



Why would I want to do this? As I attempt to fit my entire universe into 
this org-mode contraption I recently found, I've decided for now to leave a 
few things just outside the fort, and have a visual map of the outside file 
structure handy within org. 




Re: [O] hyperlink to customize

2013-12-10 Thread Brady Trainor
Nick Dokos  gmail.com> writes:



> Yes, you will be happiest when you are assimilated  



:borg: 



> > Would be nice to have org versions of all info files. 

> 

> [...] why do you

> want to have org versions of all info files? What would the benefits

> be?

> 

>  [...] But rewriting

>existing texinfo documentation in org just does not seem to

>provide many (or even any) benefits.



(disclaimer: my naïve impression) 



- clarifications

  - maybe not /all/ info files should be converted

- elisp and maybe the main Emacs manuals may be considered more pivotal 
to all users and all modes 

  - maybe only a conversion to outline mode? 

- I don't know if that has the potential for hyperlinks, but may supply 
all the info functionality; is outline mode "lighter"?  

- drawbacks

  - slow (large elisp info file in org) 

  - hard to convert info to org? 

- positives

  - another way to look at the info (like a change of coordinates ;) ) 

- org's outline mode supplies one less step between browsing the 
section titles and reading the content in unfolding, easier to navigate



especially, there is the effect that it may be hard to know where to look 
for a possible elisp command, and so the more aids in browsing for that 
command, the better. 










Re: [O] hyperlink to customize

2013-12-10 Thread Brady Trainor
Brady Trainor  uw.edu> writes:



> 

> [...] I think I'll Pandoc the manual into org to practice the manual's 

> 

> navigation. 

> 

> 



Converting the html version to org met with some difficulties, such as 
carriage returns and pandoc giving an overflow. 



Should probably just get comfortable with the info version of elisp manual. 
Would be nice to have org versions of all info files. 




Re: [O] hyperlink to customize

2013-12-10 Thread Brady Trainor


Nick Dokos  gmail.com> writes:

> 

> Brady Trainor  uw.edu> writes:

> > synopsis: want (clickable) customize to open in a new frame  

> >

> 

> Fiddling with the following variable may help (NB: untested,

> and no time to dig, so I may be leading you up the garden path):

> 

> ,

> | org-link-frame-setup is a variable defined in `org.el'.

...

> 

> Nick

> 

> 

Thank you Nick! Last night I received an email (from a gmaner) with a 
working solution: 

[[elisp:(with-selected-frame (get-other-frame) (customize))]]

(I add a `[customize]` label).  

To try to hypothesize how I might have put this together, I was close, as 

original post mentioned Input Focus in the Emacs Lisp documentation. That 

page links to Selecting Windows, where we find the main function that I was 

missing. I think I'll Pandoc the manual into org to practice the manual's 

navigation. 






Re: [O] hyperlink to customize

2013-12-09 Thread Brady Trainor
> elisp:customize

> 

> should also work as a link, even without the brackets. 



> [...] so the question

> is why it does not work for you.





It does work, I was wrong. 



That is, `elisp:customize` does in fact work for me. 



Not sure if I should start a new thread for the following. 



--- 

synopsis: want (clickable) customize to open in a new frame  



---



I am currently having most of my links open in a new frame, a la



 '(org-link-frame-setup (quote ((vm . vm-visit-folder-other-frame) (vm-
imap . vm-visit-imap-folder-other-frame) (gnus . org-gnus-no-new-news) 
(file . find-file-other-frame) (wl . wl-other-frame



I have tried to get my link to customize to open in a new frame, but do not 
know how to code, in particular in Emacs Lisp. 



I have considered the following elements that may play a role in a 
solution, but am not sure how to combine them, or what else to look for. 



I've considered the elisp manual, and looked at lists, macros, functions, 
in-line functions, creating frames, input focus and lamda calculus. 





This is probably my most complex attempt:



  [[elisp:(make-frame after-make-frame customize)]]



But it does not work. 





http://www.gnu.org/software/emacs/manual/html_node/elisp/index.html#Top

http://www.gnu.org/software/emacs/manual/html_node/elisp/Lists.html#Lists

http://www.gnu.org/software/emacs/manual/html_node/elisp/Macros.html#Macros

http://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-
Frames.html#Creating-Frames

http://www.gnu.org/software/emacs/manual/html_node/elisp/Input-
Focus.html#Input-Focus






Re: [O] hyperlink to customize

2013-12-09 Thread Brady Trainor
Nick Dokos  gmail.com> writes:



> 

> Brady Trainor  uw.edu> writes:

> 

> >

> > So, my naïve attempt is to use 

> >

> >

> >

> > elisp:customize

> >

> >

> 

> so to call it from an elisp link, you say

> 

> [[elisp:(customize)]]





Thank you for the speedy reply and solution! 

















P.S. 



However, I am curious why I get away with 



  file:~/.emacs, 



but not 



  elisp:(customize)



That is, I can get away with not using square brackets for the file, but we 
need



  [[elisp:(customize)]]



Not a priority, just a mild curiosity. 



(Now that I think about it, in my troubleshooting, I had tried elisp:(...), 
but the linking broke so I should have thought to add the brackets. Drat.) 














[O] hyperlink to customize

2013-12-09 Thread Brady Trainor


As I climb the org-mode (and Emacs) learning curve, I like to have things 
like hyperlinks to frequently visited places available. 



I can link to info, but not sure how to link to the customize, er, mode? 
buffer? 



I assume I should consider it an external link, or anyways assume I should 
use the elisp:blah method from http://orgmode.org/manual/External-
links.html#External-links. 



So, my naïve attempt is to use 



elisp:customize



This does not work, any ideas? Custom links? 




Re: [O] per file face keywords, /in/ file

2013-12-07 Thread brady trainor
Suvayu Ali  gmail.com> writes:


> Try something like this:
> 
>
<https://github.com/suvayu/.emacs.d/blob/master/themes/dark-emacs-theme.el#L16>
> 
> > 
> > ... I would like to adjust colors
> > in-file. 
> 
> I would advise against it.  Personally I think appearance related
> customisations should not be per-file.


Thank you Ali, 

Within a few hours I realized there was little merit in continuing to get a
feel for the keywords in just per-file (stepped out of the main file).
Further, I appreciate your link to a sample of colors, as I am confident you
have pointed me to a great introduction to some good color choices for faces. 

Brady Trainor 

P.S. and I am immensely happy to have found this software and excited about
the possibilities! 




[O] per file face keywords, /in/ file

2013-12-07 Thread brady trainor

(this is my first post here. first, thank you for providing this software,
it seems to have potential for having an optimal effect on my workflow. so
far, it is still just a hobby to learn, but i got a couple things done in
the process.) 

I would like to set keyword faces in file. I have considered the following
information: 

1. Per-file keywords: 
  http://orgmode.org/manual/Per_002dfile-keywords.html#Per_002dfile-keywords
2. Faces for TODO keywords: 
  http://orgmode.org/manual/Faces-for-TODO-keywords.html#Faces-for-TODO-keywords
3. Specifying file variables: 
 
http://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html

First I thought about if there was some way to get colors in to the "#+
TODO:" syntax. 

That is, I considered that 
  #+ TODO: TODO
seems to correspond with 
  (setq org-todo-keyword-faces '(("TODO")))
in the /.emacs file. 

Then, I thought about the desired result of 
  (setq org-todo-keyword-faces '(("TODO" . "yellow")))
and decided there was no way to that with #+TODO: ... 

So I considered directions at the 3rd link above, asking emacs to set the
variable for the file, so in my file, I set: 
  -*-  mode: org; org-todo-keyword-faces: ("TODO" . "yellow"); -*-
This did not work as desired. Also, not sure if there will be some inherent
slowing of startup, as currently this ineffective line of code seems to slow
emacs down. 

Any ideas? 

P.S. Why would I want to do this? In developing my use of org-mode, my use
of keywords is early in it's evolution, so I would like to adjust colors
in-file.