Re: [O] function-finding-location?

2017-04-23 Thread Michael Welle
Hello,

Xebar Saram  writes:

> today i saw this in the DOCU
>
> (file+function "path/to/file" function-finding-location)
> A function to find the right location in the file.
>
> i assume you dont just use "function-finding-location" but rather a
> specific function. are there examples for such functions?
something like this would do the trick:

(defun hmw/foo ()
  (goto-char (org-find-exact-headline-in-buffer "boingfoo")))

You can, of course, use regexp or other means of finding the position in
the file.

Does that help?

Regards
hmw




[O] LaTeX export of org file uses listings instead of minted, why?

2017-04-23 Thread vendo.li...@libero.it
Hello again, I'm still trying to find out why emacs doesn't pick up MINTED 
instead of LISTINGS to handle code blocks when exporting files from .org to 
.pdf, via .tex.
I backed-up my previous .emacs file (which had a lot of customization for 
Beamer, AUCTeX etc.), loaded Nick Dokos' minimal init file, restarted emacs 
then tried exporting a minimal working example (MWE) of an Org file. IT 
WORKS!!! (Even though the background color is Black and I'd like it to be 
White!)
I've tried exporting a more complicated Org file and it works too! (Albeit with 
a dark background that makes it hard to read some lines).
Now the question is how do I integrate these lines in my old .emacs file so 
that I can keep all other modes' settings AND export code flawlessly from Org 
mode?
This is the result of `C-h v org-latex-listings' variable given while .emacs 
file was open. In truth, this was its value also a couple of days ago, with my 
old .emacs file active.

--org-latex-listings
 is a variable defined in `ox-latex.el'.Its value is mintedOriginal value was 
nil--
Here's the very simple MWE of an Org 
file:#+TITLE: My 
Minted Experiment#+AUTHOR: me#+DATE: #+STARTUP: nolatexpreview#+OPTIONS: 
toc:nil#+LATEX_CLASS: article#+LATEX_CLASS_OPTIONS: [a4paper,10pt]#+ATTR_LATEX: 
:mode table :booktabs#+LATEX_HEADER: \usepackage{esdiff}#+LATEX_HEADER: 
\usepackage[version=4]{mhchem}#+LATEX_HEADER: 
\usepackage{amssymb}#+LATEX_HEADER: \usepackage{siunitx}#+LATEX_HEADER: 
\usepackage{booktabs}#+LATEX_HEADER: \setcounter{secnumdepth}{0}#+LATEX_HEADER: 
\usepackage[margin=1in]{geometry}#+LATEX_HEADER: \frenchspacing 
\allowdisplaybreaks#+LATEX_HEADER: \usepackage{fancyhdr}#+LATEX_HEADER: 
\pagestyle{fancy} % choose page-style#+LATEX_HEADER: \fancyhf{}  % erase and 
clean up#+LATEX_HEADER: \fancyhf[HLE,HRO]{\thepage} % H or F=Header or Footer, 
LCR=Left, Centre, Right#+LATEX_HEADER: \fancyhf[HC]{My minted experiment}
* SECTION#+BEGIN_SRC python print "there's some code here"; a= 
True;#+END_SRC---

Here's the TeX file generated with the Export command (C-c C-e l 
o)---% Created 
2017-04-23 Sun 
13:23\documentclass[a4paper,10pt]{article}\usepackage[utf8]{inputenc}\usepackage[T1]{fontenc}\usepackage{fixltx2e}\usepackage{graphicx}\usepackage{longtable}\usepackage{float}\usepackage{wrapfig}\usepackage{rotating}\usepackage[normalem]{ulem}\usepackage{amsmath}\usepackage{textcomp}\usepackage{marvosym}\usepackage{wasysym}\usepackage{amssymb}\usepackage{hyperref}\tolerance=1000\usepackage{minted}\usepackage{esdiff}\usepackage[version=4]{mhchem}\usepackage{amssymb}\usepackage{siunitx}\usepackage{booktabs}\setcounter{secnumdepth}{0}\usepackage[margin=1in]{geometry}\frenchspacing
 \allowdisplaybreaks\usepackage{fancyhdr}\pagestyle{fancy} % choose 
page-style\fancyhf{}  % erase and clean up\fancyhf[HLE,HRO]{\thepage} % H or 
F=Header or Footer, LCR=Left, Centre, Right\fancyhf[HC]{My minted 
experiment}\author{me}\date{}\title{My Minted Experiment}\hypersetup{  
pdfkeywords={},  pdfsubject={},  pdfcreator={Emacs 24.4.1 (Org mode 
8.2.10)}}\begin{document}
\maketitle
\section{SECTION}\label{sec-1}\begin{minted}[fontsize=\footnotesize,bgcolor=black,obeytabs=true]{python}
 print "there's some code here"; a= True;\end{minted}% Emacs 24.4.1 (Org mode 
8.2.10)\end{document}---
This is how the .emacs file looks now: 
- (server-start)
; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) (setq reftex-plug-into-AUCTeX t)
;;; a key for tilde symbol(define-key key-translation-map (kbd "M-2") (kbd 
"~"));;; a key for backquote symbol(define-key key-translation-map (kbd "M-6") 
"")(define-key key-translation-map (kbd "M-9") (kbd "`"));;this one's only for 
CDLaTeX math insertion(define-key key-translation-map (kbd "C-1") (kbd "`"))
;; visual line word wrapping(global-visual-line-mode t)
;;automatically recognize org files(add-to-list 'auto-mode-alist '("\\.org\\'" 
. org-mode))
;; MINIMAL init FILE. HERE'S WHERE NICK'S INIT FILE STARTS
(add-to-list 'load-path "~/src/emacs/org/org-mode/lisp")
(require 'org-loaddefs)(require 'org)
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(global-set-key "\C-cl" 'org-store-link)(global-set-key "\C-cc" 
'org-capture)(global-set-key "\C-ca" 'org-agenda)
;;; 
(setq org-latex-listings 'minted  org-latex-packages-alist '(("" "minted"))  
org-latex-pdf-process  '("pdflatex -shell-escape -interaction nonstopmode 
-output-directory %o %f""pdflatex -shell-escape -interaction nonstopmode 
-output-directory %o %f"))-


Re: [O] LaTeX export of org file uses listings instead of minted, why?

2017-04-23 Thread Kaushal Modi
Not an answer to the issue you are seeing, but I noticed that you are using
Emacs 24.x and Org-mode 8.2.x. The Org-mode version especially is too old.

I can only suggest that you update to the latest version of Org-mode mode
(9.0.5) (and also that of Emacs (25.2) if you get a chance), so that the
debug time is not spent on old versions.
-- 

Kaushal Modi


[O] org capture properties from a list of strings?

2017-04-23 Thread Xebar Saram
Hi all

so i currently have this in my capture templates


:PROPERTIES:
:Time: %^{minutes|-|10|15|30|60}
:Rating: %^{rating?|-|1|2|3|4|5}
:END:

i was wondering if instead of manually putting the values in each line i
can perhaps supply a list like this


(defun returns-a-list-of-strings2
()
(list  "1" "2" "3" "4" "5" ))

is that somehow possible where i could have something like this


:Rating: %^{rating?|(returns-a-list-of-strings2)}

is that possible at all?

best

Z


Re: [O] function-finding-location?

2017-04-23 Thread Xebar Saram
thx guys


z

On Sun, Apr 23, 2017 at 10:07 AM, Michael Welle  wrote:

> Hello,
>
> Xebar Saram  writes:
>
> > today i saw this in the DOCU
> >
> > (file+function "path/to/file" function-finding-location)
> > A function to find the right location in the file.
> >
> > i assume you dont just use "function-finding-location" but rather a
> > specific function. are there examples for such functions?
> something like this would do the trick:
>
> (defun hmw/foo ()
>   (goto-char (org-find-exact-headline-in-buffer "boingfoo")))
>
> You can, of course, use regexp or other means of finding the position in
> the file.
>
> Does that help?
>
> Regards
> hmw
>
>
>


[O] LaTeX export of org file uses listings instead of minted, why?

2017-04-23 Thread vendo.li...@libero.it
Does this code from the backed-up .emacs interfere with TeX not working with 
MINTED in the body of the .tex file? Should I eliminate it? 
I'm thinking of posting all the bits of code where `minted' is mentioned, in 
the hopes that some of you experts can tell me whether I could eliminate/edit 
it. Please help me out!
Again, I'm using Org 8.2, Emacs 24 on a Win 7 32-bit machine (have no intention 
of upgrading, for now). Thank you in advance.

---(custom-set-variables
 ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you 
could mess it up, so be careful. ;; Your init file should contain only one such 
instance. ;; If there is more than one, they won't work right. 
'(ansi-color-faces-vector   [default default default italic underline success 
warning error]) '(cdlatex-math-symbol-prefix 64) '(custom-enabled-themes (quote 
(tango-dark))) '(org-format-latex-options   (quote(:foreground default 
:background default :scale 1.2 :html-foreground "Black" :html-background 
"Transparent" :html-scale 1.0 :matchers("begin" "$1" "$" "$$" "\\(" 
"\\[" '(org-latex-listings (quote minted)) '(org-latex-minted-langs   
(quote((emacs-lisp "common-lisp") (cc "c++") (cperl "perl") 
(shell-script "bash") (caml "ocaml") (latex "tex" 
'(org-latex-minted-options   (quote(("fontsize" "\\footnotesize") 
("bgcolor" "white") ("obeytabs" "true" '(org-startup-with-latex-preview 
nil) '(preview-default-document-pt 10) '(show-paren-mode t) 
'(transient-mark-mode (quote (only . 
t-


Re: [O] Bug: export does not ignore #+INCLUDE if archived or tagged :noexport: Package: Org mode version 9.0.5 (9.0.5-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20170210/)

2017-04-23 Thread Rasmus
Nicolas Goaziou  writes:

>>> when archiving sections or exclude them from export I would expect
>>> them being exempt from being evaluated during export.
>>> The section archived or marked as ~:no export:~ is still evaluated
>>> and there is an error
>>> if the reference in the include file is no longer available. I get
>>> the error message
>>> ~"org-export-expand-include-keyword: Cannot include file ~/filename.org"~
>>
>> IMO this is a feature.  I have used this before, for instance when
>> including tables used in source blocks at export time.
>
> I agree an included file could introduce Babel contents which would then
> be processed, even though the tree is not exported.
>
> However, COMMENT keyword prevents Babel evaluation, so we could avoid
> expanding include keywords in this particular case.
>
> WDYT?

It's fine to exclude #+include in COMMENT headlines IMO.

Cheers,
Rasmus

-- 
Spil noget med Slayer!



Re: [O] Bug: export does not ignore #+INCLUDE if archived or tagged :noexport: Package: Org mode version 9.0.5 (9.0.5-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20170210/)

2017-04-23 Thread Nicolas Goaziou
Hello,

Rasmus  writes:

> It's fine to exclude #+include in COMMENT headlines IMO.

Done in master.

Regards,

-- 
Nicolas Goaziou



Re: [O] set org-attach-directory location per buffer

2017-04-23 Thread Kyle Meyer
Xebar Saram  writes:

> i was wondering if one could use perhaps local variables in separate org
> files to define the location of the attachment folder per file [...]

Have you tried setting it as a file-local variable?

(info "(emacs)Specifying File Variables")

>  so that for each folder the attachment will be stored in a separate
> directory

I can't parse that sentence to see how it fits into the "per file" that
precedes it.

-- 
Kyle



[O] Infinite loop with org-inlinetask and org-sticky-header [was Re: ANN: org-sticky-header]

2017-04-23 Thread Adam Porter
Hi Charles,

Thanks for reporting this.  This is bizarre.  I reproduced it with my
personal config, and with "emacs -q", but it only happens if
org-inlinetask is loaded with "(require 'org-inlinetask)".  This is with
Emacs 25.1 and the Org package distributed with it for "emacs -q", and
with Emacs 25.1 and Org 9.0.5 on my personal config.

I used "pkill -SIGUSR2 emacs" to interrupt the infinite loop and get a
backtrace, but it took many tries of running that command in rapid
succession, because each time, "Entering debugger..." would flash in the
minibuffer for a moment before the process would go back into the
infinite loop.  After enough tries, it would stop the loop and show the
backtrace, but it would go back into the loop as soon as I tried to
switch windows or paste the backtrace into another program.  I had to
kill the process to make it stop.

I'll paste below two backtraces I managed to get, but I'm afraid I don't
know where to go from here.  Since it only happens if org-inlinetask is
loaded, I guess it's not a bug in org-sticky-header per se, but a bug
that org-sticky-header exposes somehow.  Aaron Jensen actually uncovered
a bug in Emacs itself, and in org-sticky-header, a few days ago:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26586

It was also an infinite loop.  It seems unlikely to me that it's the
same bug, but maybe they are related somehow.  It's all I have to go
on.  If you are interested and adventurous enough, you could try
building Emacs with the fix mentioned on that bug report, and see if you
can still reproduce it.

I can't be sure that it's actually a bug in Emacs, but since the
infinite loop is practically impossible to break out of without killing
the process, and since these backtraces don't mention anything related
to org-anything, it seems like it should be reported as an Emacs bug.

#+BEGIN_EXAMPLE
Debugger entered--entering a function:
* eval((if (display-graphic-p) " " "-"))
  redisplay_internal\ \(C\ function\)()
  recursive-edit()
  debug(lambda)
* eval((if (display-graphic-p) " " "-"))
  redisplay_internal\ \(C\ function\)()
  recursive-edit()
  debug(lambda)
* current-bidi-paragraph-direction()
  line-move-visual(1 nil)
  line-move(1 nil nil 1)
  next-line(1 1)
  funcall-interactively(next-line 1 1)
  call-interactively(next-line nil nil)
  command-execute(next-line)
  recursive-edit()
  debug(lambda)
* eval((if (display-graphic-p) " " "-"))
  redisplay_internal\ \(C\ function\)()
  recursive-edit()
  debug(lambda)
* eval((if (display-graphic-p) " " "-"))
  redisplay_internal\ \(C\ function\)()
  recursive-edit()
  debug(lambda)
* eval((if (display-graphic-p) " " "-"))
  redisplay_internal\ \(C\ function\)()
  recursive-edit()
  debug(lambda)
* eval((if (display-graphic-p) " " "-"))
  redisplay_internal\ \(C\ function\)()
  recursive-edit()
  debug(lambda)
* eval((if (display-graphic-p) " " "-"))
  redisplay_internal\ \(C\ function\)()
  recursive-edit()
  debug(lambda)
* tooltip-hide()
  recursive-edit()
  debug(lambda)
* eval((if (display-graphic-p) " " "-"))
  redisplay_internal\ \(C\ function\)()
  recursive-edit()
  debug(lambda)
* eval((if (display-graphic-p) " " "-"))
  redisplay_internal\ \(C\ function\)()
  recursive-edit()
  debug(lambda)
* tooltip-hide()
#+END_EXAMPLE

#+BEGIN_EXAMPLE
Debugger entered--entering a function:
* eval((if (display-graphic-p) " " "-"))
  redisplay_internal\ \(C\ function\)()
  recursive-edit()
  debug(lambda)
* eval((if (display-graphic-p) " " "-"))
  redisplay_internal\ \(C\ function\)()
  recursive-edit()
  debug(lambda)
* eval((if (display-graphic-p) " " "-"))
  redisplay_internal\ \(C\ function\)()
  read-from-minibuffer("M-x " nil (keymap (10 . minibuffer-complete-and-exit) 
(13 . minibuffer-complete-and-exit) keymap (menu-bar keymap (minibuf "Minibuf" 
keymap (tab menu-item "Complete" minibuffer-complete :help "Complete as far as 
possible") (space menu-item "Complete Word" minibuffer-complete-word :help 
"Complete at most one word") (63 menu-item "List Completions" 
minibuffer-completion-help :help "Display all possible completions") 
"Minibuf")) (27 keymap (118 . switch-to-completions)) (prior . 
switch-to-completions) (63 . minibuffer-completion-help) (32 . 
minibuffer-complete-word) (9 . minibuffer-complete) keymap (menu-bar keymap 
(minibuf "Minibuf" keymap (previous menu-item "Previous History Item" 
previous-history-element :help "Put previous minibuffer history element in the 
minibuffer") (next menu-item "Next History Item" next-history-element :help 
"Put next minibuffer history element in the minibuffer") (isearch-backward 
menu-item "Isearch History Backward" isearch-backward :help "Incrementally 
search minibuffer history backward") (isearch-forward menu-item "Isearch 
History Forward" isearch-forward :help "Incrementally search minibuffer history 
forward") (return menu-item "Enter" exit-minibuffer :key-sequence "" :help 
"Terminate input and exit minibuffer") (quit menu-item "Quit" 
abort-recursive-edit :

[O] [PATCH] ob-C.el: Fix command to perform on remote host

2017-04-23 Thread Иван Трусков
* lisp/ob-C.el (org-babel-C-execute): Made sure name of compiled
program is converted to local representation before sending it to the
shell on remote host.

The problem was when one would try to evaluate C source code block in
the file on remote host. Compilation would go normally, then
evaluation will fail with error like "/bin/sh: unable to find file
prevents that.

TINYCHANGE
---
 lisp/ob-C.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index 795bcb2..e54e174 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -161,7 +161,7 @@ or `org-babel-execute:C++' or `org-babel-execute:D'."
   (org-babel-eval
(pcase org-babel-c-variant
  ((or `c `cpp)
-  (concat tmp-bin-file cmdline))
+  (concat (org-babel-process-file-name tmp-bin-file) cmdline))
  (`d
   (format "%s %s %s %s"
   org-babel-D-compiler