Re: How to capture export prepended header numbering

2019-12-30 Thread Adam Porter
Someone reminded me that Org has org-num-mode now, so please disregard
all of that.  At least it was good exercise.




Re: How to capture export prepended header numbering

2019-12-30 Thread Adam Porter
Adam Porter  writes:

> There is no built-in way to do that, and no way independent of
> org-export to get the numbers, AFAIK.
>
> Here's some ugly old code that shows outline numbering as overlays in an
> Org buffer.  It doesn't update automatically, so you have to run it
> again when the outline changes.  But it seems to work well.  It uses
> dash.el and let-alist, in case you don't have them loaded.

Please do disregard that monstrosity.  I rewrote it in a much simpler
way.  It seems fast on a reasonably large Org buffer.  It doesn't
account for org-indent-mode or org-bullets, but that wouldn't be too
hard to fix, I think.

No third-party packages are required.  See attached file, or
.



november-0ac22.el
Description: org-outline-numbers rewritten


Include file relative path

2019-12-30 Thread Steven Penny
The Org Mode section on including files:

https://orgmode.org/manual/Include-files.html

seems to be missing a detail. It appears that relative paths are allowed, I
assume they would be relative to the directory of the parent file.

That is to say if I have file "monday.org" including file "sunday.org", and they
are in the same folder, then I could use this syntax:

#+INCLUDE: "sunday.org"

Is that correct?




using #+ to define faces

2019-12-30 Thread Jean-Christophe Helary
I would like to define faces on a file basis by using #+ but I'm not finding 
relevant info in the manual.

Is it possible ?


Jean-Christophe Helary
---
http://mac4translators.blogspot.com @brandelune





Agenda: Display timeline for today

2019-12-30 Thread Nathan Neff
Hello all,

I was searching for a way to display today's clocked items in
a timeline style view e.g.:

10:00 - 10:15  foo
11:00 - 11:15 bar

I found this Stack Overflow thread:
https://emacs.stackexchange.com/questions/19746/get-a-timeline-of-clocked-time-in-org-mode

One of the replies says to "Look into org-agenda-prefix-format to show
start and end time" but doesn't specify how to do this.

Any ideas?  Looking at org-agenda-prefix-format I don't see anything
regarding
a start time or end time.  I'm guessing I could code a function to get a
start and end time.  I looked around and found some code in org-element.el
and I think that org-element-timestamp-parser may be what I need, but wanted
to see if anyone has done something similar.

Thanks,
--Nate


Re: How to capture export prepended header numbering

2019-12-30 Thread Adam Porter
FYI, I tidied the code a tiny bit and posted it here:

https://github.com/alphapapa/unpackaged.el#outline-number-overlays




Re: How to capture export prepended header numbering

2019-12-30 Thread Adam Porter
There is no built-in way to do that, and no way independent of
org-export to get the numbers, AFAIK.

Here's some ugly old code that shows outline numbering as overlays in an
Org buffer.  It doesn't update automatically, so you have to run it
again when the outline changes.  But it seems to work well.  It uses
dash.el and let-alist, in case you don't have them loaded.

mike-0ac22.el
Description: ap/org-outline-numbers


Re: Turn function into interactive

2019-12-30 Thread Berry, Charles


> On Dec 29, 2019, at 9:26 PM, Lawrence Bottorff  wrote:
> 
> I've discovered org-outline-level which when in a code block under a given 
> header delivers as expected:
> 
> * This old level
> #+BEGIN_SRC emacs-lisp
> (org-current-level)
> #+END_SRC
> 
> #+RESULTS:
> : 1
> 
> Now, how could I turn this into an interactive callable with M-x? My stab in 
> the dark
> 
> (defun my-insert-level ()
>   (interactive)
>   (insert (org-outline-level)))

> doesn't seem to be working. 

It works, but just isn't what you wanted. ;-)

Note:

,[ C-h f insert RET ]
| insert is a built-in function in ‘C source code’.
| 
| (insert &rest ARGS)
| 
| Insert the arguments, either strings or characters, at point.
| Point and after-insertion markers move forward to end up
|  after the inserted text.
| [...]
`-


So try something like

(defun my-insert-level ()
  (interactive)
  (insert (format "%d" (org-outline-level

To insert a string.

HTH,

Chuck

BUG? - opening an org file containing #+STARTUP: inlineimages results in error message ...

2019-12-30 Thread Johannes Brauer
… File mode specification error: (void-variable image-map)

It seems that the problem arised since I’ve upgraded orgmode from version 9.2.6 
(9.2.6-4-ge30905-elpa to version 9.3 resp. 9.3.1
On a system where the 9.2.6 is installed, images are shown.

Johannes




How to capture export prepended header numbering

2019-12-30 Thread Lawrence Bottorff
Basically, I'd like to know what level each heading of an org file is and
in what order they appear. So if my org file looks like this

* heading a
** sub-heading a.1
** sub-heading a.2
*** sub-sub-heading a.2.1
* heading b
** sub-heading b.1
*** sub-sub-heading b.1.1
* heading c

And an HTML export creates this

1 heading a
1.1 sub-heading a.1
1.2 sub-heading a.2
1.2.1 sub-sub-heading a.2.1
2 heading b
2.1 sub-heading b.1
2.1.1 sub-sub-heading b.1.1
3 heading c

is there a way to capture that prepended export numbering? Actually, I'd
like to capture every heading's rank and order and keep it in a PROPERTIES
drawer. There's obviously some baked in mechanism doing this for exporting.
Is it possible for a mere mortal to know, have?

LB


Re: Long links

2019-12-30 Thread Nicolas Goaziou
Hello,

Steven Penny  writes:

> Hm, neither one of those methods seem to work with either of these parsers:
>
> - https://github.com/niklasfasching/go-org
> - https://github.com/wallyqs/org-ruby

You may want to see with the maintainers of these projects if they want
to implement it.

Regards,

-- 
Nicolas Goaziou