Re: [PATCH] Omit file description when :file-desc has nil value

2020-09-03 Thread Kyle Meyer
Matt Huszagh writes:

> Hello,
>
> This patch omits a file description when :file-desc has a nil
> value. Previously, the following src block
>
> #+BEGIN_SRC asymptote :results value file :file circle.pdf :file-desc 
> :output-dir img/
>   size(2cm);
>   draw(unitcircle);
> #+END_SRC
>
> would yield
>
> #+RESULTS:
> [[file:img/circle.pdf][circle.pdf]]
>
> This makes it impossible (I think) to provide :file-desc with a default
> value and prevent the description in some cases.

Hmm, I think that's unfortunately the case.

> I feel I may be missing something in regard to why this previously had
> the functionality it did. Is there a use case I've missed?

A use case was given in the initial patch:
.
The test for this behavior mentioned there is
test-ob/file-desc-header-argument.

That thread links to another thread by gmane ID.  That's this one:
https://orgmode.org/list/87limm4eo2@med.uni-goettingen.de/T/#u

> To me, the documentation seems to indicate that my patch is the
> desired behavior:
>
>The =file-desc= header argument defines the description (see
>[[*Link Format]]) for the link.  If =file-desc= has no value, the
>"description" part of the link will be omitted.
>
> Full disclaimer: I wrote this section of the documentation as part of
> this patch:
>
> https://lists.gnu.org/archive/html/emacs-orgmode/2020-07/msg00320.html

Right, to reflect the current behavior established as a result of the
above thread, I think that should be reworded to distinguish between an
absent :file-desc header and one with no argument.  Sorry for not
catching that when reviewing your initial patch.



Re: new feature for consideration: other-tab for org-agenda-window-setup

2020-09-03 Thread Eric S Fraga
On Thursday,  3 Sep 2020 at 14:29, Bastien wrote:
> IMHO it deserves a small addition to etc/ORG-NEWS.

Already there although maybe I added it in the wrong section?  I put it
under Version 9.4 -> New options.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-725-g7bc18e



Re: new feature for consideration: other-tab for org-agenda-window-setup

2020-09-03 Thread Kyle Meyer
Bastien writes:

> Hi again,
>
> Eric S Fraga  writes:
>
>> Patch attached.  Comments welcome, of course.
>
> IMHO it deserves a small addition to etc/ORG-NEWS.
>
> Can one of you add it?

v2 (87imd33mys@ucl.ac.uk) included a NEWS entry.



Re: Bug: Source blocks before first ":tangle yes" are not tangled to file [9.4 (nil @ /Users/ezchi/.emacs.d/.local/straight/build/org-mode/)]

2020-09-03 Thread Berry, Charles
I get one file, "foo.el", with both src blocks.

Chuck

> On Sep 3, 2020, at 1:31 PM, Enze Chi  wrote:
> 
> Hi Charles:
> 
> Thanks for the clear explanation. Add default ":tangle yes" does what I 
> expected. 
> 
> But when I try to tangle it to a file like this (with default ":tangle no"):
> (org-babel-tangle nil "foo.el")
> 
> I end up get 2 files:
> foo.el:
> (setq foo "hello")
> 
> test_tangle.el:
> (setq bar "world")
> 
> Should I expect only:
> foo.el:
> (setq bar "world")
> 
> 
> 
> On Fri, Sep 4, 2020 at 3:10 AM Berry, Charles  wrote:
> Not a bug. See inline.
> 
> > On Sep 3, 2020, at 12:37 AM, Enze Chi  wrote:
> > 
> > 
> > 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
> > 
> >  https://orgmode.org/manual/Feedback.html#Feedback
> > 
> > Your bug report will be posted to the Org mailing list.
> > 
> > 
> > I have a org file like this (test_tangle.org):
> > 
> > #+begin_src emacs-lisp
> >   (setq foo "hello") ;
> > #+end_src
> > 
> 
> There was no :tangle header arg specified for this block. Hence it is never 
> tangled.  I believe this is well documented in the manual.
> 
> Running `org-babel-view-src-block-info' (C-c C-v C-i) with point in the src 
> block will confirm this this by listing the header args including `:tangle no'
> 
> If you want all src blocks to be tangled, you should study
> 
> (info "(org) Using Header Arguments")
> 
> to set a system-wide or buffer wide default.
> 
> HTH,
> 
> Chuck
> 
> 
> > #+begin_src emacs-lisp :tangle yes
> >   (setq bar "world") 
> > #+end_src
> > 
> > 
> > After I run "(org-babel-tangle nil nil)"
> > 
> > I expect both of them are tangled to "test_tangle.el":
> > 
> > (setq foo "hello")
> > (setq bar "world")
> > 
> > 
> > But I only got:
> > 
> > (setq bar "world")
> > 
> > 
> > 
> > Emacs  : GNU Emacs 27.1.50 (build 1, x86_64-apple-darwin19.6.0, NS 
> > appkit-1894.60 Version 10.15.6 (Build 19G73))
> >  of 2020-08-14
> > Package: Org mode version 9.4 (nil @ 
> > /Users/ezchi/.emacs.d/.local/straight/build/org-mode/)
> > 
> > current state:
> > ==
> > (setq
> >  org-src-mode-hook '(org-src-babel-configure-edit-buffer
> > org-src-mode-configure-edit-buffer)
> >  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-mode-hook '(#[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-babel-pre-tangle-hook '(save-buffer)
> >  org-tab-first-hook '(org-babel-hide-result-toggle-maybe
> >  org-babel-header-arg-expand)
> >  org-agenda-loop-over-headlines-in-active-region nil
> >  org-occur-hook '(org-first-headline-recenter)
> >  org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
> >  org-cycle-show-empty-lines
> >  org-optimize-window-after-visibility-change)
> >  org-speed-command-hook '(org-speed-command-activate
> >  org-babel-speed-command-activate)
> >  org-export-before-parsing-hook '(org-attach-expand-links)
> >  org-confirm-shell-link-function 'yes-or-no-p
> >  org-link-parameters '(("attachment" :follow org-attach-follow :complete
> > org-attach-complete-link)
> >   ("id" :follow org-id-open)
> >   ("eww" :follow org-eww-open :store org-eww-store-link)
> >   ("rmail" :follow org-rmail-open :store
> > org-rmail-store-link)
> >   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
> >   ("irc" :follow org-irc-visit :store org-irc-store-link
> > :export org-irc-export)
> >   ("info" :follow org-info-open :export org-info-export
> > :store org-info-store-link)
> >   ("gnus" :follow org-gnus-open :store
> > org-gnus-store-link)
> >   ("docview" :follow org-docview-open :export
> > org-docview-export :store org-docview-store-link)
> >   ("bibtex" :follow org-bibtex-open :store
> > org-bibtex-store-link)
> >   ("bbdb" :follow org-bbdb-open :export org-bbdb-export
> > :complete org-bbdb-complete-link :store
> > org-bbdb-store-link)
> >   ("w3m" :store org-w3m-store-link) ("file+sys")
> >   ("file+emacs") ("shell" :follow org-link--open-shell)
> >   ("news" :follow
> > #[514 "\301\300\302Q\"\207"
> >  ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"]
> > )
> >   ("mailto" :follow
> > #[514 "\301\300\302Q\"\207"

Re: Bug: Source blocks before first ":tangle yes" are not tangled to file [9.4 (nil @ /Users/ezchi/.emacs.d/.local/straight/build/org-mode/)]

2020-09-03 Thread Enze Chi
Hi Charles:

Thanks for the clear explanation. Add default ":tangle yes" does what I
expected.

But when I try to tangle it to a file like this (with default ":tangle no"):
(org-babel-tangle nil "foo.el")

I end up get 2 files:
foo.el:
(setq foo "hello")

test_tangle.el:
(setq bar "world")

Should I expect only:
foo.el:
(setq bar "world")



On Fri, Sep 4, 2020 at 3:10 AM Berry, Charles 
wrote:

> Not a bug. See inline.
>
> > On Sep 3, 2020, at 12:37 AM, Enze Chi  wrote:
> >
> >
> > 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
> >
> >  https://orgmode.org/manual/Feedback.html#Feedback
> >
> > Your bug report will be posted to the Org mailing list.
> > 
> >
> > I have a org file like this (test_tangle.org):
> >
> > #+begin_src emacs-lisp
> >   (setq foo "hello") ;
> > #+end_src
> >
>
> There was no :tangle header arg specified for this block. Hence it is
> never tangled.  I believe this is well documented in the manual.
>
> Running `org-babel-view-src-block-info' (C-c C-v C-i) with point in the
> src block will confirm this this by listing the header args including
> `:tangle no'
>
> If you want all src blocks to be tangled, you should study
>
> (info "(org) Using Header Arguments")
>
> to set a system-wide or buffer wide default.
>
> HTH,
>
> Chuck
>
>
> > #+begin_src emacs-lisp :tangle yes
> >   (setq bar "world")
> > #+end_src
> >
> >
> > After I run "(org-babel-tangle nil nil)"
> >
> > I expect both of them are tangled to "test_tangle.el":
> >
> > (setq foo "hello")
> > (setq bar "world")
> >
> >
> > But I only got:
> >
> > (setq bar "world")
> >
> >
> >
> > Emacs  : GNU Emacs 27.1.50 (build 1, x86_64-apple-darwin19.6.0, NS
> appkit-1894.60 Version 10.15.6 (Build 19G73))
> >  of 2020-08-14
> > Package: Org mode version 9.4 (nil @
> /Users/ezchi/.emacs.d/.local/straight/build/org-mode/)
> >
> > current state:
> > ==
> > (setq
> >  org-src-mode-hook '(org-src-babel-configure-edit-buffer
> > org-src-mode-configure-edit-buffer)
> >  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-mode-hook '(#[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-babel-pre-tangle-hook '(save-buffer)
> >  org-tab-first-hook '(org-babel-hide-result-toggle-maybe
> >  org-babel-header-arg-expand)
> >  org-agenda-loop-over-headlines-in-active-region nil
> >  org-occur-hook '(org-first-headline-recenter)
> >  org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
> >  org-cycle-show-empty-lines
> >  org-optimize-window-after-visibility-change)
> >  org-speed-command-hook '(org-speed-command-activate
> >  org-babel-speed-command-activate)
> >  org-export-before-parsing-hook '(org-attach-expand-links)
> >  org-confirm-shell-link-function 'yes-or-no-p
> >  org-link-parameters '(("attachment" :follow org-attach-follow :complete
> > org-attach-complete-link)
> >   ("id" :follow org-id-open)
> >   ("eww" :follow org-eww-open :store org-eww-store-link)
> >   ("rmail" :follow org-rmail-open :store
> > org-rmail-store-link)
> >   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
> >   ("irc" :follow org-irc-visit :store org-irc-store-link
> > :export org-irc-export)
> >   ("info" :follow org-info-open :export org-info-export
> > :store org-info-store-link)
> >   ("gnus" :follow org-gnus-open :store
> > org-gnus-store-link)
> >   ("docview" :follow org-docview-open :export
> > org-docview-export :store org-docview-store-link)
> >   ("bibtex" :follow org-bibtex-open :store
> > org-bibtex-store-link)
> >   ("bbdb" :follow org-bbdb-open :export org-bbdb-export
> > :complete org-bbdb-complete-link :store
> > org-bbdb-store-link)
> >   ("w3m" :store org-w3m-store-link) ("file+sys")
> >   ("file+emacs") ("shell" :follow org-link--open-shell)
> >   ("news" :follow
> > #[514 "\301\300\302Q\"\207"
> >  ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"]
> > )
> >   ("mailto" :follow
> > #[514 "\301\300\302Q\"\207"
> >  ["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"]
> > )
> >   ("https" :follow
> > #[514 "\301\300\302Q\"\207"
> >  ["https" browse-url ":"] 6 "\n\n(fn URL ARG)"]
> > )
> >   

Re: Headline generation as in diary?

2020-09-03 Thread Michael Heerdegen
Ihor Radchenko  writes:

> > I didn't know that eval specs support multi-line sexps, but seems that
> > works, so I can indeed use this.  Thanks for the suggestion.
>
> Hmm. According to manual, it should support multi-line string. Not sure
> about sexps.

AFAIR it didn't work in the past.  I guess it has been fixed in master
not long ago.

Michael.



Re: Headline generation as in diary?

2020-09-03 Thread Ihor Radchenko
> I didn't know that eval specs support multi-line sexps, but seems that
> works, so I can indeed use this.  Thanks for the suggestion.

Hmm. According to manual, it should support multi-line string. Not sure
about sexps.

In the worst case when you absolutely want multi-line sexp to be really
multi-line and that is also not possible in file-local eval, you can
define your sexp in a named src block. Then, you can execute the named
block using file-local eval statement calling the following function:

(defun org-link-babel-follow (name  return-info)
  "Run src block NAME.
The NAME is parsed as in #+CALL: specification.
The src block should be in the same org file."
  (let* ((call (with-temp-buffer
 (interactive)
 (org-mode)
 (insert "#+CALL: " (format "%s" (org-link-unescape name)) "\n")
 (beginning-of-buffer)
 (org-element-babel-call-parser (point-max) (list (point-min)))
 ))
 (info (org-babel-lob-get-info call)))
(if return-info
info
  (flet ((org-babel-insert-result (result  result-params info hash 
lang) nil))
(org-babel-execute-src-block nil info)

Michael Heerdegen  writes:

> Ihor Radchenko  writes:
>
>> I do not think there is support of multi-line planning everywhere.
>
> I see.
>
>> You can always use file-local definition at the beginning or end of your
>> org file. Below is an example of local definition at the end of an org
>> file.
>>
>> # Local Variables:
>> # eval: (defun your-function () (sexp))
>
> I didn't know that eval specs support multi-line sexps, but seems that
> works, so I can indeed use this.  Thanks for the suggestion.
>
> Michael.



Re: Bug: Source blocks before first ":tangle yes" are not tangled to file [9.4 (nil @ /Users/ezchi/.emacs.d/.local/straight/build/org-mode/)]

2020-09-03 Thread Berry, Charles
Not a bug. See inline.

> On Sep 3, 2020, at 12:37 AM, Enze Chi  wrote:
> 
> 
> 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
> 
>  https://orgmode.org/manual/Feedback.html#Feedback
> 
> Your bug report will be posted to the Org mailing list.
> 
> 
> I have a org file like this (test_tangle.org):
> 
> #+begin_src emacs-lisp
>   (setq foo "hello") ;
> #+end_src
> 

There was no :tangle header arg specified for this block. Hence it is never 
tangled.  I believe this is well documented in the manual.

Running `org-babel-view-src-block-info' (C-c C-v C-i) with point in the src 
block will confirm this this by listing the header args including `:tangle no'

If you want all src blocks to be tangled, you should study

(info "(org) Using Header Arguments")

to set a system-wide or buffer wide default.

HTH,

Chuck


> #+begin_src emacs-lisp :tangle yes
>   (setq bar "world") 
> #+end_src
> 
> 
> After I run "(org-babel-tangle nil nil)"
> 
> I expect both of them are tangled to "test_tangle.el":
> 
> (setq foo "hello")
> (setq bar "world")
> 
> 
> But I only got:
> 
> (setq bar "world")
> 
> 
> 
> Emacs  : GNU Emacs 27.1.50 (build 1, x86_64-apple-darwin19.6.0, NS 
> appkit-1894.60 Version 10.15.6 (Build 19G73))
>  of 2020-08-14
> Package: Org mode version 9.4 (nil @ 
> /Users/ezchi/.emacs.d/.local/straight/build/org-mode/)
> 
> current state:
> ==
> (setq
>  org-src-mode-hook '(org-src-babel-configure-edit-buffer
> org-src-mode-configure-edit-buffer)
>  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-mode-hook '(#[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-babel-pre-tangle-hook '(save-buffer)
>  org-tab-first-hook '(org-babel-hide-result-toggle-maybe
>  org-babel-header-arg-expand)
>  org-agenda-loop-over-headlines-in-active-region nil
>  org-occur-hook '(org-first-headline-recenter)
>  org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
>  org-cycle-show-empty-lines
>  org-optimize-window-after-visibility-change)
>  org-speed-command-hook '(org-speed-command-activate
>  org-babel-speed-command-activate)
>  org-export-before-parsing-hook '(org-attach-expand-links)
>  org-confirm-shell-link-function 'yes-or-no-p
>  org-link-parameters '(("attachment" :follow org-attach-follow :complete
> org-attach-complete-link)
>   ("id" :follow org-id-open)
>   ("eww" :follow org-eww-open :store org-eww-store-link)
>   ("rmail" :follow org-rmail-open :store
> org-rmail-store-link)
>   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
>   ("irc" :follow org-irc-visit :store org-irc-store-link
> :export org-irc-export)
>   ("info" :follow org-info-open :export org-info-export
> :store org-info-store-link)
>   ("gnus" :follow org-gnus-open :store
> org-gnus-store-link)
>   ("docview" :follow org-docview-open :export
> org-docview-export :store org-docview-store-link)
>   ("bibtex" :follow org-bibtex-open :store
> org-bibtex-store-link)
>   ("bbdb" :follow org-bbdb-open :export org-bbdb-export
> :complete org-bbdb-complete-link :store
> org-bbdb-store-link)
>   ("w3m" :store org-w3m-store-link) ("file+sys")
>   ("file+emacs") ("shell" :follow org-link--open-shell)
>   ("news" :follow
> #[514 "\301\300\302Q\"\207"
>  ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"]
> )
>   ("mailto" :follow
> #[514 "\301\300\302Q\"\207"
>  ["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"]
> )
>   ("https" :follow
> #[514 "\301\300\302Q\"\207"
>  ["https" browse-url ":"] 6 "\n\n(fn URL ARG)"]
> )
>   ("http" :follow
> #[514 "\301\300\302Q\"\207"
>  ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"]
> )
>   ("ftp" :follow
> #[514 "\301\300\302Q\"\207" ["ftp" browse-url ":"]
>  6 "\n\n(fn URL ARG)"]
> )
>   ("help" :follow org-link--open-help)
>   ("file" :complete org-link-complete-file)
>   ("elisp" :follow org-link--open-elisp)
>   ("doi" :follow org-link--open-doi))
>  org-link-elisp-confirm-function 'yes-or-no-p
>  )
> 





Re: Headline generation as in diary?

2020-09-03 Thread Michael Heerdegen
Ihor Radchenko  writes:

> I do not think there is support of multi-line planning everywhere.

I see.

> You can always use file-local definition at the beginning or end of your
> org file. Below is an example of local definition at the end of an org
> file.
>
> # Local Variables:
> # eval: (defun your-function () (sexp))

I didn't know that eval specs support multi-line sexps, but seems that
works, so I can indeed use this.  Thanks for the suggestion.

Michael.



Re: Putting the value of page-delimiter in some outline regexps?

2020-09-03 Thread Eric Abrahamsen
Nicolas Goaziou  writes:

> Hello,
>
> Eric Abrahamsen  writes:
>
>> I've been trying to find a way to cordon off the bottom of my Org files,
>> to create an area for file-local variables and "LocalWords" and what
>> have you that Org doesn't consider part of the file's final heading.
>>
>> The usual Emacs thing to do seems to be using the value of
>> page-delimiter to demarcate the end of content, and the beginning of
>> meta data. I stuck that into the value of `org-outline-regexp', and also
>> hard-coded it into the "true heading" branch of `org-end-of-subtree'.
>> Over the past day this has worked fine for interactive use, and some
>> automatic Org-based tools. But I'm not so naive as to think that
>> catastrophic breakage couldn't be right around the corner as a result of
>> this!
>>
>> Anyway, I wanted to see if anyone else had tried this, or had any ideas
>> about it.
>
> I think Org already puts some care into preserving file-local variables
> at the end of the buffer, e.g., when moving around headlines. Maybe the
> issues you're encountering can be fixed the same way.

Do you mean `org-preserve-local-variables'? I think it would make sense
to put `page-delimiter' in the re-search-backward regexp. We could also
consider putting in the value of some of the ispell-*-keyword constants,
but it might also be reasonable to just ask the user to hide all that
stuff under a page-delimiter.

This still doesn't stop `org-next-visible-heading' or
`org-end-of-subtree' from treating the end matter as part of the last
heading. This would only be a minor inconvenience if I weren't trying to
write some automatic tools on top of Org. But perhaps I should be making
my tools smarter, not insisting that Org get smarter.

> Adding page delimiter in `org-outline-regexp' is clearly not subtle
> enough in any case, as it would affect every headline, not only the last
> one in the buffer.

No, I guess I didn't really think that was going to be a practical
solution.

Thanks for considering this,
Eric




Re: auto-completion for file paths?

2020-09-03 Thread Dmitrii Korobeinikov
> org-insert-link (C-c C-l) will read a file name from you if you select
> "file:" or call it with a prefix argument.

This will do, thanks!

ср, 2 сент. 2020 г. в 03:08, Kyle Meyer :
>
> Dmitrii Korobeinikov writes:
>
> > Hi, all!
> >
> > Is there a way to provide completions for paths
> > [[file:suggest/completions/here]]?
>
> org-insert-link (C-c C-l) will read a file name from you if you select
> "file:" or call it with a prefix argument.



Re: Headline generation as in diary?

2020-09-03 Thread Ihor Radchenko
> Multi-line sexps in time stamps work would just be nice to have.  Would
> it be hard to achieve?  I mean, since multi-line %%(...) entries already
> work...

The problem is that org-mode assumes that planning line must be a single
line and a lot of internal logic hard-code this assumption.

For example, below is a fragment of org-get-property-block:

 ;; Move point to its position according to its positional rules.
 (cond ((org-before-first-heading-p)
(while (and (org-at-comment-p) (bolp)) (forward-line)))
   (t (forward-line)
  (when (looking-at-p org-planning-line-re) (forward-line

The last line clearly assumes that planning line is always a single
line. The same assumption is made in many other places in org-mode
internals. Though one may write a patch to make multi-line sexps work in
org-mode, there is also a problem with external tools working with org.
I do not think there is support of multi-line planning everywhere.

> I think this is inconvenient.  Ok, only a bit.  But it would be nicer if
> I could specify my dates in only one file.  Jumping around in my org
> file + my emacs init file is what I used to do.

You can always use file-local definition at the beginning or end of your
org file. Below is an example of local definition at the end of an org
file. 

# Local Variables:
# eval: (defun your-function () (sexp))

Best,
Ihor

Michael Heerdegen  writes:

> Ihor Radchenko  writes:
>
>> > When dealing with complicated date rules it can likely happen that a
>> > diary sexp doesn't fit into one line.
>>
>> Diary sexp can be a user-defined function. If your sexp needs to span
>> multiple lines, it is probably worth defining a function and simply
>> using <%%(your-function)> as a timestamp.
>
> I think this is inconvenient.  Ok, only a bit.  But it would be nicer if
> I could specify my dates in only one file.  Jumping around in my org
> file + my emacs init file is what I used to do.
>
> Multi-line sexps in time stamps work would just be nice to have.  Would
> it be hard to achieve?  I mean, since multi-line %%(...) entries already
> work...
>
>
> Thanks,
>
> Michael.



Re: Headline generation as in diary?

2020-09-03 Thread Ihor Radchenko
> It can? Thatʼs not documented, as far as I can tell.

It is literally called "diary sexp". You can use any elisp sexp there,
like (let ...) or (or ...) or (function-name ...)

Robert Pluim  writes:

>> On Thu, 03 Sep 2020 21:35:54 +0800, Ihor Radchenko  
>> said:
>
> >> When dealing with complicated date rules it can likely happen that a
> >> diary sexp doesn't fit into one line.
>
> Ihor> Diary sexp can be a user-defined function. If your sexp needs to 
> span
> Ihor> multiple lines, it is probably worth defining a function and simply
> Ihor> using <%%(your-function)> as a timestamp.
>
> It can? Thatʼs not documented, as far as I can tell.
>
> Robert



Re: Bug: No colors in first file opened [9.3.7 (9.3.7-dist @ c:/w/.emacs.d/org-9.3.7/lisp/)]

2020-09-03 Thread Dominick Samperi
Hello Bastien,

My current work-around is to map F12 to (org-mode-restart).

After installing a fresh version of Emacs 27.1 using the Windows
installer, and copying
org-9.3.7 to ~/.emacs.d, the first file I open is not colorized until
I use F12. My init.el contains:
(add-to-list 'load-path "~/.emacs.d/org-9.3.7/lisp")
(setq auto-mode-alist (cons '("\\.s?txt?\\'" . org-mode) auto-mode-alist))
(require 'org)

This happens when the first file I open has name foo.org, or bar.txt.
There are no problems when I continue to open files.

On Thu, Sep 3, 2020 at 6:09 AM Bastien  wrote:
>
> Hi Dominick,
>
> Dominick Samperi  writes:
>
> > No colors appear in first file opened. Must use (org-mode-restart)
> > to enable colors after opening first file.
>
> Can you provide a reproducible recipe?
>
> --
>  Bastien



Re: Are we still in a feature freeze?

2020-09-03 Thread TEC



Hello Bastien,

Below I've included some quick (hopefully useful) notes on the 
changes

I've made.

Bastien  writes:

p.s. If you'd like a TLDR on that website thread I started I'd 
happily
attempt one. I just hope you don't find me too presumptions 
going as far

as I have without having heard your thoughts on it.


Of course not!  I really appreciate the time and efforts you put 
in
this (daunting) task and I agree we should move on.  I just hope 
it
won't be too frustrating if I ask more changes or if we don't 
"buy"

your solution entirely.  I will carefully review it.


This makes me most happy to hear! While there is the 60-odd email 
chain
with all the relevant information, to hopefully make you life a 
little

easier here's a little summary:

+ I've forked https://code.orgmode.org/bzg/orgweb to[fn:1]
  https://github.com/tecosaur/orgwebsite
+ The current state of the site (+ any unpushed changes) can be 
seen at

  https://orgmode.tecosaur.com/
+ Technology changes:
  - now using SASS over CSS
  - static images are now (mostly) SVGs (thanks Cairo!)
  - brief screen-captures have been done as looping Gifs
  - jQuery has been removed
  - 'resources' (fonts, images, styles, js, html snippets) have 
  been

filed under ./resources
+ I've (re-)created the following pages: index, features,
  releases(changes), install, contribute, tools, and colophon
+ I've added documentation styling ripped from org-roam
+ I've added a bunch of 'social' meta-information (opengraph, 
twitter,

  and more). This should give nice embed content like:
  https://orgmode.tecosaur.com/resources/img/social-card.png

I think that's all the main points. Don't hesitate to ask if you 
have

any questions about what/why I've done.

I look forward to (finally :P) getting your feedback! Don't worry 
about
frustrating me with change requests, I just may ask what lead you 
to

make a particular request every now and then.

All the best, I eagerly await your feedback :)

Timothy.


[fn:1] I've also used LFS for files like images, fonts, etc. I 
have since

 noticed that for LFS to work with Gogs you'll need to update the
 version to 0.12. This has also caused a re-write of the history, 
 so a

 force push will be needed.



Re: Headline generation as in diary?

2020-09-03 Thread Robert Pluim
> On Thu, 03 Sep 2020 16:46:48 +0200, Michael Heerdegen 
>  said:

Michael> Robert Pluim  writes:
>> It can? Thatʼs not documented, as far as I can tell.

Michael> As a user, I read "Diary-style expression entries" in the org 
manual as
Michael> including my own defined diary sexps - excluding them would be a
Michael> surprise that should be documented (no, I don't want that to 
happen!).

Ah, I wasnʼt aware that "diary-style expression entries" and "lisp
expression with %% prepended" were the same thing.

And itʼs not likely to go away: org just runs those expressions
through `eval'.

Robert



Re: Are we still in a feature freeze?

2020-09-03 Thread Bastien
Hi Timothy,

TEC  writes:

> Ah, I see. I was going off a line in 
> https://orgmode.org/worg/org-contribute.html
> "If you are undertaking big changes, please create a dedicated branch"
>
> I'm not sure if ~10 commits counted, but thought this may be the way to
> go. Once again, thanks for clarifying.

You're welcome -- I rephrased the sentence on worg a bit to avoid
further confusion.

> p.s. If you'd like a TLDR on that website thread I started I'd happily
> attempt one. I just hope you don't find me too presumptions going as far
> as I have without having heard your thoughts on it.

Of course not!  I really appreciate the time and efforts you put in
this (daunting) task and I agree we should move on.  I just hope it
won't be too frustrating if I ask more changes or if we don't "buy"
your solution entirely.  I will carefully review it.

Best,

-- 
 Bastien



Re: Headline generation as in diary?

2020-09-03 Thread Michael Heerdegen
Robert Pluim  writes:

> It can? Thatʼs not documented, as far as I can tell.

As a user, I read "Diary-style expression entries" in the org manual as
including my own defined diary sexps - excluding them would be a
surprise that should be documented (no, I don't want that to happen!).

Michael.



Re: Headline generation as in diary?

2020-09-03 Thread Robert Pluim
> On Thu, 03 Sep 2020 21:35:54 +0800, Ihor Radchenko  
> said:

>> When dealing with complicated date rules it can likely happen that a
>> diary sexp doesn't fit into one line.

Ihor> Diary sexp can be a user-defined function. If your sexp needs to span
Ihor> multiple lines, it is probably worth defining a function and simply
Ihor> using <%%(your-function)> as a timestamp.

It can? Thatʼs not documented, as far as I can tell.

Robert



Re: Headline generation as in diary?

2020-09-03 Thread Michael Heerdegen
Ihor Radchenko  writes:

> > When dealing with complicated date rules it can likely happen that a
> > diary sexp doesn't fit into one line.
>
> Diary sexp can be a user-defined function. If your sexp needs to span
> multiple lines, it is probably worth defining a function and simply
> using <%%(your-function)> as a timestamp.

I think this is inconvenient.  Ok, only a bit.  But it would be nicer if
I could specify my dates in only one file.  Jumping around in my org
file + my emacs init file is what I used to do.

Multi-line sexps in time stamps work would just be nice to have.  Would
it be hard to achieve?  I mean, since multi-line %%(...) entries already
work...


Thanks,

Michael.



Re: Headline generation as in diary?

2020-09-03 Thread Ihor Radchenko
> When dealing with complicated date rules it can likely happen that a
> diary sexp doesn't fit into one line.

Diary sexp can be a user-defined function. If your sexp needs to span
multiple lines, it is probably worth defining a function and simply
using <%%(your-function)> as a timestamp.

Best,
Ihor

Michael Heerdegen  writes:

> Robert Pluim  writes:
>
>> I can push my change to org, but Iʼm not a regular org contributor, so
>> Iʼd prefer to hear from one of the maintainers first.
>
> Sorry - I meant, I see no reason to touch the existing code.  No need to
> change anything for what I want.
>
>> Michael> This doesn't work:
>>
>> Michael> | ** APPT 17:00 Test
>> Michael> | SCHEDULED: <%%(and (or (diary-date 03 09 2020)
>> Michael> |(diary-date 04 09 2020)))>
>
>> I think thatʼs just a consequence of timestamps not being allowed to
>> span multiple lines in org, unlike diary.
>
> This is bad.  Why is that?  Can it be changed?
>
> When dealing with complicated date rules it can likely happen that a
> diary sexp doesn't fit into one line.
>
> Regards,
>
> Michael.



Re: Default value and docstring of org-attach-store-link-p

2020-09-03 Thread Ihor Radchenko
> I don't have a strong opinion here.
>
> Why do you think it would it be a better as a default?

It seems that other people expect it to be default [1]. Also, I am using
org-attach heavily in my workflows. Most of the time I found myself
inserting the link to attachment right after attaching a file. Finally,
it do not see any drawback adding the link to history vs not adding.

I personally would prefer 'attached as a default, but it is mostly
because I use org-attach already and attach: link would be shorter.
Probably, 'file as default is safer if the user changes the :DIR:
property for some reason.

[1] 
https://www.reddit.com/r/emacs/comments/ihzh9r/orgmode_quicker_way_to_create_link_to_attachment/

> Feel free to propose a patch for this and the suggested switch, we can
> apply it after Org 9.4.

I will add it to my todo list. This should be lower priority than org-fold.el

Best,
Ihor

Bastien  writes:

> Hi Ihor,
>
> Ihor Radchenko  writes:
>
>> The default value of org-attach-store-link-p is nil for now.
>> Would it make more sense to set it to something else (say, 'attach)?
>> I believe that 'attach or t would be better as a default.
>>
>> Thoughts?
>
> I don't have a strong opinion here.
>
> Why do you think it would it be a better as a default?
>
>> Also, the docstring does not mention that there may be several different
>> non-nil values. It is only reflected in the :type field of defcustom.
>
> Feel free to propose a patch for this and the suggested switch, we can
> apply it after Org 9.4.
>
> Best,
>
> -- 
>  Bastien



Re: ob-java and ob-haxe

2020-09-03 Thread ian martins
That is understandable; they're big patches. I recommend going over ob-java
first. Java is probably more familiar to you and ob-java and ob-haxe are
very similar. These were mostly based on ob-python and ob-C. The tests are
based on ob-Cs tests.

Look carefully at org-babel-temp-dir and
org-babel-remove-temporary-directory. The patches override core but ideally
these would be changes in core.

I was hesitant to put these in ELPA because then the tests won't run when
org-mode is modified.


On Thu, Sep 3, 2020 at 12:56 AM Kyle Meyer  wrote:

> ian martins writes:
>
> > I posted patches for ob-java and ob-haxe a couple months ago but there
> was
> > no interest. I have been given access to push to contrib. If there's no
> > objection I'll put them there.
> >
> > I'll rename my version ob-java-alt so it doesn't conflict with the
> official
> > one. The contrib directory doesn't have a "testing" directory so I'll add
> > one. I'll document them in worg.
>
> My understanding is that there's been a move away from adding new
> libraries to contrib/, instead preferring an ELPA for cases where core
> isn't deemed appropriate.
>
> Fixes and enhancements to ob-java are obviously appropriate for core.
> And while it'd be fine to host ob-haxe separately, my impression is that
> it too would be suitable for core.
>
> I'm sorry your patches haven't gotten any reviews or other feedback.
> I've sat down a couple of times to review the ob-haxe patch but haven't
> ended up blocking off enough time to get anywhere.  I'll revisit it this
> weekend.  Of course, any feedback from those that actually use haxe
> would be appreciated.
>
>


Re: Headline generation as in diary?

2020-09-03 Thread Michael Heerdegen
Robert Pluim  writes:

> I can push my change to org, but Iʼm not a regular org contributor, so
> Iʼd prefer to hear from one of the maintainers first.

Sorry - I meant, I see no reason to touch the existing code.  No need to
change anything for what I want.

> Michael> This doesn't work:
>
> Michael> | ** APPT 17:00 Test
> Michael> | SCHEDULED: <%%(and (or (diary-date 03 09 2020)
> Michael> |(diary-date 04 09 2020)))>

> I think thatʼs just a consequence of timestamps not being allowed to
> span multiple lines in org, unlike diary.

This is bad.  Why is that?  Can it be changed?

When dealing with complicated date rules it can likely happen that a
diary sexp doesn't fit into one line.

Regards,

Michael.



Re: how to create next, previous, and up navigation links when exporting to html

2020-09-03 Thread Bastien
Hi Christopher,

Kyle Meyer  writes:

> Christopher W. Ryan writes:
>
>> how do I create next, previous, and up navigation links when exporting
>> to html, like in the org mode manual:
>>
>> https://orgmode.org/manual/HTML-specific-export-settings.html
>
> I think that's created in a two-step process: using
> org-texinfo-export-to-texinfo to generate a .texi file from
> org-manual.org and then feeding that result to makeinfo.

Indeed.  next, previous and down/up navigation links are from the
makeinfo --html command, when run against the org.texi version.

2 cents,

-- 
 Bastien



Re: new feature for consideration: other-tab for org-agenda-window-setup

2020-09-03 Thread Bastien
Hi again,

Eric S Fraga  writes:

> Patch attached.  Comments welcome, of course.

IMHO it deserves a small addition to etc/ORG-NEWS.

Can one of you add it?

-- 
 Bastien



Re: Are we still in a feature freeze?

2020-09-03 Thread TEC


Hi Bastien!

Great to see you back on the lists again :)

Bastien  writes:

> Good guess :)   I'm rolling up my sleeves to get to 9.4 ASAP so that
> we can commit features in the master branch again soonish.
>
> Still, you can share patches on the list, that's useful to discuss
> and improve them.

I won't hold back till 9.4 is released then, thanks for confirming the status.

> We do not use code.orgmode.org for collaborative development, we
> use this list instead.  You can still create a clone of Org where
> you see fit.

Ah, I see. I was going off a line in 
https://orgmode.org/worg/org-contribute.html
"If you are undertaking big changes, please create a dedicated branch"

I'm not sure if ~10 commits counted, but thought this may be the way to
go. Once again, thanks for clarifying.

Much appreciated!

Timothy.

p.s. If you'd like a TLDR on that website thread I started I'd happily
attempt one. I just hope you don't find me too presumptions going as far
as I have without having heard your thoughts on it.



Re: Default value and docstring of org-attach-store-link-p

2020-09-03 Thread Bastien
Hi Ihor,

Ihor Radchenko  writes:

> The default value of org-attach-store-link-p is nil for now.
> Would it make more sense to set it to something else (say, 'attach)?
> I believe that 'attach or t would be better as a default.
>
> Thoughts?

I don't have a strong opinion here.

Why do you think it would it be a better as a default?

> Also, the docstring does not mention that there may be several different
> non-nil values. It is only reflected in the :type field of defcustom.

Feel free to propose a patch for this and the suggested switch, we can
apply it after Org 9.4.

Best,

-- 
 Bastien



Re: Are we still in a feature freeze?

2020-09-03 Thread Bastien
Hi Timothy,

TEC  writes:

> Are we still in a feature freeze? 

Yes.

> At the start of June Bastien announced a feature freeze (Release
> 9.3.7). As we are now moving into September, I'm wondering if this
> is still in effect? I can't see any recent emails from Bastien
> either so I'm guessing he's just been snowed under with work.

Good guess :)   I'm rolling up my sleeves to get to 9.4 ASAP so that 
we can commit features in the master branch again soonish.

Still, you can share patches on the list, that's useful to discuss
and improve them.

> If we are still in a
> feature freeze, it would be nice if I could get an account on
> code.orgmode.org so I can fork org-mode and make some feature
> branches.

We do not use code.orgmode.org for collaborative development, we
use this list instead.  You can still create a clone of Org where 
you see fit.

Thanks,

-- 
 Bastien



Re: new feature for consideration: other-tab for org-agenda-window-setup

2020-09-03 Thread Bastien
Kyle Meyer  writes:

> Kyle Meyer writes:
>
>> I'll let this sit for another day to see if other comments come in.
>
> Applied (e8ebf5d6c).

A welcome enhancement - thanks Eric and Kyle!

-- 
 Bastien



Re: Bug: No colors in first file opened [9.3.7 (9.3.7-dist @ c:/w/.emacs.d/org-9.3.7/lisp/)]

2020-09-03 Thread Bastien
Hi Dominick,

Dominick Samperi  writes:

> No colors appear in first file opened. Must use (org-mode-restart)
> to enable colors after opening first file.

Can you provide a reproducible recipe?

-- 
 Bastien



Re: ox-* vs org-* naming convention?

2020-09-03 Thread Bastien
Hi Diego,

Diego Zamboni  writes:

> Just a quick update: issue
> https://github.com/purcell/package-lint/issues/89 submitted by Kaushal
> has been closed through the PR I submitted, so now package-lint
> officially accepts "org-" symbols in "ox-" and "ob-" packages :)

Thanks for taking care of this!

-- 
 Bastien



Re: Get Grades Done: the joys of Org's simple power

2020-09-03 Thread Bastien
Hi Richard,

Richard Lawrence  writes:

> I haven't tested it extensively, and the code can surely be improved,
> but it works for the cases I could think to test.

thanks for writing and sharing this - perhaps you can add a link to
this message in https://orgmode.org/worg/org-hacks.html ?

Best,

-- 
 Bastien



Re: [Announcement] lsp-mode integration with org-mode

2020-09-03 Thread Bastien
stardiviner  writes:

> This is really great to get official support for Org Mode.

+1!  Thanks Ivan.

-- 
 Bastien



Re: [feature request] A new cookie type [!] showing the last note taken

2020-09-03 Thread Nicolas Goaziou
Hello,

Ihor Radchenko  writes:

> I may miss something, but it does not look [for me] any more specific
> in comparison with headline format:
>
> - headline :: "^\*+ .+$"
> - first line of note :: "^[ \t]*-.+$"

I do see a big difference, tho. Starting a line with an asterisk
followed by a space _always_ create a headline. However, writing an item
with a line break at the end of its first line is not necessarily
a note.

  - Question.\\
Why would this be a note?

  - Answer.\\
It isn't.

So, suggested syntax is too ambiguous.

Regards,
-- 
Nicolas Goaziou



Bug: [PATCH] org-datetree-insert-line doesn't honor headline spacing customization [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)]

2020-09-03 Thread Vasilij Schneidermann


When doing org captures using the datetree format, newly added headlines
do not follow the value of `org-blank-before-new-entry'.  This seems to
be the fault of `org-datetree-insert-line' using `insert' as opposed to
`org-insert-heading' to do its work.  See the attachment for a proposed
fix.




Emacs  : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22)
 of 2020-08-13
Package: Org mode version 9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 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-enforce-todo-dependencies t
 org-time-stamp-rounding-minutes '(0 15)
 org-reveal-start-hook '(org-decrypt-entry)
 org-blocker-hook '(org-block-todo-from-checkboxes
org-block-todo-from-children-or-siblings-or-parent)
 org-cycle-include-plain-lists 'integrate
 org-mode-hook '(#[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-startup-indented t
 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-babel-pre-tangle-hook '(save-buffer)
 org-file-apps '(("pdf" . system) (auto-mode . emacs) (system . "xdg-open %s")
 (t . system))
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-export-backends '(ascii beamer html latex md)
 org-ellipsis 'org-ellipsis
 org-src-preserve-indentation t
 org-catch-invisible-edits 'error
 org-occur-hook '(org-first-headline-recenter)
 org-enforce-todo-checkbox-dependencies t
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate
  org-babel-speed-command-activate)
 org-capture-mode-hook '(evil-insert-state)
 org-M-RET-may-split-line nil
 org-return-follows-link t
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("attachment" :follow org-attach-open-link :export
org-attach-export-link :complete 
org-attach-complete-link)
   ("id" :follow org-id-open)
   ("eww" :follow eww :store org-eww-store-link)
   ("rmail" :follow org-rmail-open :store
org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
   ("irc" :follow org-irc-visit :store org-irc-store-link
:export org-irc-export)
   ("info" :follow org-info-open :export org-info-export
:store org-info-store-link)
   ("gnus" :follow org-gnus-open :store org-gnus-store-link)
   ("docview" :follow org-docview-open :export
org-docview-export :store org-docview-store-link)
   ("bibtex" :follow org-bibtex-open :store
org-bibtex-store-link)
   ("bbdb" :follow org-bbdb-open :export org-bbdb-export
:complete org-bbdb-complete-link :store
org-bbdb-store-link)
   ("w3m" :store org-w3m-store-link) ("file+sys")
   ("file+emacs") ("shell" :follow org-link--open-shell)
   ("news" :follow
#[257 "\301\300\302Q!\207" ["news" browse-url ":"] 5
  "\n\n(fn URL)"]
)
   ("mailto" :follow
#[257 "\301\300\302Q!\207" ["mailto" browse-url ":"] 5
  "\n\n(fn URL)"]
)
   ("https" :follow
#[257 "\301\300\302Q!\207" ["https" browse-url ":"] 5
  "\n\n(fn URL)"]
)
   ("http" :follow
#[257 "\301\300\302Q!\207" ["http" browse-url ":"] 5
  "\n\n(fn URL)"]
)
   ("ftp" :follow
#[257 "\301\300\302Q!\207" ["ftp" browse-url ":"] 5
 

Re: Putting the value of page-delimiter in some outline regexps?

2020-09-03 Thread Nicolas Goaziou
Hello,

Eric Abrahamsen  writes:

> I've been trying to find a way to cordon off the bottom of my Org files,
> to create an area for file-local variables and "LocalWords" and what
> have you that Org doesn't consider part of the file's final heading.
>
> The usual Emacs thing to do seems to be using the value of
> page-delimiter to demarcate the end of content, and the beginning of
> meta data. I stuck that into the value of `org-outline-regexp', and also
> hard-coded it into the "true heading" branch of `org-end-of-subtree'.
> Over the past day this has worked fine for interactive use, and some
> automatic Org-based tools. But I'm not so naive as to think that
> catastrophic breakage couldn't be right around the corner as a result of
> this!
>
> Anyway, I wanted to see if anyone else had tried this, or had any ideas
> about it.

I think Org already puts some care into preserving file-local variables
at the end of the buffer, e.g., when moving around headlines. Maybe the
issues you're encountering can be fixed the same way.

Adding page delimiter in `org-outline-regexp' is clearly not subtle
enough in any case, as it would affect every headline, not only the last
one in the buffer.

Regards,
-- 
Nicolas Goaziou



Bug: Source blocks before first ":tangle yes" are not tangled to file [9.4 (nil @ /Users/ezchi/.emacs.d/.local/straight/build/org-mode/)]

2020-09-03 Thread Enze Chi
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

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

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


I have a org file like this (test_tangle.org):

#+begin_src emacs-lisp
  (setq foo "hello") ;
#+end_src

#+begin_src emacs-lisp :tangle yes
  (setq bar "world")
#+end_src


After I run "(org-babel-tangle nil nil)"

I expect both of them are tangled to "test_tangle.el":

(setq foo "hello")
(setq bar "world")


But I only got:

(setq bar "world")



Emacs  : GNU Emacs 27.1.50 (build 1, x86_64-apple-darwin19.6.0, NS
appkit-1894.60 Version 10.15.6 (Build 19G73))
 of 2020-08-14
Package: Org mode version 9.4 (nil @
/Users/ezchi/.emacs.d/.local/straight/build/org-mode/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 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-mode-hook '(#[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-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
 org-babel-header-arg-expand)
 org-agenda-loop-over-headlines-in-active-region nil
 org-occur-hook '(org-first-headline-recenter)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
 org-cycle-show-empty-lines
 org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate
 org-babel-speed-command-activate)
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("attachment" :follow org-attach-follow :complete
org-attach-complete-link)
  ("id" :follow org-id-open)
  ("eww" :follow org-eww-open :store org-eww-store-link)
  ("rmail" :follow org-rmail-open :store
org-rmail-store-link)
  ("mhe" :follow org-mhe-open :store org-mhe-store-link)
  ("irc" :follow org-irc-visit :store org-irc-store-link
:export org-irc-export)
  ("info" :follow org-info-open :export org-info-export
:store org-info-store-link)
  ("gnus" :follow org-gnus-open :store
org-gnus-store-link)
  ("docview" :follow org-docview-open :export
org-docview-export :store org-docview-store-link)
  ("bibtex" :follow org-bibtex-open :store
org-bibtex-store-link)
  ("bbdb" :follow org-bbdb-open :export org-bbdb-export
:complete org-bbdb-complete-link :store
org-bbdb-store-link)
  ("w3m" :store org-w3m-store-link) ("file+sys")
  ("file+emacs") ("shell" :follow org-link--open-shell)
  ("news" :follow
#[514 "\301\300\302Q\"\207"
 ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"]
)
  ("mailto" :follow
#[514 "\301\300\302Q\"\207"
 ["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"]
)
  ("https" :follow
#[514 "\301\300\302Q\"\207"
 ["https" browse-url ":"] 6 "\n\n(fn URL ARG)"]
)
  ("http" :follow
#[514 "\301\300\302Q\"\207"
 ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"]
)
  ("ftp" :follow
#[514 "\301\300\302Q\"\207" ["ftp" browse-url ":"]
 6 "\n\n(fn URL ARG)"]
)
  ("help" :follow org-link--open-help)
  ("file" :complete org-link-complete-file)
  ("elisp" :follow org-link--open-elisp)
  ("doi" :follow org-link--open-doi))
 org-link-elisp-confirm-function 'yes-or-no-p
 )


Re: Bug: No colors in first file opened [9.3.7 (9.3.7-dist @ c:/w/.emacs.d/org-9.3.7/lisp/)]

2020-09-03 Thread Huszaghmatt
  
  

 Does refreshing the buffer work too? If so, I’ve had the same issue for a 
while, but never really knew what was going on?
  

  
Matt
  

  
  

  
  
>   
> On Sep 2, 2020 at 10:20 PM,  mailto:djsamp...@gmail.com)>  
> wrote:
>   
>   
>   
>  No colors appear in first file opened. Must use (org-mode-restart) to enable 
> colors after opening first file.  
>
>   
  
  
 

Re: [PATCH] Omit file description when :file-desc has nil value

2020-09-03 Thread Matt Huszagh
Matt Huszagh  writes:

> This patch omits a file description when :file-desc has a nil
> value.

I've modified the patch to yield the same effect when executing a source
block.

Matt

>From 24d156e421973b5a97f1c797d48f1daa95348898 Mon Sep 17 00:00:00 2001
From: Matt Huszagh 
Date: Wed, 2 Sep 2020 23:06:10 -0700
Subject: [PATCH] lisp/ob-core.el: Omit file description when :file-desc has
 nil value

* lisp/ob-core.el (org-babel-insert-result): Omit file description
when :file-desc value evaluates to nil.
(org-babel-execute-src-block): Perform the same functionality when
executing a src block.

The previous implementation makes it impossible to provide a default
:file-desc and in some cases override it to omit the description.
---
 lisp/ob-core.el | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 578622232..02c0a153c 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -750,7 +750,8 @@ block."
 (org-babel-result-to-file
  file
  (let ((desc (assq :file-desc params)))
-   (and desc (or (cdr desc) result)))
+   (and (and desc (cdr desc))
+	(cdr desc)))
 		  (setq result (org-babel-ref-resolve post))
 		  (when file
 			(setq result-params (remove "file" result-params))
@@ -2257,9 +2258,9 @@ INFO may provide the values of these header arguments (in the
 	 (setq result (org-no-properties result))
 	 (when (member "file" result-params)
 	   (setq result (org-babel-result-to-file
-			 result (when (assq :file-desc (nth 2 info))
-  (or (cdr (assq :file-desc (nth 2 info)))
-  result))
+			 result (when (and (assq :file-desc (nth 2 info))
+	   (cdr (assq :file-desc (nth 2 info
+  (cdr (assq :file-desc (nth 2 info
 	((listp result))
 	(t (setq result (format "%S" result
   (if (and result-params (member "silent" result-params))
-- 
2.28.0



[PATCH] Omit file description when :file-desc has nil value

2020-09-03 Thread Matt Huszagh
Hello,

This patch omits a file description when :file-desc has a nil
value. Previously, the following src block

#+BEGIN_SRC asymptote :results value file :file circle.pdf :file-desc 
:output-dir img/
  size(2cm);
  draw(unitcircle);
#+END_SRC

would yield

#+RESULTS:
[[file:img/circle.pdf][circle.pdf]]

This makes it impossible (I think) to provide :file-desc with a default
value and prevent the description in some cases. This patch would cause
the same code block to execute to

#+RESULTS:
[[file:img/circle.pdf]]

I feel I may be missing something in regard to why this previously had
the functionality it did. Is there a use case I've missed? To me, the
documentation seems to indicate that my patch is the desired behavior:

   The =file-desc= header argument defines the description (see
   [[*Link Format]]) for the link.  If =file-desc= has no value, the
   "description" part of the link will be omitted.

Full disclaimer: I wrote this section of the documentation as part of
this patch:

https://lists.gnu.org/archive/html/emacs-orgmode/2020-07/msg00320.html

Thanks
Matt

>From edcfa85add6ac71a1e13b7731779ccf4a8e12868 Mon Sep 17 00:00:00 2001
From: Matt Huszagh 
Date: Wed, 2 Sep 2020 23:06:10 -0700
Subject: [PATCH] lisp/ob-core.el: Omit file description when :file-desc has
 nil value

* lisp/ob-core.el (org-babel-insert-result): Omit file description
when :file-desc value evaluates to nil.

The previous implementation makes it impossible to provide a default
:file-desc and in some cases override it to omit the description.
---
 lisp/ob-core.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 578622232..55165ebc5 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -2257,9 +2257,9 @@ INFO may provide the values of these header arguments (in the
 	 (setq result (org-no-properties result))
 	 (when (member "file" result-params)
 	   (setq result (org-babel-result-to-file
-			 result (when (assq :file-desc (nth 2 info))
-  (or (cdr (assq :file-desc (nth 2 info)))
-  result))
+			 result (when (and (assq :file-desc (nth 2 info))
+	   (cdr (assq :file-desc (nth 2 info
+  (cdr (assq :file-desc (nth 2 info
 	((listp result))
 	(t (setq result (format "%S" result
   (if (and result-params (member "silent" result-params))
-- 
2.28.0