Re: [O] [PATCH] ox-html: add option to restore old src block behaviour?

2019-10-02 Thread Matt Price
So I'm pretty interested in this: what to others thi k?

On Sat., Sep. 21, 2019, 8:16 a.m. Jens Lechtenboerger, <
jens.lechtenboer...@fsfe.org> wrote:

> On 2019-09-19, Matt Price wrote:
>
> > Over the summer, commit ded3d27b1468b878197e5fe55a70c5e13350ea27
> > by Nik Clayton was merged to master. It's a one-line change that
> > adds new ~~ tags around each lin of code in html export of
> > source blocks.  It's useful because it allows individual lines to
> > be addressed directly by CSS.
> >
> > However, at least one very common syntax highlighter,
> > https://highlinghtjs.org, expects just a single  tag, as do
> > other common CSS frameworks.
> > [...]
>
> The attached patch adds a new variable org-html-wrap-src-lines to
> control whether code tags should be added or not.
>
> I’m not sure whether :package-version 9.3 is correct.  Also, I set
> the value to t, which does not change the current functionality.
> However, for backwards compatibility (up to version 9.2.6), a value
> of nil would be preferable.  Any thoughts?
>
> Best wishes
> Jens
>
>


Re: [O] How many other people want an org-mode client to the Canvas LMS API?

2019-10-02 Thread Matt Price
Wow, great, I hope it ends up being useful for you. And that those months
give me time to clean up the mess.

Am working with TAs this semester for the first time since I wrote this, so
I have some incentive to improve the 2 way flow between org and canvas. So
hopefully by the time you look at it, it will be in better shape.

On Mon., Sep. 30, 2019, 8:48 p.m. John Kitchin, 
wrote:

> I am pretty interested in this. I can't use it this semester, but next
> semester I am teaching a new class where it might be useful. I don't
> have much time this fall to look into it, but I will have time in the
> spring before my class starts.
>
>
> Matt Price  writes:
>
> > Hi everyone,
> >
> > I've been working away slowly on my primitive API client for the Canvas
> > Learning Management System, which my university now uses (
> > https://github.com/titaniumbones/org-lms, note the documentation is
> > terrible and may be misleading in places). The code is at my usual very
> low
> > level of quality. I'm interested in improving it, but if I'm going to be
> > the only person who ever uses it, my motivation to do so is somewhat more
> > limited. So I just wanted to ask here if anyone else would really like to
> > have this tool (I've asked before, but it's been a while). For me it's
> been
> > kind of great, and along with ox-hugo has made it possible for me to keep
> > all my course materials in one place. But it might not be worthwhile for
> > others!
> >
> > Matt
>
>
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>


Re: [O] Babel eval w/ C-c C-c but not (org-babel-execute-buffer)

2019-10-02 Thread John Kitchin
I guess this is not easily possible without some advice. When you run
org-babel-execute-buffer the cursor moves into each block, so you need to
save the point before you run it, and then test if point has moved when
org-babel-execute-src-block is called.

It might be easier to write your own version of org-babel-execute-buffer
for this. You could use org-babel-map-src-blocks as the base, and in each
block run a test that determines if it should be executed.

John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Wed, Oct 2, 2019 at 4:48 PM Ken Mankoff  wrote:

> Hello,
>
> I'm interested in having code blocks that do not eval when I run
> (org-babel-execute-buffer) but do when the cursor is within them and I
> explicitly want to execute them by entering C-c C-c.
>
> I cannot get this behavior playing around with the :eval header argument.
> Is the behavior I described possible?
>
> Thanks,
>
>   -k.
>
>


[O] Babel eval w/ C-c C-c but not (org-babel-execute-buffer)

2019-10-02 Thread Ken Mankoff
Hello,

I'm interested in having code blocks that do not eval when I run 
(org-babel-execute-buffer) but do when the cursor is within them and I 
explicitly want to execute them by entering C-c C-c.

I cannot get this behavior playing around with the :eval header argument. Is 
the behavior I described possible?

Thanks,

  -k.



Re: [O] [RFC] Document level property drawer

2019-10-02 Thread Gustav Wikström
Hi Sebastian,

> From: Sebastian Miele
> Subject:  Re: [O] [RFC] Document level property drawer
> Date: Tue, 01 Oct 2019 12:38:12 +

> ...

> I would like to be able to make a clear distinction between properties
> that are visible by default and properties that are not. Maybe it would
> be possible to allow some #+.. syntax following headings for subtree
> properties that are visible by default. A requirement could be made that
> such property specifications always have to be followed by a property
> drawer, even if that is empty. Then everything #+.. that is before the
> property drawer would belong to the heading/subtree, and everything #+..
> that follows the drawer would be treated as it is until now.

That maps quite well to what I also had in mind initially. What I
called "Document property keywords" in [fn:1]:

  #+begin_quote
  I propose to allow properties to be defined also as document
  property keywords. All keywords in the top of a buffer, before any
  non-comment line, are document-level keywords. In effect, they are
  properties that apply in exactly the same way as properties defined
  in the property drawer. The only reason for using a document keyword
  instead of defining it inside the property drawer is to make it more
  visible. One example would be the title-keyword (#+TITLE: ...).
  #+end_quote

Although I didn't think of generalizing it to also work for the
outline nodes. Something that makes sense to do though, given the use
case you describe!

[fn:1] https://lists.gnu.org/archive/html/emacs-orgmode/2019-06/msg0.html

FWIW
Gustav


Re: [O] Bug: COMMENT and noweb-ref

2019-10-02 Thread Sebastian Miele
First, here is a patch introducing tests concerning Org comments and
tangling.
>From c769435b9ab11f7a3b5ff5f1ec2df95ae2c6aa32 Mon Sep 17 00:00:00 2001
From: Sebastian Miele 
Date: Wed, 2 Oct 2019 13:02:46 +
Subject: [PATCH] ob-tangle: Add tests

* testing/lisp/test-ob-tangle.el (ob-tangle/commented-src-blocks):
  (ob-tangle/commented-src-blocks-with-nowebref): Add tests.
---
 testing/lisp/test-ob-tangle.el | 85 ++
 1 file changed, 85 insertions(+)

diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el
index 47c31dff5..675f0714b 100644
--- a/testing/lisp/test-ob-tangle.el
+++ b/testing/lisp/test-ob-tangle.el
@@ -296,6 +296,91 @@ another block
(org-split-string (buffer-string
  (delete-file file))
 
+(ert-deftest ob-tangle/commented-src-blocks ()
+  "Test omission of commented src blocks."
+  (should
+   (equal '("A")
+ (let ((file (make-temp-file "org-tangle-")))
+   (unwind-protect
+   (progn
+ (org-test-with-temp-text-in-file
+ (format "#+property: header-args :tangle %S
+* A
+
+  #+BEGIN_SRC emacs-lisp
+  A
+  #+END_SRC
+
+* COMMENT B
+
+  #+BEGIN_SRC emacs-lisp
+  B
+  #+END_SRC
+
+* C
+
+  # #+BEGIN_SRC emacs-lisp
+  # C
+  # #+END_SRC
+
+* D
+
+  #+BEGIN_COMMENT
+  #+BEGIN_SRC emacs-lisp
+  D
+  #+END_SRC
+  #+END_COMMENT"
+ file)
+   (org-babel-tangle))
+ (with-temp-buffer
+   (insert-file-contents file)
+   (org-split-string (buffer-string
+ (delete-file file))
+
+(ert-deftest ob-tangle/commented-src-blocks-with-nowebref ()
+  "Test omission of commented src blocks with nowebref."
+  (should
+   (equal '("A")
+ (let ((file (make-temp-file "org-tangle-")))
+   (unwind-protect
+   (progn
+ (org-test-with-temp-text-in-file
+ (format "#+property: header-args :tangle %S
+* A
+
+  #+BEGIN_SRC elisp :noweb yes
+  A
+  <>
+  <>
+  <>
+  #+END_SRC
+
+* COMMENT B
+
+  #+BEGIN_SRC elisp :noweb-ref B
+  B
+  #+END_SRC
+
+* C
+
+  # #+BEGIN_SRC elisp :noweb-ref C
+  # C
+  # #+END_SRC
+
+* D
+
+  #+BEGIN_COMMENT
+  #+BEGIN_SRC elisp :noweb-ref D
+  D
+  #+END_SRC
+  #+END_COMMENT"
+ file)
+   (org-babel-tangle))
+ (with-temp-buffer
+   (insert-file-contents file)
+   (org-split-string (buffer-string
+ (delete-file file))
+
 (provide 'test-ob-tangle)
 
 ;;; test-ob-tangle.el ends here
-- 
2.23.0



Re: [O] [ANN] org-sidebar-tree: Sidebar tree-view buffer for outline navigation

2019-10-02 Thread Fraga, Eric
Hi Adam,

I've had a chance to play with it a little bit.  Works very well
generally.  Some notes:

- a way to exit the sidebar-tree mode to get back to the full buffer
  (e.g. to run commands that require the whole file).  The documentation
  seems to indicate that 'q' should do this but it didn't work for
  me.  I do use evil mode but q didn't work whether in evil or emacs
  states.

- hitting RET on a headline which has subtrees doesn't show the
  subtrees.  Can this be customized?  It might be nice to have two
  different bindings to allow for recursion and not.
  
- invoking org-sidebar-tree when point is at the top of the file,
  e.g. on the #+title: line of a document, gives an error:
  outline-back-to-heading: Before first heading.

I will probably use this in place of my rough and ready version.

Thanks,
eric

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.4-401-gfabd6d



Re: [O] [RFC] Document level property drawer

2019-10-02 Thread Marco Wahl
Adam Porter  writes:

> Marco Wahl  writes:
>
>> Adam Porter  writes:
>>
>>> Gustav Wikström  writes:
>>>
 3) Properties defined in a property drawer will have precedence over
properties defined as a property keyword, if the same property is
defined using both conventions.
>>>
>>> That protocol seems unnatural and confusing to me:
>>>
>>> - If precedence were to be defined by something other than file-order,
>>>   it seems to me that those defined with #+ keywords should have
>>>   precedence, because they are more visible, while those in drawers are
>>>   hidden.
>>> - However, it seems to me that the simplest, most natural protocol would
>>>   be for later declarations to override earlier ones.
>>
>> I think it would be quite natural to use the tree structure of Org.  A
>> property setting in a subtree overrides the setting in a parent (which
>> could be the document(= the whole file.))
>
> Hi Marco,
>
> I think you misunderstood his point #3 and my objection to it.  :)

Hi Adam,

that's possible but I don't think so.  But I'm willing to learn if
I didn't get it. :)

Possibly a concrete example can help.  Let's take Org property CATEGORY
for illustration.

First to Gustav's statement 3):

Let the file be this:

--8<---cut here---start->8---
#+title: file
:PROPERTIES:
:CATEGORY: cat-doc-prop-drawer
:END:

* foo
SCHEDULED: <2019-10-02 Wed>

#+CATEGORY:  cat-doc-prop-keyword-1

** bar

:somedrawer:
#+CATEGORY:  cat-doc-prop-keyword-2
:END:
--8<---cut here---end--->8---

With Gustav's proposition the CATEGORY of task foo is
cat-doc-prop-drawer.

Next to your statements:

You say the visibility is better for the #+-property keywords.  I say
they can occur _anywhere_ in the file and even in some drawers.  See
above "#+CATEGORY:  cat-doc-prop-keyword-2".

Further you say 

>>> - However, it seems to me that the simplest, most natural protocol would
>>>   be for later declarations to override earlier ones.

This means that cat-doc-prop-keyword-2 from the example defines the
CATEGORY property which at least I find not so natural.  And I already
stated what I find natural.


Best regards,  Marco




Re: [O] Dates with repeaters, times and range

2019-10-02 Thread Fraga, Eric
On Tuesday,  1 Oct 2019 at 23:38, Nathan Neff wrote:
> I have a meeting that's scheduled from 10:00 - 11:00 for the next three
> days.

This is discussed in the FAQ on the org mode website.

Quick answer: not possible the way you wish.  Instead, the easiest solution is 
to make a one day entry and then use M-x org-clone-subtree-with-time-shift RET.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.4-401-gfabd6d