Re: [BUG] org-babel-tangle may fail due to (org-babel-tangle-collect-blocks lang-re tangle-file) [9.6.9 ( @ /home/andrea/.emacs.d/elpa/org-9.6.9/)]

2023-11-24 Thread Andrea
Sorry Ihor for the long delay.
I got the error again for the second source block in the attached file.
That is a sample of my configuration.

Hope this helps,

Andrea



example.org
Description: Lotus Organizer


On Fri 13 Oct 2023 at 11:56, Ihor Radchenko  wrote:

> Andrea  writes:
>
>> Thanks Ihor! I found out that there was (likely) an encoding issue on
>> one of the source block. I had something like:
>> :PROPERTIES:
>> :ID: some-id
>> :END:
>>
>> #+being_src emacs-lisp
>>
>> And trying to evaluate (org-babel-get-src-block-info 'no-eval) at the
>> beginning of the source block was returning nil (as if I were outside of it).
>
> This should not happen. It would be nice if you can share a file with
> problematic encoding, so that I could check if we have an edge case
> with Org parser.


Re: [BUG] org-babel-tangle may fail due to (org-babel-tangle-collect-blocks lang-re tangle-file) [9.6.9 ( @ /home/andrea/.emacs.d/elpa/org-9.6.9/)]

2023-10-12 Thread Andrea


On Thu 12 Oct 2023 at 15:29, Ihor Radchenko  wrote:

>
> I recommend trying to shrink the problematic file to the smallest possible.
> Then, try with emacs -Q. If cannot reproduce, you can use
> https://github.com/Malabarba/elisp-bug-hunter to bisect the config
> quickly.


Thanks Ihor! I found out that there was (likely) an encoding issue on
one of the source block. I had something like:
:PROPERTIES:
:ID: some-id
:END:

#+being_src emacs-lisp

And trying to evaluate (org-babel-get-src-block-info 'no-eval) at the
beginning of the source block was returning nil (as if I were outside of it).

Just adding a newline manually removed the issue, so I guessed there was
some special character there (which is weird, but I cannot be sure of my
copy pasting).

Sorry for the noise and thanks for your suggestions, they were useful in
debugging my issue.

Best,

Andrea



Re: [BUG] org-babel-tangle may fail due to (org-babel-tangle-collect-blocks lang-re tangle-file) [9.6.9 ( @ /home/andrea/.emacs.d/elpa/org-9.6.9/)]

2023-10-12 Thread Andrea


On Thu 12 Oct 2023 at 14:40, Ihor Radchenko  wrote:

> Andrea  writes:
>
>> This is the full trace I get running "emacs --debug-init" (sorry I should 
>> have added it in my bug report):
>>
>>Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>>  string-match("\\`\\(?:e\\(?:\\(?:macs-\\)?lisp\\)\\)\\'" nil nil)
>>  string-match-p("\\`\\(?:e\\(?:\\(?:macs-\\)?lisp\\)\\)\\'" nil)
>>  (not (string-match-p lang-re src-lang))
>
> That looks like a malformed src block with missing lang.
> I recommend running M-x org-lint
>

Mmm... I run org-lint (and fix unrelated issues, thanks!) and the problem 
remains.
It is strange though, this is the block on which the function
stops working (it is the first actually)

   #+begin_src emacs-lisp :tangle yes
   (defun my/init-audit-message (string)
 "Print out STRING and calculate length of init."
 (message string)
 (if (not (string= "end" (substring string -3)))
 (setq my/init-audit-message-begin (current-time))
   (message
"It took %s seconds in total."
(time-to-seconds
 (time-subtract
  (current-time)
  my/init-audit-message-begin
 nil)
   #+end_src

Must be something wrong with my configuration then.
I will update this issue if I find that out.



Re: [BUG] org-babel-tangle may fail due to (org-babel-tangle-collect-blocks lang-re tangle-file) [9.6.9 ( @ /home/andrea/.emacs.d/elpa/org-9.6.9/)]

2023-10-12 Thread Andrea


Thanks Ihor for the super quick response!

On Thu 12 Oct 2023 at 13:04, Ihor Radchenko  wrote:

> Andrea  writes:
>
>> 
>> Sometimes I get an error on org-babel-load-file saying that
>> org-babel-tangle-collect-blocks was called with target-file set to nil.
>
> May it be possible to provide more details about the error you are
> seeing? You can set `debug-on-error' to t and post the backtrace, which
> will give more details. Or, better, provide a reproducer. See
> https://orgmode.org/manual/Feedback.html#Feedback
>

This is the full trace I get running "emacs --debug-init" (sorry I should have 
added it in my bug report):

   Debugger entered--Lisp error: (wrong-type-argument stringp nil)
 string-match("\\`\\(?:e\\(?:\\(?:macs-\\)?lisp\\)\\)\\'" nil nil)
 string-match-p("\\`\\(?:e\\(?:\\(?:macs-\\)?lisp\\)\\)\\'" nil)
 (not (string-match-p lang-re src-lang))
 (and lang-re (not (string-match-p lang-re src-lang)))
 (or (string= src-tfile "no") (and tangle-file (not (equal tangle-file 
src-tfile))) (and lang-re (not (string-match-p lang-re src-lang
 (if (or (string= src-tfile "no") (and tangle-file (not (equal tangle-file 
src-tfile))) (and lang-re (not (string-match-p lang-re src-lang nil (let* 
((block (org-babel-tangle-single-block counter)) (src-tfile (cdr (assq :tangle 
(nth 4 block (file-name (org-babel-effective-tangled-filename (nth 1 block) 
src-lang src-tfile)) (by-fn (assoc file-name blocks))) (if by-fn (setcdr by-fn 
(cons (cons src-lang block) (cdr by-fn))) (setq blocks (cons (cons file-name 
(list (cons src-lang block))) blocks)
 (let* ((info (org-babel-get-src-block-info 'no-eval)) (src-lang (nth 0 
info)) (src-tfile (cdr (assq :tangle (nth 2 info) (if (or (string= 
src-tfile "no") (and tangle-file (not (equal tangle-file src-tfile))) (and 
lang-re (not (string-match-p lang-re src-lang nil (let* ((block 
(org-babel-tangle-single-block counter)) (src-tfile (cdr (assq :tangle (nth 4 
block (file-name (org-babel-effective-tangled-filename (nth 1 block) 
src-lang src-tfile)) (by-fn (assoc file-name blocks))) (if by-fn (setcdr by-fn 
(cons (cons src-lang block) (cdr by-fn))) (setq blocks (cons (cons file-name 
(list ...)) blocks))
 (if (or (org-in-commented-heading-p) (org-in-archived-heading-p)) nil 
(let* ((info (org-babel-get-src-block-info 'no-eval)) (src-lang (nth 0 info)) 
(src-tfile (cdr (assq :tangle (nth 2 info) (if (or (string= src-tfile "no") 
(and tangle-file (not (equal tangle-file src-tfile))) (and lang-re (not 
(string-match-p lang-re src-lang nil (let* ((block 
(org-babel-tangle-single-block counter)) (src-tfile (cdr (assq :tangle ...))) 
(file-name (org-babel-effective-tangled-filename (nth 1 block) src-lang 
src-tfile)) (by-fn (assoc file-name blocks))) (if by-fn (setcdr by-fn (cons 
(cons src-lang block) (cdr by-fn))) (setq blocks (cons (cons file-name ...) 
blocks)))
 (let ((full-block (match-string 0)) (beg-block (match-beginning 0)) 
(end-block (match-end 0)) (lang (match-string 2)) (beg-lang (match-beginning 
2)) (end-lang (match-end 2)) (switches (match-string 3)) (beg-switches 
(match-beginning 3)) (end-switches (match-end 3)) (header-args (match-string 
4)) (beg-header-args (match-beginning 4)) (end-header-args (match-end 4)) (body 
(match-string 5)) (beg-body (match-beginning 5)) (end-body (match-end 5))) 
(ignore full-block beg-block end-block lang beg-lang end-lang switches 
beg-switches end-switches header-args beg-header-args end-header-args body 
beg-body end-body) (let ((current-heading-pos (if (org-element--cache-active-p) 
(or (org-element-property :begin (org-element-lineage ... ... t)) 1) 
(save-excursion (save-restriction (widen) (progn ... ... ... ... ...)) (if 
(eq last-heading-pos current-heading-pos) (setq counter (1+ counter)) (setq 
counter 1) (setq last-heading-pos current-heading-pos))) (if (or 
(org-in-commented-heading-p) (org-in-archived-heading-p)) nil (let* ((info 
(org-babel-get-src-block-info 'no-eval)) (src-lang (nth 0 info)) (src-tfile 
(cdr (assq :tangle (nth 2 info) (if (or (string= src-tfile "no") (and 
tangle-file (not (equal tangle-file src-tfile))) (and lang-re (not 
(string-match-p lang-re src-lang nil (let* ((block 
(org-babel-tangle-single-block counter)) (src-tfile (cdr ...)) (file-name 
(org-babel-effective-tangled-filename ... src-lang src-tfile)) (by-fn (assoc 
file-name blocks))) (if by-fn (setcdr by-fn (cons ... ...)) (setq blocks (cons 
... blocks))) (goto-char end-block))
 (progn (goto-char (match-beginning 0)) (let ((full-block (match-string 0)) 
(beg-block (match-beginning 0)) (end-block (match-end 0)) (lang (match-string 
2)) (beg-lang (match-beginning 2)) (end-lang (match-end 2)) (switches 
(match-string 3)) (beg-switches (match-beginning 3)) (end-switches (match-end 
3)) (header-args (match-s

[BUG] org-babel-tangle may fail due to (org-babel-tangle-collect-blocks lang-re tangle-file) [9.6.9 ( @ /home/andrea/.emacs.d/elpa/org-9.6.9/)]

2023-10-12 Thread Andrea


Hello, thanks for maintaining the great Org Mode!

I have been keeping a literate Org Mode configuration for my init file.
This means that I have tons of src blocks looking like

#+begin_src emacs-lisp :tangle yes
...
#+end_src

Sometimes I get an error on org-babel-load-file saying that
org-babel-tangle-collect-blocks was called with target-file set to nil.

Not totally sure if this is had something to do with my configuration, I
always solved this by adding some spaces before my blocks (it doesn't
make sense, but strangely tended to work).

Since that seems an effective but senseless action, I just looked into it and 
there is
something weird in the code of org-babel-tangle:

Given the header of the function:

  (defun org-babel-tangle ( arg target-file lang-re)

and the docstring section

  "Optional argument TARGET-FILE can be used to specify a default export
  file for all source blocks.  "

I think this let binding in org-babel-tangle is weird and the cause of my error:

  (tangle-file
 (when (equal arg '(16))
   (or (cdr (assq :tangle (nth 2 (org-babel-get-src-block-info 
'no-eval
   (user-error "Point is not in a source code block"

Shouldn't that be:

  (tangle-file
 (or
   (when (equal arg '(16))
 (or (cdr (assq :tangle (nth 2 (org-babel-get-src-block-info 
'no-eval
 (user-error "Point is not in a source code
 block")))
 target-file ;; the target file which was passed as input of 
org-babel-tangle
 ))

With that my problem seems resolved. I think that code is weird because
using a when clause causes a possible nil value for that binding. But we
may still use the target-file input to save the day, no?

Any chance I found a bug?

Best,

Andrea

Emacs  : GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, 
cairo version 1.16.0)
 of 2022-05-31
Package: Org mode version 9.6.9 ( @ /home/andrea/.emacs.d/elpa/org-9.6.9/)



Re: [BUG] Error in data input and output format for org-columns--summary-estimate

2023-08-18 Thread andrea

   IR > May you share your changes?
   Sure!
   Here they are: In these slices I take the upper part of the fork (where in 
case, assuming a small-big usage convention ;)) as that is the value that 
surely testify the effort estimation overrun. Being so, at the time of this 
writing I just realized the use of pcase is likely replaceable by a simpler 
(car (last (mapcar...))) call :).
   Cheers,
     Andrea

   Job: diff -bwi org-clock.el{.old,}

   720c720,723

   < (let* ((effort-in-minutes (org-duration-to-minutes org-clock-effort))

   ---

   > (let* ((effort-in-minutes

   > (pcase (mapcar #'org-duration-to-minutes (split-string 
org-clock-effort "-"))

   >   (`(,_ ,value) value)

   >   (`(,value) value)))

   828c831,833

   < (let ((effort-in-minutes (org-duration-to-minutes org-clock-effort))

   ---

   > (let ((effort-in-minutes (pcase (mapcar #'org-duration-to-minutes 
(split-string org-clock-effort "-"))

   >(`(,_ ,value) value)

   >    (`(,value) value)))

   Da emacs-orgmode-bounces+andrea=fedeli...@gnu.org
   A and...@fedeli.eu
   Cc emacs-orgmode@gnu.org
   Data Wed, 16 Aug 2023 10:15:13 +
   Oggetto Re: [BUG] Error in data input and output format for 
org-columns--summary-estimate
   and...@fedeli.eu writes:

   > Howdy!
   > I'm back to a previous element partially discussed as I found other org 
places where the duration had to be adapted to be able to deal with ranges: 
org-clock-get-clock-string and
   > org-clock-notify-once-if-expired, both in og-clock.el; both get into 
action if you have a task you estimated and for which you're now tracking 
development time (quite handy, I have to say, as you're immediately warned 
you've running beyond estimations. For those two functions, I have introduced a 
similar change to the one I did originally to go from the basic string-to 
number on split-string to org-duration to minutes. Thanks, Sant Ignucius, for 
the debug-on-entry feature :))

   May you share your changes? I am not sure if I fully understand what and
   why you did without seeing the diff.

   > Two considerations here:
   > 1. I understand the fact that est+ doesn't have to necessarily be 
associated with effort, but it is quite clear from the docs which is the intent 
with which it was introduced: the only provided example is on times, and there 
we have to consider that time is expressed in durations.
   > What I mean is that it does NOT make much sense to me to tell users the 
effort is to be written as 3d if given as a single value, and it has to be 
rewritten as 3-5 if we want to say "in a fork of 3 to 5 days", especially if 
somewhere else some other duration unit is used..

   It should not. The reason `org-columns--summary-estimate' uses
   split-string is because it may have to work with recursively calculated
   estimates from subtrees. EFFORT property itself does not officially
   support ranges.

   --
   Ihor Radchenko // yantar92,
   Org mode contributor,
   Learn more about Org mode at <https://orgmode.org/>.
   Support Org development at <https://liberapay.com/org-mode>,
   or support my work at <https://liberapay.com/yantar92>


Re: [BUG] Error in data input and output format for org-columns--summary-estimate

2023-08-15 Thread andrea

   Howdy!
   I'm back to a previous element partially discussed as I found other org 
places where the duration had to be adapted to be able to deal with ranges: 
org-clock-get-clock-string and
   org-clock-notify-once-if-expired, both in og-clock.el; both get into action 
if you have a task you estimated and for which you're now tracking development 
time (quite handy, I have to say, as you're immediately warned you've running 
beyond estimations. For those two functions, I have introduced a similar change 
to the one I did originally to go from the basic string-to number on 
split-string to org-duration to minutes. Thanks, Sant Ignucius, for the 
debug-on-entry feature :))
   Two considerations here:
   1. I understand the fact that est+ doesn't have to necessarily be associated 
with effort, but it is quite clear from the docs which is the intent with which 
it was introduced: the only provided example is on times, and there we have to 
consider that time is expressed in durations.
   What I mean is that it does NOT make much sense to me to tell users the 
effort is to be written as 3d if given as a single value, and it has to be 
rewritten as 3-5 if we want to say "in a fork of 3 to 5 days", especially if 
somewhere else some other duration unit is used..
   2. Said differently, whether it was practically used also somewhere else, 
and not for time estimation, I can say nothing about; it is already quite hard 
to find it in doc, to date, and there  the only example given is about time.
   As without my changes the effort fork would not work properly in org-clock 
functions, if we really think estimation ranges shall be used also somewhere 
else I think we need to consider a possible generalization of what a duration 
is. In facts if we want to utilize it for other kind of measuring units 
(weight, money, etc.), it might make sense to pair it with a proper translation 
table like the one of duration that allows to convert days, hours, weeks, etc. 
into minutes, back and forth; this way we might allow both a proper type check 
according to the utilized measure unit, and would be able to avoid having to 
misleadlingly allow to sum tons to kg, for instance. (Recall: the ending letter 
today is just discarded hence 1kg-1ton is today taken as 1-1).
   Cheers,
 Andrea.

   Da "Ihor Radchenko" yanta...@posteo.net
   A and...@fedeli.eu
   Cc emacs-orgmode@gnu.org
   Data Tue, 18 Jul 2023 09:10:33 +
   Oggetto Re: [BUG] Error in data input and output format for 
org-columns--summary-estimate
   and...@fedeli.eu writes:

   >> About possibile abuses, org documentation, to date, clearly tells
   >> org estimate utilizes times.
   >
   >> May you please elaborate?

   > AF: Sure! Clause 8.5 of current
   > (2023.Jul.14) org documentation,
   > https://orgmode.org/manual/Effort-Estimates.html, refers to effort
   > estimates giving examples that are all appearing to fall in time
   > domain.

   I see what you mean.
   However, est+ column summary does not have to be applied to EFFORT
   columns.

   One can, for example, use %SCORE{est+} column specification to summarize
   values stored in SCORE property. Org has no right to demand SCORE to be
   in time units and only time units.

   > > Similarly, I'd not spend too much code to check the format; i
   > > understand the intent to preserve backward compatibility, bit if
   > > that format adaptation mistake slipped forward to these days I
   > > doubt that nice feature was used much so far...
   >
   > Yes, but it is easy to have a fallback, so why not.

   > Because this way you persist in allowing a mistaken usage of that
   > function. A number is a number but a duration is NOT just a number,
   > and having something like (just for example) 10kg-0.5ton be taken
   > as 10-0.5 is in my opinion NOT helpful to any user.

   We may provide a linter (for M-x org-lint) that will ensure EFFORT
   estimates to be in understandable format.

   --
   Ihor Radchenko // yantar92,
   Org mode contributor,
   Learn more about Org mode at <https://orgmode.org/>.
   Support Org development at <https://liberapay.com/org-mode>,
   or support my work at <https://liberapay.com/yantar92>


Re: [BUG] Error in data input and output format for org-columns--summary-estimate

2023-07-14 Thread andrea

   Howdy!

   Da "Ihor Radchenko" yanta...@posteo.net
   A and...@fedeli.eu
   Cc emacs-orgmode@gnu.org
   Data Fri, 14 Jul 2023 09:02:04 +
   Oggetto Re: [BUG] Error in data input and output format for 
org-columns--summary-estimate
   [ Adding Org ML back to CC. Please use "reply all" to reply on the
   mailing list ]

   "and...@fedeli.eu"  writes:

   > I do apologize, I noticed only now the patch content: the output
   > format of duration-from-minutes Is controlled by the
   > org-duration-format variable, so if the user wants results in
   > months (s)he can easily get It that way.

   `org-duration-format' is controlling many other aspects of formatting.
   Customizing, for example, agenda should probably not affect column views.
   AF: I think we need to univoquely clarify which unit is to be used in 
estimation. As shown below org documentation suggests time it to be used for 
that, from there it cames the idea to turn times into minutes for computation 
reason; maybe we may introduce a new format variable for estimation results 
reporting. I thought I might use org-duration-from-minutes for that, as it came 
very handy.
   > About possibile abuses, org documentation, to date, clearly tells
   > org estimate utilizes times.

   May you please elaborate?
   AF: Sure! Clause 8.5 of current (2023.Jul.14) org documentation, 
https://orgmode.org/manual/Effort-Estimates.html, refers to effort estimates 
giving examples that are all appearing to fall in time domain. In particular it 
refers to org-duration.el for format information. That, IMO, establish that 
efforts have to refer to org-duration units. Now, the *default* values of 
org-duration are *clearly* time measures. From there my assumption about the 
fact that I may use the org-duration-to-minutes and org-duration-from-minutes 
adapters.
   Clearly, you /may/ decide to completely redefine the org-duration basis, but 
that would mean to coherently propagate the information change everywhere 
somebody used org-duration-units which, even though LisP is a very flexible 
language, is NOT what I'd expect org-duration utilizer always foresaw to have 
to be flexible in terms of.
   > Similarly, I'd not spend too much code to check the format; i
   > understand the intent to preserve backward compatibility, bit if
   > that format adaptation mistake slipped forward to these days I
   > doubt that nice feature was used much so far...

   Yes, but it is easy to have a fallback, so why not.
   Because this way you persist in allowing a mistaken usage of that function. 
A number is a number but a duration is NOT just a number, and having something 
like (just for example) 10kg-0.5ton be taken as 10-0.5 is in my opinion NOT 
helpful to any user.
   The pcase matches either value pairs or single values, and 
org-duration-to-minutes can be charged to decide on what to do if values did 
not match the proper format (with the default assumption, I'd say, that simple 
integers are minutes).
   In facts org-duration-to-minutes already has a cond classical closing (t 
...) branch to deal with that case. I'd leave the rest as I suggested; maybe, 
if you --as maintainer hence exposed to the global amount of supports request 
and use cases-- see that as convenient, with a different output format adapter 
than the one I picked (org-duration-from-minutes without an extra format 
specification actual argument); already allowing a custom format adapter would 
introduce an extra flexibility knob BUT consider that org-duration-to-minutes 
does NOT do the same (it implicitly utilizes the org-duration-format content, 
and has hardcoded assumption on quantities being representing times, so there 
too you'd need to change something, if it was not just a matter of definining a 
different alternative to display result times).
   Cheers!
 Andrea.

   --
   Ihor Radchenko // yantar92,
   Org mode contributor,
   Learn more about Org mode at <https://orgmode.org/>.
   Support Org development at <https://liberapay.com/org-mode>,
   or support my work at <https://liberapay.com/yantar92>


Re: [BUG] Error in data input and output format for org-columns--summary-estimate

2023-07-09 Thread andrea

   #+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00

   #+COLUMNS: %30ITEM(Task) %30Effort(Estimated Effort){est+} %CLOCKSUM

   * efforts

   ** task 1

   :PROPERTIES:

   :Effort:   3d

   :END:

   ** task 2

   :PROPERTIES:

   :Effort:   3m-4m

   :END:

   Originally produces
   image.png
   That shows that days and months are wrongly counted the same
   With the suggested patch produces
   image.png
   Showing that day and months are correctly handled, and reported.
   Cheers,
 Andrea.

   Da emacs-orgmode-bounces+andrea=fedeli...@gnu.org
   A and...@fedeli.eu
   Cc emacs-orgmode@gnu.org
   Data Sun, 09 Jul 2023 14:17:59 +
   Oggetto Re: [BUG] Error in data input and output format for 
org-columns--summary-estimate
   and...@fedeli.eu writes:

   > The matter is related to the fact that org-columns--summary-estimate, from 
org-colview.el, uses function string-to-number to take value on ranges; acting 
this way
   >
   > the unit is removed making impossible to distinguish between 1y and 1min . 
Similarly, on output, the two margins are produced a (format "%.0f" ), 
which --again-- is generally wrong as it does not tell anything about the 
utilized time unit.

   May you please provide a concrete example demonstrating the problem?

   --
   Ihor Radchenko // yantar92,
   Org mode contributor,
   Learn more about Org mode at <https://orgmode.org/>.
   Support Org development at <https://liberapay.com/org-mode>,
   or support my work at <https://liberapay.com/yantar92>


[BUG] Error in data input and output format for org-columns--summary-estimate

2023-07-09 Thread andrea

   Howdy!

   This has been tested to happen with org 9.5.5, a few of the

   following, and on the HEAD version on git (9.6.7+); it's a source

   matter, afflicting org independently of the running platform (GNU/Linux,

   Windows, etc.)

   The matter is related to the fact that org-columns--summary-estimate, from 
org-colview.el, uses function string-to-number to take value on ranges; acting 
this way

   the unit is removed making impossible to distinguish between 1y and 1min . 
Similarly, on output, the two margins are produced a (format "%.0f" ), 
which --again-- is generally wrong as it does not tell anything about the 
utilized time unit.

   Both issues can be very simply addressed by adoption of 
org-duration-to-minutes as

   input adapted and org-duration-from-minutes as output adapter.
   A similar concern affects also the simpler case of a single value instead of 
a range (second pcase branch)

   Here is the patched code with the wrong code lines commented out.

   (defun org-columns--summary-estimate (estimates _)

 "Combine a list of estimates, using mean and variance.

   The mean and variance of the result will be the sum of the means

   and variances (respectively) of the individual estimates."

 (let ((mean 0)

   (var 0))

   (dolist (e estimates)

   ;;  (pcase (mapcar #'string-to-number (split-string e "-"))

 (pcase (mapcar #'org-duration-to-minutes (split-string e "-"))

   (`(,low ,high)

(let ((m (/ (+ low high) 2.0)))

  (cl-incf mean m)

  (cl-incf var (- (/ (+ (* low low) (* high high)) 2.0) (* m m)

   ;;(`(,value) (cl-incf mean value

   (`(,value) (cl-incf mean (org-duration-to-minutes value)

   (let ((sd (sqrt var)))

 (format "%s-%s"

   ;;  (format "%.0f" (- mean sd))

   ;;  (format "%.0f" (+ mean sd))

 (org-duration-from-minutes (- mean sd))

     (org-duration-from-minutes (+ mean sd))

   Cheers!
 Andrea Fedeli.


Re: [FR] Enhancing footnote managment (via indirect buffer)?

2023-07-03 Thread Andrea Lazzarini

> Il giorno 2 lug 2023, alle ore 12:56, Ihor Radchenko  ha 
> scritto:
> 
> Hello,
> 
> It has been over one month since the last message in this thread.
> Are you still interested to work on this feature? Do you need any help?


Hi,

I was busy with work and had less time to focus on this, sorry!
Well, sorry for the noob question but how do you suggest I fork the org.el file 
to start tinkering with it?
I would pass through the Org repository on Savannah, as specified here: 
https://orgmode.org/worg/org-contribute.html 
.
What do you suggest for testing the changes? Should I then send a diff?

I guess I can manage to have the code I already produced working in org.el. In 
what section of it should the eldoc package be required?

Thank you so much.

Fwd: [FR] Enhancing footnote managment (via indirect buffer)?

2023-05-26 Thread Andrea Lazzarini
Il giorno 24 mag 2023, alle ore 11:03, Ihor Radchenko  ha 
scritto:
> 
> Payas Relekar  writes:
> 
>> I've been playing with org-footnote-assistance, and this is again just
>> another opinion, but I'm also preferring the indirect buffer. It just
>> puts things in better perspective.
> 
> I'd prefer to integrate things with `org-edit-special', if possible.
> Possibly extending `org-edit-special' functionality.
> 
> The pros for `org-edit-special' are that we can escape certain edge
> cases. In particular, there is a known edge case when footnote
> definition contains an src block with 2+ blank lines. The blank lines
> are treated as the end of the footnote definition and src block is not
> recognized. Also, `org-edit-footnote-reference' takes care about
> removing common indentation.
> 

I've tried to use org-edit-special with a src block with 2+ blank lines and the 
second #+end_src is not seen as part of the footnote.
Is this the edge problem you were addressing? I get the same result with the 
indirect buffer.

I'll try to implement at least footnote previewing functionalities with eldoc!

> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 





Re: Change colour of hyperlinks in Beamer presentation

2023-05-23 Thread Andrea
I believe you could do something like that (borrowed from the LaTeX Wikibook
):
#+LATEX_HEADER: \hypersetup{
#+LATEX_HEADER: colorlinks=true,% false: boxed links; true:
colored links
#+LATEX_HEADER: linkcolor=red,  % color of internal links
(change box color with linkbordercolor)
#+LATEX_HEADER: citecolor=green,% color of links to bibliography
#+LATEX_HEADER: filecolor=cyan, % color of file links
#+LATEX_HEADER: urlcolor=magenta% color of external links
#+LATEX_HEADER: }

Il giorno lun 22 mag 2023 alle ore 14:43 Loris Bennett <
loris.benn...@fu-berlin.de> ha scritto:

> Hi,
>
> In my Beamer presentation the hyperlinks, all URLs, appear as normal
> text and can only be identified by the change in the cursor when the
> mouse moves over them.
>
> How can I change the colour of such links?
>
> I have already several lines such as
>
>   #+LATEX_HEADER: \setbeamercolor{title}{fg=mFubMainGreen}
>
> to tweak the appearance, but wasn't able to find an appropriate keyword
> for URLs.
>
> Cheers,
>
> Loris
>
> --
> This signature is currently under constuction.
>
>


Re: [FR] Enhancing footnote managment (via indirect buffer)?

2023-05-23 Thread Andrea Lazzarini



> Il giorno 22 mag 2023, alle ore 17:30, Ihor Radchenko  
> ha scritto:
> 
> Andrea Lazzarini  writes:
> 
>> Eldoc (or tooltips) could be great for previewing: I'm going to give them a 
>> try
>> and to see how they might be integrated in an academic writing workflow.
>> I wander if they would maintain buffer-specific highlighting though...
> 
> AFAIK, Eldoc expects a function that will return the string to be
> displayed. You can use `font-lock-ensure' to fontify the footnote
> definition you need to display. Then, the copied string will hold the
> fontification as it would be in Org mode buffer.
> 

Ok, very good. This is my first attempt at it and, apparently, it works.

(setq eldoc-echo-area-use-multiline-p nil)

(defun org-footnote-eldoc-function (callback  _ignored)
  "Return the definition of the footnote at point for Eldoc."
  (when (org-footnote-at-reference-p)
(let* ((footnote-label (car (org-footnote-at-reference-p)))
   (footnote-definition (org-footnote-get-definition footnote-label))
   (start-def (nth 1 footnote-definition))
   (end-def (nth 2 footnote-definition)))
  (when footnote-definition
(font-lock-ensure start-def end-def)
(format "%s"  (buffer-substring start-def end-def))

(defun org-footnote-enable-eldoc ()
  "Enable Eldoc support for Org Mode footnotes."
  (add-hook 'eldoc-documentation-functions #'org-footnote-eldoc-function nil t))

(add-hook 'org-mode-hook #'org-footnote-enable-eldoc)

I now wonder if there is a way to prevent changing 
eldoc-echo-area-use-multiline-p
to nil globally to prevent footnotes from appearing there and not only in the
eldoc-doc-buffer.

Provided this might be considered useful, where could such a feature be
implemented? I checked org-eldoc.el, but it looks like it aims at
providing programming documentation inside org-mode rather than
implementing specific org-oriented features.


>>> "Eeasier Footnote Deletion": How is it different from `org-footnote-delete'?
>>> 

>> That was nothing more than a simple wrapper for org-footnote-delete, which
>> is not an interactive function: btw, I am curious to know if there is a 
>> reason for
>> that. Why should users re-implement org-footnote-delete with wrappers if 
>> they want to use it interactively?
> 
> I see nothing in git history and mailing list.
> I think that it makes sense to convert org-footnote-delete into
> interactive function.

That would be great.

I've fiddled with org-edit-special and I see it has a major flaw, at least in 
my opinion.
It inserts all changes without keeping track of the undos, as opposed to the 
indirect
buffer solution, which also had the advantage of doing everything from a single 
buffer:
it operates as some sort of 'window' on a part of the file, rather than feeling 
as some
sort of out-of-the-normal operation. Aren't there other possibile use cases for 
indirect
buffers in org mode? Why are they considered inferior to other solutions? I ask 
just
for my understanding.

(A combination of eldoc + org-edit-special might be rather affecting on the
seamlessness of the workflow, but this is of course my simple personal opinion).


> Il giorno 22 mag 2023, alle ore 13:45, Ihor Radchenko  
> ha scritto:
> 
> This sounds like something we can extend `org-forward-element' and
> `org-backward-element' with - it may not only jump to the next element,
> but also jump to the next element of the same type. Jumping to next/previous
> footnote might will useful as a separate command as well though, as a
> complement to the existing `org-next-item', `org-next-link',
> `org-next-block', etc.


Functions that make navigation between similar elements easier would simply be 
great.







[FR] Enhance footnote editing?

2023-05-22 Thread Andrea Lazzarini
I have recently developed a very simple package, org-footnote-assistant (link:
https://github.com/lazzalazza/org-footnote-assistant), which aims to enhance the
functionality and user experience of footnotes within Org Mode. It mainly uses
an indirect buffer to try to solve the problem of limited inline viewing of
footnotes, making it easier to review and modify content without disrupting your
workflow. I recently shared this package via Reddit, and it received, I think, a
fairly positive feedback from the community.

The org-footnote-assistant package introduces several features that improve the
management and editing of footnotes in Org Mode. The features include commands
for easy navigation between footnote references. Users can quickly jump to the
next reference or return to the previous one, ensuring a smooth editing
workflow.

The positive feedback and interest received on Reddit (and a comment by
alphapapa) have encouraged me to explore the possibility of integrating some of
these features upstream to prevent bitrot, ensure wider accessibility, and
leverage the collaborative power of the Org Mode community for their continued
maintenance and development.

I kindly request your feedback, evaluation, and suggestions regarding the
org-footnote-assistant package. I don’t know if some of these features might be
useful upstream, but I believe that your insights and expertise will be
invaluable in refining and optimizing these features for the benefit of all Org
Mode users.

Thank you,

Andrea Lazzarini
[GitHub: lazzalazza]
[Link to org-footnote-assistant: 
https://github.com/lazzalazza/org-footnote-assistant]



Re: [FR] Enhancing footnote managment (via indirect buffer)?

2023-05-22 Thread Andrea Lazzarini



> Il giorno 22 mag 2023, alle ore 13:45, Ihor Radchenko  
> ha scritto:
> 
> Andrea Lazzarini  writes:
> 
>> I am writing to you because I have recently published a simple package called
>> org-footnote-assistant 
>> [https://github.com/lazzalazza/org-footnote-assistant],
>> which aims at improving the overall functionality and user experience of 
>> footnotes
>> within Org Mode.
> 
> Thanks for your interest to contribute to Org mode!

Thank you for your kind reply, for the consideration and the great tips!

> 
>> The current management of footnotes has certain limitations that can 
>> sometimes
>> hinder the overall user experience. One major limitation is the limited 
>> inline
>> viewing of footnotes, which makes it challenging to review and modify 
>> footnote
>> content precisely and without disrupting the workflow.
>> 
>> Org-footnote-assistant addresses the limitations of inline viewing of 
>> footnotes
>> by using an indirect buffer.
> 
> I am not sure if indirect buffer is the right approach for _previews_.
> It is more common in Emacs to either use eldoc or tooltips.
> You may use
> https://www.masteringemacs.org/article/seamlessly-merge-multiple-documentation-sources-eldoc
> as reference about eldoc.
> 

Eldoc (or tooltips) could be great for previewing: I'm going to give them a try
and to see how they might be integrated in an academic writing workflow.
I wander if they would maintain buffer-specific highlighting though...

>> The package also provides commands for easy
>> navigation between footnote references, enabling quick jumps to the next or
>> previous reference.
> 
> This sounds like something we can extend `org-forward-element' and
> `org-backward-element' with - it may not only jump to the next element,
> but also jump to the next element of the same type. Jumping to next/previous
> footnote might will useful as a separate command as well though, as a
> complement to the existing `org-next-item', `org-next-link',
> `org-next-block', etc.
> 

Yes, this actually sounds great, and would make it really easier to implement
focused jumping.

> "Footnote Editing Window" sounds like a duplicate of the existing C-c '
> functionality (`org-edit-special').
> 

Yep! It is, and that's also very good to know: I am sorry but this totally flew
over my head in these years of using org... 

> "Customized Footnote Definition Jumping" does not sound too different
> from editing window. May you elaborate why it is useful?
> 
> I am not sure if I understand what "Enhanced Footnote Reference
> Searching" does from its description.
> 
> "Eeasier Footnote Deletion": How is it different from `org-footnote-delete'?
> 

That was nothing more than a simple wrapper for org-footnote-delete, which
is not an interactive function: btw, I am curious to know if there is a reason 
for
that. Why should users re-implement org-footnote-delete with wrappers if 
they want to use it interactively?

Many thanks!

Andrea Lazzarini

> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>




[FR] Enhancing footnote managment (via indirect buffer)?

2023-05-22 Thread Andrea Lazzarini
I am writing to you because I have recently published a simple package called
org-footnote-assistant [https://github.com/lazzalazza/org-footnote-assistant],
which aims at improving the overall functionality and user experience of 
footnotes
within Org Mode.

The current management of footnotes has certain limitations that can sometimes
hinder the overall user experience. One major limitation is the limited inline
viewing of footnotes, which makes it challenging to review and modify footnote
content precisely and without disrupting the workflow.

Org-footnote-assistant addresses the limitations of inline viewing of footnotes
by using an indirect buffer.The package also provides commands for easy
navigation between footnote references, enabling quick jumps to the next or
previous reference.

On Reddit I have been encouraged to seek your feedback and explore the
possibility of integrating some of these features upstream to prevent bitrot and
ensure wider accessibility, and I am of course open to any suggestion or input.

Best,

Andrea Lazzarini
GitHub: lazzalazza




Re: [BUG] No space after footnote with org-export-with-footnotes set to nil [9.6.1 ( @ /Users/test/.emacs.d/elpa/28.0/develop/org-9.6.1/)]

2023-03-05 Thread Andrea Lazzarini
If some languages require it and some not, as you correctly say, couldn't the 
behaviour be customizable? 

> Il giorno 5 mar 2023, alle ore 13:42, Ihor Radchenko  ha 
> scritto:
> 
> 
> Andrea Lazzarini  writes:
>> Consider the fact that I had to put an extra space before the footnote 
>> exactly to have a space (not an extra one) in the result.
>> 
>> As you say, couldn't it be replaced with:
>> 
>>> maybe with number of spaces equal to :post-blank ?
> 
> Sure, but footnotes are expected to have space before in some languages:
> 
> Sentence. [footnote] Another sentence.
> 
> Keeping the space after will leave us with _two_ spaces:
> 
> Sentence.  Another sentence.
> 
> Not ideal when exporting to, say, ASCII.
> 
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>




Re: [BUG] No space after footnote with org-export-with-footnotes set to nil [9.6.1 ( @ /Users/test/.emacs.d/elpa/28.0/develop/org-9.6.1/)]

2023-03-05 Thread Andrea Lazzarini
Consider the fact that I had to put an extra space before the footnote exactly 
to have a space (not an extra one) in the result.

As you say, couldn't it be replaced with:

> maybe with number of spaces equal to :post-blank ?



> Il giorno 5 mar 2023, alle ore 13:06, Ihor Radchenko  ha 
> scritto:
> 
> Max Nikulin  writes:
> 
>> In my opinion, the filter removing footnotes should transfer afterspaces 
>> to preceding objects.
> 
> I am not sure.
> 
> Consider text like "Pellentesque dapibus suscipit ligula. [fn:1] Donec 
> posuere augue in quam."
> with space before the footnote. If we replace the footnote with space,
> two spaces will be exported. I am not sure if it is expected.
> 
> Also, should we replace footnote with a single space or with the number
> of spaces after?
> 
> Further, this bug is actually not just about footnotes. The footnotes
> are removed in `org-export--prune-tree':
> 
>(if (org-export--skip-p data info selected excluded)
> (if (memq type '(table-cell table-row)) (push data ignore)
>   (org-element-extract-element data))
> 
> The extracted objects can be latex-fragment, statistics-cookie,
> timestamp, and footnote.
> 
> Will it be safe to replace all the above with space? Or maybe with
> number of spaces equal to :post-blank? Something else?
> 
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 




Re: [BUG] No space after footnote with org-export-with-footnotes set to nil [9.6.1 ( @ /Users/test/.emacs.d/elpa/28.0/develop/org-9.6.1/)]

2023-03-04 Thread Andrea Lazzarini
I totally agree with Max Nikulin: wouldn't that be an improvement? That would 
make things a lot easier for those instances in which you want to put the 
footnotes back in.

> Il giorno 3 mar 2023, alle ore 17:47, Max Nikulin  ha 
> scritto:
> 
> On 03/03/2023 22:47, Ihor Radchenko wrote:
>> Max Nikulin writes:
>>> Self-containing example:
>>> 
>>>  8< 
>>> #+options: f:nil
>>> 
>>> Pellentesque dapibus suscipit ligula.[fn::1 ftnt]  Donec posuere augue
>>> in quam.
>>>  >8 
>> This is because spaces after Org syntax objects are considered a part of
>> those syntax objects.  So, excluding footnote automatically means
>> excluding spaces after.
> 
> In my opinion, the filter removing footnotes should transfer afterspaces to 
> preceding objects.
> 




[BUG] No space after footnote with org-export-with-footnotes set to nil [9.6.1 ( @ /Users/test/.emacs.d/elpa/28.0/develop/org-9.6.1/)]

2023-03-03 Thread Andrea Lazzarini


After setting 'org-export-with-footnotes' to 'nil', 
the space following the footnote is removed when exporting (I’ve tested
this with pandoc [docx and html]).

So, given this example:

«Pellentesque dapibus suscipit ligula.[fn:1]  Donec posuere augue in quam.»

The resulting text is:

«Pellentesque dapibus suscipit ligula.Donec posuere augue in quam.»

The only way in which I can get a space in the correct place  is by putting an 
extra one
before the footnote.


Emacs  : GNU Emacs 28.0.91 (build 1, aarch64-apple-darwin21.2.0, NS 
appkit-2113.20 Version 12.1 (Build 21C52))
 of 2022-02-06
Package: Org mode version 9.6.1 ( @ 
/Users/test/.emacs.d/elpa/28.0/develop/org-9.6.1/)




Problems with bibliography while exporting org files

2021-11-08 Thread Andrea Lazzarini
Hi,

I’m a Spacemacs user, and I’ve just upgraded to org mode 9.5.
Coming from 9.4.6, I’m currently trying to figure out how to adapt to the 
changes in the export mechanism.

When I then try to export an org file via org-export and pandoc, I get the 
following message:

Wrong type argument: stringp, 
("~/Dropbox/Standard/Bibliografia/bibliografia_generale.bib")

I am setting my bibliography thus:

(setq org-cite-global-bibliography
'("~/Dropbox/Standard/Bibliografia/bibliografia_generale.bib"))

If I specify a "#+bibliography:” locally in the org file, the same problem 
reoccurs, now stating:

Wrong type argument: stringp, ("local.bib" 
"~/Dropbox/Standard/Bibliografia/bibliografia_generale.bib")

Is there something I must do to be able to export correctly?

Thanks,

Andrea


Emacs  : GNU Emacs 28.0.60 (build 1, x86_64-apple-darwin20.6.0, NS 
appkit-2022.60 Version 11.6 (Build 20G165))
 of 2021-11-02
Package: Org mode version 9.5 (release_9.5-59-g52e6f1 @ 
/usr/local/Cellar/emacs-plus@28/28.0.50/share/emacs/28.0.60/lisp/org/)

current state:
==
(setq
 org-noter--doc-goto-location-hook '(org-noter-pdftools--doc-goto-location)
 org-noter--check-location-property-hook '(org-noter-pdftools--check-link)
 org-link-elisp-confirm-function 'yes-or-no-p
 org-roam-db-gc-threshold 402653184
 org-ref-cite-onclick-function #[257 "\300 \207" [org-ref-citation-hydra/body] 
2 "\n\n(fn _)"]
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-pdftools-get-desc-function 'org-pdftools-get-desc-default
 org-ref-insert-cite-function 'org-ref-insert-cite-link
 org-download-file-format-function 'org-download-file-format-default
 org-log-done 'time
 org-fontify-done-headline nil
 org-roam-dailies-capture-templates '(("d" "default" plain "%?" :target 
(file+head "%<%Y-%m-%d>.org" "#+title: %<%Y-%m-%d>\n#+startup: content")))
 org-log-into-drawer t
 org-babel-after-execute-hook '(spacemacs/ob-fix-inline-images)
 org-agenda-files '("~/Dropbox/Agenda/todo.org" 
"~/Dropbox/Agenda/todo.org_archive" "~/Dropbox/Corsi/corsi_conclusi.org" 
"/Users/test/Dropbox/org-roam/20210709174709-erc.org"
"/Users/test/Dropbox/org-roam/20211018120015-disfor.org" 
"/Users/test/Dropbox/org-roam/20211104164945-esami.org"

"/Users/test/Dropbox/org-roam/20211009124857-racconti_de_roberto.org" 
"/Users/test/Dropbox/org-roam/20211006180957-curiosity_driven.org"

"/Users/test/Dropbox/org-roam/20211029144338-de_roberto.org")
 org-capture-templates '(("d" "Deadline" entry (file+headline 
"~/Dropbox/Agenda/todo.org" "Tasks") "* TODO %?\n  DEADLINE: %T\n\n")
 ("t" "Task" entry (file+headline 
"~/Dropbox/Agenda/todo.org" "Tasks") "* TODO %?\n  SCHEDULED: %T\n\n")
 ("i" "Idea" entry (file+headline 
"~/Dropbox/Agenda/inbox.org" "Idee") "* %?"))
 org-export-before-parsing-hook '(org-attach-expand-links org-reledmac-export)
 org-default-notes-file "~/Dropbox/Agenda/todo.org"
 org-export-async-init-file 
"/Users/test/.emacs.d/layers/+emacs/org/local/org-async-init.el"
 org-roam-find-file-hook '(org-roam-buffer--setup-redisplay-h 
org-roam--register-completion-functions-h org-roam--replace-roam-links-on-save-h
   org-roam-open-id-with-org-roam-db-h 
org-roam-db-autosync--setup-update-on-save-h)
 org-ref-bibtex-assoc-pdf-with-entry-move-function 'rename-file
 org-publish-timestamp-directory "~/.emacs.d/.cache/.org-timestamps/"
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-file-apps '(("\\.docx\\'" . default) (auto-mode . emacs))
 org-noter-pdftools-markup-pointer-function 
'pdf-annot-add-highlight-markup-annotation
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS 
WIDTH)"]
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines org-optimize-window-after-visibility-change)
 org-noter--note-after-tipping-point-hook 
'(org-noter-pdftools--note-after-tipping-point)
 org-modules '(org-habit ol-doi ol-w3m ol-bbdb ol-bibtex ol-docview ol-gnus 
ol-info ol-irc ol-mhe ol-rmail ol-eww)
 org-ref-notes-function 'orb-org-ref-edit-note
 org-image-actual-width nil
 org-mode-hook '(er/add-org-mode-expansions org-ref-org-menu #[0 
"\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-all 
append local] 5]
 #[0 "\300\301\302\303\304$\207" [add-hoo

Re: Shower thought: submit an IETF RFC to register Org as a MIME type

2020-09-24 Thread Andrea
Hi,

What are the pros?

About the cons: maybe we need to look more into the requirements.

I am looking at https://tools.ietf.org/html/rfc2048 and the one that
concerns me a little is 2.2.6: I guess somebody would need to write a
bit of docs about security concerns. Or you can go the way Markdown did
it: from https://tools.ietf.org/html/rfc7763#section-2

"Security considerations:

  Markdown interpreted as plain text is relatively harmless.  A text
  editor need only display the text.  The editor SHOULD take care to
  handle control characters appropriately and to limit the effect of
  the Markdown to the text-editing area itself; malicious Unicode-
  based Markdown could, for example, surreptitiously change the
  directionality of the text.  An editor for normal text would
  already take these control characters into consideration, however.

  Markdown interpreted as a precursor to other formats, such as
  HTML, carries all of the security considerations as the target
  formats.  For example, HTML can contain instructions to execute
  scripts, redirect the user to other web pages, download remote
  content, and upload personally identifiable information.  Markdown
  also can contain islands of formal markup, such as HTML.  These
  islands of formal markup may be passed as they are, transformed,
  or ignored (perhaps because the islands are conditional or
  incompatible) when the Markdown is processed.  Since Markdown may
  have different interpretations depending on the tool and the
  environment, a better approach is to analyze (and sanitize or
  block) the output markup, rather than attempting to analyze the
  Markdown.
"

Do they have an org-babel?

Thanks,

Andrea



Re: Shower thought: submit an IETF RFC to register Org as a MIME type

2020-09-24 Thread Andrea
Hi,

What are the pros?

About the cons: maybe we need to look more into the requirements.

I am looking at https://tools.ietf.org/html/rfc2048 and the one that
concerns me a little is 2.2.6: I guess somebody would need to write a
bit of docs about security concerns. Or you can go the way Markdown did
it: from https://tools.ietf.org/html/rfc7763#section-2

"Security considerations:

  Markdown interpreted as plain text is relatively harmless.  A text
  editor need only display the text.  The editor SHOULD take care to
  handle control characters appropriately and to limit the effect of
  the Markdown to the text-editing area itself; malicious Unicode-
  based Markdown could, for example, surreptitiously change the
  directionality of the text.  An editor for normal text would
  already take these control characters into consideration, however.

  Markdown interpreted as a precursor to other formats, such as
  HTML, carries all of the security considerations as the target
  formats.  For example, HTML can contain instructions to execute
  scripts, redirect the user to other web pages, download remote
  content, and upload personally identifiable information.  Markdown
  also can contain islands of formal markup, such as HTML.  These
  islands of formal markup may be passed as they are, transformed,
  or ignored (perhaps because the islands are conditional or
  incompatible) when the Markdown is processed.  Since Markdown may
  have different interpretations depending on the tool and the
  environment, a better approach is to analyze (and sanitize or
  block) the output markup, rather than attempting to analyze the
  Markdown.
"

Do they have an org-babel?

Thanks,

Andrea



[ANN] integrate Org-capture and YASnippet and Yankpad

2020-07-28 Thread Andrea
Hi,

TL;DR: I show a way to run a yasnippet or a yankpad snippet from your
org-capture templates.

I would like to share with the community this little hack to integrate
org-capture with the templating systems of YASnippet and Yankpad!

If you like to keep snippets organized and not in the init file, you may
be using YASnippet and/or Yankpad. I found that is not straightforward
to run one of these while creating a task with org-capture so I hacked
my way through.

So this is the screencast of my hack:
https://github.com/ag91/ya-org-capture/blob/master/ya-org-capture-screehcast.gif

And this is a post describing why/what I did: 
https://ag91.github.io/blog/2020/07/28/how-to-integrate-yasnippet-and-yankpad-with-org-capture/

I hope this will be helpful to somebody else too! And any feedback is
welcome, maybe there was an easier way to do it?

Thanks,

Andrea



[O] Oas: a small addon to Org Mode to automatically close tasks with statistics

2019-08-30 Thread Andrea Giugliano
Hi,

I recently landed on this conversation:
https://lists.gnu.org/archive/html/emacs-orgmode/2010-03/msg00802.html

Since I find myself quite often in a situation like the following:

* TODO abc [3/3]
- [X] a
- [X] b
- [X] c

I decided to dive more into Org's API, and I created this library [0] to
automatically moving that task to DONE. My library checks that when you
are in a situation like:

* TODO abc [1/1]
- [X] a

** TODO b

the parent task does not swap to DONE because there is still a sub-task
to complete.

Tasks that have heading like

* abc [0/1]

or

* TODO abc

do NOT get updated, because I want this to work only for TODO that have
statistics.

How could I propose this as an add-on of Org Mode? Do you think it is
worth the effort?

Any feedback is very welcome to learn more :)

Best,

Andrea

[0] https://github.com/ag91/org-active-statistics



[O] Suggestion for note capture

2019-05-11 Thread Andrea Giugliano
Hi Nathan,

I think I have a starting point for you:

--
(defun ag/org-add-note-to-last-entry ()
  "Add a note to the main agenda file under the latest visited
heading (untested in case the org buffer is not available)"
  (interactive)
  (let ((buffer (car (org-buffer-list 'files 't
(with-current-buffer buffer
  (org-add-note)
  (message "%S" (concat "Adding note in heading: " (fifth 
(org-heading-components)))
---

This function adds a note to the last heading you were editing before
switching file. It is limited to the first file in your
"org-buffer-list" (so does not work if you have multiple org files from
which you generate your agenda).

I imagine you could extend this by choosing the file that has a clock
open (i.e., you need to change the "buffer" binding accordingly), move
to the clocked heading (i.e., add some logic before "org-add-note") and
pointing to the subheading (i.e., again adding some logic before
"org-add-note").

Hope this gives you a lead.

Best,

Andrea


Re: [O] [Patch] Org-tools addendum

2019-02-24 Thread Andrea D'Amore
On Tue, 26 Jun 2018 at 11:55, Nicolas Goaziou  wrote:
> Hello,
> "Andrea D'Amore"  writes:
> > I'm submitting a small patch to add orga and pandoc to the list of
> > org-tools.
>
> Thank you. Would you mind using "git format-patch" to get a proper
> commit message and send it again?

Sorry for the extreme delay, I'm attaching the patch printed out by
git-format-patch.

I had a little embarrassment writing a ChangeLog entry for such a
small diff, the first line was already saying it all…

Please still directly reply to me if need be.


Best regards

-- 
Andrea
From c73b2afcf11a1041dc2893e1e69868316820e351 Mon Sep 17 00:00:00 2001
From: Andrea D'Amore 
Date: Sun, 24 Feb 2019 16:20:58 +0100
Subject: [PATCH] index.org: Mention Orga and Pandoc in the tool page

* index.org (Org-mode parsers): add link to homepage and brief description for
Orga, an ES parsers for org, and Pandoc, the multi-purpose converter.

TINYCHANGE
---
 org-tools/index.org | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/org-tools/index.org b/org-tools/index.org
index 53a01963..3b6a5035 100644
--- a/org-tools/index.org
+++ b/org-tools/index.org
@@ -111,6 +111,17 @@ org-js is a javascript parser and converter for org-mode
 For a working example of an interactive editor, see
 http://mooz.github.com/org-js/editor/.
 
+** [[https://github.com//xiaoxinghu/orgajs][orga]] by Xiaoxing Hu
+
+Orga is a flexible org-mode syntax parser. It parses org content into
+AST (Abstract Syntax Tree).
+
+** [[https://pandoc.org][pandoc]]
+
+Pandoc is the Swiss-army knife to convert files from one markup format
+into another, it can convert documents from many source format,
+including Org-Mode, to many other.
+
 * Specific purpose tools
 
 ** orgmode for drupal
-- 
2.17.1



Re: [O] Org mode repeated dates to do spaced learning

2019-01-06 Thread Andrea Giugliano
Hi there,

That was a very helpful suggestion. At the bottom of the mail I attached
my first (working) stab at it.

The idea is to have an headline with the :spaced: tag and another tag
maintaining the number of repetition performed so far. At the beginning
I was thinking to use scheduled times instead of a "counter" tag, but it
was not worth the complexity of the code.

If anybody else finds this feature useful, what would be the best way
to share this?

#+begin_src elisp
(defun my/space-repeat-if-tag-spaced (e)
  "Resets the header on the TODO states and increases the scheduled date
according to a suggested spaced repetition interval."
  (let* ((spaced-rep-map '((0 . "++1d")
  (1 . "++2d")
  (2 . "++10d")
  (3 . "++30d")
  (4 . "++60d")
  (5 . "++4m")))
 (spaced-key "spaced")
 (tags (org-get-tags nil t))
 (spaced-todo-p (member spaced-key tags))
 (repetition-n (first (cdr spaced-todo-p)))
 (n+1 (if repetition-n (+ 1 (string-to-number (substring repetition-n 
(- (length repetition-n) 1) (length repetition-n 0))
 (spaced-repetition-p (alist-get n+1 spaced-rep-map))
 (new-repetition-tag (concat "repetition" (number-to-string n+1)))
 (new-tags (reverse (if repetition-n
(seq-reduce
 (lambda (a x) (if (string-equal x 
repetition-n) (cons new-repetition-tag a) (cons x a)))
 tags
 '())
  (seq-reduce
   (lambda (a x) (if (string-equal x spaced-key) 
(cons new-repetition-tag (cons x a)) (cons x a)))
   tags
   '())
(if (and spaced-todo-p spaced-repetition-p)
  (progn
  ;; avoid infinitive looping
  (remove-hook 'org-trigger-hook 'my/space-repeat-if-tag-spaced)
  ;; reset to previous state
  (org-call-with-arg 'org-todo 'left)
  ;; schedule to next spaced repetition
  (org-schedule nil (alist-get n+1 spaced-rep-map))
  ;; rewrite local tags
  (org-set-tags new-tags)
  (add-hook 'org-trigger-hook 'my/space-repeat-if-tag-spaced))
)))

(add-hook 'org-trigger-hook 'my/space-repeat-if-tag-spaced)
#+end_src


Thanks,

Andrea




On Wed 02 Jan 2019 at 05:59, Marcin Borkowski  wrote:

> On 2019-01-01, at 17:34, Andrea Giugliano  wrote:
>
>> Hi,
>>
>> Thanks for your reply. You are right org-drill does spaced repetition. I
>> just was unclear: I would like to see that in the agenda as a normal
>> item (that gets space-repeated every time I mark it DONE though).
>> I could not get from the docs if org-drill does that.
>
> That is an interesting idea.  I am pretty sure you could make it happen
> with `org-trigger-hook' or `org-after-todo-state-change-hook' (I am not
> entirely sure why both exist, btw).
>
>> Thanks,
>>
>> Andrea
>
> Hth,



Re: [O] Org mode repeated dates to do spaced learning

2019-01-01 Thread Andrea Giugliano
Hi,

Thanks for your reply. You are right org-drill does spaced repetition. I
just was unclear: I would like to see that in the agenda as a normal
item (that gets space-repeated every time I mark it DONE though).
I could not get from the docs if org-drill does that.

Thanks,

Andrea

On Tue 01 Jan 2019 at 16:39, Bingo  wrote:

> Le 1 janvier 2019 18:02:31 GMT+05:30, Andrea Giugliano  a 
> écrit :
>>Happy 2019 everyone!
>>
>>I would like to slightly change my learning method this year. I have
>>heard that spaced learning is much better than bang your head against
>>the same material multiple times in a row.
>>
>>Spaced learning is simply reviewing some interesting topic at given
>>intervals: after 1 day, 1 week, 2 weeks, 1 month, 3 months, etc...
>>
>>It seems to me that org-mode does not support this: how would you make
>>a
>>repetitive task with spaced intervals?
>>
>>I saw org-drill.el, but I do not think it does this.
>>Ideally I could do something like:
>>
>>""
>>* review this interesting thing
>>SCHEDULED: <2019-01-01 Tue>
>>:PROPERTIES:
>>:SPACED:
>>:END:
>>""
>>
>>If this is not an interesting use case for org-mode, what do you think
>>about me trying to extend org-habits.el instead?
>>
>>Best wishes to all the community,
>>
>>Andrea
>
> Hi,
>Why do you think org-drill doesn't do spaced repetition ? I used it for a 
> while in 2017, and it does. I've since moved to Anki on Android phone for the 
> same purpose, because phones are accessible for longer, but was happy with 
> org-drill.


[O] Org mode repeated dates to do spaced learning

2019-01-01 Thread Andrea Giugliano
Happy 2019 everyone!

I would like to slightly change my learning method this year. I have
heard that spaced learning is much better than bang your head against
the same material multiple times in a row.

Spaced learning is simply reviewing some interesting topic at given
intervals: after 1 day, 1 week, 2 weeks, 1 month, 3 months, etc...

It seems to me that org-mode does not support this: how would you make a
repetitive task with spaced intervals?

I saw org-drill.el, but I do not think it does this.
Ideally I could do something like:

""
* review this interesting thing
SCHEDULED: <2019-01-01 Tue>
:PROPERTIES:
:SPACED:
:END:
""

If this is not an interesting use case for org-mode, what do you think
about me trying to extend org-habits.el instead?

Best wishes to all the community,

Andrea



Re: [O] Literate programming: Org mode and Scala

2018-09-18 Thread Andrea
Hi Grant,

Yes, I am. If you manage to make the current scala-mode work, the output
is ugly (I opened a PR for that). The old scala-mode [1] did not need any
external package to work (apart of Scala).

Best,

Andrea

[0] https://github.com/ensime/emacs-scala-mode/issues/148
[1] https://raw.githubusercontent.com/tkf/org-mode/master/lisp/ob-scala.el

On Tue 18 Sep 2018 at 15:50, Grant Rettke  wrote:

> On Sun, Sep 9, 2018 at 2:43 PM Andrea Giugliano  wrote:
>> I wonder: is the org-mode community planning to make scala-mode work in
>> a literate way without workarounds?
>
> Are you saying that there are two versions of scala-mode out there:
> one that works and one that doesn't work?



[O] Literate programming: Org mode and Scala

2018-09-09 Thread Andrea Giugliano
Hi everybody,

TL;DR: org mode literate programming does not work easily with the current
scala-mode, there are options to work around this: are the org-mode
maintainers still okay with scala-mode depending on ensime?


Thanks so much for org-mode: the more I use it the more I appreciate the
effort you have put into it!

I am working with Scala and I like to test out things using a literate
programming style. Apparently org-mode decided to offload the scala-mode
to the Ensime maintainers. For this reason there is no straightforward
(at least not to me) support to run code blocks on the fly.

I have opened an issue about this [0], but the Ensime/scala-mode
community does not seem active (at least this pull request did not
receive any comment yet [1]).

For those who are struggling I have created a little of code to make
easy to work with Scala and org-mode [2].

I wonder: is the org-mode community planning to make scala-mode work in
a literate way without workarounds?

Thanks,

Andrea

[0] https://github.com/ensime/emacs-scala-mode/issues/148
[1] https://github.com/ensime/emacs-scala-mode/pull/151
[2] https://github.com/ag91/EasyOrgEnsime



[O] [Patch] Org-tools addendum

2018-06-26 Thread Andrea D'Amore
Hello,
I'm submitting a small patch to add orga and pandoc to the list of org-tools.

I'm not subscribing to the ml, so if there is any follow-up please be
sure to directly reply to my email address.


Best regards

-- 
Andrea
diff --git a/org-tools/index.org b/org-tools/index.org
index 53a0196..3b6a503 100644
--- a/org-tools/index.org
+++ b/org-tools/index.org
@@ -111,6 +111,17 @@ org-js is a javascript parser and converter for org-mode
 For a working example of an interactive editor, see
 http://mooz.github.com/org-js/editor/.
 
+** [[https://github.com//xiaoxinghu/orgajs][orga]] by Xiaoxing Hu
+
+Orga is a flexible org-mode syntax parser. It parses org content into
+AST (Abstract Syntax Tree).
+
+** [[https://pandoc.org][pandoc]]
+
+Pandoc is the Swiss-army knife to convert files from one markup format
+into another, it can convert documents from many source format,
+including Org-Mode, to many other.
+
 * Specific purpose tools
 
 ** orgmode for drupal


[O] Bug: [Feature request] generate source blocks from filename [9.0.8 (9.0.8-elpaplus @ /Users/andreagiugliano/.emacs.d/elpa/org-plus-contrib-20170606/)]

2017-06-19 Thread Andrea

Hello everyone,

Thanks immensely for your effort in developing/maintaining org mode. I
learned to use it during my Ph.D. and now that I am working is even more
useful (and fun :).

I like literate programming, and I find really useful to work by using
source blocks (as I can swap between org mode bindings and the code mode
bindings with the easy C-c ').

So to simplify my source imports I developed this simple function in
elisp:

#+BEGIN_SRC elisp
;; in this function there is a map from file extensions to org babel identifiers
(defun org-src-from-filename (filepath)
  "Convert filename at point to org src block."
  (interactive)
  (let* (
 (ext2babelIds '(("clj" . "clojure")
("dot" . "dot")
;(gnuplot . t)
;(calc . t)
("hs" . "haskell")
("java" . "java")
("ml" . "ocaml")
("org" . "org")
;(plantuml . t)
("py" . "python")
("rb" . "ruby")
("scala" . "scala")
("sbt" . "scala")
("sh" . "sh")
("txt" . "text")
("html" . "html")
("xml" . "html")
("xhtml" . "xhtml")
("tex" . "latex")
("el" . "emacs-lisp")
("json" . "javascript")
("js" . "javascript")
("css" . "css")
("sql" . "sql")
("" . "text")
))
 (bounds (bounds-of-thing-at-point 'filename))
 (contents (with-temp-buffer
 (insert-file-contents filepath)
 (buffer-string)))
 (extension (file-name-extension filepath))
 (babel-id (cdr (assoc extension ext2babelIds)))
 (org-contents (concat "#+BEGIN_SRC " (if babel-id babel-id extension) 
" :tangle " filepath "\n"  contents "#+END_SRC"))
)
(save-excursion (when (and bounds filepath)
  (delete-region (car bounds) (cdr bounds))
  (insert org-contents)
#+END_SRC

It basically, given a filename, generates a source block with the
correct extension and the tangle path.

The cool thing is that I can use it to substitute a path at point:

#+BEGIN_SRC emacs-lisp :tangle yes
(defun org-src-from-filename-at-point ()
  (interactive)
  (org-src-from-filename (thing-at-point 'filename)))
(bind-key "C-c s" 'org-src-from-filename-at-point)
#+END_SRC

And even integrate it with helm, by using the kill-ring list:

#+BEGIN_SRC emacs-lisp :tangle yes
(defun org-src-from-helm-kill-ring ()
  (interactive)
  (helm-show-kill-ring)
  (org-src-from-filename-at-point))
(bind-key "C-c y" 'org-src-from-helm-kill-ring)
#+END_SRC

Which becomes so cool having a function that adds the current buffer
filename to the kill-ring:

#+BEGIN_SRC emacs-lisp :tangle yes
(defun copy-buffer-filename ()
  (interactive)
  (let ((path (buffer-file-name)))
(when path (kill-new path)))
  )
(global-set-key (kbd "C-c b")  'copy-buffer-filename)
#+END_SRC

Do you think it would make sense to add such a functionality to
org-mode? Or maybe it is already there and I missed it?

However, just thanks for your amazing work!

Best regards,

Andrea


Emacs  : GNU Emacs 25.1.2 (x86_64-apple-darwin16.0.0, Carbon Version 157 AppKit 
1504)
 of 2017-04-04
Package: Org mode version 9.0.8 (9.0.8-elpaplus @ 
/Users/andreagiugliano/.emacs.d/elpa/org-plus-contrib-20170606/)



[O] Bug: org-eww-copy-for-org-mode Empty Link problem + easy fix [9.0.4 (9.0.4-elpaplus @ /home/andrea/.emacs.d/elpa/org-plus-contrib-20170124/)]

2017-02-11 Thread Andrea

Hello,

thanks hugely for org mode: the more I learn about it the easier is my
life organization!

I was trying to use org-eww-copy-for-org-mode (org-eww package in the
contrib/ directory) within eww in website like www.indeed.co.uk, and
every time I tried, I was receiving the error "Empty Link".

The error is due to the presence of input forms (e.g., in
www.indeed.co.uk where you can add the job you are looking for), that
are considered like urls by this function [1]. When the input form is
passed to org-make-link-string, org-make-link-string complains that the
link is empty.

Now I solved this by adding an if statement that makes the link only if
the info passed is not nil [2], but maybe someone knows a better check
for org-eww-goto-next-url-property-change than the one using 'shr-url?

Thanks a lot for org mode,

Andrea



[1] org-eww-copy-for-org-mode uses org-eww-goto-next-url-property-change
to get the position of the next link, which uses
(next-single-property-change (point) 'shr-url) which considers input
forms 'shr-url.

[2] this is the fixed version (the only change is highlighted by a FIXED
HERE comment):

#+BEGIN_SRC elisp
(defun org-eww-copy-for-org-mode ()
  "Copy current buffer content or active region with `org-mode' style links.
This will encode `link-title' and `link-location' with
`org-make-link-string', and insert the transformed test into the kill ring,
so that it can be yanked into an Org mode buffer with links working correctly.

Further lines starting with a star get quoted with a comma to keep
the structure of the Org file."
  (interactive)
  (let* ((regionp (org-region-active-p))
 (transform-start (point-min))
 (transform-end (point-max))
 return-content
 link-location link-title
 temp-position out-bound)
(when regionp
  (setq transform-start (region-beginning))
  (setq transform-end (region-end))
  ;; Deactivate mark if current mark is activate.
  (when (fboundp 'deactivate-mark) (deactivate-mark)))
(message "Transforming links...")
(save-excursion
  (goto-char transform-start)
  (while (and (not out-bound)   ; still inside region to copy
  (org-eww-has-further-url-property-change-p)) ; there is a 
next link
;; Store current point before jump next anchor.
(setq temp-position (point))
;; Move to next anchor when current point is not at anchor.
(or (org-eww-url-below-point)
(org-eww-goto-next-url-property-change))
(cl-assert
 (org-eww-url-below-point) t
 "program logic error: point must have an url below but it hasn't")
(if (<= (point) transform-end) ; if point is inside transform bound
(progn
  ;; Get content between two links.
  (when (< temp-position (point))
(setq return-content (concat return-content
 (buffer-substring
  temp-position (point)
  ;; Get link location at current point.
  (setq link-location (org-eww-url-below-point))
  ;; Get link title at current point.
  (setq link-title
(buffer-substring
 (point)
 (org-eww-goto-next-url-property-change)))
  ;; concat `org-mode' style url to `return-content'.
  (setq return-content (if (and ;; FIXED HERE added if statement
(if (stringp link-location) 
(string-blank-p link-location) nil)
(string-blank-p link-title)
)
   (concat return-content
   (org-make-link-string
link-location link-title))
   return-content   
   
   )))
  (goto-char temp-position) ; reset point before jump next anchor
  (setq out-bound t); for break out `while' loop
  ))
  ;; Add the rest until end of the region to be copied.
  (when (< (point) transform-end)
(setq return-content
  (concat return-content
  (buffer-substring (point) transform-end
  ;; Quote lines starting with *.
  (org-kill-new (replace-regexp-in-string "^\\*" ",*" return-content))
  (message "Transforming links...done, use C-y to insert text into Org mode 
file"
#+END_SRC





Emacs  : GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.31)
 of 2017-02-03
Package: Org mode version 9.0.4 (9.0.4-elpaplus @ 
/home/andrea/.emacs.d/elpa/org-plus-contri

[O] Bug: EXPORT_FILE_NAME error [9.0.3 (9.0.3-elpaplus @ /home/andrea/.emacs.d/elpa/org-plus-contrib-20161224/)]

2016-12-28 Thread Andrea

Hello,

thanks for org mode, it is great!
I am having a problem with the latest version of org: I really would
like to be able to export buffers in a different directory, and so far I
used the :EXPORT_FILE_NAME: property for this use case.

However, after upgrading to the latest release it seems that something
does not work anymore: the pdf file is generated but the output
directory is ignored!

You could reproduce this by:

1) cd ~
2) touch test.org
3) echo "* bla
   :PROPERTIES:
 :EXPORT_FILE_NAME:  /tmp/bla
   :END: 
   " > test.org
4) emacs test.org
5) C-e C-s l o

Error here: org-compile-file: File "/tmp/bla.pdf" wasn’t produced.  See "*Org 
PDF LaTeX
You should see that the LaTeX file is in the /tmp directory, but that
the pdf is in the home directory.

It would be marvellous if this could start working as before.
Thanks and Happy New Year to everyone,

Andrea



Emacs  : GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.31)
 of 2016-12-24
Package: Org mode version 9.0.3 (9.0.3-elpaplus @ 
/home/andrea/.emacs.d/elpa/org-plus-contrib-20161224/)

current state:
==
(setq
 org-capture-prepare-finalize-hook '(org-id-get-create)
 org-reveal-mathjax t
 org-pandoc-epub-rights "Copyright 2016 Andrea <>"
 org-tab-first-hook '(do-yas-expand org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-src-window-setup 'current-window
 org-latex-format-inlinetask-function 
'org-latex-format-inlinetask-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-image-actual-width 550
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-latex-pdf-process '("latexmk -pdf %f")
 org-highlight-latex-and-related '(latex script entities)
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-default-notes-file "/home/andrea/workspace/agenda/myTasks.org"
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-from-is-user-regexp "\\<Andrea\\>"
 org-loop-over-headlines-in-active-region 'start-level
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-babel-tangle-use-relative-file-links nil
 org-mode-hook '((lambda nil (make-variable-buffer-local (quote 
yas/trigger-key)) (setq yas/trigger-key [tab])
  (add-to-list (quote org-tab-first-hook) (quote do-yas-expand))
  (define-key yas/keymap [tab] (quote yas/next-field)))
 (lambda nil (local-set-key "\357" (quote 
org-mime-org-buffer-htmlize))) org-toggle-blocks turn-on-flyspell
 #[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-show-block-all append local] 5]
 #[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes 
org-eldoc-load)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-use-speed-commands t
 org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS 
WIDTH)"]
 org-pomodoro-ticking-sound 
"/home/andrea/.emacs.d/elpa/org-pomodoro-20161119.226/resources/tick.wav"
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-pomodoro-start-sound 
"/home/andrea/.emacs.d/elpa/org-pomodoro-20161119.226/resources/bell.wav"
 org-babel-tangle-lang-exts '(("haskell" . "hs") ("scala" . "scala") ("ruby" . 
"rb") ("python" . "py") ("java" . "java")
  ("clojure" . "clj") ("ocaml" . "ml") 
("emacs-lisp" . "el") ("elisp" . "el"))
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-html-format-headline-function 'org-html-format-headline-default-function
 org-link-parameters '(("id" :follow org-id-open) ("rmail" :follow 
org-rmail-

[O] Fwd: Re: Bug: Org-babel-detangle does not work for subtrees [8.3.5 (8.3.5-elpaplus @ /home/andrea/.emacs.d/elpa/org-plus-contrib-20160808/)]

2016-08-31 Thread Andrea Giugliano
I am not sure my previous mail reached everyone interested.
Best,

Andrea

Andrea Giugliano <agiugli...@live.it> writes:

> Hello,
>
> I found a solution, or better I have understood how detangling is
> supposed to work after reading ob-tangle.el.
>
> Basically, I found necessary two things to detangle properly (not
> counting the =:comments yes= that is described in the info):
>
> 1) the cursor needs to be _on_ the code body, and *not* on the comments
>generated by org-babel-tangle.
>
> 2) the setting =(setq org-babel-tangle-use-relative-file-links 'nil)= is 
> essential:
>indeed, using relative path makes my org-babel-jump-to-org try to
>find something like home/andrea/home/andrea... that typically does
>not exists.
>
> I am not sure if this is a src bug (in the wrong default of
> =org-babel-tangle-use-relative-file-links=), or a documentation 
> (http://orgmode.org/worg/doc.html) bug.
>
> It would be nice that =org-babel-detangle= and
> =org-babel-tangle-jump-to-org= could support IDs link navigation as well
> sometimes in the future (since it is possible to base links
> definitions on IDs with =(setq org-id-link-to-org-use-id t)=).
> Thanks,
>
> Andrea
>
> P.S: thanks Grant, your answer gave me the right ques to solve my
> problem. (Also, I am not sure I fully understood the capabilities of your
> framework "help" from the repository description, but I liked the
> guidelines for literate programming you gave in one of the readmes.)
>
> Grant Rettke <g...@wisdomandwonder.com> writes:
>
>> Good evening Andrea,
>>
>> Does it use the contents of the headline instead of the ID?
>>
>> If yes, I know what you mean, but I don't remember why it does that
>> because long ago I changed it so that it uses the NAME of the ID
>> instead. I can tell you how my configuration looks though:
>>
>> All of my Org-Mode LP configuration is in here:
>>
>> https://github.com/grettke/help/blob/master/Org-Mode_Fundamentals.org
>>
>> Here are some values that come to mind though:
>>
>> - Global header-args sets comments to "noweb"
>> - This whole section
>> https://github.com/grettke/help/blob/master/Org-Mode_Fundamentals.org#identity
>> - (require 'org-id)
>> - (setq org-id-link-to-org-use-id 'nil)
>>
>> That makes it so that the comment links to the file, not to the id or
>> custom_id. Yes, I find it confusing and I only figured this out a
>> couple nights ago. However, this makes detangle work.
>>
>> Let me know how it goes and check out my config.
>>
>> Sincerely,
>>
>> Grant Rettke
>>
>>
>> On Tue, Aug 30, 2016 at 5:38 PM, Andrea Giugliano <agiugli...@live.it> wrote:
>>> Hello,
>>>
>>> yup, that would be the ideal solution, but at the moment my
>>> org-babel-tangle does not use the ID in the comments! It uses a (not
>>> working) string.
>>> Do you mean that I can force to reference in the comment to be an ID??
>>> Thanks,
>>>
>>> Andrea
>>>
>>> Grant Rettke <g...@wisdomandwonder.com> writes:
>>>
>>>> On Tue, Aug 30, 2016 at 12:25 PM, Andrea Giugliano <agiugli...@live.it> 
>>>> wrote:
>>>>> I think that the ideal solution is to allow an user to make
>>>>> org-babel-detangle rely on header IDs, since this not only assures
>>>>> detangle to find the correct header every time, but also push the user
>>>>> to use IDs through org-id (that seems good practice).
>>>>> What do you think?
>>>>
>>>> Yes you should set a ID on every Headline and source-block
>>>> automatically using org-id so that detangling always works.
>>>>
>>>> When you want a custom ID it is easily changed.
>>>




[O] Bug: Org-babel-detangle does not work for subtrees [8.3.5 (8.3.5-elpaplus @ /home/andrea/.emacs.d/elpa/org-plus-contrib-20160808/)]

2016-08-30 Thread Andrea Giugliano

Hello,

I have an org mode file with deep subtrees (i.e., 7 stars nesting
level).
When I try to detangle a src block generated by

"
*** TODO find map
:PROPERTIES:
:ID:   501cfff7-3b24-47cc-9ada-42e6d46abbe9
:END:

#+BEGIN_SRC ocaml :noeval :comments both :mkdirp yes :tangle ~/tmp/findMap.ml
anything here
#+END_SRC
"

and the generated file contains:

(* TODO find map *)
(* :PROPERTIES: *)
(* :ID:   501cfff7-3b24-47cc-9ada-42e6d46abbe9 *)
(* :END: *)


(* [[file:../home/andrea/workspace/agenda/myTasks.org::*find%20map][find\ 
map:1]] *)
anything here
(* find\ map:1 ends here *)

the detangle cannot find the header, and proposes me to create a new one
in the file.
I think that the ideal solution is to allow an user to make
org-babel-detangle rely on header IDs, since this not only assures
detangle to find the correct header every time, but also push the user
to use IDs through org-id (that seems good practice).
What do you think?
Thanks for the fantastic org mode!!

Andrea

Emacs  : GNU Emacs 24.5.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.29)
 of 2016-08-26 on localhost
Package: Org-mode version 8.3.5 (8.3.5-elpaplus @ 
/home/andrea/.emacs.d/elpa/org-plus-contrib-20160808/)

current state:
==
(setq
 org-capture-prepare-finalize-hook '(org-id-get-create)
 org-reveal-mathjax t
 org-pandoc-epub-rights "Copyright 2016 Andrea <>"
 org-tab-first-hook '(org-hide-block-toggle-maybe 
org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-src-tab-acts-natively t
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-html-format-drawer-function '(lambda (name contents) contents)
 org-src-window-setup 'current-window
 org-latex-format-inlinetask-function 
'org-latex-format-inlinetask-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-image-actual-width 550
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-latex-pdf-process '("latexmk -pdf %f")
 org-highlight-latex-and-related '(latex script entities)
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-default-notes-file "/home/andrea/workspace/agenda/myTasks.org"
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function '(lambda (name contents) contents)
 org-from-is-user-regexp "\\<Andrea\\>"
 org-loop-over-headlines-in-active-region 'start-level
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '((lambda nil
  (local-set-key "\357" (quote org-mime-org-buffer-htmlize)))
 org-toggle-blocks turn-on-flyspell
 #[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook org-show-block-all 
append local]
   5]
 #[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook 
org-babel-show-result-all
append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes 
org-eldoc-load)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-use-speed-commands t
 org-ascii-format-drawer-function '(lambda (name contents width) contents)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point 
org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-babel-tangle-lang-exts '(("haskell" . "hs") ("scala" . "scala") ("ruby" . 
"rb")
  ("python" . "py") ("java" . "java") ("ocaml" . 
"ml")
  ("emacs-lisp" . "el") ("elisp" . "el"))
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-html-format-headline-function 'org-html-format-headline-default-function
 org-structure-template-alist '(("n" "#+BEGIN_NOTES\n?\n#+END_NOTES")
("p"
 "#+BEGIN_SRC plantuml :file uml.png 
\n?\n#+END_SRC")
("s" "#+BEGIN_SRC ?\n\n#+END_SRC")
("e" "#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE")
("q" "#+BEGIN_QUOTE\n?\n#+END_QUOTE")
(&qu

[O] Bug: [Feature request] ob-plantuml fails if there is not jar: can it check for the executable as well? [8.3.5 (8.3.5-elpaplus @ /home/andrea/.emacs.d/elpa/org-plus-contrib-20160808/)]

2016-08-12 Thread Andrea Giugliano

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


I am using NixOS, and since this operating system does not use /usr/bin
as standard folder for executables, plantuml.jar cannot find the
graphviz dependency. NixOS provides a plantuml package, and so I can
call the plantuml command from commandline. It would be nice if
ob-plantuml tried to use the plantuml executable in the case
a .jar is not provided (instead of just failing).
Thanks for Org mode: it is simply wonderful!

Andrea

P.S:
Sorry if I am using the wrong medium for asking for a feature, but I do
not know where else I should do it.

Emacs  : GNU Emacs 24.5.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.29)
 of 2016-07-26 on localhost
Package: Org-mode version 8.3.5 (8.3.5-elpaplus @ 
/home/andrea/.emacs.d/elpa/org-plus-contrib-20160808/)

current state:
==
(setq
 org-pandoc-epub-rights "Copyright 2016 Andrea <>"
 org-tab-first-hook '(org-hide-block-toggle-maybe 
org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-src-tab-acts-natively t
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-html-format-drawer-function '(lambda (name contents) contents)
 org-src-window-setup 'current-window
 org-latex-format-inlinetask-function 
'org-latex-format-inlinetask-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-image-actual-width 550
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-latex-pdf-process '("latexmk -pdf %f")
 org-highlight-latex-and-related '(latex script entities)
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-default-notes-file "/home/andrea/workspace/agenda/myTasks.org"
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function '(lambda (name contents) contents)
 org-from-is-user-regexp "\\<Andrea\\>"
 org-loop-over-headlines-in-active-region 'start-level
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '((lambda nil (local-set-key "\357" (quote 
org-mime-org-buffer-htmlize))) turn-on-flyspell
 #[nil "\300\301\302\303\304$\207" [org-add-hook 
change-major-mode-hook org-show-block-all append local] 5]
 #[nil "\300\301\302\303\304$\207" [org-add-hook 
change-major-mode-hook org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes 
org-eldoc-load)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-use-speed-commands t
 org-ascii-format-drawer-function '(lambda (name contents width) contents)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point 
org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-plantuml-jar-path 
"/nix/store/2s91vgzv8ckhwq1hhxrf666q99z0pnhi-plantuml-8012/lib/plantuml.jar"
 org-babel-tangle-lang-exts '(("haskell" . "hs") ("ruby" . "rb") ("python" . 
"py") ("java" . "java") ("ocaml" . "ml")
  ("emacs-lisp" . "el") ("elisp" . "el"))
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-html-format-headline-function 'org-html-format-headline-default-function
 org-structure-template-alist '(("p" "#+BEGIN_SRC plantuml :file uml.png 
\n?\n#+END_SRC") ("s" "#+BEGIN_SRC ?\n\n#+END_SRC")
("e" "#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE") ("q" 
"#+BEGIN_QUOTE\n?\n#+END_QUOTE")
("v" "#+BEGIN_VERSE\n?\n#+END_VERSE") ("V" 
"#+BEGIN_VERBATIM\n?\n#+END_VERBATIM")
("c" "#+BEGIN_CENTER\n?\n#+END_CENTER") ("l" 
"#+BEGIN_LaTeX\n?\n#+END_LaTeX") ("L" "#+LaTeX: ")
("h" "#+BEGIN_HTML\n?\n#+END_HTML") ("H" 
"#+HTML: ") ("a" "#+BEGIN_ASCII\n?\n#+END_ASCII")
("A" "#+ASCII: ") ("i" "#+INDEX: ?") ("I" 
"#+INCLUDE: %file ?"))
 org-babel-load-languages '((ocaml . t) (java . t) (sh . t) (python . t) (ruby 
. t) (haskell . t) (plantuml . t) (dot . t))
 org-src-preserve-indentation t
 org-html-format-inlinetask-function 
'org-html-format-inlinetask-default-function
 org-agenda-files '("/home/andrea/workspace/agenda/myTasks.org")
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-confirm-babel-evaluate nil
 )



Re: [O] Bug: org -> org export ignores latex blocks [8.3.4 (8.3.4-50-g83e373-elpaplus @ /home/andrea/.emacs.d/elpa/org-plus-contrib-20160509/)]

2016-05-12 Thread Andrea
Okay, I have deleted the org one and left the org-contrib:
I can still use the new feature (probably org-contrib enables it).
Thanks for your explanation,

Andrea

Kaushal Modi <kaushal.m...@gmail.com> writes:

> On Thu, May 12, 2016 at 6:20 PM Andrea <agiuglian...@gmail.com> wrote:
>
>> I think I saw that, but I did not read it carefully. And since the
>> autocompletion (I mean <l+TAB) still gives me the #+BEGINE_LaTex it did
>> not occur to me that may be the problem.
>>
>> By the way, I did not clone the git repo, so I should be on the master
>> published on ELPA.
>
>
> The versions published on ELPA are from the maint branch of org git.
>
>
>> When I give org-version in emacs I get:
>> Org-mode version 8.3.4 (8.3.4-50-g83e373-elpaplus @
>> /home/andrea/.emacs.d/elpa/org-plus-contrib-20160509/)
>>
>> On package-list-packages I have
>>
>>   org20160509  installed Outline-based
>> notes management and organizer
>>   org-plus-contrib   20160509  installed Outline-based
>> notes management and organizer
>>
>
> Correct, both are the exact same stable 8.3.x versions; just that
> org-plus-contrib has the packages in contrib/ folder which the other does
> not have.
>
> Also installing just org-plus-contrib should suffice. You do not need to
> install both. If you are not using any package from the contrib/ area (
> http://orgmode.org/cgit.cgi/org-mode.git/tree/contrib/lisp?h=maint ), you
> do not need org-plus-contrib, and you can use just the org package.
>
> But the mystery is still unresolved for me.. why did #+BEGIN_EXPORT syntax
> work for you .. May be someone else more knowledgeable can answer that.
> -- 




Re: [O] Bug: org -> org export ignores latex blocks [8.3.4 (8.3.4-50-g83e373-elpaplus @ /home/andrea/.emacs.d/elpa/org-plus-contrib-20160509/)]

2016-05-12 Thread Andrea
I think I saw that, but I did not read it carefully. And since the
autocompletion (I mean <l+TAB) still gives me the #+BEGINE_LaTex it did
not occur to me that may be the problem.

By the way, I did not clone the git repo, so I should be on the master
published on ELPA. When I give org-version in emacs I get:
Org-mode version 8.3.4 (8.3.4-50-g83e373-elpaplus @
/home/andrea/.emacs.d/elpa/org-plus-contrib-20160509/)

On package-list-packages I have

  org20160509  installed Outline-based notes 
management and organizer
  org-plus-contrib   20160509  installed Outline-based notes 
management and organizer

For the first one I get:
org is an installed package.

 Status: Installed in `~/.emacs.d/elpa/org-20160509/',
 shadowing a built-in package (unsigned).
Archive: n/a
Version: 20160509
Summary: Outline-based notes management and organizer
Other versions: 20160509 (org), 20160509 (gnu), builtin.

[back]

and the second:

org-plus-contrib is an installed package.

 Status: Installed in `~/.emacs.d/elpa/org-plus-contrib-20160509/' 
(unsigned).
Archive: n/a
Version: 20160509
Summary: Outline-based notes management and organizer
Other versions: 20160509 (org).

[back]

Do you think my configuration is messed up?
Thanks,

Andrea

Kaushal Modi <kaushal.m...@gmail.com> writes:

>
> But I am surprised that that fix applied to your org-plus-contrib version.
>
> It applies only to the version built from the master branch. Is
> org-plus-contrib the only version that you have installed? Or do you have
> multiple versions of org installed, including the one from org git?
> -- 




Re: [O] Bug: org -> org export ignores latex blocks [8.3.4 (8.3.4-50-g83e373-elpaplus @ /home/andrea/.emacs.d/elpa/org-plus-contrib-20160509/)]

2016-05-12 Thread Andrea
Hello,

thanks for the fast reply. It actually works with the new syntax, thank
you!
There is a minor thing though: when I export a #+BEGIN_export latex to
an org buffer, it exports to #+BEGIN_export (without the latex). Maybe
this is a bug?
Thanks,

Andrea

P.S: I did not know about these changes, I will look forward for them!

John Hendy <jw.he...@gmail.com> writes:

> Ah. I always wondered about that since the change is reported for 9.0
> but it's in effect for me on:
>
> Org-mode version 8.3.4 (release_8.3.4-753-gda4db33 @ ~/.elisp/org/lisp/)
>
> But I've obviously built from git. Simple case would be for Andrea to
> just try it and let us know :) Other than that, I'd defer to Nicholas
> to say whether or not this should be going on.
>
>
> Thanks for the clarification,
> John
>
> On Thu, May 12, 2016 at 1:57 PM, Kaushal Modi <kaushal.m...@gmail.com> wrote:
>> On Thu, May 12, 2016 at 2:53 PM John Hendy <jw.he...@gmail.com> wrote:
>>>
>>> I believe this is due to the new syntax change for export blocks
>>> announced a bit back. See:
>>> - http://orgmode.org/cgit.cgi/org-mode.git/plain/etc/ORG-NEWS
>>>
>>> Try this instead:
>>>
>>> * Hello
>>> #+BEGIN_export latex
>>> hi I am latex
>>> #+END_export
>>
>>
>> I was going to say the same but then I saw that Andrea is using an
>> org-plus-contrib version. The new syntax would go in effect in org 9.0 or
>> for someone using org built from the master branch.
>>
>> It should not affect users using org from maint branch or
>> org/org-plus-contrib from Org Elpa.
>> --
>>
>> --
>> Kaushal Modi




[O] Bug: org -> org export ignores latex blocks [8.3.4 (8.3.4-50-g83e373-elpaplus @ /home/andrea/.emacs.d/elpa/org-plus-contrib-20160509/)]

2016-05-12 Thread Andrea

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


Hello,

I am a great fan of org mode, so thanks a lot for maintaining this wonder!

The problem:

when I try to export an org file to an org buffer/file, LaTex blocks are
removed:

the org file
---
* Hello
#+BEGIN_LaTeX
hi I am latex
#+END_LaTeX
---
becomes
---
# Created 2016-05-12 Thu 17:45
#+TITLE: 
#+AUTHOR: Andrea
* Hello
---

The export to html deletes these blocks as well.
Packages as ox-pandoc and org-pandoc use this functionality,
and so fail the export as well.
Hope this can be solved easily.
Thanks,

Andrea

Emacs  : GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.3)
 of 2016-05-05 on arojas
Package: Org-mode version 8.3.4 (8.3.4-50-g83e373-elpaplus @ 
/home/andrea/.emacs.d/elpa/org-plus-contrib-20160509/)

current state:
==
(setq
 org-pandoc-epub-rights "Copyright 2016  <>"
 org-tab-first-hook '(org-hide-block-toggle-maybe 
org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-html-format-drawer-function '(lambda (name contents) contents)
 org-log-done t
 org-latex-format-inlinetask-function 
'org-latex-format-inlinetask-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-latex-pdf-process '("texi2dvi -p -b -V %f")
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-default-notes-file "~/org/notes.org"
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function '(lambda (name contents) contents)
 org-from-is-user-regexp nil
 org-loop-over-headlines-in-active-region 'start-level
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[nil "\300\301\302\303\304$\207" [org-add-hook 
change-major-mode-hook org-show-block-all append local] 5]
 #[nil "\300\301\302\303\304$\207" [org-add-hook 
change-major-mode-hook org-babel-show-result-all append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes 
turn-on-flyspell org-eldoc-load)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-ascii-format-drawer-function '(lambda (name contents width) contents)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point 
org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-plantuml-jar-path "/home/andrea/.emacs.d/plantuml.jar"
 org-babel-tangle-lang-exts '(("haskell" . "hs") ("ruby" . "rb") ("python" . 
"py") ("java" . "java") ("ocaml" . "ml")
  ("emacs-lisp" . "el") ("elisp" . "el"))
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-html-format-headline-function 'org-html-format-headline-default-function
 org-babel-load-languages '((ocaml . t) (java . t) (sh . t) (python . t) (ruby 
. t) (haskell . t) (plantuml . t))
 org-html-format-inlinetask-function 
'org-html-format-inlinetask-default-function
 org-agenda-files '("~/myTasks.org")
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )



Re: [O] #+BEGIN_SRC mail and org-src-fontify-natively

2014-12-21 Thread Andrea Rossetti
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Hello,

 Andrea Rossetti andrea.rosse...@gmail.com writes:
   when I start emacs -Q and do the following recipe:

 1) open the test file prova.org (see attach)
 2) confirm at the file-local variable prompt, by typing y
 3) quit with C-x C-c 

 then Emacs unexpectedly asks for a confirm to save the
 modified buffer org-src-fontify:mail-mode, even if I took care
 to avoid any editing between steps 2) and 3).

 I cannot reproduce it on development branch. It may have been fixed.

  Hello Nicolas and everyone else reading. Sorry for the late reply, it
took some time and edebugging for me to understand the problem.

  1) in summary: it was a mail-mode fault, not Org's. Or better:
 it was my fault, not knowing in depth mail-mode.

  2) in detail: when you create a #+BLOCK_SRC mail and fontify it with
 M-x org-src-fontify-block RET, a buffer is created with name
  org-src-fontify:mail-mode (notice the initial space character).
 This buffer usually have a buffer-local variable
 `buffer-offer-save' set to nil, but mail-mode forces it to t. That
 doesn't seem a wrong workflow: you don't accidentally lose the mail
 you just composed.

  3) lesson learnt: you can't fontify whatever you want in a SRC block.
 Some modes work perfectly, some don't, some almost work (like
 mail-mode).

  4) future plans: I'm now curious and I'll probably try fontification
 of whatever mode I can think of (M-x apropos RET -mode$ RET) :)

Thanks for your time and attention, kindest regards.

Andrea



[O] #+BEGIN_SRC mail and org-src-fontify-natively

2014-12-03 Thread Andrea Rossetti
Hello Org users,

  when I start emacs -Q and do the following recipe:

1) open the test file prova.org (see attach)
2) confirm at the file-local variable prompt, by typing y
3) quit with C-x C-c 

then Emacs unexpectedly asks for a confirm to save the
modified buffer org-src-fontify:mail-mode, even if I took care
to avoid any editing between steps 2) and 3).

  The unexpected confirm is not asked if the same recipe is replayed
with a modified prova.org, where org-src-fontify-natively has been
set to nil instead of t.

  May I please ask: it's reproducible for you as well? any clue on
how to suppress that annoying confirm? Thanks in advance for your
suggestions.

  Another minor issue is that To: and Subject: aren't fontified
if the mail text is indented by two spaces (typically added by default
if you edit the block by typing C-c '). Not a big deal, just to let
you know. One could just avoid using C-c ' and align the mail text
at left side. The issue is visible in the buffer window, but
HTML export is not affected, it works fine.

  Thanks for reading, kindest regards.

  Andrea




Re: [O] #+BEGIN_SRC mail and org-src-fontify-natively

2014-12-03 Thread Andrea Rossetti
Andrea Rossetti andrea.rosse...@gmail.com writes:

 Hello Org users,

   when I start emacs -Q and do the following recipe:

 1) open the test file prova.org (see attach)

Apologies for the missing attach. prova.org is attached here:

#+BEGIN_SRC mail
To: andrea.rosse...@gmail.com
Subject: blah

Dear friends, blah blah..
#+END_SRC

# Local Variables:
# org-src-fontify-natively: t
# End:


Re: [O] Make * bold?

2014-10-13 Thread Andrea Rossetti
Rainer M Krug Rainer at krugs.de writes:
 I would like to make three stars bold - is this possible? I have the
 following table and at the moment, I get what is in the latex
 column. But I would like to have what is in the last column.
 
 | org | latex| what I would like |
 | *3.96e-21 *** * | \textbf{3.96e-21 **} *   | \textbf{3.96e-21 ***} |
 ...
 
 Any suggestions?

Hi! using the pretty entity \ast{} works for me in HTML and PDF:

| *3.96e-21 \ast{}\ast{}\ast{}*  |

Does it work for you too? Regards, Andrea




Re: [O] Babel evaluation of Calc block not working, bug in Calc?

2014-10-06 Thread Andrea Rossetti
Hi Dieter,

die...@duenenhof-wilhelm.de (H. Dieter Wilhelm) writes:
 PS: Are you using Calc regularly?

Compact answer: no :(

Detailed answer: I do like Calc and Org+Babel+Calc,
but my daily job doesn't involve any maths.

The Org functions I use most frequently are:
- org-clock-in, org-clock-out, agenda view
- org-columns
- simple exports of TODOs or clocktable in HTML
  or PDF format

Kindest regards,

  Andrea



Re: [O] Clocktable language customization not working as expected

2014-10-06 Thread Andrea Rossetti
Axel Kielhorn org-m...@axelkielhorn.de writes:

 Clocktable language: not working

 #+BEGIN: clocktable :maxlevel 2 :scope file :lang fr
 #+CAPTION:  [2014-10-04 Sat 09:09]
 | ||  |
 |-++--|
 | *nil*   | *0:31* |  |
 |-++--|
 | Gesamtarbeitszeit   |   0:31 |  |
 | \emsp Projekt 12301 || 0:03 |
 | \emsp Projekt 12302 || 0:28 |
 #+END:


Not an exhaustive answer, but hope it helps: it works
for me if I change :lang fr into :lang fr. Same for you?
Kindest regards, Andrea



Re: [O] Improved way to include some headlines from an external org file

2014-10-01 Thread Andrea Rossetti
Xavier Garrido xavier.garr...@gmail.com writes:
 Thanks for the follow-up. Actually I am waiting this patch
 http://article.gmane.org/gmane.emacs.orgmode/90932/match=include+resolve+links
 to be pushed by Rasmus (see the comment in the endlessparentheses

Ahem... sincere apologies for the noise. I got confused by
those words resolve links in the topic title, it sounded
like a HTML-specific thing. Kindest regards, Andrea



Re: [O] Improved way to include some headlines from an external org file

2014-09-30 Thread Andrea Rossetti
Xavier Garrido xavier.garr...@gmail.com writes:
 Is there a way ...
...
 to write something like that
...
 #+BEGIN_SRC org
 #+INCLUDE: ./base.org :headline First base chapter
 ,* A more personal chapter
 #+INCLUDE: ./base.org :headline Second base chapter
 ,* Another personal chapter
 #+END_SRC

Hi! today I crossed into Sacha's weekly links
( http://sachachua.com/blog/#post-27515 ).

One of the proposed link suggests a solution not too far
from your initial question:

http://endlessparentheses.com/updating-org-mode-include-statements-on-the-fly.html?source=rss

Kindest regards, 

  Andrea



Re: [O] Babel evaluation of Calc block not working, bug in Calc?

2014-09-29 Thread Andrea Rossetti
Andrea Rossetti andrea.rosse...@gmail.com writes:
 3) temporary workaround: try to change :var v=3 into :var var-v=3,
 it works for me, does it work for you too?

I'm afraid I've been a bit cryptic here.
The suggested workaround/test is: replace

#+BEGIN_SRC calc :var v=3
 v + 4
#+END_SRC

with

#+BEGIN_SRC calc :var var-v=3
 v + 4
#+END_SRC

Kindest regards, 

  Andrea



Re: [O] Babel evaluation of Calc block not working, bug in Calc?

2014-09-28 Thread Andrea Rossetti
die...@duenenhof-wilhelm.de (H. Dieter Wilhelm) writes:
 But now we are getting: byte-code: Symbol's function definition is void:
 v!

 #+BEGIN_SRC calc :var v=3
 v + 4
 #+END_SRC


Hello Dieter, I think I got it!

1) I see the same error message as you see, for variables with
name v or var

2) diagnosys: I see that Calc tries to avoid name collisions by
adding a var- prefix to variable names, and by removing it when
it needs to. (see code in functions calc-read-var-name and
calc-var-name)

3) temporary workaround: try to change :var v=3 into :var var-v=3,
it works for me, does it work for you too?

4) proposed correction (untested, and makes sense only if workaround 
actually works): in ob-calc.el, function org-babel-execute:calc,
the invocation of calc-store-into could prepend 'var- to its argument

5) warning: if one applies correction 4), then workaround 3) doesn't
work anymore 

  Hope it helps and makes sense for you too, kindest regards.

 Andrea





Re: [O] user-error: Not at a block -- how to debug?

2014-09-15 Thread Andrea Rossetti
Eric S Fraga e.fraga at ucl.ac.uk writes:
 
  user-error: Not at a block
 ...
 
 Can anybody please suggest how to debug this?
Does this work?

M-x debug-on-entry RET user-error RET 





[O] trying to add hline refs (@I$2) in lhs of formulae

2014-09-14 Thread Andrea Rossetti
Hello Org users,

  this example:

|   | |   |
|---+-+---|
|   | |   |
|---+-+---|
|   | |   |
#+TBLFM: @I$2='(random 1000)

  works incorrectly for me (Org 8.2.7c from ELPA, Emacs 24.3,
Win7): C-c C-c on the #+TBLFM line updates four cells
(@2$1, @2$2, @3$1, @3$2) instead of one (expected response:
update of @2$2 only).

  I crafted a tiny change for my org-table.el to assign 1x1 cell
addresses @I$2, @III-2$4... in the left-hand side of table formulae. 
The diff file is attached here:

*** c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140908/org-table-original.el	Sat Sep 13 16:54:54 2014
--- c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140908/org-table.el	Sun Sep 14 23:39:13 2014
***
*** 3216,3221 
--- 3216,3231 
 ((string-match ^@-?[-+0-9]+\\$-?[0-9]+$ lhs)
  	;; This just refers to one fixed field
  	(push e res))
+((string-match ^@\\(I+\\)\\(\\([-+]\\)?\\([0-9]+\\)\\)?\\(\\$-?[0-9]+\\)$ lhs)
+ 	;;		   1	   2  3		 4		5
+ 	;; This just refers to one field with hline-based row fixed column
+ 	(let*
+ 	(
+ 	 (m1   (match-string 1 lhs))
+ 	 (m2   (match-string 2 lhs))
+ 	 (m5   (match-string 5 lhs))
+ 	 (m1m2line (org-table-line-to-dline (org-table-get-descriptor-line (concat m1 m2)
+ 	  (push (cons (format @%d%s m1m2line m5) (cdr e)) res)))
 ((string-match ^[a-zA-Z][_a-zA-Z0-9]*$ lhs)
  	;; This just refers to one fixed named field
  	(push e res))

  May I please ask for some feedback to Org users who installed Org
from ELPA: if you apply the diff, does example-hline-refs.org work
properly (i.e. formula recalculation updates only cell @2$2)?
Does it work good also for other values like @II-1$2, @I+1$1 etc.?

  Thanks in advance for any feedback you may provide, kindest regards.

  Andrea


  PS1: 1xN ranges like @I, @I+1 aren't managed by the proposed
tiny change. Another (similar) tiny change would be needed in order
to support them.

  PS2: if you want to test the diff without messing your Org
installation, you might simply...

 - open org-table.el
 - copypaste the additional code into function org-table-expand-lhs-ranges
 - reevaluate the (defun org-table-expand-lhs-ranges ...) statement with
   C-x C-e
 - kill the org-table.el buffer without saving the file
 - play again with example-hline-refs.org

  PS3: I believe the change will not work for Org versions
installed from git master, because at some point in org table
there's a code check forbidding hline refs:

(if (string-match ^@-?I+ (car x))
(user-error Can't assign to hline relative reference))

  Motivations for that code check were discussed here:
http://thread.gmane.org/gmane.emacs.orgmode/71562 ,
I hope the proposed diff could make the check unnecessary
or less strict in the future.


Re: [O] Improved way to include some headlines from an external org file

2014-09-11 Thread Andrea Rossetti
Xavier Garrido xavier.garr...@gmail.com writes:
 Of course, I can achieve that by using =:lines= and calculating how many 
 lines embeds the given headline. 

  Hi Xavier, another possible approach (maybe less handy, but in
some cases it might fit): the user could keep one .org file
per headline, and #+INCLUDE one headline (= one entire file)
when needed.

  Kindest regards,

Andrea



[O] Bug: (org-babel-result-names) should not return nil [8.2.7c (8.2.7c-1-gf5065b-elpa @ c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140804/)]

2014-09-03 Thread Andrea Rossetti

Hello everyone,

  if I create this org example: 

#+NAME: blah
#+BEGIN_SRC emacs-lisp :exports results
  (+ 2 3)
#+END_SRC

#+RESULTS: blah
: 5


  I can't execute the command

M-x org-babel-goto-named-result RET blah RET

  because blah is not listed in the available
choices.

  The problem seems to boil down to this function:

M-S-; (org-babel-result-names) RET

  I would expect two results in the message mode line,
but I only get a nil. 

  I explored function org-babel-result-names in ob-core.el,
the body contains a (match-string 4) but I believe it
should be changed into (match-string 6).

  If I apply that change, (org-babel-result-names) returns
two results, and org-babel-goto-named-result provides the
expected choice (just blah in the example).

  Is it reproducible for you as well? Does it make sense
for you too? Kindest regards,

Andrea


Re: [O] Table formula with @I

2014-09-02 Thread Andrea Rossetti
Charles Millar mill...@verizon.net writes:
 I must be missing something. When I recalculate the table (update
 table) applying both above TBLFM's - on the line to be updated, in the
 TBLFM line, and in the table itself, an error is returned

 can't assign to hline relative reference

 Org-mode version 8.3beta (release_8.3beta-304-ga4a1d8 @
 c:/cygwin/home/Charlie01/.elisp/org-mode/lisp/)
 GNU Emacs 24.3.1 (i386-mingw-nt6.0.6002) of 2013-03-17 on MARVIN
 Windows Vista SP2


It works on my Org version (8.2.7c from ELPA). After a bit of
digging I found that:

  - the can't assign to hline relative reference message was
added by commit a2c71a6e359cb93aa652f65c666294fb2a3b5e1b
dated Nov 5th, 2013

  - motivations for that patch have been discussed here:
http://thread.gmane.org/gmane.emacs.orgmode/71562
 
  - so I think I suggested something undocumented/unsupported
that can't be used anymore, sorry :(

  - I'd like to express it as a wish for the future: support for
hline references (@I) in the left side of the formula
would be a great feature (and it already seemed to work
in some special cases, like @I+1$1..@I+1$1)

Kindest regards,

  Andrea



Re: [O] Table formula with @I

2014-09-01 Thread Andrea Rossetti
Loris Bennett loris.benn...@fu-berlin.de writes:
 In the following:

 |   |   |   |
 |   |   |   |
 |---+---+---|
 | 1 | 1 | 1 |
 #+TBLFM: @I$3=1

 I expected to get a '1' just in the third column.  Where am I going
 wrong?

(apologies in advance for suggesting just a workaround
instead of a rational explanation, hope it helps anyway)

It happened to me too some time ago, I used a slightly
different formula and it worked:

#+TBLFM: @I+1$3..@I+1$3=1

Does it work for you too? Kindest regards,

  Andrea



Re: [O] A Babel block to #+INCLUDE all .org files of a directory

2014-09-01 Thread Andrea Rossetti
Andrea Rossetti andrea.rosse...@gmail.com writes:
   I wrote a Babel block to generate the #+INCLUDE statements
 for all Org files of a directory.

 https://github.com/thesoftwarebin/the-emacs-software-bin/tree/master/include-all-org-files

Hello Org users,

  just in case you try to visit the link of that script
for multiple #+INCLUDE files: I renamed it into

https://github.com/thesoftwarebin/the-emacs-software-bin/tree/master/include-many-files

because now the user can specify inclusion of files
with any extension (see example/main.org).

Kindest regards,

  Andrea



[O] A Babel block to #+INCLUDE all .org files of a directory

2014-08-30 Thread Andrea Rossetti
Hi Org users,

  I wrote a Babel block to generate the #+INCLUDE statements
for all Org files of a directory.

  Nothing spectacular: not recursive through directories,
only .org files ... but I wanted to share it, just in case
someone finds it helpful. Source code and usage example
are available here:

https://github.com/thesoftwarebin/the-emacs-software-bin/tree/master/include-all-org-files

(GitHub renders Org files as html, so be sure to click the Raw button
in order to see #+BEGIN_SRC, #+END_SRC and #+COMMENTS)

  Opinions, corrections and enhancements are of course
more than welcome. Kindest regards,

  Andrea




Re: [O] A Babel block to #+INCLUDE all .org files of a directory

2014-08-30 Thread Andrea Rossetti
Hello,

Grant Rettke g...@wisdomandwonder.com writes:
 May you please discuss your use case that motivated this code?

  typical usage scenarios could be:

  1) write a book of many chapters, one main.org file
 and many second-level .org files, one file per chapter,
 and you don't want to manually write all the #INCLUDEs:

  main.org
chapter01-the-intro.org
chapter02-another-day-another-story.org
chapter03-bad-day-emacs-froze-again.org
...
chapter47-end.org

  2) write some reference manual (example: my_c_manual.org)
 that includes many .org files, every one of them shows usage
 and examples of a language keyword or library function:

  my_reference_manual.org
abs.org
...
printf.org
strcpy.org

  Thanks to everyone for whatever feedback, kindest regards.

  Andrea



Re: [O] A Babel block to #+INCLUDE all .org files of a directory

2014-08-30 Thread Andrea Rossetti
Andrea Rossetti andrea.rosse...@gmail.com writes:
   my_reference_manual.org
   abs.org
   ...
   printf.org
   strcpy.org

sorry for the typo, I meant:

  my_c_manual.org
abs.org
...
printf.org
strcpy.org



Re: [O] Worg Tutorial error: using Emacs lisp as formulas

2014-08-27 Thread Andrea Rossetti
Hello Ciaran,

  given your example:

 | Col1 | Col2 | Col3 | Col4 | Col5 |
 |--+--+--+--+--|
 | a| a| :='(mapconcat 'identity (delete-dups (list @2$1..@$1 
 @2$2..@$2))  ) | b|  |
 | b| a|  |  |  |
 | c| d|  |  |  |
 #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@$1 
 @2$2..@$2))  )

  I confirm I see your same hitting C-c C-c in the cell containing the
  formula. My setup is:

  - Org 8.2.7c
  - GNU Emacs 24.3.1 (i386-mingw-nt6.1.7600) of 2013-03-17 on MARVIN
  - Win 7

  Further observations I collected are:

  1) if I use II-1 instead of  in the formula
 (though it's not exactly the same) it works properly.

  2) I tried to reduce the test case to a simpler formula:
 for example :='(length (list @2$1..@$1)) gave me
 another, maybe more helpful error message:

 user-error: Spreadsheet error: invalid reference
 '(length (list @2$1..@$1))

toggle-debug-on-error did not work for case 2) because
it's a catched error condition. Some random debugging 
made me think the problem lies in (or around) function
`org-table-get-range'. 

  Kindest regards,

  Andrea
 
  



Re: [O] Worg Tutorial error: using Emacs lisp as formulas

2014-08-27 Thread Andrea Rossetti
Ciaran Mulloy crmul...@gmail.com writes:
 Inserting the following as a field formula in location @2$3:   
 :='(mapconcat 'identity (delete-dups (list @2$1..@$1 @2$2..@$2))  ) 
 and doing a C-c or a C-u-C-c C-c generates an 'Invalid regexp: Regular 
 expression too big' error.
 
 It seems that I can reliably reproduce a bug that I haven't been able to 
 find on forums and that most other people have difficulty replicating. 
 If I've done something to my installation of emacs I'd love to find out 
 what has caused the problem.

 Is there a way of determining what could be my issue?

Hello Ciaran,

  long story short: digging in org-table.el I noticed
that functions f1=`org-table-formula-handle-first/last-rc'
and f2=`org-table-formula-substitute-names' were used
sometimes like this: (f2 (f1 x)), and sometimes
like this: (f2 x). 

  I conjecture it should always be (f2 (f1 x)), so I applied
to my org-table.el, reloaded its definitions with `eval-buffer'
and... it worked! 

  File formula.diff attached here shows the exact changes
that I applied on my org-table.el. (if you try formula.diff
and it works for you, beware that you need to remove or recompile
the old org-table.elc file). 

diff -c -L c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140804/org-table.el -L #buffer org-table.el c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140804/org-table.el c:/Users/andrea/AppData/Local/Temp/buffer-content-3236IUh
*** c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140804/org-table.el
--- #buffer org-table.el
***
*** 2600,2606 
  	(unless (string-match \\S- fmt)
  	  (setq fmt nil
(if (and (not suppress-const) org-table-formula-use-constants)
! 	  (setq formula (org-table-formula-substitute-names formula)))
(setq orig (or (get-text-property 1 :orig-formula formula) ?))
(while ( ndown 0)
  	(setq fields (org-split-string
--- 2600,2606 
  	(unless (string-match \\S- fmt)
  	  (setq fmt nil
(if (and (not suppress-const) org-table-formula-use-constants)
! 	  (setq formula (org-table-formula-substitute-names (org-table-formula-handle-first/last-rc formula
(setq orig (or (get-text-property 1 :orig-formula formula) ?))
(while ( ndown 0)
  	(setq fields (org-split-string
***
*** 3767,3773 
(if (eq what 'name) (setq var (substring match 1)))
(when (eq what 'range)
  	(or (equal (string-to-char match) ?@) (setq match (concat @ match)))
! 	(setq match (org-table-formula-substitute-names match)))
(unless local
  	(save-excursion
  	  (end-of-line 1)
--- 3767,3773 
(if (eq what 'name) (setq var (substring match 1)))
(when (eq what 'range)
  	(or (equal (string-to-char match) ?@) (setq match (concat @ match)))
! 	(setq match (org-table-formula-substitute-names (org-table-formula-handle-first/last-rc match
(unless local
  	(save-excursion
  	  (end-of-line 1)

Diff finished.  Thu Aug 28 01:17:44 2014

  Hope it may be of some help, kindest regards.

  Andrea


[O] Feature request: copy cell contents into kill ring

2014-08-11 Thread Andrea Rossetti

Hello everone,

  copying a table cell (C-c C-x M-w) uses a private clipboard, as stated
by the `org-table-copy-region' docstring. Sometimes it's handy to paste
a cell's text into something that isn't an org-table (my use case was:
record a macro to perform some silly updates in bbdb, once per table row).

  My quick-and-dirty solution was the following:



bin5FXj1pWhDr.bin
Description: application/emacs-lisp

  but I believe a copy cell to kill ring would be a nice Org feature
to add (maybe bound to C-u C-c C-x M-w). Before digging any further,
may I please ask for opinions and advice: would it make sense for you
too? not worth it? or is this already possible with some different
keystroke?

  Thanks in advance, kindest regards.

  Andrea


[O] Bug: org src block folds partially [8.2.6 (8.2.6-67-g9e09b2-elpa @ c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140602/)]

2014-07-31 Thread Andrea Rossetti
Hi guys, I think I found a problem in folding a BEGIN_SRC block.
When I:

  - create a BEGIN_SRC org block (let's call it the external
BEGIN_SRC)
  - hit C-c ' to edit its contents
  - create two consecutive, non-nested BEGIN_SRC org blocks
(let's call them the internal BEGIN_SRCs)
  - hit C-c ' to return back to the main org buffer
  - hit TAB on the external BEGIN_SRC to fold the whole block

then the folding happens only for the first internal BEGIN_SRC block.
Tentative guess: I suppose #+END_SRC is used as a regexp by the fold
procedure, while something like [^,]#+END_SRC could be more appropriate.

  Can anyone please confirm if the described issue is reproducible?
(if your answer is yes, but you think it's a very minor problem:
I agree with you, it's just better if we know it :)

  Thanks for your attention, kindest regards.

  Andrea


PS: a test case file is attached here:

#+BEGIN_SRC org
  ,#+BEGIN_SRC org
block1
  ,#+END_SRC

  ,#+BEGIN_SRC org
block2
  ,#+END_SRC

#+END_SRC

Emacs  : GNU Emacs 24.3.1 (i386-mingw-nt6.1.7600)
 of 2013-03-17 on MARVIN
Package: Org-mode version 8.2.6 (8.2.6-67-g9e09b2-elpa @ 
c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140602/)



Re: [O] Bug: syntax highlighting of elisp:blahblah and shell:blablah [8.2.6 (8.2.6-67-g9e09b2-elpa @ c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140602/)]

2014-07-21 Thread Andrea Rossetti
Nick Dokos ndo...@gmail.com writes:
 I don't know whether it's expected (one of these years I really have
 to sit down and learn the syntax).

  I digged a bit further about the linkification
of shell:bla and elisp:bla (the same applies
to all protocols listed in `org-link-types'):

  - this type of links is defined by the syntax (see plain link in
defcustom `org-activate-links')
  - syntax seems not to consider the corner-case of tags shell:bla
  - the unwanted link inhibits the function click on tags = do a search by 
tags
  - my workaround: I won't use `elisp' and `shell' in the tags, but `el' and 
`sh'
  - possible actions could be:
- change the syntax (backward-incompatible): the regexp for plain
  links should not allow for : delimiters
- or (backward-compatible) change `org-activate-plain-links' so that
  a plain link is not activated if it's inside a tag
- or (backward-compatible) leave everything as it is now,
  as it's a minor bug (note that the tag search with C-c \
  works properly, the problem is just that you can't
  start a search with a mouse click)
  
  Kindest regards,

Andrea



[O] Bug: syntax highlighting of elisp:blahblah and shell:blablah [8.2.6 (8.2.6-67-g9e09b2-elpa @ c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140602/)]

2014-07-20 Thread Andrea Rossetti

Hi all,

  when I insert some text like elisp:sometext or shell:sometext
in an Org buffer, it becomes highlighted and clickable. On click,
a prompt asks for confirm to execute sometext.

  I get the same behaviour if I add tags to a headline, and one
of the tags is elisp or shell.

  I expected this behaviour when I create links with double square
brackets, but not in default text paragraphs, nor in the tags.
May I please ask for some feedback:

1) did I miss something, and this was expected (at least for default
   text paragraphs)?
2) is this reproducible for some of you as well?

  I attach here a small test case:

* my elisp tricks collection:elisp:andrea:tricks:

I like to write elisp:it is useful.
I seldow use shell:but it's useful as well

  Thanks in advance, kindest regards.

Andrea

Emacs  : GNU Emacs 24.3.1 (i386-mingw-nt6.1.7600) of 2013-03-17 on MARVIN
Package: Org-mode version 8.2.6 (8.2.6-67-g9e09b2-elpa @ 
c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140602/)


Re: [O] Org Export Latex Hyperref Options Format

2014-06-29 Thread Andrea Rossetti
Joseph Vidal-Rosset joseph.vidal.ros...@gmail.com writes:
 How can I remove this old built-in Org shadowed
 by my new Elpa Org ? It seems to me that it should be the best
 solution,

  That time I thought life is too short to mess with it :) and simply
ignored that zombie option; it's rare that an option is removed, so
I never faced the same problem again.

  If you still want to try, I guess the built-in Org could be removed
by deleting the elisp code from the directory youremacspath/lisp/org.

  Cheers,

Andrea



Re: [O] Org Export Latex Hyperref Options Format

2014-06-28 Thread Andrea Rossetti
Joseph Vidal-Rosset joseph.vidal.ros...@gmail.com writes:

 Hello,
 I meet problems to customize this variable via M-x customize-variable :
 Org Export Latex Hyperref Options Format
 I mean that the hypersetup options do not change in my .tex file after the
 export from an org-file.

 Does it correspond  to a bug?

Hello Joseph,

  I had the same problem some time ago. That variable
has been removed in recent Org versions, and you
probably have (like me) an old built-in Org shadowed
by a new Elpa Org. You should ignore that variable.

See previous discussion and some advices here:

http://permalink.gmane.org/gmane.emacs.orgmode/77193
http://permalink.gmane.org/gmane.emacs.orgmode/77241

Kindest regards, Andrea



Re: [O] problems while editing in org-columns mode

2014-05-31 Thread Andrea Rossetti
Bastien b...@gnu.org writes:

 Let me know if it works for you, 

  Hi! I tried a recent git snapshot (Fri May 30 19:28:04
2014 +0200) and performed some manual tests (1 to 5, see
below).

- in org-columns mode (C-c C-x C-c):

  - 1) PASS: org-columns-edit-value (e) updates correctly the
empty/whitespace string

- in normal org-mode (i.e. not org-columns mode):

  - 2) PASS: org-set-property (C-c C-x p) and
   org-set-property-and-value (C-c C-x P) update
   correctly the empty/whitespace string

  - 3) FAIL: when using org-set-property or org-set-property-and-value
   interactively, tab autocompletion for the Property:  prompt
   can't find the name of property X if the old value of X was an
   empty/whitespace string
  
  - 4) FAIL: org-delete-property (M-x org-delete-property) commands
   skips/ignores a property name if the value is empty/whitespace string

  I think that commit 822dcfc881a5df3249fcecf4b7bc71ee9c321b92 addressed
the tests 1) and 2) and they pass, so I'd say the commit is OK.

  The tests 3) and 4) pass if I use the following (naive,
demonstrative-only, just-to-give-the-idea) patch:

diff --git a/lisp/org.el b/lisp/org.el
index d645897..a772743 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15530,7 +15530,7 @@ things up because then unnecessary parsing is avoided.
 	   (setq range (org-get-property-block beg end))
 	   (when range
 	 (goto-char (car range))
-	 (while (re-search-forward org-property-re
+	 (while (re-search-forward (org-re-property .*? 'literal t)
    (cdr range) t)
 	   (setq key (org-match-string-no-properties 2)
 		 value (org-trim (or (org-match-string-no-properties 3) )))
@@ -15619,7 +15619,7 @@ If yes, return this value.  If not, return the current value of the variable.
 	(if (and range
 		 (goto-char (car range))
 		 (re-search-forward
-		  (org-re-property property)
+		  (org-re-property property nil t)
 		  (cdr range) t))
 	(progn
 	  (delete-region (match-beginning 0) (1+ (point-at-eol)))

  For curiosity I also tested a wrong-syntax input:

  - 5) if the user edits manually the :PROPERTIES: block and
   adds an empty-valued property (example: :prop1:) and he forgets
   to add at least one whitespace character after :prop1: then
   the tests 1)-2)-3)-4) fail

  I'd say: 5) is acceptable behaviour, but special care must
be taken by users that hand-edit empty-valued properties, as it's
easy to miss a whitespace while typing.

 and thanks for reporting this,

Thanks to you for your work on this one. Cheers,

  Andrea


Re: [O] problems while editing in org-columns mode

2014-04-24 Thread Andrea Rossetti

Hello Carsten and everyone else reading,

  yesterday I re-stumbled into the problem B described
below, and had a look at the Org sources. I think the solution
could be: if user sets a non-special property to  or nil,
then remove the property. 

  An example of a possible (non-bulletproof, test-only-intended)
patch for org-entry-put follows.

*** c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140422/org.el	Wed Apr 23 22:15:51 2014
--- c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140422/org.new.el	Thu Apr 24 12:40:49 2014
***
*** 15557,15562 
--- 15557,15563 
 ((member property org-special-properties)
  	(error The %s property can not yet be set with `org-entry-put'
  	   property))
+((equal value ) (org-delete-property property))
 (t ; a non-special property
  	(let ((buffer-invisibility-spec (org-inhibit-invisibility))) ; Emacs 21
  	  (setq range (org-get-property-block beg end 'force))

  Does it make sense for you too? Kindest regards,

  Andrea



Carsten Dominik carsten.domi...@gmail.com writes:

 Hi Andrea,

 I have fixed problem A.  Problem B has to do with the fact that the
 property search function does not find a property with an empty value.
 I need to look into this some more.

 - Carsten
 On Nov 22, 2013, at 8:30 PM, andrea.rosse...@gmail.com wrote:

...
 
 HOW TO REPRODUCE PROBLEM A:
 
 1) create an example Org file like this:
 
 * myproject
 ** mytask1
 ** mytask2
 
 2) click on the word myproject, C-c C-x C-c to enable
 column view
 
 3) M-S-right, then answer the wizard questions:
 property=cost, title=cost, width=8, summary=add_numbers
 
 4) now click on the word myproject, type q to leave
 org-columns mode
 
 5) you will see that in the first row of the buffer
 a new line appears:
 
 #+COLUMNS: %25ITEM %8cost %TODO %3PRIORITY %TAGS
 
  I expected %8cost{+} instead of %8cost. Even
 if f I change manually %8cost to %8cost{+} the
 automatic sums (cost of myproject sums cost of
 mytask1+mytask2) still don't work.
 
  The sums work properly if I remove the entire
 #+COLUMNS statement and add to the :PROPERTIES: of
 row myproject the following property:
 
 :COLUMNS: %25ITEM %8cost{+} %TODO %3PRIORITY %TAGS
 
 
 
 HOW TO REPRODUCE PROBLEM B:
 
 1, 2, 3) same steps than problem A
 
 4) go on row mytask1 column cost, type e to edit
 the value, set it to 1234, type RET
 
 5) type e and change the proposed value 1234 into
 the empty string, then type RET 
 
 6) type e and set the value to 3456, then type RET
 
 7) go on row mytask1, type TAB to see the properties:
 you will see that the properties are now:
 
   :PROPERTIES:
   :cost: 
   :cost: 3456
   :END:
 
 (I did not expect that empty :cost: column)
 


Re: [O] putting a element +UWa in table

2014-04-22 Thread Andrea Rossetti
Neal Becker ndbeck...@gmail.com writes:

 The first item in my table should say '+UWa'.  This seems to upset the
 org table gods, who draw a line through my entry.

 How do I put such an item in a table without org table misinterpreting it?

For curiosity I played a bit on this problem.
I got no exact solution, but here's what I found.
I guess they aren't exactly *cough* the most
didactic Org tricks ever... Cheers,

  Andrea


- Test1: shows overstrike on text (as per Org syntax)

| +UWa UWb+ |

- Test 2: shows + in buffer if org-toggle-pretty-entities
  is enabled, but produces bad HTML export (a subscript nil
  appears)

| \plus_{}UWa UWb\plus_{} |

- Test 3: looks OK for HTML, Latex, ASCII export

#+MACRO: myplus @@html:+latex:+ascii:+@@

| {{{myplus}}}UWa UWb{{{myplus}}} |



Re: [O] Warning when make in git

2014-03-27 Thread Andrea Rossetti
Rainer M Krug Rainer at krugs.de writes:

 
...
 | makeinfo --no-split org.texi -o org
 | org.texi:15: warning: unrecognized encoding name `UTF-8'.
 `
 
 Is this something in my setup? Should I worry?

My guess: could it be that you have an old version
of makeinfo/texinfo, not supporting UTF-8 for
@documentencoding in org.texi? Regards, Andrea




Re: [O] Warning when make in git

2014-03-27 Thread Andrea Rossetti
Rainer M Krug Rainer at krugs.de writes:

...
 This is the version info - I did not install an old one on my mac:
 
 ,
 | $ makeinfo --version
 | makeinfo (GNU texinfo) 4.8
 | 
 | Copyright (C) 2004 Free Software Foundation, Inc.
...

I guess the texinfo version is too old for UTF-8: you may see here below that 
UTF-8 is not mentioned, more recent versions have it:

http://www.nongnu.org/texi2latex/texinfo/documentencoding.html#documentencodi
ng

Regards, Andrea





Re: [O] Warning when make in git

2014-03-27 Thread Andrea Rossetti
On my Win7 + MSYS + MinGW + MikTex I found a texinfo 4.13 that compiled
without complaints about UTF-8. I suppose the problem is faced mostly by
Mac users.

Unfortunately I can't reproduce the problem here, so I have no clue about
the contents of the .info output...

Kindest regards, Andrea
Il giorno 27/mar/2014 15:36, Rainer M Krug rai...@krugs.de ha scritto:

 Andrea Rossetti andrea.rosse...@gmail.com writes:

  Rainer M Krug Rainer at krugs.de writes:
 
  ...
  This is the version info - I did not install an old one on my mac:
 
  ,
  | $ makeinfo --version
  | makeinfo (GNU texinfo) 4.8
  |
  | Copyright (C) 2004 Free Software Foundation, Inc.
  ...
 
  I guess the texinfo version is too old for UTF-8: you may see here below
 that
  UTF-8 is not mentioned, more recent versions have it:
 
 
 http://www.nongnu.org/texi2latex/texinfo/documentencoding.html#documentencodi
  ng

 OK - now to the next step: makeinfo 4.8 is part of Maverick (OSX) - so
 it should be not only me who sees this warning? Is this warning a
 problem or can it only result in UTF-8 characters not converted into
 texinfo files?

 Rainer


 
  Regards, Andrea
 
 
 
 

 --
 Rainer M. Krug
 email: Raineratkrugsdotde
 PGP: 0x0F52F982



Re: [O] dynamic block for ordered list of all clock intervals

2014-02-27 Thread Andrea Rossetti
Eric S Fraga e.fr...@ucl.ac.uk writes:

 Andrea Rossetti andrea.rosse...@gmail.com writes:
 
 wanted to see the chronological history of all
 the CLOCK intervals, i.e. no sums/aggregations
 by day/week.
 .

 I don't think anybody has answered.  Just for information, you can
 achieve pretty much what you wanted using the agenda: v c.  The clock
 view shows all clocked events for the particular period the agenda is
 displaying, whether day or week or year...  And it shows gaps if there
 are any during any given day (where the day start is customisable).

 I use this all the time.

Me too, from now on :-) Eric, sincerely thank you for
the directions. v c, v r and v l are the commands
I was looking for. Kindest regards, Andrea


 In the same view, you can of course add in the clock report with v
 r if you do want aggregation.



[O] dynamic block for ordered list of all clock intervals

2014-02-19 Thread Andrea Rossetti
Hello Org users,

  recently I had to clock several small tasks,
switching repeatedly from one to the other, and
wanted to see the chronological history of all
the CLOCK intervals, i.e. no sums/aggregations
by day/week.

  So I wrote a (first rough version of a) dynamic
block function for it, you may see it in this example:

https://raw.github.com/thesoftwarebin/the-emacs-software-bin/master/clock-history/clock-history.org

  May I please ask if that function reinvents
the wheel, i.e. if there's already a function
in Org to extract that same list.

  Thanks, kindest regards.

  Andrea




Re: [O] Feature request: filling of long captions

2014-02-06 Thread Andrea Rossetti

Hello Bastien and everyone reading,

Bastien b...@gnu.org writes:
 Could you list other options that are good candidates for such
 auto-filling fonctionality?  We'd better implement them all at
 once.

  I'd suggest to split the wish-list in two buckets, i.e. 

1) some #+... commands would benefit of a line-continuation
mechanism (like the backslash at EOL in a multilined C/C++
#define macro)

2) some line-continuation-aware #+... commands (thanks to
implementations for step 1) would benefit of auto-filling

  To me #+TBLFM seems to fit into bucket 1, #+CAPTION into
bucket 2. My Christmas wish is #+MACRO into bucket 1.

  Kindest regards,

  Andrea



Re: [O] [ANN, OT] Emacs web-server, a new option for serving Org-mode files

2014-01-15 Thread Andrea Rossetti

Eric Schulte schulte.e...@gmail.com writes:
 I've written an Emacs web-server [1], which may be used to interact with
 Org-mode over HTTP.  It has no dependencies aside from needing Emacs 24
 or later and it should be easy to install and use [2].

Thanks Eric for having shared this project. Unfortunately in my setup
(Emacs 24.3.1, Windows 7) I could not run even the first hello world.
If some Windows user has time and chance to try, may I please ask
if they run web-server successfully.

My attempt was to run emacs -Q and type:

--8---cut here---start-8---
(require 'cl)
(require 'ert)
(add-to-list 'load-path C:/Users/andrea/Desktop/emacs-web-server-master)
(require 'web-server)

(load-file ./examples/000-hello-world.el)
--8---cut here---end---8---

  While executing this script I received no errors, not even with
debug-on-error turned on. 

  I checked that my port 9000 is free before using it.

  When I launch Chrome/curl/wget, the connection is established
but it never terminates, and no output is delivered to client.

  Even M-x list-processes showed apparently correct output:
-
server  listen  --  --   (network server on local)
ws-server   listen  --  --   (network server on [0 0 0 
0 9000])
ws-server 1... open--  --   (network connection to 
127.0.0.1)
-

  Thanks for any hint/advice, kindest regards.

  Andrea



Re: [O] problem of accents with pdflatex export

2013-12-28 Thread Andrea Rossetti

Joseph Vidal-Rosset joseph.vidal.ros...@gmail.com writes:
 ... Is it a way to automatically save the .org
 file in utf8 ? In my emacs the encoding is utf8 by default.


  Sorry, I never customized file-coding-system-alist
and related variables, defaults worked well for me, so
unfortunately I don't have good hints... but please note
that in my simple environment (Win7 + Emacs 24.3 + Org 8.2.2-elpa
+ nearly zero customizations) I can export org to PDF with
àèìòù (Italian) without any need to specify encodings, it
just worked out-of-the-box.

I would suggest to investigate in these directions:

1) try to see what happens without customizations
   (maybe by running emacs -Q)

2) try to force utf8 on that specific org file, by saying in
the head line:
# -*- mode:org; your settings...; coding:utf-8 -*-

3) or alternatively:
# -*- mode:org; your settings...; coding:iso-8859-1 -*-

  Kindest regards, 

  Andrea



Re: [O] problem of accents with pdflatex export

2013-12-27 Thread Andrea Rossetti
Joseph Vidal-Rosset joseph.vidal.rosset at gmail.com writes:

 
 Hello,
 I do not succeed to solve this problem of accent with pdflatex : 
 

 Shot in the dark: could it be that the encoding of your
org file needs to be saved in utf8 in order to generate a utf8
latex file? Regards, Andrea 





[O] problems while editing in org-columns mode

2013-11-22 Thread andrea . rossetti

Hello everyone,

  I get some unexpected behaviour in org-column mode on my
workstation (Emacs 24.3, org-version 8.2.2, Win 7 64 bit).
May I ask support in order to understand:

- if this is reproducible for you as well
- if it is actually a bug, or a mess on my local installation,
  or if I misunderstood how to use org-column properly

  Thanks in advance to anyone patient enough to read this
and give it a try. Kindest regards, Andrea.




HOW TO REPRODUCE PROBLEM A:

1) create an example Org file like this:

* myproject
** mytask1
** mytask2

2) click on the word myproject, C-c C-x C-c to enable
column view

3) M-S-right, then answer the wizard questions:
property=cost, title=cost, width=8, summary=add_numbers

4) now click on the word myproject, type q to leave
org-columns mode

5) you will see that in the first row of the buffer
a new line appears:

#+COLUMNS: %25ITEM %8cost %TODO %3PRIORITY %TAGS

  I expected %8cost{+} instead of %8cost. Even
if f I change manually %8cost to %8cost{+} the
automatic sums (cost of myproject sums cost of
mytask1+mytask2) still don't work.

  The sums work properly if I remove the entire
#+COLUMNS statement and add to the :PROPERTIES: of
row myproject the following property:

:COLUMNS: %25ITEM %8cost{+} %TODO %3PRIORITY %TAGS



HOW TO REPRODUCE PROBLEM B:

1, 2, 3) same steps than problem A

4) go on row mytask1 column cost, type e to edit
the value, set it to 1234, type RET

5) type e and change the proposed value 1234 into
the empty string, then type RET 

6) type e and set the value to 3456, then type RET

7) go on row mytask1, type TAB to see the properties:
you will see that the properties are now:

   :PROPERTIES:
   :cost: 
   :cost: 3456
   :END:

(I did not expect that empty :cost: column)



[O] My howto for Org, japanese text and furigana

2013-11-18 Thread Andrea Rossetti
Hello everyone,

  by reading the suggestions from this list, I prepared
an example the Org headers one could use to write
Japanese in Org, with or without furigana signs.

  It's available at this address, under the furigana-example
section:

https://github.com/thesoftwarebin/the-emacs-software-bin

  It's there mainly as a reminder to myself, and it's obviously
not perfect, but I just wanted to share. In my environment
(Win 7 + Emacs 24.3 + a recent Org + a newbie user at the
console) the Org file produces proper export to HTML and PDF
output, hope it may work for other users interested in Japanese
writing too.

  Kindest regards,

  Andrea


[O] exported dates in ox-rss.el

2013-10-06 Thread Andrea Rossetti

Hello everyone,
 
  I played a bit with the RSS export (contrib/lisp/ox-rss.el),
and found that the dates in the emitted output lack the month name:
pubDateSat, 05  2013 15:44:49 +0200/pubDate (the month Oct
is missing).

  It turned out that the date format specifier %h is not
accepted by the runtime (MSVCRT.DLL) of my Windows installation
(a plain Windows 7 64 bit from year 2009). 

  I resolved my personal problem by simply replacing %h-%b
in my ox-rss.el, but may I please ask to good-willed Windows+Emacs
users around if they face the same issue (or if it's just me).

  Here is a simple test: open an empty buffer and type:

(format-time-string day: %d, month: %h, year: %y)
C-x C-e wrongly returns day: 06, month: , year: 13

(format-time-string day: %d, month: %b, year: %y)
C-x C-e returns day: 06, month: Oct, year: 13

  Thanks in advance, kindest regards.

  Andrea Rossetti
  http://github.com/thesoftwarebin




Re: [O] proposed patch for org-export-latex-hyperref-options-format

2013-10-01 Thread Andrea Rossetti

  Thanks Nicolas for your last directions,
I will apply them.

  The accidental coexistence of two Org versions
on my Emacs installation (built-in versus ELPA)
confused me a bit, apologies for the noise.

  Kindest regards,

  Andrea

Nicolas Goaziou n.goaz...@gmail.com writes:

 You can disable the hypersetup with `org-latex-with-hyperref' (or
 locally with #+options: texht:nil) and install you own
 with #+latex_header, or in your class.

 I don't think we need yet another way to provide a customized hypersetup
 string. Do we?


 Regards,



Re: [O] proposed patch for org-export-latex-hyperref-options-format

2013-09-30 Thread Andrea Rossetti

Hello,

  apologies for my mistake. Nicolas you were right,
org-export-latex-hyperref-options-format was present
only in the old exporter, in a file named org-latex.el.

  I'd like to suggest a customizable hypersetup string
as a future, non-urgent enhancement of ox-latex.el; the
defcustom at line 324 of this old file:

http://repo.or.cz/w/emacs.git/blob/HEAD:/lisp/org/org-latex.el

could fit reasonably well for variable name, default value,
type and docstring. 

  Thanks for your attention, kindest regards.

Andrea
http://github.com/thesoftwarebin



Nicolas Goaziou n.goaz...@gmail.com writes:

 Hello,


 Andrea Rossetti andrea.rosse...@gmail.com writes:

   may I please ask if this tiny patch looks reasonable and can
 be committed by the mantainers.

   Customizable option org-export-latex-hyperref-options-format
 is currently available in Org, but is ignored by the export.
 This patch enables use of org-export-latex-hyperref-options-format.

 There is no such variable in Org. It probably comes from the old export
 engine.


 Regards,



[O] proposed patch for org-export-latex-hyperref-options-format

2013-09-29 Thread Andrea Rossetti

Hello everyone, 

  may I please ask if this tiny patch looks reasonable and can
be committed by the mantainers.

  Customizable option org-export-latex-hyperref-options-format
is currently available in Org, but is ignored by the export.
This patch enables use of org-export-latex-hyperref-options-format.

  A simple test case (to see the effect before/after patching) is
reported in the How to reproduce section at the bottom of this
mail.

Kindest regards,

Andrea
https://github.com/thesoftwarebin

---8--patch file start--8
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 196e50f..91dbeff 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1120,7 +1120,7 @@ holding export options.
  (format \\title{%s}\n title)
  ;; Hyperref options.
  (when (plist-get info :latex-hyperref-p)
-   (format \\hypersetup{\n  pdfkeywords={%s},\n  pdfsubject={%s},\n  
pdfcreator={%s}}\n
+   (format org-export-latex-hyperref-options-format
   (or (plist-get info :keywords) )
   (or (plist-get info :description) )
   (if (not (plist-get info :with-creator)) 
---8--patch file end8

 From: andrea.rosse...@gmail.com
 Subject: Bug: Customization of Org Export Latex Hyperref Options Format 
 ignored
 To: emacs-orgmode@gnu.org
 Date: Sat, 21 Sep 2013 18:58:12 +0200 (1 week, 1 day, 6 hours ago)

 Hello everyone,

   option Org Export Latex Hyperref Options Format
 (aka org-export-latex-hyperref-options-format)
 seems to have no effect on my latex exports, i.e.
 the latex pramble always contains this same text:

 ===
 \hypersetup{
   pdfkeywords={},
   pdfsubject={},
   pdfcreator={Emacs 24.3.1 (Org mode 8.2)}}
 ===

   May I please ask if this is reproducible on
 your installation as well, or if it's just me.

 Thanks in advance, kindest regards.

   Andrea
   https://github.com/thesoftwarebin

 =
 How to reproduce:

 1) check that option Org Latex With Hyperref
 is enabled

 2) create a simple example.org file:
 * hello
 ** blah
 ** bleah
 * end

 3) export to latex buffer (C-c C-e l L),
 look at the \hypersetup{...} lines

 4) close the *Org LATEX Export* buffer
 with C-x k

 5) add text blah somewhere in the value of
 option Org Export Latex Hyperref Options Format

 6) export again to latex buffer (C-c C-e l L)

 7) \hypersetup{...} lines should have changed
 accordingly to changes made in step 3), but 
 they don't change for me
 =



[O] Bug: Customization of Org Export Latex Hyperref Options Format ignored [8.2 (8.2-elpa @ c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20130919/)]

2013-09-22 Thread andrea . rossetti

Hello everyone,

  option Org Export Latex Hyperref Options Format
(aka org-export-latex-hyperref-options-format)
seems to have no effect on my latex exports, i.e.
the latex pramble always contains this same text:

===
\hypersetup{
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs 24.3.1 (Org mode 8.2)}}
===

  May I please ask if this is reproducible on
your installation as well, or if it's just me.

Thanks in advance, kindest regards.

  Andrea
  https://github.com/thesoftwarebin

=
How to reproduce:

1) check that option Org Latex With Hyperref
is enabled

2) create a simple example.org file:
* hello
** blah
** bleah
* end

3) export to latex buffer (C-c C-e l L),
look at the \hypersetup{...} lines

4) close the *Org LATEX Export* buffer
with C-x k

5) add text blah somewhere in the value of
option Org Export Latex Hyperref Options Format

6) export again to latex buffer (C-c C-e l L)

7) \hypersetup{...} lines should have changed
accordingly to changes made in step 3), but 
they don't change for me
=





Emacs  : GNU Emacs 24.3.1 (i386-mingw-nt6.1.7600)
 of 2013-03-17 on MARVIN
Package: Org-mode version 8.2 (8.2-elpa @ 
c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20130919/)

current state:
==
(setq
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
  org-babel-execute-safely-maybe)
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-drill-optimal-factor-matrix '((2 (2.2198 . 2.277)
(1.9001 . 2.065)
(2.04 . 2.195))
   (1 (1.96 . 3.58) (2.08 . 3.86)
(2.2198 . 3.725) (2.04 . 3.59)
(2.36 . 3.86) (2.1797 . 3.72)
(1.7002 . 3.44))
   )
 org-export-with-drawers nil
 org-export-copy-to-kill-ring t
 org-export-date-timestamp-format %Y-%m-%d
 org-beamer-column-view-format %45ITEM %10BEAMER_env(Env) %10BEAMER_act(Act) 
%4BEAMER_col(Col) %8BEAMER_opt(Opt)
 org-export-with-tags 'not-in-toc
 org-export-preprocess-before-selecting-backend-code-hook 
'(org-beamer-select-beamer-code)
 org-tab-first-hook '(org-hide-block-toggle-maybe
  org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-export-latex-hyperref-options-format \\hypersetup{\n  pdfkeywords={%s},\n 
 pdfsubject={%s},\n  pdfcreator={blah: %s}}\n
 org-modules '(org-bbdb org-bibtex org-docview org-gnus org-info org-jsinfo
   org-irc org-mew org-mhe org-rmail org-vm org-wl org-w3m
   org-drill)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-hide-inline-tasks org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-speed-command-hook '(org-speed-command-default-hook
  org-babel-speed-command-hook)
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
 org-babel-pre-tangle-hook '(save-buffer)
 org-occur-hook '(org-first-headline-recenter)
 org-export-with-sub-superscripts '{}
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-default-notes-file ~/.emacs.d/org/notes.org
 org-latex-classes '((beamer
  
\\documentclass[presentation]{beamer}\n[DEFAULT-PACKAGES]\n[PACKAGES]\n[EXTRA]
  (\\section{%s} . \\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s}))
 (article \\documentclass[11pt]{article}
  (\\section{%s} . \\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s})
  (\\paragraph{%s} . \\paragraph*{%s})
  (\\subparagraph{%s} . \\subparagraph*{%s}))
 (report \\documentclass[11pt]{report}
  (\\part{%s} . \\part*{%s})
  (\\chapter{%s} . \\chapter*{%s})
  (\\section{%s} . \\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s}))
 (book \\documentclass[11pt]{book}
  (\\part{%s} . \\part*{%s})
  (\\chapter{%s} . \\chapter*{%s})
  (\\section{%s

Re: [O] Agenda restrict to buffer

2012-07-12 Thread andrea crotti
2012/7/12 Bastien b...@gnu.org:

 (defun my-org-agenda-command ()
   (interactive)
   (org-agenda-set-restriction-lock 'file)
   (org-agenda nil %))

 Note that you need to be in your .org file for this to work, so this
 isn't really suited for a global keybinding, only for org-mode-map.

 HTH,

 --
  Bastien


Nice thanks I'll give it a try..
I can maybe switch to the buffer automatically and run that, as I was
trying to do before.
Just for curiosity, why the lispy arguments are deprecated?



[O] Agenda restrict to buffer

2012-07-11 Thread andrea crotti
I never quite understood how to pass arguments to org-agenda without
using it interactively..
I want a simple thing, a command that shows the agenda with the TODO
entries from a given file

So supposing the buffer projects.org is open I tried this:

(defun my-org-agenda ()
  (interactive)
   (switch-to-buffer (get-buffer projects.org))
   (org-agenda :arg 'agenda :restriction '))

which complains for
Wrong number of arguments: (lambda (optional arg keys restriction)
Dispatch agenda commands to collect entries to the agenda buffer.

Any suggestions?



Re: [O] [PATCH] org-goto before headline

2012-02-12 Thread Andrea Crotti

On 02/10/2012 02:42 PM, Toby Cubitt wrote:

On Fri, Feb 10, 2012 at 02:19:27PM +, Andrea Crotti wrote:

What is exactly the reason for org-goto to need to be at least in the
first headline to work?

I always get this error when I just try to jump in the first line:
byte-code: Before first headline at position 1 in buffer ..

Do you by any chance have `org-goto-interface' set to
outline-path-completion (or are you using org-goto with a prefix
argument)?

If so, I've also come across this problem. I think it's a bug in
org-goto, which should pass NO-EXCLUDE to org-refile-get-location (but
doesn't). The attached patch fixes this for me (or you can pull the
org-goto branch from http://www.dr-qubit.org/git/org-mode.git).

HTH,

Toby

Is the patch already pushed to master then?
Just to check, it would be sad if it gets lost in the way..



Re: [O] [PATCH] org-goto before headline

2012-02-10 Thread Andrea Crotti

On 02/10/2012 02:42 PM, Toby Cubitt wrote:

On Fri, Feb 10, 2012 at 02:19:27PM +, Andrea Crotti wrote:

What is exactly the reason for org-goto to need to be at least in the
first headline to work?

I always get this error when I just try to jump in the first line:
byte-code: Before first headline at position 1 in buffer ..

Do you by any chance have `org-goto-interface' set to
outline-path-completion (or are you using org-goto with a prefix
argument)?

If so, I've also come across this problem. I think it's a bug in
org-goto, which should pass NO-EXCLUDE to org-refile-get-location (but
doesn't). The attached patch fixes this for me (or you can pull the
org-goto branch from http://www.dr-qubit.org/git/org-mode.git).

HTH,

Toby


Yes it was set to that..
I've tried the patch and it works perfectly here!
3 minutes to get a bug-fix is quite amazing ;)



Re: [O] just made orgmode-7.8.02

2011-12-29 Thread Andrea Crotti

On 12/29/2011 07:02 PM, Jude DaShiell wrote:

Then perhaps something more is wrong.  I downloaded orgmode-7.8.02 and
installed that after having run the standard gitclone command to clone
org-mode on this system.  I did that because the gitclone process pulled
version 5.23 for me and also created my git repository for me in that
process.  I don't know how or why that happened but it was a satellite
connection yesterday and not my usual cable connection.


Maybe you're cloning the right repository but ending up using the shipped
version in Emacs anyway?

What is your configuration to use git org-mode from the git repository?



Re: [O] back to a multiple-file configuration

2011-12-17 Thread Andrea Crotti
On 12/12/2011 07:43 AM, Gustav Wikström wrote:
 I've also had this problem, but this related to the use of multiple
 computers and more than one OS that all needed some specific tweaks to
 be able to run. I'm also using org-babel for my init. A section from
 my init.org http://init.org follows below (warning for wall of
 text). Maybe this relates to your thoughts and if so lets hope it adds
 some value.



Thanks for sharing..
Well my conclusion is that is just a bad idea.
Literate programming is great but for other things, as for example
scientific work very dense
of hard to grasp concepts.

If I need many lines to explain some elisp function it normally means
that it's really badly written,
and I just need to rewrite it better.
One thing which is much harder with the single org file is to have
different kind of profiles.

The only way would be to actually tangle to some files and load them on
demand when needed,
but then there is no point in using org-babel in the first place..
And then it's really hard to debug, because since they are not separate
modules is was
almost impossible to understand what was going on, now that I switched
to many smaller
files I solved all my latent problems..


[O] back to a multiple-file configuration

2011-12-10 Thread Andrea Crotti
For quite a long time I had my emacs configuration in a big org-mode
file (https://github.com/AndreaCrotti/Emacs-configuration).

The file has is more than 3500 lines now, and I think the experiment has
failed in a sense.  The problem is that this even if this style is great
to produce nice documents and add a lot of useful text, is quite bad to
actually write modular code.

I rely quite heavily on the order in which things are declared for
example, instead of having different libraries to load.

So I guess I will switch to a multiple files structure again, which is
more programmer friendly in a sense.
Anyone else had similar experiences?



Re: [O] back to a multiple-file configuration

2011-12-10 Thread Andrea Crotti
On 12/10/2011 06:31 PM, Andrea Crotti wrote:
 For quite a long time I had my emacs configuration in a big org-mode
 file (https://github.com/AndreaCrotti/Emacs-configuration).

 The file has is more than 3500 lines now, and I think the experiment has
 failed in a sense.  The problem is that this even if this style is great
 to produce nice documents and add a lot of useful text, is quite bad to
 actually write modular code.

 I rely quite heavily on the order in which things are declared for
 example, instead of having different libraries to load.

 So I guess I will switch to a multiple files structure again, which is
 more programmer friendly in a sense.
 Anyone else had similar experiences?

It's quite a hard task to migrate more than 3500 lines :S
This little function is helping a lot, I replace all the :tangle yes
setting the right destination name for the given block,
so at least I do the first big transiction with org-babel..

(defun ca-replace-with-file (fname)
 (interactive sWith String:?\n)
 (let ((fname (format modules/ca-%s.el fname)))
   (query-replace :tangle yes (concat :tangle  fname))
 ))



[O] fill-paragraph?

2011-12-09 Thread Andrea Crotti
I lilke the fill-paragraph behaviour that I get in org-mode, and I was 
wondering

if I could use it also in other modes.
Using (turn-on-orgstruct) doesn't change the behaviour, and actually how 
does it

work?

I mean M-q in org-mode is still bound to the exact same function, how 
come it

behaves differently?

For example I would like to be able to refill comments in python without 
messing

up the list structure:

# TODO
# - see how to handle possible interconnected links between different 
projects

# - add some ways to declare more possible branches
# - the name of the protocol is not necessary unless it's HTTP

Ideas?



  1   2   3   >