Re: [O] Dynamically creating capture mode templates (solved)

2015-10-09 Thread tenspd137 .
Needed to use backquotes correctly:

(setq products '("Firebird" "Ion"))


(dolist (product products)
  (setq org-capture-templates
(append org-capture-templates `( (,(substring product 0 1) ,product)
(,(concat (substring product 0
1) "t" ) "Todo" entry (file+headline (concat org-directory
"/default.org") ,product) "* TODO %?" ) 

Again - I hope this helps someone else in the future.

Thanks!



On Fri, Oct 9, 2015 at 12:34 PM, tenspd137 .  wrote:
> Hi all -
>
> I was hoping someone could help me figure this out.  I have the
> following in a .el file I am loading to create keys for my projects:
>
> (setq projects '("Aa" "Bb" "Cc" "Dd")
>
> (let (firstLetter)
>   (dolist (project projects firstLetter)
> (setq firstLetter (substring project 0 1))
> (message "%s" firstLetter)
> (setq org-capture-templates
>   (append org-capture-templates
>   '((firstLetter project)
> ((concat firstLetter "t") "Todo" entry
> (file+headline (concat org-directory "/default.org") project) "* TODO
> %?"))
>
> C-n (to activate capture mode)
>
> org-mks: Wrong type argument: sequencep, firstLetter
>
>
> but in the messages window, it prints the firstLetter variable -
> shouldn't firstLetter be a string or char?
>
> Anyway, I can't seem to get this to work - could anyone give me some
> insight as to what I am missing?
>
> Thanks!



Re: [O] SOLVED: LaTeX equation align in orgmode?

2015-10-09 Thread Eric S Fraga
On Friday,  9 Oct 2015 at 09:25, Enzo Chi wrote:
> I tried that "\begin{align}...\end{align}" code with "C-c C-x C-l", it
>   generate a very back quality image like this:

What settings do you have for image creation in org?  What is
org-latex-create-formula-image-program?  

For instance, I have the following settings:

#+begin_src emacs-lisp :results none
  (setq org-format-latex-options '(:foreground "white" :background "black" 
:scale 3 :html-foreground "Black" :html-background "Transparent" :html-scale 
1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\["))
org-latex-create-formula-image-program 'imagemagick
)
#+end_src

and I get something along these lines:


You'll probably not want to change the foreground and background colours
if you have a light background emacs theme.

The quality of the image may also be a function of your LaTeX default
packages and fonts.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.2, Org release_8.3.2-161-gd2ac25


Re: [O] Suggestion for automatic latex rendering

2015-10-09 Thread John Kitchin
I made a kind of solution that does this here:

http://kitchingroup.cheme.cmu.edu/blog/2015/10/09/Automatic-latex-image-toggling-when-cursor-is-on-a-fragment/

You might see if it does what you want.

Knud Soerensen writes:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hi
>
> I love org-mode and use it a lot for latex notes.
>
> I will like to suggest a new latex setting which let org-mode show the
> latex code when cursor is on the code line.
> But when the cursor leaves the code line the latex is automatic rendered
> to a image.
>
> This will save many C-c C-x C-l and C-c C-c and make Latex editing much
> easier.
>
> If the latex is a multi line block it should only render when you leave
> the block.
>
> Thanks for Org-mode.
>
> Knud
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1
>
> iQEcBAEBAgAGBQJWFRvTAAoJEIiA+jisx2wbROYH/3dCDHgxsZqbGydxOUkpzA6I
> Ls0p92xYOD3be15EXozCftMUMmqbeWB3mMDipwu3ZNJKhRKz/P+m7gHW+quVitkg
> 4C7O27r0ka7/oDELV7TCkfMFCZ1MSKELqHA/qDegkz3tS14/h542QxGiJo6utTs1
> LMajLUNYOm/TbVtvM1otI4f+EqapTeZYyFhvh64KyKZRUvHteUk5wRtZMiTDglKF
> WhM9ObOS8R6RkMDNb/yWPiuydGnjsCgOoO5B7qr4DxqK5l8+IePcRZBeZpaM767U
> lEf0gRMbA030q+UXhAbbKN0Kn8s0K+SDt0yAer1/NE9PDGeObIWiOwHXz3nA61E=
> =PPw+
> -END PGP SIGNATURE-

--
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] Dynamically creating capture mode templates

2015-10-09 Thread tenspd137 .
Hi all -

I was hoping someone could help me figure this out.  I have the
following in a .el file I am loading to create keys for my projects:

(setq projects '("Aa" "Bb" "Cc" "Dd")

(let (firstLetter)
  (dolist (project projects firstLetter)
(setq firstLetter (substring project 0 1))
(message "%s" firstLetter)
(setq org-capture-templates
  (append org-capture-templates
  '((firstLetter project)
((concat firstLetter "t") "Todo" entry
(file+headline (concat org-directory "/default.org") project) "* TODO
%?"))

C-n (to activate capture mode)

org-mks: Wrong type argument: sequencep, firstLetter


but in the messages window, it prints the firstLetter variable -
shouldn't firstLetter be a string or char?

Anyway, I can't seem to get this to work - could anyone give me some
insight as to what I am missing?

Thanks!



[O] How to pass parameters to org-sbe function?

2015-10-09 Thread Kalev Takkis
Hi list,

I'm trying to use org-sbe to execute another source block but I cannot
figure out how to provide required parameters. My source block takes one
parameter in form of list of lists. When I compose the list in place like
this

(org-sbe testblock (params (list (list \"somevar\" \"somevalue\") (list
\"othervar\" \"othervalue\"

then the block works as expected, but everything else, such as using a
variable or a function (ideally that's what I'd like to do), has failed.
What's the secret?


All the best,
Kalev


Re: [O] First steps in customizing org-mode

2015-10-09 Thread Eric Abrahamsen
Giulio Petrucci  writes:

> Hello there,
>
> this is my first post here so let me introduce myself: my name is
> Giulio, or "petrux" for friends. I am italian. I am a PhD candidate at
> University of Trento and I've been working for many years as a
> developer before "going back to school".
> I use Emacs for almost everything. I love org-mode and I would like to
> start using it at an higher level.
> So, I would like to heavily customize it.
> I am experiencing some problems that come from MOSTLY my un-expertise
> in Lisp/EmacsLisp -- which I am actually trying to recover.
>
> Another problem that I am eperiencing is that it is very hard for me
> to find documentation about the org-mode function and variables.
> For this specific issue, is there any resource that shows you *what*
> you can do *and how* to do it?
>
> Thanks,
> Giulio
>
> P.S. here is an example of what I mean. I have learned from some
> examples that I can customize my agenda views acting on the
> org-agenda-custom-commands variable. If I google for that variable's
> name, I end up in some pages not telling me that much about that
> variable, how to customize it  and so on. So what I need is an
> exaustive list of "In org-mode, you can do this and this and this..."
> for beginner.

Google's not the place to look! For once. One of the main principles of
Emacs, and thus of Org mode, is that it is self-documenting. You'll get
a better sense of what `org-agenda-custom-commands' does, and how to use
it, by hitting "C-h v org-agenda-custom-commands" than you will from any
other source. There's even a clickable link to customize it.

If that's not enough, read the manual: "C-h i m Org Mode  g Custom
Agenda Views ".

Do that first, then ask here!

Eric




Re: [O] Minning Org-files

2015-10-09 Thread John Kitchin
You can do something like this:

By TODO keyword to grab the DONE entries.

#+BEGIN_SRC emacs-lisp
(let ((entries (org-map-entries
(lambda ()
  (save-restriction
(org-narrow-to-subtree)
(buffer-string)))
"TODO=\"DONE\"")))
  (switch-to-buffer (get-buffer-create "new"))
  (org-mode)
  (mapcar 'insert entries))
#+END_SRC



Doyley, Marvin M. writes:

> Hi there,
>
> I have a huge org-file with notes I have taken on various topics (my 
> commonplace org file). Is there an easy way to grab all the entires with a 
> given tag or keyword to a new org-file ?
>
> Thanks,
> M
>
> ---
> Marvin Doyley Ph.D.
> University of Rochester
> Associate Professor of Electrical and Computer Engineering
> Associate Professor of Biomedical Engineering
> 333 Hopeman Engineering Building
> Rochester NY 14627

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



Re: [O] Exporter aborts upon encountering even one unresolvable link

2015-10-09 Thread D. C. Toedt
>> Look at publishing instead of exporting to html which works with missing
links.
​​

Apparently it doesn't.
I'm still having the same problem of throwing a fatal error --- even when
publishing, not exporting --- when encountering a missing (unresolvable)
link.  This was after doing a clean install of org-mode 8.3.2 (20151005,
using the emacs package manager) on top of a clean install of the latest
stable version of emacs (24.5) from EmacsForMacOSX. (I'm running the latest
version of Mac OS X Yosemite; haven't gotten around to El Capitan.)  I then
set up publishing the way Rainer suggested in his email.  Well, publishing
likewise throws an error when it encounters a missing link target, just as
does exporting.

> You can use org-lint for this.

I haven't tried org-lint yet (
http://steve.planetbarr.com/posts/2015-08-11-org-lint.html).  That requires
building org from a separate branch in git.  That makes me nervous -- I'm a
user, not a dev, and while I'm sort of familiar with git, it seems like yet
another layer of complexity.

I don't mean to be a nag, but I genuinely don't understand why org-mode's
former way of dealing with unresolvable links during export was disabled.
The old way, namely just marking the problem link in the output file and
continuing with the export, made it very easy to search for the problem in
the output file. That approach was simple and worked quite well.  It also
allowed exporting a single .org file, instead of jumping through the hoops
of publishing a project.  The new way seems like a giant step backwards;
it's likely to be a significant barrier to entry for non-expert users.

Can the old way of dealing with unresolvable links be restored, at least as
an option?



D. C. Toedt III
*(My last name is pronounced "Tate")*
Attorney & arbitrator -- tech contracts & IP
Common Draft  toolkit for contract drafters
O: +1 (713) 364-6545
C: +1 (713) 516-8968
​​

d...@toedt.com
www.OnContracts.com/About

Unless expressly stated otherwise,
this message is not intended to serve
as assent to an agreement or other document,
even if attached to this message.


Re: [O] Minning Org-files

2015-10-09 Thread Doyley, Marvin M.
Is there anyway of making the search term a variable ?

> On Oct 9, 2015, at 1:24 PM, John Kitchin  wrote:
> 
> You can do something like this:
> 
> By TODO keyword to grab the DONE entries.
> 
> #+BEGIN_SRC emacs-lisp
> (let ((entries (org-map-entries
>(lambda ()
>  (save-restriction
>(org-narrow-to-subtree)
>(buffer-string)))
>"TODO=\"DONE\"")))
>  (switch-to-buffer (get-buffer-create "new"))
>  (org-mode)
>  (mapcar 'insert entries))
> #+END_SRC
> 
> 
> 
> Doyley, Marvin M. writes:
> 
>> Hi there,
>> 
>> I have a huge org-file with notes I have taken on various topics (my 
>> commonplace org file). Is there an easy way to grab all the entires with a 
>> given tag or keyword to a new org-file ?
>> 
>> Thanks,
>> M
>> 
>> ---
>> Marvin Doyley Ph.D.
>> University of Rochester
>> Associate Professor of Electrical and Computer Engineering
>> Associate Professor of Biomedical Engineering
>> 333 Hopeman Engineering Building
>> Rochester NY 14627
> 
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> https://urldefense.proofpoint.com/v2/url?u=http-3A__kitchingroup.cheme.cmu.edu&d=BQIBAg&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=T41F_5QsIVBGYhPPUkgYHUp9iPHgs2rOCjs7rfKaTMU&m=ZjP3xZzVOvLNMInBTkxBhV_-2rP9uP3owADCIadxXxk&s=ry0y4fD4NMUUCHUpPSK5djnyUZWt57fxbXHuhqUfSls&e=
>  




Re: [O] Readcube

2015-10-09 Thread John Kitchin
you would have to find an applescript api I think. Look at some examples in
org-mac-link http://orgmode.org/worg/org-contrib/org-mac-link.html or this
project https://github.com/claviclaws/org-mac-protocol.

John

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


On Fri, Oct 9, 2015 at 8:29 AM, Doyley, Marvin M. 
wrote:

> Hi there,
>
> I have been using readcube to manage my pdfs, awesome software, for more
> than a year now. However, i would like to link it to my org-mode notes.
> Does anybody know how to grab readcube links on OS X.
>
> Thanks,
> M
>
> ---
> Marvin Doyley Ph.D.
> University of Rochester
> Associate Professor of Electrical and Computer Engineering
> Associate Professor of Biomedical Engineering
> 333 Hopeman Engineering Building
> Rochester NY 14627
>
>
>
>
>
>
>


Re: [O] Readcube

2015-10-09 Thread Doyley, Marvin M.
Thanks John,
I really appreciate this.
Cheers,
M
---
Marvin Doyley Ph.D.
University of Rochester
Associate Professor of Electrical and Computer Engineering
343 Hopeman Engineering Building
Rochester NY 14627
Tel: 585-275-3774
Fax: 585-273-4919
Website: http://www.ece.rochester.edu/projects/doyley_lab/






On Oct 9, 2015, at 1:44 PM, John Kitchin 
mailto:jkitc...@andrew.cmu.edu>> wrote:

you would have to find an applescript api I think. Look at some examples in 
org-mac-link 
http://orgmode.org/worg/org-contrib/org-mac-link.html
 or this project 
https://github.com/claviclaws/org-mac-protocol.

John

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


On Fri, Oct 9, 2015 at 8:29 AM, Doyley, Marvin M. 
mailto:mdoy...@ur.rochester.edu>> wrote:
Hi there,

I have been using readcube to manage my pdfs, awesome software, for more than a 
year now. However, i would like to link it to my org-mode notes. Does anybody 
know how to grab readcube links on OS X.

Thanks,
M

---
Marvin Doyley Ph.D.
University of Rochester
Associate Professor of Electrical and Computer Engineering
Associate Professor of Biomedical Engineering
333 Hopeman Engineering Building
Rochester NY 14627










Re: [O] First steps in customizing org-mode

2015-10-09 Thread James Richardson

Giulio Petrucci writes:

[snip]
>
> Another problem that I am eperiencing is that it is very hard for me
> to find documentation about the org-mode function and variables.
> For this specific issue, is there any resource that shows you *what*
> you can do *and how* to do it?
>

Outside of http://orgmode.org/worg/, I found
http://doc.norang.ca/org-mode.html to very useful.

[snip]

-- 
Sent with my mu4e



[O] [PATCH] ox-extra.el: Fix filtering of latex header blocks

2015-10-09 Thread Sebastian Christ
Hi group,

I'd like to provide a patch to
ox-extra.el. `org-latex-header-blocks-filter' still calls
`org-edit-src-find-region-and-lang' and raises therefore an undefined
function error.

Best wishes,
Sebastian

>From 34b76e06bda5739e433c95b451915c8b804a1733 Mon Sep 17 00:00:00 2001
From: Sebastian Christ 
Date: Fri, 9 Oct 2015 17:37:39 +0200
Subject: [PATCH] ox-extra.el: Fix filtering of latex header blocks

* ox-extra.el (org-latex-header-blocks-filter): Use `org-element' API to
  find begin and end of latex header blocks.

`org-latex-header-blocks-filter' still called
`org-edit-src-find-region-and-lang' and raised an undefined function
error because the funtion was removed from org-mode. This is fixed by determining the
begin and end of the latex block via `org-element'.
---
 contrib/lisp/ox-extra.el | 28 
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/contrib/lisp/ox-extra.el b/contrib/lisp/ox-extra.el
index e6d45cc..bb838fc 100644
--- a/contrib/lisp/ox-extra.el
+++ b/contrib/lisp/ox-extra.el
@@ -71,18 +71,22 @@
 		   (org-element-property :end block)
 		   (org-element-property :post-affiliated block)))
   (mapc (lambda (pos)
-	  (goto-char (nth 2 pos))
-	  (destructuring-bind
-		  (beg end &rest ignore)
-		  (org-edit-src-find-region-and-lang)
-		(let ((contents-lines (split-string
-   (buffer-substring-no-properties beg end)
-   "\n")))
-		  (delete-region (nth 0 pos) (nth 1 pos))
-		  (dolist (line contents-lines)
-		(insert (concat "#+latex_header: "
-(replace-regexp-in-string "\\` *" "" line)
-"\n"))
+  (let* ((beg (third pos))
+ (end (second pos))
+ (post-affiliated (first pos))
+ (contents-lines
+  (cdr (butlast
+(split-string
+ (buffer-substring-no-properties post-affiliated
+ end)
+ "\n")
+2
+(goto-char beg)
+(delete-region beg end)
+(dolist (line contents-lines)
+  (insert (concat "#+latex_header: "
+  (replace-regexp-in-string "\\` *" "" line)
+  "\n")
 	;; go in reverse, to avoid wrecking the numeric positions
 	;; earlier in the file
 	(reverse positions)
-- 
2.6.1



[O] Readcube

2015-10-09 Thread Doyley, Marvin M.
Hi there,

I have been using readcube to manage my pdfs, awesome software, for more than a 
year now. However, i would like to link it to my org-mode notes. Does anybody 
know how to grab readcube links on OS X.

Thanks,
M

---
Marvin Doyley Ph.D.
University of Rochester
Associate Professor of Electrical and Computer Engineering
Associate Professor of Biomedical Engineering
333 Hopeman Engineering Building
Rochester NY 14627








[O] Minning Org-files

2015-10-09 Thread Doyley, Marvin M.
Hi there,

I have a huge org-file with notes I have taken on various topics (my 
commonplace org file). Is there an easy way to grab all the entires with a 
given tag or keyword to a new org-file ?

Thanks,
M

---
Marvin Doyley Ph.D.
University of Rochester
Associate Professor of Electrical and Computer Engineering
Associate Professor of Biomedical Engineering
333 Hopeman Engineering Building
Rochester NY 14627









[O] First steps in customizing org-mode

2015-10-09 Thread Giulio Petrucci
Hello there,

this is my first post here so let me introduce myself: my name is
Giulio, or "petrux" for friends. I am italian. I am a PhD candidate at
University of Trento and I've been working for many years as a
developer before "going back to school".
I use Emacs for almost everything. I love org-mode and I would like to
start using it at an higher level.
So, I would like to heavily customize it.
I am experiencing some problems that come from MOSTLY my un-expertise
in Lisp/EmacsLisp -- which I am actually trying to recover.

Another problem that I am eperiencing is that it is very hard for me
to find documentation about the org-mode function and variables.
For this specific issue, is there any resource that shows you *what*
you can do *and how* to do it?

Thanks,
Giulio

P.S. here is an example of what I mean. I have learned from some
examples that I can customize my agenda views acting on the
org-agenda-custom-commands variable. If I google for that variable's
name, I end up in some pages not telling me that much about that
variable, how to customize it  and so on. So what I need is an
exaustive list of "In org-mode, you can do this and this and this..."
for beginner.

--



Re: [O] org-agenda-files

2015-10-09 Thread Eric S Fraga
On Thursday,  8 Oct 2015 at 22:36, Paul Jewell wrote:

[...]

> The bit I missed was that org-agenda-files were set in customize to nil,
> and this change was happening after the assignment. Once I cleared this,
> everything works as planned.
>
> Thanks for coming back to me!

Glad you figured it out.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.2, Org release_8.3.2-161-gd2ac25



Re: [O] [RFC] Draft mode

2015-10-09 Thread Rasmus
Nick Dokos  writes:

> Eric S Fraga  writes:
>
>> On Thursday,  8 Oct 2015 at 19:00, Nicolas Goaziou wrote:
>>
>> [...]
>>
>>> I think I will go with the straight to the point
>>> `org-export-barf-on-invalid-link' variable.
>>>
>>> However, not sure about the OPTIONS item.
>>>
>>>   #+OPTIONS: ???:t
>>
>> #+options: barf:t
>>
>> ;-)
>>
>> More seriously, I'm a big fan of longer is better if more clear so how
>> about "invalidlinksok:t" or "allowdanglinglinks:t" or some variation
>> thereof?
>
> Can option names contain dashes?
> If so, combine these two ideas to make a name as similar as possible
> to the variable name:
>
> #+options: barf-on-invalid-link:t

While I agree that options such as 't:·', '^:·', 'h:·' are bad, I think
'barf:·' is nice.  It's short and precise, much like 'num:·'.

Something like 'barf-on-invalid-link' is very easy to mistype or forget.
And yes, I mostly type options by hand.

Rasmus

-- 
Got mashed potatoes. Ain't got no T-Bone. No T-Bone