Re: [O] Help with "macro"

2019-10-12 Thread Adam Porter
Nathan Neff  writes:

> I'm trying to implement a function to display the TODO items of the
> currently highlighted item in the agenda and have a few questions:
>
> Goal:
>
> 1) From the agenda, place the cursor on a heading.
>
> 2) Press a key and instantly narrow the agenda to the heading which
> the cursor is on.
>
> 3) Display org-todo-list for the "narrowed" item in a new buffer, with
> the name "agenda for " or perhaps "agenda for  "PROP" of the narrowed item"
>
> 4) Keep the existing original agenda view (using sticky or some other
> tactic).

Agenda restrictions are awkward to work with.  I recommend using org-ql
for this sort of thing, since it's designed to do things like this.
This seems to work:

(defun nn/agenda-item-todos ()
  (interactive)
  (org-with-point-at (org-get-at-bol 'org-marker)
(save-restriction
  (org-narrow-to-subtree)
  (org-ql-search (current-buffer)
'(todo)
:narrow t




Re: [O] Help with "macro"

2019-10-12 Thread Nathan Neff
I'm getting there - I found

(org-element-property :PROJ (org-element-at-point)) from a regular org-mode
file -
now I just need to jump there from the agenda.

On Sat, Oct 12, 2019 at 12:18 PM Nathan Neff  wrote:

> I'm trying to implement a function to display the TODO items of the
> currently highlighted
> item in the agenda and have a few questions:
>
> Goal:
>
> 1) From the agenda, place the cursor on a heading.
> 2) Press a key and instantly narrow the agenda to the heading which the
> cursor is on.
> 3) Display org-todo-list for the "narrowed" item in a new buffer, with the
> name "agenda for " or perhaps "agenda for  the narrowed item"
> 4) Keep the existing original agenda view (using sticky or some other
> tactic).
>
> Here's what I have so far:
> (defun njn-show-tasks-for-project()
>(interactive)
>;; (setq preval org-agenda-sticky)
>;; (message "preval is: ")
>(call-interactively 'org-agenda-set-restriction-lock-from-agenda)
>;; (org-toggle-sticky-agenda 't)
>(setq org-agenda-buffer-name "JarJarBarBar")
>(call-interactively 'org-todo-list)
>;; (org-toggle-sticky-agenda preval)
> )
>
> This works, but my original agenda view is updated to be restricted.
>  I've been tinkering with the "sticky" view for the agenda.  Also, I would
> like to set the name of the new buffer to either the heading which my
> cursor
> is on in the agenda, or perhaps a property of the heading which my cursor
> is
> on in the agenda.
>
> As you can see, I tried to set a "preval" variable to the current
> stickiness of the agenda
> and then reset the value after calling org-todo-list, but this has not
> worked out for me so far.
>
> Any ideas?
>
> Thanks,
> --Nate
>


[O] Help with "macro"

2019-10-12 Thread Nathan Neff
I'm trying to implement a function to display the TODO items of the
currently highlighted
item in the agenda and have a few questions:

Goal:

1) From the agenda, place the cursor on a heading.
2) Press a key and instantly narrow the agenda to the heading which the
cursor is on.
3) Display org-todo-list for the "narrowed" item in a new buffer, with the
name "agenda for " or perhaps "agenda for 

[O] Bug and quick bugfix

2019-10-12 Thread Godefroy
Hello,

As it is my first email to the list, please forgive me if I do anything
the wrong way.

I recently encountered a bug when exporting an org file to LaTeX: when
generating a figure with a caption, the LaTeX result has the following
shape:

\begin{figure}
…
\caption{\label{…}
Content of the caption}
\end{figure}

When compiling to LaTeX, the carriage return causes a indesirable white
space in some cases. What I would expect is:

\begin{figure}
…
\caption{Content of the caption}
\label{…}
\end{figure}

To fix this, I have changed the org-latex--caption/label-string function
in ox-latex.el on lines 1314 and 1315:

(format (if nonfloat "\\captionof{%s}%s{%s%s}\n"
 "\\caption%s%s{%s%s}\n")

becomes

(format (if nonfloat "\\captionof{%s}%s{%s}\n%s"
 "\\caption%s%s{%s}\n%s")

I hope that this bug report and the quickfix I found will help you.

Sincerely,

Godefroy Vannoye




[O] Quoting of noweb references and variable noweb function arguments

2019-10-12 Thread Cody Goodman
I'm having an issue with quoting noweb functions. Since quote is used to
signify a variable being passed into the noweb syntax function call I
cannot put a quote around theno web function call and end up with invalid
bash.

I feel like I had this working at some point and it turned out that
:results value smartly handles quoting the values or something. I keep
seeming to run into the problem though of needing something like:

echo "<>
   echo $json | jq $jqExpr
   #+end_src

   #+RESULTS: get-login-json-value
   | sh: line 2: hunter2 | : command not found |
** result: sh: line 2: hunter2 | : command not found |
* get login token function using previous functions
** code
   #+name: get-login-token
   #+call:
get-login-json-value(logValUserVar="user3",logValUserPass="user3",".loginToken")

   #+RESULTS: get-login-token
** result: nothing, because the previous step fails