Re: [O] source block name contains "call"
Hello, Skip Collins writes: > I am editing some Perl. When I export any source block that includes > the word "call" in the name, it causes the verbatim formatting to be > dropped. This happens with both html and latex exports. The problem > does not seem to be limited to Perl. A minimal example: > > * foo > > #+name: call_foo > #+begin_src perl > > ## This is a comment #+end_src > > * bar > > #+name: bar > #+begin_src perl > > ## This is a comment > #+end_src > > The code under the first heading is exported as normal org text, > omitting the #+name and #+begin_src lines, but including the #+end_src > line. The second heading is exported as expected, with the source > block properly formatted verbatim. The word "call" seems to be the > trigger for the bad behavior. This reminds me of https://www.xkcd.com/327/ Fixed. Thank you. Regards, -- Nicolas Goaziou
Re: [O] [patch, ox-latex] captions and latex-environments
Hello, Rasmus writes: >> Since environments do not necessary start with \begin{...}, I think the >> following is better >> >> (and (string-match ...) >>(match-string ...)) > > Don't the element `latex-environment' always start \begin{.}? > Cf. org-element--latex-begin-environment. At the moment, they do, but I have a patch somewhere to make "\[...\]" an element instead of an object (e.g., to avoid filling it). It was accepted, but it some similar change could happen. I'm just suggesting to make it more robust right from the start. > Another danger is that someone writes something like, > > \begin{center} > \begin{table} > ... You can start the regexp with "\\`[ \t]*..." > Longtable in an omission, but would have been matched. For some reason > I thought tabu was no longer supported. Browsing the tabu CTAN page > there’s links to all sorts of exotic table packages, like "stabular", > "bigtabular", and "supertabular". I wonder if it’s enough to match the > ones supported by Org by default, or whether it would be better to > have it as a defvar that could be hacked if necessary? tabu/longtabu are supported by Org by default. We could make the list a defconst anyway. > I have attached the patch with the changes again and added a changelog > entry. I am not sure this needs to be documented, but I’m happy to > include a couple lines somewhere. I think the entry in ORG-NEWS is enough. > +(defun org-latex--environment-type (latex-environment) > + "Return the TYPE of LATEX-ENVIRONMENT. > + > +The TYPE is determined from the actual latex environment, and > +could be a member of `org-latex-caption-above' or `math'." > + (let* ((value (org-remove-indentation > + (org-element-property :value latex-environment))) > + (env (or (and (string-match "begin{\\([A-Za-z0-9*]+\\)}" value) > +(match-string 1 value)) ""))) For clarity, "" should be indented at the same level as (and ...). > +(cond > + ((string-match-p org-latex-math-environments-re value) 'math) > + ((string-match-p > + (regexp-opt '("table" "longtable" "tabular" "tabu" "longtabu")) env) Nitpick: you could wrap the above into `eval-when-compile' for a small optimization. > + 'table) > + ((string-match-p "figure" env) 'image) > + ((or (string-match-p "\\(\\(lst\\)?listing\\|verbatim\\|minted\\)" env) > + (string-match-p > +(regexp-opt > + (mapcar (lambda (str) > + (let ((s (cadr str))) > + (if (string-match latex-begin-re s) You removed `latex-begin-re' binding so this is going to fail. > + (match-string 2 s) > + s))) > + org-latex-custom-lang-environments)) I'm not sure it is necessary. AFAIU, `org-latex-custom-lang-environments' already provides a way to insert captions. The matching process above seems fragile. Thank you. Regards, -- Nicolas Goaziou
Re: [O] jumping from Agenda/Timeline to .org source file
Hello, Alan Schmitt writes: > Hello Eric, > > On 2017-03-09 07:23, Eric S Fraga writes: > >> On Wednesday, 8 Mar 2017 at 12:55, Alan Schmitt wrote: >> >> [...] >> >>> I would like to use `org-agenda-goto', but without splitting the frame. >>> In other words, I want to destination to be the one of >>> `org-agenda-goto', but the window handling to be the one of >>> `org-agenda-switch-to'. >> >> You could "advice" (advise in English :-) org-agenda-goto to delete other >> windows after invocation? >> >> Or, create a new function which invokes org-agenda-goto and then >> delete-other-windows and bind that to the key you want? > > Yes, these are solutions. I was just trying to understand why the > functions had different behaviors. I tried the same, without much success. I think we could factor out both functions into a single one with a control argument. Any taker? Regards, -- Nicolas Goaziou
Re: [O] clock resolution bug
Hello, Samuel Wales writes: > in recent maint: > > i get "clock start time is gone" pretty frequently. > > i do org-clock-cancel. this stops the clock but does > not fix the dangling clock. > > to fix the dangling clock, i try clocking in or out. > > i then get clock resolution menu (k, K, etc.). > > which says at bottom: > > "For all these options, using uppercase makes your final > state to be CLOCKED OUT." > > i press K, and it correctly clocks me out, then clocks me in again. > > i expected it to not clock me in again. Could you provide an ECM? Regards, -- Nicolas Goaziou
Re: [O] parsing of emphasis versus links
On Friday, 17 Mar 2017 at 19:32, John Kitchin wrote: > I can not reproduce all the things you report. Hi John, But you did reproduce most so it's not my imagination :-) > I think part of the problem is [calc:]. I have to have at least two > characters of path to get a link that is colored. Ah, okay. I'll think about extending the template for embedded calc recognition. > This particular case looks like emphasis from a simple regexp pov. Yes, indeed. I'm getting around it by making sure there is only one calc: link per line but not ideal. More thinking required! Thanks for having a look. -- : Eric S Fraga (0xFFFCF67D), Emacs 26.0.50, Org release_9.0.5-378-gf6f02e.dirty signature.asc Description: PGP signature
[O] [PATCH] org-clock: Align formula column in clock tables
* lisp/org-clock.el (org-clocktable-write-default): Align formula column in clock tables. Here is an ECM: * foo ** sub :LOGBOOK: CLOCK: [2017-03-18 Sat 15:00]--[2017-03-18 Sat 15:15] => 0:15 :END: ** sub2 :LOGBOOK: CLOCK: [2017-03-18 Sat 15:15]--[2017-03-18 Sat 15:30] => 0:15 :END: ** sub3 *** subsub1 :LOGBOOK: CLOCK: [2017-03-18 Sat 13:00]--[2017-03-18 Sat 13:15] => 0:15 :END: *** subsub1 :LOGBOOK: CLOCK: [2017-03-18 Sat 14:00]--[2017-03-18 Sat 14:15] => 0:15 :END: * bar :LOGBOOK: CLOCK: [2017-03-18 Sat 13:15]--[2017-03-18 Sat 13:30] => 0:15 :END: * table #+BEGIN: clocktable :maxlevel 3 :scope file :formula % #+CAPTION: Clock summary at [2017-03-18 Sat 16:50] | Headline | Time | | | % | |---++--+--+---| | *Total time* | *1:15* | | | 100.0 | |---++--+--+---| | foo | 1:00 | | | 80.0 | | \_ sub || 0:15 | | 20.0 | | \_ sub2 || 0:15 | | 20.0 | | \_ sub3 || 0:30 | | 40.0 | | \_subsub1 || | 0:15 | 20.0 | | \_subsub1 || | 0:15 | 20.0 | | bar | 0:15 | | | 20.0 | #+END: --- lisp/org-clock.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index ffa1b3003..73afd87e6 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -2622,6 +2622,7 @@ from the dynamic block definition." ;; Empty fields for higher levels. (make-string (max 0 (1- (min time-columns level))) ?|) hlc (org-minutes-to-clocksum-string time) hlc "|" ; time +(make-string (max 0 (- time-columns level)) ?|) (if (eq formula '%) (format "%.1f |" (* 100 (/ time (float total-time "") -- 2.11.0
[O] The name attribute is obsolete. Consider putting an id attribute
Hello, I am exporting Org to Markdown, and when used with: What is GNU CLISP? then the validator https://validator.w3.org/ is telling: Warning: The name attribute is obsolete. Consider putting an id attribute on the nearest container instead. >From line 382, column 23; to line 382, column 49 GNU CLISP?
[O] Enhance changelog with org formatting?
Changelog is a great tool, but with some org-mode love, it could be even better. Or, perhaps better yet, has anyone implemented something like changelog in org-mode? I've wondered about this for years. Perhaps I'm barking up the wrong tree. Alan Davis -- [I do not] carry such information in my mind since it is readily available in books. …The value of a college education is not the learning of many facts but the training of the mind to think. ---Albert Einstein "Sweet instruments hung up in cases. . . keep their sounds to themselves." ---Shakespeare, _Timon of Athens_
Re: [O] source block name contains "call"
I actually thought of the same xkcd comic when I finally figured out what was going on. The original name was "full_precision_recall_test". It took some time to isolate the problem. > This reminds me of https://www.xkcd.com/327/