Survey: changing a few default settings for Org 9.4

2020-02-18 Thread Bastien
Hi all,

while Org 9.4 is on its way, I am considering changing a few default
settings (10 options in total).  I have created a survey here:

https://framadate.org/Ufc42EVxS2jO1Ajz

Can you take a few minutes and express your opinion there?

Here is the list of options and a line of justification - feel free to
discuss this on the mailing list too, of course.

- org-loop-over-headlines-in-active-region => t

  This option was not documented in the manual until recently.  It is
  useful to act on several headlines in the region.  When you select a
  region, it feels natural to expect some commands to act specially on
  the selected region.

- org-agenda-loop-over-headlines-in-active-region => t

  Same for the agenda: the feature has been added in Org 9.4.  It
  makes things really easier than bulk marking entries when bulking
  marking in a row.

- org-fontify-done-headline => t

  This is useful to visualize done headlines and can be easily turned
  off, while not being easily discovered for Org newcomers.

- org-hide-emphasis-markers => t
- org-hide-macro-markers => t

  The two changes proposed above will probably trigger some reactions
  as they touch something very sensitive: whether Org should try to be
  "too clever" at making things invisible.  I am all for letting Org
  newcomers enjoying these visual enhancements, while letting experts
  turning them off if needed.

- org-refile-use-cache => t

  This is a speed boost when refiling entries: if org-refile-targets
  is big, caching refile targets help refiling faster.

- org-special-ctrl-k => t

  The default value for the sister option org-special-ctrl-a is set to
  reversed and while this changes a fundamental Emacs command behavior
  it feels useful.  I'd argue this is the same for org-special-ctrl-k:
  setting it to t will feel natural.

- org-src-tab-acts-natively => t

  I believe that's the natural expectation when using TAB in a source
  block.  Things can be brittle in this area, but turning this on will
  provide a better experience to everyone.

- org-allow-promoting-top-level-subtree => t

  With the current default of nil, an error is thrown when the user
  tries to promote a top level subtree.  The new default setting would
  let users convert the top level heading to a commented heading.
  
- Add org-tempo to org-modules

  Last but not least: we had long discussions about this one in the
  past.  Expansion of the "https://www.emacs-doctor.com/

Thanks in advance for your feedback.

Changing defaults is always a sensitive matter.

There are generally two points of view confronting themselves: those
who take side with the "beginners" or the "don't-have-time-to-config"
(although these are just abstract figures here), and those insisting
that default are "for everyone", beginners, non-configurers, experts.

I think both sides are correct, provided we consider Org's experience
as something *dynamic* in time, a learning process.  So good defaults
are a balance between beginners/non-configurers experience and that of
experts.

In any case, let's keep the discussion as constructive as possible.

Thanks!

-- 
 Bastien



Re: [PATCH] Fix ob-python.el initiate session error with py-shell

2020-02-18 Thread numbch...@gmail.com
Yes, Jack, as Bastien said, you can format my commit, because my home
network is broken, I'm using Mobile Phone's 4G network to get online. Can't
get update immediately.
And thanks for tips about `python-mode' is deprecated. I didn't know that.
I will migrate to `python.el'.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Wed, Feb 19, 2020 at 1:18 AM Jack Kamm  wrote:

> Hi stardiviner,
>
> Sorry for the noise, I have some additional comments below:
>
> When I run "make compile", I get the following message:
>
> In org-babel-python-initiate-session-by-key:
> ob-python.el:211:12:Warning: py-shell called with 9 arguments, but accepts
> only 0-1
>
> I think this is because the "(declare-function py-shell)" no longer
> matches the signature of the upstream py-shell function you're using.
>
> Also, I now see that the commit does have a changelog entry, but not a
> commit message. Unless it is standard to take the subject line as the
> commit message? I am still a little new to merging patches from email,
> and might not have all the proper tooling setup for it.
>
> When you update the patch, please mention that this is specifically for
> python-mode.el in the commit message and changelog entry.
>


Re: How to occasionally store link as file.org+headline

2020-02-18 Thread Matthew Lundin
Mirko Vukovic  writes:

> For most of my links, I want to use the ID generated by orgmode
> i.e., (setq org-id-link-to-org-use-id t)
>
> But occasionally, for targets that are not part of my agenda files, I want
> to store a link of the type file:path.org::*headline
>
> I wrote the following function to accomplish that:
>
> (defun org-store-file+headline ()
>   "Store link as file + headline"
>   (interactive)
>   (let ((org-id-link-to-org-use-id nil))
> (org-store-link nil t)))
>
> This function works (lightly tested).
>
> But is there a built-in way, such as using prefixes or arguments to
> org-store-link? I browsed the code for it, but that function is several
> hundred lines long, and I gave up.

I think the function is the best option, as the logic of whether to
store ids (based on the value of org-id-link-to-org-use-id) is
hard-coded into org-store-link and can't be changed through arguments.
You could always create a custom function and bind it to 'C-c l' in
org-mode:

(defun my-org-store-org-link (arg)
  "Store a link org mode.
When there is a prefix arg, use file+headline format"
  (interactive "P")
  (let ((org-id-link-to-org-use-id (not arg)))
(org-store-link nil t)))

Best,
Matt



Re: [PATCH] Fix ob-python.el initiate session error with py-shell

2020-02-18 Thread Bastien
Hi Jack,

Jack Kamm  writes:

> Unless it is standard to take the subject line as the
> commit message?

Yes, it is - although in stardiviner's patch, the subject line should
not have the asterisk.

You can check for the propre format of a patch by doing

~$ git format-patch HEAD~10

and read the 10 latest patches (hopefully they are well formatted.)

I often do tiny edits on patches to fix problems, don't hesitate to
do so when it does not affect the author's intent.

Thanks,

-- 
 Bastien



Re: Automatic LaTeX preview toggling

2020-02-18 Thread Ken Mankoff
Recent melpa package does this:
https://github.com/io12/org-fragtog

  -k.


Please excuse brevity. Sent from tiny pocket computer with non-haptic
feedback keyboard.

On Thu, Feb 13, 2020, 21:20 Ag Ibragimov  wrote:

>
> I just recently discovered that this excellent code snippet that I found
> long time ago here:
> http://slumpy.org/blog/2017-02-01-automatic-latex-preview-in-org-mode
>
> which is based on even older post originally written by John Kitchin:
>
>
> http://kitchingroup.cheme.cmu.edu/blog/2015/10/09/Automatic-latex-image-toggling-when-cursor-is-on-a-fragment/
>
> unfortunately stopped working. I guess I missed it, at some point it seems
> org--list-latex-overlays function was removed.
>
> Does anyone know if there's updated version of this thing somewhere? Or
> maybe this was extracted into some plugin or something that can be
> installed from MELPA maybe and I don't even know?
>
>


Re: [PATCH] Fix ob-python.el initiate session error with py-shell

2020-02-18 Thread Jack Kamm
Hi stardiviner,

Sorry for the noise, I have some additional comments below:

When I run "make compile", I get the following message:

In org-babel-python-initiate-session-by-key:
ob-python.el:211:12:Warning: py-shell called with 9 arguments, but accepts
only 0-1

I think this is because the "(declare-function py-shell)" no longer
matches the signature of the upstream py-shell function you're using.

Also, I now see that the commit does have a changelog entry, but not a
commit message. Unless it is standard to take the subject line as the
commit message? I am still a little new to merging patches from email,
and might not have all the proper tooling setup for it.

When you update the patch, please mention that this is specifically for
python-mode.el in the commit message and changelog entry.



Re: [PATCH] Fix ob-python.el initiate session error with py-shell

2020-02-18 Thread Jack Kamm
Hi stardiviner,

> This minor patch should fixed ~py-shell~ initiate Python session issue.

It looks like this patch only affects users of python-mode.el. Since I
don't use python-mode.el, I cannot test it. But the patch looks
fine. Please add a commit message and changelog entry, and I'll merge it
in.

Now, a few general thoughts on python-mode.el:

I'm a little surprised to see python-mode.el pop up, and that
we have code in ob-python to explicitly support it. I thought it was
obsolete ever since python.el was added to emacs 24. But, it looks like
it's still receiving commits in 2020, so I guess I was wrong.

In a sense, it doesn't seem right to have code in ob-python explicitly
supporting python-mode.el. While at one point it may have been a
contender with python.el as the standard Python mode, at this point it's
just another third-party package like elpy, jedi, etc, none of which get
explicit support.

I don't want to break anyone's setup without further investigation, so
I'll leave the python-mode.el support as is, for now. But a warning,
this may change in future if we ever refactor ob-python.



Re: Bug: R src blocks fail to produce link to graphics file [9.3 org-plus-contrib-20200127]

2020-02-18 Thread Tyler Smith
You're welcome! I think the examples could use refreshing/restructuring,  but 
I'm not sure when I'll have time to get to that.

Best,

Tyler 

-- 
plantarum.ca

On Mon, Feb 17, 2020, at 12:40 PM, Jack Kamm wrote:
> Hi Tyler,
> 
> >> The documentation for ob-R is now incorrect:
> >>
> >>   https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html
> >
> > Yes, also that page could use some other updates, e.g. there are some
> > dead links in there.
> 
> Just saw that you updated the docs a few days ago. Thanks for taking
> care of this!
> 
> Best,
> Jack
>



Re: [PATCH] Re: ob-clojure.el: Add ClojureScript interface

2020-02-18 Thread Bastien
Hi stardiviner,

stardiviner  writes:

> I tested your method, true. And I also pulled that latest ob-clojure.el 
> changes.
> Works great, I like this new method more. Thanks for your
> improvement.

Thanks for your feedback.

Also, you may have noted that the code for Clojure sessions has been
removed - I could not make it work, even in previous versions.

If you know sesman/cider better than I do and can propose to handle
sesman/cider sessions correctly, please go ahead.

By "correctly" I mean requesting the launch of a (sibling?) nREPL
process buffer when :session is set to a string.

> The clojurescript support has a ~:target~ header argument to tell CIDER this 
> is a
> clojurescript code, I don't know CIDER internal much, but CIDER eval should 
> eval
> in a ClojureScript corresponding REPL.

Yes, what I meant was that for now ":target cljs" won't let you start
a nREPL unless you are in a ClojureScript project.

cider-jack-in-cljs will ask for the cljs method (figwheel-main, etc.)
but if your org file is in, e.g., an empty directory, there is no such
cljs configuration file.

-- 
 Bastien



Re: [PATCH] Fix ob-python.el initiate session error with py-shell

2020-02-18 Thread Bastien
Hi Stardiviner,

I add Jack to the loop, as he's deciding for these patches.

Jack: feel free to go ahead with committing, the release of 9.4
is not yet planned (I'll write to the list when it is.)

Thanks!

stardiviner  writes:

> When I have a python src block like this:
>
> #+begin_src python :session "test" :results output
> print("hello, world")
> #+end_src
>
> It will report session error.
>
> This minor patch should fixed ~py-shell~ initiate Python session issue.

-- 
 Bastien



Re: Possible to exclude/include tags for agenda custom commands?

2020-02-18 Thread Bastien
Hi Adam,

Adam Porter  writes:

> https://alphapapa.github.io/org-almanac/

this is a very nice list of resources!

Do you think we can advertize it somewhere on Worg?

If yes but are unsure *where*, just go ahead with whatever location
seems fine, we can always rearrange Worg's contents later on.

thanks,

-- 
 Bastien



Re: [PATCH] Re: ob-clojure.el: Add ClojureScript interface

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


Bastien  writes:

> stardiviner  writes:
>
>> I use CIDER (sesman) keybinding =[C-c C-s d]= on ob-clojure src
>> block to link current buffer directory to CIDER REPL session.
>
> I simply start Cider with C-c M-j and then execute the Clojure source
> block with C-c C-c, it works fine.

I tested your method, true. And I also pulled that latest ob-clojure.el changes.
Works great, I like this new method more. Thanks for your improvement.

>
>> I guess this should work for ClojureScript src block too.
>
> IMHO it works differently for ClojureScript, as C-c M-J doesn't know
> how to start a ClojureScript session unless you're in a directory with
> the proper cljs configuration (be it figwheel-main.edn, dev.cljs.edn,
> whatever.)  At least this is how I made it work.

The clojurescript support has a ~:target~ header argument to tell CIDER this is 
a
clojurescript code, I don't know CIDER internal much, but CIDER eval should eval
in a ClojureScript corresponding REPL.

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

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

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5L4CcUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsNx/Af/U3ZqKwelFTr0IO1evplCY/qHk4ON
ICousQWbMmv29665xhI9fkxBFMSXSE6fb7LJadfPK/7NWVfl/OIP4rotmp3mICow
FKzYuJ032MSiQma43LCADbXci8x7sTLUo5FlHI2pA6srypaqL4TcNIGnbVjO5UNg
WGmYJwAr8pwnXls6sF8JkZB4e+NEtvQl3rhZtDxzfKYHIaz2OYJJ7ELJuEl4IB1G
TQz+yzKgSdVeypHGj/t+Q0l2jTLDMFvrCOg/e0OWvuy2DSw4L/CEiS2NIv4CFftC
qj0FWOnt5+GPzzpMGoaNpu5LZNoWWlrV99Jv9F2TeU/fNIgMdq+LASsrIw==
=g/L7
-END PGP SIGNATURE-



[PATCH] Fix ob-python.el initiate session error with py-shell

2020-02-18 Thread stardiviner

When I have a python src block like this:

#+begin_src python :session "test" :results output
print("hello, world")
#+end_src

It will report session error.

This minor patch should fixed ~py-shell~ initiate Python session issue.

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

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
  
From fa39b7f3ad8aafe0fcebb27c5f695edf08820884 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Tue, 18 Feb 2020 20:52:32 +0800
Subject: [PATCH] * lisp/ob-python.el
 (org-babel-python-initiate-session-by-key):

fix ob-python.el initiate session issue.
---
 lisp/ob-python.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index de718b04b..f67acf2f9 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -207,8 +207,8 @@ (defun org-babel-python-initiate-session-by-key ( session)
 			 "^\\*\\([^*]+\\)\\*$" "\\1" python-buffer)
 			  (concat "Python-" (symbol-name session
 	   (py-which-bufname bufname))
-	  (py-shell)
-	  (setq python-buffer (org-babel-python-with-earmuffs bufname
+	  (setq python-buffer (org-babel-python-with-earmuffs bufname))
+	  (py-shell nil nil t org-babel-python-command python-buffer nil nil t nil)))
(t
 	(error "No function available for running an inferior Python")))
   (setq org-babel-python-buffers
-- 
2.25.0



signature.asc
Description: PGP signature


Re: [PATCH] org-agenda.el: Fix typo

2020-02-18 Thread Bastien
Hi Stefan,

Stefan Kangas  writes:

> Please find attached a small patch to fix a typo.  I have signed
> papers with the FSF for Emacs.

Applied in maint, thanks!

-- 
 Bastien



[PATCH] org-agenda.el: Fix typo

2020-02-18 Thread Stefan Kangas
Please find attached a small patch to fix a typo.  I have signed
papers with the FSF for Emacs.

Best regards,
Stefan Kangas

>From d23d79344a29f53e684b4993e056145007f906f5 Mon Sep 17 00:00:00 2001
From: Stefan Kangas 
Date: Tue, 18 Feb 2020 07:24:33 +0100
Subject: [PATCH] org-agenda.el: Fix typo

* lisp/org-agenda.el (org-agenda-add-entry-text-descriptive-links):
Fix typo.
---
 lisp/org-agenda.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index b0da70beb..0bd3247a8 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -187,7 +187,7 @@ and `org-agenda-entry-text-maxlines'."
   "Non-nil means export org-links as descriptive links in agenda added text.
 This variable applies to the text added to the agenda when
 `org-agenda-add-entry-text-maxlines' is larger than 0.
-When this variable nil, the URL will (also) be shown."
+When this variable is nil, the URL will (also) be shown."
   :group 'org-agenda
   :type 'boolean)
 
-- 
2.25.0