[O] bug#25132: 26.0.50; emacs hangs when loading org file with python source blocks

2017-01-23 Thread npostavs
Dmitry Gutov  writes:

> On 20.01.2017 03:52, npost...@users.sourceforge.net wrote:
>
>> My feeling is that inhibit-modification-hooks should usually be buffer
>> local anyway.
>
> Maybe you're right.
>
> inhibit-read-only, bound nearby, seems to be in the same situation.
>
>>> If we are not, why not make inhibit-modification-hooks always
>>> buffer-local instead?
>>
>> It would have to be in addition to, because even after doing
>> (make-variable-buffer-local 'var), (let ((var 'foo))...) still makes a
>> global binding.  `make-variable-buffer-local' only has effect for
>> `setq', which I think will hardly ever happen for
>> `inhibit-modification-hooks'.
>
> You're right, and that sounds a little too complicated for my taste.
>
> So, personally, I'd try to fix the particular instance
> first. Switching buffers inside with-silent-modifications is not a
> very common usage, I think.
>
> Maybe org-src should itself let-bind the aforementioned variable(s)
> where it visits other buffers.

Yeah, that works, and is my proposal for emacs-25, but I'm still leaning
towards solving this more broadly in with-silent-modifications, probably
also add a mention about this to the inhibit-modification-hooks
docstring.

I think doing the same to inhibit-read-only isn't worth the trouble
because if it happens to be let-bound to t in a buffer where it wasn't
"supposed" to be, the worst that happens is that an error *isn't*
thrown.





Re: [O] VM for org-based reproducible environment?

2017-01-23 Thread John Kitchin
I looked briefly into Docker, but I did not make any progress on it. 

Matt Price writes:

> I'd like to provide a way for people to copy my course materials in the
> easiest possible way. At present my export & grading processes rely on some
> customization of various tools, mostly emacs-based. So I'm thinking the
> easiest thing might be fore me to define a virtual machine, maybe
> docker-based, and distribute that.
>
> Is anyone already doing this? I remember maybe John K. saying something
> along these lines a year or so ago, but can't find the details right away.
> Would love to steal someone else's setup as I currently know nothing about
> docker...
>
> Thanks,
> Matt


-- 
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



[O] VM for org-based reproducible environment?

2017-01-23 Thread Matt Price
I'd like to provide a way for people to copy my course materials in the
easiest possible way. At present my export & grading processes rely on some
customization of various tools, mostly emacs-based. So I'm thinking the
easiest thing might be fore me to define a virtual machine, maybe
docker-based, and distribute that.

Is anyone already doing this? I remember maybe John K. saying something
along these lines a year or so ago, but can't find the details right away.
Would love to steal someone else's setup as I currently know nothing about
docker...

Thanks,
Matt


Re: [O] run a function during capture

2017-01-23 Thread Nick Dokos
Alan Schmitt  writes:

> ...
> - I added a hook to org-capture-after-finalize-hook
  ^
>   #+begin_src emacs-lisp
>   (defun as/do-org-board-dl-hook ()
> (when (equal (buffer-name) (concat "CAPTURE-" as/org-board-capture-file))
>   (org-board-archive)))
>
>   (add-hook 'org-capture-before-finalize-hook 'as/do-org-board-dl-hook)
   ^^
>   #+end_src
>
> (Note: I mistakenly said that the "prepare" hook worked, but that would
 ^^^
> download the file even when cancelling, which was wrong)
>

Make up your mind, will you? :-)

-- 
Nick




Re: [O] Is it possible to "properly" indent inside latex fragments?

2017-01-23 Thread Charles C. Berry

On Mon, 23 Jan 2017, alain.coch...@unistra.fr wrote:



Hello.

This is what I obtain if I type each line followed by  and then
 in an org file:

* foo
 \begin{displaymath}
 \begin{split}
 a &= b \\
 &+c
 \end{split}
 \end{displaymath}

If I highlight everything and use 'M-x indent-region' or 'M-x
org-indent-region', it does not change.

Instead, what I would like to get is:

* foo
 \begin{displaymath}
   \begin{split}
 a &= b \\
 &+c
   \end{split}
 \end{displaymath}

(That specific indentation for the latex instructions is what I obtain
within a .tex file.)

Is it possible?


With export blocks you can get close.

If you type =C-c '= inside the following export block, you will get the 
contents in a latex buffer. Then indentation and other LATEX/P mode 
operations are available. When you exit with another =C-c '= the 
indentation is preserved.


#+BEGIN_EXPORT latex
\begin{displaymath}
  \begin{split}
a &= b \\
&+c
  \end{split}
\end{displaymath}
#+END_EXPORT


HTH,

Chuck



[O] Is it possible to "properly" indent inside latex fragments?

2017-01-23 Thread Alain . Cochard

Hello.  

This is what I obtain if I type each line followed by  and then
 in an org file:

* foo
  \begin{displaymath}
  \begin{split}
  a &= b \\
  &+c  
  \end{split}
  \end{displaymath}

If I highlight everything and use 'M-x indent-region' or 'M-x
org-indent-region', it does not change.

Instead, what I would like to get is:

* foo
  \begin{displaymath}
\begin{split}
  a &= b \\
  &+c
\end{split}
  \end{displaymath}

(That specific indentation for the latex instructions is what I obtain
within a .tex file.)

Is it possible?  
Thank you.

(I did spend quite some time searching for a solution...)

-- 
EOST (École et Observatoire des Sciences de la Terre) 
IPG (Institut de Physique du Globe) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 106] | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France| Fax:   +33 (0)3 68 85 01 25 


[O] raising frame on capture hack

2017-01-23 Thread Alan Schmitt
Hello,

I'm using the following hack to raise the emacs frame when doing a
capture from outside emacs:

#+begin_src emacs-lisp
  (defun as/raise-frame ()
(select-frame-set-input-focus (selected-frame)))

  (add-hook 'org-capture-mode-hook 'as/raise-frame)
#+end_src

Is there a better way?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2016-12: 404.48, 2015-12: 401.85


signature.asc
Description: PGP signature


Re: [O] run a function during capture

2017-01-23 Thread Alan Schmitt
On 2017-01-20 15:25, Xebar Saram  writes:

> Alan: once you have your org-board and capture setting finalized , i
> would be very interested to get more details on your setup and work
> flow, this looks really interesting!

Here is how I did it:
- on Firefox side, I installed Org-capture for Firefox
  http://chadok.info/firefox-org-capture/. Alternatively, you can do it
  manually by following http://weblog.zamazal.org/org-mode-firefox/ (in
  the “The advanced way” section)
- I "(require 'org-protocol)" and have installed the "org-board"
  package.
- I setup a capture template like this:
  #+begin_src emacs-lisp
  (setq as/org-board-capture-file "my-org-board.org")

  (setq org-capture-templates
`(...
  ("c" "capture through org protocol" entry
(file+headline ,as/org-board-capture-file "Unsorted")
"* %?%:description\n:PROPERTIES:\n:URL: %:link\n:END:\n\n Added %U")
  ...))
  #+end_src
- I added a hook to org-capture-after-finalize-hook
  #+begin_src emacs-lisp
  (defun as/do-org-board-dl-hook ()
(when (equal (buffer-name) (concat "CAPTURE-" as/org-board-capture-file))
  (org-board-archive)))

  (add-hook 'org-capture-before-finalize-hook 'as/do-org-board-dl-hook)
  #+end_src

(Note: I mistakenly said that the "prepare" hook worked, but that would
download the file even when cancelling, which was wrong)

I think this is it.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2016-12: 404.48, 2015-12: 401.85


signature.asc
Description: PGP signature


Re: [O] run a function during capture

2017-01-23 Thread Alan Schmitt
On 2017-01-19 12:11, Nick Dokos  writes:

> Alan Schmitt  writes:
>
>> Hello,
>>
>> It is possible to run a function at the end of capture? I would like to
>> call org-board-archive (that downloads a web page according to some
>> properties) before finishing the capture?
>>
>
> There are three hooks that are run from org-capture-finalize:
>
> - org-capture-prepare-finalize-hook
> - org-capture-before-finalize-hook
> - org-capture-after-finalize-hook
>
> Check their documentation for when they are run and what the context is.
> One of them should be good enough for what you want to do.

Thanks, this was most helpful. org-capture-prepare-finalize-hook worked
great.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2016-12: 404.48, 2015-12: 401.85


signature.asc
Description: PGP signature


[O] Mobile org

2017-01-23 Thread Paul Schlesinger
For about two weeks since getting a new ipad I have not been able to
re-install mobile org. After setting up dropbox I can log in from MobileOrg
but the target directories are not created and they are not use if I create
them manually. This seems to me to be resulting from a change in dropbox.
Perhaps these are anticipated by the promise of a version 1.71 that appears
to be expected but not available. I would appreciate direction to
installation instructions that are current or other explanation.


Thank you

Paul Schlesinger

-- 
Paul H. Schlesinger MD, PhD
Washington University School of Medicine


Re: [O] Table formula from code block

2017-01-23 Thread Michael Welle
Hello,

I think there are several problems, starting with BEGIN_SRC sh and some
more. But fixing them doesn't bring success. I even have trouble to get
a minimal example to work:

#+NAME: foo
#+BEGIN_SRC emacs-lisp
(+ 4 4)
#+END_SRC


|  bar   | foo|
|+|
| 42 | #ERROR |
#+TBLFM: $2='(org-sbe "foo")::$1=42


I'm not sure, what the problem is. Looking at org-sbe there is
something, I don't understand. In the end org-babel-execute-src-block is
called. That executes the _current_ source code block. But I don't
understand, how foo (in this example) becomes the current source code
block. Can someone explain, please? Is there a side effect, I don't see?
Or maybe a regression?

Regards
hmw