Re: Anyone doing any fancy customizations of source blocks?

2020-06-18 Thread William Denton

On 3 June 2020, Diego Zamboni wrote:


I use the config John mentioned and I like it - though I use different
symbols. Here's my config if you want an example:
https://github.com/zzamboni/dot-emacs/blob/master/init.org#source-code-blocks


Thanks for this.  I used it for a while, and it looks great, but I decided I 
want to see the details on the begin_src line all the time.  I do like using the 
⎡and ⎣ character nr prettify-symbols-ali stto replace #+begin_src and 
#+end_src and will keep those.


(My apologies for weirdness in that line---the Unicode threw things off and 
I can't get it back to normal.)


I'll refer to your configuration file when I move my init files into Org.  It's 
a great example.


Bill
--
William Denton :: Toronto, Canada   ---   Listening to Art: 
https://listeningtoart.org/
https://www.miskatonic.org/ ---   GHG.EARTH: https://ghg.earth/
Caveat lector.  ---   STAPLR: https://staplr.org/

Re: New mailing list archive at https://orgmode/list/

2020-06-18 Thread Kyle Meyer
Eric Abrahamsen writes:

> Hey, that works great! It's a bit weird that it still asks for a
> username and password, I wonder if there's any way to skip that. I've
> never dealt with anonymous IMAP before -- is there anything in the
> connection process that explicitly tells us "you don't need to log on"?

The server advertises AUTH=ANONYMOUS as a capability [*], so Gnus could
detect that and send "AUTHENTICATE ANONYMOUS", I _think_.

[*] https://public-inbox.org/meta/20200610070519.18252-...@yhbt.net/

> Otherwise, I guess it doesn't hurt just to save a bogus
> username/password and forget about it.

Yeah, I went with that approach.  But poking around a bit in nnimap.el,
it seems another option would be

(nnimap "news.yhetil.org"
(nnimap-authenticator anonymous))



Re: New mailing list archive at https://orgmode/list/

2020-06-18 Thread Colin Baxter
> Eric Abrahamsen  writes:

> Kyle Meyer  writes:
>> Eric Abrahamsen writes:
>> 
>>> Kyle Meyer  writes:
>>> 
 (setq gnus-select-method '(nnimap "news.yhetil.org" ;; no certs
 yet (nnimap-stream plain)))
>>> 
>>> Hmm, I tried this (adding to `gnus-secondary-select-methods'),
>>> and got:
>>> 
>>> Warning: Opening nnimap server on news.yhetil.org...failed: NO
>>> Mailbox doesn't exist: DOES.NOT.EXIST (0.001 + 0.000 secs).;
>>> Unable to open server nnimap+news.yhetil.org due to: make client
>>> process failed: Network is unreachable, :name, *nnimap*,
>>> :buffer, *nnimap news.yhetil.org nil *nntpd**, :host,
>>> news.yhetil.org, :service, imap, :coding, nil
>>> 
>>> The "mailbox doesn't exist" thing seems to be misleading:
>>> further attempts to connect to the server just gave me "network
>>> is unreachable".  I wonder if this has something to do with my
>>> tls settings? I'll set `gnutls-log-level' to 2 and try
>>> again... Nope, same error.
>>> 
>>> This is on Emacs master, I'm not sure what else I can check
>>> (though I still suspect it's something to do with connection
>>> security).
>> 
>> Sorry, I switched it over to using a cert last night.  I should
>> have sent a message here.  Hopefully just having
>> 
>> (nnimap "news.yhetil.org")
>> 
>> in gnus-secondary-select-methods will work for you.  I tried just
>> now, and it worked on my end (Emacs 26.3).

> Hey, that works great! It's a bit weird that it still asks for a
> username and password, I wonder if there's any way to skip
> that. I've never dealt with anonymous IMAP before -- is there
> anything in the connection process that explicitly tells us "you
> don't need to log on"?  Otherwise, I guess it doesn't hurt just to
> save a bogus username/password and forget about it.

I noticed that too. I just hit return each time, which appears to be
acceptable. I was also asked if I want to save the credentials to my
autoinfo file. I hit yes and got these two lines:

machine news.yhetil.org-ephemeral login  port imaps
machine news.yhetil.org login  port imaps

I have only blanked out my usual machine user name - I entered no password.

Works well, though.

Best wishes,

Colin.




Colin Baxter
URL: http://www.Colin-Baxter.com



Re: New mailing list archive at https://orgmode/list/

2020-06-18 Thread Eric Abrahamsen
Kyle Meyer  writes:

> Eric Abrahamsen writes:
>
>> Kyle Meyer  writes:
>>
>>> (setq gnus-select-method '(nnimap "news.yhetil.org"
>>>   ;; no certs yet
>>>   (nnimap-stream plain)))
>>
>> Hmm, I tried this (adding to `gnus-secondary-select-methods'), and got:
>>
>> Warning: Opening nnimap server on news.yhetil.org...failed: NO Mailbox
>> doesn't exist: DOES.NOT.EXIST (0.001 + 0.000 secs).; Unable to open
>> server nnimap+news.yhetil.org due to: make client process failed:
>> Network is unreachable, :name, *nnimap*, :buffer, *nnimap
>> news.yhetil.org nil *nntpd**, :host, news.yhetil.org, :service, imap,
>> :coding, nil
>>
>> The "mailbox doesn't exist" thing seems to be misleading: further
>> attempts to connect to the server just gave me "network is unreachable".
>> I wonder if this has something to do with my tls settings? I'll set
>> `gnutls-log-level' to 2 and try again... Nope, same error.
>>
>> This is on Emacs master, I'm not sure what else I can check (though I
>> still suspect it's something to do with connection security).
>
> Sorry, I switched it over to using a cert last night.  I should have
> sent a message here.  Hopefully just having
>
> (nnimap "news.yhetil.org")
>
> in gnus-secondary-select-methods will work for you.  I tried just now,
> and it worked on my end (Emacs 26.3).

Hey, that works great! It's a bit weird that it still asks for a
username and password, I wonder if there's any way to skip that. I've
never dealt with anonymous IMAP before -- is there anything in the
connection process that explicitly tells us "you don't need to log on"?
Otherwise, I guess it doesn't hurt just to save a bogus
username/password and forget about it.

The whole thing (connection, search, display) is also significantly
faster than gmane :)

Eric



Re: New mailing list archive at https://orgmode/list/

2020-06-18 Thread Kyle Meyer
Eric Abrahamsen writes:

> Kyle Meyer  writes:
>
>> (setq gnus-select-method '(nnimap "news.yhetil.org"
>>   ;; no certs yet
>>   (nnimap-stream plain)))
>
> Hmm, I tried this (adding to `gnus-secondary-select-methods'), and got:
>
> Warning: Opening nnimap server on news.yhetil.org...failed: NO Mailbox
> doesn't exist: DOES.NOT.EXIST (0.001 + 0.000 secs).; Unable to open
> server nnimap+news.yhetil.org due to: make client process failed:
> Network is unreachable, :name, *nnimap*, :buffer, *nnimap
> news.yhetil.org nil *nntpd**, :host, news.yhetil.org, :service, imap,
> :coding, nil
>
> The "mailbox doesn't exist" thing seems to be misleading: further
> attempts to connect to the server just gave me "network is unreachable".
> I wonder if this has something to do with my tls settings? I'll set
> `gnutls-log-level' to 2 and try again... Nope, same error.
>
> This is on Emacs master, I'm not sure what else I can check (though I
> still suspect it's something to do with connection security).

Sorry, I switched it over to using a cert last night.  I should have
sent a message here.  Hopefully just having

(nnimap "news.yhetil.org")

in gnus-secondary-select-methods will work for you.  I tried just now,
and it worked on my end (Emacs 26.3).



Re: New mailing list archive at https://orgmode/list/

2020-06-18 Thread Eric Abrahamsen
Kyle Meyer  writes:

> [ adding Eric Wong back to the cc ]
>
> Eric Abrahamsen writes:
>
>> Eric Wong  writes:
>>> Fwiw, I've been trying to avoid exposing NNTP article numbers in
>>> the HTTP endpoint in favor of Message-IDs because serial numbers
>>> aren't decentralization-friendly.  Of course, sometimes
>>> Message-IDs get reused, so public-inbox will return all messages
>>> which match a particular Message-ID in those rare cases.
>>>
>>> Btw, POST with the "=m" query parameter already allows search
>>> to return a gzipped mboxrd.
>>>
>>> And also what I just wrote about about JMAP/GraphQL in the other
>>> message.
>>>
>>> A read-only IMAP server is also coming with search support,
>>> and IMAP UIDs will be equivalent to NNTP article numbers.
>>
>> Sounds like something in there is bound to work! IMAP might be best --
>> while it's certainly possible to do Message-ID<->article number lookups,
>> that will slow Gnus down further, and it's already fairly slow.
>>
>> Thanks again,
>> Eric
>
> Here are the recent patches that Eric sent out related to the read-only
> IMAP server:
>
>   https://public-inbox.org/meta/20200610070519.18252-...@yhbt.net
>
> It's already available at .  I've played
> around with that a bit in Mutt and Gnus, and it seems to work nicely.
> As I mentioned before, I don't really search much in Gnus, but I tried
> some basic queries via GG and the results looked reasonable.
>
> I set this up for news.yhetil.org tonight.  Here's what I used to test
> it out:
>
> ;; Set so that all groups/folders aren't subscribed and synced.  Think
> ;; I should be able to prevent that with `gnus-options-not-subscribe'
> ;; or `gnus-auto-subscribed-groups', but didn't have any luck.
> (setq gnus-check-new-newsgroups nil)
>
> (setq gnus-select-method '(nnimap "news.yhetil.org"
>   ;; no certs yet
>   (nnimap-stream plain)))

Hmm, I tried this (adding to `gnus-secondary-select-methods'), and got:

Warning: Opening nnimap server on news.yhetil.org...failed: NO Mailbox
doesn't exist: DOES.NOT.EXIST (0.001 + 0.000 secs).; Unable to open
server nnimap+news.yhetil.org due to: make client process failed:
Network is unreachable, :name, *nnimap*, :buffer, *nnimap
news.yhetil.org nil *nntpd**, :host, news.yhetil.org, :service, imap,
:coding, nil

The "mailbox doesn't exist" thing seems to be misleading: further
attempts to connect to the server just gave me "network is unreachable".
I wonder if this has something to do with my tls settings? I'll set
`gnutls-log-level' to 2 and try again... Nope, same error.

This is on Emacs master, I'm not sure what else I can check (though I
still suspect it's something to do with connection security).

Eric



Re: Import Reusable org-babel snippet using #+SETUPFILE

2020-06-18 Thread Douglas Perrin
Hi Salomon,
Babel definitions, in this case, lots of elsip blocks to add behaviors like
this example to clear bloc results on save to avoid polluting commits that
can be turned on and off per section with properties.

#+name: Clear-Results-On-Save
#+begin_src emacs-lisp :results none
;;; code to clean up org-file results on save
(defun CHAI-ClearResultsOnSave ()
  (when (eq major-mode 'org-mode)
(org-babel-map-executables nil
  (cond ((equal "true" (org-entry-get nil "ClearOnSave" t t))
 (org-babel-remove-result))
))
))

;;; interactive version that ignores PROPERTIES and clears all results
(defun CHAI-ClearResultsNow ()
  (interactive)
  (when (eq major-mode 'org-mode)
(org-babel-map-executables nil (org-babel-remove-result))
))

;;; add the hook before saving a file
(add-hook 'before-save-hook 'CHAI-ClearResultsOnSave nil t)
#+end_src

In this case, the init block in the template.org file would have an org-sbe
call to "Clear-Results-On-Save" after ingesting GeneralORGTools.org if I
wanted that behavior. By convention, I always have an init bloc but in this
case it is not very interesting:

#+name:GeneralORGTools_Init
#+BEGIN_SRC elisp
  ;; nice org-mode setting to remove newlines from the outline
  (setq org-cycle-separator-lines 0)
 #+end_src

**correction from my previous post**:
 (org-sbe "GeneralORGTools.org") '
should have been a call to the init
(org-sbe ":GeneralORGTools_Init")

Regards
Doug


Re: Question on contributing to Org-mode

2020-06-18 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Ag Ibragimov  writes:

> Can someone help me please to improve ob-clojure for the next release.
>
> I'd like to add bababashka and clojure-cmd support.
>
> I've experimented with the code that's currently in master I so far I got to 
> this.
>
> What I would like to propose:
>
> 1) Ability to override `org-babel-clojure-backend` with a src-block header 
> parameter

I like this idea, currently ob-clojure has many different backends support now,
Use a header argument will be helpful for situations like use different backends
in one org file and other cases.

> 2) Header argument for additional parameters so you could do things like this:

I would like propose header argument name ":backend" or ":clojure". ob-scheme.el
has similar header argument named ":scheme". But I prefer ":backend", because
it's more general.

>
> #+begin_src clojure :args "-Sdeps '{:deps {inflections {:mvn/version 
> "0.13.2"}}}'"
>  (use 'inflections.core)
>  (plural "word")
> #+end_src
>
> However, I don't know what's current convention about header parameters - 
> naming, etc.
> What your thoughts about all that?
>
> diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el
> index 299a326e4..de005c32b 100644
> --- a/lisp/ob-clojure.el
> +++ b/lisp/ob-clojure.el
> @@ -224,6 +224,14 @@ (defun ob-clojure-eval-with-slime (expanded params)
>,(buffer-substring-no-properties (point-min) (point-max)))
>  (cdr (assq :package params)
>
> +(defun ob-clojure-eval-with-babashka (expanded params)
> +  "Evaluate EXPANDED code block with PARAMS using babashka."
> +  (org-babel-execute:shell (format "bb -e \"%s\"" expanded) params))
> +
> +(defun ob-clojure-eval-with-clj (expanded params)
> +  "Evaluate EXPANDED code block with PARAMS using clojure-cli."
> +  (org-babel-execute:shell (format "clj -e \"%s\"" expanded) params))
> +
> (defun org-babel-execute:clojure (body params)
>   "Execute a block of Clojure code with Babel."
>   (unless org-babel-clojure-backend
> @@ -238,7 +246,11 @@ (defun org-babel-execute:clojure (body params)
>  ((eq org-babel-clojure-backend 'cider)
>   (ob-clojure-eval-with-cider expanded params))
>  ((eq org-babel-clojure-backend 'slime)
> - (ob-clojure-eval-with-slime expanded params
> + (ob-clojure-eval-with-slime expanded params))
> +((eq org-babel-clojure-backend 'babashka)
> + (ob-clojure-eval-with-babashka expanded params))
> +((eq org-babel-clojure-backend 'clj-cli)
> + (ob-clojure-eval-with-clj expanded params
> (org-babel-result-cond result-params
>   result
>   (condition-case nil (org-babel-script-escape result)
>
> On Sat 13 Jun 2020 at 17:19, Kyle Meyer  wrote:
>
>> Ag Ibragimov writes:
>>
>>> M-x emacs-version and org-version report:
>>>
>>> GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin19.5.0, NS appkit-1894.50 
>>> Version 10.15.5 (Build 19F101)) of 2020-06-07
>>> Org mode version 9.3.7 (9.3.7-2-g706970-elpaplus @ 
>>> ~/.emacs.d/elpa/28.0/develop/org-plus-contrib-20200608/)
>>>
>>> Now I'm confused, what's in master of bzg/org-mode?
>>
>> It contains what will be the next feature release (9.4, at the moment).
>>
>> Notice that your reported version above contains a git revision: 706970.
>> If you look that up in the repo, you'll find that it's a few commits
>> back from the current tip of the maint branch.  The maint branch is the
>> source for the ELPA builds and is where bug fix releases are cut from.
>>
>>> And if someone wants to send patches, which branch it should be based
>>> of?
>>
>> Bug fixes that apply to maint should ideally be based off of maint, and
>> master is usually appropriate for everything else.


- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7rDs8UHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsMWVQf/YlHZw3Yga3dTlLPU0Xg0f+tJ0JJR
oigjt4oOBsaMGshHny+4QBnO/QJTVWpYEm6j2oFp0Cb1CUn5TiTRDDyRVcX+I15u
W4T+UqsamKQQoRoJccPN3apraQlwiYbwLzN5Qy0hefOkj+E285PNf4Uq1VMwy9sL
n2zqY+cm+lrhv3wG08xXxWckg+Jx76s1M6j9QQH7nGNovYSl3YzpjtOPc2VE2ayv
8FQQX6PSH4gEW7ItyfYd18vYtIn65Zkum+L80d8+HtDVPkw0yDIq6uIkUbR5jCCY
tdbUsl6EeZlb9CkjY9WtOsIGe2FzIHjjhFSYvamgarqs5GGd+GazSPUVKQ==
=4JBP
-END PGP SIGNATURE-