Capture to heading of current cursor

2019-11-05 Thread Nathan Neff
Hello all,

I know I've asked this before, but can't remember the quick & easy path (TM)
to creating an org-capture template which will capture to the current
heading?

It would be cool to simply "re-use" my existing capture templates and
override the
destination to "wherever my cursor is now" -- this would allow me to keep
all the capture
templates and avoid defining new ones with only the target re-defined.

Any ideas?

Thanks,
--Nate


Cannot export org mode to collapsible HTML

2019-11-05 Thread Kris Brown
Hi, I am trying to have basic folding functionality for my org file that
has been exported to HTML. I am using Emacs 26.2 (9.0) and Org 9.1.9 on a
Mac.

This seems to be a built-in feature: JavaScript supported display of web
pages
. I
downloaded my own copy of org-info.js
. However, I cannot see any
difference when I use the #+INFOJS_OPT commands or not (org with
, org without
, html with
, html without
). I would expect to
see collapsible headers and no TOC displayed when I use those commands.

There *is* a difference in the generated HTML files (an extra CDATA region
with a bunch of statements like: *org_html_manager.set("VIEW", "info");*)
but nothing different visually.

Is this happening because org-info.js is no longer being maintained
?
Another solution I saw was Daniel Clemente's tool
,
though I am at a total loss for what to specify in the org file to
incorporate his esquemadorg.js script. I appreciate any help that could let
me export large org files to HTML while having the headers be collapsible.


Babel: command line args in java

2019-11-05 Thread Jarmo Hurri


* Intro
  I am trying to supply command line arguments to java code in
  babel. For this a logical option would be to use ~:cmdline~ header
  argument, but I can not get it to work.

  I really need to process the given values as command line arguments,
  so setting some variable values will not work.

* This does not work
  Because ~ob-java.el~ concatenates ~:cmdline~ before ~:classname~ ,
  the straightforward way fails.

  #+begin_src java :classname ArgumentExample :cmdline hi there org fans 
:results output verbatim 
class ArgumentExample
{
  public static void main (String[] args)
  {
for (String s : args)
  System.out.println (s);
  }
}
  #+end_src

  #+RESULTS:

  The results is
  #+begin_center
  Error: Could not find or load main class hi
  Caused by: java.lang.ClassNotFoundException: hi
  #+end_center

  The reason is this piece of code in ~ob-java.el~
  #+begin_src elisp
(org-babel-eval (concat org-babel-java-command " " cmdline " " classname) 
"")
  #+end_src

* This compiles and runs but not as desired
  The second try is to provide classname as the first argument. But a
  ~:classname~ header is also required, so the end result is not the
  desired one.

  #+begin_src java :classname ArgumentExample :cmdline ArgumentExample hi there 
org fans :results output verbatim 
class ArgumentExample
{
  public static void main (String[] args)
  {
for (String s : args)
  System.out.println (s);
  }
}
  #+end_src

  #+RESULTS:
  : hi
  : there
  : org
  : fans
  : ArgumentExample

* This fix does not work either
  When I try to leave out ~:classname~ , the process fails in early stages.

  #+begin_src java :cmdline ArgumentExample hi there org fans :results output 
verbatim 
class ArgumentExample
{
  public static void main (String[] args)
  {
for (String s : args)
  System.out.println (s);
  }
}
  #+end_src

  #+begin_center
  org-babel-execute:java: Can’t compile a java block without a classname
  #+end_center
* Questions
  1. Is there a correct way of doing this already?
  2. If there is no better way, is this desired behaviour or should it
 be fixed?
  3. If this is desired behaviour, can I write a patch adding a new
 header argument such as ~cmdargs~ ?




Org meta up/down and left/right behavior

2019-11-05 Thread Nathan Neff
Hello all,

I noticed for the first time the difference in the shift key
behavior in the following function groups:

org-meta up/down versus org-shiftmeta up/down
and
org-meta left/right versus org-shift meta left/right

With the up/down behavior the shift key being pressed indicates
that I wish to only bring the main heading up/down.

With the left/right behavior the shift key indicates that I wish
to bring the entire subtree left / right.

This behavior seems to be inconsistent -- am I correct?  I noticed this
only
today - I use the left/right behavior the most often and map the shift key
to mean
"Take the entire subtree".  Today I was moving some headlines up/down and
noticed
this difference.

Has anyone made this behavior consistent by mapping keys or some other
method?  It seems
that changing these specific mappings could impact other aspects (e.g.
table rows) which may
cause other inconsistencies -- thus the difference in behavior of the shift
key :-)

Thanks,
--Nate


Re: How to move from inline tasks to drawers? [was: How to change the width of a latex exported inlinetask?]

2019-11-05 Thread Fraga, Eric
Again, very impressive.

I do some of this with drawers but there could indeed be much more
support built-in for such aspects.  Navigating drawers in org mode
should be easier.
-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.6-552-g8c5a78



Re: org-timer-set-timer from any buffer

2019-11-05 Thread Marco Wahl
ian martins  writes:

> Is it intentional that org-timer start, stop, and pause-or-continue all
> work from any buffer, but org-timer-set-timer only works from an org buffer?

I bet $1 that this is unintentional.  If it was intentional this should
have been documented, I think.  Possibly you are the first noticing this
inconsistency.







Re: How to move from inline tasks to drawers? [was: How to change the width of a latex exported inlinetask?]

2019-11-05 Thread John Kitchin
The other aspects I find very useful are: 1) there is a display list so I
can see all the editmarks and jump to them. That way, in a proposal for
example I can see if there are any residual marks that should be removed.
2) when I make a pdf, they are converted to a list of todo items at the
front, and as margin notes. This reminds me that they are there, and is
useful for non-org users to see what I need and where.

John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Tue, Nov 5, 2019 at 8:07 AM Fraga, Eric  wrote:

> On Tuesday,  5 Nov 2019 at 07:49, John Kitchin wrote:
> > I use it when editing papers mostly. The main difference is I can put
> > them inline {>~ @jk here is a comment.~<} in a paragraph.
>
> Very interesting.  The inline aspect can be quite useful.  Thanks for
> the description!
>
> --
> Eric S Fraga via Emacs 27.0.50, Org release_9.2.6-552-g8c5a78
>


Re: How to move from inline tasks to drawers? [was: How to change the width of a latex exported inlinetask?]

2019-11-05 Thread Fraga, Eric
On Tuesday,  5 Nov 2019 at 07:49, John Kitchin wrote:
> I use it when editing papers mostly. The main difference is I can put
> them inline {>~ @jk here is a comment.~<} in a paragraph. 

Very interesting.  The inline aspect can be quite useful.  Thanks for
the description!

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.6-552-g8c5a78



Re: How to move from inline tasks to drawers? [was: How to change the width of a latex exported inlinetask?]

2019-11-05 Thread John Kitchin
I use it when editing papers mostly. The main difference is I can put
them inline {>~ @jk here is a comment.~<} in a paragraph. I use them to
mark {>.tpyos.<}, text for {>-deletion-<} removal, or {>+insertion+<},
{y>highlighted text  writes:

> On Monday,  4 Nov 2019 at 15:14, John Kitchin wrote:
>> I have been exploring the use of something I call editmarks for this
>
> Out of curiousity, what do these give you that drawers would not?  I use
> :todo: and :note: drawers.
>
> For syntax highlighting, I use hi-lock-mode with, for instance, this
> pattern to highlight todo drawers:
>
> # Hi-lock: (("^:todo:" (0 'hi-yellow prepend)))
>
> thanks,
> eric


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



org-timer-set-timer from any buffer

2019-11-05 Thread ian martins
Is it intentional that org-timer start, stop, and pause-or-continue all
work from any buffer, but org-timer-set-timer only works from an org buffer?


Re: How to move from inline tasks to drawers? [was: How to change the width of a latex exported inlinetask?]

2019-11-05 Thread Fraga, Eric
On Monday,  4 Nov 2019 at 15:14, John Kitchin wrote:
> I have been exploring the use of something I call editmarks for this

Out of curiousity, what do these give you that drawers would not?  I use
:todo: and :note: drawers.

For syntax highlighting, I use hi-lock-mode with, for instance, this
pattern to highlight todo drawers:

# Hi-lock: (("^:todo:" (0 'hi-yellow prepend)))

thanks,
eric

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.6-552-g8c5a78