Re: [O] Problem: clock-in:t not respected in the org-capture-templates ?

2015-03-30 Thread Nicolas Goaziou
Hello,

Xavier xav...@maillard.im writes:

 I have several org-capture-templates with the clock-in property set to t
 but, either I do not understand how it works either there is a bug but,
 AFAICS, I do not see the clock-in when triggering the template.

Could you send an ECM?


Regards,

-- 
Nicolas Goaziou



[O] How to get inline python code to work with :session option?

2015-03-30 Thread Richard Stanton
:session doesn't seem to play well with inline code blocks. For example, if I 
press C-c C-c with the cursor in the middle of  the following inline code, 

src_python[]{return 2+3} 

it gets expanded to

src_python[]{return 2+3} {{{results(=5=)}}}   

However, if I do the same with this code block, 

src_python[:session]{return 2+3} 

no results appear in the text buffer, and the mini-buffer displays the message 
Code block produced no output.

How can I get inline code to work with :session? 

Thanks.

Richard Stanton




Re: [O] [ox, patch] #+SUBTITLE

2015-03-30 Thread Nicolas Goaziou
Rasmus ras...@gmx.us writes:

 Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Do you mean KEYWORD and DESCRIPTION should also belong to category 1?
 I'm not against it, but then, back-ends are required to support them
 whenever possible.

 At the moment they are.  They lack ascii support, but at least keywords
 should be supported in ascii eventually IMO (but that's another thread).

 So I would keep them.  The documentation explicitly states which backend
 these keywords are supported by.

OK. Then DESCRIPTION and KEYWORD stay in ox.el, and documented in
Export settings. You need to revert your patch about it.

We will have to take care about support for missing back-ends. E.g.,
ASCII could treat DESCRIPTION as a quote box just below title.

 We could add a subsection with text document properties which are
 keywords that are supported by the set: {ox-html, ox-ascii, ox-odt,
 ox-latex}.  These would be sort of 1½ class citizens.

 I don't want to create a third category (à la
 `org-element-document-properties', which I'm trying to remove).

 This category would not exists in the code.  It would simply be a
 classification that exists in the manual.  I would be a hack to not
 maintain no. of backend that support SOME_KEYWORD different places to
 maintain documentation for SOME_KEYWORD.

I don't think it is needed. Such text document properties are de facto
members of category 1 anyway.

Regards,



[O] latex options

2015-03-30 Thread Zhihao Ding
Dear Org experts, 

I was wondering if anyone could advise on this simple problem.
My toy org file, shown as below, contains 3 projects. I’d like to  
export beamer PDFs for individual projects from time to time, 
but the pain is that I always need to modify the header options  
(title, select_tags etc) to match the project that I want to export. 

The question is what the best way is to organise the options for 
multiple projects? Ideally I’d like to put a copy of the options 
under each project, so that I only need to define them once. 
It’d be even better if I could specify the file that I want the project
to be exported to instead of the same pdf file matching my org
file.

#+TITLE: mytitle
#+AUTHOR: myself
#+DATE: \today
#+LaTeX_CLASS: mybeamer
#+SELECT_TAGS: export
#+EXCLUDE_TAGS: noexport
#+OPTIONS: H:4 toc:nil *:

** project 1
** project 2
** project 3

Thanks a lot!

Zhihao



Re: [O] replace letf with cl-letf in org-mime

2015-03-30 Thread Eric Abrahamsen
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Hello,

 Eric Abrahamsen e...@ericabrahamsen.net writes:

 It's amazing what an effect barky compiler errors can have.

 Thanks. However, `cl-flet' is not supported in Emacs 23 so it's not an
 option for Org 8.3.

 OTOH, most uses of `flet' can be replaced with a plain `lambda' and
 funcalls.

 -(flet ((mp (p) (org-entry-get nil p org-mime-use-property-inheritance)))
 +(cl-flet ((mp (p) (org-entry-get nil p 
 org-mime-use-property-inheritance)))
(let* ((file (buffer-file-name (current-buffer)))
   (subject (or (mp MAIL_SUBJECT) (nth 4 (org-heading-components
   (to (mp MAIL_TO))

   (let* ((mp (lambda (p) (org-entry-get nil p 
 org-mime-use-property-inheritance
  (file (buffer-file-name (current-buffer)))
  (subject (or (funcall mp MAIL_SUBJECT) (nth 4 
 (org-heading-components
  (to (funcall mp MAIL_TO))
  ...)

That took longer than I expected...

From 796667bc0afe3031c9e81e359809af9fceb3839f Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen e...@ericabrahamsen.net
Date: Mon, 30 Mar 2015 16:32:14 +0800
Subject: [PATCH] org-mime.el: Avoid use of letf/cl-letf

* contrib/lisp/org-mime.el (org-mime-send-subtree, org-mime-compose):
  `letf' is deprecated in future emacs, but `cl-letf' is unavailable
  in past emacs.  Replace with plain old lambdas and funcalls.
---
 contrib/lisp/org-mime.el | 111 ---
 1 file changed, 56 insertions(+), 55 deletions(-)

diff --git a/contrib/lisp/org-mime.el b/contrib/lisp/org-mime.el
index f341474..bf2ad06 100644
--- a/contrib/lisp/org-mime.el
+++ b/contrib/lisp/org-mime.el
@@ -252,22 +252,22 @@ export that region, otherwise export the entire body.
   (save-restriction
 (org-narrow-to-subtree)
 (run-hooks 'org-mime-send-subtree-hook)
-(flet ((mp (p) (org-entry-get nil p org-mime-use-property-inheritance)))
-  (let* ((file (buffer-file-name (current-buffer)))
-	 (subject (or (mp MAIL_SUBJECT) (nth 4 (org-heading-components
-	 (to (mp MAIL_TO))
-	 (cc (mp MAIL_CC))
-	 (bcc (mp MAIL_BCC))
-	 (body (buffer-substring
-		(save-excursion (goto-char (point-min))
-(forward-line 1)
-(when (looking-at [ \t]*:PROPERTIES:)
-  (re-search-forward :END: nil)
-  (forward-char))
-(point))
-		(point-max
-	(org-mime-compose body (or fmt 'org) file to subject
-			  `((cc . ,cc) (bcc . ,bcc)))
+(let* ((mp (lambda (p)) (org-entry-get nil p org-mime-use-property-inheritance))
+	   (file (buffer-file-name (current-buffer)))
+	   (subject (or (funcall mp MAIL_SUBJECT) (nth 4 (org-heading-components
+	   (to (funcall mp MAIL_TO))
+	   (cc (funcall mp MAIL_CC))
+	   (bcc (funcall mp MAIL_BCC))
+	   (body (buffer-substring
+		  (save-excursion (goto-char (point-min))
+  (forward-line 1)
+  (when (looking-at [ \t]*:PROPERTIES:)
+(re-search-forward :END: nil)
+(forward-char))
+  (point))
+		  (point-max
+  (org-mime-compose body (or fmt 'org) file to subject
+			`((cc . ,cc) (bcc . ,bcc))
 
 (defun org-mime-send-buffer (optional fmt)
   (run-hooks 'org-mime-send-buffer-hook)
@@ -287,45 +287,46 @@ export that region, otherwise export the entire body.
   (require 'message)
   (message-mail to subject headers nil)
   (message-goto-body)
-  (flet ((bhook (body fmt)
-		(let ((hook (intern (concat org-mime-pre-
-	(symbol-name fmt)
-	-hook
-		  (if ( (eval `(length ,hook)) 0)
-		  (with-temp-buffer
-			(insert body)
-			(goto-char (point-min))
-			(eval `(run-hooks ',hook))
-			(buffer-string))
-		body
-(let ((fmt (if (symbolp fmt) fmt (intern fmt
-  (cond
-   ((eq fmt 'org)
-	(require 'ox-org)
-	(insert (org-export-string-as
-		 (org-babel-trim (bhook body 'org)) 'org t)))
-   ((eq fmt 'ascii)
-	(require 'ox-ascii)
-	(insert (org-export-string-as
-		 (concat #+Title:\n (bhook body 'ascii)) 'ascii t)))
-   ((or (eq fmt 'html) (eq fmt 'html-ascii))
-	(require 'ox-ascii)
-	(require 'ox-org)
-	(let* ((org-link-file-path-type 'absolute)
-	   ;; we probably don't want to export a huge style file
-	   (org-export-htmlize-output-type 'inline-css)
-	   (html-and-images
-		(org-mime-replace-images
-		 (org-export-string-as (bhook body 'html) 'html t) file))
-	   (images (cdr html-and-images))
-	   (html (org-mime-apply-html-hook (car html-and-images
-	  (insert (org-mime-multipart
-		   (org-export-string-as
-		(org-babel-trim
-		 (bhook body (if (eq fmt 'html) 'org 'ascii)))
-		(if (eq fmt 'html) 'org 'ascii) t)
-		   html)
-		  (mapconcat 'identity images \n
+  (let ((bhook
+	 (lambda (body fmt)
+	   (let ((hook (intern (concat org-mime-pre-
+   (symbol-name fmt)
+   -hook
+	 (if ( (eval `(length ,hook)) 0)
+		 (with-temp-buffer
+		   (insert body)
+		   (goto-char (point-min))
+		   (eval 

Re: [O] ob-lilypond

2015-03-30 Thread Patrick L. Schmidt
Nick,

thank you very much for your helpful suggestions! After loading ob-lilypond.el, 
test-ob-lilypond.el and org-test.el from the git repo 38/42 tests passed. After 
I also loaded ob-org.el (git-repo) only one test failed. So I guess my org-mode 
version 8.2.7b (installed via elpa) is too old???  I tried to install the 
latest version from the git repo following the instructions at 
http://orgmode.org/manual/Installation.html.  But M-x org-version still returns 
org-mode version 8.2.7b. Do I have to get rid of the elpa-versions of org-mode. 
If yes, what’s the best way to do so?

Thanks a million!
patrick
On 29.03.2015, at 23:27, Nick Dokos ndo...@gmail.com wrote:

 pls p.l.schm...@gmx.de writes:
 
 Hey all,
 
 looks like I’m having quite a few problems with ob-lilypond (Org-mode 
 version 8.2.7b).
 To ensure that my setup is correct I ran the tests mentioned on 
 http://orgmode.org/worg
 /org-contrib/babel/languages/ob-doc-lilypond.html#sec-9:
 
M-x load-file RET ~/path/to/current/org-mode-git-repository/testing/lisp/
test-ob-lilypond.el
M-x ert RET RET
 
 And this is what I got (short version):
 
Selector: t
Passed: 6
Failed: 36 (36 unexpected)
Total:  42/42
 
Started at:   2015-03-25 13:32:19+0100
Finished.
Finished at:  2015-03-25 13:32:19+0100
 
...FFF…F
 
 Am I missing something? How can I get this to work?
 
 
 Probably missing a load-file: in addition to ob-lilypond.el
 and test-ob-lilypond.el, you need to load org-test.el (which
 is in the testing subdir of the git repo).
 
 With those three loaded (in addition to org-mode itself of course), all
 42 tests pass in my setup:
 
 Org-mode version 8.3beta (release_8.3beta-882-gf8731e @
 /home/nick/elisp/org-mode/lisp/)
 
 HTH,
 Nick



Re: [O] latex options

2015-03-30 Thread Andreas Leha
Hi Zhihao,

Zhihao Ding zhihao.d...@imm.ox.ac.uk writes:
 Dear Org experts, 

 I was wondering if anyone could advise on this simple problem.
 My toy org file, shown as below, contains 3 projects. I’d like to  
 export beamer PDFs for individual projects from time to time, 
 but the pain is that I always need to modify the header options  
 (title, select_tags etc) to match the project that I want to export. 

 The question is what the best way is to organise the options for 
 multiple projects? Ideally I’d like to put a copy of the options 
 under each project, so that I only need to define them once. 
 It’d be even better if I could specify the file that I want the project
 to be exported to instead of the same pdf file matching my org
 file.

 #+TITLE: mytitle
 #+AUTHOR: myself

 #+DATE: \today
 #+LaTeX_CLASS: mybeamer

 #+SELECT_TAGS: export
 #+EXCLUDE_TAGS: noexport

 #+OPTIONS: H:4 toc:nil *:

 ** project 1
 ** project 2
 ** project 3


You can add most of these keywords to the properties of a subtree by
prepending them with 'export_'.  I am not sure about the select tags,
though.  Why do you need them to differ between the projects?


Your Example:


--8---cut here---start-8---
#+TITLE: mytitle
#+AUTHOR: myself

#+DATE: \today
#+LaTeX_CLASS: mybeamer

#+SELECT_TAGS: export
#+EXCLUDE_TAGS: noexport

#+OPTIONS: H:4 toc:nil *:

** project 1
:PROPERTIES:
:header-args:R: :session *mysession1*
:header-args: :cache yes
:EXPORT_TITLE: mytitle 1
:EXPORT_LaTeX_HEADER: \subtitle{mysubtitle 1}
:EXPORT_FILE_NAME: myfile1
:EXPORT_DATE: mydate 1
:EXPORT_LaTeX_CLASS: mybeamer 1
:EXPORT_OPTIONS: H:2 toc:nil
:END:
** project 2
:PROPERTIES:
:header-args:R: :session *mysession2*
:header-args: :cache yes
:EXPORT_TITLE: mytitle 2
:EXPORT_LaTeX_HEADER: \subtitle{mysubtitle 2}
:EXPORT_FILE_NAME: myfile2
:EXPORT_DATE: mydate 2
:EXPORT_LaTeX_CLASS: mybeamer 2
:EXPORT_OPTIONS: H:2 toc:nil
:END:
** project 3
:PROPERTIES:
:header-args:R: :session *mysession3*
:header-args: :cache yes
:EXPORT_TITLE: mytitle 3
:EXPORT_LaTeX_HEADER: \subtitle{mysubtitle 3}
:EXPORT_FILE_NAME: myfile3
:EXPORT_DATE: mydate 3
:EXPORT_LaTeX_CLASS: mybeamer 3
:EXPORT_OPTIONS: H:2 toc:nil
:END:
--8---cut here---end---8---


HTH,
Andreas




Re: [O] Org-Mode and Mac OS X advice

2015-03-30 Thread Mike McLean
On Sat, Mar 28, 2015 at 12:26 PM, Rick Frankel r...@rickster.com wrote:

 On Thu, Mar 26, 2015 at 02:57:40PM +0100, Alan Schmitt wrote:
  On 2015-03-26 14:50, Bernd Haug bernd.h...@xaidat.com writes:
 
  I'm using this nice trick (passed to me by a colleague) that sets the
  environment variables and path to be the same in zsh and emacs (launched
  From the GUI).
 
  #+begin_src emacs-lisp
  (let ((vars (split-string-and-unquote (shell-command-to-string .
 ~/.zshrc; export) \n)))
(mapcar (lambda (X) (let ((var_val (split-string-and-unquote X =)))
  (setenv (car var_val) (cadr var_val vars)
(setq exec-path
  (append
   (split-string-and-unquote (getenv PATH) :)
   exec-path)))
  #+end_src

 You could also use the `exec-path-from-shell' package, which will set a
 specified list of variables (defaults to MANPATH, PATH) from the shell.


Which is the way I do it also. I have the following in my emacs-init.org
file (that Tangles to my actual Emacs init file)

#+begin_src emacs-lisp :tangle yes
  (add-to-list 'el-get-sources '(:name exec-path-from-shell))
  (let ((exec-path-from-shell.el
~/.emacs.d/el-get/exec-path-from-shell/exec-path-from-shell.el))
(when (file-exists-p exec-path-from-shell.el)
  (load exec-path-from-shell.el)
  (require 'exec-path-from-shell)
  (when (memq window-system '(mac ns))
(exec-path-from-shell-initialize
#+end_src





 rick




Re: [O] latex options

2015-03-30 Thread Zhihao Ding
Thanks Andreas! This is very helpful. 

I am using tags to control how verbose I want my export to be 
and currently they differ slightly between projects. Quite often 
I also have project specific tags. But no problem I think that’s 
manageable with the layout you suggested. 

Best, 
Zhihao


 On 30 Mar 2015, at 11:32, Andreas Leha andreas.l...@med.uni-goettingen.de 
 wrote:
 
 Hi Zhihao,
 
 Zhihao Ding zhihao.d...@imm.ox.ac.uk writes:
 Dear Org experts, 
 
 I was wondering if anyone could advise on this simple problem.
 My toy org file, shown as below, contains 3 projects. I’d like to  
 export beamer PDFs for individual projects from time to time, 
 but the pain is that I always need to modify the header options  
 (title, select_tags etc) to match the project that I want to export. 
 
 The question is what the best way is to organise the options for 
 multiple projects? Ideally I’d like to put a copy of the options 
 under each project, so that I only need to define them once. 
 It’d be even better if I could specify the file that I want the project
 to be exported to instead of the same pdf file matching my org
 file.
 
 #+TITLE: mytitle
 #+AUTHOR: myself
 
 #+DATE: \today
 #+LaTeX_CLASS: mybeamer
 
 #+SELECT_TAGS: export
 #+EXCLUDE_TAGS: noexport
 
 #+OPTIONS: H:4 toc:nil *:
 
 ** project 1
 ** project 2
 ** project 3
 
 
 You can add most of these keywords to the properties of a subtree by
 prepending them with 'export_'.  I am not sure about the select tags,
 though.  Why do you need them to differ between the projects?
 
 
 Your Example:
 
 
 --8---cut here---start-8---
 #+TITLE: mytitle
 #+AUTHOR: myself
 
 #+DATE: \today
 #+LaTeX_CLASS: mybeamer
 
 #+SELECT_TAGS: export
 #+EXCLUDE_TAGS: noexport
 
 #+OPTIONS: H:4 toc:nil *:
 
 ** project 1
 :PROPERTIES:
 :header-args:R: :session *mysession1*
 :header-args: :cache yes
 :EXPORT_TITLE: mytitle 1
 :EXPORT_LaTeX_HEADER: \subtitle{mysubtitle 1}
 :EXPORT_FILE_NAME: myfile1
 :EXPORT_DATE: mydate 1
 :EXPORT_LaTeX_CLASS: mybeamer 1
 :EXPORT_OPTIONS: H:2 toc:nil
 :END:
 ** project 2
 :PROPERTIES:
 :header-args:R: :session *mysession2*
 :header-args: :cache yes
 :EXPORT_TITLE: mytitle 2
 :EXPORT_LaTeX_HEADER: \subtitle{mysubtitle 2}
 :EXPORT_FILE_NAME: myfile2
 :EXPORT_DATE: mydate 2
 :EXPORT_LaTeX_CLASS: mybeamer 2
 :EXPORT_OPTIONS: H:2 toc:nil
 :END:
 ** project 3
 :PROPERTIES:
 :header-args:R: :session *mysession3*
 :header-args: :cache yes
 :EXPORT_TITLE: mytitle 3
 :EXPORT_LaTeX_HEADER: \subtitle{mysubtitle 3}
 :EXPORT_FILE_NAME: myfile3
 :EXPORT_DATE: mydate 3
 :EXPORT_LaTeX_CLASS: mybeamer 3
 :EXPORT_OPTIONS: H:2 toc:nil
 :END:
 --8---cut here---end---8---
 
 
 HTH,
 Andreas



[O] How to create agenda which ignores headings with deadline/scheduled dates older than 3 months

2015-03-30 Thread Martin Beck
Hi,



how can I set up an agenda view in org-mode which does NOT show old entries which contain scheduled or deadline dates older than 3 months?



I did not find an option for that - maybe Ive overlooked it?



Kind regards



Martin



[O] org-present key bindings for Logitech R400 handheld presenter

2015-03-30 Thread Bernd Haug
I made myself a .emacs snippet with some bindings for using a Logitech
R400 presenter with org-present; maybe some of you can use this, too.

Minor questions noted below.

-
(defun my-on-org-mode ()
(local-set-key (kbd f5) 'org-present))

(defun my-on-org-present ()
(org-present-big)
(org-present-read-only)
(org-display-inline-images)
(local-set-key (kbd next) 'org-present-next)
(local-set-key (kbd prior) 'org-present-prev)
(local-set-key (kbd escape) 'org-present-quit)
(local-set-key (kbd .) 'org-present-beginning))

(defun my-on-org-present-quit ()
(local-unset-key (kbd next))
(local-unset-key (kbd prior))
(local-unset-key (kbd escape))
(local-unset-key (kbd .)))

(add-hook 'org-mode-hook 'my-on-org-mode)
(add-hook 'org-present-mode-hook 'my-on-org-present)
(add-hook 'org-present-mode-quit-hook 'my-on-org-present-quit)
-

1) The R400 just sends f5 and escape alternatingly on the
start/stop presentation button. If you get it in a mixed up state so
that it toggles the wrong way around, just turn it off (on its side)
and on again. First stroke will always be f5.

2) Originally I wanted to provide toggling read only using the last
key (lower right on the presenter, temporarily blank). Didn't work
This way:


(defun my-org-present-ro ()
  (interactive)
  (local-set-key (kbd .) 'my-org-present-rw)
  (org-present-read-only))

(defun my-org-present-rw ()
  (interactive)
  (local-set-key (kbd .) 'my-org-present-ro)
  (org-present-read-write))

; + calling my-org-present-ro instead of org-present-read-only in
my-on-org-present


For me, no issue practically speaking, since I pretty much always want
R/O anyway, but out of curiousity – what was I doing wrong?

Cheers, Bernd
-- 
Senior Software Engineer

Xaidat GmbH
Wickenburggasse 5
8010 Graz
Austria / Europe

web: http://www.xaidat.com/
phone:  +43-676-845023-706
email:   bernd.h...@xaidat.com

FN 384295s, LG ZRS Graz
UID-Nr. ATU67414611



Re: [O] Bug: Proposed new version of ob-C.el [8.3beta (release_8.3beta-944-g830cf3 @ /Users/snapp/.emacs.d/vendor/org/)]

2015-03-30 Thread Nick Dokos
Thierry Banel tbanelweb...@free.fr writes:

 Hi Robert

 Those #includes were a proposal I did long ago.
 The purpose was to make short scripts even shorter with default
 #includes that everybody uses.

 Your use-case is worth considering.
 If this cause trouble, it is easy to remove the includes.

 To keep existing scripts working, an :includes parameter would be
 required, like this:

 #+BEGIN_SRC C++ :includes string.h stdio.hstdlib.h
   // C++ script
 #+END_SRC

 Does everyone agree with this change?


IMO, it would be better than the current situation, but I wonder if
it makes sense to have a global default setting containing the
three files, but one which the user can customize; any :includes
parameters would augment the default.

That would satisfy the OP's requirements, but would also allow for
a shorter #+BEGIN_SRC line.

Nick





Re: [O] [ox, patch] #+SUBTITLE

2015-03-30 Thread Rasmus
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 So I would keep them.  The documentation explicitly states which backend
 these keywords are supported by.

 OK. Then DESCRIPTION and KEYWORD stay in ox.el, and documented in
 Export settings. You need to revert your patch about it.

I thought we were just discussing criteria for being at a particular spot
in the manual, not in the code.

So should I also move the SUBTITLE to ox.el or keep it in files?  I think
it's OK to just define it in the files where it makes sense...

 We will have to take care about support for missing back-ends. E.g.,
 ASCII could treat DESCRIPTION as a quote box just below title.

Would that not be an abstract?  I'm not sure I think description should be
handled like that.

—Rasmus

-- 
El Rey ha muerto. ¡Larga vida al Rey!



Re: [O] How to get inline python code to work with :session option?

2015-03-30 Thread Ken Mankoff

I've modified my config to use IPython.

doesn't work:
src_python[]{return 2+3} {{{results(==)}}} 

works w/o 'return':
src_python[:session]{2+3} {{{results(=5=)}}} 

doesn't work:
src_python[:session]{return 2+3}   

  -k.


On 2015-03-30 at 02:41, Richard Stanton stan...@haas.berkeley.edu wrote:
 :session doesn't seem to play well with inline code blocks. For
 example, if I press C-c C-c with the cursor in the middle of the
 following inline code,

 src_python[]{return 2+3} 

 it gets expanded to

 src_python[]{return 2+3} {{{results(=5=)}}}   

 However, if I do the same with this code block, 

 src_python[:session]{return 2+3} 

 no results appear in the text buffer, and the mini-buffer displays the 
 message Code block produced no output.

 How can I get inline code to work with :session? 

 Thanks.

 Richard Stanton




Re: [O] How to create agenda which ignores headings with deadline/scheduled dates older than 3 months

2015-03-30 Thread Sebastien Vauban
Martin Beck wrote:
 how can I set up an agenda view in org-mode which does NOT show old
 entries which contain scheduled or deadline dates older than 3 months?
 I did not find an option for that - maybe I've overlooked it?

Something like (untested):

  (tags-todo DEADLINE\-3m\)

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] How to create agenda which ignores headings with deadline/scheduled dates older than 3 months

2015-03-30 Thread Nick Dokos
[Not sure why, but quoting the OP's message did not work - I had to do
it by hand - I wonder if the problem is with the message or my setup:
if someone could verify, I'd appreciate it.]

Martin Beck elwood...@web.de writes:

 how can I set up an agenda view in org-mode which does NOT show old
 entries which contain scheduled or deadline dates older than 3 months? 

C-h v org-agenda-todo-ignore-timestamp RET
C-h v org-agenda-todo-ignore-scheduled RET
C-h v org-agenda-todo-ignore-deadlines RET

quote
This variable can also have an integer as a value.  If positive (N),
todos with a timestamp N or more days in the future will be ignored.  If
negative (-N), todos with a timestamp N or more days in the past will be
ignored.  If 0, todos with a timestamp either today or in the future will
be ignored.  For example, a value of -1 will exclude todos with a
timestamp in the past (yesterday or earlier), while a value of 7 will
exclude todos with a timestamp a week or more in the future.
/quote

Nick




Re: [O] Define org-capture-templates with variables via customize

2015-03-30 Thread Nick Dokos
Trying to just read Xavier's email message in Gnus, I get the following
backtrace (with unprintable characters replaced by periods) - to me, this
looks like a bug somewhere, but not sure where:

Debugger entered--Lisp error: (error Before first headline at position 114 in 
buffer *fontification*2)
  signal(error (Before first headline at position 114 in buffer 
*fontification*2))
  error(Before first headline at position %d in buffer %s 114 #buffer 
*fontification*2)
  (condition-case nil (outline-back-to-heading invisible-ok) (error (error 
Before first headline at position %d in buffer %s (point) (current-buffer
  org-back-to-heading(t)
  (save-excursion (org-back-to-heading t) (if (symbolp tprop) 
(put-text-property (point) (or (outline-next-heading) (point-max)) tprop p) 
(mapc (function (lambda (al) (save-excursion (put-text-property (point-at-bol) 
(or ... ...) (car al) (funcall ... p) tprop)))
  org-refresh-property(((effort . identity) (effort-minutes . 
org-duration-string-to-minutes)) 
%^{effort|1:00|0:30|0:05|0:15|2:00|3:00|4:00})
  (while (re-search-forward (concat ^[ ]*: dprop : +\\(.*\\)[
]*$) nil t) (org-refresh-property tprop (org-match-string-no-properties 1)))
  (save-restriction (widen) (goto-char (point-min)) (while (re-search-forward 
(concat ^[   ]*: dprop : +\\(.*\\)[]*$) nil t) 
(org-refresh-property tprop (org-match-string-no-properties 1
  (save-excursion (save-restriction (widen) (goto-char (point-min)) (while 
(re-search-forward (concat ^[   ]*: dprop : +\\(.*\\)[]*$) nil 
t) (org-refresh-property tprop (org-match-string-no-properties 1)
  (progn (save-excursion (save-restriction (widen) (goto-char (point-min)) 
(while (re-search-forward (concat ^[]*: dprop : +\\(.*\\)[
]*$) nil t) (org-refresh-property tprop (org-match-string-no-properties 1))
  (unwind-protect (progn (save-excursion (save-restriction (widen) (goto-char 
(point-min)) (while (re-search-forward (concat ^[]*: dprop : 
+\\(.*\\)[]*$) nil t) (org-refresh-property tprop 
(org-match-string-no-properties 1)) (if modified nil 
(restore-buffer-modified-p nil)))
  (let* ((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only 
t) (inhibit-modification-hooks t)) (unwind-protect (progn (save-excursion 
(save-restriction (widen) (goto-char (point-min)) (while (re-search-forward 
(concat ^[   ]*: dprop : +\\(.*\\)[]*$) nil t) 
(org-refresh-property tprop (org-match-string-no-properties 1)) (if 
modified nil (restore-buffer-modified-p nil
  (let ((case-fold-search t) (inhibit-read-only t)) (let* ((modified 
(buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only t) 
(inhibit-modification-hooks t)) (unwind-protect (progn (save-excursion 
(save-restriction (widen) (goto-char (point-min)) (while (re-search-forward ... 
nil t) (org-refresh-property tprop ...) (if modified nil 
(restore-buffer-modified-p nil)
  org-refresh-properties(Effort ((effort . identity) (effort-minutes . 
org-duration-string-to-minutes)))
  org-refresh-effort-properties()
  (let ((buffer-undo-list t) (inhibit-modification-hooks t)) (and 
org-startup-with-beamer-mode (org-beamer-mode)) (if 
org-startup-align-all-tables (progn (org-table-map-tables (quote 
org-table-align) (quote quietly (if org-startup-with-inline-images (progn 
(org-display-inline-images))) (if org-startup-with-latex-preview (progn 
(org-toggle-latex-fragment))) (if org-inhibit-startup-visibility-stuff nil 
(org-set-startup-visibility)) (org-refresh-effort-properties))
  (unwind-protect (let ((buffer-undo-list t) (inhibit-modification-hooks t)) 
(and org-startup-with-beamer-mode (org-beamer-mode)) (if 
org-startup-align-all-tables (progn (org-table-map-tables (quote 
org-table-align) (quote quietly (if org-startup-with-inline-images (progn 
(org-display-inline-images))) (if org-startup-with-latex-preview (progn 
(org-toggle-latex-fragment))) (if org-inhibit-startup-visibility-stuff nil 
(org-set-startup-visibility)) (org-refresh-effort-properties)) 
(set-buffer-modified-p --was-modified))
  (let ((--was-modified (buffer-modified-p))) (unwind-protect (let 
((buffer-undo-list t) (inhibit-modification-hooks t)) (and 
org-startup-with-beamer-mode (org-beamer-mode)) (if 
org-startup-align-all-tables (progn (org-table-map-tables (quote 
org-table-align) (quote quietly (if org-startup-with-inline-images (progn 
(org-display-inline-images))) (if org-startup-with-latex-preview (progn 
(org-toggle-latex-fragment))) (if org-inhibit-startup-visibility-stuff nil 
(org-set-startup-visibility)) (org-refresh-effort-properties)) 
(set-buffer-modified-p --was-modified)))
  (if org-inhibit-startup nil (let ((--was-modified (buffer-modified-p))) 
(unwind-protect (let ((buffer-undo-list t) (inhibit-modification-hooks t)) (and 
org-startup-with-beamer-mode (org-beamer-mode)) (if 
org-startup-align-all-tables (progn (org-table-map-tables (quote 

Re: [O] How to create agenda which ignores headings with deadline/scheduled dates older than 3 months

2015-03-30 Thread Elwood151


Hi Nick,



thanks a lot for your help! That looks great, however I dont get it to work:



lightweight example agenda (shows also scheduled items which are 500 days old!):



(y1 test agenda  ((org-agenda-todo-ignore-scheduled -30)))



What am I doing wrong?

Im still on org-mode 8.2.7c, is this the problem?



Kind regards



Martin


Gesendet:Montag, 30. Mrz 2015 um 17:02 Uhr
Von:Nick Dokos ndo...@gmail.com
An:emacs-orgmode@gnu.org
Betreff:Re: [O] How to create agenda which ignores headings with deadline/scheduled dates older than 3 months

[Not sure why, but quoting the OPs message did not work - I had to do
it by hand - I wonder if the problem is with the message or my setup:
if someone could verify, Id appreciate it.]

Martin Beck elwood...@web.de writes:

 how can I set up an agenda view in org-mode which does NOT show old
 entries which contain scheduled or deadline dates older than 3 months?

C-h v org-agenda-todo-ignore-timestamp RET
C-h v org-agenda-todo-ignore-scheduled RET
C-h v org-agenda-todo-ignore-deadlines RET

quote
This variable can also have an integer as a value. If positive (N),
todos with a timestamp N or more days in the future will be ignored. If
negative (-N), todos with a timestamp N or more days in the past will be
ignored. If 0, todos with a timestamp either today or in the future will
be ignored. For example, a value of -1 will exclude todos with a
timestamp in the past (yesterday or earlier), while a value of 7 will
exclude todos with a timestamp a week or more in the future.
/quote

Nick








Re: [O] How to create agenda which ignores headings with deadline/scheduled dates older than 3 months

2015-03-30 Thread Nick Dokos
elwood...@web.de writes:

 thanks a lot for your help! That looks great, however I don't get it to work:
  
 lightweight example agenda (shows also scheduled items which are 500 days 
 old!):
  
 (y1 test agenda  ((org-agenda-todo-ignore-scheduled -30)))
  
 What am I doing wrong?
 I'm still on org-mode 8.2.7c, is this the problem?


I don't think so: it seems that setting it globally DTRT for the global
todo list (C-c a t). I'm not sure what it does (if anything) when you
set it locally in a custom agenda, but in limited testing it certainly
does not seem to do what you want.

Nick







Re: [O] org-drill problem: questions are blank

2015-03-30 Thread Marco Wahl
Peter Westlake peter.westl...@pobox.com writes:

 On Mon, 30 Mar 2015, at 17:54, Marco Wahl wrote:
 Hi Peter,
 
 Peter Westlake peter.westl...@pobox.com writes:
 
  Thanks for the suggestion, but this doesn't make the bug go away for
  me.
 
 That's awkward.  
 
 Just to be sure: did you evaluate the function after changing the line
 in function org-toggle-latex-fragment of org.el to
 
 ; (set-window-start nil window-start)
 
 ?  I ask since this fixed the issue for me and to not give up too early.

 Yes, I even restarted Emacs.

Did you byte-compile org.el then?




Re: [O] org-drill problem: questions are blank

2015-03-30 Thread Marco Wahl
Hi Peter,

Peter Westlake peter.westl...@pobox.com writes:

 Thanks for the suggestion, but this doesn't make the bug go away for
 me.

That's awkward.  

Just to be sure: did you evaluate the function after changing the line
in function org-toggle-latex-fragment of org.el to

; (set-window-start nil window-start)

?  I ask since this fixed the issue for me and to not give up too early.


  Marco
-- 
http://www.wahlzone.de
GPG: 0x49010A040A3AE6F2



Re: [O] org-drill problem: questions are blank

2015-03-30 Thread Peter Westlake

On Mon, 30 Mar 2015, at 17:54, Marco Wahl wrote:
 Hi Peter,
 
 Peter Westlake peter.westl...@pobox.com writes:
 
  Thanks for the suggestion, but this doesn't make the bug go away for
  me.
 
 That's awkward.  
 
 Just to be sure: did you evaluate the function after changing the line
 in function org-toggle-latex-fragment of org.el to
 
 ; (set-window-start nil window-start)
 
 ?  I ask since this fixed the issue for me and to not give up too early.

Yes, I even restarted Emacs.

Peter.



[O] Adding time to timestamp in agenda view

2015-03-30 Thread Subhan Michael Tindall
I make pretty extensive use of some custom agenda views to manage and schedule 
my workflow.
Lots of todos with timestamps(Deadlines  Schedules).
It's fairly easy shift deadlines back  forth from agenda view using Shift 
right-arrow and Shift left-arrow

There is inconsistency in how this works however.
Deadlines may either simply be a day, or have a time component as well EG 
2015-04-11 Sat or 2015-04-11 Sat 11:00

The shifted arrow keys move deadlines forward or backward one day by default, 
carrying any hour:min info right along.
IF there is an hour:min component present, using one or two prefix arguments 
will shift the hour:min portion forward or backward
IF there is not, bare prefix arguments have no effect
A numeric prefix will always shift the Deadline forward or backward N days

What I would like is a way to ADD an hour:min component to an existing 
Deadline, and to directly enter an updated hour:min as needed.

Can't seem to find anything that will easily allow this other than moving from 
the agenda to the source of the headline itself  changing the deadline there.

Any ideas?




This message is intended for the sole use of the individual and entity to which 
it is addressed and may contain information that is privileged, confidential 
and exempt from disclosure under applicable law. If you are not the intended 
addressee, nor authorized to receive for the intended addressee, you are hereby 
notified that you may not use, copy, disclose or distribute to anyone the 
message or any information contained in the message. If you have received this 
message in error, please immediately advise the sender by reply email and 
delete the message.  Thank you.


Re: [O] Emacs-orgmode Digest, Vol 109, Issue 35

2015-03-30 Thread Richard Stanton
 Date: Sun, 29 Mar 2015 23:41:52 -0700
 From: Richard Stanton stan...@haas.berkeley.edu
 To: emacs-orgmode@gnu.org
 Subject: [O] How to get inline python code to work with :session
   option?
 Message-ID: 438abcf3-a5e3-4743-92de-6b85e3e2e...@haas.berkeley.edu
 Content-Type: text/plain; charset=us-ascii
 
 :session doesn't seem to play well with inline code blocks. For example, if I 
 press C-c C-c with the cursor in the middle of  the following inline code, 
 
 src_python[]{return 2+3} 
 
 it gets expanded to
 
 src_python[]{return 2+3} {{{results(=5=)}}}   
 
 However, if I do the same with this code block, 
 
 src_python[:session]{return 2+3} 
 
 no results appear in the text buffer, and the mini-buffer displays the 
 message Code block produced no output.
 
 How can I get inline code to work with :session? 
 
 Thanks.
 
 Richard Stanton

An answer to my own question, in case it’s useful to others: With the :session 
option, you need to drop the “return”.


[O] View logged notes in Agenda

2015-03-30 Thread Ken Mankoff

I find the option to view logged state changes (via v l or v L) in the agenda 
useful. Is there a way to view all notes? I take a lot of notes (via the z 
shortcut) and would like to view these too. Is this possible? Or should I just 
get in the habit of state changing to the existing state, in which case the 
notes do show up.

Thanks,

  -k.



Re: [O] Bug: Proposed new version of ob-C.el [8.3beta (release_8.3beta-944-g830cf3 @ /Users/snapp/.emacs.d/vendor/org/)]

2015-03-30 Thread Thierry Banel
Ok, 100% of votes are for the removal of wired #includes.
Here is the patch.  Tests are changed accordingly.

Thierry


Le 30/03/2015 16:39, Nick Dokos a écrit :

 IMO, it would be better than the current situation, but I wonder if
 it makes sense to have a global default setting containing the
 three files, but one which the user can customize; any :includes
 parameters would augment the default.

 That would satisfy the OP's requirements, but would also allow for
 a shorter #+BEGIN_SRC line.

 Nick



From 89eab423a0084a715456db558a987d6d806c49ba Mon Sep 17 00:00:00 2001
From: Thierry Banel tbanelweb...@free.fr
Date: Mon, 30 Mar 2015 21:36:00 +0200
Subject: [PATCH] Remove default #includes in Babel C, C++

* ob-C.el (org-babel-C-expand-C): remove automatic inclusion
of string.h, stdio.h, stdlib.h

* ob-C-test.org: adjust C++ tests to manually include
required header files.
---
 lisp/ob-C.el   | 1 -
 testing/examples/ob-C-test.org | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index 0857795..8d5ff2f 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -194,7 +194,6 @@ it's header arguments.
 		  nil)))
 (when (stringp includes)
   (setq includes (split-string includes)))
-(setq includes (append includes '(string.h stdio.h stdlib.h)))
 (when (stringp defines)
   (let ((y nil)
 	(result (list t)))
diff --git a/testing/examples/ob-C-test.org b/testing/examples/ob-C-test.org
index ab744f1..dcd1c48 100644
--- a/testing/examples/ob-C-test.org
+++ b/testing/examples/ob-C-test.org
@@ -129,7 +129,7 @@
   | sunday|4 |
 
 #+source: inhomogeneous_table
-#+begin_src cpp :var tinomogen=tinomogen :results silent
+#+begin_src cpp :var tinomogen=tinomogen :results silent :includes string.h stdio.h
 int main()
 {
   int i, j;
-- 
2.1.4



Re: [O] [PATCH] Fix massive slowdown in org-id-find

2015-03-30 Thread Florian Beck
Hello,

[sorry for the delay, I had some git SNAFUs]

 Could you also send and updated patch containing the VALUE optional
 argument to `org-re-property' and changing modifying only the (re ...)
 line in `org-find-property', with a new profiling?

Seems like this does trick. I don't really understand why, though. The
previous profiling seemed to indicate that most of the time was spent in
`org-entry-get' (that's why I removed it). Anyway, many thanks for
helping me out. Much appreciated.

I attached the new patch.

(let ((time (current-time)))
   (org-id-find zangwill.nick_2014:aesthetic.judgment)
   (format %ss (time-to-seconds (time-subtract (current-time) time

-- 0.032598146s

Here is the profiler report:

- command-execute 215  89%
 - call-interactively 215  89%
  - funcall-interactively 140  58%
   + execute-extended-command  92  38%
   - eval-last-sexp35  14%
- elisp--eval-last-sexp35  14%
 - eval35  14%
  - let35  14%
   - org-id-find   35  14%
- org-id-find-id-in-file   35  14%
 - org-find-entry-with-id  35  14%
  - org-find-property  35  14%
   - save-excursion35  14%
- let  35  14%
 - catch   35  14%
while  35  14%
   + next-line 13   5%
  + byte-code  75  31%
+ redisplay_internal (C function)  15   6%
+ timer-event-handler  11   4%
+ ...   0   0%

-- 
Florian Beck

From 389d8cec4406c394f3bf955726823951b014f6aa Mon Sep 17 00:00:00 2001
From: Florian Beck f...@miszellen.de
Date: Mon, 30 Mar 2015 22:27:36 +0200
Subject: [PATCH] org.el: Allow searching for specific property value

* lisp/org.el (org-re-property): New optional argument.
(org-find-property): Use it.
---
 lisp/org.el | 20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index cf37950..4f61123 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6254,7 +6254,7 @@ takes into consideration inlinetasks.
 
 (defvar org-font-lock-keywords nil)
 
-(defsubst org-re-property (property optional literal allow-null)
+(defsubst org-re-property (property optional literal allow-null value)
   Return a regexp matching a PROPERTY line.
 
 When optional argument LITERAL is non-nil, do not quote PROPERTY.
@@ -6262,14 +6262,22 @@ This is useful when PROPERTY is a regexp.  When ALLOW-NULL is
 non-nil, match properties even without a value.
 
 Match group 3 is set to the value when it exists.  If there is no
-value and ALLOW-NULL is non-nil, it is set to the empty string.
+value and ALLOW-NULL is non-nil, it is set to the empty string.
+
+With optional argument VALUE, match only property lines with
+that value; in this case, ALLOW-NULL is ignored.  VALUE is quoted
+unless LITERAL is non-nil.
   (concat
^\\(?4:[ \t]*\\)
(format \\(?1::\\(?2:%s\\):\\)
 	   (if literal property (regexp-quote property)))
-   (if allow-null
-   \\(?:\\(?3:$\\)\\|[ \t]+\\(?3:.*?\\)\\)\\(?5:[ \t]*\\)$
- [ \t]+\\(?3:[^ \r\t\n]+.*?\\)\\(?5:[ \t]*\\)$)))
+   (cond (value
+	  (format [ \t]+\\(?3:%s\\)\\(?5:[ \t]*\\)$
+		  (if literal value (regexp-quote value
+	 (allow-null
+	  \\(?:\\(?3:$\\)\\|[ \t]+\\(?3:.*?\\)\\)\\(?5:[ \t]*\\)$)
+	 (t
+	  [ \t]+\\(?3:[^ \r\t\n]+.*?\\)\\(?5:[ \t]*\\)$
 
 (defconst org-property-re
   (org-re-property \\S-+ 'literal t)
@@ -16323,7 +16331,7 @@ part of the buffer.
   (save-excursion
 (goto-char (point-min))
 (let ((case-fold-search t)
-	  (re (org-re-property property nil (not value
+	  (re (org-re-property property nil (not value) value)))
   (catch 'exit
 	(while (re-search-forward re nil t)
 	  (when (if value (equal value (org-entry-get (point) property nil t))
-- 
2.1.0



Re: [O] org-drill problem: questions are blank

2015-03-30 Thread Peter Westlake
Marco,

Thanks for the suggestion, but this doesn't make the bug go away for me.

Peter.

On Sun, 29 Mar 2015, at 19:54, Marco Wahl wrote:
 Peter Westlake peter.westl...@pobox.com writes:
 
  On Thu, 26 Mar 2015, at 17:26, J. David Boyd wrote:
  Peter Westlake peter.westl...@pobox.com writes:
  
   From time to time Org-drill shows me a blank window instead of a
   question. The frame, mode line and prompt to answer are visible, but
   there's nothing in the window at all. As a workaround I can type t to
   edit the tags, and the question will appear.
  
   A sample file is enclosed. It's a new file without any of the org-drill
   property drawers just to keep the example short and to avoid having to
   wait for the question to be scheduled to be shown again, but the problem
   *does* still happen when the drawers are present.
  
   To reproduce the bug, run org-drill in drillbug.org; the question MC
   gives a blank screen.
  
   I'm using org-drill with the latest version of Org-mode, git commit
   2f58e3c011ec84f621905332d8df68b83da580d9, on Emacs 24.3.1, 2014-09-30.
  
   Peter.
  
  There's no attached file...
 
  Ugh! There is now, sorry.
 
 Thanks!  I can reproduce your issue with a relatively fresh emacs 25 and
 org from git.
 
 AFAICS the window gets blanked sometimes in function
 org-toggle-latex-fragment of org.el in line
 
 --8---cut here---start-8---
 ;; Work around a bug that doesn't restore window's start
 ;; when widening back the buffer.
 (set-window-start nil window-start)
 --8---cut here---end---8---
 
 A workaround would be to comment out just this line.
 
 I don't know if this is a reliable fix though.
 
 
 HTH
 -- 
 http://www.wahlzone.de
 GPG: 0x49010A040A3AE6F2