Re: org-babel-load-file support elisp

2020-02-09 Thread Bastien
Hi Tim and Troy,

Tim Cross  writes:

> I came across this inconsistency a while back. I think the problem is
> that you should *not* be able to use elisp as a language specifier in
> source blocks.
>
> All other language specifiers comply to the pattern of source block
> languages being the language major mode name without the '-mode', but
> there is no elisp-mode.
>
> The problem now is that removing support for 'elisp' would break too
> much.

What I suggest for this particular issue is this: first be liberal
while staying consistent (thus allowing "elisp" as Troy suggest),
then be strict when a major release is issued (thus removing aliases
that are problematic, not just "elisp" but others.)

WDYT?  Troy, would you be able to prepare a patch for this?

Thanks,

-- 
 Bastien



Re: babel latex headers and image generation commands

2020-02-09 Thread Bastien
Hi Matt,

Matt Huszagh  writes:

> What do people think? If there's any interest, I'm more than happy to
> put in the extra time and add this functionality to
> latex-execute.

If you find the time to share your change as a _patch_ (not the whole
updated Elisp function), that will allow more readers on this list to
quickly understand what is at stake.

Thanks!

-- 
 Bastien



Re: Faster version of org-find-olp

2020-02-09 Thread Bastien
Hi Eric,

Eric Abrahamsen  writes:

> I ended up writing a function on top of that that does find-or-create,
> so you can go to a certain outline path, creating and inserting
> (optionally in sorted order) the missing segments as you go. It was
> fairly difficult to get right, so perhaps it will be of use to someone,
> or appropriate for Worg or even Org proper:
>
> https://github.com/girzel/timesheet.el/blob/master/timesheet.el#L250

thanks for this - don't hesitate to reference it somewhere on Worg if
you think that's useful.

If you think this should go to Org's core, please make a patch and
tell what's the difference with your patch and how to test it to make
sure we really understand the issue at stake.  I don't have any issue
with the current implementation of `org-find-olp' so I cannot really
know.

Thanks!

-- 
 Bastien



Re: How to set time limit and memory limit for execution of source blocks

2020-02-09 Thread Anoop GR
Thanks for the tip Ken.
I will get hold of one of those packages and modify it to my needs.


On Sun, Feb 9, 2020 at 8:24 PM Ken Mankoff  wrote:

> On 2020-02-03 at 22:40 -08, Anoop GR  wrote...
> > How do I enforce the same on my orgmode source blocks. I want the
> > execution to stop whenever it exceeds the above limits on memory and
> > time.
>
> There are several packages that implement :async source blocks via the
> :async header arg. It seems like one of these could be fairly easy to adapt
> to monitor the process it spawns.
>
>   -k.
>
>


Re: Glacial file operation!

2020-02-09 Thread Bastien
Sharon Kimble  writes:

> I actually solved it after I'd emailed you

Glad to read this, and thanks for replying!

-- 
 Bastien



Re: Prose with markup needs more line spacing [legibility 5/6]

2020-02-09 Thread Bastien
Hi Samuel,

Samuel Wales  writes:

> i'd sure like to change physical indentation in org to don't.

please try

  (setq org-adapt-indentation 'headline-data)

from latest master branch, and see how it behaves in a new org buffer.

-- 
 Bastien



Re: Make code elements in prose unobtrusive [legibility 6/6]

2020-02-09 Thread Bastien
Tim Cross  writes:

> Changing defaults is far more problematic as it has the potential to
> impact a large number of existing users who have their environment
> configured the way they like already.

Yes, indeed.

-- 
 Bastien



Re: Prose with markup needs more line spacing [legibility 5/6]

2020-02-09 Thread Bastien
Texas Cyberthal  writes:

> #+begin_src elisp
> ;; prose with markup needs more line spacing
> (defun leo-space-lines ()
>   (setq line-spacing 0.175))
> (add-hook 'org-mode-hook 'leo-space-lines)
> #+end_src

This can definitely be part of the Emacs theme you can write to target
prose writers.

-- 
 Bastien



Re: Fixed vs variable pitch font [legibility 4/6]

2020-02-09 Thread Bastien
Adam Porter  writes:

> Having said that, if Org could have a simple org-mixed-pitch-mode, or
> something like that, that could be very helpful, since it could make
> such configuration much easier.

If anyone wants to start coding something like this, we can consider
referencing it on Worg.

-- 
 Bastien



Re: org-adapt-indentation default should be nil [legibility 3/6]

2020-02-09 Thread Bastien
Hi Texas and Adam,

Adam Porter  writes:

>> Beginners are bad at making adjustments to keep heavily-indented
>> prose legible. Thus the default should be nil.
>
> I think you have a better case for changing this setting.

The default `org-adapt-indentation' can indeed be problematic.

One problem is that you typically want planning information and
property/logbook drawer of a headline to be indented, while you
don't want the subtree *text* to be indented.

>From master, you can test

  (setq org-adapt-indentation 'headline-data)

To get this behavior.  I think it should be the default, but
(1) it should be heavily tested first via a major release and
(2) other users may think otherwise, this needs to be carefully
discussed first.

Thanks,

-- 
 Bastien



Re: org-startup-truncated default should be nil [legibility 2/6]

2020-02-09 Thread Bastien
Hi Texas,

Texas Cyberthal  writes:

> #+begin_src elisp
> (org-startup-truncated nil)
> #+end_src

I disagree.

The whole discussion about mixing prose and code in the same buffer is
interesting: ideas like mixing variable pitch fonts, truncating lines
for specific parts of the buffer, etc. are all worth experimenting,
but they are about *Emacs*, not just Org.

Your best luck is to discuss this on emacs-devel first.

Thanks,

-- 
 Bastien



Re: Defaults for noobs, dotfiles for vets [legibility 1/6]

2020-02-09 Thread Bastien
Hi Texas and Adam,

Adam Porter  writes:

>> Inexperienced users will mostly use Org for longform prose, since they
>> haven't learned its database functions yet. Since Org aspires to be a
>> personal info manager, it should prioritize prose presentation above
>> code conventions.
>
> Org is not intended more for prose writing than for other uses.  We
> should not prioritize one such use above others.

I strongly agree with Adam here.

Also, defaults are for *every* users, they should not target beginners
over experienced users.

IMHO the best way to target different kinds of users is to write Emacs
themes for them.

We could advertize these themes more prominently on orgmode.org.

Would you like to write a theme, publish it and reference it on Worg?

See https://orgmode.org/worg/org-contribute.html on how to contribute
to Worg.

Thanks,

-- 
 Bastien



Re: Possible bug report: URL capitalization in online manual

2020-02-09 Thread Bastien
Hi Ori,

thanks a lot for taking the trouble to produce this file, very useful.

I've now installed the rewrite rules on the server and all these links
are redirecting correctly. Given the amount of Org documentation links
living out there, that's really a good idea.

> Versioned folders living side-by-side.

I've thought about this, but I think it is too much. If someone thinks
otherwise, anyone can volunteer to maintain multiple versions of the
documentation on the website.

Thanks again!

-- 
 Bastien



Re: Bug: org-indent-region doesn't restore cursor position when org-src-tab-acts-natively is t [9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/26.3/lisp/org/)]

2020-02-09 Thread Bastien
Hi Sébastien,

Sébastien Miquel  writes:

> As far as I can tell, this is still broken in 9.3.3, which has your
> fix included.

yes, the initial fix was wrong.

The current behavior when the region is active in a src block is to
indent the whole source block, which is not what the user expect.  The
problem with the cursor going back to the beginning of the block comes
on top of this (bigger?) problem.

I could not find a proper fix yet, I will try later this week.

Thanks,

-- 
 Bastien



Re: [PATCH] Fix `org-babel-detangle' handling of false positives

2020-02-09 Thread Bastien
Hi Kevin,

Kevin Foley  writes:

> Thank you for the feedback!  I'm working with my employer regarding
> copyright assignment and should have that sorted out shortly.  I'll
> submit the proposed changes once that's taken care.

great, thanks a lot for taking the time to go through this!

-- 
 Bastien



Re: Possible bug report: URL capitalization in online manual

2020-02-09 Thread Ori
Hi Bastien,

Attached are the relevant URL aliases.

When I initially saw the issue I thought it was a matter of a change to the
way the docs are built, not old vs new documentation. That makes the list
I've attached a little tricky to maintain. Of course within emacs is the
best way for a user to reach the documentation, but maybe a different
approach for the web would be appropriate. Some ideas:

Versioned folders living side-by-side. That's done in some other projects
like Django, CommonMark, Bootstrap. A script could go into files from the
last version and indicate that these are docs for an older version of Org.

Keep aliasing. Require an alias added each time is removed or is renamed.
The script here would be a check between versions. Seems like more friction
both in creating the check and in requiring the aliases, though big
rearranges don't seem to be the norm so perhaps it's not so bad.

Just leave it. The easy option!

Maybe there are others.

At any rate, thanks for your help.

Ori

On Sat, Feb 8, 2020 at 2:56 PM Bastien  wrote:

> Hi Ori,
>
> Ori  writes:
>
> > I'm not sure which repo this all lives in but I believe since
> > information has been added to the paths, this should be easy. The
> > other direction would be trickier and would need the old scheme.
> >
> > Wherever the current filename has capital letters after the first
> > character, make an alias using the sentence-case version.
> >
> > Happy to take a stab at this if you can point me to the repo!
>
> Thanks a lot for your help!
>
> https://code.orgmode.org/bzg/org-mode/ is where doc/org-manual.org
> lives.
>
> By exporting the manual with ~$ make html and bisecting from Org's
> repository, you may find the list of aliases that I can add.
>
> I searched nginx docs on how to make URL matching case-insensible:
> from what I understand, you can rewrite a case-sensibility-ignored
> URL to another URL, but you cannot completely ignore case-sensibility.
>
> If I am wrong, please let me know.
>
> --
>  Bastien
>
;; /guide/ url aliases, (currentFile . oldFile)
(("ASCII_002fUTF_002d8-Export.html" . "ASCII_002fLatin_002d1_002fUTF_002d8-export.html")
 ("Agenda-Commands.html" . "Agenda-commands.html")
 ("Agenda-Dispatcher.html" . "Agenda-dispatcher.html")
 ("Agenda-Files.html" . "Agenda-files.html")
 ("Breaking-Down-Tasks.html" . "Breaking-down-tasks.html")
 ("Built_002din-Agenda-Views.html" . "Built_002din-agenda-views.html")
 ("Capture-Refile-Archive.html" . "Capture-_002d-Refile-_002d-Archive.html")
 ("Clocking-Work-Time.html" . "Clocking-work-time.html")
 ("Comment-Lines.html" . "Comment-lines.html")
 ("Creating-Timestamps.html" . "Creating-timestamps.html")
 ("Custom-Agenda-Views.html" . "Custom-agenda-views.html")
 ("Deadlines-and-Scheduling.html" . "Deadlines-and-scheduling.html")
 ("Emphasis-and-Monospace.html" . "Emphasis-and-monospace.html")
 ("Export-Settings.html" . "Export-options.html")
 ("External-Links.html" . "External-links.html")
 ("Global-TODO-List.html" . "Global-TODO-list.html")
 ("HTML-Export.html" . "HTML-export.html")
 ("Handling-Links.html" . "Handling-links.html")
 ("Include-Files.html" . "Include-files.html")
 ("LaTeX-Export.html" . "LaTeX-and-PDF-export.html")
 ("Matching-Tags-and-Properties.html" . "Matching-tags-and-properties.html")
 ("Multi_002dstate-Workflow.html" . "Multi_002dstate-workflows.html")
 ("Plain-Lists.html" . "Plain-lists.html")
 ("Progress-Logging.html" . "Progress-logging.html")
 ("Refile-and-Copy.html" . "Refile-and-copy.html")
 ("Search-View.html" . "Search-view.html")
 ("Setting-up-capture.html" . "Setting-up-a-capture-location.html")
 ("Sparse-Trees.html" . "Sparse-trees.html")
 ("Structure-Editing.html" . "Structure-editing.html")
 ("Table-of-Contents.html" . "Table-of-contents.html")
 ("The-Export-Dispatcher.html" . "The-export-dispatcher.html")
 ("Visibility-Cycling.html" . "Visibility-cycling.html")
 ("Working-with-Source-Code.html" . "Working-With-Source-Code.html")
 ("iCalendar-Export.html" . "iCalendar-export.html"))

;; /manual/ url aliases, (currentFile . oldFile)
(("Add_002don-Packages.html" . "Add_002don-packages.html")
 ("Adding-Export-Back_002dends.html" . "Adding-export-back_002dends.html")
 ("Adding-Hyperlink-Types.html" . "Adding-hyperlink-types.html")
 ("Advanced-Export-Configuration.html" . "Advanced-configuration.html")
 ("Agenda-Column-View.html" . "Agenda-column-view.html")
 ("Agenda-Commands.html" . "Agenda-commands.html")
 ("Agenda-Dispatcher.html" . "Agenda-dispatcher.html")
 ("Agenda-Files.html" . "Agenda-files.html")
 ("Agenda-Views.html" . "Agenda-views.html")
 ("Batch-Execution.html" . "Batch-execution.html")
 ("Beamer-Export.html" . "Beamer-export.html")
 ("Breaking-Down-Tasks.html" . "Breaking-down-tasks.html")
 ("Built_002din-Agenda-Views.html" . "Built_002din-agenda-views.html")
 ("Built_002din-Table-Editor.html" . "Built_002din-table-editor.html")
 ("Clean-View.html" . "Clean-view.html")
 ("Clocking-Work-Time.html" . "Clocking-work-time.html")
 

Re: [PATCH] Fix `org-babel-detangle' handling of false positives

2020-02-09 Thread Kevin Foley
Hi Bastien,

Thank you for the feedback!  I'm working with my employer regarding
copyright assignment and should have that sorted out shortly.  I'll
submit the proposed changes once that's taken care.

Kevin

Bastien  writes:

> Hi Kevin,
>
> this looks good.  The patch is significant enough that we need you to
> sign the FSF copyright assignment papers.  Here is the form:
>
> https://code.orgmode.org/bzg/org-mode/raw/master/request-assign-future.txt
>
> Once you're done with this, we can push your commit.
>
> Should you contribute more, we can give you push access.
>
> Some comments below:
>
> Foley  writes:
>
>> This patch fixes the way `org-babel-detangle' handles false positive
>> matches for links.  Without the patch it tries to use match data that
>> may not be present in a false positive.  I've also included a regression
>> test.
>>
>> This is my first contribution to Org Mode or Emacs and my first patch
>> by mailing list so please let me know if I've overlooked anything.
>>
>> Also note I have not assigned copyright to FSF at this time, however I
>> believe this change should be small enough to not require it.
>>
>> Kevin Foley
>>
>> From 82e2d108536101c5a5ff9f8a0009051e5a308a3a Mon Sep 17 00:00:00 2001
>> From: "Kevin J. Foley" 
>> Date: Tue, 28 Jan 2020 17:51:29 -0500
>> Subject: [PATCH] Fix `org-babel-detangle' handling of false positives
>>
>> * lisp/ob-tangle.el (org-babel-detangle): Handle false positive
>> matches of `org-link-bracket-re'
>   ^
>   There should be a "." at the end of
>   sentences in changelog entries.
>
>> * testing/examples/babel.el: New file for babel detangle false
>> positive test
>^
>Same here.
>
>> * testing/examples/babel.org (detangle): Add detangle/false positive
>> example
>  ^
>  And here.
>
>> * testing/lisp/test-ob-tangle.el (ob-tangle/detangle-false-positive):
>> Add test for detangle false positive
>   ^ And here.
>   
>> TINYCHANGE
>
> Well, there are more than 15 lines of changes.  Signing the FSF papers
> will allow you to submit more changes later.
>
> Thanks!
>
> -- 
>  Bastien



Re: Bug: org-indent-region doesn't restore cursor position when org-src-tab-acts-natively is t [9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/26.3/lisp/org/)]

2020-02-09 Thread Sébastien Miquel

Thank you for looking into this.

As far as I can tell, this is still broken in 9.3.3, which has your fix 
included.


I've updated org to 9.3.3, describe-function brings me to the org.el 
file with your save-window-excursion modification, and I've deleted the 
.elc file just in case.




Hi Sébastien,

Sébastien Miquel  writes:


Thank you for your reply.

I can still reproduce with latest Org

Mh, yes, I can reproduce this now, and this is fixed in maint.

Thanks!





Re: How to set time limit and memory limit for execution of source blocks

2020-02-09 Thread Ken Mankoff
On 2020-02-03 at 22:40 -08, Anoop GR  wrote...
> How do I enforce the same on my orgmode source blocks. I want the
> execution to stop whenever it exceeds the above limits on memory and
> time.

There are several packages that implement :async source blocks via the :async 
header arg. It seems like one of these could be fairly easy to adapt to monitor 
the process it spawns.

  -k.




Bug: broken org-cycle-include-plain-lists integrate [9.3.3 (9.3.3-elpa @ /home/bruce/.emacs.d/elpa/org-9.3.3/)]

2020-02-09 Thread Bruce Tulloch
* Bug Report

  (setq org-cycle-include-plain-lists 'integrate)

  seems to have no effect.

  That is, plain lists are no longer cycling as children of outline headings.

* Example

  This content appears when cycling on Example

  * This plain list line appears (correct)
* this line also appears (incorrect)
* this one too (it shouldn't)
  * but this one should appear (and does)
  * as does this one but
* this should not (but does)
  * and so does this one
* Discussion

  When cycling on the heading, plain lists always appears in the expanded state
  since upgrading to 9.3.3. The plain list will not cycle (as children of the
  heading). It appears that when org-cycle-include-plain-lists is 'integrate it
  is behaving the same as when set to t.

  This changed has appeared since 9.2.1 (which used to work).
* Current State
  #+begin_src elisp
  (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-html-head-include-scripts nil
org-metadown-hook '(org-babel-pop-to-session-maybe)
org-export-with-sub-superscripts '{}
org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
org-html-format-inlinetask-function
'org-html-format-inlinetask-default-function
org-edit-src-content-indentation 0
org-odt-format-headline-function 'org-odt-format-headline-default-function
org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
org-cycle-include-plain-lists 'integrate
org-archive-location "ARCHIVE.org::* %s"
org-mode-hook '(org-tempo-setup org-clock-load
navi-make-org-mode-promotion-headings-list #[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-clock-persist 'history
org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
org-archive-hook '(org-attach-archive-delete-maybe)
org-confirm-elisp-link-function 'yes-or-no-p
org-group-tags nil
org-clock-history-length 50
org-reverse-note-order 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-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
org-babel-pre-tangle-hook '(save-buffer)
org-file-apps '((auto-mode . emacs) ("\\.mm\\'" . default)
("\\.x?html?\\'" . default) ("\\.pdf\\'" . "evince %s"))
org-tab-first-hook '(org-babel-hide-result-toggle-maybe
 org-babel-header-arg-expand)
org-hide-leading-stars t
org-export-initial-scope 'subtree
org-html-text-markup-alist '((bold . "%s") (code .
"%s") (italic . "%s")
(strike-through . "%s") (underline . "%s")
(verbatim . "%s"))
org-hide-emphasis-markers t
org-link-file-path-type 'relative
org-ascii-format-drawer-function #[771 " \207" [] 4 "\n\n(fn NAME
CONTENTS WIDTH)"]
org-attach-store-link-p 'attached
org-catch-invisible-edits 'error
org-occur-hook '(org-first-headline-recenter)
outline-minor-mode-hook '(outshine--outline-minor-mode-hook)
org-log-into-drawer t
org-export-before-processing-hook
'(org-blackfriday--reset-org-blackfriday--code-block-num-backticks)
org-html-head-include-default-style nil
org-html-htmlize-output-type 'css
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-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
org-clock-display-default-range 'untilnow
org-confirm-shell-link-function 'yes-or-no-p
("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)
("orgit-rev" :store orgit-rev-store :follow orgit-rev-open
:export orgit-rev-export :complete
orgit-rev-complete-link)
("orgit-log" :store orgit-log-store :follow orgit-log-open
:export orgit-log-export :complete
orgit-log-complete-link)
("orgit" :store orgit-status-store :follow orgit-status-open
:export orgit-status-export :complete
orgit-status-complete-link)
("file+sys") ("file+emacs") ("shell" :follow org-link--open-shell)
("news" :follow