Bug: Off-by-one when archiving to top level date [9.3.6 (9.3.6-17-g389288-elpa @ /home/charlestam/.emacs.d/elpa/org-20200224/)]

2020-02-27 Thread Charles Tam
I am archiving subtrees of my main Orgmode document to a top-level
datetree in a secondary file. When I do so, I expect something like
the following:

* 2020
*** 2020-02 February  (org-odd-levels-only t)
* 2020-02-27 Thursday
*** Archived Item

But instead I get

* 2020
*** 2020-02 February
* 2020-02-27 Thursday
* Archived Item

The archived item ends up as a sibling of the targeted date, instead of
a child. This seems incorrect.

Thanks,
Charles

Emacs  : GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.2), modified by Debian
Package: Org mode version 9.3.6 (9.3.6-17-g389288-elpa @
/home/charlestam/.emacs.d/elpa/org-20200224/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-link-shell-confirm-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-html-format-inlinetask-function
'org-html-format-inlinetask-default-function
 org-special-ctrl-a/e t
 org-agenda-files '("~/mise/TODO")
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-reveal-start-hook '(org-decrypt-entry)
 org-modules '(org-w3m org-bbdb org-bibtex org-docview org-gnus org-info
org-irc org-mhe org-rmail
   org-eww)
 org-link-doi-server-url "http://dx.doi.org/;
 org-archive-location "%s_archive::datetree/"
 org-mode-hook '((closure
  (org--rds reftex-docstruct-symbol org-with-time
org-defdecode org-def
   org-read-date-inactive org-ans2 org-ans1
org-columns-current-fmt-compiled
   org-end-time-was-given org-time-was-given
org-blocked-by-checkboxes org-state
   org-agenda-headline-snapshot-before-repeat
org-capture-last-stored-marker
   org-struct-menu org-last-state org-id-track-globally
texmathp-why
   remember-data-file iswitchb-temp-buflist
calc-embedded-open-mode
   calc-embedded-open-formula calc-embedded-close-formula
align-mode-rules-list
   org-export-registered-backends
org-indent-indentation-per-level
   org-inlinetask-min-level t)
  nil
  (add-hook (quote change-major-mode-hook) (quote
org-show-all) (quote append)
   (quote local))
  )
 (closure (*this* org-babel-confirm-evaluate-answer-no t)
nil
  (add-hook (quote change-major-mode-hook) (quote
org-babel-show-result-all)
   (quote append) (quote local))
  )
 (closure (t) nil (setq imenu-create-index-function (quote
org-imenu-get-tree)))
 (lambda nil (auto-fill-mode t) (local-set-key (kbd "M-[")
(quote org-metaleft))
  (local-set-key (kbd "M-]") (quote org-metaright))
  (local-set-key (kbd "M-{") (quote org-shiftmetaleft))
  (local-set-key (kbd "M-}") (quote org-shiftmetaright))
  (local-set-key (kbd "") (quote org-shifttab))
  (local-unset-key (kbd "C-c C-j")) (local-unset-key (kbd
"C-,")))
 turn-on-font-lock
 (lambda nil
  (font-lock-add-keywords nil (quote (("{{{.+}}}" 0 (quote
org-macro-face))
 #[0 "\301\211 \207" [imenu-create-index-function
org-imenu-get-tree] 2]
 #[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-hook change-major-mode-hook
org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-latex-format-drawer-function '(closure (t) (_ contents) contents)
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-hide-leading-stars t
 org-babel-load-languages '((python . t))
 org-clock-clocktable-default-properties '(:maxlevel 2 :scope file)
 org-log-done 'time
 org-hide-emphasis-markers t
 org-export-backends '(ascii html latex md)
 org-ascii-format-drawer-function '(closure (t) (_name contents _width)
contents)
 org-use-fast-todo-selection t
 org-occur-hook '(org-first-headline-recenter)
 org-agenda-start-with-log-mode t
 org-odd-levels-only t
 org-structure-template-alist '(("n" "#+NAME: ?") ("p" "#+BEGIN_SRC
python?\n#+END_SRC")
("a" . "export ascii") ("c" . "center")
("C" . "comment")

Re: Incident tracking

2020-02-27 Thread Samuel Wales
i have no right to respond as i have 483 scheduleds and 28 deadlines
and i get lost even trying to get one thing done per week, but i just
wanted to add to the advice so far.

there is org-edna for dependencies.  org-depend also, but i think it
lacks the feature of scheduling a remote org-id header once a local
one is doneified.

it is useful to stick inactive timestamps at boh on headlines, so you
can do all sorts of things like visually bisect to find what you are
looking for, search only the visible headlines, etc.  this makes for
good logging.  [others will recommend date trees instead.]

i like this type of discussion as we have had few of them in the last
8 years or so and there is much insight for usage and even fodder for
better features or refactoring, i think.

gtd is too labor-intensive for myself, but others will suggest reading
materials if you think it fits.

org is flexible so it's really a toolkit for figuring out your own
structures.  i'd suggest not getting too fancy at first because yagni
sometimes applies.

===

i find it useful to think of my org forest as an ontology of
representations of preferably physical objects that become canonical
locations in it.

thus, your washer is one holon [subtree] and you always know where to
refile to for it.  then you don't need tags as much; you can use org
id links to make the forest a digraph.  location determines identity.

this is in contrast to, for example "stuff to do for maintenance".

-- 
The Kafka Pandemic

What is misopathy?
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html



Re: Incident tracking

2020-02-27 Thread Tim Cross


This is a fairly open question with a wide range of possibilities. If
there is an existing incident management workflow, I would probably
start by seeing how that could be replicated using org-mode facilities.

I would start with a new org file and begin by listing your functional
and non-functional requirements. Perhaps assign a priority to each
requirement or use something like MoSCoW prioritisation to each (Must,
Should, Could, Wont) to each. Then go through all the Must requirements
and see how best to use org to satisfy them, then the should, etc.

If you wanted, you could then come back to the list and show the
requirements and your proposed org-mode solution or ask for an org-mode
based solution and you may get some more substantive responses. As it
stands, the possibilities are too broad/open for any real advice.

A lot will depend on what or how you want to use the incident tracking
system. For example, a priority might be just in tracking and responding
to incidents or it might be to report on incidents or using the
incidents to build up a knowledge base to help resolve incidents faster
by making it easier to find known solutions, identifying reoccurring
incidents that identify underlying problems etc.

Org provides most of the key building blocks, but you may need to put
some effort into reporting and summarising data. I would try to keep it
fairly simple to start with and add functionality as it becomes evident
it is required.

Areas which will likely be good starting points might be

- Capture templates. Standardising how data is captured will really help
  in further processing and reporting. Capture templates can be really
  useful for this.

- Custom TODO states. You probably need TODO states which are more
  'natural' for incident management. For example, instead of TODO,
  STARTED and DONE, you may want to define something like NEW,
  CONFIRMED, TRIAGED/FIX, RESOLVED etc. Any existing incident management
  workflow will likely provide good choices.

- TAGS are likely going to be critical for classification, assignment
  and reporting on incidents. My only advice here would be to be
  conservative when it comes to creating new tags. Too many tags is
  often worse than too few.

- Assigning unique ID numbers to each incident. You will likely have
  repeat incidents or multiple incidents with the same unerlying cause.
  Being able to link incidents or define relationships between them will
  likely be useful.

It may also be worthwhile looking at some existing incident management
solutions. Some of these have good ideas and may provide some valuable
guidance. In many cases, the same principals can be implemented in org
without too much effort.


Lawrence Bottorff  writes:

> What would be the best way in the Emacs org-mode world to "keep track" of
> "incidents" that might happen in, e.g., a factory setting? Let's say a
> piece of equipment has various things in its life that happen to it:
> breakdown, warning, maintenance, etc. that you want to keep track of in an
> org-mode way. Would it be something in the TODO/GTD realm, or something
> custom?
>
> LB


--
Tim Cross



Re: attachment: link type export to HTML invalid attach dir

2020-02-27 Thread Nicolas Goaziou
Hello,

Gustav Wikström  writes:

> Surely custom code for file links. Haven't dug much deeper since the
> issue is solved by the attached patch.

Certainly, but that means `org-export-link-as-file' is not working at
some level. Since adding a hook is better, and the function was not used
anymore, I removed it: it is not necessary.

> I'll apply the patch then, unless already taken care of by you or
> Bastien! :)

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: Debugging at least 2 regressions in org-mode master breaking ox-hugo

2020-02-27 Thread Adam Porter
Kaushal Modi  writes:

> Failure 1: org-get-outline-path has moved, and not mentioned in ORG-NEWS
>
> Compiling ox-hugo.el now gives:
>
> ox-hugo.el:4284:1: Warning: the function ‘org-get-outline-path’ is not known 
> to be defined.
>
> I see that defun has now moved to org-refile.el. I see that
> org-get-outline-path has nothing to do specific to refiling. Can that
> be moved back to org.el, or may be a separate library? Otherwise,
> ox-hugo.el will have to load org-refile.el too (yes, I don't use
> org-refile (yet), and that's how I discovered this :))

Yes, please move that function back.  This is going to cause breakage in
a variety of packages that use that function but do not load
org-refile.  I can hear the bug reports rumbling already...  ;)




Re: Incident tracking

2020-02-27 Thread Russell Adams
On Thu, Feb 27, 2020 at 04:55:30PM -0600, Lawrence Bottorff wrote:
> What would be the best way in the Emacs org-mode world to "keep track" of
> "incidents" that might happen in, e.g., a factory setting? Let's say a
> piece of equipment has various things in its life that happen to it:
> breakdown, warning, maintenance, etc. that you want to keep track of in an
> org-mode way. Would it be something in the TODO/GTD realm, or something
> custom?

LB,

You can structure your file any way you like.

You might consider either:

--

 - Organize tickets by time, adding to the bottom, but tagging them against
 machines by serial or something similar

* Tickets

** TODO Fix it again   :MACHINE_X:

** DONE Eat a sock  :DRYER_2:

--

 - Organize tickets by machine first, then time

* Tickets

** Machine X

*** TODO Fix it again

** Dryer 2

*** DONE Eat a sock

YMMV. You can do reporting on either with column views.


--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



Incident tracking

2020-02-27 Thread Lawrence Bottorff
What would be the best way in the Emacs org-mode world to "keep track" of
"incidents" that might happen in, e.g., a factory setting? Let's say a
piece of equipment has various things in its life that happen to it:
breakdown, warning, maintenance, etc. that you want to keep track of in an
org-mode way. Would it be something in the TODO/GTD realm, or something
custom?

LB


Need Guidance in developing and generating code using org-mode

2020-02-27 Thread KOKOU AFIDEGNON
Hi,

Here is my sample org entry which i want to build a website for.


   1. * Home
   2. ** Design
   3. *My Sample design attempt*
   4. The journey has been quite long coupled with heuristic approaches
   5. This is an attempt to generate an html file from my blog written in
   6. org-mode.
   7. * Archives
   8. ** By Categories
   9. ** By Date
   10. ** By Author
   11. * Account
   12.
   13. ** Register
   14. - username
   15. - password
   16. - email
   17. - Gender
   18.
   19. ** Login
   20. - Username
   21. - Password
   22.
   23. ** Activate
   24.
   25. ** Logout


I have been able to to export using C-c C-e h o


   - How do i insert my personal template with custom CSS and JS?
   - Under Register, and Login heading, How do i generate html forms which
   will post entries to specific destinations? and also generate code for
   capturing the data?
   - How do i link Activate and Logout heading to custom urls?

I m finding hard grasping orgmode i will be grateful if you can help
elucidate.


Re: Need Guidance in developing and generating code using org-mode

2020-02-27 Thread Leslie Watter
Hi Kokou,

See below ;-)

On Thu, Feb 27, 2020 at 3:46 PM KOKOU AFIDEGNON 
wrote:

> Hi,
>
> Here is my sample org entry which i want to build a website for.
>
>
>1. * Home
>2. ** Design
>3. *My Sample design attempt*
>4. The journey has been quite long coupled with heuristic approaches
>5. This is an attempt to generate an html file from my blog written in
>6. org-mode.
>7. * Archives
>8. ** By Categories
>9. ** By Date
>10. ** By Author
>11. * Account
>12.
>13. ** Register
>14. - username
>15. - password
>16. - email
>17. - Gender
>18.
>19. ** Login
>20. - Username
>21. - Password
>22.
>23. ** Activate
>24.
>25. ** Logout
>
>
> I have been able to to export using C-c C-e h o
>
>
>- How do i insert my personal template with custom CSS and JS?
>
>
CSS: you'll need to read:
https://orgmode.org/manual/CSS-support.html#CSS-support

but basically add:

#+HTML_HEAD: 
#+HTML_HEAD_EXTRA: 

Javascript:
https://orgmode.org/manual/JavaScript-support.html#JavaScript-support


>
>- Under Register, and Login heading, How do i generate html forms
>which will post entries to specific destinations? and also generate code
>for capturing the data?
>
> To use forms, you'll probably will use raw HTML:

https://orgmode.org/manual/Quoting-HTML-tags.html#Quoting-HTML-tags


>
>- How do i link Activate and Logout heading to custom urls?
>
>
To change headline links you'll need to read:
https://orgmode.org/org.html#Headlines-in-HTML-export

Headlines are exported to ‘’, ‘’, etc. Each headline gets the ‘id’
attribute from ‘CUSTOM_ID’ property, or a unique generated value, see Internal
Links .

When org-html-self-link-headlines is set to a non-nil value, the text of
the headlines is also wrapped in ‘’ tags. These tags have a ‘href’
attribute making the headlines link to themselves.

You'll have to put an CUSTOM_ID to the *custom url *you'll need




> I m finding hard grasping orgmode i will be grateful if you can help
> elucidate.
>

Hope this helps

Cheers,

LEslie


-- 
Leslie H. Watter


RE: attachment: link type export to HTML invalid attach dir

2020-02-27 Thread Gustav Wikström
Hello,

> -Original Message-
> From: Nicolas Goaziou 
> Sent: den 26 februari 2020 16:23
> To: Gustav Wikström 
> Cc: Bastien ; emacs-orgmode@gnu.org
> Subject: Re: attachment: link type export to HTML invalid attach dir
> 
> Hello,
> 
> Gustav Wikström  writes:
> 
> > Expanding attachment-links in the buffer makes the link type no longer
> > be attachment.
> 
> What makes you think that? The link type is preserved during the
> substitution, according to the (concat "attachment" ...).

What I meant is that the content of the link, even though mentioned to be 
"attachment" cannot be reasoned about and worked with in the same way as an 
unexpanded attachment link. Thus, it's not the same type of link any longer. 
It's effectively a "file" link when expanded. But this discussion doesn't carry 
much meaning any longer I suppose, given the agreement to apply the patch.

> > I would prefer if we explicitly set the link type to
> > files here instead. Storing intermediate state in an attachment link
> > types makes less sense imo.
> >
> > One issue with the current way it's done is that images are treated
> > differently between attachment links and file links. For HTML exports,
> > file links are wrapped in a div with class figure where expanded
> > attachment links are not.
> 
> It would be nice to investigate why this happens.

Surely custom code for file links. Haven't dug much deeper since the issue is 
solved by the attached patch.

> > Letting org-attach-expand-links do the full
> > transform to file links would solve that issue. That also
> > means :export is not needed for org-link-set-parameters.
> >
> > Patch attached if you agree to this.
> 
> Of course! This is what I suggested, like, 6 weeks ago (although, at
> this time, I was thinking about having the substitution in "ox.el").

Well yes... I had other ideas at that point and would rather see attachment 
links as something of its own. But we're not in that place now, and the 
decision was to treat link types that can be expanded into file links just like 
that. You've kindly fixed the code so Org mode can do that now, something I'm 
sure I couldn't have done myself anyhow. So let's do it as you suggested from 
the beginning. I'll apply the patch then, unless already taken care of by you 
or Bastien! :)

Kindly
Gustav


Need Guidance in developing and generating code using org-mode

2020-02-27 Thread KOKOU AFIDEGNON
Hi,

Here is my sample org entry which i want to build a website for.


   1. * Home
   2. ** Design
   3. *My Sample design attempt*
   4. The journey has been quite long coupled with heuristic approaches
   5. This is an attempt to generate an html file from my blog written in
   6. org-mode.
   7. * Archives
   8. ** By Categories
   9. ** By Date
   10. ** By Author
   11. * Account
   12.
   13. ** Register
   14. - username
   15. - password
   16. - email
   17. - Gender
   18.
   19. ** Login
   20. - Username
   21. - Password
   22.
   23. ** Activate
   24.
   25. ** Logout


I have been able to to export using C-c C-e h o


   - How do i insert my personal template with custom CSS and JS?
   - Under Register, and Login heading, How do i generate html forms which
   will post entries to specific destinations? and also generate code for
   capturing the data?
   - How do i link Activate and Logout heading to custom urls?

I m finding hard grasping orgmode i will be grateful if you can help
elucidate.


A possible improvement to org todo keywords completion UI

2020-02-27 Thread akater
I'd like to discuss a possible improvement to org todo keywords completion UI 
but

- it could break something as is

- it still needs some polish, or maybe some of org internals better be
altered

Proposal so far:
#+begin_src diff
--- 
/sudo:portage@localhost:/var/tmp/portage/app-editors/emacs-28.0./work/emacs/lisp/org/org-agenda.el
+++ #>
@@ -4774,8 +4774,11 @@
 (nth (1- arg) kwds
   (when (equal arg '(4))
 (setq org-select-this-todo-keyword
-  (completing-read "Keyword (or KWD1|K2D2|...): "
-   (mapcar #'list kwds) nil nil)))
+  (mapconcat #'identity
+ (completing-read-multiple
+  "Keyword (or KWD1|KWD2|...): "
+  (mapcar #'list kwds) nil nil)
+ "|")))
   (and (equal 0 arg) (setq org-select-this-todo-keyword nil))
   (org-compile-prefix-format 'todo)
   (org-set-sorting-strategy 'todo)
#+end_src

This makes it possible to mark multiple candidates with helm. In what
follows, `crm' means `complete-read-multiple'.

With org-todo-list implemented as it is now, helm user cannot select
multiple todo keywords with helm at all. User has to type keywords
explicitly, togehther with vertical bar separators.

The proposed change makes it possible to do the following C-c a T TAB
 RET and have KWD1,KWD2,...,KWDn
appear in minibuffer.

At this point, user can type another comma, hit TAB again and add more
keywords to the list. Hitting RET without adding anoter comma will
submit the keywords to org-adenga procedure, and the expected Agenda
buffer will be displayed.

There are see several issues however, relevant to inner workings of both
crm and orgmode.

The first three are likely either crm-related or helm-related; I leave
them here so that I can reference to the whole example, with its
context, from other discussions. Skipping them won't prevent you from
being able to reply meaningfully to this message.

- the neccessity to hit the initial TAB to trigger the completion is
somewhat unpleasant: new users likely won't recognise the completion
candidates are there at all. It would be more convenient and less
confusing if candidates appeared immediately.

- it would be natural for crm to allow for arbitrary separator, tailored
to particular callers; in this case it better be vertical bar rather
than comma.

- results entered so far could be safely appended with a trailing
comma. That would make it possible to trigger additional completions
with hitting just TAB each time. One does not need to remove the
trailing separator for the resulting list to be correct, or at least
this is true for org todo keywords. The downside is that the presence of
the trailing separator might confuse users, so that they'd think their
input was still incomplete but (1) I find this unlikely; (2) I guess the
trailing separator could be de-emhasized with a dimmed face (the
downside here, in turn, is that there is no such thing as dimmed face in
console). Trailing separator might also confuse users so that they'd
remove it each time before hitting RET. This is more likely, and I don't
know what to do with this.

orgmode-related questions and issues are:

- could orgmode internals be changed in such a way that this call to
completing-read-multiple could simply return a list and thus we wouldn't
have to rely on some unix-style string passing with explicit characters
as separators, doing it in a civilised manner instead?

- maybe my patch would break something as is?

- reliance on completing-read-multiple will make org-agenda require
Emacs ≥24.4 (or something similar; I'm as precise here as crm help page
is). I suspect it's not an issue but I want to make sure.

I'd like to hear feedback on orgmode-related points, and maybe hints on
where I should discuss the aforementioned crm interface issues: in helm
repository or in some emacs mailing list. Also, it is possible that
those can be mitigated with a patch for `org-agenda.el' that is more
competently made than mine, still providing the intended improvement.



Re: Bug or not a bug? dot expansion in ob-shell

2020-02-27 Thread Kaushal Modi
Hello all,


On Wed, Feb 19, 2020 at 7:11 AM Bastien  wrote:

> Hi Eric,
>
> note that the previous behavior only _seemed_ right by chance: there
> is no notion of getting the exit code of the shell command in
> ob-shell.el, and returning "0" is just a hazard here, just because
> (org-babel--string-to-number ".") returns "0", while it should return
> nil.
>

Seems like I missed this long thread. After this change to
org-babel--string-to-number, now (org-babel--string-to-number "1,3-5") is
now returning 1 (instead of returning nil as before).

Related thread that I just started:
https://lists.gnu.org/r/emacs-orgmode/2020-02/msg00932.html


Re: Debugging at least 2 regressions in org-mode master breaking ox-hugo

2020-02-27 Thread Kaushal Modi
On Thu, Feb 27, 2020 at 9:13 AM Kaushal Modi  wrote:

> The regression is caused by
> https://code.orgmode.org/bzg/org-mode/commit/6b2a7cb20b357e730de151522fe4204c96615f98
> or the later commit that changes `org-babel--string-to-number'.
>
> Using this function redefinition with additional debug messages:
>
> (defun org-babel--string-to-number (string)
>   "If STRING represents a number return its value.
> Otherwise return nil."
>   (message "DBG: string: %S" string)
>   (unless (string-match-p "\\s-" (org-trim string))
> (let ((interned-string (ignore-errors (read string
>   (when (numberp interned-string)
> (message "DBG: interned string: %S" interned-string)
> interned-string
>
> I get:
>
> DBG: string: "1,3-5"
> DBG: interned string: 1
>
> So that ",3-5" piece of information is lost.
>

To be more specific, here is the call order:

org-babel-parse-header-arguments -> org-babel-read ->
org-babel--string-to-number

org-babel-read returns the string as-is if org-babel--string-to-number
returns nil.

*The regression is that earlier (org-babel--string-to-number "1,3-5") used
to return nil, but now it returns 1.*

I think that it should return a number only if 100% of the input string
represents a number. In the case of "1,3-5", it makes sense for it to still
return nil, so that org-babel-read does not throw away the ",3-5" piece of
information.


Re: Debugging at least 2 regressions in org-mode master breaking ox-hugo

2020-02-27 Thread Kaushal Modi
On Thu, Feb 27, 2020 at 9:00 AM Kaushal Modi  wrote:

> Failure 2: Change in parsing of org babel header arguments.
>
> The relevant snippet where I parse the header arguments in ox-hugo.el is
> at
> https://github.com/kaushalmodi/ox-hugo/blob/f8ec4aa5ad7d92f94bd8dbb814d85f980be67aea/ox-hugo.el#L2563
>
> This behavior change in org-babel-parse-header-arguments is also not
> documented in ORG-NEWS. I will now investigate what cause this regression.
>

The regression is caused by
https://code.orgmode.org/bzg/org-mode/commit/6b2a7cb20b357e730de151522fe4204c96615f98
or the later commit that changes `org-babel--string-to-number'.

Using this function redefinition with additional debug messages:

(defun org-babel--string-to-number (string)
  "If STRING represents a number return its value.
Otherwise return nil."
  (message "DBG: string: %S" string)
  (unless (string-match-p "\\s-" (org-trim string))
(let ((interned-string (ignore-errors (read string
  (when (numberp interned-string)
(message "DBG: interned string: %S" interned-string)
interned-string

I get:

DBG: string: "1,3-5"
DBG: interned string: 1

So that ",3-5" piece of information is lost.


Debugging at least 2 regressions in org-mode master breaking ox-hugo

2020-02-27 Thread Kaushal Modi
Hello,

I recently updated to the latest org-mode master and it is failing
ox-hugo[1] build and tests at 2 places.

Failure 1: org-get-outline-path has moved, and not mentioned in ORG-NEWS

Compiling ox-hugo.el now gives:

ox-hugo.el:4284:1: Warning: the function ‘org-get-outline-path’ is not
known to be defined.

I see that defun has now moved to org-refile.el. I see that
org-get-outline-path has nothing to do specific to refiling. Can that be
moved back to org.el, or may be a separate library? Otherwise, ox-hugo.el
will have to load org-refile.el too (yes, I don't use org-refile (yet), and
that's how I discovered this :))

Failure 2: Change in parsing of org babel header arguments.

This was caught by my weekly Travis CI cron jobs for ox-hugo:
https://travis-ci.org/kaushalmodi/ox-hugo/jobs/655410731#L2426

26c26
< {{< highlight emacs-lisp "hl_lines=1" >}}
---
> {{< highlight emacs-lisp "hl_lines=1 3-5" >}}

Earlier this kind of src block header:

#+begin_src emacs-lisp :hl_lines 1,3-5
...
#+end_src

got exported as

{{< highlight emacs-lisp "hl_lines=1 3-5" >}}

The regression is that now it is getting exported as

{{< highlight emacs-lisp "hl_lines=1" >}}

The values that I have after the comma in ":hl_lines 1,3-5" are getting
lost.

The relevant snippet where I parse the header arguments in ox-hugo.el is at
https://github.com/kaushalmodi/ox-hugo/blob/f8ec4aa5ad7d92f94bd8dbb814d85f980be67aea/ox-hugo.el#L2563

This behavior change in org-babel-parse-header-arguments is also not
documented in ORG-NEWS. I will now investigate what cause this regression.

...

--
Kaushal Modi

[1]: https://github.com/kaushalmodi/ox-hugo


Re: Bibliography entry in the menu-bar

2020-02-27 Thread Simon Butler
Hi Sharon

the menu is part of BibTeX-mode (https://www.emacswiki.org/emacs/BibTeX)

hth

Simon

On 2020-02-26 17:14, Sharon Kimble wrote:
> I'm hoping that someone can help, but when I'm in a buffer of my
> bibliography, there is a drop-down list in the menu-bar, of buffer
> commands titled 'Entry-Types'. But what program puts it there?
>
> I want to create a new command to an entry in it, but I don't know what
> the originating program is. Can anyone help please?
>
> Thanks
> Sharon.



signature.asc
Description: OpenPGP digital signature


Re: ob-python.el: questions about output

2020-02-27 Thread R C
Hi Jack,
Thanks for your suggestion to use ob-jupyter. That gives me the stdout and
graphical output in separate results blocks as I wanted, and no return
statement is needed. I don't know if there are any side-effects to using
multiple sessions in a single org file, but so far it seems to work quite
well.

On Mon, Feb 24, 2020 at 11:18 AM Jack Kamm  wrote:

> Hi RC,
>
> R C  writes:
>
> > My python src blocks often have both graphical output as well as the
> > results of some numerical calculation displayed using print statements.
> >
> > When exported I would like the line: return 'img/ex1.png' not to be
> > included in the listing of the src block.
> >
> > Also, the output of the print statement is not displayed in this case.
>
> The external ob-jupyter [0] accomplishes what you want:
>
> 1. It can return multiple types of output, e.g. print statements and plots.
> 2. It doesn't require the "return" statement.
>
> It's main limitations are:
> 1. It requires jupyter.
> 2. It requires using session blocks.
>
> I'd recommend checking it out. It has excellent Python support.
>
> If you prefer a native solution, I think the options are:
>
> 1. noweb (as Eric mentioned). Then you only need to write the code
> once, but note that it will be executed twice.
>
> 2. Using multiple session blocks to return output and value
> separately. Since they use the same state, you would only need to
> execute the code once.
>
> 3. Possibly, you could insert the link to the image separately, create a
> named reference to it, and pass it to the Python block via ":var", which
> would create at an image at that link. Then use ":results output" to
> capture the print statements. I'm not 100% sure if this will work.
>
> [0] https://github.com/dzop/emacs-jupyter
>


-- 
Regards,
RC