Re: [O] blogging wih org-mode

2019-09-29 Thread Ivan Tadeu Ferreira Antunes Filho
If you want to see one more example of blog generator, I also
built one to generate a blog from a single org file, exporting each
heading into a new file.
https://github.com/itf/org-export-head/blob/master/blog.org


It is an org file with a source block: you run the source block, and
call a single function, and it generates the blog.

However, it does not generate an RSS feed.


On Sun, Sep 29, 2019 at 8:32 PM Thibault Marin 
wrote:

Last time I researched this, this was the list I obtained:

http://bastibe.de/2013-11-13-blogging-with-emacs.html

http://endlessparentheses.com/how-i-blog-one-year-of-posts-in-a-single-org-file.html
https://github.com/howardabrams/dot-files/blob/master/emacs-blog.org
http://www.john2x.com/blog/blogging-with-orgmode.html
https://ogbe.net/blog/blogging_with_org.html
http://nicolas.petton.fr/blog/blogging-with-org-mode.html

This may be a little out-dated, I think ox-hugo is pretty popular
nowadays.

I built one a while ago
(
https://thibaultmarin.github.io/blog/posts/2016-11-13-Personal_website_in_org.html
)
using org-mode only, but I wouldn't call it simple.  There may still
be some useful things in there.

Hope it helps.

On 2019-09-29T18:06:27-0400, Joseph Vidal-Rosset wrote:

  Hi the list,

  I would be glad to know what is, according to the majority, the best
  tool to blog with org-mode. I'm searching something simple to use and
  to install in order to blog with emacs, and, ideally, with emacs and
  org-mode only.

  (I met  difficulties with lazyblorg, for example. I did not succeed to
  understand how it works.)

  Thanks for your help.

  Jo.


Re: [O] blogging wih org-mode

2019-09-29 Thread Thibault Marin


Last time I researched this, this was the list I obtained:

http://bastibe.de/2013-11-13-blogging-with-emacs.html

http://endlessparentheses.com/how-i-blog-one-year-of-posts-in-a-single-org-file.html
https://github.com/howardabrams/dot-files/blob/master/emacs-blog.org
http://www.john2x.com/blog/blogging-with-orgmode.html
https://ogbe.net/blog/blogging_with_org.html
http://nicolas.petton.fr/blog/blogging-with-org-mode.html

This may be a little out-dated, I think ox-hugo is pretty popular
nowadays.

I built one a while ago
(https://thibaultmarin.github.io/blog/posts/2016-11-13-Personal_website_in_org.html)
using org-mode only, but I wouldn't call it simple.  There may still
be some useful things in there.

Hope it helps.

On 2019-09-29T18:06:27-0400, Joseph Vidal-Rosset wrote:

  Hi the list,

  I would be glad to know what is, according to the majority, the best
  tool to blog with org-mode. I'm searching something simple to use and
  to install in order to blog with emacs, and, ideally, with emacs and
  org-mode only.

  (I met  difficulties with lazyblorg, for example. I did not succeed to
  understand how it works.)

  Thanks for your help.

  Jo.



Re: [O] blogging wih org-mode

2019-09-29 Thread Scott Randby
On 9/29/19 6:06 PM, Joseph Vidal-Rosset wrote:
> I would be glad to know what is, according to the majority, the best
> tool to blog with org-mode. I'm searching something simple to use and
> to install in order to blog with emacs, and, ideally, with emacs and
> org-mode only.
> 
> (I met  difficulties with lazyblorg, for example. I did not succeed to
> understand how it works.)
> 

Does this help?

https://diego.codes/post/blogging-with-org/

Scott Randby



[O] blogging wih org-mode

2019-09-29 Thread Joseph Vidal-Rosset
Hi the list,

I would be glad to know what is, according to the majority, the best
tool to blog with org-mode. I'm searching something simple to use and
to install in order to blog with emacs, and, ideally, with emacs and
org-mode only.

(I met  difficulties with lazyblorg, for example. I did not succeed to
understand how it works.)

Thanks for your help.

Jo.



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

2019-09-29 Thread Marco Wahl
Hi,

> This patch introduces a document level property drawer. 

[...]

> What do you say?

I'll install the patch and have a look how it feels in my little
personal Org universe.


Thanks,
-- 
Marco




[O] org-babel noweb-ref

2019-09-29 Thread edgar

Hello dear list,

First of all, this may be related:
- https://lists.gnu.org/archive/html/emacs-orgmode/2018-02/msg00300.html
- https://lists.gnu.org/archive/html/emacs-orgmode/2012-01/msg00044.html

- Emacs: src_emacs-lisp{emacs-version} {{{results(=26.3=)}}}
- Org: src_emacs-lisp{org-version} {{{results(=9.1.14=)}}}
- Parabola GNU/Linux: src_bash{uname -r} {{{results(=5.2.5-gnu-1=)}}}

I prepared the following hoping that it makes the issue clear. Let me 
know :) .


#+CAPTION: This works if ~org-babel-use-quick-and-dirty-noweb-expansion~ 
is ~nil~, but I don't want to import everything from ~libraries~
#+BEGIN_SRC python :tangle routines1.py :noweb yes :shebang # -*- 
coding: utf-8 -*-

  <>


  <>
#+END_SRC

* Explanation with example

- I noticed some differences between the output of tangling and 
previewing org-babel blocks.
- ~org-babel-use-quick-and-dirty-noweb-expansion~ interferes with 
~:noweb~ in a way that I did not expect


I want to know
1. if this is the expected behaviour
2. how I can expand a named block (which has ~#+name: tag~) which is 
inside a subtree (subheading with the ~:noweb-ref~ property)


** Option 1

Set src_emacs-lisp{(setq org-babel-use-quick-and-dirty-noweb-expansion 
nil)}


#+BEGIN_SRC python :tangle /tmp/routines1.py :noweb yes :shebang # -*- 
coding: utf-8 -*-

  <>


  <>
#+END_SRC

- Preview shows empty lines instead of ~imp1.py~ and no ~shebang~

  #+BEGIN_SRC python



def fun1():
pass


def fun2():
pass
  #+END_SRC

- Tangled ~/tmp/routines2.py~ shows ~shebang~, but no ~imp1.py~.

  #+BEGIN_SRC python
# -*- coding: utf-8 -*-
def fun1():
pass


def fun2():
pass
  #+END_SRC


*** What I expected

1. Both Preview and tangling to have the same content
2. for ~imp1.py~ to be expanded at the top of the code as ~import numpy 
as np~.


** Option 2

src_emacs-lisp{(setq org-babel-use-quick-and-dirty-noweb-expansion t)}

#+BEGIN_SRC python :tangle /tmp/routines2.py :noweb yes :shebang # -*- 
coding: utf-8 -*-

  <>


  <>
#+END_SRC

- Preview shows

  #+BEGIN_SRC python
import numpy as np


  #+END_SRC

- Tangled ~/tmp/routines2.py~ shows

  #+BEGIN_SRC python
# -*- coding: utf-8 -*-
import numpy as np
  #+END_SRC

*** What I expected

According to the manual, ~<>~ would not be solved correctly 
(as shown), but I expected to have the ~shebang~ in the preview.


A further comment can be made about the extra space (related to 
~:noweb-sep~), but that is minor and I don't care.


** Routines
:PROPERTIES:
:header-args: :noweb-ref routines :noweb-sep "\n\n\n"
:END:

#+NAME: fun1.py
#+BEGIN_SRC python
  def fun1():
  pass
#+END_SRC

#+NAME: fun2.py
#+BEGIN_SRC python
  def fun2():
  pass
#+END_SRC

** Libraries
:PROPERTIES:
:header-args: :noweb-ref libraries
:END:

#+NAME: imp1.py
#+BEGIN_SRC python
  import numpy as np
#+END_SRC

#+NAME: imp2.py
#+BEGIN_SRC python
  import os
#+END_SRC

-
This free account was provided by VFEmail.net - report spam to ab...@vfemail.net

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



[O] [RFC] Document level property drawer

2019-09-29 Thread Gustav Wikström
Hi,

This patch introduces a document level property drawer. 

This has been discussed previously in a larger context:
- https://lists.gnu.org/archive/html/emacs-orgmode/2019-06/msg0.html
- https://lists.gnu.org/archive/html/emacs-orgmode/2019-08/msg00339.html 
- https://lists.gnu.org/archive/html/emacs-orgmode/2019-09/msg00010.html

The patch is a somewhat modified version of what was included in the third 
link above.

The following will be true for document level property drawers:
1) In the same way that one can have a property drawer for a heading, one
   can have a property drawer for a whole document.
2) All existing commands that can work with property drawers will
   (shall) work also on property drawers before the first heading.
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.
4) The position for the document level property drawer is:
   - At the first line in a file that is not a comment or a keyword.

 I.e. the following will work:
 #+begin_src org
   # -*- mode: org -*-
   ,#+TITLE: Test
   :PROPERTIES:
   :CATEGORY: Test
   :END:

   Preamble 

   ,* Some heading
   Some content
 #+end_src

 but not this:
 #+begin_src org
   Some comment and/or empty line

   :PROPERTIES:
   :CATEGORY: Test
   :END:

   ,* Some heading
   Some content
 #+end_src

What do you say?

Regards
Gustav Wikström


0001-Org-document-property-drawers.patch
Description: 0001-Org-document-property-drawers.patch


[O] export code snippet in beamer with different fonts

2019-09-29 Thread Luca Ferrari
Hi all,
in my org files I've got examples like:

#+begin_src sql
testdb=# alter role simon with nologin;
testdb=# alter role group_a with login;
#+end_src

and in my latex theme I've got:

setbeamerfont{verbatim}{size=\tiny}

This is ok for most of my examples, but here are my questions:
1) the highlight seems not to work, all the text is made in fixed size
font but in plain back (no keyword highlighted). How can I circumvent
this?
2) is it possible to tella latex to export the snippet at the max size
available in the page? Something like
#+LaTeX: \resizebox{\textwidth}{!}{ ... }
that I place around my tables.

Thanks,
Luca



Re: [O] [RFC] Org document concept + document property drawers

2019-09-29 Thread Gustav Wikström
Hi again,

I'm separating the Org document concept from the document property drawer to 
not block the document property drawer by syntax changes.

New RFC coming in a moment. Now only for the document property drawer 
functionality.

/G 

> -Original Message-
> From: Nicolas Goaziou 
> Sent: den 6 september 2019 22:10
> To: Gustav Wikström 
> Cc: emacs-orgmode@gnu.org
> Subject: Re: [RFC] Org document concept + document property drawers
> 
> Hello,
> 
> Gustav Wikström  writes:
> 
> > I'm starting out slow by making this a non-breaking change. At least
> > I'm trying to. I.e. everything that worked before should continue to
> > work.
> 
> This still is a syntax change, which is not to be taken lightly. Since
> Org 9.3 is way overdue (I'm not blaming anyone for it, mind you),
> I suggest to wait, and discuss about it with users meanwhile.

I'll separate the patches and propose to go ahead with the document property 
drawer without the conceptual addition of Org documents in the parser.

> 
> >> > Patch 0001 introduces the document element into org-element.el, and
> >> > some restructuring related to that.
> >>
> >> This should be explained in comments, and, if it lands at some point,
> >> Worg pages about syntax and exporter should be updated, too.
> >
> > Which comments do you mean? I've tried to be rigorous in the patch
> > notes. But you mean in the mail itself?
> 
> In the "org-element.el" file. There are some comments there. You could
> add some info about the changes there.

Got it.

> 
> > Noted, except in this case I think it's warranted since
> > org-back-to-heading behaves exactly the same with the exception of
> > raising an error if before the first heading. Since both functions are
> > defined next to another I'm sure a later refactor will take care of
> > both since they're structurally identical and defined two lines apart.
> 
> Your call.

My call is to follow current pattern and make sure it's at least not adding any 
complexity for possible later refactor.

> 
> > I've just "pattern-matched" myself into that docstring. It matches the
> > existing definitions of org-at-drawer-p, org-at-comment-p,
> > org-at-block-p. Which are defined around this.
> 
> Then, these docstrings should be fixed too. Actually, "Non-nil if..." is
> for variables with a boolean value. For predicates, like these
> functions, it should be : "Return t if ...".
> 
> See (info "(elisp) Documentation Tips") for more information about the
> subject.

Fixed existing docstrings in separate patch already pushed to master.

> > Hmm... I see your point. Have to think a bit here - because I have the
> > feeling that defining the predicate using org-element-at-point will
> > incur quite a performance hit.
> 
> Of course it will be slower. But "almost correct" predicates are also
> bad, in other ways. Besides, it may be premature optimization at this
> point.

I've not made any changes to this just yet. It may be worth a revisit later 
though, because I do see your point. The issue is bigger than the one added 
predicate here though, and should most likely be looked at more holistically. I 
propose to take that in a separate change as refactoring isn't made more 
complicated by the patch I've suggested (although the amount of work will 
increase slightly).

BR
Gustav


[O] org-table-wrap-region insert new lines if needed?

2019-09-29 Thread Uwe Brauer


Hi 

The behavior of 
org-table-wrap-region 
behaves as described in the doc string

,
| The wrapped text is pasted back into the table. If you formatted it to
| more lines than it was before, fields further down in the table get
| overwritten - so you might need to make space in the table first.
`


Would it be possible in the future, to avoid that text is overwritten my
automatically increase the needed space?

Regards

Uwe Brauer 





[O] [PATCH] org: org-get-priority: reduce `not`, deduplicate magic `(* 1000 ..)` operation

2019-09-29 Thread Anton Latukha
Another two small patches.(First I subscribed mail profile with a `name+tag@mail` format, after that understood that I can receive messages, but I can not write back from that tag address. Still do not see or know, if I reached the mailing list with the patches). $ make test---Ran 808 tests, 808 results as expected (2019-09-29 03:24:36+0300)13 expected failures Regards,Anton Latukha From afb204303a388f2644a535dccef6f603d3519ead Mon Sep 17 00:00:00 2001
From: Anton-Latukha 
Date: Sun, 29 Sep 2019 03:08:24 +0300
Subject: [PATCH 1/2] org: org-get-priority: rm: reduce negation operation

* org (org-get-priority): reducing bool negation operation by
switching if cases
---
 lisp/org.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 450d16083..72408f49f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11679,10 +11679,10 @@ and by additional input from the age of a schedules or deadline entry."
   (save-match-data
 (if (functionp org-get-priority-function)
 	(funcall org-get-priority-function)
-  (if (not (string-match org-priority-regexp s))
-	  (* 1000 (- org-lowest-priority org-default-priority))
+  (if (string-match org-priority-regexp s)
 	(* 1000 (- org-lowest-priority
-		   (string-to-char (match-string 2 s
+		   (string-to-char (match-string 2 s
+	(* 1000 (- org-lowest-priority org-default-priority))
 
  Tags
 
-- 
2.23.0

From c1e5afed098133103c0d7c44db4da4a939aa6431 Mon Sep 17 00:00:00 2001
From: Anton-Latukha 
Date: Sun, 29 Sep 2019 03:10:25 +0300
Subject: [PATCH 2/2] org: org-get-priority: push same magic (* 1000 .. ) op
 outside of if

* org (org-get-priority): Push the same magic (* 1000 ..) operation
outside applying it to if overall.
---
 lisp/org.el | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 72408f49f..8aabce5f4 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11679,10 +11679,11 @@ and by additional input from the age of a schedules or deadline entry."
   (save-match-data
 (if (functionp org-get-priority-function)
 	(funcall org-get-priority-function)
-  (if (string-match org-priority-regexp s)
-	(* 1000 (- org-lowest-priority
-		   (string-to-char (match-string 2 s
-	(* 1000 (- org-lowest-priority org-default-priority))
+  (* 1000
+	 (if (string-match org-priority-regexp s)
+	 (- org-lowest-priority
+		(string-to-char (match-string 2 s)))
+	   (- org-lowest-priority org-default-priority))
 
  Tags
 
-- 
2.23.0



[O] [PATCH] org.el: fx org-get-priority-function funcall (give arg - headline)

2019-09-29 Thread Anton Latukha
From d9b237304b23b8bbb75e9b799bd3698060bc82a9 Mon Sep 17 00:00:00 2001From: Anton-Latukha Date: Sun, 29 Sep 2019 01:13:41 +0300Subject: [PATCH] org.el: fx org-get-priority-function funcall (give arg - headline) * org.el (org-get-priority): Fix to allow the use of custom prioritygetters.Provide the headline as argument to the custom priority getterfunction.--- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.elindex 450d16083..71490893d 100644--- a/lisp/org.el+++ b/lisp/org.el@@ -11678,7 +11678,7 @@ and by additional input from the age of a schedules or deadline entry."   "Find priority cookie and return priority."   (save-match-data     (if (functionp org-get-priority-function)-    (funcall org-get-priority-function)+    (funcall org-get-priority-function s)       (if (not (string-match org-priority-regexp s))       (* 1000 (- org-lowest-priority org-default-priority))     (* 1000 (- org-lowest-priority-- 2.23.0 $ make test---Ran 808 tests, 808 results as expected (2019-09-29 01:54:46+0300)13 expected failures My first patch. Limiting it to be very-very simple.(I had read the main docs) - Should I send patch in email body or pinned file is fine? Regards,Anton LatukhaFrom d9b237304b23b8bbb75e9b799bd3698060bc82a9 Mon Sep 17 00:00:00 2001
From: Anton-Latukha 
Date: Sun, 29 Sep 2019 01:13:41 +0300
Subject: [PATCH] org.el: fx org-get-priority-function funcall (give arg -
 headline)

* org.el (org-get-priority): Fix to allow the use of custom priority
getters.
Provide the headline as argument to the custom priority getter
function.
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 450d16083..71490893d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11678,7 +11678,7 @@ and by additional input from the age of a schedules or deadline entry."
   "Find priority cookie and return priority."
   (save-match-data
 (if (functionp org-get-priority-function)
-	(funcall org-get-priority-function)
+	(funcall org-get-priority-function s)
   (if (not (string-match org-priority-regexp s))
 	  (* 1000 (- org-lowest-priority org-default-priority))
 	(* 1000 (- org-lowest-priority
-- 
2.23.0



[O] [PATCH] org: org-get-priority-function: Clearly state that this is a holder for a name of the function

2019-09-29 Thread Anton Latukha
Additionally state that this is a holder of a function name, so the simple user did not get confused. Regards,Anton Latukha From da3066489128af42a89e498db7fb8b0bcda9e431 Mon Sep 17 00:00:00 2001
From: Anton-Latukha 
Date: Sun, 29 Sep 2019 03:41:17 +0300
Subject: [PATCH] org: org-get-priority-function: doc: add that it holds a func
 name

* org (org-get-priority-function): Make clear that *this must hold the
name of a custom priority getter function (there were cases of
confusion).
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 450d16083..113d97a8f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -2591,7 +2591,7 @@ See also `org-default-priority'."
   :type 'boolean)
 
 (defcustom org-get-priority-function nil
-  "Function to extract the priority from a string.
+  "Name of a function to extract the priority from a string.
 The string is normally the headline.  If this is nil Org computes the
 priority from the priority cookie like [#A] in the headline.  It returns
 an integer, increasing by 1000 for each priority level.
-- 
2.23.0



[O] [PATCH] org.el: fx org-get-priority-function funcall (give arg - headline)

2019-09-29 Thread Anton Latukha
From d9b237304b23b8bbb75e9b799bd3698060bc82a9 Mon Sep 17 00:00:00 2001From: Anton-Latukha Date: Sun, 29 Sep 2019 01:13:41 +0300Subject: [PATCH] org.el: fx org-get-priority-function funcall (give arg - headline) * org.el (org-get-priority): Fix to allow the use of custom prioritygetters.Provide the headline as argument to the custom priority getterfunction.--- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.elindex 450d16083..71490893d 100644--- a/lisp/org.el+++ b/lisp/org.el@@ -11678,7 +11678,7 @@ and by additional input from the age of a schedules or deadline entry."   "Find priority cookie and return priority."   (save-match-data     (if (functionp org-get-priority-function)-    (funcall org-get-priority-function)+    (funcall org-get-priority-function s)       (if (not (string-match org-priority-regexp s))       (* 1000 (- org-lowest-priority org-default-priority))     (* 1000 (- org-lowest-priority-- 2.23.0 $ make test---Ran 808 tests, 808 results as expected (2019-09-29 01:54:46+0300)13 expected failures My first patch. Limiting it to be very very simple.(I had read the main docs) - Should I send patch in email body or pinned file is fine? Regards,Anton LatukhaFrom d9b237304b23b8bbb75e9b799bd3698060bc82a9 Mon Sep 17 00:00:00 2001
From: Anton-Latukha 
Date: Sun, 29 Sep 2019 01:13:41 +0300
Subject: [PATCH] org.el: fx org-get-priority-function funcall (give arg -
 headline)

* org.el (org-get-priority): Fix to allow the use of custom priority
getters.
Provide the headline as argument to the custom priority getter
function.
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 450d16083..71490893d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11678,7 +11678,7 @@ and by additional input from the age of a schedules or deadline entry."
   "Find priority cookie and return priority."
   (save-match-data
 (if (functionp org-get-priority-function)
-	(funcall org-get-priority-function)
+	(funcall org-get-priority-function s)
   (if (not (string-match org-priority-regexp s))
 	  (* 1000 (- org-lowest-priority org-default-priority))
 	(* 1000 (- org-lowest-priority
-- 
2.23.0