Re: Release Org 9.4.2

2021-01-02 Thread TRS-80

On 2020-12-18 16:49, Asa Zeren wrote:

Have people looked at sourcehut (https://sourcehut.org)? While it's
still in alpha, and so has a number of rough edges, it seems pretty
promising. Sourcehut is trying to build a platform with accessible web
uis that is backed by mailing lists. Just annother option to consider,
though there is no urgency to move from the current situtation.

--Asa


I have been using Sourcehut for about a month and loving it so far![0]

I searched for long time for a git forge I could live with.  Most of
popular options nowadays seem either proprietary software or typical
sluggish castles of JavaScript (or both!) as is so much of the "modern"
web.

So, when I finally discovered Sourcehut (which is neither of the above
mentioned things) it was like a breath of fresh air in comparison!  I
really appreciate what Drew is trying to do over there.

I even ironed out one or two of those "rough edges" getting some Orgmode
export (to sr.ht supported Markdown) stuff working a little better (and
I continue to do so).  I don't mind at all (in fact rather enjoy)
contributing to actual no-bs Free Software platform!

Come join me!  Come on in, the water is fine... :)

Cheers,
TRS-80

[0] https://sr.ht/~trs-80/



[PATCH] ol: Avoid initial input when completing function for storing link

2021-01-02 Thread Kyle Meyer
John Kitchin writes:

> Recently I have had an issue where multiple functions may store a link,
> e.g. to a bibtex entry.
>
> In this case, org-mode seems to prompt me to ask which function to store
> the link with, with an initial input of the first function, which masks all
> the options that are available. This happens inside org-store-link in ol.el
> at line 1495 for me. in
>
> (apply #'org-link-store-props
> (cdr (assoc-string
>   (completing-read
> "Which function for creating the link? "
> (mapcar #'car results-alist)
> nil t (symbol-name name))
>   results-alist)))
>
> because of the (symbol-name name).
>
> Is there an easy way to avoid this, or to modify the order of the functions
> used? I want to see all the options for storing, or better, to just store
> them all and let me choose later when I use org-insert-link.

The "or better" sounds reasonable.  Perhaps someone will attempt that,
but in the meantime I think just avoiding the discouraged/mostly
deprecated INITIAL-INPUT argument would be a good improvement.

-- >8 --
Subject: [PATCH] ol: Avoid initial input when completing function for storing
 link

* lisp/ol.el (org-store-link): Use completing-read's DEF argument
rather than INITIAL-INPUT, which is discouraged (see Elisp manual) and
may hide the other choices depending on the completion framework.

Reported-by: John Kitchin 
Ref: 
https://orgmode.org/list/caj51etqo9a8me0w3pgu2cfzazsesdyxav0x-8vey+_v9awp...@mail.gmail.com
---
 lisp/ol.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/ol.el b/lisp/ol.el
index 5ba813142..cf105786f 100644
--- a/lisp/ol.el
+++ b/lisp/ol.el
@@ -1496,9 +1496,9 @@ (defun org-store-link (arg  interactive?)
  (apply #'org-link-store-props
 (cdr (assoc-string
   (completing-read
-   "Which function for creating the link? "
-   (mapcar #'car results-alist)
-   nil t (symbol-name name))
+(format "Store link with (default %s): " name)
+(mapcar #'car results-alist)
+nil t nil nil (symbol-name name))
   results-alist)))
  t
(setq link (plist-get org-store-link-plist :link))

base-commit: 291993888d7b6776d42a86facd26c8bc0f72e475
-- 
2.29.2




ob-haskell

2021-01-02 Thread Lawrence Bottorff
I recently wimped out of trying to update ob-haskell as an official
maintainer, but I'd eventually like to get back to it -- *after *I get some
base understanding of what Haskell is (Zeno's paradox-land?) and how the
ghci works. Basically, the ghci is what it is -- tautological, but true.
And that means when ob-haskell does nothing but dump the contents of a
babel code block into ghci, it's no better than if the user had typed in
into the REPL line-by-line. A quick run-down:

:set +m supposedly alerts ghci that a multi-line expression is coming, will
come; but typically, it doesn't infer this very well.

Enclosing code in :{ ... :} is fairly good -- again you can type this in at
the REPL prompt and see how it works -- however, there are gotchas.

a plain block:

#+begin_src haskell
...code...
#+end_src

is okay when you only have a one-liner to evaluate. But again, ob-haskell
seems to do nothing but take the block contents and dump it to the ghci
REPL as though the user had typed it in line-by-line, Enter, Enter...

What would be nice is if a C-c C-c inside a block could somehow act as
though the ghci were being sent a regular  *.hs buffer in haskell-mode --
and that, of course, cumulatively. C-' creates a decent haskell-mode
environment, BTW, so some form of a babel block to haskell-mode connection
does exist

So am I on the right track? It's obvious at this point raw dumps into the
REPL aren't optimal, i.e., are fraught. What is, e.g., geiser doing
that ob-haskell isn't?

LB

PS: Eventually, I'll try to glean some hints from the Jupyter Haskell
 effort.

PPS: GHCI User's Guide

doesn't
really tell me anything other than yes, ob-haskell is raw-dumping into an
environment that isn't designed to play nice with babel.


Re: [PATCH] Enhance org-html--build-meta-info

2021-01-02 Thread TEC

After considering the information passed to a meta info generation
function, I'm now in agreement with you that just passing `info' is the
most sensible way forward.

Attached is a (final?) set of patches, which is as described.

--
Timothy.

>From e8c9646ae6c5083417a927bd2b23bb0f837930d2 Mon Sep 17 00:00:00 2001
From: TEC 
Date: Mon, 14 Dec 2020 17:41:33 +0800
Subject: [PATCH 1/2] lisp/ox-html.el: make html meta tag builder nicer

* lisp/ox-html.el (org-html--build-meta-info): Multi-line repeated
structure extracted to new function `org-html--build-meta-entry'.
The keyword value formatting is changed from `org-export-data' to
`org-html-encode-plain-text' to avoid potentially nesting HTML tags in
meta tags and the  element, which would violate W3C.
---
 lisp/ox-html.el | 114 
 1 file changed, 56 insertions(+), 58 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 03145e3..f74c6a4 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1835,78 +1835,76 @@ INFO is a plist used as a communication channel."
 
 ;;; Template
 
+(defun org-html--build-meta-entry (label identity  content-format  content-formatters)
+  "Construct  tag of form , or when CONTENT-FORMAT is present:
+
+
+Here {content} is determined by applying any CONTENT-FORMATTERS to the CONTENT-FORMAT and encoding
+the result as plain text."
+  (concat "\n"))
+
 (defun org-html--build-meta-info (info)
   "Return meta tags for exported document.
 INFO is a plist used as a communication channel."
-  (let* ((protect-string
-  (lambda (str)
-(replace-regexp-in-string
- "\"" "" (org-html-encode-plain-text str
- (title (org-export-data (plist-get info :title) info))
- ;; Set title to an invisible character instead of leaving it
- ;; empty, which is invalid.
- (title (if (org-string-nw-p title) title ""))
- (author (and (plist-get info :with-author)
-  (let ((auth (plist-get info :author)))
+  (let* ((title (org-html-plain-text
+		 (org-element-interpret-data (plist-get info :title)) info))
+	 ;; Set title to an invisible character instead of leaving it
+	 ;; empty, which is invalid.
+	 (title (if (org-string-nw-p title) title ""))
+	 (author (and (plist-get info :with-author)
+		  (let ((auth (plist-get info :author)))
 			;; Return raw Org syntax.
-(and auth (org-element-interpret-data auth)
- (description (plist-get info :description))
- (keywords (plist-get info :keywords))
- (charset (or (and org-html-coding-system
-   (fboundp 'coding-system-get)
-   (coding-system-get org-html-coding-system
-  'mime-charset))
-  "iso-8859-1")))
+			(and auth (org-html-plain-text
+   (org-element-interpret-data auth) info)
+	 (charset (or (and org-html-coding-system
+			   (fboundp 'coding-system-get)
+			   (symbol-name
+			(coding-system-get org-html-coding-system
+	   'mime-charset)))
+		  "iso-8859-1")))
 (concat
  (when (plist-get info :time-stamp-file)
(format-time-string
 	(concat "\n")))
- (format
-  (if (org-html-html5-p info)
-	  (org-html-close-tag "meta" "charset=\"%s\"" info)
-	(org-html-close-tag
-	 "meta" "http-equiv=\"Content-Type\" content=\"text/html;charset=%s\""
-	 info))
-  charset) "\n"
+
+ (if (org-html-html5-p info)
+	 (org-html--build-meta-entry "charset" charset)
+   (org-html--build-meta-entry "http-equiv" "Content-Type"
+   (concat "text/html;charset=" charset)))
+
  (let ((viewport-options
 	(cl-remove-if-not (lambda (cell) (org-string-nw-p (cadr cell)))
 			  (plist-get info :html-viewport
-   (and viewport-options
-	(concat
-	 (org-html-close-tag
-	  "meta"
-	  (format "name=\"viewport\" content=\"%s\""
-		  (mapconcat
-		   (lambda (elm) (format "%s=%s" (car elm) (cadr elm)))
-		   viewport-options ", "))
-	  info)
-	 "\n")))
+   (if viewport-options
+	   (org-html--build-meta-entry "name" "viewport"
+   (mapconcat
+	(lambda (elm) (format "%s=%s" (car elm) (cadr elm)))
+	viewport-options ", "
+
  (format "%s\n" title)
- (org-html-close-tag "meta" "name=\"generator\" content=\"Org mode\"" info)
- "\n"
- (and (org-string-nw-p author)
-	  (concat
-	   (org-html-close-tag "meta"
-			   (format "name=\"author\" content=\"%s\""
-   (funcall protect-string author))
-			   info)
-	   "\n"))
- (and (org-string-nw-p description)
-	  (concat
-	   (org-html-close-tag "meta"
-			   (format "name=\"description\" content=\"%s\"\n"
-   (funcall protect-string description))
-			   info)
-	   "\n"))
- (and (org-string-nw-p keywords)
-	  (concat
-	   (org-html-close-tag "meta"
-			   (format "name=\"keywords\" content=\"%s\""
-			

Re: what do do when multiple functions store a link

2021-01-02 Thread John Kitchin
Here is a very grungy solution:

(defun scimax-store-link-advice (orig-fun  args)
  (cl-letf (((symbol-function 'symbol-name)
 (lambda (_)
   "")))
(apply orig-fun args)))

(advice-add 'org-store-link :around 'scimax-store-link-advice)

It works by temporarily redefining symbol-name to return an empty string.
It's only redeeming qualities are 1) it works, 2) you don't have to modify
the org src code!

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 Sat, Jan 2, 2021 at 9:37 AM Daniele Nicolodi  wrote:

> On 02/01/2021 14:49, John Kitchin wrote:
> > Recently I have had an issue where multiple functions may store a link,
> > e.g. to a bibtex entry.
> >
> > In this case, org-mode seems to prompt me to ask which function to store
> > the link with, with an initial input of the first function, which masks
> > all the options that are available. This happens
> > inside |org-store-link| in ol.el at line 1495 for me. in
> >
> > (apply #'org-link-store-props
> > (cdr (assoc-string
> >   (completing-read
> > "Which function for creating the link? "
> > (mapcar #'car results-alist)
> > nil t (symbol-name name))
> >   results-alist)))
> >
> > because of the (symbol-name name).
> >
> > Is there an easy way to avoid this, or to modify the order of the
> > functions used? I want to see all the options for storing, or better, to
> > just store them all and let me choose later when I use org-insert-link.
>
> I have the exact same problem. I think it comes from having org-bibtex
> and org-ref loaded at the same time. I haven't investigated a possible
> solution.
>
> Cheers,
> Dan
>


Re: what do do when multiple functions store a link

2021-01-02 Thread Daniele Nicolodi
On 02/01/2021 14:49, John Kitchin wrote:
> Recently I have had an issue where multiple functions may store a link,
> e.g. to a bibtex entry. 
>  
> In this case, org-mode seems to prompt me to ask which function to store
> the link with, with an initial input of the first function, which masks
> all the options that are available. This happens
> inside |org-store-link| in ol.el at line 1495 for me. in
> 
> (apply #'org-link-store-props
> (cdr (assoc-string
>       (completing-read
> "Which function for creating the link? "
> (mapcar #'car results-alist)
> nil t (symbol-name name))
>       results-alist))) 
> 
> because of the (symbol-name name).
>  
> Is there an easy way to avoid this, or to modify the order of the
> functions used? I want to see all the options for storing, or better, to
> just store them all and let me choose later when I use org-insert-link.

I have the exact same problem. I think it comes from having org-bibtex
and org-ref loaded at the same time. I haven't investigated a possible
solution.

Cheers,
Dan



what do do when multiple functions store a link

2021-01-02 Thread John Kitchin
Recently I have had an issue where multiple functions may store a link,
e.g. to a bibtex entry.

In this case, org-mode seems to prompt me to ask which function to store
the link with, with an initial input of the first function, which masks all
the options that are available. This happens inside org-store-link in ol.el
at line 1495 for me. in

(apply #'org-link-store-props
(cdr (assoc-string
  (completing-read
"Which function for creating the link? "
(mapcar #'car results-alist)
nil t (symbol-name name))
  results-alist)))

because of the (symbol-name name).

Is there an easy way to avoid this, or to modify the order of the functions
used? I want to see all the options for storing, or better, to just store
them all and let me choose later when I use org-insert-link.

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