Re: Bug: "before first headline" error when adding clock out note [9.4.6 (9.4.6-dist @ /home/wenlong/org-9.4.6/lisp/)]

2021-06-27 Thread Dave D
Thank you so much for the quick fix.

On 28/06/2021, Nicolas Goaziou  wrote:
> Hello,
>
> Dave D  writes:
>
>> It seems the error is caused by function
>> org-clock-remove-empty-clock-drawer called by org-clock-out-hook
>>
>> I have removed that function from the hook for now as a workaround.
>
> I pushed a fix in master.
>
> Thank you.
>
> Regards,
> --
> Nicolas Goaziou
>



Re: org-agenda no longer clocks out then in

2021-06-27 Thread Dave D
this commit
https://code.orgmode.org/bzg/org-mode/commit/8e3e2f667f0b28b85845204b708c3f0aebc9152b
probably fixes the issue. Could you perhaps give it a test?



Re: Bug: "before first headline" error when adding clock out note [9.4.6 (9.4.6-dist @ /home/wenlong/org-9.4.6/lisp/)]

2021-06-25 Thread Dave D
It seems the error is caused by function
org-clock-remove-empty-clock-drawer called by org-clock-out-hook

I have removed that function from the hook for now as a workaround.



Re: org-agenda no longer clocks out then in

2021-06-25 Thread Dave D
seems related to a bug I reported a few days ago.

link to my bug report:
https://lists.gnu.org/archive/html/emacs-orgmode/2021-06/msg00506.html

the bug is basically that we you have org-log-note-clock-out set to t,
an error "before first headline" would occur when you clock out, thus
blocking subsequent actions.



getting "before first headline at position xxx in buffer *Org Note*" when clocking out

2021-06-23 Thread Dave D
Hi all,

I recently started getting the message "before first headline at position
xxx in buffer *Org Note*" when clocking out items.

After much frustration and testing I've summarized these steps to reproduce
the issue.

1. Download https://orgmode.org/org-9.4.6.tar.gz and extract to ~/org-9.4.6
2. Start emacs with emacs -Q
I've tried both 27 and 28, 28 has native comp. same result.
3. evaluate (add-to-list 'load-path "~/org-9.4.6/lisp")
4. create a new org file, create a heading and clock in
5. evaluate (setq org-log-note-clock-out t)
6. clock out.

I think there is a good chance another person can reproduce the issue too
with the steps above.
Would anybody be kind enough to try to reproduce the issue?

Many thanks
Dave


clock doesn't respect org-id-link-to-org-use-id

2021-06-18 Thread Dave D
Hi All,

I use org-mode clock table to generate report for the tasks I clocked.
The header of my clock table looks like this:
#+BEGIN: clocktable :block 2021-06-18 :scope agenda :maxlevel 5
:fileskip0 t :link t

I have :link t so that I can jump to a task directly from the clock
table. I have noticed that sometimes the link doesn't work because of
a heading having strange characters ( in my case my heading is
suffixed with date time).

I traced it back to function org-clock-get-table-data, which seems to
construct the link itself from scratch without leveraging the existing
function org-store link. This also results in it not respecting the
value of org-id-link-to-org-use-id. If use org-store-link in
org-clock-get-table-data, a few lines of code can be reduced and the
behavior can be more consistent and robust.

If I'm correct so far, anybody mind work or this? I can do that as
well, but i'm not fluent with lisp or the workflow, so I'd appreciate
if someone else can help.

Thank You.
Dave



[PATCH] etc/ORG-NEWS: Announce clocktable per-file time percentages (':formula %')

2021-05-01 Thread Alan D. Salewski
On Sat, May 1, 2021, at 05:52, Bastien wrote:
> Hi Alan,
> 
> applied in master as commit 9aa9f3b1f.
> 
> Thanks you very much!

Great, and thank /you/ for all the work you do on org-mode!


> Can you announce this by providing a patch for etc/ORG-NEWS?
> 
> -- 
>  Bastien

Sure thing; included below.

8<

* etc/ORG-NEWS: New entry announcing clocktable calculation and
display of per-file time percentages, when ':formula %' is used.

TINYCHANGE

Signed-off-by: Alan D. Salewski 
---
 etc/ORG-NEWS | 17 +
 1 file changed, 17 insertions(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 0c822d029..d08e3f68f 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -235,6 +235,23 @@ tags including from both buffer local and user defined 
persistent
 global list (~org-tag-alist~ and ~org-tag-persistent-alist~).  Now
 option ~org-complete-tags-always-offer-all-agenda-tags~ is honored.
 
+*** Clocktable option =:formula %= now shows the per-file time percentages
+
+This change only has an effect when multiple files are contributing to
+a given clocktable (such as when =:scope agenda= has been specified).
+The existing behavior is that such tables have an extra 'File' column,
+and each individual file that contributes has its own summary line
+with the headline value '*File time*'.  Those summary rows also
+produce a rollup time value for the file in the 'Time' column.
+
+Prior to this change, the built-in =%= formula did not produce a
+calculation for those per-file times in the '%' column (the relevant
+cells in the '%' column were blank).  With this change, the
+percentage contribution of each individual file time to the total
+time is shown.
+
+The more agenda files you have, the more useful this behavior becomes.
+
 ** Miscellaneous
 *** Missing or empty placeholders in "eval" macros are now nil
 They used to be the empty string.

-- 
a l a n   d.   s a l e w s k i
ads@salewski.email
salew...@att.net
https://github.com/salewski



Re: Concerns about community contributor support

2021-04-29 Thread D
Hi Bastien, Hi Ihort

> https://updates.orgmode.org

whoops, I completely overlooked that.

> Org, whether they want to help, fix confirmed bugs or review patches.
> 
> Of course, https://updates.orgmode.org is in alpha and we can still
> improve it a lot.  In particular, I plan to let it track unconfirmed
> bugs too, to help with bug triage, and to provide woof.el to ease
> interaction with this tool directly from within Emacs.
> 
> Ideas are welcome: https://github.com/bzg/woof/issues

I'll look into it, thank you!

> In general, I find it good to have a central communication place for
> the community, where newcomers can learn from more experienced users
> and I've always resisted to the urge of having e.g. org-users@ and
> org-devel@ mailing lists, as some projects have.  Nowadays, users who
> don't want to mix with Org's development can interact on many other
> places (SO, reddit and others).

I'm not sure sure whether it is about mixing with development
personally, but I think my point is largely addressed by
updates.orgmode.org.

Cheers,
D.



Re: Concerns about community contributor support

2021-04-29 Thread D
Hi Timothy,

I was quite weary to bring up this point, but given the sheer volume of
patch-related exchanges in recent memory I feel that it may be worth
bringing up as I have not yet seen it discussed (if I overlooked it, my
apologies): I don't think the core problem can (or maybe should) be
solved by sheer manpower alone.  I would argue that the issue may be
partially infrastructural in nature.  This ML is incredibly active, with
a lot of different people surely following it for different reasons.
However, I am not entirely convinced that having patches, bug reports
and general discussions all in one place is necessarily a net positive
for people wanting to contribute to the project (once a project hits a
certain size, at least).  It lacks a certain separation of concerns that
clearly informed the design of forges like GitHub (having separate
"Issues" and "PRs").

I may be alone with this opinion, given manually organizing is a
personal weakness of mine, and something I prefer to avoid at all costs,
but I think having a separate list for patches would greatly improve
their visibility without having to resort to band-aids like automated
subject-based filtering schemes which are thwarted by mundane human
error ("[PTACH]").  On the other hand, were I completely alone with this
opinion, then we wouldn't have dozens of emacs-* mailing lists already.

TL;DR: Maybe we could improve the visibility of patches by having a
dedicated mailing list for them? This would also allow for a greater
deal of automation in the way we deal with patches.

Cheers,
D.



[PATCH] org-clock.el: clocktable ':formula %' now includes per-file time pct

2021-02-06 Thread Alan D. Salewski

* lisp/org-clock.el (org-clocktable-write-default): When ':formula %'
  is in-effect, show the per-file time percentage in the '%' column.

This change only has an effect when multiple files are contributing
to a given clocktable (such as when ':scope agenda' has been
specified).  The existing behavior is that such tables have an extra
'File' column, and each individual file that contributes has its own
summary line with the headline value '*File time*'.  Those summary
rows also produce a rollup time value for the file in the 'Time'
column.

Prior to this change, the built-in '%' formula does not produce a
calculation for those per-file times in the '%' column (the relevant
cells in the '%' column were blank).  With this change, the
percentage contribution of each individual file time to the total
time is shown.

The more agenda files you have, the more useful this behavior
becomes.

TINYCHANGE

Signed-off-by: Alan D. Salewski 
---
 lisp/org-clock.el | 20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index cfd112ec3..8e91609c2 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2697,7 +2697,18 @@ from the dynamic block definition."
 (format (concat "| %s %s | %s%s%s"
 (format org-clock-file-time-cell-format
 (org-clock--translate "File time" lang))
-" | *%s*|\n")
+
+;; The file-time rollup value goes in the first 
time
+;; column (of which there is always at least 
one)...
+" | *%s*|"
+;; ...and the remaining file time cols (if any) 
are blank.
+(make-string (max 0 (1- time-columns)) ?|)
+
+;; Optionally show the percentage contribution of 
"this"
+;; file time to the total time.
+(if (eq formula '%) " %s |" "")
+"\n")
+
 (file-name-nondirectory file-name)
 (if level?"| " "") ;level column, maybe
 (if timestamp "| " "") ;timestamp column, maybe
@@ -2705,7 +2716,12 @@ from the dynamic block definition."
 (if properties ;properties columns, maybe
 (make-string (length properties) ?|)
   "")
-(org-duration-from-minutes file-time ;time
+(org-duration-from-minutes file-time) ;time
+
+(cond ((not (eq formula '%)) "");time percentage, maybe
+  ((or (not total-time) (= total-time 0)) "0.0")
+  (t
+   (format "%.1f" (* 100 (/ file-time (float 
total-time)
 
 	  ;; Get the list of node entries and iterate over it

  (when (> maxlevel 0)
--
a l a n   d.   s a l e w s k i
ads@salewski.email
salew...@att.net
https://github.com/salewski



[PATCH] org-clock.el: clocktable ':formula %' now includes per-file time pct

2021-01-31 Thread Alan D. Salewski
* lisp/org-clock.el (org-clocktable-write-default): When ':formula %'
  is in-effect, show the per-file time percentage in the '%' column.

This change only has an effect when multiple files are contributing
to a given clocktable (such as when ':scope agenda' has been
specified).  The existing behavior is that such tables have an extra
'File' column, and each individual file that contributes has its own
summary line with the headline value '*File time*'.  Those summary
rows also produce a rollup time value for the file in the 'Time'
column.

Prior to this change, the built-in '%' formula does not produce a
calculation for those per-file times in the '%' column (the relevant
cells in the '%' column were blank).  With this change, the
percentage contribution of each individual file time to the total
time is shown.

The more agenda files you have, the more useful this behavior
becomes.

TINYCHANGE

Signed-off-by: Alan D. Salewski 
---
 lisp/org-clock.el | 20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index cfd112ec3..8e91609c2 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2697,7 +2697,18 @@ from the dynamic block definition."
 (format (concat "| %s %s | %s%s%s"
 (format org-clock-file-time-cell-format
 (org-clock--translate "File time" lang))
-" | *%s*|\n")
+
+;; The file-time rollup value goes in the first 
time
+;; column (of which there is always at least 
one)...
+" | *%s*|"
+;; ...and the remaining file time cols (if any) 
are blank.
+(make-string (max 0 (1- time-columns)) ?|)
+
+;; Optionally show the percentage contribution of 
"this"
+;; file time to the total time.
+(if (eq formula '%) " %s |" "")
+"\n")
+
 (file-name-nondirectory file-name)
 (if level?"| " "") ;level column, maybe
 (if timestamp "| " "") ;timestamp column, maybe
@@ -2705,7 +2716,12 @@ from the dynamic block definition."
 (if properties ;properties columns, maybe
 (make-string (length properties) ?|)
   "")
-(org-duration-from-minutes file-time ;time
+(org-duration-from-minutes file-time) ;time
+
+(cond ((not (eq formula '%)) "")  ;time percentage, 
maybe
+  ((or (not total-time) (= total-time 0)) "0.0")
+  (t
+   (format "%.1f" (* 100 (/ file-time (float 
total-time)
 
  ;; Get the list of node entries and iterate over it
  (when (> maxlevel 0)
-- 
a l a n   d.   s a l e w s k i
ads@salewski.email
salew...@att.net
https://github.com/salewski



Re: [PATCH] Re: Re: Re: org-forward-heading-same-level and the invisible-ok argument

2020-09-08 Thread D
Hi Bastien,

> I applied a small variant of it as a700fadd7, thanks.

thank you!

> (See also the comment I added with f17d301e1, which basically means
> that such changes are made as exceptions.)

I fully understand, though I do believe that this change is beneficial
to the way org-forward-heading-same-level works overall, in a "principle
of least astonishment" sort of way.  I would agree with Ihor that it
does reflect the docstring better this way.

Best regards,
D.



Re: [PATCH] Re: Re: Re: org-forward-heading-same-level and the invisible-ok argument

2020-09-07 Thread D
> Then, can as well use `mapcar', or even simply manual loop over line
> positions.

How about this?
>From 2324d745f12fe8e8d4f7864307eb55c46fc49504 Mon Sep 17 00:00:00 2001
From: "D. Williams" 
Date: Mon, 7 Sep 2020 14:13:12 +0200
Subject: [PATCH] org.el: let heading navigation check the entire heading for
 visibility

* org.el (org-forward-heading-same-level): check complete heading instead of the first char

TINYCHANGE
---
 lisp/org.el | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index bc74cedc7..040cfad61 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20512,6 +20512,16 @@ entry."
 		((looking-at-p re) (forward-line))
 		(t (throw 'exit t
 
+(defun org--line-visible-p ()
+  "Return t if the current line is partially visible."
+  (let ((line-beg (line-beginning-position))
+	(line-pos (1- (line-end-position)))
+	(is-invisible t))
+(while (and (< line-beg line-pos) is-invisible)
+  (setq is-invisible (org-invisible-p line-pos))
+  (cl-decf line-pos))
+(not is-invisible)))
+
 (defun org-forward-heading-same-level (arg  invisible-ok)
   "Move forward to the ARG'th subheading at same level as this one.
 Stop at the first and last subheadings of a superior heading.
@@ -20533,8 +20543,7 @@ non-nil it will also look at invisible ones."
 	(cond ((< l level) (setq count 0))
 		  ((and (= l level)
 			(or invisible-ok
-			(not (org-invisible-p
-  (line-beginning-position)
+			(org--line-visible-p)))
 		   (cl-decf count)
 		   (when (= l level) (setq result (point)))
 	(goto-char result))
-- 
2.26.2



Re: [PATCH] Re: Re: Re: org-forward-heading-same-level and the invisible-ok argument

2020-09-06 Thread D
Hi,

> Does it fix a problem for org-superstar-mode or a more general problem
> in Org?

It mostly fixes an org-superstar-mode problem (see
https://github.com/integral-dw/org-superstar-mode/issues/19).

> Why do you need to check the visibility status every character in the
> headline (even for the org-superstar-mode, where you seem to need to
> check for the visibility status /after/ the stars)?

There is no intrinsic need for my current application for it to check
anything past the last star, I just went with the most "naive"
implementation first.  If it were just for org-superstar (and similar
modes [1]) it would be fully sufficient to check the heading from the
position of the last star up to the first character past the space, if
present (which would boil it down to checking 3 chars instead of N).

> If you use seq* functions, the code will be incompatible with previous
> emacsen, right?

Hmm, looking at the oldest available ELPA release (seq-1.0, 2015),
seq-every-p should be fully backwards-compatible.  The current package
itself also has a fallback option for Emacs versions <25, so that should
be fine.

Cheers,
D

[1] https://github.com/TonCherAmi/org-starless



[PATCH] Re: Re: Re: org-forward-heading-same-level and the invisible-ok argument

2020-08-30 Thread D
> Probably, it is easier if you just use seq-every-p instead of
> mapcar on (number-sequence max-pos min-pos -1). The result of
> seq-every-p will be inverse of the currently used expression.

Oh yeah, that's much nicer.  I also made the predicate check
right-to-left, which just causes it to check the text bit of a heading
first, which is useful for the cases where the predicate returns t and
makes no difference otherwise.  I again ran the tests and it seems ready
to go.

Cheers,
D.
>From 9ae3dd4b73b2b9b41244bb7f9c610ed3f4777398 Mon Sep 17 00:00:00 2001
From: "D. Williams" 
Date: Sun, 30 Aug 2020 23:58:55 +0200
Subject: [PATCH] org.el: let heading navigation check the entire heading for
 visibility

* org.el (org-forward-heading-same-level): check complete heading instead of the first char

TINYCHANGE
---
 lisp/org.el | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 71dbc611e..f44f94ec4 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20478,6 +20478,14 @@ entry."
 		((looking-at-p re) (forward-line))
 		(t (throw 'exit t
 
+(defun org--line-visible-p ()
+  "Return t if the current line is partially visible."
+  (not
+   (seq-every-p #'org-invisible-p
+		(number-sequence (1- (line-end-position))
+ (line-beginning-position)
+ -1
+
 (defun org-forward-heading-same-level (arg  invisible-ok)
   "Move forward to the ARG'th subheading at same level as this one.
 Stop at the first and last subheadings of a superior heading.
@@ -20499,8 +20507,7 @@ non-nil it will also look at invisible ones."
 	(cond ((< l level) (setq count 0))
 		  ((and (= l level)
 			(or invisible-ok
-			(not (org-invisible-p
-  (line-beginning-position)
+			(org--line-visible-p)))
 		   (cl-decf count)
 		   (when (= l level) (setq result (point)))
 	(goto-char result))
-- 
2.26.2



Re: [PATCH] Re: Re: org-forward-heading-same-level and the invisible-ok argument

2020-08-28 Thread D
>> + (mapcar #'org-invisible-p
>> + (number-sequence (line-beginning-position)
>> +  (1- (line-end-position)
>
> This is a bad idea. org--line-visible-p will be called for every single
> invisible headline. If you check every single point at every single
> invisible headline, it can be extremely slow.

Hm, of course it would only check invisible headlines of the same level,
thanks to the logic of the navigation command.  However, I do see the
concern.

> Better do something like below (or maybe even without narrow-to-region,
> not sure if that may cause significant overhead):
> 
> (defun org--line-visible-p ()
>   "Return t if the current line is partially visible."
>   (save-restriction
> (narrow-to-region (line-beginning-position) (1- (line-end-position)))
> (let ((visible t)
> (p (point-min)))
>   (while (and visible (< p (point-max)))
>   (when (org-invisible-p p)
>   (setq visible nil))
> (setq p (next-single-char-property-change p 'invisible)))
>   visible)))

The issue with that is that it reintroduces the thing the patch is
trying to fix, as it considers any partially invisible line as fully
invisible (while the opposite should be the case).  I also don't see
much of a difference when profiling, unless I severely screwed up.  I
just manually prepared a buffer with 10k invisible headings (each 83
chars long) and plugged a visible one of the same level above and below
the huge invisible block.  C-c C-f does take a second plus change in
that case for both cases.

The main issue is that a hot-circuit approach would only ever optimize
navigating across many visible blocks, if we want a partially visible
heading to be treated like a visible one (instead of an invisible one
like it is at the moment).  However, we could use a similar hack as the
original implementation and only check a couple of characters, if
performance really is a concern there.  In that case, I think it would
be best to check the *last* few characters (as it makes more sense that
the stars at the beginning are hidden than the actual title at the end).
 That would mean to replace the original implementation with something like

(defun org--line-visible-p ()
  "Return t if the current line is partially visible."
  (let ((min-pos (max (line-beginning-position)
  (- (line-end-position) 3)))
(max-pos (1- (line-end-position
(and
 (memq nil
   (mapcar #'org-invisible-p
   (number-sequence min-pos max-pos)))
 t)))

which basically removes any relevant slowdown.
But I'd really only recommend going that far if necessary, given it adds
a random magic number.  Thoughts?

Cheers,
D.



[PATCH] Re: Re: org-forward-heading-same-level and the invisible-ok argument

2020-08-28 Thread D
> I do not think that setting visibility the leading stars is a correct
> approach to control the movement commands. After second though about the
> issue you raised in the first email, I think that it would make more
> sense for org-forward-heading-same-level to check if any part of the
> heading line is visible to decide if we need to skip it (instead of
> current approach checking only the point at the beginning of the
> headline). Any mode aiming to make org-forward-heading-same-level skip a
> heading will then just need to make the whole heading invisible.
> Skipping partially visible headlines would be a violation of the
> docstring.

Good point!  I think this would be a more or less reasonable patch, then.

Cheers,
D.
>From 4c0f638104f689780de317af5f715384152459bd Mon Sep 17 00:00:00 2001
From: "D. Williams" 
Date: Fri, 28 Aug 2020 14:15:31 +0200
Subject: [PATCH] org.el: let heading navigation check the entire heading for
 visibility

* org.el (org-forward-heading-same-level): check complete heading instead of the first char

TINYCHANGE
---
 lisp/org.el | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 71dbc611e..26f815e19 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20478,6 +20478,15 @@ entry."
 		((looking-at-p re) (forward-line))
 		(t (throw 'exit t
 
+(defun org--line-visible-p ()
+  "Return t if the current line is partially visible."
+  (and
+   (memq nil
+	 (mapcar #'org-invisible-p
+		 (number-sequence (line-beginning-position)
+  (1- (line-end-position)
+   t))
+
 (defun org-forward-heading-same-level (arg  invisible-ok)
   "Move forward to the ARG'th subheading at same level as this one.
 Stop at the first and last subheadings of a superior heading.
@@ -20499,8 +20508,7 @@ non-nil it will also look at invisible ones."
 	(cond ((< l level) (setq count 0))
 		  ((and (= l level)
 			(or invisible-ok
-			(not (org-invisible-p
-  (line-beginning-position)
+			(org--line-visible-p)))
 		   (cl-decf count)
 		   (when (= l level) (setq result (point)))
 	(goto-char result))
-- 
2.26.2



[PATCH] Re: org-forward-heading-same-level and the invisible-ok argument

2020-08-26 Thread D

> I guess it is simply because nobody though that the leading stars can be
> hidden via fontification.
> 
> I think the whole issue can be fixed by changing the call to
> org-invisible-p inside org-forward-heading-same-level. org-invisible-p
> has an optional third argument to ignore text hidden via fontification.
> You can try to make a patch for org-forward-heading-same-level and
> similar commands adding that third argument.

I looked into the git repository and noticed that org-invisible-p
already, thanks to a patch from Nicolas Goaziou (b1822760f4).
What I am wondering is whether it would make more sense as an argument
for org-forward-heading-same-level and similar commands, or as a
(potentially buffer-local) org variable to tweak the behavior, given
it's most likely going to affect these functions as interactive commands
(see alternative_org.el.diff).  This version has the advantage of
allowing minor modes to easily mess with Org's behavior buffer-locally.

I considered how adding a third argument to
org-forward-heading-same-level, but realized that adding another
invisibility argument would kinda leak a little complexity, as we'd wind
up with TWO invisibility-related arguments (which only differ in subtle
ways) and their interactions.  So instead I'd recommend to instead allow
a distinct, non-nil option for invisible-ok, for example `t', `nil' and
`except-folding' (see org.el.diff).  This version would be more
transparent, as it would not change the behavior of ALL calls in the
buffer, but comes at the cost of minor modes needing to overshadow
bindings to accomplish the same.

I whipped up a quick diff for both versions, and will gladly make a
patch once we settled on one, but I wanted to discuss which is
preferable before making an uninformed decision on my own.
diff --git a/lisp/org.el b/lisp/org.el
index 71dbc611e..b8e6d47c2 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20482,7 +20482,12 @@ entry."
   "Move forward to the ARG'th subheading at same level as this one.
 Stop at the first and last subheadings of a superior heading.
 Normally this only looks at visible headings, but when INVISIBLE-OK is
-non-nil it will also look at invisible ones."
+non-nil it will also look at invisible ones.
+
+If INVISIBLE-OK is set to the symbol `except-folding', continue
+ignoring all parts that are invisible due to folding of a
+headline, a block or a drawer, i.e., not because of
+fontification."
   (interactive "p")
   (let ((backward? (and arg (< arg 0
 (if (org-before-first-heading-p)
@@ -20495,12 +20500,14 @@ non-nil it will also look at invisible ones."
 	(result (point)))
 	(while (and (> count 0)
 		(funcall f org-outline-regexp-bol nil 'move))
-	  (let ((l (- (match-end 0) (match-beginning 0) 1)))
+	  (let ((l (- (match-end 0) (match-beginning 0) 1))
+		(folding-only (eq 'except-folding invisible-ok)))
 	(cond ((< l level) (setq count 0))
 		  ((and (= l level)
-			(or invisible-ok
+			(or (and invisible-ok (not folding-only))
 			(not (org-invisible-p
-  (line-beginning-position)
+  (line-beginning-position)
+  folding-only
 		   (cl-decf count)
 		   (when (= l level) (setq result (point)))
 	(goto-char result))
diff --git a/lisp/org.el b/lisp/org.el
index 71dbc611e..8e0040814 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20478,6 +20478,18 @@ entry."
 		((looking-at-p re) (forward-line))
 		(t (throw 'exit t
 
+
+(defcustom org-navigate-invisible-headings nil
+  "If non-nil, navigate through (unfolded) invisible headings normally.
+Commands such as `org-forward-heading-same-level' and
+`org-forward-heading-same-level' will consider all invisible
+headings except for those that are invisible due to folding of a
+headline, a block or a drawer."
+  :group 'org
+  :type '(choice
+	  (const :tag "Don't navigate invisible headings" nil)
+	  (const :tag "Navigate invisible (unfolded) headings" t)))
+
 (defun org-forward-heading-same-level (arg  invisible-ok)
   "Move forward to the ARG'th subheading at same level as this one.
 Stop at the first and last subheadings of a superior heading.
@@ -20498,9 +20510,11 @@ non-nil it will also look at invisible ones."
 	  (let ((l (- (match-end 0) (match-beginning 0) 1)))
 	(cond ((< l level) (setq count 0))
 		  ((and (= l level)
-			(or invisible-ok
+			(or (and invisible-ok
+ (not org-navigate-invisible-headings))
 			(not (org-invisible-p
-  (line-beginning-position)
+  (line-beginning-position)
+  org-navigate-invisible-headings
 		   (cl-decf count)
 		   (when (= l level) (setq result (point)))
 	(goto-char result))


org-forward-heading-same-level and the invisible-ok argument

2020-08-25 Thread D
Hi,

I am currently thinking about how to have
org-forward-heading-same-level and its sister command work together
with a setting of my minor mode org-superstar-mode.  The issue that
arises is that when my mode renders the leading stars of a headline
invisible, org-forward-heading-same-level considers the partially
invisible headlines fully invisible, and hence only works correctly
for single-asterisk headlines.

The solution I considered is making two interactive commands that
simply call org-forward-heading-same-level with invisible-ok set to t
and overshadow the bindings (C-c C-f and  
 ).  The downside to this is of
course is the intrusive nature of it, and I am concerned about side
effects I may be overlooking.  So I thought it is best to ask *why* the
navigation commands take invisibility into account the way they do,
and whether you guys have a suggestion that may be more elegant than
the approach I came up?

Cheers,
D.



Re: Feature request: Footnotes immediately following the paragraph when exported ($)

2020-05-23 Thread D. C. Toedt
Thanks for the response, Bastien. No one has answered up, suggesting that
there's not widespread interest.






On Sat, May 23, 2020 at 4:29 AM Bastien  wrote:

> Hi,
>
> "D. C. Toedt"  writes:
>
> > For an ongoing pro bono project, it would be nice if there were an
> > in-buffer #+OPTION: configuration for footnotes, when exporting to
> > HTML (or DOCX or PDF), to have the footnote text in small print just
> > below the paragraph in which the footnote reference occurs.
>
> I don't know if you find someone to implement this, but FWIW I don't
> think it would be a good idea to support it in Org by default.  This
> is more a job for a new specific export backend (HTML based, if your
> need is just for the HTML export.)
>
> Best,
>
> --
>  Bastien
>


Feature request: Footnotes immediately following the paragraph when exported ($)

2020-04-22 Thread D. C. Toedt
For an ongoing pro bono project, it would be nice if there were an
in-buffer #+OPTION: configuration for footnotes, when exporting to HTML (or
DOCX or PDF), to have the footnote text in small print just below the
paragraph in which the footnote reference occurs.

I'd be willing to pay something to have this done and contributed to the
standard installation.

Here's an example of the desired "look"; it's copied and pasted from a court
opinion <https://casetext.com/case/caradigm-us-llc-v-pruitthealth-inc>,
with the footnote numbers bolded:



[T]he CSA allowed Pruitt to not only access CIP, but also to "build
Customer Use Cases*[4]*
<https://casetext.com/case/caradigm-us-llc-v-pruitthealth-inc#N196682> and
configure Data Feeds*[5]* for those" cases. *[remainder of paragraph
omitted]*


*[4]* The CSA defines "Use Case" as a "Cloud Services configuration that
incorporates Data Feeds with designated views to address specific issues
within [Pruitt] or [Pruitt's] Facilities." Doc. 1–1 at 7. "Customer Use
Cases," in turn, "means any Use Case developed by or for [Pruitt] or
customized for [Pruitt]." *Id.*

*[5]* "Data Feeds" are "inbound electronic data messages from [Pruitt]
information systems to the Cloud Services." Doc. 1–1 at 7. Essentially, a
data feed is the delivery of information from a Pruitt electronic medical
records software system to CIP, which Caradigm hosts on its own computers,
and which Pruitt accesses via the "cloud." *See* doc. 73 at 6 ("data feeds
are the electronic data messages from PruittHealth systems to [CIP].")
(quotes omitted).

The Order—"made as of June 25th, 2013 ("Order Effective Date ") pursuant to
the [CSA]"—meanwhile, reveals that Pruitt, in addition to the $20,000/month
CIP development license, purchased two other "Cloud Services:" *[remainder
of text omitted]*



I've just (re)checked the manual
<https://orgmode.org/org.html#Creating-Footnotes> but didn't see this
feature.

A Google search yielded a 2014 Stack Overflow question
<https://stackoverflow.com/questions/26160126/emacs-org-mode-html-footnotes>
along
the same lines.

D. C. Toedt III   Attorney & neutral arbitrator — tech contracts & IP
*(My last name is pronounced "Tate")  * +1 (713) 364-6545
d...@toedt.com@dctoedt <https://twitter.com/DCToedt>
Skype: dctoedt

www.OnContracts.com/About <http://www.oncontracts.com/About>
Unless expressly stated otherwise, this message is not intended to serve
as assent to an agreement or other document, even if attached to this
message.


org-superstar is now available on MELPA

2020-03-08 Thread D
Hi all,

as the subject suggests, I am happy to announce that org-superstar-mode
is now available on MELPA! :)

repo: https://github.com/integral-dw/org-superstar-mode
package: https://melpa.org/#/org-superstar

Cheers,
D.



[PATCH] Re: org-hide-eading-stars-before-indent-mode

2020-02-19 Thread D
Hi!

On 19.02.20 22:42, Bastien wrote:
> IIUC, it would be "and", not "or": first use
> 
>   (setq-local org-hide-leading-stars (default-value 'org-hide-leading-stars))
> 
> to set org-hide-leading-stars to a temporary value *and*
> 
>   (kill-local-variable 'org-hide-leading-stars)
> 
> to restore the global value.

Not quite, both are valid ways to revert hide-leading-stars to it's
original value, with the second (which I picked for the patch) having
the advantage to properly get rid off the buffer-local property again.
The mode itself calls for setting the variable locally to `t' instead of
the original value.

I attached the patch, which I hope is the correct format.  I'm still a
bit new to this, my apologies if I cause any unnecessary work.

Regards,
D.
>From d3390eb442bccef476fa2514d4078b9f8e9d978a Mon Sep 17 00:00:00 2001
From: "D. Williams" 
Date: Wed, 19 Feb 2020 23:50:48 +0100
Subject: [PATCH] org-indent.el: Deprecate
 `org-hide-leading-stars-before-indent-mode'

* lisp/org-indent.el (org-indent-mode): Make `org-hide-leading-stars'
buffer local and revert it back to it's global value when exiting the
mode without storing it's global value manually.
(org-hide-leading-stars-before-indent-mode): Remove declaration.

This commit implements my suggestion from the mailing list
(https://lists.gnu.org/archive/html/emacs-orgmode/2020-02/msg00759.html)
to rely on Emacs' native mechanisms for restoring a buffer-local
variable to it's global default value instead of storing the global
value in a temporary variable (in this case:
`org-hide-leading-stars-before-indent-mode').

TINYCHANGE
---
 lisp/org-indent.el | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/lisp/org-indent.el b/lisp/org-indent.el
index c136a75bd..73b077965 100644
--- a/lisp/org-indent.el
+++ b/lisp/org-indent.el
@@ -71,8 +71,6 @@ Delay used when the buffer to initialize isn't current.")
 (defvar org-indent--initial-marker nil
   "Position of initialization before interrupt.
 This is used locally in each buffer being initialized.")
-(defvar org-hide-leading-stars-before-indent-mode nil
-  "Used locally.")
 (defvar org-indent-modified-headline-flag nil
   "Non-nil means the last deletion operated on a headline.
 It is modified by `org-indent-notify-modified-headline'.")
@@ -183,8 +181,6 @@ during idle time."
   (or (eq org-adapt-indentation 'headline-data)
 	  (setq-local org-adapt-indentation nil)))
 (when org-indent-mode-turns-on-hiding-stars
-  (setq-local org-hide-leading-stars-before-indent-mode
-		  org-hide-leading-stars)
   (setq-local org-hide-leading-stars t))
 (org-indent--compute-prefixes)
 (if (boundp 'filter-buffer-substring-functions)
@@ -216,9 +212,8 @@ during idle time."
 	  (delq (current-buffer) org-indent-agentized-buffers))
 (when (markerp org-indent--initial-marker)
   (set-marker org-indent--initial-marker nil))
-(when (boundp 'org-hide-leading-stars-before-indent-mode)
-  (setq-local org-hide-leading-stars
-		  org-hide-leading-stars-before-indent-mode))
+(when (local-variable-p 'org-hide-leading-stars)
+  (kill-local-variable 'org-hide-leading-stars))
 (if (boundp 'filter-buffer-substring-functions)
 	(remove-hook 'filter-buffer-substring-functions
 		 (lambda (fun start end delete)
-- 
2.24.1



org-hide-leading-stars-before-indent-mode

2020-02-19 Thread D
Hi all,

I have come across this rather strange variable in org-indent, and was
wondering if someone could add a bit of documentation to clarify what it
actually does.

Currently, the variable org-hide-leading-stars-before-indent-mode is
only documented as "used locally".  However, upon closer inspection, the
first thing I noticed was that it is actually declared using "defvar"
instead of "defvar-local", which in turn would render the docstring
redundant as it would automatically append the message "this variable
becomes buffer local when set".  Is this intentional?  Looking at the
code it seems to be a throwaway variable remembering the initial value
of org-hide-leading-stars, restoring it buffer-locally when indent-mode
is turned off.  This leaves two questions for me:

1) Wouldn't it be clearer to use defvar-local for
org-hide-leading-stars-before-indent-mode and replace the docstring with
something like "Holds the original value of `org-hide-leading-stars'
before Org indent."

2) Considering that org-hide-leading-stars is global by default,
wouldn't it be even better to dispose of the temp variable entirely?
One could either use (kill-local-variable 'org-hide-leading-stars) or
(setq-local org-hide-leading-stars (default-value
'org-hide-leading-stars)) for the same effect.

Cheers,
D.



Documentation: Side effects of org-entry-properties and others

2020-02-17 Thread D
Hi,

it seems a few functions meant to expose org internals to programmers
seem to cause undocumented side effects.  A particular example being
org-entry-properties.  When called, it changes the match-data.  This can
cause issues in cases where leaking match-data can cause font-lock to
behave inconsistently or throw errors.  I think it would be a good idea
to add a prominent warning to such interfacing functions, or document it
somewhere in the module.

The same is true for org-element-lineage, but I am not so sure whether
it is intended for hacking purposes as much as org-entry-properties.
Sadly, I have no overview over the scope of this issue, so I do not know
whether my suggestion is unrealistic (for example, because it would mean
adding warnings practically everywhere).

Regards,

D.



Re: Weird face behavior with org-hide-emphasis-markers enabled

2020-02-12 Thread D
Hi,

After some I found the culprit!  The issue arises from
org-do-emphasis-faces.  The bug is caused by the line

(font-lock-prepend-text-property
  (match-beginning 2) (match-end 2) 'face face)

which makes the surrounding "~"s part of the box, combined with

(add-text-properties (match-end 4) (match-beginning 5)
  '(invisible org-link))

setting them invisible.  This appears to confuse Emacs.  Anything along
the lines of

(let ((num (if org-hide-emphasis-markers 4 2)))
  (font-lock-prepend-text-property
   (match-beginning num) (match-end num) 'face face))

should fix the issue.

To demonstrate the behavior, I created a MWE function reproducing the bug.

(defun mwe (start end)
  "Reproduce a weird fontification behaviour cutting off boxes."
  (interactive "r")
  (font-lock-prepend-text-property
   start end 'face '(:box (:line-width 3 :color "grey")))
  (add-text-properties (1- end) end '(invisible org-link)))


Hope that is helpful,
D.



Re: Weird face behavior with org-hide-emphasis-markers enabled

2020-02-12 Thread D
Hi,

On 12.02.20 18:24, Bastien wrote:
> I can reproduce this issue but I have no clue what can be wrong in
> Org.  Perhaps you can submit this to emacs-de...@gnu.org.
Very strange indeed.  In that case I'll try poking around the code a bit
more (I think there is a lot I can learn from investigating org's code
base) and relay the issue to emacs-devel if I find nothing helpful.

I'll report back in a few days!



Re: [org-inlinetask] Inquiry of opinion from all users

2020-02-11 Thread D
Thanks! :)

Right now I am mostly focused on what features people could want from a
package like this without blowing the scope out of proportion.
Currently I mostly stick to vanilla org with a few tweaks (such as using
the same proportions for org-level-X as LaTeX does for sub*sections), so
I will most likely add very few things on my own and keep an eye on
potential requests.  I am aware there were a couple of suggestions on
org-bullets' original GitHub, which I will try to address thoroughly.

Cheers,

D.



[org-inlinetask] Inquiry of opinion from all users

2020-02-07 Thread D
Hi,

while org-superstar-mode (a minor mode that prettifies org headlines and
item bullets, see
https://github.com/dw-github-mirror/org-superstar-mode) is awaiting it's
debut on MELPA, I am currently doing a few more touch-ups to ensure
quality.  While I am working on providing proper unit tests, I thought I
may take the time to ask a few questions to all people interested using
org-inlinetask:

1) Would you like a mode prettifying header bullets to honor
org-inlinetask-show-first-star?
2) If yes, would you like to have the leading character depend on the
inlinetask's level (or rather, the level it would have had as a
headline), or would you prefer a fixed character, for example, a Dingbat?
3) Header bullets cycle through a user defined list of bullets.  Should
the pair of header bullets (the trailing two stars) be displayed by the
level they would have as headlines?  For example, suppose your headeline
bullets would cycle through (1), (2), (3), (4).  Now suppose
org-inlinetask-min-level was 6.  Should

**

be rendered as

(1)(1)

(that is, as the *first* inlinetask) or

(2)(2)
(that is, like a level 6 (mod 4) headline)?

Thank you in advance,

D.



Re: Weird face behavior with org-hide-emphasis-markers enabled

2020-02-04 Thread D
> Can you provide an emacs and org version, the value of the variables
> at stake and an reproducible example?

Hi,

naturally, I just wasn't at all sure I just overlooked something obvious
and it's actually common knowledge.

Naturally, using emacs -Q

GNU Emacs 26.3 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.13)
of 2019-12-10

Org mode version 9.1.9 (release_9.1.9-65-g5e4542)

minimal setup:
(setq org-hide-emphasis-markers t)
(set-face-attribute 'org-code nil :box '(:line-width 1))

an example file mwe.org:
~sample text~

This reproduces the issue reliably.

Cheers,
D.



Weird face behavior with org-hide-emphasis-markers enabled

2020-02-04 Thread D
Hi all,

maybe I overlooked something in the archives, but I can't find this
issue having been brought up yet.  org-hide-emphasis-markers has a
strange interaction with faces like org-code: when trying to draw a box
around an emphasized expression it does not draw the right border.

Cheers,
D.



Re: A new, "org-bullets"-like minor mode

2020-02-04 Thread D
> 
> I would like to take a try too. Hope it is lightweight enough. Don't invoked 
> lot of time.
> 

I have not yet optimized the package, but experience no issues.  The
package is currently in the process of being reviewed for MELPA.  If you
(or anyone else) would like to contribute a large, complex org file for
benchmarking purposes I would be happy to profile my mode against it.

For the time being, you can find it  here:
https://github.com/dw-github-mirror/org-superstar-mode



Re: A new, "org-bullets"-like minor mode

2020-02-02 Thread D


> I haven't looked at the code yet but would it make sense for your new
> mode just being renamed to "org-bullet" instead? Do you expect that
> some current users won't want to update?

I have been considering that, but decided against replacing org-bullets
(or calling the package something akin to org-bullets+) for two reasons:
1) For the things I have/had in mind I would not have wanted to ensure
backwards-compatibility.

I would hate to see long-time users of org-bullets to experience
breakage because of design decisions I made.  I think that there is a
lot of value in keeping a straightforward package with a singular goal
for people that want exactly that.  While I made sure to ease the pain
of transitioning for people interested, I would not want to touch it
beyond maintenance.  From what I know, spacemacs ships with it for
example, so I would not like to cause anything downstream without warning.

2) While there are perfectly valid reasons to name a package similar to
another ("xpackage", "packagex", "package+", "pakG", ...) I personally
shy away from the practice to avoid confusion.  LaTeX packages are
notorious for this, and their overuse of this convention has led to many
frustrating afternoons for me in the past years.

> If you want to stick with creating a new mode, are there any bug fixes
> that you could backport to "org-bullet"?

I am sincerely considering to help maintain the project, to "adopt" it
from the orphanage, should org-superstar gain any popularity.  I will
gladly port anything technical (bugfixes, plausible performance patches)
I can to org-bullets if requested, but I would not add features.
However, I hesitate to immediately pick up the role of maintaining
org-bullets for the simple reason that I'd first like to have a project
of my own to show for myself, as a proof of responsibility if you will.

> I don't actually use it myself and just enable it temporarily if someone
> reports a bug or something.  It's not that I am not interested in
> something like this package, but from the sound of it I would rather use
> your package than the old "org-bullet".

If you find the time to check out my package, I am always open for
criticism and suggestions.  Seeing how young the package is I am very
open to adding features and making quality of life improvements to the
interfaces.

> If I remember correctly it, then it took some effort to contact sabof,
> but eventually they gave their blessing.

I sent sabof a mail via the Github address, if you have any means of
communication with him, would you mind sharing them?





Re: Strangely recognized non-lists and non-headers.

2020-02-02 Thread D
> You need to escape them with commas.

Ah, I overlooked that because I did not check the manual whether leading
stars are escaped automatically and just assumed it, sorry.  Thanks a lot!

Though, there is one minor thing I noticed:

Leading stars are valid comment symbols in Fortran, as long as they are
the first character in the line.  They are recognized in SRC fortran
blocks when the star is unescaped, but not when the star is escaped, meaning
#+BEGIN_SRC fortran
,***
,* a valid comment
,**
#+END_SRC
 is displayed with the org-block face instead of the usual
font-lock-comment-face.




Re: Strangely recognized non-lists and non-headers.

2020-02-02 Thread D
Hi,

On 02.02.20 12:59, Nicolas Goaziou wrote:
> Long story short. Don't use this function, it is not correctly
> implemented at the moment. The correct way to check if you're in a list
> is something like:
> 
>   (org-element-lineage (org-element-at-point) '(plain-list) t)

I tried that out, but it still seems to recognize source code as
headlines, replacing the predicate does not change the behavior.  It
seems to be something more deeply rooted than that, I mean, otherwise
org mode wouldn't try to collapse those fake-headlines when hitting TAB,
either.

Regards,

D.



Strangely recognized non-lists and non-headers.

2020-02-02 Thread D
Hi all,

while debugging org-superstar-mode I noticed something very strange, and
I am not sure if it's a bug in org or a bug in my understanding of org.

First off, an MWE for Org mode version 9.1.9 (release_9.1.9-65-g5e4542):

#+BEGIN_SRC C
/*
* This is a header?
  + this
+ is
  * a list?
*/
#+END_SRC

This works. I can promote, demote, fold, etc.  org-superstar also has no
issue with accepting these.  I should add, this is the default config
(emacs -Q on Emacs 26.3).  So no spooky stuff I believe on that end.
So I began digging.

I use org-list-in-valid-context-p as a quick hack to check if what I am
looking at is actually a list.  Said predicate is a simple wrapper
around the function org-in-block-p being called with
org-list-forbidden-blocks.  It is the the list of environments where
lists are not allowed.

Value: ("example" "verse" "src" "export")

There is also a very similar variable: org-protecting-blocks.  This one
marks environments as quoted, disallowing org syntax.

Value: ("src" "example" "export")

Currently these two variables don't know of one another.  Maybe the
latter should be a strict subset of the former?

Anyway, from what I have found org-in-block-p seems to not recognize src
blocks reliably.  I wrote a small function to test this:

(defun nag ()
  (interactive)
  (when (org-list-in-valid-context-p)
(warn "You can make a list here! :(")))

And it seems, yes, you can make a list in a src block.
That's all very peculiar, what do you guys think?



org-superstar-mode: A re-imagining of org-bullets with new features

2020-02-01 Thread D
Hi,

thank you two for your encouragement!

Here is the link to the new project:

https://github.com/dw-github-mirror/org-superstar-mode/

Fair warning though, I am still in the process of debugging.

Cheers,

D.



Re: A new, "org-bullets"-like minor mode

2020-02-01 Thread D
On 01.02.20 21:32, Marco Wahl wrote:
> AFAICS org-bullets is released under GPL3.  Doesn't this mean that you
> can use org-bullets as a base for further development if you leave the
> license intact and also keep the original authors next to your name?

That is correct, I just don't mean to come off as rude making a still
rather derivative mode like that without trying to get the guy's
blessing.  I am likely overthinking the matter.

Would it be appropriate to share the link here? I think it would be
great to get feedback before trying to get it on melpa.

Cheers,

D.



A new, "org-bullets"-like minor mode

2020-02-01 Thread D
Hi,

in the past two weeks I have been working on a new org minor mode based
on org-bullets.  Much like org-bullets-mode, the new mode (dubbed
"org-superstar-mode" for the time being) visually replaces headline
stars with UTF8 bullets.  However, while I took the code of org-bullets
as an initial template, I have largely rewritten the code base for lots
of additional features, including:

* The ability to fully customize the look of plain list items as well.
* Contextual sensitivity (meaning lists and headings are recognized
semantically, so org-superstar-mode ignores false positives in for
example SRC blocks)
* level-dependent fontification for bullets
* The ability to customize the look of leading stars, while respecting
org-hide-leading-stars.

However, since the mode still contains code snippets from org-bullets, I
have tried to contact the original author (sabof) of the package in the
hopes of getting an official approval before making the thing public.
The problem with /that/ however is that the author has been inactive for
several years now, with the package being maintained by Jonas Bernoulli,
who I did not yet contact.

So, before going any further, I wanted to first ask whether there is any
community interest in such a package.

As an addendum, an excerpt from the description of the yet-to-be package:

;; This package is heavily influenced by (and uses snippets from) the
;; popular package "org-bullets", created by sabof.  It was made with
;; the goal of inheriting features the author liked about org-bullets
;; while being able to introduce compatibility-breaking changes to it.
;; It is largely rewritten, to the point of almost no function being
;; identical to it's org-bullets counterpart.




strange/cryptic org variables

2020-01-25 Thread D
Hello,

org.el seems to define three weird variables: org-m, org-l and org-f
(see below).  Two of these variables (l and f) are used exclusively in
org-level-face, while m is not used anywhere in the code.  They don't
appear to be used in the other source files, either.

Is there a particular reason for them being accessible outside of the
function?  They seem oddly.. exposed.  Or is it some kind of performance
reason?

Here's the code in question, taken from Version 9.1.9, L6531 onward:

(defvar org-m nil)
(defvar org-l nil)
(defvar org-f nil)
(defun org-get-level-face (n)
  "Get the right face for match N in font-lock matching of headlines."
  (setq org-l (- (match-end 2) (match-beginning 1) 1))
  (when org-odd-levels-only (setq org-l (1+ (/ org-l 2
  (if org-cycle-level-faces
  (setq org-f (nth (% (1- org-l) org-n-level-faces) org-level-faces))
(setq org-f (nth (1- (min org-l org-n-level-faces)) org-level-faces)))
  (cond
   ((eq n 1) (if org-hide-leading-stars 'org-hide org-f))
   ((eq n 2) org-f)
   (t (unless org-level-color-stars-only org-f

Cheers,
DW



[O] TOC local for specified heading and its subheadings - now broken?

2018-07-30 Thread D. C. Toedt
1. In November 2015, Sacha Chua very kindly put together a patch to allow
the following:

> # = The next line is the desired feature:  Generate a TOC
list (with links) of *all subheadings in the specified heading *
> *#+TOC: headlines 1 local ConfInfoClauses *


2. Nicholas subsequently proposed
<https://lists.gnu.org/archive/html/emacs-orgmode/2015-11/msg00697.html>
modifying the syntax:

  #+toc: headlines 1 :headline #headline
> or
>   *#+toc: headlines 1 :target #headline*
> since TOC keywords always refer to headlines.



3. Sacha's patch appears to have been applied to ox-html.el for a couple of
years now — but it doesn't seem to work anymore, regardless of the syntax
used.

I've tried it on my main file, and also on a small test file, as follows:

#+TITLE: Test of subTOC for specified headline

* Section 1
  :PROPERTIES:
  :CUSTOM_ID: SectionOne
  :END:

** Section 1.1
  :PROPERTIES:
  :CUSTOM_ID: SecOneOne
  :END:


Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam interdum
dui eu commodo sodales. Nunc ac pulvinar augue. Suspendisse sagittis tempus
aliquet. Ut placerat, magna quis blandit pretium, risus libero maximus dui,
non sollicitudin ligula orci non massa. Morbi bibendum facilisis elit a
congue. Suspendisse blandit iaculis quam, sed molestie leo. Nulla porttitor
leo eu urna fermentum pretium. In congue nulla laoreet nunc accumsan, vel
malesuada lacus porta. Praesent vulputate arcu lectus, vitae tincidunt elit
laoreet eget. Suspendisse lobortis nibh sed est scelerisque imperdiet.

** Another section: 1.2
  :PROPERTIES:
  :CUSTOM_ID: SecOneTwo
  :END:


Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam interdum
dui eu commodo sodales. Nunc ac pulvinar augue. Suspendisse sagittis tempus
aliquet. Ut placerat, magna quis blandit pretium, risus libero maximus dui,
non sollicitudin ligula orci non massa. Morbi bibendum facilisis elit a
congue. Suspendisse blandit iaculis quam, sed molestie leo. Nulla porttitor
leo eu urna fermentum pretium. In congue nulla laoreet nunc accumsan, vel
malesuada lacus porta. Praesent vulputate arcu lectus, vitae tincidunt elit
laoreet eget. Suspendisse lobortis nibh sed est scelerisque imperdiet.

* Next top-level section: Two
  :PROPERTIES:
  :CUSTOM_ID: SecTwo
  :END:

The next portion should be a sub-TOC for Section 1:

#+TOC: headlines 2 :target #SectionOne

But what it produces is a complete table of contents.

So let's try adding "local" as a keyword:

#+TOC: headlines 2 local  :target #SectionOne

But that produces no TOC at all.


I've got GNU Emacs 26.1 (9.0) installed for Mac OS and the 2018-07-23
update of org-mode.

Any suggestions?

D. C. Toedt III   Attorney & neutral arbitrator — tech contracts & IP
*(My last name is pronounced "Tate")  *Houston, Texas, USA
O: +1 (713) 364-6545   C: +1 (713) 516-8968

d...@toedt.com@dctoedt <https://twitter.com/DCToedt>
Skype: dctoedt

www.OnContracts.com/About <http://www.oncontracts.com/About>

Unless expressly stated otherwise, this message is not intended to serve
as assent to an agreement or other document, even if attached to this
message.


Re: [O] bug report: + is not escaped in org-link-escape

2017-12-10 Thread D M German


Nicolas Goaziou twisted the bytes to say:

 Nicolas> Hello,
 Nicolas> dmg <d...@turingmachine.org> writes:

 >> org-link-escape only replaces space, [, ], and %
 >> 
 >> but search in google/gmail is replacing + also.
 >> 
 >> The simplest solution is to add 43 to org-link-escape-chars:
 >> 
 >> org-link-escape-chars is a variable defined in ‘org.el’.
 >> Its value is (32 91 93 37)
 >> 
 >> This variable may be risky if used as a file-local variable.

 Nicolas> `org-link-escape' is for internal links, not for general URL-encoding.
 Nicolas> You may want to use `url-encode-url' instead.

this indeed addresses the issue I was having.

thank you very much for your response.


--daniel



--
Daniel M. German  "It is useless to punish a man
   unless he knows why he is punished...
   Punishment must be unusual
   R. Heinlein ->  or it serves no purpose."
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .




[O] org-export-preprocess-apply-macros ?

2017-04-30 Thread D Bro
Is this still a thing?  I can’t seem to find it anywhere but a very few online 
references, no where in the org code, and it doesn’t seem work…
https://lists.gnu.org/archive/html/emacs-orgmode/2011-03/msg00857.html

   (add-hook 'org-babel-tangle-body-hook (lambda () 
(org-export-preprocess-apply-macros)))

I only found 'org-macro-replace-all’, which I’m not sure how to apply while in 
the tangle context.

Many thanks,
Ed B.


[O] Latex class files in async export?

2017-04-29 Thread D Bro
I have the following definition in my org-mode file:

(add-to-list 'org-latex-classes ;; 
https://emacs.stackexchange.com/questions/29694/spacemacs-and-org-mode-configuration-problem
 '("koma-article"
   "\\documentclass{scrartcl}"
   ("\\section{%s}" . "\\section*{%s}")
   ("\\subsection{%s}" . "\\subsection*{%s}")
   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
   ("\\paragraph{%s}" . "\\paragraph*{%s}")
   ("\\subparagraph{%s}" . "\\subparagraph*{%s}"


Yet it doesn’t seem to be visible when I do an async export to PDF.  When I try 
an async export to PDF, I get “Process ‘org-export-process’ exited abnormally”. 
 The PDF is not altered.

I’m no longer getting an export stack buffer, but when I was, it was 
complaining about the class ‘koma-article’, to me indicating it couldn’t be 
found.  I don’t know why that buffer is no longer being generated.

Many thanks,
Ed B.


[O] Viewing tangled source code as source code block result?

2017-04-24 Thread D Bro
I was wondering if there is any simple way of displaying the actual tangled 
code in the org-mode buffer and resulting exports.  One can #+INCLUDE the 
resulting file, seeing it in the export; one can M-x ffap the #+INCLUDE file to 
see it in a buffer; one can do a hack like shelling out and calling cat; I 
guess you could write an lisp function that hooked org-babel-tangle, grabbed 
the buffer, and formatted it as output (haven’t figured out how to do that one 
yet). One could also do a #+src_begin org block.

But what about a simple :results setting, say ‘tangle’ or ‘noweb’?  Whose 
#+RESULTS: was actually a #+src_…#end_src block with appropriate language 
tagging that could get syntax highlighted?

Am I missing something here.  Is there a non-hackish way of composing existing 
features to print the resulting source of a noweb block, in addition to 
actually executing it and displaying the value/output?

Re: [O] :noweb-ref property inheritance failure?

2017-04-18 Thread D Bro
PS  I verified that in addition to org-use-property-inheritance, I have 
org-babel-use-quick-and-dirty-noweb-expansion set to nil, since the 
documentation and mailing list indicate that’s not compatible with property 
inheritance.

It’s good (and bad :) to know it’s just my config, based on it working for you…

> On Apr 18, 2017, at 9:47 PM, D Bro <dabro...@gmail.com> wrote:
> 
> Many thanks—especially for the quick response.  Unfortunately, no go.
> 
> The headline was a copy and paste issue into the email — my org-lint only 
> complains about the :classname (I didn’t even know about org-lint, thank you!)
> Export to Ascii produces:
> 
> … 
> 1 Create
> 
> 
>   ,
>   | <>
>   `
> 
> 
> 1.1 Let's see what our code-weaving produces
> 
> 
> 1.1.1 this is how we will assemble our code:
> 
> 
>   ,
>   | public class Yo {
>   |   public static void main (Args[]) {
>   `
> 
> 
> 1.1.2 body
> --
> 
>   ,
>   | return "The test worked!";
>   `
> 
> 
> 1.1.3 foot
> --
> 
>   ,
>   | // <>
>   | }}
>   `
> 
> 
> 1.1.4 weave together
> 
> 
>   - which will weave together the above blocks to produce this:
> 
> ,----
> | cat TestDemo2.java
> `——
> 
> Ed
> 
>> On Apr 18, 2017, at 9:04 PM, Charles C. Berry <ccbe...@ucsd.edu 
>> <mailto:ccbe...@ucsd.edu>> wrote:
>> 
>> On Tue, 18 Apr 2017, D Bro wrote:
>> 
>>> Both 26.0 and 25.1 on OS X 10.12 via homebrew, using the Spacemacs 
>>> configuration.
>>> 
>> 
>>> I recently tried the weaving technique from 
>>> http://orgmode.org/manual/noweb_002dref.html#noweb_002dref 
>>> <http://orgmode.org/manual/noweb_002dref.html#noweb_002dref> 
>>> <http://orgmode.org/manual/noweb_002dref.html#noweb_002dref 
>>> <http://orgmode.org/manual/noweb_002dref.html#noweb_002dref>> :
>> 
>> [snip]
>> 
>> Using M-x org-lint on your example gives
>> 
>> 3 high  Unknown header argument ":classname"
>>12 high  Incorrect location for PROPERTIES drawer
>> 
>> The latter is because the drawer is not immediately after a headline and is 
>> disregarded:
>> 
>>> **Let's see what our code-weaving produces
>>> :PROPERTIES:
>>> :header-args: :noweb-ref testdemo2
>>> :END:
>> 
>> If you put a space between `**' and `L[...]' the line becomes a valid 
>> headline. Then the TestDemo2 src block produces
>> 
>> ,
>>  | public class Yo {
>>  | public static void main (Args[]) {
>>  | return "The test worked!";
>>  | //
>>  | }}
>>  | cat TestDemo2.java
>>  `
>> 
>> on ASCII export.
>> 
>> You can ignore the message about :classname, which comes from ob-java not 
>> defining it as a header-arg.
>> 
>> HTH,
>> 
>> Chuck
> 



Re: [O] :noweb-ref property inheritance failure?

2017-04-18 Thread D Bro
Many thanks—especially for the quick response.  Unfortunately, no go.

The headline was a copy and paste issue into the email — my org-lint only 
complains about the :classname (I didn’t even know about org-lint, thank you!)
Export to Ascii produces:

… 
1 Create


  ,
  | <>
  `


1.1 Let's see what our code-weaving produces


1.1.1 this is how we will assemble our code:


  ,
  | public class Yo {
  |   public static void main (Args[]) {
  `


1.1.2 body
--

  ,
  | return "The test worked!";
  `


1.1.3 foot
--

  ,
  | // <>
  | }}
  `


1.1.4 weave together


  - which will weave together the above blocks to produce this:

,
| cat TestDemo2.java
`——

Ed

> On Apr 18, 2017, at 9:04 PM, Charles C. Berry <ccbe...@ucsd.edu> wrote:
> 
> On Tue, 18 Apr 2017, D Bro wrote:
> 
>> Both 26.0 and 25.1 on OS X 10.12 via homebrew, using the Spacemacs 
>> configuration.
>> 
> 
>> I recently tried the weaving technique from 
>> http://orgmode.org/manual/noweb_002dref.html#noweb_002dref 
>> <http://orgmode.org/manual/noweb_002dref.html#noweb_002dref> :
> 
> [snip]
> 
> Using M-x org-lint on your example gives
> 
> 3 high  Unknown header argument ":classname"
>12 high  Incorrect location for PROPERTIES drawer
> 
> The latter is because the drawer is not immediately after a headline and is 
> disregarded:
> 
>> **Let's see what our code-weaving produces
>> :PROPERTIES:
>> :header-args: :noweb-ref testdemo2
>> :END:
> 
> If you put a space between `**' and `L[...]' the line becomes a valid 
> headline. Then the TestDemo2 src block produces
> 
> ,
>  | public class Yo {
>  | public static void main (Args[]) {
>  | return "The test worked!";
>  | //
>  | }}
>  | cat TestDemo2.java
>  `
> 
> on ASCII export.
> 
> You can ignore the message about :classname, which comes from ob-java not 
> defining it as a header-arg.
> 
> HTH,
> 
> Chuck



[O] :noweb-ref property inheritance failure?

2017-04-18 Thread D Bro
Both 26.0 and 25.1 on OS X 10.12 via homebrew, using the Spacemacs 
configuration.

I recently tried the weaving technique from 
http://orgmode.org/manual/noweb_002dref.html#noweb_002dref 
 :

* Create 
#+NAME: TestDemo2
#+BEGIN_SRC java :classname TestDemo2 :noweb yes :tangle yes
  <>
#+END_SRC

#+BEGIN_SRC elisp
(format "%s" (org-babel-expand-src-block testdemo2))
#+END_SRC

**Let's see what our code-weaving produces
:PROPERTIES:
:header-args: :noweb-ref testdemo2
:END:

*** this is how we will assemble our code:
  #+BEGIN_SRC java
public class Yo {
  public static void main (Args[]) {
  #+END_SRC

*** body
  #+BEGIN_SRC java
 return "The test worked!";
  #+END_SRC
*** foot
  #+BEGIN_SRC java
// <>
}}
  #+END_SRC
*** weave together
- which will weave together the above blocks to produce this:

  #+BEGIN_SRC shell :results org :exports none
  cat TestDemo2.java
  #+END_SRC

I have tried both   (setq org-use-property-inheritance (quote (noweb-ref))) and 
  (setq org-use-property-inheritance t), both at org-mode load and from within 
the org file in question.  Also, note that I am using the 9.0 syntax, which I 
believe Spacemacs loads as part of its org-mode layer.

The result is always an empty TestDemo2.java file.  What’s interesting is that 
if I run org-babel-expand-src-block I see this:

public class Yo {
  public static void main (Args[]) {
return "The test worked!";
// 
}}
cat TestDemo2.java

If I add :noweb-ref to each block, it works.

- OS: darwin
- Emacs: 25.1.1
- Spacemacs: 0.200.9
- Spacemacs branch: develop (rev. 4b92183c)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
- System configuration features: NOTIFY ACL GNUTLS LIBXML2 ZLIB 
TOOLKIT_SCROLL_BARS NS MODULES

My org-mode config (org-plus-contrib-20170210)

;; org-mode
  (with-eval-after-load 'org
;; Turning `org-use-property-inheritance' on can cause significant overhead 
when doing a search, which is why it is not on by default.
(setq org-use-property-inheritance t)
(setq org-reveal-root "/usr/workspace/reveal.js")
(setq org-src-fontify-natively t)
(setq org-src-tab-acts-natively t)
(setq org-confirm-babel-evaluate nil)
(setq org-export-babel-evaluate nil)
(setq org-startup-indented t)
(setq org-imenu-depth 3) ;;; increase imenu depth to include third level 
headings
;; https://www.mfoot.com/static/emacs-config/config.html
(setq org-ditaa-jar-path "/usr/local/bin/ditaa")
(setq org-html-checkbox-type 'html)
(setq org-hide-emphasis-markers t)
(setq org-src-window-setup 'other-window) ;; reuses another open buffer 
window
(add-hook 'org-mode-hook 'org-display-inline-images) 
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images) ;;; 
Update images from babel code blocks automatically


  ;;; LaTex
;; https://github.com/syl20bnr/spacemacs/tree/master/layers/+lang/latex
;; To perform full-document previews (that is, aside from the inline 
previewing
;; under SPC m p), add the following to your .spacemacs under
;; dotspacemacs/user-config.  Then when you open up a compiled PDF, the 
preview
;; will update automatically when you recompile.
(add-hook 'doc-view-mode-hook 'auto-revert-mode)
;; http://orgmode.org/manual/CDLaTeX-mode.html#CDLaTeX-mode
;; Don't use CDLaTeX mode itself under Org mode, but use the light version
;; org-cdlatex-mode that comes as part of Org mode. Turn it on for the 
current
;; buffer with M-x org-cdlatex-mode RET, or for all Org files with
(add-hook 'org-mode-hook 'turn-on-org-cdlatex)
;; 
http://stackoverflow.com/questions/11272236/how-to-make-formule-bigger-in-org-mode-of-emacs
(setq org-format-latex-options (plist-put org-format-latex-options :scale 
2.0)) ;;
(setq org-format-latex-options (plist-put org-format-latex-options :justify 
'center)) ;;
(setq org-pandoc-options-for-latex-pdf '((latex-engine . "xelatex")));;  
"pdflatex")));; "lualatex")));;
;; http://bnbeckwith.com/blog/org-mode-tikz-previews-on-windows.html
(add-to-list 'org-latex-packages-alist '("" "tikz" t))
(setq org-latex-create-formula-image-program 'imagemagick)
(eval-after-load "preview" '(add-to-list 'preview-default-preamble 
"\\PreviewEnvironment{tikzpicture}" t))
;; 
http://emacs.stackexchange.com/questions/23982/cleanup-org-mode-export-intermediary-file
(setq org-latex-logfiles-extensions (quote ("lof" "lot" "tex~" "aux" "idx" 
"log" "out" "toc" "nav" "snm" "vrb" "dvi" "fdb_latexmk" "blg" "brf" "fls" 
"entoc" "ps" "spl" "bbl")))

(define-key evil-normal-state-map (kbd "zp") 'org-toggle-latex-fragment)

;; (add-to-list 'org-src-lang-modes '("dot" . graphviz-dot)) 
(require 'ob-haskell)
(require 'ob-scala)
(require 'ob-dot)
(require 'ob-ditaa)
(require 'ob-shell)
(require 'ob-C)
(require 'ob-dot)
(require 

Re: [O] Bug report: export to HTML does not escape * in example

2017-03-01 Thread D M German
 
Hi Charles, everybody,

 >> I am running a babel script that generates, as one of its line * in the
 >> front:
 >> 
 >> ​#+BEGIN_SRC sh
 >> echo "* Hello"
 >> #+END_SRC
 >> 
 >> #+RESULTS:
 >> #+begin_example
 >> * Hello
 >> #+end_example
 >> 
 >> ​In that case, should babel be the one escaping the * in the RESULTS block?

 Charles> Is that *really* what it did?

 Charles> When I run your example, I get:

 Charles> #+RESULTS:
 Charles> : * Hello

 Charles> and this exports (with the `:exports results' header) to html wrapped 
in a  container:

 Charles> 
 Charles> * Hello
 Charles> 

 Charles> using Org 9.0.5.

 Charles> Without that header the src code gets wrapped in a  container.

 Charles> So there must be something in/about your setup you haven't mentioned.

 Charles> HTH,

 Charles> Chuck




I looked a bit into my configuration. In my configuration, I set the value of 
org-babel-min-lines-for-block-output to 0.

The default value of this variable is by default 10.

When the number of lines in the output is larger than it, it uses
EXAMPLE blocks rather than the escaped ones.

So the original issue (* not being escaped) will nonetheless appear when
the threshold is passed:

Here is an example (I run it with emacs -nw -q, using emacs25) org
version 8.2.10 (this works also in my configuration under 9.0.2)

#+BEGIN_SRC emacs-lisp :results output
(dotimes (i 2) (print '*hello))
#+END_SRC

#+RESULTS:
: 
: *hello
: 
: *hello


#+BEGIN_SRC emacs-lisp :results output
(dotimes (i 10) (print '*hello))
#+END_SRC

#+RESULTS:
#+begin_example

*hello

*hello

*hello

*hello

*hello
#+end_example


 

thank you all again,

--
Daniel M. German  "Cyberspace. A consensual hallucination
   experienced daily by billions
   William Gibson ->   of legitimate operators in every nation"
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .




Re: [O] bug report: ox-html with coderef links needs a space between attributes in element (with patch)

2017-01-24 Thread D M German
 Nicolas Goaziou twisted the bytes to say:


 >> 
 >> ​I am running version 9.0.3 of org.
 >> 
 >> I believe this patch will solve the issue. It simply adds a space before
 >> the class attribute.

 Nicolas> It works but I eventually applied a slightly different patch. Thank 
you
 Nicolas> for both the report and the patch.

thank you very much!

--daniel

 Nicolas> Regards,

 Nicolas> -- 
 Nicolas> Nicolas Goaziou

--
Daniel M. German  "For indeed who is there alive
   that will not be swayed by his
   bias and partiality to
Jonathan Swift ->  the place of his birth?"
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 



Re: [O] function to select text of in a cell of a table

2017-01-03 Thread D M German
 Kaushal Modi twisted the bytes to say:


 Kaushal> Check out this earlier thread:
 Kaushal> https://lists.gnu.org/archive/html/emacs-orgmode/2016-05/msg00240.html

 Kaushal> You probably just need the org-table-mark-field definition from that.

thank you both very much. Kaushal, your function is exactly what I
needed.

--daniel


 Kaushal> On Sat, Dec 31, 2016, 8:28 AM Charles C. Berry  
wrote:

 >> On Fri, 30 Dec 2016, dmg wrote:
 >> 
 >> > hi everybody,
 >> >
 >> > has anybody written a function to select the text in a cell of a table?
 >> 
 >> If you mean like what ob-ref.el uses to support babel references, yes.
 >> 
 >> Also see org-table.el.
 >> 
 >> If you just want support for working with Babel src blocks, see
 >> 
 >> (info "(org) var")
 >> 
 >> HTH,
 >> 
 >> Chuck
 >> 
 >> --

 Kaushal> Kaushal Modi

--
Daniel M. German  "If Microsoft ever does applications
   Linus Torvalds ->   for Linux it means I've won."
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 



Re: [O] question about org-coderef-label-format and HTML export

2016-12-07 Thread D M German
 Nicolas Goaziou twisted the bytes to say:


 Nicolas> Hello,
 Nicolas> dmg <d...@turingmachine.org> writes:

 >> I was playing with org-coderef-label-format to reference lines of code
 >> in blocks.
 >> 
 >> I created a small example that overrides the default value:
 >> 
 >> #+BEGIN_SRC C++ :main no :flags -std=c++14 -Wall --pedantic -Werror
 >> :results output :exports both -r -l "//(ref:%s)" +n

 Nicolas> Switches are to be located before Babel parameters:

  #+begin_src C++ -r -l "//(ref:%s)" +n :main no ..

Thank you, Nicolas, I appreciate your response. It almost works now.

I think I found a bug. It works in some cases but not in others:

the following code properly defines the references abc and bfc. But it
does not define the one for (ref:jump). Here is a link to the exported
HTML file:

http://turingmachine.org/~dmg/temp/ref-test.html
http://turingmachine.org/~dmg/temp/ref-test.org

#+BEGIN_SRC C++ -r -l "//(ref:%s)" +n :main no :results output :exports both 
#include 
int main()
{ //(ref:abc)
   std::cout << "Hello world" << std::endl;
   std::cout << "Hello world 2" << std::endl;
   //(ref:jump)
   return 0; //(ref:bcf)
}
#+END_SRC


 Nicolas> Regards,

thank you again,

--daniel


 Nicolas> -- 
 Nicolas> Nicolas Goaziou

--
Daniel M. German  "Computer Science is no more
   about computers than astronomy
   Edsger Dijkstra  -> is about telescopes"
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 



Re: [O] [ox-html] Why are dedicated targets automatically renamed?

2016-10-18 Thread D. C. Toedt
I'm late to this thread but found it in researching a similar problem.  I
use designated targets to create a permanently-named internal HTML anchor
that I can use in providing a precisely-targeted complete URL that points
to a specific paragraph (as opposed to a section).  Example:  In the file
index.org, the org-mode dedicated target  <> should export to
HTML as: http://www.example.com/index.html#ThisTarget.  The name #ThisTarget
needs to be permanent because the document in question is a work in
progress.

Based on Nicolas's suggestion (downthread) about using #+HTML: or @@html: ,
I did a couple of quickie macros to create  anchors and links, but
that's a pain and clutters up the on-screen display in org-mode.
​​

​--D. C.​



D. C. Toedt III
Attorney & neutral arbitrator <http://www.OnContracts.com/arb-prefs>  —
tech contracts & IP
*(My last name is pronounced "Tate")*
O: +1 (713) 364-6545   C: +1 (713) 516-8968
​​

d...@toedt.com@dctoedt <https://twitter.com/DCToedt>
​
Skype: dctoedt
​

www.OnContracts.com/About <http://www.oncontracts.com/About>
​​


Unless expressly stated otherwise,
this message is not intended to serve
as assent to an agreement or other document,
even if attached to this message.


Re: [O] Configurable prefixes for heading-tree numbering in HTML export? ($)

2016-07-30 Thread D. C. Toedt
Many thanks, Nick -- an interesting approach, but it's not a good fit for
what I need.

Another approach would be possible if org-mode had a way of including
arbitrary attribute text in HTML exports of headings.  This would enable
use of the CSS attr()
<https://developer.mozilla.org/en-US/docs/Web/CSS/attr>functionality,
combined with the ::before pseudo-element and counters.   I've tested out
the following in HTML; it seems to work for what I need:

==BEGIN HTML SNIPPET==


body   { counter-reset: section-counter; }
h2  { counter-reset: sub-section-counter; }
h3  { counter-reset: sub-sub-section-counter; }

h2::before {
counter-increment: section-counter;
content: attr(CDArticlePrefix) "-" counter(section-counter) " ";
}

h3:before {
counter-increment: sub-section-counter;
content: attr(CDArticlePrefix) "-" counter(section-counter) "."
counter(sub-section-counter) " ";
}

h4:before {
counter-increment: sub-sub-section-counter;
content: attr(CDArticlePrefix) "-" counter(section-counter) "."
counter(sub-section-counter) "." counter(sub-sub-section-counter) " ";
}



Definitions 

Consulting Services

Payment Terms

General Provisions

==END HTML SNIPPET==

Unfortunately, org-mode does not seem to be able to include the
CDArticlePrefix="DEFN" attribute text in headings, as opposed to in divs.

I appreciate the response.

Regards,

D. C.





D. C. Toedt III
*(My last name is pronounced "Tate")*
Attorney & arbitrator -- tech contracts & IP
O: +1 (713) 364-6545   C: +1 (713) 516-8968
​​

d...@toedt.com@dctoedt <https://twitter.com/DCToedt>
​
Skype: dctoedt
​

www.OnContracts.com/About <http://www.oncontracts.com/About>
​​


Unless expressly stated otherwise,
this message is not intended to serve
as assent to an agreement or other document,
even if attached to this message.



On Sat, Jul 30, 2016 at 5:06 PM, Nicolas Goaziou <m...@nicolasgoaziou.fr>
wrote:

> Hello,
>
> "D. C. Toedt" <d...@toedt.com> writes:
>
> > So far as I can tell, org-mode currently allows heading numbering in only
> > one style (1, 1.1, 1.1.1, etc.).  For HTML export, I'm interested in
> having
> > the heading numbering be configurable on a per-subtree basis, along
> > something like the following lines for a hypothetical
> consulting-agreement
> > contract  (indentation is for convenient reading only).  This is for my
> Common
> > Draft <http://www.CommonDraft.org> contract terms and conditions project
> > --- I'd like to be able to arrange the trees in an arbitrary order and
> have
> > the top-level headings start with prefixes and heading numbers instead of
> > heading numbers alone.
> >
> > This can be done in a very kludgy fashion with CSS (see below), but doing
> > it in org-mode would be far preferable for several reasons.
> >
> > I'd be happy to pay an honorarium, or make a donation, of USD$100-$200
> for
> > the appropriate elisp code that I could include in the relevant file(s).
> > I'd want the elisp code to be open-sourced, and at least minimal
> > documentation, so that it could be made a candidate for possible
> inclusion
> > in a future org-mode release.
> >
> > Here's an example of the desired org-mode code:
> >
> >
> > ===BEGIN===
> >
> >
> > * Services
> >
> >   :PROPERTIES:
> >
> >   :CUSTOM_ID: SVC
> >
> >   :CUSTOM_PREFIX: t
> >
> >   :END:
> > #  NOTE THE :CUSTOM_PREFIX: property above === #
> >
> >
> > ** Statements of Work
> >
> > [properties and text omitted]
> >
> >
> > *** Written Statements of Work Required
> >
> > [properties and text omitted]
> > # === AN ARBITRARY NUMBER OF SUBHEADING LEVELS BENEATH THE TOP
> > LEVEL = #
> >
> >
> > *** Changes Must Be in Writing
> > [properties and text omitted]
> >
> >
> >
> > ** Billing Rates
> >
> > [properties and text omitted]
> >
> >
> > ** IP Ownership
> >
> > [properties and text omitted]
> >
> >
> > * General Provisions
> >
> >   :PROPERTIES:
> >
> >   :CUSTOM_ID: GP
> >   :CUSTOM_PREFIX: t
> >
> >   :END:
> >
> >
> > ** Amendments
> >
> > [properties and text omitted]
> >
> >
> > ** Notices
> >
> > [properties and text omitted]
> >
> > ===END===
> >
> >
> > I'd like for the resulting HTML export to be something like the
> following:
> >
> > SVC Services
> >
> > # 

[O] Configurable prefixes for heading-tree numbering in HTML export? ($)

2016-07-28 Thread D. C. Toedt
So far as I can tell, org-mode currently allows heading numbering in only
one style (1, 1.1, 1.1.1, etc.).  For HTML export, I'm interested in having
the heading numbering be configurable on a per-subtree basis, along
something like the following lines for a hypothetical consulting-agreement
contract  (indentation is for convenient reading only).  This is for my Common
Draft <http://www.CommonDraft.org> contract terms and conditions project
--- I'd like to be able to arrange the trees in an arbitrary order and have
the top-level headings start with prefixes and heading numbers instead of
heading numbers alone.

This can be done in a very kludgy fashion with CSS (see below), but doing
it in org-mode would be far preferable for several reasons.

I'd be happy to pay an honorarium, or make a donation, of USD$100-$200 for
the appropriate elisp code that I could include in the relevant file(s).
I'd want the elisp code to be open-sourced, and at least minimal
documentation, so that it could be made a candidate for possible inclusion
in a future org-mode release.

Here's an example of the desired org-mode code:


===BEGIN===


* Services

  :PROPERTIES:

  :CUSTOM_ID: SVC

  :CUSTOM_PREFIX: t

  :END:
#  NOTE THE :CUSTOM_PREFIX: property above === #


** Statements of Work

[properties and text omitted]


*** Written Statements of Work Required

[properties and text omitted]
# === AN ARBITRARY NUMBER OF SUBHEADING LEVELS BENEATH THE TOP
LEVEL = #


*** Changes Must Be in Writing
[properties and text omitted]



** Billing Rates

[properties and text omitted]


** IP Ownership

[properties and text omitted]


* General Provisions

  :PROPERTIES:

  :CUSTOM_ID: GP
  :CUSTOM_PREFIX: t

  :END:


** Amendments

[properties and text omitted]


** Notices

[properties and text omitted]

===END===


I'd like for the resulting HTML export to be something like the following:

SVC Services

#  NOTE THAT THERE'S NO HEADING /NUMBER/ FOR THE TOP-LEVEL HEADING,
JUST THE PREFIX == #


SVC-1 Statements of Work

[properties and text omitted]

#  PREFERABLY THE SEPARATOR IN "SVC-1" COULD BE CONFIGURED AS A
HYPHEN, A PERIOD, A COLON, A FORWARD SLASH, ETC. = #


SVC-1.1  Written Statements of Work Required

[properties and text omitted]

SVC-1.2  Changes Must Be in Writing

[properties and text omitted]


SVC-2 Billing Rates

[properties and text omitted]


SVC-3 IP Ownership

[properties and text omitted]


GP General Provisions


GP-1 Amendments

[properties and text omitted]


GP-2 Notices

[properties and text omitted]



I've played with doing this in CSS --- a suboptimal solution would be to:

   1. set the :UNNUMBERED: property to non-nil
   2. define separate CSS div classes for each top-level heading (e.g., SVC
   and GP in the examples above)
   3. for each top-level heading in question:
  1. use the :HTML_CONTAINER_CLASS: property to specify the div class
  for that top-level heading
  2. for each subheading level in that div class, use the
  psuedo-element ":before" to add the appropriate prefix and counter

Apart from being kludgy, doing it this way (in CSS) would eliminate
org-mode's ability to produce automatic cross-referencing during export.
Also, the heading numbers wouldn't transfer over when copying and pasting
from HTML to a Word document, which is an important user feature.

In case it matters, I run the 2016-07-25 release of org-mode on Emacs
25.1.50 (9.0) with the most recent update of Mac OS X El Capitan.  I know a
little about elisp and have cobbled together a few simple functions for my
own use, but I'm far from being even minimally competent at it.

Any ideas for an org-mode elisp solution?

​Thanks in advance,

--D. C.

D. C. Toedt III
*(My last name is pronounced "Tate")*
Attorney & arbitrator -- tech contracts & IP
O: +1 (713) 364-6545   C: +1 (713) 516-8968
​​

d...@toedt.com@dctoedt <https://twitter.com/DCToedt>
​
Skype: dctoedt
​

www.OnContracts.com/About <http://www.oncontracts.com/About>
​​


Unless expressly stated otherwise,
this message is not intended to serve
as assent to an agreement or other document,
even if attached to this message.


Re: [O] Internal non-PROPERTY links don't export to HTML with the "a" IDs that were assigned

2016-03-28 Thread D. C. Toedt
> So what problems are you seeing (other than that the label looks funny)?

The problem is that the label can vary from export to export.  EXAMPLE:  I
added a <> target ID in the paragraph before the paragraph
containing <>; the result was that <> now
exports as http://www.CommonDraft.org/#orgtarget21; the link would no longer point to
where it was supposed to.

> CUSTOM_ID

That works for heading properties, but I'm not aware that CUSTOM_ID can be
used in the text internal to a heading-designated section.




>
>
>
>


[O] Internal non-PROPERTY links don't export to HTML with the "a" IDs that were assigned

2016-03-28 Thread D. C. Toedt
I'm using the latest update from the package updater, released 2016-03-28:
 Org-mode version 8.3.2 (release_8.3.2-164-g50a182).

I can best illustrate the problem with an example:

*Org source:  *

See also the [[IndemnNonAssign][Indemnity rights not
> ​​
> assignable]] provision.


*​Former exported HTML (correct):*


See also the http://www.commondraft.org/#IndemnNonAssign>
> demnNonAssign <http://www.commondraft.org/#IndemnNonAssign>">Indemnity rig
> ​​
> hts not assignable provision.

​​

*Current exported HTML (incorrect):*

​​
> See also the <
> ​​
> a href="#orgtarget21">Indemnity rights not assignable provision.

​​

​​
This causes problems, because "orgtarget21" won't necessarily be assigned
to the same point in the text, which in turn means that "jump cite" ​​links
to specific points internal to the document will break.​​
​​
​​I scanned through the documentation but didn't see anything indicating
​that there's a setting to use assigned names instead of "orgtargetNN"


​​

D. C. Toedt III
*(My last name is pronounced "Tate")*
Attorney & arbitrator -- tech contracts & IP
O: +1 (713) 364-6545   C: +1 (713) 516-8968
​​

d...@toedt.com@dctoedt <https://twitter.com/DCToedt>
​
Skype: dctoedt
​

www.OnContracts.com/About <http://www.oncontracts.com/About>
​​


Unless expressly stated otherwise,
this message is not intended to serve
as assent to an agreement or other document,
even if attached to this message.


[O] TOC local for specified heading and its subheadings (in HTML export)?

2015-11-27 Thread D. C. Toedt
The #+TOC: headlines [n] local feature is really useful; I use it a lot.
How easy would it be to do a macro to generate a similar table of contents
for the subheadings of an arbitrary specified heading?  That would be an
alternative to transclusion <https://en.wikipedia.org/wiki/Transclusion>,
allowing re-use of text but with links instead of the actual text.  For UX
purposes this will sometimes be preferable to actual transclusion, e.g.,
with Angular.js.  I'm not even a cargo-cult programmer in elisp and
wouldn't have the level of skill to do this myself without spending a lot
of time.

EXAMPLE:  In the Common Draft contract form file
<http://www.CommonDraft.org>, I'd like to add a Model Confidentiality
Agreement, a Model Software Development Agreement, a Model Consulting
Services Agreement, etc.  Each of these model agreements would include
several TOC-style lists of clauses under various other headings, as shown
in the following hypothetical file excerpt:

* Model Confidentiality Agreement
  :PROPERTIES:
  :CUSTOM_ID: ConfAgrmt
  :END:

** Parties; Effective Date

This Agreement is entered into as of November 27, 2015, between ABC Ltd.
and XYZ Inc.

** Confidential Information

# = The next line is the desired feature: Generate a TOC list
(with links) of all subheadings in the specified heading
=
#+TOC: headlines 1 local ConfInfoClauses

** Notices

#+TOC: headlines 1 local NoticesClauses

* Signatures

AGREED:

ABC Ltd, by:

[Signature block]


AGREED:

XYZ Inc., by:

[Signature block]


* Confidential Information Clauses
  :PROPERTIES:
  :CUSTOM_ID: ConfInfoClauses
  :END:

** Confidential Information Definition
  :PROPERTIES:
  :CUSTOM_ID: ConfInfoDefn
  :END:

[text of clause]

** Confidentiality Obligation
  :PROPERTIES:
  :CUSTOM_ID: ConfInfoOblig
  :END:

[text of clause]


* Notices Clauses
  :PROPERTIES:
  :CUSTOM_ID: NoticesClauses
  :END:

​** Notices Must Be in Writing
  :PROPERTIES:
  :CUSTOM_ID: NoticesWriting
  :END:
​
​[text of clause]

** Notices by Email
  :PROPERTIES:
  :CUSTOM_ID: NoticesEmail
  :END:
​
​[text of clause]​

​I'd be happy to make a donation for this.

​


D. C. Toedt III
*(My last name is pronounced "Tate")*
Attorney & arbitrator -- tech contracts & IP
Common Draft <http://www.CommonDraft.org> contract clauses & checklists,
annotated
O: +1 (713) 364-6545   C: +1 (713) 516-8968
​​

d...@toedt.com@dctoedt <https://twitter.com/DCToedt>
www.OnContracts.com/About

Unless expressly stated otherwise,
this message is not intended to serve
as assent to an agreement or other document,
even if attached to this message.


Re: [O] Exporter aborts upon encountering even one unresolvable link

2015-10-10 Thread D. C. Toedt
UPDATE:

> I haven't tried org-lint yet (
http://steve.planetbarr.com/posts/2015-08-11-org-lint.html).
> That requires building org from a separate branch in git.  That makes me
nervous --
> I'm a user, not a dev, and while I'm sort of familiar with git, it seems
like yet another layer of complexity.

1.  OK, I got org-mode version 8.3.2 up and running using git.

The org-lint feature works -- very nice.

> The old way, namely just marking the problem link in the output file and
continuing with the export,
> made it very easy to search for the problem in the output file. That
approach was simple and worked quite well.

I still think that, but at least I'm up and running again.

Thanks to all for putting up with my lack of expertise, and especially to
the org-mode creator(s) and maintainers for a very-useful tool.

2.  For background: I'm a lawyer and part-time law professor.  I've been
using org-mode for several years now in building http:/www.CommonDraft.org
-- a free (Creative Commons) library of clauses for tech- and commercial
contracts, extensively annotated with citations, commentary, and links to
further reading.  The long-term goal is to have a Common Draft reference
version of each substantive variation of each type of contract clause
that's typically seen in the wild. That will free up lawyers from always
having to draft detailed contract language, and from having to review other
people's detailed language --- instead, we can simply incorporate desired
Common-Draft clauses by reference. (It's analogous to a library of callable
functions in software development.)  That will save time for both the
contract drafter and for the other side's legal reviewer, which in turn
will help the parties get a workable contract to signature sooner, at lower
cost.

In pitching the Common Draft concept, my latest metaphor for non-techies is
this:  If you're ordering a meal in a Chinese-food restaurant, but you
don't want any monosodium glutamate (MSG) in your food, you're _not_ going
to hand your server a set of detailed recipes for the dishes you want and
ask that the kitchen staff use those recipes.  No, you're simply going to
order from the menu --- hot-and-sour soup, kung-pao chicken, or whatever
--- but you'll say to your server, "no MSG, please," as a desired
variation.  It's the same idea for the Common Draft project:  A contract
drafter can "order from the menu" and specify any desired variations. The
Common Draft project is starting to get some attention in the
contract-management community; the International Association for Contract
and Commercial Management (http://www.IACCM.com), which has around 35,000
members worldwide, is supporting it.





D. C. Toedt III
*(My last name is pronounced "Tate")*
Attorney & arbitrator -- tech contracts & IP
Common Draft <http://www.CommonDraft.org> toolkit for contract drafters
O: +1 (713) 364-6545
C: +1 (713) 516-8968
​​

d...@toedt.com
www.OnContracts.com/About

Unless expressly stated otherwise,
this message is not intended to serve
as assent to an agreement or other document,
even if attached to this message.



On Fri, Oct 9, 2015 at 5:28 PM, D. C. Toedt <d...@toedt.com> wrote:

> >> Look at publishing instead of exporting to html which works with missing
> links.
> ​​
>
> Apparently it doesn't.
> I'm still having the same problem of throwing a fatal error --- even when
> publishing, not exporting --- when encountering a missing (unresolvable)
> link.  This was after doing a clean install of org-mode 8.3.2 (20151005,
> using the emacs package manager) on top of a clean install of the latest
> stable version of emacs (24.5) from EmacsForMacOSX. (I'm running the latest
> version of Mac OS X Yosemite; haven't gotten around to El Capitan.)  I then
> set up publishing the way Rainer suggested in his email.  Well, publishing
> likewise throws an error when it encounters a missing link target, just as
> does exporting.
>
> > You can use org-lint for this.
>
> I haven't tried org-lint yet (
> http://steve.planetbarr.com/posts/2015-08-11-org-lint.html).  That
> requires building org from a separate branch in git.  That makes me nervous
> -- I'm a user, not a dev, and while I'm sort of familiar with git, it seems
> like yet another layer of complexity.
>
> I don't mean to be a nag, but I genuinely don't understand why org-mode's
> former way of dealing with unresolvable links during export was disabled.
> The old way, namely just marking the problem link in the output file and
> continuing with the export, made it very easy to search for the problem in
> the output file. That approach was simple and worked quite well.  It also
> allowed exporting a single .org file, instead of jumping through the hoops
> of publishing a project.  The new way seems like a giant step backwards;
> it's likely to be a signifi

Re: [O] Exporter aborts upon encountering even one unresolvable link

2015-10-09 Thread D. C. Toedt
>> Look at publishing instead of exporting to html which works with missing
links.
​​

Apparently it doesn't.
I'm still having the same problem of throwing a fatal error --- even when
publishing, not exporting --- when encountering a missing (unresolvable)
link.  This was after doing a clean install of org-mode 8.3.2 (20151005,
using the emacs package manager) on top of a clean install of the latest
stable version of emacs (24.5) from EmacsForMacOSX. (I'm running the latest
version of Mac OS X Yosemite; haven't gotten around to El Capitan.)  I then
set up publishing the way Rainer suggested in his email.  Well, publishing
likewise throws an error when it encounters a missing link target, just as
does exporting.

> You can use org-lint for this.

I haven't tried org-lint yet (
http://steve.planetbarr.com/posts/2015-08-11-org-lint.html).  That requires
building org from a separate branch in git.  That makes me nervous -- I'm a
user, not a dev, and while I'm sort of familiar with git, it seems like yet
another layer of complexity.

I don't mean to be a nag, but I genuinely don't understand why org-mode's
former way of dealing with unresolvable links during export was disabled.
The old way, namely just marking the problem link in the output file and
continuing with the export, made it very easy to search for the problem in
the output file. That approach was simple and worked quite well.  It also
allowed exporting a single .org file, instead of jumping through the hoops
of publishing a project.  The new way seems like a giant step backwards;
it's likely to be a significant barrier to entry for non-expert users.

Can the old way of dealing with unresolvable links be restored, at least as
an option?



D. C. Toedt III
*(My last name is pronounced "Tate")*
Attorney & arbitrator -- tech contracts & IP
Common Draft <http://www.CommonDraft.org> toolkit for contract drafters
O: +1 (713) 364-6545
C: +1 (713) 516-8968
​​

d...@toedt.com
www.OnContracts.com/About

Unless expressly stated otherwise,
this message is not intended to serve
as assent to an agreement or other document,
even if attached to this message.


Re: [O] Exporter aborts upon encountering even one unresolvable link

2015-10-07 Thread D. C. Toedt
To the org-mode maintainers (all praise and thanks to them, incidentally):
 Is there any chance that this can be made into a per-file configuration
#+OPTION?  No doubt the publishing approach suggested by Rainer (thanks
also to him for suggesting it) would work, but it would take some effort to
get it set up; I've looked into publishing on previous occasions and
concluded it was easier just to do a simple HTML export.  Other things
being equal, #+OPTION options would be easier for non-expert users such as
me to work with, than fiddling with the .emacs file.

D. C. Toedt III
*(My last name is pronounced "Tate")*
Attorney & arbitrator -- tech contracts & IP
Common Draft <http://www.CommonDraft.org> contracts project
O: +1 (713) 364-6545
C: +1 (713) 516-8968
​​

d...@toedt.com
www.OnContracts.com/About

Unless expressly stated otherwise,
this message is not intended to serve
as assent to an agreement or other document,
even if attached to this message.


On Fri, Sep 25, 2015 at 12:04 AM, Rainer M Krug <rai...@krugs.de> wrote:

[portions omitted]​​



> ​​
> Look at publishing instead of exporting to html which works with
> ​​
> missing links.
> ​​
>
> ​​
> I have the following in my emacs.org which makes it possible to publish
> all org files to html in the folder ./pubHTML/ which is equivalent to
> exporting.
>
> #+begin_src emacs-lisp
> (setq org-publish-project-alist
>   '(
> ("local"
>  :base-directory "./"
>  :base-extension "org"
>  :publishing-directory "./pubHTML/"
>  :recursive t
>  :publishing-function org-html-publish-to-html
>  :headline-levels 6
>  :auto-preamble t)
> ))
> #+end_src
>
>
>


[O] Exporter aborts upon encountering even one unresolvable link

2015-09-24 Thread D. C. Toedt
I just updated to 8.3.1 from 8.3beta (from git).  That appears to have been
a terrible mistake on my part.

>From this thread
<https://lists.gnu.org/archive/html/emacs-orgmode/2015-09/msg00040.html> I
see that the exporter now throws an error and aborts when it encounters an
unresolvable link.  That makes things really, REALLY difficult.  It means I
can't get a complete, working export to HTML (in my case) until all link
problems are fixed in my 22KLOC .org file (which I use to generate
http://www.CommonDraft.org/index.html
<http://www.commondraft.org/index.html>).  That seems EXTREMELY suboptimal.
(I'm trying to be tactful here.)

Worse, the exporter doesn't even generate a list of unresolvable links
before aborting.  That means the only way that I can find and fix busted
links (so far as I know) is to do an export --- which takes several minutes
given the large file  --- and have the export abort on a single link. Then
I fix that one link, export again, and have it abort again. Repeat.
Aaaargg.

I started looking at the hooks, as suggested in a message in the previous
thread, but I'm not nearly skilled enough in elisp to be able to do
anything useful.

Any suggestions?


*D. C. Toedt III  **(My last name is pronounced "Tate"; I go by "D. C.,"
which stands for Dell Charles**) *
Attorney & neutral arbitrator -- tech contracts & IP  |  Adjunct professor,
University of Houston Law Center
​Author, ​​​Common Draft <http://www.commondraft.org/> desk book of
contract clauses & research notes   |  LinkedIn: dctoedt
<http://www.linkedin.com/in/dctoedt>   |   Calendar
<https://www.google.com/calendar/embed?src=dc.to...@toedt.com=WEEK>
(redacted)
E: d...@toedt.comO: +1 (713) 364-6545C: +1 (713) 516-8968
​​

​
Houston, Texas (Central time zone)

Unless expressly stated otherwise, this message is not intended
to serve as assent to an agreement or other document, whether or not
attached to this message.


Re: [O] Exporter aborts upon encountering even one unresolvable link

2015-09-24 Thread D. C. Toedt
P.S.:   Thank heavens for Time Machine.




On Thu, Sep 24, 2015 at 9:50 PM, D. C. Toedt <d...@toedt.com> wrote:

> I just updated to 8.3.1 from 8.3beta (from git).  That appears to have
> been a terrible mistake on my part.
>
> From this thread
> <https://lists.gnu.org/archive/html/emacs-orgmode/2015-09/msg00040.html>
> I see that the exporter now throws an error and aborts when it encounters
> an unresolvable link.  That makes things really, REALLY difficult.  It
> means I can't get a complete, working export to HTML (in my case) until all
> link problems are fixed in my 22KLOC .org file (which I use to generate
> http://www.CommonDraft.org/index.html
> <http://www.commondraft.org/index.html>).  That seems EXTREMELY
> suboptimal. (I'm trying to be tactful here.)
>
> Worse, the exporter doesn't even generate a list of unresolvable links
> before aborting.  That means the only way that I can find and fix busted
> links (so far as I know) is to do an export --- which takes several minutes
> given the large file  --- and have the export abort on a single link.
> Then I fix that one link, export again, and have it abort again. Repeat.
> Aaaargg.
>
> I started looking at the hooks, as suggested in a message in the previous
> thread, but I'm not nearly skilled enough in elisp to be able to do
> anything useful.
>
> Any suggestions?
>
>
> *D. C. Toedt III  **(My last name is pronounced "Tate"; I go by "D. C.,"
> which stands for Dell Charles**) *
> Attorney & neutral arbitrator -- tech contracts & IP  |  Adjunct
> professor, University of Houston Law Center
> ​Author, ​​​Common Draft <http://www.commondraft.org/> desk book of
> contract clauses & research notes   |  LinkedIn: dctoedt
> <http://www.linkedin.com/in/dctoedt>   |   Calendar
> <https://www.google.com/calendar/embed?src=dc.to...@toedt.com=WEEK>
> (redacted)
> E: d...@toedt.comO: +1 (713) 364-6545C: +1 (713) 516-8968
> ​​
>
> ​
> Houston, Texas (Central time zone)
>
> Unless expressly stated otherwise, this message is not intended
> to serve as assent to an agreement or other document, whether or not
> attached to this message.
>
>
>


Re: [O] Table of contents for just one section?

2015-03-16 Thread D. C. Toedt
I see this feature is now in the beta of Org-Mode 8.3.  Excellent!   I'm
doing several things with it in the forthcoming release of the Common Draft
contract clause library (linked below).

I also see that there now seems to be some reluctance by the maintainers to
accept donations. (See http://comments.gmane.org/gmane.emacs.orgmode/83318).
Has that been resolved?  I'd like to do a donation.




*D. C. Toedt III  **(I go by D. C., which stands for Dell Charles; my** last
name is pronounced Tate) *
Attorney and neutral arbitrator -- tech contracts and intellectual property
​Editor, ​​​Common Draft http://www.commondraft.org/ contract clauses and
templates, with research notes
Lecturer, University of Houston Law Center
d...@toedt.com LinkedIn: dctoedt http://www.linkedin.com/in/dctoedt
Calendar
https://www.google.com/calendar/embed?src=dc.to...@toedt.commode=WEEK
(redacted)
O: +1 (713) 364-6545C: +1 (713) 516-8968
​​

​
Houston, Texas (Central time zone)

Unless expressly stated otherwise, this message is not intended
to serve as an electronic signature nor as assent to an agreement.



On Sun, Oct 26, 2014 at 6:03 AM, D. C. Toedt d...@toedt.com wrote:

 Many thanks!  I'll wait till this shows up in the package updater (I've
 toyed with Git only enough to be dangerous) but am eagerly looking forward
 to trying it.



 D. C. (Dell Charles) Toedt III  *(my** last name is pronounced Tate) *
 Attorney and neutral arbitrator -- tech contracts and intellectual property
 Lecturer, University of Houston Law Center
 ​Editor, ​​​Common Draft http://www.commondraft.org/ contract form file
 d...@toedt.com LinkedIn: dctoedt http://www.linkedin.com/in/dctoedt
   Calendar
 https://www.google.com/calendar/embed?src=dc.to...@toedt.commode=WEEK
 (redacted)
 O: +1 (713) 364-6545C: +1 (713) 516-8968
 ​​

 ​
 Houston, Texas (Central time zone)

 Unless expressly stated otherwise, this message is not intended
 to serve as an electronic signature nor as assent to an agreement.



 On Sun, Oct 26, 2014 at 3:15 AM, Nicolas Goaziou m...@nicolasgoaziou.fr
 wrote:

 Hello,

 D. C. Toedt d...@toedt.com writes:

  The local keyword would be great.

 The following patch implements local tocs for ascii, html and odt export
 back-ends. I skipped latex because using minitoc looks too tricky to
 automate.

 Feedback welcome.


 Regards,

 --
 Nicolas Goaziou





Re: [O] [Patch] Fix date-based sorting of tags and tags-todo agenda views

2015-02-09 Thread Yuri D. Lensky

Done.

From 64c0ea3d6ac89d8ab12b030b9270ea21599a5c83 Mon Sep 17 00:00:00 2001
From: Yuri D. Lensky y...@ydl.cm
Date: Sat, 7 Feb 2015 13:37:46 -0500
Subject: [PATCH] Fix timestamp-based sorting of tags-based entries in agenda

* lisp/org.el (org-scan-tags): Fix agenda org tags scans to properly
  add timestamp property, completely analogously to
  org-agenda-get-todos.
* lisp/org-agenda.el (org-agenda-entry-get-agenda-timestamp,
  org-agenda-get-todos): Factored timestamp retrieval code out to
  separate function org-agenda-entry-get-agenda-timestamp from
  org-agenda-get-todos.

Before this fix, timestamps were ignored when sorting agenda views of
the 'tags' and 'tags-todo' types.

TINYCHANGE
---
 lisp/org-agenda.el | 67 +++---
 lisp/org.el| 11 +++--
 2 files changed, 48 insertions(+), 30 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 1872ca5..10d52bb 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -5362,6 +5362,40 @@ the documentation of `org-diary'.
 (defvar org-heading-keyword-regexp-format) ; defined in org.el
 (defvar org-agenda-sorting-strategy-selected nil)
 
+(defun org-agenda-entry-get-agenda-timestamp (pom)
+  Retrieve timestamp information for sorting agenda views.
+Given a point or marker POM, returns a cons cell of the timestamp
+and the timestamp type relevant for the sorting strategy in
+`org-agenda-sorting-strategy-selected'.
+  (let (ts ts-date-type)
+(save-match-data
+  (cond ((org-em 'scheduled-up 'scheduled-down
+org-agenda-sorting-strategy-selected)
+(setq ts (org-entry-get pom SCHEDULED)
+  ts-date-type  scheduled))
+   ((org-em 'deadline-up 'deadline-down
+org-agenda-sorting-strategy-selected)
+(setq ts (org-entry-get pom DEADLINE)
+  ts-date-type  deadline))
+   ((org-em 'ts-up 'ts-down
+org-agenda-sorting-strategy-selected)
+(setq ts (org-entry-get pom TIMESTAMP)
+  ts-date-type  timestamp))
+   ((org-em 'tsia-up 'tsia-down
+org-agenda-sorting-strategy-selected)
+(setq ts (org-entry-get pom TIMESTAMP_IA)
+  ts-date-type  timestamp_ia))
+   ((org-em 'timestamp-up 'timestamp-down
+org-agenda-sorting-strategy-selected)
+(setq ts (or (org-entry-get pom SCHEDULED)
+ (org-entry-get pom DEADLINE)
+ (org-entry-get pom TIMESTAMP)
+ (org-entry-get pom TIMESTAMP_IA))
+  ts-date-type ))
+   (t (setq ts-date-type )))
+  (cons (when ts (ignore-errors (org-time-string-to-absolute ts)))
+   ts-date-type
+
 (defun org-agenda-get-todos ()
   Return the TODO information for agenda display.
   (let* ((props (list 'face nil
@@ -5386,7 +5420,8 @@ the documentation of `org-diary'.
   |)
  \\|) \\)))
  (t org-not-done-regexp
-marker priority category level tags todo-state ts-date ts-date-type
+marker priority category level tags todo-state
+ts-date ts-date-type ts-date-pair
 ee txt beg end inherited-tags todo-state-end-pos)
 (goto-char (point-min))
 (while (re-search-forward regexp nil t)
@@ -5406,33 +5441,9 @@ the documentation of `org-diary'.
(goto-char (match-beginning 2))
(setq marker (org-agenda-new-marker (match-beginning 0))
  category (org-get-category)
- ts-date (let (ts)
-   (save-match-data
- (cond ((org-em 'scheduled-up 'scheduled-down
-org-agenda-sorting-strategy-selected)
-(setq ts (org-entry-get (point) SCHEDULED)
-  ts-date-type  scheduled))
-   ((org-em 'deadline-up 'deadline-down
-org-agenda-sorting-strategy-selected)
-(setq ts (org-entry-get (point) DEADLINE)
-  ts-date-type  deadline))
-   ((org-em 'ts-up 'ts-down
-org-agenda-sorting-strategy-selected)
-(setq ts (org-entry-get (point) TIMESTAMP)
-  ts-date-type  timestamp))
-   ((org-em 'tsia-up 'tsia-down
-org-agenda-sorting-strategy-selected)
-(setq ts (org-entry-get (point) TIMESTAMP_IA)
-  ts-date-type  timestamp_ia))
-   ((org-em 'timestamp-up 'timestamp-down

Re: [O] [Patch] Fix date-based sorting of tags and tags-todo agenda views

2015-02-08 Thread Yuri D. Lensky
Done.

From 131435ac43d950bad2bb42b92982f498de74a31f Mon Sep 17 00:00:00 2001
From: Yuri D. Lensky y...@ydl.cm
Date: Sat, 7 Feb 2015 13:37:46 -0500
Subject: [PATCH] Fix timestamp-based sorting of tags-based entries in agenda

* lisp/org.el (org-scan-tags): Fix agenda org tags scans to properly
  add timestamp property, completely analogously to
  org-agenda-get-todos.
* lisp/org-agenda.el (org-agenda-entry-get-agenda-timestamp,
  org-agenda-get-todos): Factored timestamp retrieval code out to
  separate function org-agenda-entry-get-agenda-timestamp from
  org-agenda-get-todos.

Before this fix, timestamps were ignored when sorting agenda views of
the 'tags' and 'tags-todo' types.
---
 lisp/org-agenda.el | 66 +++---
 lisp/org.el| 11 +++--
 2 files changed, 47 insertions(+), 30 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index e7cfd27..5b04cac 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -5362,6 +5362,39 @@ the documentation of `org-diary'.
 (defvar org-heading-keyword-regexp-format) ; defined in org.el
 (defvar org-agenda-sorting-strategy-selected nil)
 
+(defun org-agenda-entry-get-agenda-timestamp (pom)
+  Given a point or maker POM, returns a cons cell of the
+timestamp and the timestamp type relevant for the sorting
+strategy in `org-agenda-sorting-strategy-selected'.
+  (let (ts ts-date-type)
+(save-match-data
+  (cond ((org-em 'scheduled-up 'scheduled-down
+org-agenda-sorting-strategy-selected)
+(setq ts (org-entry-get pom SCHEDULED)
+  ts-date-type  scheduled))
+   ((org-em 'deadline-up 'deadline-down
+org-agenda-sorting-strategy-selected)
+(setq ts (org-entry-get pom DEADLINE)
+  ts-date-type  deadline))
+   ((org-em 'ts-up 'ts-down
+org-agenda-sorting-strategy-selected)
+(setq ts (org-entry-get pom TIMESTAMP)
+  ts-date-type  timestamp))
+   ((org-em 'tsia-up 'tsia-down
+org-agenda-sorting-strategy-selected)
+(setq ts (org-entry-get pom TIMESTAMP_IA)
+  ts-date-type  timestamp_ia))
+   ((org-em 'timestamp-up 'timestamp-down
+org-agenda-sorting-strategy-selected)
+(setq ts (or (org-entry-get pom SCHEDULED)
+ (org-entry-get pom DEADLINE)
+ (org-entry-get pom TIMESTAMP)
+ (org-entry-get pom TIMESTAMP_IA))
+  ts-date-type ))
+   (t (setq ts-date-type )))
+  (cons (when ts (ignore-errors (org-time-string-to-absolute ts)))
+   ts-date-type
+
 (defun org-agenda-get-todos ()
   Return the TODO information for agenda display.
   (let* ((props (list 'face nil
@@ -5386,7 +5419,8 @@ the documentation of `org-diary'.
   |)
  \\|) \\)))
  (t org-not-done-regexp
-marker priority category level tags todo-state ts-date ts-date-type
+marker priority category level tags todo-state
+ts-date ts-date-type ts-date-pair
 ee txt beg end inherited-tags todo-state-end-pos)
 (goto-char (point-min))
 (while (re-search-forward regexp nil t)
@@ -5406,33 +5440,9 @@ the documentation of `org-diary'.
(goto-char (match-beginning 2))
(setq marker (org-agenda-new-marker (match-beginning 0))
  category (org-get-category)
- ts-date (let (ts)
-   (save-match-data
- (cond ((org-em 'scheduled-up 'scheduled-down
-org-agenda-sorting-strategy-selected)
-(setq ts (org-entry-get (point) SCHEDULED)
-  ts-date-type  scheduled))
-   ((org-em 'deadline-up 'deadline-down
-org-agenda-sorting-strategy-selected)
-(setq ts (org-entry-get (point) DEADLINE)
-  ts-date-type  deadline))
-   ((org-em 'ts-up 'ts-down
-org-agenda-sorting-strategy-selected)
-(setq ts (org-entry-get (point) TIMESTAMP)
-  ts-date-type  timestamp))
-   ((org-em 'tsia-up 'tsia-down
-org-agenda-sorting-strategy-selected)
-(setq ts (org-entry-get (point) TIMESTAMP_IA)
-  ts-date-type  timestamp_ia))
-   ((org-em 'timestamp-up 'timestamp-down
-org-agenda-sorting-strategy-selected

[O] [Patch] Fix date-based sorting of tags and tags-todo agenda views

2015-02-07 Thread Yuri D Lensky
An example to test this problem:

Evaluate:
(setq org-agenda-custom-commands
  '((t TEST tags-todo tag
 ((org-agenda-sorting-strategy '(deadline-up))
then run the view. It will not be sorted properly before the patch, but will be 
after.

I would also recommend factoring the code that I added out into a separate 
function (as it also appears almost verbatim in org-agenda-get-todos), but I am 
not sure the conventions or desire for this.

From c8a7211639d9c138a3b3dcb7e3ce7c85264580f1 Mon Sep 17 00:00:00 2001
From: Yuri D. Lensky y...@ydl.cm
Date: Sat, 7 Feb 2015 13:37:46 -0500
Subject: [PATCH] Fix timestamp-based sorting of tags-based entries in agenda

* lisp/org.el (org-scan-tags): Fix agenda org tags scans to properly
  add timestamp property, completely analogously to org-agenda-get-todos.

Before this fix, timestamps were ignored when sorting agenda views of
the 'tags' and 'tags-todo' types.
---
 lisp/org.el | 34 --
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index a095f8d..54b375e 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14177,7 +14177,7 @@ headlines matching this string.
  lspos tags tags-list
 (tags-alist (list (cons 0 org-file-tags)))
 (llast 0) rtn rtn1 level category i txt
-todo marker entry priority)
+todo marker entry priority ts-date ts-date-type)
 (when (not (or (member action '(agenda sparse-tree)) (functionp action)))
   (setq action (list 'lambda nil action)))
 (save-excursion
@@ -14194,6 +14194,34 @@ headlines matching this string.
  (goto-char (setq lspos (match-beginning 0)))
  (setq level (org-reduced-level (org-outline-level))
category (org-get-category))
+  (when (eq action 'agenda)
+(setq ts-date (let (ts)
+   (save-match-data
+ (cond ((org-em 'scheduled-up 'scheduled-down
+org-agenda-sorting-strategy-selected)
+(setq ts (org-entry-get (point) SCHEDULED)
+  ts-date-type  scheduled))
+   ((org-em 'deadline-up 'deadline-down
+org-agenda-sorting-strategy-selected)
+(setq ts (org-entry-get (point) DEADLINE)
+  ts-date-type  deadline))
+   ((org-em 'ts-up 'ts-down
+org-agenda-sorting-strategy-selected)
+(setq ts (org-entry-get (point) TIMESTAMP)
+  ts-date-type  timestamp))
+   ((org-em 'tsia-up 'tsia-down
+org-agenda-sorting-strategy-selected)
+(setq ts (org-entry-get (point) TIMESTAMP_IA)
+  ts-date-type  timestamp_ia))
+   ((org-em 'timestamp-up 'timestamp-down
+org-agenda-sorting-strategy-selected)
+(setq ts (or (org-entry-get (point) 
SCHEDULED)
+ (org-entry-get (point) DEADLINE)
+ (org-entry-get (point) 
TIMESTAMP)
+ (org-entry-get (point) 
TIMESTAMP_IA))
+  ts-date-type ))
+   (t (setq ts-date-type )))
+ (when ts (ignore-errors (org-time-string-to-absolute 
ts)))
  (setq i llast llast level)
  ;; remove tag lists from same and sublevels
  (while (= i level)
@@ -14265,7 +14293,9 @@ headlines matching this string.
  (org-add-props txt props
'org-marker marker 'org-hd-marker marker 'org-category category
'todo-state todo
-   'priority priority 'type tagsmatch)
+'ts-date ts-date
+   'priority priority
+'type (concat tagsmatch ts-date-type))
  (push txt rtn))
 ((functionp action)
  (setq org-map-continue-from nil)
-- 
1.9.4.msysgit.2



0001-Fix-timestamp-based-sorting-of-tags-based-entries-in.patch
Description: 0001-Fix-timestamp-based-sorting-of-tags-based-entries-in.patch


[O] [PATCH] ox-html.el: Add exporting of priority

2015-01-09 Thread Zane D. Purvis
* list/ox-html.el (org-html--priority): New function.
(org-html-format-headline-default-function): Call `org-html--priority'.
(org-html-style-default): Add `.priority'.

HTML export previously did not support exporting of priority simply by setting
`org-export-with-priority' to `t'.

TINYCHANGE
---
 lisp/ox-html.el | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 3c3b444..a1c33ac 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -278,6 +278,7 @@ defconst org-html-style-default
   .done   { color: green; }
   .tag{ background-color: #eee; font-family: monospace;
 padding: 2px; font-size: 80%; font-weight: normal; }
+  .priority { font-family: monospace; color: orange; }
   .timestamp { color: #bebebe; }
   .timestamp-kwd { color: #5f9ea0; }
   .right  { margin-left: auto; margin-right: 0px;  text-align: right; }
@@ -1885,6 +1886,14 @@ defun org-html--todo (todo info)
 (org-html-fix-class-name todo)
 todo)))

+ Priority
+
+(defun org-html--priority (priority info)
+  Format a priority into HTML.
+PRIORITY is the character code of the priority or nil.
+INFO is a plist containing export options.
+  (and priority (format span class=\priority\[%c]/span priority)))
+
  Tags

 (defun org-html--tags (tags info)
@@ -2396,8 +2405,9 @@ defun org-html-format-headline-default-function
   Default format function for a headline.
 See `org-html-format-headline-function' for details.
   (let ((todo (org-html--todo todo info))
+(priority (org-html--priority priority info))
 (tags (org-html--tags tags info)))
-(concat todo (and todo  ) text (and tags #xa0;#xa0;#xa0;) tags)))
+(concat todo (and todo  ) priority (and priority  ) text (and
tags #xa0;#xa0;#xa0;) tags)))

 (defun org-html--container (headline info)
   (or (org-element-property :HTML_CONTAINER headline)
-- 
1.9.2.msysgit.0



Re: [O] [PATCH] ox-html.el: add exporting of priority

2015-01-09 Thread Zane D. Purvis
Sure thing. Expect a new patch momentarily. Thanks.

On Fri, Jan 9, 2015 at 3:20 AM, Nicolas Goaziou m...@nicolasgoaziou.fr wrote:
 Hello,

 Zane D. Purvis zane.pur...@gmail.com writes:

 Thanks for the patch.

 The summary line should be capitalized, i.e.,

   ox-html: Add exporting of priority

 * list/ox-html.el (org-html--priority): new function

 Capitalize, too.

 (org-html-format-headline-default-function): call `org-html--priority'

 Ditto.

 (org-html-style-default): add `.priority'

 Ditto.

 +(defun org-html--priority (priority info)
 +  Format a priority into HTML.
 +PRIORITY is the character code of the priority or nil.
 +INFO is a plist containing export options.
 +  (when priority
 +(format span class=\priority\[%s]/span
 +(byte-to-string priority

 Shorter:

   (and priority (format span class=\priority\[%c]/span priority))

 Could you fix these issues before I apply your patch?


 Regards,

 --
 Nicolas Goaziou



[O] [PATCH] ox-html.el: add exporting of priority

2015-01-08 Thread Zane D. Purvis
* list/ox-html.el (org-html--priority): new function
(org-html-format-headline-default-function): call `org-html--priority'
(org-html-style-default): add `.priority'

HTML export previously did not support exporting of priority simply by setting
`org-export-with-priority' to `t'.

TINYCHANGE
---
 lisp/ox-html.el | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 3c3b444..1d1aa57 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -278,6 +278,7 @@ for the JavaScript code in this tag.
   .done   { color: green; }
   .tag{ background-color: #eee; font-family: monospace;
 padding: 2px; font-size: 80%; font-weight: normal; }
+  .priority { font-family: monospace; color: orange; }
   .timestamp { color: #bebebe; }
   .timestamp-kwd { color: #5f9ea0; }
   .right  { margin-left: auto; margin-right: 0px;  text-align: right; }
@@ -1885,6 +1886,16 @@ INFO is a plist used as a communication channel.
 (org-html-fix-class-name todo)
 todo)))

+ Priority
+
+(defun org-html--priority (priority info)
+  Format a priority into HTML.
+PRIORITY is the character code of the priority or nil.
+INFO is a plist containing export options.
+  (when priority
+(format span class=\priority\[%s]/span
+(byte-to-string priority
+
  Tags

 (defun org-html--tags (tags info)
@@ -2396,8 +2407,9 @@ holding contextual information.
   Default format function for a headline.
 See `org-html-format-headline-function' for details.
   (let ((todo (org-html--todo todo info))
+(priority (org-html--priority priority info))
 (tags (org-html--tags tags info)))
-(concat todo (and todo  ) text (and tags #xa0;#xa0;#xa0;) tags)))
+(concat todo (and todo  ) priority (and priority  ) text (and
tags #xa0;#xa0;#xa0;) tags)))

 (defun org-html--container (headline info)
   (or (org-element-property :HTML_CONTAINER headline)
-- 
1.9.1



[O] [PATCH] ox-html.el: DONE is monospace for consistency

2015-01-08 Thread Zane D. Purvis
* lisp/ox-html.el (org-html-style-default): `.done' gets `font-family:
monospace;'

Other items on the headline that aren't the text itself are monospaced,
including non-DONE todo's.

TINYCHANGE
---
 lisp/ox-html.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 3c3b444..e2d1921 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -275,7 +275,7 @@ for the JavaScript code in this tag.
  !--/*--![CDATA[/*!--*/
   .title  { text-align: center; }
   .todo   { font-family: monospace; color: red; }
-  .done   { color: green; }
+  .done   { font-family: monospace; color: green; }
   .tag{ background-color: #eee; font-family: monospace;
 padding: 2px; font-size: 80%; font-weight: normal; }
   .timestamp { color: #bebebe; }
-- 
1.9.1



Re: [O] Table of contents for just one section?

2014-10-26 Thread D. C. Toedt
Many thanks!  I'll wait till this shows up in the package updater (I've
toyed with Git only enough to be dangerous) but am eagerly looking forward
to trying it.



D. C. (Dell Charles) Toedt III  *(my** last name is pronounced Tate) *
Attorney and neutral arbitrator -- tech contracts and intellectual property
Lecturer, University of Houston Law Center
​Editor, ​​​Common Draft http://www.commondraft.org/ contract form file
d...@toedt.com LinkedIn: dctoedt http://www.linkedin.com/in/dctoedt
Calendar
https://www.google.com/calendar/embed?src=dc.to...@toedt.commode=WEEK
(redacted)
O: +1 (713) 364-6545C: +1 (713) 516-8968
​​

​
Houston, Texas (Central time zone)

Unless expressly stated otherwise, this message is not intended
to serve as an electronic signature nor as assent to an agreement.



On Sun, Oct 26, 2014 at 3:15 AM, Nicolas Goaziou m...@nicolasgoaziou.fr
wrote:

 Hello,

 D. C. Toedt d...@toedt.com writes:

  The local keyword would be great.

 The following patch implements local tocs for ascii, html and odt export
 back-ends. I skipped latex because using minitoc looks too tricky to
 automate.

 Feedback welcome.


 Regards,

 --
 Nicolas Goaziou



Re: [O] Table of contents for just one section?

2014-10-20 Thread D. C. Toedt
The local keyword would be great.

Right now I'm interested only in HTML export -- I can use Pandoc to convert
to anything else.

Thanks!



D. C. (Dell Charles) Toedt III  *(my** last name is pronounced Tate) *
Attorney and neutral arbitrator -- tech contracts and intellectual property
Lecturer, University of Houston Law Center
​Editor, ​​​Common Draft http://www.commondraft.org/ project:  A readable
library of best-practices contract clauses,
 with extensive citations and commentary, updated often.
d...@toedt.com LinkedIn: dctoedt http://www.linkedin.com/in/dctoedt
Calendar
https://www.google.com/calendar/embed?src=dc.to...@toedt.commode=WEEK
(redacted)
O: +1 (713) 364-6545C: +1 (713) 516-8968
​​

​
Houston, Texas (Central time zone)

Unless expressly stated otherwise, this message is not intended
to serve as an electronic signature nor as assent to an agreement.



On Mon, Oct 20, 2014 at 8:41 AM, Nicolas Goaziou m...@nicolasgoaziou.fr
wrote:

 Hello,

 D. C. Toedt d...@toedt.com writes:

  I'd like to do sub-TOCs for individual sections and subsections.

 We could add a local keyword to TOC lines, e.g.,

   #+TOC: headlines 1 local

 would mean only top level children in current headline.

 This feature is trivial to add to ox-ascii, probably easy for ox-html or
 ox-odt, assuming someone can provide the expected code.

 Implementing it in ox-latex probably boils down to requiring another
 package (minitoc?).

 WDYT?


 Regards,

 --
 Nicolas Goaziou



[O] Table of contents for just one section?

2014-10-15 Thread D. C. Toedt
I'd like to do sub-TOCs for individual sections and subsections.

EXAMPLE

*#+TOC: headlines 1*

** Business operations*

{{{SUBTOC}}}  # Inserts just the level-2 headings for this level-1
section

*** Services*

{{{SUBTOC}}}  # Shows just the level-3 headings for this level-2
section

*** Statements of work

*** Changes to statements of work

*** No obligation to agree to statement of work

*** Sales of goods*

{{{SUBTOC}}}

etc.

Any suggestions?

Regards, and thanks in advance,

--D. C.

D. C. (Dell Charles) Toedt III  *(my** last name is pronounced Tate) *
Attorney and neutral arbitrator -- tech contracts and intellectual property
Lecturer, University of Houston Law Center
​Editor, ​​​Common Draft http://www.commondraft.org/ project:  A readable
library of best-practices contract clauses,
 with extensive citations and commentary, updated often.
d...@toedt.com LinkedIn: dctoedt http://www.linkedin.com/in/dctoedt
Calendar
https://www.google.com/calendar/embed?src=dc.to...@toedt.commode=WEEK
(redacted)
O: +1 (713) 364-6545C: +1 (713) 516-8968
​​

​
Houston, Texas (Central time zone)

Unless expressly stated otherwise, this message is not intended
to serve as an electronic signature nor as assent to an agreement.


[O] Is it possible to export Org properties as ODT user defined fields?

2014-09-22 Thread Kevin D. Robbins
I would like to export some Org document properties as ODT user defined
fields for use in ODT templates.  For example, it would be great if
something like

#+ODT_FIELD: FOO:17 BAR:Hello, world!

in the Org document exported the following user defined fields in the
content.xml.

text:user-field-decls
text:user-field-decl office:value-type=float office:value=17
text:name=FOO/
text:user-field-decl office:value-type=string
office:string-value=Hello, world! text:name=BAR/
/text:user-field-decls

Is this currently possible?

Best Regards,

Kevin


[O] Get :PROPERTY: value from drawer in other heading during HTML export?

2014-09-12 Thread D. C. Toedt
When generating an HTML file from an org-mode document, I'd like to do a
GET operation to retrieve a property value from the drawer of an arbitrary
heading, using the CUSTOM_ID property to identify the heading.  From
Google-searching, I suspect that org-heading-components will be involved,
but I'm not proficient enough in elisp to be able to figure out how to use
it from the on-line examples I've found --- and I'm not proficient enough
in Emacs to use any built-in documentation about it (apropos doesn't
produce any results).

Here's an example, where GET-PROP is a macro I'd like to use:

==BEGIN==

#+MACRO: get-prop []

#+MACRO: get-title [omitted -- thanks to Nicolas Goaziou for the get-title
macro, at
https://lists.gnu.org/archive/html/emacs-orgmode/2014-02/msg00386.html]

* CLAUSES

** Affiliate status from voting control
  :PROPERTIES:
  :CUSTOM_ID: AffilDefn
  :CD-ID: AFFIL-VOTE
  :IMPORTANCE: Situational
  :PUSHBACK: Unlikely
  :END:

(a) One individual or organization (Person) is an {{{DEFN(Affiliate)}}}
of another Person if,  directly or indirectly via one or more
intermediaries, one of those Persons /controls/ (as defined in subdivision
(b) below), or is controlled by, or is under common control with, the other
Person.

(b) [other text omitted]


* CONTRACT TEMPLATES

** Nondisclosure Agreement

{{{GET-PROP(AffilDefn,CD-ID)}}}: {{{GET-TITLE(AffilDefn)}}} -- pushback
from the other side is {{{GET-PROP(AffilDefn,PUSHBACK)}}}.

# This should export to:
# AFFIL-VOTE: Affiliate status from voting control -- pushback from the
other side is: Unlikely.

==END==

Thanks in advance,

--D. C.

*D*ell *C*harles D. C. Toedt III  *(my** last name is pronounced Tate) *
Attorney and neutral arbitrator -- tech contracts and intellectual property
Lecturer, University of Houston Law Center
​Editor, ​​​Common Draft http://www.commondraft.org/ project:  A readable
library of best-practices contract clauses,
 with extensive citations and commentary, updated often.
d...@toedt.com LinkedIn: dctoedt http://www.linkedin.com/in/dctoedt
Calendar
https://www.google.com/calendar/embed?src=dc.to...@toedt.commode=WEEK
(redacted)
O: +1 (713) 364-6545C: +1 (713) 516-8968
​​

​
Houston, Texas (Central time zone)

Unless expressly stated otherwise, this message is not intended
to serve as an electronic signature nor as assent to an agreement.


Re: [O] Get :PROPERTY: value from drawer in other heading during HTML export?

2014-09-12 Thread D. C. Toedt
Beautiful -- thanks!

Is there any documentation I can read to get a sense of how things work?
 I've done a little bit of browsing inside org.el and its comments, but
that seems like it's not the most effective way to get up to speed.


Regards,

--D. C.

*D*ell *C*harles D. C. Toedt III  *(my** last name is pronounced Tate) *
Attorney and neutral arbitrator -- tech contracts and intellectual property
Lecturer, University of Houston Law Center
​Editor, ​​​Common Draft http://www.commondraft.org/ project:  A readable
library of best-practices contract clauses,
 with extensive citations and commentary, updated often.
d...@toedt.com LinkedIn: dctoedt http://www.linkedin.com/in/dctoedt
Calendar
https://www.google.com/calendar/embed?src=dc.to...@toedt.commode=WEEK
(redacted)
O: +1 (713) 364-6545C: +1 (713) 516-8968
​​

​
Houston, Texas (Central time zone)

Unless expressly stated otherwise, this message is not intended
to serve as an electronic signature nor as assent to an agreement.



On Fri, Sep 12, 2014 at 2:06 PM, Nicolas Goaziou m...@nicolasgoaziou.fr
wrote:

 Hello,

 D. C. Toedt d...@toedt.com writes:

  When generating an HTML file from an org-mode document, I'd like to do a
  GET operation to retrieve a property value from the drawer of an
 arbitrary
  heading, using the CUSTOM_ID property to identify the heading.  From
  Google-searching, I suspect that org-heading-components will be
 involved,
  but I'm not proficient enough in elisp to be able to figure out how to
 use
  it from the on-line examples I've found --- and I'm not proficient enough
  in Emacs to use any built-in documentation about it (apropos doesn't
  produce any results).
 

 [...]

  #+MACRO: get-title [omitted -- thanks to Nicolas Goaziou for the
 get-title
  macro, at
 
  https://lists.gnu.org/archive/html/emacs-orgmode/2014-02/msg00386.html]

 You can use the same macro, replacing

   (org-get-heading nil nil)

 with

   (org-entry-get (point) $2)

 IOW,

   #+MACRO: GET-PROP (eval (or (save-excursion (ignore-errors (let
 ((org-link-search-inhibit-query t)) (org-open-link-from-string [[#$1]])
 (org-entry-get (point) $2 UNKNOWN VALUE))


 Regards,

 --
 Nicolas Goaziou



[O] Get headline number w/o link?

2014-07-12 Thread D. C. Toedt
During HTML export, I'm trying to automatically get the headline number of
the then-current headline, WITHOUT a link, so I don't want to use [[$1]].
 EXAMPLE:

=== ORG MODE TEXT: ===

* Definitions {{{HL-NUM}}}

** Affiliate Definition {{{HL-NUM}}}

*[body text omitted]*

** Arbitration {{{HL-NUM}}}

*[body text omitted]*



=== DESIRED EXPORTED TEXT: ===

1. Affiliate Definition [1]

1.1  Affiliate Definition [1.1]

*[body text omitted]*

1.2  Arbitration [1.2]

*[body text omitted]*


Suggestions?  I've gone rummaging through org.el, ox.el, and the HTML
exporter.  I tried the following but it doesn't work:

#+MACRO: HL-NUM (eval (org-export-get-headline-number (org-get-heading nil
nil)) nil)

I'm a cargo-cult programmer at best and am just scratching the surface of
Lisp and emacs Lisp.

Thanks in advance.

Regards,

--D. C.

*D*ell *C*harles D. C. Toedt III  *(my** last name is pronounced Tate) *
Attorney and neutral arbitrator -- tech contracts and intellectual property
​Editor, ​​​Common Draft http://www.commondraft.org/ project:  Model
contract term sheets  clauses, annotated
d...@toedt.com LinkedIn: dctoedt http://www.linkedin.com/in/dctoedt
Calendar
https://www.google.com/calendar/embed?src=dc.to...@toedt.commode=WEEK
(redacted)
O: +1 (713) 364-6545C: +1 (713) 516-8968
​​

​
Houston, Texas (Central time zone)

Unless expressly stated otherwise, this message is not intended
to serve as an electronic signature nor as assent to an agreement.


Re: [O] Tables of contents for individual sections wanted -- will donate

2014-06-30 Thread D. C. Toedt
Thanks, Ian.  I've done things like that in the past, but it'd entail
maintaining the TOC by hand, which I was hoping to avoid.  True, I'd be
able to create the initial TOC using org-mode, followed by manually
inserting jQuery calls.  But I'd have to manually edit the TOC every time I
added a new chapter or section and every time I edited a heading title.






On Mon, Jun 30, 2014 at 1:40 PM, Ian Barton li...@wilkesley.net wrote:

 On 29/06/14 19:51, D. C. Toedt wrote:
  at http://www.CommonDraft.org, and plan to expand and maintain it.


 QUESTION:  I'm currently using a single, multi-level table of contents
 (TOC) at the beginning of the document.  That ends up being a lot to
 scroll through to get to the first chapter.  I'd like instead to have:

   * a one-level master TOC at the beginning of the document, listing

 and linking to just the articles (in contracts, articles are the
 same as chapters in books, that is, the top-level sections); and

   * at the beginning of each article, a TOC listing and linking to the
 subheadings within that article.


 Not an org-mode solution, but if your audience is consuming the content as
 a web page generated from org-mode, you can do most of this using jQuery.

 What I am suggesting is you make your TOC collapsible and clicking on a
 heading in the TOC expands the links to the sub headings underneath the
 heading. You can probably do nested collapsible headings so you can expand
 various level of subheadings like a concertina.

 I am definitely not a Javascript expert, but I have managed to use this
 technique on some of my documents.

 Ian.




Re: [O] Tables of contents for individual sections wanted -- will donate

2014-06-30 Thread D. C. Toedt
That would be very much of interest, Ian.  One potential issue, though:
 The table of contents generated by org-mode uses just one div/div,
with nested ulli elements.

I spent a few hours tinkering with variations on the jQuery approach at
http://www.sitepoint.com/forums/showthread.php?822342-JavaScript-list-of-links-with-sub-lists-hide-and-show,
with code at http://jsfiddle.net/GeekyJohn/9kaQQ/.  It initially
looked promising, but I haven't been able to make it reliably play well
with having links in the TOC headings.  Of course, when it comes to jQuery
I'm not much better than a cargo-cult programmer.

Thanks,

--D. C.


[O] Tables of contents for individual sections wanted -- will donate

2014-06-29 Thread D. C. Toedt
Hi all --

BACKGROUND:  I've been using org-mode to develop the *Common Draft*
annotated collection of business contract clauses, in part for the law
school course in contract drafting that I teach to third-year law students.
 I've been posting the collection as a Creative Commons document at
http://www.CommonDraft.org, and plan to expand and maintain it.

QUESTION:  I'm currently using a single, multi-level table of contents
(TOC) at the beginning of the document.  That ends up being a lot to scroll
through to get to the first chapter.  I'd like instead to have:

   - a one-level master TOC at the beginning of the document, listing and
   linking to just the articles (in contracts, articles are the same as
   chapters in books, that is, the top-level sections); and


   - at the beginning of each article, a TOC listing and linking to the
   subheadings within that article.

EXAMPLE of the desired capability:

[book title:] COMMON DRAFT:  Business Contract Clauses, Annotated and
Explained


SUMMARY OF CONTENTS


1.  Definitions  Usages


2.  Arbitration


3.  Assignment of Agreement


[etc.]


ART. 1.  DEFINITIONS  USAGES


TABLE OF CONTENTS

1.1  Affiliate Status


1.2  Agreement Definition


[etc.]


1.1  Affiliate Status

Two entities are affiliates if one of them controls, is controlled by, or
is under common control of the other, where control refers 


1.2  Agreement Definition

The term this Agreement refers to this signed document as well as its
exhibits, appendixes, annexes, .


​Suggestions?  ​If it can't currently be done in org-mode but can be
implemented, I'd donate US$100.00 to the org-mode support fund if someone
were to come up with and publish a working solution.  As for doing it
myself in e-lisp, I'm just scratching the surface of e-lisp, so it's not
something I could undertake at this juncture.


Regards,

--D. C.

*D*ell *C*harles D. C. Toedt III  *(my** last name is pronounced Tate) *
Attorney and neutral arbitrator -- tech contracts and intellectual property
​Editor, ​​​Common Draft http://www.commondraft.org/ project:  Model
contract term sheets  clauses, annotated
d...@toedt.com LinkedIn: dctoedt http://www.linkedin.com/in/dctoedt
Calendar
https://www.google.com/calendar/embed?src=dc.to...@toedt.commode=WEEK
(redacted)
O: +1 (713) 364-6545C: +1 (713) 516-8968
​​

​
Houston, Texas (Central time zone)

Unless expressly stated otherwise, this message is not intended
to serve as an electronic signature nor as assent to an agreement.


Re: [O] Include heading title in HTML section-number cross-reference, like LaTex \nameref?

2014-02-09 Thread D. C. Toedt
 Why don't you use [[#IntroTechContracts][Introduction to Technology
Contracts]]
 as a link?

I routinely tweak the text of the target headings as I edit the document.
 For example, the section heading Introduction to Technology Contracts
might become, say, Introduction:  Why Technology Contracts are Fun.

I don't want to have to manually revise the link text for the many internal
cross-reference links that exist in the document.  I'd really like to have
a way for a link to automatically retrieve the heading text during HTML
export.





On Sun, Feb 9, 2014 at 2:19 AM, Bastien b...@gnu.org wrote:

 Hello,

 D. C. Toedt d...@toedt.com writes:

  (Org-mode maintainer [Bastien, still?], can you please let me know if
  / when this gets implemented in an official release.)

 I'm not Org's maintainer anymore, I'm just /de facto/ taking decisions
 in accordance with the other core maintainers, our level of trust lets
 us move forward happily.

 To come back to you original question:

 ,
 | #+OPTIONS: H:7 TOC:nil @:t num:1 email:t author:t
 |
 | * Introduction to Technology Contracts
 |   :PROPERTIES:
 |   :CUSTOM_ID: IntroTechContracts
 |   :END:
 |
 | Lorem ipsum etc. etc.
 |
 | * Dangerous Clauses
 |   :PROPERTIES:
 |   :CUSTOM_ID: DangerousClauses
 |   :END:
 |
 | Lorem ipsum etc. etc. -- see Section [[#IntroTechContracts]].
 `

 Why don't you use

 [[#IntroTechContracts][Introduction to Technology Contracts]]

 as a link?  It is the link stored by org-store-link, and later
 inserted by org-insert-link, and AFAICS it is correctly exported.

 But it's true there are a few things we can make more consistent
 in this area though, so thanks for bringing this up.

 Best,

 --
  Bastien



Re: [O] Include heading title in HTML section-number cross-reference, like LaTex \nameref?

2014-02-09 Thread D. C. Toedt
Excellent -- that seems to export just fine.

Interestingly, the export now generates the message, Position saved to
mark ring, go back with C-c  .  I presume that comes from the
((org-link-search-inhibit-query t)) argument in the let function.  It doesn't
seem to harm the export results.

One of these years I'll have to start poking around the Emacs-Lisp code to
try to puzzle out the workings of the functions being called, especially
org-get-heading
--- is there a comparable one (or arguments) to get the section number of a
heading?

Many thanks, Nicolas.



On Sun, Feb 9, 2014 at 2:29 AM, Nicolas Goaziou n.goaz...@gmail.com wrote:

 D. C. Toedt d...@toedt.com writes:

  I found a problem when trying this on a bigger file (my book file):  If
 $1
  (actually, #$1) is for a link target that doesn't exist, then org-mode
 goes
  into its No match - create this as a new heading? (y or n) routine.
 That
  causes the rest of the export to fail.  It'd be better if get-title could
  do the same thing org-mode does natively, that is, including the text of
 $1
  as italics to indicate a non-existent link.
 
  Example file below:
 
 
  #+MACRO: get-title (eval (save-excursion (org-open-link-from-string
  [[#$1]]) (org-get-heading nil nil)))
  #+MACRO: SECREF [[#$1][{{{get-title($1)}}}]]
  #+OPTIONS: H:7 toc:nil num:1 email:t author:t
 
  * Introduction to Technology Contracts
:PROPERTIES:
:CUSTOM_ID: IntroTechContracts
:END:
 
  Lorem ipsum etc. etc.
 
  * Dangerous Clauses
:PROPERTIES:
:CUSTOM_ID: DangerousClauses
:END:
 
  Lorem ipsum etc. etc. -- see Section {{{SECREF(
  BogusLinkTarget
  )}}}

 The following should work.

   #+MACRO: get-title (eval (or (save-excursion (ignore-errors (let
 ((org-link-search-inhibit-query t)) (org-open-link-from-string [[#$1]])
 (org-get-heading nil nil /$1/))


 Regards,

 --
 Nicolas Goaziou



[O] Include heading title in HTML section-number cross-reference, like LaTex \nameref?

2014-02-08 Thread D. C. Toedt
I'm using Org-mode version 8.2.5f with Gnu Emacs 24.3 on a Macbook Air with
Mavericks. I'm using it to build building an annotated collection of
contract clauses that I'm releasing under a Creative Commons license (see
http://www.CommonDraft.org), which I hope to monetize with a book on
contract drafting and negotiation.

I've done a fair amount of Google searching and also searching within this
list. If the following isn't already implemented, I'd pay USD$100 (via
PayPal) to have that done to whoever implements it in an official org-mode
release, plus another USD$100 donation to the org-mode maintainer.

QUESTION:  When org-mode headings are NUMBERED, and the file is exported to
HTML, is there any way to have org-mode include the TITLE, not just the
section number, of a cross-referenced section, along the lines of the LaTex
\nameref{} function?  Here's an example:

==BEGIN EXAMPLE==

#+OPTIONS: H:7 TOC:nil @:t num:1 email:t author:t

* Introduction to Technology Contracts
  :PROPERTIES:
  :CUSTOM_ID: IntroTechContracts
  :END:

Lorem ipsum etc. etc.

* Dangerous Clauses
  :PROPERTIES:
  :CUSTOM_ID: DangerousClauses
  :END:

Lorem ipsum etc. etc. -- see Section [[#IntroTechContracts]].

==END EXAMPLE==

With numbering turned ON (#+OPTIONS: num:1), the link is exported to HTML
as:  Section a href=#IntroTechContracts1/a.

With numbering turned OFF (#+OPTIONS: num:nil), the link is exported to
HTML as:  Section a href=#IntroTechContractsIntroduction to Technology
Contracts/a.

Using a macro, I'd like to be able to AUTOMATICALLY do the latter --- that
is, have the link text be the heading title --- even with numbering turned
ON, so that a macro such as {{{SECREF(IntroTechContracts)}}} would render
in HTML as, let's say:   Section a href=#IntroTechContracts1/a,
entitled a href=#IntroTechContractsIntroduction to Technology
Contracts/a.

Is that currently doable?

*D. C. Toedt III * *(my** last name is pronounced Tate) *
Attorney and neutral arbitrator -- tech contracts and intellectual property

d...@toedt.com LinkedIn: dctoedt http://www.linkedin.com/in/dctoedt
Calendarhttps://www.google.com/calendar/embed?src=dc.to...@toedt.commode=WEEK
 (redacted)
O: +1 (713) 364-6545C: +1 (713) 516-8968

Houston, Texas (Central time zone)
*Common Draft* http://www.commondraft.org annotated collection of
contract clauses

Unless expressly stated otherwise, this message is not intended
to serve as an electronic signature nor as assent to an agreement.


Re: [O] Include heading title in HTML section-number cross-reference, like LaTex \nameref?

2014-02-08 Thread D. C. Toedt
That works -- please email me privately with where to send the $100 via
PayPal.  Thanks!

(Org-mode maintainer [Bastien, still?], can you please let me know if /
when this gets implemented in an official release.)

Regards,

D. C.


*D. C. Toedt III * *(my** last name is pronounced Tate) *
Attorney and neutral arbitrator -- tech contracts and intellectual property

d...@toedt.com LinkedIn: dctoedt http://www.linkedin.com/in/dctoedt
Calendarhttps://www.google.com/calendar/embed?src=dc.to...@toedt.commode=WEEK
 (redacted)
O: +1 (713) 364-6545C: +1 (713) 516-8968

Houston, Texas (Central time zone)
*Common Draft* http://www.commondraft.org annotated collection of
contract clauses

Unless expressly stated otherwise, this message is not intended
to serve as an electronic signature nor as assent to an agreement.




On Sat, Feb 8, 2014 at 3:50 PM, Nicolas Goaziou n.goaz...@gmail.com wrote:

 Hello,

 D. C. Toedt d...@toedt.com writes:

  QUESTION:  When org-mode headings are NUMBERED, and the file is exported
 to
  HTML, is there any way to have org-mode include the TITLE, not just the
  section number, of a cross-referenced section, along the lines of the
 LaTex
  \nameref{} function?  Here's an example:
 
  ==BEGIN EXAMPLE==
 
  #+OPTIONS: H:7 TOC:nil @:t num:1 email:t author:t
 
  * Introduction to Technology Contracts
:PROPERTIES:
:CUSTOM_ID: IntroTechContracts
:END:
 
  Lorem ipsum etc. etc.
 
  * Dangerous Clauses
:PROPERTIES:
:CUSTOM_ID: DangerousClauses
:END:
 
  Lorem ipsum etc. etc. -- see Section [[#IntroTechContracts]].
 
  ==END EXAMPLE==

 [...]

  Is that currently doable?

 I think so. Not trivial, but doable nonetheless.

 --8---cut here---start-8---
 #+MACRO: get-title (eval (save-excursion (org-open-link-from-string
 [[#$1]]) (org-get-heading nil nil)))
 #+MACRO: SECREF [[#$1][{{{get-title($1)}}}]]
 #+OPTIONS: H:7 toc:nil num:1 email:t author:t

 * Introduction to Technology Contracts
   :PROPERTIES:
   :CUSTOM_ID: IntroTechContracts
   :END:

 Lorem ipsum etc. etc.

 * Dangerous Clauses
   :PROPERTIES:
   :CUSTOM_ID: DangerousClauses
   :END:

 Lorem ipsum etc. etc. -- see Section {{{SECREF(IntroTechContracts)}}}
 --8---cut here---end---8---


 Regards,

 --
 Nicolas Goaziou



Re: [O] Include heading title in HTML section-number cross-reference, like LaTex \nameref?

2014-02-08 Thread D. C. Toedt
I found a problem when trying this on a bigger file (my book file):  If $1
(actually, #$1) is for a link target that doesn't exist, then org-mode goes
into its No match - create this as a new heading? (y or n) routine. That
causes the rest of the export to fail.  It'd be better if get-title could
do the same thing org-mode does natively, that is, including the text of $1
as italics to indicate a non-existent link.

Example file below:

--8---cut here---start-8---

#+MACRO: get-title (eval (save-excursion (org-open-link-from-string
[[#$1]]) (org-get-heading nil nil)))
#+MACRO: SECREF [[#$1][{{{get-title($1)}}}]]
#+OPTIONS: H:7 toc:nil num:1 email:t author:t

* Introduction to Technology Contracts
  :PROPERTIES:
  :CUSTOM_ID: IntroTechContracts
  :END:

Lorem ipsum etc. etc.

* Dangerous Clauses
  :PROPERTIES:
  :CUSTOM_ID: DangerousClauses
  :END:

Lorem ipsum etc. etc. -- see Section {{{SECREF(
BogusLinkTarget
)}}}

--8---cut here---end---8---






[O] HTML export -- footnote section -- blank lines between footnote number and footnote text

2013-09-25 Thread D. C. Toedt
The footnote section in my HTML-export doc has the footnote number
separated from the footnote text by a blank line.  See
http://www.commondraft.org for the document.

Here's an example of what it looks like:


==BEGIN EXAMPLE==

[TEXT:]

The term Agreement-Related[9] refers to something – for example, a
dispute – that arises out of or relates to any of the following:
[remainder of section omitted]


[FOOTNOTES:]

[9]

Agreement-Related definition: This defined term is available for use
in, for example, attorneys' fees clauses, limitations of liability,
and the like.


==END EXAMPLE==


DETAILS:

Org version 8.2-4 (version 20130923) on Mac OS X Mountain Lion.

I upgraded to 8.2-4 by uninstalling and reinstalling Emacs after
encountering the ELPA bug (see
http://lists.gnu.org/archive/html/emacs-orgmode/2013-05/msg00176.html).

Relevant portion of my .emacs file:

 '(org-footnote-section nil)
 '(org-html-footnote-format [%s])

In the .org file itself:

#+STARTUP: nofnadjust indent showstars

QUESTION:

Is this a bug in the code, or a PICNIC problem
(http://en.wikipedia.org/wiki/User_error)?


--

D
. C. Toedt III  (my last name is pronounced Tate)
Attorney and arbitrator -- contracts and intellectual property

d...@toedt.com LinkedIn: dctoedtCalendar (redacted)
O: +1 (713) 364-6545C: +1 (713) 516-8968

Houston, Texas (Central time zone)
B
log: On Contracts.com
Book project: Common Draft encyclopedic dictionary of contract clauses

Unless expressly stated otherwise, this message is not intended
to serve as an electronic signature nor as assent to an agreement.



Re: [O] HTML export -- footnote section -- blank lines between footnote number and footnote text

2013-09-25 Thread D. C. Toedt
I thought the footnotes would come out as follows, which I believe is
the way it did before I upgraded from org version 7.9.3 (I think it
was):

==BEGIN EXAMPLE==

[FOOTNOTES:]

[9]  Agreement-Related definition: This defined term is available for use
in, for example, attorneys' fees clauses, limitations of liability,
and the like.

==END EXAMPLE==

Here's the HTML generated by the exporter -- note that the footnote
number comes just before the p containing the text:

==BEGIN HTML==

div class=footdef[a id=fn.9 name=fn.9 class=footnum
href=#fnr.99/a] p class=footpara
bAgreement-Related definition:/b  This defined term is available
for use in, for example, attorneys' fees clauses, limitations of
liability, and the like.
/p/div

==END HTML==


--

D
. C. Toedt III  (my last name is pronounced Tate)
Attorney and arbitrator -- contracts and intellectual property

d...@toedt.com LinkedIn: dctoedtCalendar (redacted)
O: +1 (713) 364-6545C: +1 (713) 516-8968

Houston, Texas (Central time zone)
B
log: On Contracts.com
Book project: Common Draft encyclopedic dictionary of contract clauses

Unless expressly stated otherwise, this message is not intended
to serve as an electronic signature nor as assent to an agreement.




On Wed, Sep 25, 2013 at 7:35 AM, Bastien b...@gnu.org wrote:
 Hi,

 D. C. Toedt d...@toedt.com writes:

 The footnote section in my HTML-export doc has the footnote number
 separated from the footnote text by a blank line.  See
 http://www.commondraft.org for the document.

 What did you expect instead of this rendering?

 Did you try to adapt the CSS to get what you need?

 Thanks,

 --
  Bastien



Re: [O] conflict load of epresent - org mode 8.0.3

2013-05-30 Thread d . tchin
Hi, 

 I just updated the require statements in epresent.el.
 
   https://github.com/eschulte/epresent/blob/master/epresent.el


 
 I'm not sure what epresent-org.el is.


For your information, Sacha Chua on her blog has given a short description 
of EPresent accessible on the following link

http://sachachua.com/blog/2013/04/how-to-present-using-org-mode-in-emacs/

Above it is mentioned about a tool called org-present developed by Ric 
Lister. I certainly made a confusion in my mail with this tool when I 
mentioned epresent-org.el. Sorry for this.

Anyway your changes work well. 

Thanks







[O] overview of org files

2013-05-29 Thread D M German

Hi everybody,

here is a small contribution to the org project.

It is a dashboard of org files in your main org directory. It shows,
in a table, each of the org files, including its title (#+TITLE: field)
and the filename.


   Date  Title   Filename   
  --
   13/05/29  Cooking /home/dmg/org/cooking.org  
   13/05/29  Project X   /home/dmg/org/x.org
   13/05/29  The different licenses  /home/dmg/org/licenses.org 
   13/05/29  Todo File   /home/dmg/org/todo.org 
   13/05/28  Linux   /home/dmg/org/linux.org
   13/05/28  Notes   /home/dmg/org/notes.org


From there, if you press return, you will visit that particular file.

the code is here:

https://github.com/dmgerman/org-manage


Hopefully somebody finds it useful.

--dmg



--
Daniel M. German  Beauty is the first test; there is no
   permanent place in the world for ugly
   G. H. Hardy -  mathematics.
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 



Re: [O] conflict load of epresent - org mode 8.0.3

2013-05-23 Thread d . tchin
Hi,


If the intention is to use epresent with org file, is it necessary to put
the following instructions in epresent.el and epresent-org.el?

(require 'ox)
(require 'ox-latex)

I suppose that when a org file is loaded, this library and corresponding are
already loaded, so these intructions may be not needed ?


Thanks

 d.tchin writes:







Re: [O] performance of exporting large tables

2013-05-21 Thread D M German
 Nicolas Goaziou twisted the bytes to say:


 Nicolas Nicolas Goaziou n.goaz...@gmail.com writes:
  I am going to have a look at this.

 Nicolas I pushed a commit caching the results of some table functions. Export 
of
 Nicolas large tables should be a lot faster (I get 6 s now; it was 90 s 
before).

Hi Nicolas,

thank you very much. This has resolved my issue. I can now export an org file
with these tables in few seconds.

thank you,

--daniel


 Nicolas Regards,

 Nicolas -- 
 Nicolas Nicolas Goaziou


--
Daniel M. German  To read is to travel without all the hassles 
of luggage.
   Emilio Salgari
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 



[O] conflict load of epresent - org mode 8.0.3

2013-05-17 Thread d . tchin
Hi,

This post to report a problem about epresent and new version of org mode.
I have just tried to update from releas 7.9.2 to 8.0.3 and I encountered 
several problems that are partially solved by the description of the 
changes due to the actual export and new name conventions.

From time to time, I use epresent tool that I find useful for tiny 
presentation. Tool is described here :

http://orgmode.org/worg/org-tutorials/non-beamer-presentations.html#sec-2

There are conflicts when this tool is loaded with new version of org mode.

In source files there are the following instructions :

(require 'org-exp)
(require 'org-latex)

As far I understand these modules are not available with this specific 
names. I have commented these two instruction in epresent-org.el and in 
epresent.el. 

I load ox.el and ox-latex.el in my .emacs and before loading the epresent 
tool and it seems to solve the conflicts and to work. 

Regard




Re: [O] performance of exporting large tables

2013-05-17 Thread D M German

Hi Suvayu,

 Suvayu Hi Daniel,
 Suvayu On Thu, May 16, 2013 at 01:24:10PM -0700, D M German wrote:
  
  If interested, I can make the table available.

 Suvayu A working example that reproduces the issue always helps.  If you could
 Suvayu post the table (of course after removing sensitive/private information)
 Suvayu it would be great help for the developers and testers.

Here is a trivial example:

http://turingmachine.org/~dmg/temp/bigTable.org

(you can do anything with this file, including adding it to any battery
of tests in the future).

- Latex works well (export within a couple of seconds)
- ASCII, HTML, Markdown (based on html so no surpise) take more than a
  minute 

Does anybody know where the processing might be taking time? 

thanks again,

--daniel


 Suvayu Thanks,

 Suvayu -- 
 Suvayu Suvayu

 Suvayu Open source is the future. It sets us free.



--
Daniel M. German  Operating systems are like underwear,
   Bill Joy - nobody really wants to look at them.
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 



[O] performance of exporting large tables

2013-05-16 Thread D M German

hi everybody,

I have a table with 15 columns and 500 rows. One of the columns is a
URL.

org-mode is hanging while exporting the table. It does not seem to
crash, but it is taking a significant amount of time. The worst part is
that it does not appear to be linear.

80 rows - 17 seconds
160 rows (same 80 rows duplicated) - 58 seconds

160 rows, 8 columns - 21 seconds (it seems to not matter which columns
there are).

I wonder if this is expected behaviour. Given that org does not sort the
tables, why does the time increase non-linearly to the size of the
table?

If interested, I can make the table available.

thanks a lot!

--daniel


--
Daniel M. German  And ye shall know the truth,
   John 8:32 -and the truth shall make you free.
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 



[O] LaTex / PDF export doesn't hyphenate

2013-05-03 Thread D. C. Toedt
ENVIRONMENT:  Using Mac OS X Mountain Lion, Emacs 24.3, Org-mode 7.9.1.

PROBLEM:  When I export to LaTex, there's no hyphenation.

The problem exists even when I manually insert hyphenation points with \-
as shown below.

This problem exists when I process a book manuscript, and also when I
process a tiny file such as the following:

=begin quote=

#+LATEX_CLASS: book

** Affiliate

a) One individual or organization (Person) is an Affiliate of another
Per\-son if, either directly or indirectly via one or more intermediaries,
the first Person controls, or is controlled by, or is under common
con\-trol with, the other Person.

b) For this purpose, a\nbsp{}Person controls an organization if the Person
has voting control\nbsp{}--- via legal, beneficial or equitable ownership;
a\nbsp{}voting agreement; or otherwise\nbsp{}--- of securities of (or other
interest in) the organization having more than the Minimum Voting
Percentage (51% if the Agreement does not specify otherwise) of the
aggregate right to vote for the organization's board of directors or
comparable governing body.

c) A\nbsp{}Person also controls an organization if the Person has a
legally-enforceable right to select, or to prevent the selection, of
a\nbsp{}majority of the members of that board or other body.

=end quote=


INVESTIGATION:  I looked at the buffer *Org PDF LaTex Output*; the only
occurrences of any hyphen-related string are:

=begin quote=

Babel v3.8m and hyphenation patterns for english, dumylang,
nohyphenation, ge
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus,
arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech,
danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi,
finnis
h, french, friulan, galician, german, ngerman, swissgerman, monogreek,
greek, h
ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada,
malayalam, ma
rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish,
italian,
kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal,
nynorsk,
 polish, portuguese, romanian, romansh, russian, sanskrit, serbian,
serbianc, s
lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian,
uppersorbian,
welsh, loaded.

=end quote=

EXPERIMENTS:  In the course of a lot of Google-searching, I've tried,
without success, the following:

#+LATEX_HEADER: \usepackage[english]{babel}


and

#+LATEX_HEADER: \usepackage[english=hyphenation]{babel}


All suggestions gratefully received.

*--*
*
*
*D. C. Toedt III * |  IP and contracts lawyer for tech companies   |
 Houston (Central time)
My last name is pronounced Tate   |   E: d...@toedt.com  |  O: +1 (713)
364-6545  |  C: +1 (713) 516-8968
*Blog:* On Contracts http://www.OnContracts.com  |  *LinkedIn:*
dctoedthttp://www.linkedin.com/in/dctoedt
|   
Calendarhttps://www.google.com/calendar/embed?src=dc.to...@toedt.commode=WEEK
 (redacted)


Re: [O] Small tutorial on how to use Perl within org

2013-03-11 Thread D M German

Hi Tom,

 Thomas S Dye twisted the bytes to say:

[...]
  
  http://turingmachine.org/~dmg/emacs/examplePerl.org

 Tom Nice.

 Tom It would be great to use this document as the basis of ob-doc-perl.
 Tom Perl is one of about 20 languages that need to be documented at
 Tom http://orgmode.org/worg/org-contrib/babel/languages.html.  

 Tom Note that there is a template that helps create a standard language
 Tom document: 

 Tom 
http://orgmode.org/w/?p=worg.git;a=blob;f=org-contrib/babel/languages/ob-doc-template.org;hb=HEAD

 Tom I don't know the first thing about Perl, but I'll be happy to help if
 Tom there are questions about getting to ob-doc-perl from the template.

It sounds good. I'll do it. I'll probably have it ready the end of the
week or beginning of next. 

I'll also take care of SQL, which I have been using under Org too.

--dmg

 Tom All the best,
 Tom Tom

 Tom -- 
 Tom Thomas S. Dye
 Tom http://www.tsdye.com


--
Daniel M. German  Science can be esoteric
The Economist -   technology has to be pragmatic
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 



[O] Small tutorial on how to use Perl within org

2013-03-09 Thread D M German

hi everybody,

I have created a  small document that describes how to use perl within
org. Hopefully others will find it useful:

http://turingmachine.org/~dmg/emacs/examplePerl.org

--dmg

 

--
Daniel M. German
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 



Re: [O] [PATCH] bug in expansion of variables in babel Perl

2013-02-25 Thread D M German
 Achim Gratz twisted the bytes to say:

Hi Achim,

thanks for taking the time to do this.

I applied the patch, one of the hunks didn't apply due to Eric's
changes, but that is not an issue, since they do the same:

--
diff a/lisp/ob-perl.el b/lisp/ob-perl.el(rejected hunks)
@@ -75,7 +75,7 @@ (defun org-babel-perl-var-to-perl (var)
 specifying a var of the same value.
   (if (listp var)
   (concat [ (mapconcat #'org-babel-perl-var-to-perl var , ) ])
-(format %S var)))
+(format q(%s) var)))
 
 (defvar org-babel-perl-buffers '(:default . nil))
--

Everything works as intended, except for the return value of the perl
code. Values in the list are concatenated, as one:

#+begin_src perl :results table
(1, 2, 3)
#+end_src

#+RESULTS:
| 123 |

#+begin_src perl :results table
(1, 2, 3)
#+end_src

#+RESULTS:
| 123 |


I think the issue is that, at least in my computer the variable $\
returns empty (the record separator).

#+begin_src perl :results output
print value of \$\\ [$\]\n;
#+end_src

#+RESULTS:
#+begin_example
value of $\ [] 
#+end_example

--daniel

--
Daniel M. German  Work. Finish. Publish. 
   Michael Faraday
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 



Re: [O] bug in expansion of variables in babel Perl

2013-02-25 Thread D M German



 Achim Eric Schulte writes:
  Are you familiar with `org-babel-expand-src-block' bound to C-c C-v v?

 Achim I wasn't, obviously, and neither was the OP.

  If I understand the desire correctly, it should be what you're after.
  Perhaps an option to raise the expanded source code buffer along with
  the error buffer when an error is raised would be a useful addition.

 Achim Yes, so there's no three ways for Perl to get the same result for
 Achim comparison.  :-P


Just keep in mind, org-babel-expand-src-block is not exactly what emacs
passes to perl. It does not contain the wrapping code.


--dmg


--
Daniel M. German
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 



  1   2   >