Re: Unable to install from elpa

2021-11-12 Thread Carlos Pita
This might be because the builtin version is the same as the one in
elpa (although if that's the case the UI is somewhat confusing) but
I'm not sure about that because I don't quite understand the
relationship between builtin versions and stable external releases. I
mean, is builtin org only updated to match external releases or does
it follow a different cadence? Does a strict number version match
between builtin and external implies exactly the same org revision?
And in this case, is it expected that package.el doesn't offer org as
a valid installation target nor prepends org's local path to the
builtin one?

Best regards,
Carlos



Unable to install from elpa

2021-11-12 Thread Carlos Pita
Hi all,

in a clean emacs-28 install I do:

M-x package-install  org

I get:

Possible completions are:
org-contrib org-edna org-real org-translate orgalist

package-archives has:

(("gnu" . "https://elpa.gnu.org/packages/;)
 ("nongnu" . "https://elpa.nongnu.org/nongnu/;))

I do list-packages, org is now listed as available in gnu archive, I
install it from there, relaunch emacs (again with -Q), do
(package-initialize) and:

- check org-version: it's still the builtin one.

- check load-path: doesn't include my ~/.emacs.d/elpa/org-9.5
directory (although it exists and installing other packages works as
expected)

So many things are not working properly:

1. I'm unable to install org using package-install.

2. I can install it from the package list but then it's not added to load-path.

3. Of course the builtin version gets loaded instead of the elpa one.

All this is in a recent build from emacs-28 with default configure
options (including native compilation).

Best regards,
Carlos



Re: after installing python3.6 on Ubuntu 16.04, org files open with errors

2021-11-12 Thread Tim Cross


Uwe Brauer  writes:

> Hi
>
> I am running Ubuntu 16.04 and I installed python3.6 (which is not
> officially supported for that Ubuntu version via 
> https://askubuntu.com/questions/865554/how-do-i-install-python-3-6-using-apt-get
>
> I also installed 
>
> sudo -H python3.6 -m pip install jupyter
> sudo -H python3.6 -m pip install pexpect
> sudo -H python3.6 -m pip install matlab_kernel
>
>
> Now however I cannot open even simple org files, I obtain errors I attach
> and most of my keybinding and other things do not work.
>
> Any help is strongly appreciated.
>
> Regards
>

The whole transition from v2.x to v3.x for python has been a terrible
mess. Version issues are the most frustrating aspect of Python and one
reason I've never embraced the language.

Given that Ubuntu 16.04 was end of life in April 2021, my recommendation
would be to upgrade to ubuntu 21.04. That version seems to have a more
consistent Python environment (based on v3). It also has newer ciaro,
hafbuzz and other libs used by Emacs which will likely work better and
once Emacs 28.0 is released, will have the gccjit libs necessary for
native comp etc. 



Re: whitespace in org source files

2021-11-12 Thread Tim Cross


excalamus--- via "General discussions about Org-mode."  
writes:

> I'm hacking on ob-shell.el and I see that the source has mixed tabs and 
> spaces.
> If I were to contribute changes, would it be an issue if tabs were converted 
> to
> whitespace?
>
> I've not used the email contribution style before and have had whitespace 
> issues
> in the past with GitHub PRs.  I typically run whitespace-cleanup with the
> before-save-hook which changes tabs to spaces.

It is usually a bad idea to change whitespace in this manner. It will
not improve readibility but will cause lots of change which will likely
make merging and tracking/reviewing changes harder than necessary.

Ideally, git itslef would be configured to deal with this automatically.
Unfortunately, the tab v space arguments can often reach the level of
religious war and represents something which is difficult to get
consensus on.

My recommendation would be to use dir local variable settings to make
Emacs use the same formatting style (i.e. with tabs) for working with
org-mode sources if your normal/wider preference is just for spaces.
this will prevent Emacs from making unnecessary whitespace changes.



whitespace in org source files

2021-11-12 Thread General discussions about Org-mode.


I'm hacking on ob-shell.el and I see that the source has mixed tabs and spaces. 
If I were to contribute changes, would it be an issue if tabs were converted to 
whitespace?

I've not used the email contribution style before and have had whitespace 
issues in the past with GitHub PRs.   I typically run whitespace-cleanup with 
the before-save-hook which changes tabs to spaces.



Weird gap in agenda mode-line

2021-11-12 Thread Carlos Pita
Hi all,

in the *Org Agenda* buffer mode-line I'm seeing a weird gap that I
can't remember whether it was before or not. In the attached
screenshot the gap shows a different face than the rest. I don't know
under which circumstances this change of face happens but, in any
case, the extra space is always there (emacs -q) and there is some
combination in my setup that sometimes more obviously reveals it. I
don't know if that's a lighter with just a space on it or what.

Best regards,
Carlos

---

org-mode version: 9.5, release_9.5-68-g77e2ec (emacs-28 branch)


after installing python3.6 on Ubuntu 16.04, org files open with errors

2021-11-12 Thread Uwe Brauer

Hi

I am running Ubuntu 16.04 and I installed python3.6 (which is not
officially supported for that Ubuntu version via 
https://askubuntu.com/questions/865554/how-do-i-install-python-3-6-using-apt-get

I also installed 

sudo -H python3.6 -m pip install jupyter
sudo -H python3.6 -m pip install pexpect
sudo -H python3.6 -m pip install matlab_kernel


Now however I cannot open even simple org files, I obtain errors I attach
and most of my keybinding and other things do not work.

Any help is strongly appreciated.

Regards

Uwe Brauer 


Traceback (most recent call last):
  File "/home/oub/.emacs.d/elpa/ob-ipython-20180224.153/client.py", line 1, in 

import jupyter_client as client
  File "/usr/local/lib/python3.6/dist-packages/jupyter_client/__init__.py", 
line 6, in 
from .asynchronous import AsyncKernelClient  # noqa
  File 
"/usr/local/lib/python3.6/dist-packages/jupyter_client/asynchronous/__init__.py",
 line 1, in 
from .client import AsyncKernelClient  # noqa
  File 
"/usr/local/lib/python3.6/dist-packages/jupyter_client/asynchronous/client.py", 
line 6, in 
from jupyter_client.channels import HBChannel
  File "/usr/local/lib/python3.6/dist-packages/jupyter_client/channels.py", 
line 15, in 
from .session import Session
  File "/usr/local/lib/python3.6/dist-packages/jupyter_client/session.py", line 
52, in 
from jupyter_client.jsonutil import extract_dates
  File "/usr/local/lib/python3.6/dist-packages/jupyter_client/jsonutil.py", 
line 15, in 
from dateutil.parser import parse as _dateutil_parse  # type: ignore
  File "/usr/lib/python3/dist-packages/dateutil/parser.py", line 25, in 
from six import text_type, binary_type, integer_types
ModuleNotFoundError: No module named 'six'
Debugger entered--Lisp error: (json-readtable-error 84)
  signal(json-readtable-error (84))
  json-read()
  json-read-from-string("Traceback (most recent call last):\n  File 
\"/usr/local/bin/jupyter-kernelspec\", line 7, in \nfrom 
jupyter_client.kernelspecapp import KernelSpecApp\n  File 
\"/usr/local/lib/python3.6/dist-packages/jupyter_client/__init__.py\", line 6, 
in \nfrom .asynchronous import AsyncKernelClient  # noqa\n  File 
\"/usr/local/lib/python3.6/dist-packages/jupyter_client/asynchronous/__init__.py\",
 line 1, in \nfrom .client import AsyncKernelClient  # noqa\n  File 
\"/usr/local/lib/python3.6/dist-packages/jupyter_client/asynchronous/client.py\",
 line 6, in \nfrom jupyter_client.channels import HBChannel\n  File 
\"/usr/local/lib/python3.6/dist-packages/jupyter_client/channels.py\", line 15, 
in \nfrom .session import Session\n  File 
\"/usr/local/lib/python3.6/dist-packages/jupyter_client/session.py\", line 52, 
in \nfrom jupyter_client.jsonutil import extract_dates\n  File 
\"/usr/local/lib/python3.6/dist-packages/jupyter_client/jsonutil.py\", line 15, 
in \nfrom dateutil.parser import parse as _dateutil_parse  # type: 
ignore\n  File \"/usr/lib/python3/dist-packages/dateutil/parser.py\", line 25, 
in \nfrom six import text_type, binary_type, 
integer_types\nModuleNotFoundError: No module named 'six'\n")
  ob-ipython--get-kernels()
  ob-ipython-auto-configure-kernels()
  run-hooks(change-major-mode-after-body-hook text-mode-hook outline-mode-hook 
org-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook text-mode-hook 
outline-mode-hook org-mode-hook))
  run-mode-hooks(org-mode-hook)
  org-mode()
  set-auto-mode-0(org-mode nil)
  set-auto-mode--apply-alist((("\\.odb\\'" . archive-mode) ("\\.oth\\'" . 
archive-mode) ("\\.otf\\'" . archive-mode) ("\\.oti\\'" . archive-mode) 
("\\.otc\\'" . archive-mode) ("\\.wiki\\'" . wikipedia-mode) ("\\.text\\'" . 
markdown-mode) ("\\.tlc\\'" . tlc-mode) ("\\.m\\'" . matlab-mode) ("\\.org$" . 
org-mode) ("\\.odc\\'" . archive-mode) ("\\.odf\\'" . archive-mode) 
("\\.odi\\'" . archive-mode) ("\\.otp\\'" . archive-mode) ("\\.odp\\'" . 
archive-mode) ("\\.otg\\'" . archive-mode) ("\\.odg\\'" . archive-mode) 
("\\.ots\\'" . archive-mode) ("\\.ods\\'" . archive-mode) ("\\.odm\\'" . 
archive-mode) ("\\.ott\\'" . archive-mode) ("\\.odt\\'" . archive-mode) 
("\\.fqm$" . message-mode) ("\\.alda\\'" . alda-mode) ("\\.[Cc][Ss][Vv]\\'" . 
csv-mode) ("\\.d[i]?\\'" . d-mode) ("\\.diffscuss\\'" . diffscuss-mode) 
("\\.djvu\\'" . djvu-dummy-mode) 
("[/]pentadactyl\\.\\(inbox\\|mail\\)\\.google\\..*\\.txt..." . 
gmail-message-mode) 
("[/]itsalltext[/]\\(inbox\\|mail\\)\\.google\\..*\\.t..." . 
gmail-message-mode) 
("[/]\\(inbox\\|mail\\)-google-com.*\\.\\(ckr\\|html?\\|t..." . 
gmail-message-mode) ("hg-histedit-" . hg-histedit-mode) ("\\.hgignore\\'" . 
hgignore-mode) ("/Mercurial\\.ini\\'" . hgrc-mode) ("/\\.hg/hgrc\\'" . 
hgrc-mode) ("/\\.hgrc\\'" . hgrc-mode) ("\\.lean$" . lean-mode) ("\\.ledger\\'" 
. ledger-mode) ("/git-rebase-todo\\'" . git-rebase-mode) ("\\.R$" . R-mode) 
("\\.jl\\'" . julia-mode) ("\\.tlc$" . tlc-mode) ("\\.m$" . matlab-mode) 
("\\.hva\\'" . latex-mode) ("\\.swift\\'" . 

Re: [BUG] Citations: Locator treated as prefix [9.5 (release_9.5-225-g494c20 @ /home/quintus/.emacs.d/org-mode/lisp/)]

2021-11-12 Thread Nicolas Goaziou
M. ‘quintus’ Gülker  writes:

>> I don’t think it is reasonable to expect this variable to contain every
>> identifier in every language. It may be a good idea to turn the variable
>> above into a defcustom, thus.
>
> Probably, but I will leave this to you. Just using the standard
> “chapter” selector resolves my problem here.

Good. I’m not sure but I think it would be more natural if locators
could be expressed in user’s language. I will let actual users chime in.

>> Meanwhile, you can test again after evaluating:
>>
>>   (push '("Kap." . "chapter") org-cite-csl--label-alist)
>
> Interestingly, doing this does not make it work for me, the “Kap.” still
> is displays at the beginning.

Indeed. I forgot to say you also need to re-evaluate
‘org-cite-csl--label-regexp’ definition (in "oc-csl.el"), in order to
refresh the locator regexp matched against.

Regards,



Re: [BUG] Citations: Locator treated as prefix [9.5 (release_9.5-225-g494c20 @ /home/quintus/.emacs.d/org-mode/lisp/)]

2021-11-12 Thread M . ‘quintus’ Gülker
Am Freitag, dem 12. November 2021 schrieb Nicolas Goaziou:
> This is because "Kap." is not known as a locator identifier. See
> ‘org-cite-csl--label-alist’ for the full list of such identifiers.

You are right, sir. “Kap.” is German for “chapter” and CSL does have a
localisable chapter locator. Using

Das ist ein Test [cite:@redeker2020itr chapter A Rn. 72, Suffixtext hier]

results indeed in the desired

1 Redeker, IT-Recht, 7. Aufl. (2020), Kap. A Rn. 72 Suffixtext hier

. Thanks for pointing it out.

> I don’t think it is reasonable to expect this variable to contain every
> identifier in every language. It may be a good idea to turn the variable
> above into a defcustom, thus.

Probably, but I will leave this to you. Just using the standard
“chapter” selector resolves my problem here.

> Meanwhile, you can test again after evaluating:
>
>   (push '("Kap." . "chapter") org-cite-csl--label-alist)

Interestingly, doing this does not make it work for me, the “Kap.” still
is displays at the beginning.

  -quintus

-- 
Dipl.-Jur. M. Gülker | https://mg.guelker.eu | PGP: Siehe Webseite
Passau, Deutschland  | kont...@guelker.eu| O<



Re: execute src block during export (Re: Worg HTML export problem?)

2021-11-12 Thread Thomas S. Dye

Aloha Max,

Max Nikulin  writes:


On 12/11/2021 00:24, Thomas S. Dye wrote:
The original problem is likely due to the default header 
arguments in 
ob-org.el, which are unusual.


It is great that the problem is solved. I do not think however 
that something
inside ob-org.el may affect processing of a file before this 
package is loaded.



If I export both, then all is well.
#+begin_src emacs-lisp :results value none :exports both
  (org-babel-do-load-languages
   'org-babel-load-languages
   '((org . t)))
#+end_src


I feel that I have missed something. I do not see the purpose to 
include this
source block in user docs. I expect that for accidental usage it 
is more
convenient to type (require 'ob-org), while as a permanent 
settings it is
possible to do customize-variable org-babel-load-languages or to 
use

`add-to-list'.


The source block is included to show the user how to modify their 
.emacs.


I was surprised that changing its :results header argument had an 
effect on export.


Do you have an explanation why the header argument makes this 
difference on Worg?


All the best,
Tom

--
Thomas S. Dye
https://tsdye.online/tsdye



Re: execute src block during export (Re: Worg HTML export problem?)

2021-11-12 Thread Max Nikulin

On 12/11/2021 00:24, Thomas S. Dye wrote:


The original problem is likely due to the default header arguments in 
ob-org.el, which are unusual.


It is great that the problem is solved. I do not think however that 
something inside ob-org.el may affect processing of a file before this 
package is loaded.



If I export both, then all is well.

#+begin_src emacs-lisp :results value none :exports both
  (org-babel-do-load-languages
   'org-babel-load-languages
   '((org . t)))
#+end_src


I feel that I have missed something. I do not see the purpose to include 
this source block in user docs. I expect that for accidental usage it is 
more convenient to type (require 'ob-org), while as a permanent settings 
it is possible to do customize-variable org-babel-load-languages or to 
use `add-to-list'.






babel+matlab+python2.7+matlab_kernel ipython jupyter matlab: problem

2021-11-12 Thread Uwe Brauer
Hi 

I am on ubuntu 16.04 with python 3.5 and 2.7 in the past I have used
successfully the matlab python kernel for 3.5

Using more or less this:
sudo apt-get install python3-setuptools
sudo -H python3 -m pip install jupyter
sudo apt-get remove python3-pexpect
sudo -H python3 -m pip install pexpect
sudo -H python3 -m pip install matlab_kernel
** Install the python API for matlab.
MATLABROOT=/usr/local/MATLAB/R2016b
Cd $MATLABROOT/extern/engines/python
sudo -H python3 setup.py install 
** Start the engine
Run
/usr/bin/python3
in the python prompt:
import matlab.engine
eng = matlab.engine.start_matlab()
the eng command needs some time to run. 


When finished run now 




#+BEGIN_SRC emacs-lisp
(setq org-confirm-babel-evaluate nil)   
;;; display/update images in the buffer after I evaluate
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append)

(add-to-list 'org-src-lang-modes '("matlab" . matlab))
(setq python-shell-interpreter "/usr/bin/python3")
;(setq python-shell-interpreter "/usr/bin/python2.7")
;; set default headers for convenience
(setq org-babel-default-header-args:matlab
  '((:results . "output replace")
(:session . "matlab")
(:kernel . "matlab")
(:exports . "code")
(:cache .   "no")
(:noweb . "no")
(:hlines . "no")
(:tangle . "no")))
(defalias 'org-babel-execute:matlab 'org-babel-execute:ipython)
(defalias 'org-babel-prep-session:matlab 'org-babel-prep-session:ipython)
(defalias 'org-babel-matlab-initiate-session 
'org-babel-ipython-initiate-session)
#+END_SRC

However I am forced to use matlab 2019b, which is not longer compatible
with python 3.5, but according to their documentation with 2.7, so I
repeated the steps above using python-2.7 instead of 3.5

And of course
;(setq python-shell-interpreter "/usr/bin/python3")
(setq python-shell-interpreter "/usr/bin/python2.7")

But when I try to execute in an org file 

#+begin_src matlab :results output latex :exports results  :eval never-export 
:wrap latex
x = [1, 2, 3, 4, 5];
fprintf('|%d', x)
#+end_src


Emacs shows me that is he is working and working and finally I have to
interrupt the process, I also don't see any error stack.

Anybody has successfully used the above configuration with python 2.7?

Thanks

Uwe Brauer 




Re: [BUG] Citations: Locator treated as prefix [9.5 (release_9.5-225-g494c20 @ /home/quintus/.emacs.d/org-mode/lisp/)]

2021-11-12 Thread Nicolas Goaziou
Hello,

M. ‘quintus’ Gülker  writes:

> take this org file `mwe.org':
>
> #+TITLE: Test
> #+AUTHOR: Testauthor
>
> #+LANGUAGE: de
> #+bibliography: /tmp/mwe/mwe.bib
>
> #+cite_export: csl /tmp/mwe/juristische-schulung.csl
>
> Das ist ein Test [cite:@redeker2020itr Kap. A Rn. 72, Suffixtext hier]
>
> with this `mwe.bib' Biblatex file:
>
> @Book{redeker2020itr,
> author   = {Helmut Redeker},
> title= {IT-Recht},
> year  = {2020},
> edition   = {7},
> publisher = {C.H. Beck},
> location  = {München},
> langid= {ngerman}}
>
> `juristische-schulung.el' is 
> https://github.com/citation-style-language/styles/blob/e22b8a566bad9b4c7f52720f60dd875057a5d210/juristische-schulung.csl
>
> When this is exported to HTML, the locator `Kap. A Rn. 72' is split and
> partly taken as the prefix. It exports to this:
>
> 1 Kap. A Rn.  Redeker, IT-Recht, 7. Aufl. (2020), 72 Suffixtext hier
>
> This is incorrect; it should export to:
>
> 1 Redeker, IT-Recht, 7. Aufl. (2020), Kap. A Rn. 72 Suffixtext
> hier

This is because "Kap." is not known as a locator identifier. See
‘org-cite-csl--label-alist’ for the full list of such identifiers.

I don’t think it is reasonable to expect this variable to contain every
identifier in every language. It may be a good idea to turn the variable
above into a defcustom, thus.

Meanwhile, you can test again after evaluating:

  (push '("Kap." . "chapter") org-cite-csl--label-alist)

Regards,
-- 
Nicolas Goaziou