Re: [O] custom port for postgresql

2016-09-13 Thread Adam Porter
Jakob Lombacher  writes:

> -(defun org-babel-sql-dbstring-postgresql (host user database)
> +(defun org-babel-sql-dbstring-postgresql (host port user database)

Hi Jakob,

Two suggestions:

1.  Generally people put something like "[PATCH]" in the subject so that
the maintainers will know it contains a patch.  :)

2.  I'd suggest putting the new `port` argument at the end of the
argument list, after an ``.  Even though it makes more sense to
put it after the host, putting it at the end and making it optional
means that people won't have to change existing code that calls this
function.

Thanks for submitting the patch.




Re: [O] org-ref: renaming/moving an entire pdf library according to a bibtex file

2016-09-13 Thread Adam Porter
Martin Leduc  writes:

> However, is there a way to bypass the download
> (because I already have the file) and to directly move/rename the pdf
> to the bibtex-pdfs/ folder while validating my bibtex entry (or
> creating a new one, does not matter) ?

I haven't yet used org-ref myself, but it should be possible to advise
the function that handles the downloading to look for a local copy first
and use it instead.




Re: [O] Trouble with capture template and prompt

2016-09-13 Thread Adam Porter
Bart Bunting  writes:

> Several of the entries I do not use but thought I should include the
> entire variable.

Hi Bart,

Well, that looks okay to me.  Going back to the original error message
you provided, isn't C-c ! bound to insert an inactive org timestamp by
default?  It's strange that it would be involved here.

I think that whatever is the problem, it's not in the capture templates,
but somewhere else in your Org config.  But I would suggest, as a first
step, trying to reduce the problematic capture template to the bare
minimum, item by item, to see if you can make it work without the error.
If you can, whatever you remove that's causing it should point you
toward the problem.

One other thing, you said that that code is from .customize.  Is there
anything related to the capture templates in your other config files?




[O] org-ref: renaming/moving an entire pdf library according to a bibtex file

2016-09-13 Thread Martin Leduc

Hi,

I just discovered org-ref recently and would like to manage my entire 
pdf library with it. Basically, my set-up is a folder containing many 
scientific papers in pdf, and a bibtex file containing most of the 
entries related to these pdfs.


My bibtex file is well linked to org-ref and I have already moved 
several pdfs into the bibtex-pdfs/ folder so that they can be opened 
easily using their bibtex entry. However, I found this to be a lot of 
work for moving/linking only a few pdfs. I'm wondering if there is a way 
to automate that.


When I'm moving one of my pdfs onto the emacs window with the 
bibliography opened, it tries to download the pdf from the web using the 
doi (if found). However, is there a way to bypass the download (because 
I already have the file) and to directly move/rename the pdf to the 
bibtex-pdfs/ folder while validating my bibtex entry (or creating a new 
one, does not matter) ?


Thanks for helping,
Martin




Re: [O] Trouble with capture template and prompt

2016-09-13 Thread Bart Bunting
Adam,

Here it is from .customize.

Several of the entries I do not use but thought I should include the
entire variable.

 '(org-capture-templates
   (quote
(("t" "todo" entry
  (file "~/.org/refile.org")
  "* TODO %^{Todo} 
%u
%a
%?" :clock-in t :clock-resume t)
 ("r" "respond" entry
  (file "~/.org/refile.org")
  "* NEXT Respond to %:from on %:subject
SCHEDULED: %t
%U
%a
" :immediate-finish t :clock-in t :clock-resume t)
 ("n" "note" entry
  (file "~/.org/refile.org")
  "* %? :NOTE:
%U
%a
" :clock-in t :clock-resume t)
 ("j" "Journal" entry
  (file+datetree "~/.org/diary.org")
  "* %?
%U
" :clock-in t :clock-resume t)
 ("w" "org-protocol" entry
  (file "~/.org/refile.org")
  "* TODO Review %c
%U
" :immediate-finish t)
 ("m" "Meeting" entry
  (file "~/.org/refile.org")
  "* MEETING with %? :MEETING:
%U" :clock-in t :clock-resume t)
 ("p" "password" entry
  (file "~/filing/p/passwords.gpg")
  "* %^{Title}
   %^{USERNAME}p %^{PASSWORD}p")
 ("P" "Phone call" entry
  (file "~/.org/refile.org")
  "* PHONE %? :PHONE:
%U" :clock-in t :clock-resume t)
 ("h" "Habit" entry
  (file "~/.org/refile.org")
  "* NEXT %?
%U
%a
SCHEDULED: %(format-time-string \"<%Y-%m-%d %a .+1d/3d>\")
:PROPERTIES:
:STYLE: habit
:REPEAT_TO_STATE: NEXT
:END:
"


Kind regards
Adam Porter  writes:

> Bart Bunting  writes:
>
>> The error that is shown in the messages buffer is:
>>
>> Template key: 
>> Capture abort: (error Key sequence C-c ! starts with non-prefix key C-c) 
>
> I think this means that you have tried to specify the capture template
> key incorrectly.  It would be helpful if you could show us the elisp
> code that defines the template rather than the customize-option screen.
> :)  e.g.:
>
> #+BEGIN_SRC elisp
> '(("a" "Appointment" entry
>(file+datetree+prompt
> (concat org-directory "/calendar.org")
> "Calendar")
>"* %^{Description} %T %^G\n\n%U %?" :clock-in t :clock-resume t)
>   ("t" "Task" entry
>(file "")
>"* TODO %^{Description}%^G\n\n%U %?" :clock-in t :clock-resume t))
> #+END_SRC
>
>
Bart
-- 

Bart Bunting



Re: [O] Multiple bibliography files with ox-bibtex and html export

2016-09-13 Thread Thibault Marin

Clément Pit--Claudel writes:

> On 2016-09-06 23:46, Thibault Marin wrote:
 I am attaching a patch which allows me to use multiple files with html
 export.  It creates a combined bibliography file and call bibtex2html on
 it.  I am not sure this is the best way to address this, so any
 suggestion would be welcome.
>
> Sorry for the late comment.  bibtex2html can read from standard input; maybe 
> that would be cleaner?
>
> Clément.

That may be a good idea, it would prevent potential name clashing with
the created bib file.  Currently, the function creates a
-combined.bib file with the content of all
bibliography files, then bibtex2html creates
-combined.html and
-combined_bib.html.  Passing the contents via stdin
would skip the -combined.bib.  We could achieve the
same by simply deleting -combined.bib after calling
bibtex2html.  I personally don't mind leaving the .bib file after
processing, but if there is a consensus to limit the side effect, we can
do that.

As far as the implementation goes, I am not sure what is the best way to
get this to work with stdin.  In the attached patch (which does *not*
work) I tried to use `call-process-region' and dump the bibliography
files into a temporary buffer.  This complicates the code a little.
Alternatively, we could use the `INFILE' parameter from `call-process',
but it looks that this would require a file, so it would not change much
from the previous patch.

Any thoughts?

>From 85369923cdd7540467a615ca92cf486fd6d08708 Mon Sep 17 00:00:00 2001
From: thibault 
Date: Thu, 8 Sep 2016 22:06:21 -0500
Subject: [PATCH 2/2] * contrib/lisp/ox-bibtex.el
 (org-bibtex-process-bib-files): (WIP)  Add support for multiple bibliography
 files with html export.

Pass multiple bibliography files (comma separated) to bibtex2html.
---
 contrib/lisp/ox-bibtex.el | 82 ++-
 1 file changed, 53 insertions(+), 29 deletions(-)

diff --git a/contrib/lisp/ox-bibtex.el b/contrib/lisp/ox-bibtex.el
index b46cb76..38c0957 100644
--- a/contrib/lisp/ox-bibtex.el
+++ b/contrib/lisp/ox-bibtex.el
@@ -187,24 +187,20 @@ Return new parse tree."
 (org-element-map tree 'keyword
   (lambda (keyword)
 	(when (equal (org-element-property :key keyword) "BIBLIOGRAPHY")
-	  (let ((arguments (org-bibtex-get-arguments keyword))
-		(file (org-bibtex-get-file keyword))
-		temp-file
-		out-file)
-	(let ((files (split-string file ",")))
-	  (when (< 1 (length files))
-		(let ((combined-bib-file
-		   (concat
-			(file-name-sans-extension
-			 (file-name-nondirectory
-			  (buffer-file-name))) "-combined.bib")))
-		  (with-temp-file combined-bib-file
-		(dolist (bib files)
-		  (insert-file-contents
-		   (if (equal (file-name-extension bib) "bib")
-			   bib
-			 (concat bib ".bib")
-		  (setq file combined-bib-file
+	  (let* ((arguments (org-bibtex-get-arguments keyword))
+		 (file (org-bibtex-get-file keyword))
+		 temp-file
+		 out-file
+		 (multiple-bib-files (split-string file ","))
+		 (multiple-bib-p (< 1 (length multiple-bib-files)))
+		 multiple-bib-file)
+	(when multiple-bib-p
+	  (setq multiple-bib-file
+		(concat
+		 (file-name-sans-extension
+		  (file-name-nondirectory
+		   (buffer-file-name))) "-combined.bib"))
+	  (setq file multiple-bib-file))
 	;; Test if filename is given with .bib-extension and strip
 	;; it off. Filenames with another extensions will be
 	;; untouched and will finally rise an error in bibtex2html.
@@ -231,17 +227,45 @@ Return new parse tree."
  (append (plist-get arguments :options)
 	 (list "-citefile" temp-file))
 	;; Call "bibtex2html" on specified file.
-	(unless (eq 0 (apply
-			   'call-process
-			   (append '("bibtex2html" nil nil nil)
-   '("-a" "-nodoc" "-noheader" "-nofooter")
-   (let ((style
-	  (org-not-nil
-	   (org-bibtex-get-style keyword
- (and style (list "--style" style)))
-   (plist-get arguments :options)
-   (list (concat file ".bib")
-	  (error "Executing bibtex2html failed"))
+	(let* ((bibtex2html-cmd '("bibtex2html" nil nil nil))
+		   (bibtex2html-args-default '("-a" "-nodoc" "-noheader"
+	   "-nofooter"))
+		   (bibtex2html-style
+		(let ((style
+			   (org-not-nil
+			(org-bibtex-get-style keyword
+		  (and style (list "--style" style
+		   (bibtex2html-opts (plist-get arguments :options)))
+	  (message "mf=%s file=%s" multiple-bib-file multiple-bib-files)
+	  (if multiple-bib-p
+		  (with-temp-buffer
+		multiple-bib-file
+		(dolist (bib multiple-bib-files)
+		  (insert-file-contents
+		   (if (equal (file-name-extension bib) "bib")
+			   bib
+			 (concat bib ".bib"
+		(unless
+			(eq 0
+			(apply
+			 'call-process-region
+			 (append `(,(point-min) ,(point-max))
+ bibtex2html-cmd
+ bibtex2html-args-default
+ 

[O] Bug: make test fails, no org-batch-test-init (8.3.5 tar.gz)

2016-09-13 Thread Rich Clark
TMPDIR=/tmp/tmp-orgtest emacs  -Q -batch --eval '(setq vc-handled-backends
nil org-startup-folded nil)'  --eval '(add-to-list '"'"'load-path (concat
default-directory "lisp"))' --eval '(add-to-list '"'"'load-path (concat
default-directory "testing"))'  -l org-batch-test-init --eval '(setq
org-batch-test t org-babel-load-languages (quote ( (awk . t)  (C . t)
 (fortran . t)  (maxima . t)  (lilypond . t)  (octave . t)  (perl . t)
 (python . t)  (emacs-lisp . t)  (shell . t)  (org . t)))
org-test-select-re "\\(org\\|ob\\)" )' -l org-loaddefs.el -l cl -l
testing/org-test.el -l ert -l org -l ox  --eval '(org-test-run-batch-tests
org-test-select-re)'
Cannot open load file: no such file or directory, org-batch-test-init
make: *** [mk/targets.mk:104: test] Error 255


Emacs  : GNU Emacs 24.5.1 (x86_64-unknown-cygwin)
 of 2015-06-23 on desktop-new
Package: Org-mode version 8.2.10 (release_8.2.10 @
/usr/share/emacs/24.5/lisp/org/)


Re: [O] Embedded LaTeX fontification

2016-09-13 Thread Kai von Fintel

On 9 Sep 2016, at 11:48, Eric S Fraga wrote:


On Friday,  9 Sep 2016 at 12:06, Kai von Fintel wrote:

When I embed LaTeX code in a #+BEGIN_SRC latex block and
org-src-fontify-natively is set to t, the code is fontified as LaTeX
code. But when the code is embedded in a #+BEGIN_LaTeX block, there's
no fontification. Is that as intended? Am I missing some setting? Or
could that functionality be added?


What version of org are you using?  In latest versions, begin_latex is
now
#+begin_export latex
...
#+end_export
and this does fontify correctly for me.


Hmm, I *thought* I was up to date: Org-mode version 8.3.5 
(8.3.5-8-gd2cb29-elpaplus @ 
/Users/fintel/.emacs.d/elpa/org-plus-contrib-20160905/). I guess I have 
to somehow get Spacemacs to use the bleeding edge version of org rather 
than the latest stable version?


-- Kai.

[O] org-board -- bookmarking and archival

2016-09-13 Thread Charles A. Roelli
Hi,

I've written a tool called "org-board" to keep track of web bookmarks
in an org mode file.  The tool can archive bookmarks instantly using
`wget', saving them in an entry's dedicated directory (made via
`org-attach').  Pretty much any option for `wget' can be used by
org-board, and the whole system is quite flexible.  Org mode already
seems like a natural place for bookmarks (with tagging, TODO entries,
linking, etc.) and org-board is a convenient extension to help you
keep all your data on your own machine.

There is a lot of room for improvement (check out the TODO.org file
for some of them).  I'm relatively new to elisp so I'd also appreciate
any style or general programming tips.

The repository is here: https://github.com/scallywag/org-board

Cheers,
Charles



Re: [O] using rgrep, ag, etc in folded org files?

2016-09-13 Thread Stig Brautaset
Clément Pit--Claudel  writes:

> On 2016-09-12 11:36, Aaron Ecay wrote:
>> (Arguably this hook function should be added to org-mode, if enough
>> people find it useful).
>
> That would be brilliant.

Adding my +1 to this, particularly if that would expand stuff in ediff
merge situations also! 

Stig