[O] org-feed-parse-atom-feed doesn't handle empty value

2019-01-07 Thread Myles English
Hello,

I think there is a problem in org-feed-update in that it doesn't handle
an entry containing an element with no value, like this:



For example, adding an entry in org-feed-alist for an atom feed that
fails like this is:

("Artanis"
 "https://gitlab.com/NalaGinrut/artanis/tags?format=atom;
 "~/feeds.org" "Artanis"
 :parse-entry org-feed-parse-atom-entry
 :parse-feed org-feed-parse-atom-feed
 :template "* TODO %title\n")

and calling org-feed-update results in a backtrace:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  
string-match("&\\(?:#\\(x\\)?\\([0-9a-fA-F]+\\)\\|\\([[:word:]:_][-0-9.[:word:]:_·̀-ͯ‿-⁀]*\\)\\);"
 nil)
  xml-substitute-special(nil)
  (plist-put entry :description (xml-substitute-special (car (xml-node-children 
content
  (setq entry (plist-put entry :description (xml-substitute-special (car 
(xml-node-children content)
  (cond ((string= type "text") (setq entry (plist-put entry :description
  (xml-substitute-special (car (xml-node-children content))
  ((string= type "html") (setq entry (plist-put entry :description
  (xml-substitute-special (car (xml-node-children content))
  ((string= type "xhtml") (setq entry (plist-put entry :description
  (prin1-to-string (xml-node-children content) (t (setq entry
  (plist-put entry :description (format-message "Unknown `%s' content."
  type)
  (progn (cond ((string= type "text") (setq entry (plist-put entry
  :description (xml-substitute-special (car (xml-node-children
  content)) ((string= type "html") (setq entry (plist-put entry
  :description (xml-substitute-special (car (xml-node-children
  content)) ((string= type "xhtml") (setq entry (plist-put entry
  :description (prin1-to-string (xml-node-children content) (t (setq
  entry (plist-put entry :description (format-message "Unknown `%s'
  content." type))
  (if content (progn (cond ((string= type "text") (setq entry (plist-put
  entry :description (xml-substitute-special (car (xml-node-children
  content)) ((string= type "html") (setq entry (plist-put entry
  :description (xml-substitute-special (car (xml-node-children
  content)) ((string= type "xhtml") (setq entry (plist-put entry
  :description (prin1-to-string (xml-node-children content) (t (setq
  entry (plist-put entry :description (format-message "Unknown `%s'
  content." type)))
  (let* ((content (car (xml-get-children xml 'content))) (type
  (xml-get-attribute-or-nil content 'type))) (if content (progn (cond
  ((string= type "text") (setq entry (plist-put entry :description
  (xml-substitute-special (car (xml-node-children content))
  ((string= type "html") (setq entry (plist-put entry :description
  (xml-substitute-special (car (xml-node-children content))
  ((string= type "xhtml") (setq entry (plist-put entry :description
  (prin1-to-string (xml-node-children content) (t (setq entry
  (plist-put entry :description (format-message "Unknown `%s' content."
  type
  (let ((xml (car (read-from-string (plist-get entry
  :item-full-text) (setq entry (plist-put entry :link
  (xml-get-attribute (car (xml-get-children xml 'link)) 'href))) (setq
  entry (plist-put entry :title (xml-substitute-special (car
  (xml-node-children (car (xml-get-children xml 'title))) (let*
  ((content (car (xml-get-children xml 'content))) (type
  (xml-get-attribute-or-nil content 'type))) (if content (progn (cond
  ((string= type "text") (setq entry (plist-put entry :description
  (xml-substitute-special (car (xml-node-children content))
  ((string= type "html") (setq entry (plist-put entry :description
  (xml-substitute-special (car (xml-node-children content))
  ((string= type "xhtml") (setq entry (plist-put entry :description
  (prin1-to-string (xml-node-children content) (t (setq entry
  (plist-put entry :description (format-message "Unknown `%s' content."
  type entry)
  org-feed-parse-atom-entry((:guid
  "https://gitlab.com/NalaGinrut/artanis/tags/v0.0.1; :item-full-text
  "(entry nil \"\n \" (id nil
  \"https://gitlab.com/NalaGinrut/artanis/tags/v0.0.1\;) \"\n \" (link
  ((href . \"https://gitlab.com/NalaGinrut/artanis/tags/v0.0.1\;))) \"\n
  \" (title nil \"v0.0.1\") \"\n \" (summary nil \"first release\") \"\n
  \" (content ((type . \"html\"))) \"\n \" (media:thumbnail ((width
  . \"40\") (height . \"40\") (url
  . 
\"https://secure.gravatar.com/avatar/9a606d9c4e90d963463107046aa61e70?s=80=identicon\;)))
  \"\n \" (author nil \"\n \" (name nil \"Nala Ginrut\") \"\n \" (email
  nil \"nalagin...@gmail.com\") \"\n \") \"\n\")" :handled nil :link
  "https://gitlab.com/NalaGinrut/artanis/tags/v0.0.1; :title "v0.0.1"))
  mapcar(org-feed-parse-atom-entry ((:guid
  "https://gitlab.com/NalaGinrut/artanis/tags/v0.0.1; :item-full-text
  "(entry nil \"\n \" (id nil
  \"https://gitlab.com/NalaGinrut/artanis/tags/v0.0.1\;) \"\n \" (link
  ((href . 

Re: [O] Saving org-capture buffer while writing it

2017-02-20 Thread Myles English

on [2017-02-20] at 22:02 Narendra Joshi writes:

> Myles English <mylesengl...@gmail.com> writes:
>
>> Hello,
>>
>> on [2017-02-20] at 14:05 Narendra Joshi writes:
>>
>>> Hi,
>>>
>>> Sometimes when I am taking notes, I end up spending a lot of time in a
>>> capture buffer. If I happen to switch to something else, I end up
>>> loosing the capture buffer. I probably just kill the buffer
>>> accidentally, or do `C-c C-k'.
>>>
>>> Is there a way I can take backups of the buffer to a file?
>
>> I usually just save it (C-c s) and it is saved to where it would be
>> saved anyway when I eventually do C-c C-c.
> I just noticed that saving with `C-x C-s` does save the buffer. Why do
> you have a personal binding for saving the buffer? Is it doing something
> else?

I meant C-x C-s.





Re: [O] Saving org-capture buffer while writing it

2017-02-20 Thread Myles English
Hello,

on [2017-02-20] at 14:05 Narendra Joshi writes:

> Hi,
>
> Sometimes when I am taking notes, I end up spending a lot of time in a
> capture buffer. If I happen to switch to something else, I end up
> loosing the capture buffer. I probably just kill the buffer
> accidentally, or do `C-c C-k'.
>
> Is there a way I can take backups of the buffer to a file?

I usually just save it (C-c s) and it is saved to where it would be
saved anyway when I eventually do C-c C-c.

Myles



[O] translating event sexps to org for org-caldav

2016-11-19 Thread Myles English

Hello,

After the recent discussion about org-caldav I thought I would give it a
try.  Unfortunately it won't work for my main diary that uses a lot of
sexps[fn:1]

>From the org-caldav github page[fn:2] :

"""However, sexp-entries are insanely flexible, and there are limits as
to what the icalendar exporter will handle. For example, this here

** Regular event
   <%%(memq (calendar-day-of-week date) '(1 3 5))>

will not be exported at all."""

However, org-agenda uses these sexps to make entries in the agenda.

Would it be possible to reuse something from org-agenda to write these
entries as org items into a file that could be uploaded using
org-caldav?  Maybe org-get-entries-from-diary?  Is there a huge problem
with this that I haven't noticed?

Obviously this would just be a one-way push rather than a sync.

Thanks,
Myles


* Footnotes

[fn:1] I think I started using sexps just because org-mode can't do
e.g. "every Monday, *between these two dates*"

[fn:2] https://github.com/dengste/org-caldav



Re: [O] Capture template for datetree under existing headline

2016-09-25 Thread Myles English

Hi Peter,

Peter Sterner writes:

> I want to have a capture template that generates a datetree under an
> existing headline in an org file with existing headlines. I tried this:
>
> ("j" "Journal" entry (file+datetree "~/workspace/org/notes.org" "Journal")
> "* %?\n Added %U\n %i\n%a")
>
> I tried creating the Journal headline before capturing. But org-mode
> generates a 2016 headline not placed under Journal.

This seems to work, by making a new capture target called
'file+headline+datetree'.

Capture template:

("j" "Journal" entry (file+headline+datetree "~/workspace/org/notes.org" 
"Journal")

Patch:

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index a89d171..1826d3e 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -923,6 +923,40 @@ Store them in the capture property list."
  (setq target-entry-p (and (derived-mode-p 'org-mode) 
(org-at-heading-p
  (error "No match for target regexp in file %s" (nth 1 target
 
+   ((eq (car target) 'file+headline+datetree)
+   ;; copied from sexp for file+headline
+   (set-buffer (org-capture-target-buffer (nth 1 target)))
+   (org-capture-put-target-region-and-position)
+   (widen)
+   (let ((hd (nth 2 target)))
+ (goto-char (point-min))
+ (unless (derived-mode-p 'org-mode)
+   (error
+"Target buffer \"%s\" for file+headline+datetree should be in Org 
mode"
+(current-buffer)))
+ (if (re-search-forward
+  (format org-complex-heading-regexp-format (regexp-quote hd))
+  nil t)
+ (goto-char (point-at-bol))
+   (goto-char (point-max))
+   (or (bolp) (insert "\n"))
+   (insert "* " hd "\n")
+   (beginning-of-line 0)))
+   (org-narrow-to-subtree)
+   (org-show-subtree)
+   ;; copied from the sexp for file+datetree
+   (funcall
+#'org-datetree-find-date-create
+(calendar-gregorian-from-absolute
+ (cond
+  (org-overriding-default-time
+   ;; use the overriding default time
+   (time-to-days org-overriding-default-time))
+  (t
+   ;; current date, possibly corrected for late night workers
+   (org-today
+'restrict))
+
((memq (car target) '(file+datetree file+datetree+prompt file+weektree 
file+weektree+prompt))
(require 'org-datetree)
(set-buffer (org-capture-target-buffer (nth 1 target)))

This results in:

* Journal
* 2016

unless the following property is set:

* Journal
  :PROPERTIES:
  :DATE_TREE:
  :END:
** 2016

An improvement might be to prompt for the headline to put the datetree
under.  It might have been possible to do this as a 'function' target.

Myles



Re: [O] Substitute for (bh/org-agenda-to-appt)

2016-07-16 Thread Myles English
Hello Lou,

Louis Turk writes:

> With this fuction appointments are set up when Emacs starts:
>
> (bh/org-agenda-to-appt)

Presumably you got this function from here:

http://doc.norang.ca/org-mode.html

> I would like to substitute it with a function that sets the appointments
> up when org-mode starts instead of when emacs starts. The reason being
> that (bh/org-agenda-to-appt) causes all the org-agenda-files to load,
> which is very irritating when I'm editing none org-mode files (which is
> probably 95% of the time).

That webpage goes on to say:

#+BEGIN_QUOTE
; Rebuild the reminders everytime the agenda is displayed
(add-hook 'org-finalize-agenda-hook 'bh/org-agenda-to-appt 'append)

; This is at the end of my .emacs - so appointments are set up when Emacs starts
(bh/org-agenda-to-appt)
#+END_QUOTE

So just comment out that line, like this:

;; (bh/org-agenda-to-appt)

or delete it, and that function won't be called when your emacs starts,
only when the agenda is displayed (assuming you set it up like that).

Myles



Re: [O] Best way of including tikz into latex (pdf and beamer) export with preview?

2016-05-19 Thread Myles English

Hello Rainer,

Rainer M Krug writes:

> What is the best way of including tikz into org for latex export
> (beamer and pdf), and to have preview as well?

I don't know, but I do remember that using the `standalone' document
class was useful because you can keep the tikz picture in its own .tex
file, develop it using command line processing to pdf and, when it is
ready, use it in in several different documents (report, poster, thesis)
by including the .tex file file.  Not sure about previewing though.

Sorry I can't find a comprehensive example but here is an example usage
of standalone:

http://drvinceknight.blogspot.co.uk/2013/04/makefiles-for-tikz-sagemath-and.html

Myles


signature.asc
Description: PGP signature


Re: [O] [PATCH] ox-koma-letter.el: Add support for 'location' koma variable

2016-04-03 Thread Myles English
>From 2d9b513e14f6d34fe81a5970fd4cee24fc253a31 Mon Sep 17 00:00:00 2001
From: Myles English <mylesengl...@gmail.com>
Date: Mon, 4 Apr 2016 01:11:19 +0100
Subject: [PATCH] ox-koma-letter: Fixed bug in filling 'location' field

* contrib/lisp/ox-koma-letter.el: Fix code apparently introduced
  in 3ee3663
---
 contrib/lisp/ox-koma-letter.el | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el
index d36e817..2ef9025 100644
--- a/contrib/lisp/ox-koma-letter.el
+++ b/contrib/lisp/ox-koma-letter.el
@@ -797,12 +797,12 @@ a communication channel."
 	   (location-set (funcall check-scope 'location))
 	   (location (plist-get info :location)))
(when (or (and with-location-set (or location-set heading-val))
-		 (and (eq scope 'buffer) (or with-location-set location-set heading-val))
-		 (format "\\setkomavar{location}{%s}\n"
-			 (if (plist-get info :with-location)
-			 (if (plist-get info :special-headings) (or heading-val location "")
-			   (or option location ""))
-			   "")
+		 (and (eq scope 'buffer) (or with-location-set location-set heading-val)))
+	 (format "\\setkomavar{location}{%s}\n"
+		 (if (plist-get info :with-location)
+		 (if (plist-get info :special-headings) (or heading-val location "")
+		   (or heading-val location ""))
+		   ""
  ;; Folding marks.
  (and (funcall check-scope 'with-foldmarks)
   (let ((foldmarks (plist-get info :with-foldmarks)))
-- 
2.7.4


Rasmus,

A patch is attached that fixes some naughty brackets in the recent commit.

Myles

Rasmus writes:

> Myles English <mylesengl...@gmail.com> writes:
>
>> Thanks for looking at this again.
>
> I'm just sorry about the delay, but I hope you can appreciate that
> sometimes time is at a premium.
>
>>> Is :with-location something you feel strongly about?  I'm not sure I find
>>> that it makes sense...
>>>
>>> I would like to apply the following patch on top of yours.
>>
>> I think that's alright.
>>
>> Just to recap: I use the "location" field, intended as a general purpose
>> extension field, for bank details.  Those details shouldn't be in every
>> letter I write and I don't want to have to enter those details every
>> time they are used.  For those reasons I put the bank details in
>> variable in a LCO file and toggle the inclusion by setting the
>> :LOCATION: (or :EXPORT_LOCATION) property like this:
>>
>> :EXPORT_LOCATION: \usekomavar{frombank}
>
> So if something should be in ALL letters the advised method would be to
> use LCO file or set the location variable.  I’m just concerned with having
> too many variables.  ox-koma-letter is already fairly complex.
>
> It might make sense to NOT parse (i.e. interpret org syntax) the keyword
> version or location then.  Then you’d be able to add latex commands there.
> The headline version would still be parsed.
>
> Rasmus



Re: [O] [PATCH] ox-koma-letter.el: Add support for 'location' koma variable

2016-03-31 Thread Myles English

Hi Rasmus,

Thanks for looking at this again.

Rasmus Pank Roulund writes:

> Myles,
>
> Is :with-location something you feel strongly about?  I'm not sure I find
> that it makes sense...
>
> I would like to apply the following patch on top of yours.

I think that's alright.

Just to recap: I use the "location" field, intended as a general purpose
extension field, for bank details.  Those details shouldn't be in every
letter I write and I don't want to have to enter those details every
time they are used.  For those reasons I put the bank details in
variable in a LCO file and toggle the inclusion by setting the
:LOCATION: (or :EXPORT_LOCATION) property like this:

:EXPORT_LOCATION: \usekomavar{frombank}

As long as I can still do that I don't
mind.

Myles



Re: [O] Example of Make file for Org Mode LaTeX to pdf

2016-03-06 Thread Myles English

Hello Bob,

Robert Love writes:

> Does anyone have a make file example that has emacs load an .org file,
> process it into LaTeX and export as PDF, all from the command line
> without the user doing anything more than type ‘make’?   All examples
> appreciated.

Fraid I don't have a makefile but I do have a CMakeLists.txt that CMake
uses to generate a makefile.  This method uses a CMake module called
UseLATEX.cmake to generate the PDF.  I haven't used it for a couple of
years so it might be a bit outdated.

The CMakeLists.txt also contains an example of how to generate all the R
graphics for the document.

If it looks a bit over complicated for your requirements perhaps just
looking at the line that contains "COMMAND emacs" would be useful for
you.

Hopefully someone else will show a nice, simple, self-contained example.

Myles


#+BEGIN_SRC sh :tangle CMakeLists.txt
  cmake_minimum_required(VERSION 2.8)
  
  project(thesis NONE)

  include(/usr/share/cmake-2.8/Modules/UseLATEX.cmake)
  
  # Set R executable
  set(R_COMPILE "/usr/bin/Rscript")
# Set the location of data files
##set(DATA_DIR data)
# Set the location of the directory for image files
  set(IMAGE_DIR graphicsauto)
  
# Get a list of R files
  file(GLOB_RECURSE R_FILES "R/*.R")
  
  file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/R DESTINATION 
${CMAKE_CURRENT_BINARY_DIR})
  file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${IMAGE_DIR})
  
  foreach(file ${R_FILES})
  message("processing ${file}")
  get_filename_component(basename "${file}" NAME_WE)
  
# Command to run R
  if(R_COMPILE)
  message("Adding ... 
${CMAKE_CURRENT_BINARY_DIR}/R/${basename}.R")
  
  add_custom_command(
  OUTPUT
  ${CMAKE_CURRENT_BINARY_DIR}/${IMAGE_DIR}/${basename}.eps
  DEPENDS
  ${CMAKE_CURRENT_BINARY_DIR}/R/${basename}.R
  #  
${CMAKE_CURRENT_BINARY_DIR}/${IMAGE_DIR}/${DATA_DIR}
  COMMAND
  ${R_COMPILE}
  ARGS
  ${CMAKE_CURRENT_BINARY_DIR}/R/${basename}.R
  ${CMAKE_CURRENT_BINARY_DIR}/${IMAGE_DIR}/${basename}.eps
  )
  message("Running ${R_COMPILE} 
${CMAKE_CURRENT_BINARY_DIR}/R/${basename}.R 
${CMAKE_CURRENT_BINARY_DIR}/${IMAGE_DIR}/${basename}.eps")

  endif(R_COMPILE)

# Make a list of all R files (for ADD_LATEX_DOCUMENT depend)
  set(ALL_R_FILES ${ALL_R_FILES}
  ${CMAKE_CURRENT_BINARY_DIR}/${IMAGE_DIR}/${basename}.eps
  )
  endforeach(file)

# --- export mainThesis.org ---
  latex_get_output_path(OUTPUT_DIR)  
  file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/mainThesis.org DESTINATION 
${OUTPUT_DIR}/ )
  file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/thesis.el DESTINATION 
${OUTPUT_DIR}/ )
  
  add_custom_target( orgfile ALL
  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/mainThesis.org )
  
  add_custom_target( elfile ALL
  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/thesis.el )
  
  add_custom_command(
  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mainThesis.tex
  COMMAND emacs -Q --batch --eval \"(progn
  (add-to-list 'load-path
 (expand-file-name 
\\"~/.emacs.d/plugins/org-mode/lisp/\\"))
   (add-to-list 'load-path
  (expand-file-name 
\\"~/.emacs.d/plugins/org-mode/contrib/lisp/\\" t))
  (require 'org)
   (require 'ox)
  (require 'org-exp)
   (require 'org-inlinetask)
  (require 'ob-plantuml)
   (setq org-plantuml-jar-path 
\\"/home/myles/Downloads/plantuml.jar\\")
   (org-babel-do-load-languages
'org-babel-load-languages
  '((emacs-lisp . t)
  (sh . t)
  (plantuml . t)))
   (setq org-confirm-babel-evaluate nil)
   (setq org-latex-listings 'minted)
  (setq org-latex-with-hyperref nil)
 (add-to-list 'org-latex-packages-alist '(\\"\\" 
\\"minted\\"))
  
  (add-to-list 'org-latex-classes 
'(\\"mynewthesis\\" \\"\\documentclass[11pt]{mythesis}\\"
 (\\"\\chapter{%s}\\" . \\"\\chapter*{%s}\\")
 (\\"\\section{%s}\\" . \\"\\section*{%s}\\")
 (\\"\\subsection{%s}\\" . \\"\\subsection*{%s}\\")
 (\\"\\subsubsection{%s}\\" . \\"\\subsubsection*{%s}\\")
 (\\"\\paragraph{%s}\\" . \\"\\paragraph*{%s}\\")))
 (setq org-export-with-todo-keywords nil)
 (load-library 

Re: [O] [PATCH] ox-koma-letter.el: Add support for 'location' koma variable

2016-02-15 Thread Myles English


Rasmus writes:

> I will try to merge your patch soon, this weekend.  Again, unless someone
> beats me to it.

Please would someone apply this patch?

Thanks,
Myles

>From 4495abd39d57abc0dd64361f852c3a638f86915b Mon Sep 17 00:00:00 2001
From: Myles English <mylesengl...@gmail.com>
Date: Wed, 27 Jan 2016 18:18:38 +
Subject: [PATCH] ox-koma-letter: Add support for LOCATION koma variable

* contrib/lisp/ox-koma-letter.el (koma-letter): Duplicated code
  used for 'place' variable, renamed as 'location'

Whenever OPTION keyword contains a 'location' item or LOCATION
keyword is used in the buffer, set KOMA option 'location' after
LCO inclusion.
---
 contrib/lisp/ox-koma-letter.el | 29 -
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el
index 9a4686e..8afeed2 100644
--- a/contrib/lisp/ox-koma-letter.el
+++ b/contrib/lisp/ox-koma-letter.el
@@ -41,6 +41,7 @@
 ;;   - PHONE_NUMBER: see `org-koma-letter-phone-number',
 ;;   - SIGNATURE: see `org-koma-letter-signature',
 ;;   - PLACE: see `org-koma-letter-place',
+;;   - LOCATION: see `org-koma-letter-location',
 ;;   - TO_ADDRESS:  If unspecified this is set to "\mbox{}".
 ;;
 ;; TO_ADDRESS and FROM_ADDRESS can also be specified using heading
@@ -58,6 +59,7 @@
 ;;   - phone (see `org-koma-letter-use-phone')
 ;;   - email (see `org-koma-letter-use-email')
 ;;   - place (see `org-koma-letter-use-place')
+;;   - location (see `org-koma-letter-use-location')
 ;;   - subject, a list of format options
 ;; (see `org-koma-letter-subject-format')
 ;;   - after-closing-order, a list of the ordering of headings with
@@ -188,6 +190,12 @@ This option can also be set with the PLACE keyword."
   :group 'org-export-koma-letter
   :type 'string)
 
+(defcustom org-koma-letter-location ""
+  "Sender's extension field, as a string.
+This option can also be set with the LOCATION keyword."
+  :group 'org-export-koma-letter
+  :type 'string)
+
 (defcustom org-koma-letter-opening ""
   "Letter's opening, as a string.
 
@@ -356,6 +364,13 @@ This option can also be set with the OPTIONS keyword, e.g.:
   :group 'org-export-koma-letter
   :type 'boolean)
 
+(defcustom org-koma-letter-use-location t
+  "Non-nil prints the contents of the letter's extension below the header.
+This option can also be set with the OPTIONS keyword, e.g.:
+\"location:nil\"."
+  :group 'org-export-koma-letter
+  :type 'boolean)
+
 (defcustom org-koma-letter-default-class "default-koma-letter"
   "Default class for `org-koma-letter'.
 The value must be a member of `org-latex-classes'."
@@ -406,6 +421,7 @@ e.g. \"title-subject:t\"."
 (:email "EMAIL" nil (org-koma-letter--get-value org-koma-letter-email) t)
 (:to-address "TO_ADDRESS" nil nil newline)
 (:place "PLACE" nil org-koma-letter-place)
+(:location "LOCATION" nil org-koma-letter-location)
 (:subject "SUBJECT" nil nil parse)
 (:opening "OPENING" nil org-koma-letter-opening parse)
 (:closing "CLOSING" nil org-koma-letter-closing parse)
@@ -425,6 +441,7 @@ e.g. \"title-subject:t\"."
 (:with-foldmarks nil "foldmarks" org-koma-letter-use-foldmarks)
 (:with-phone nil "phone" org-koma-letter-use-phone)
 (:with-place nil "place" org-koma-letter-use-place)
+(:with-location nil "location" org-koma-letter-use-location)
 (:with-subject nil "subject" org-koma-letter-subject-format)
 (:with-title-as-subject nil "title-subject" org-koma-letter-prefer-subject)
 (:with-headline-opening nil nil org-koma-letter-headline-is-opening-maybe)
@@ -435,12 +452,14 @@ e.g. \"title-subject:t\"."
 (:inbuffer-email "EMAIL" nil 'koma-letter:empty)
 (:inbuffer-phone-number "PHONE_NUMBER" nil 'koma-letter:empty)
 (:inbuffer-place "PLACE" nil 'koma-letter:empty)
+(:inbuffer-location "LOCATION" nil 'koma-letter:empty)
 (:inbuffer-signature "SIGNATURE" nil 'koma-letter:empty)
 (:inbuffer-with-backaddress nil "backaddress" 'koma-letter:empty)
 (:inbuffer-with-email nil "email" 'koma-letter:empty)
 (:inbuffer-with-foldmarks nil "foldmarks" 'koma-letter:empty)
 (:inbuffer-with-phone nil "phone" 'koma-letter:empty)
-(:inbuffer-with-place nil "place" 'koma-letter:empty))
+(:inbuffer-with-place nil "place" 'koma-letter:empty)
+(:inbuffer-with-location nil "location" 'koma-letter:empty))
   :translate-alist '((export-block . org-koma-letter-export-block)
 		 (export-snippet . org-koma-letter-export-snippet)
 		 (headline . org-koma-letter-headline)
@@ -755,6 +774,14 @@ a communication chann

Re: [O] #+BEGIN_LaTeX deprecated

2016-02-09 Thread Myles English
Hello Julien,

Julien Cubizolles writes:

> The #+BEGIN_LaTeX... #+END_LaTeX has been deprecated in favor of
> #+BEGIN_EXPORT latex ... #+END_EXPORT. I have however a lot of older org
> files that I will need to export again. I can manually change the
> blocks but I was wondering if some automatic conversion function has
> been implemented.

I don't know if there is such a function but, for the problem you
describe, I would try something like this:

sed -i 's/#+\(BEGIN\|END\)_LaTeX/#+\1_EXPORT/' myfile.org

If there are lots of files maybe (UNTESTED):

grep -rl "BEGIN_LaTeX\|END_LaTeX" | \
 xargs -IXX \
   sed -i's/#+\(BEGIN\|END\)_LaTeX/#+\1_EXPORT/' XX

Myles



Re: [O] [PATCH] ox-koma-letter.el: Add support for 'location' koma variable

2016-01-29 Thread Myles English

Rasmus,

Rasmus writes:

> I’m arguing for a solution that supports BOTH "one-off" and permanent
> data.

OK, sorry, I thought you were arguing for a heading tagged :location:
and against an option #+LOCATION or property :EXPORT_LOCATION:.  How
about applying my patch please and the tagged heading can be developed
by someone™ 'later'.

> The keyword is convenient when you want to insert a pointer to field.  I
>
> But for a one-off letter where I might need to include "one-off" details
> on the left, I’d rather type:
>
> * bank details :location:
>   Acc. No.: 1234567890
>   at Big Bank
>   Sort Code: 11-22-33
>
> Than
>
> #+latex_header: \setkomavar{frombank}{\raggedright 
> Acc.~No.:\,1234567890\\at Big Bank\\Sort Code: 11-22-33}
> #+Location: \usekomavar{frombank}
>
> To me the former reads much easier and hides away the technical details.
> Thus, I wish to see to see support for entry forms.

Alright, I get the general idea but in that specific case this would be
simpler:

#+LOCATION: \raggedright Acc.~No.:\,1234567890\\at Big Bank\\Sort Code: 11-22-33

Myles



Re: [O] [PATCH] ox-koma-letter.el: Add support for 'location' koma variable

2016-01-28 Thread Myles English

Rasmus writes:

> Myles English <mylesengl...@gmail.com> writes:
>
>> Thanks for making it!
>
> It's Nicolas’ creation, not mine.  I merely contribute a few patches
> to it.

Thanks to Nicolas too.

>>> Aside: it sounds like what you need is "yourref", maybe "yourmail",
>>> "myref", "customer", and "invoice".  These are typed in the same line as
>>> the date and place.  In my manual it’s described around pp. 180.
>>
>> Thanks, those are all useful fields I didn't know about.  The
>> description of "frombank" indicates that "location" is still a good
>> place for bank account details.
>
> OK.
>
>>> On to "location".  From the manual pp. 195 it looks like it is usually
>>> something akin to an address field on the right side of the head.  I think
>>> "location" should be settable via a special :location: heading, probably
>>> with special line breaking rules like the :to:/:from: special headings.
>>> We can allow a #+LOCATION keyword in addition, but need not.  All IMO.
>>> WDYT?
>>
>> Given that "location" is intended as a "user's extension field" I
>> suppose that a special tagged :location: heading would be convenient for
>> some uses, if you want to add it.  For most cases however, I think its
>> use would break up the structure of the org-mode letter so I would still
>> prefer this way for the simple case of inserting bank details:
>>
>> __
>>
>> ** Change of address
>> :EXPORT_LOCATION: \usekomavar{frombank}
>
> You could have this is a LCO file as well.

Do you mean like this:

\setkomavar{location}{\usekomavar{frombank}}

I don't understand why I would want to do that because I would have to
use a different LCO file depending on whether I was writing to my bank
or not.

> If so, you might be able to populate location using
> \ifkomavarempty{}{}.  I use this in my standard footer to insert
> fields depending on which variables are set.

Following on from my not understanding, any chance of an example of how
to do that showing what variable to set when writing to my bank, (to
cause the location variable to be populated with bank details)?

>> \setkomavar{frombank}{\raggedright Acc.~No.:\,1234567890\\at Big
>>   Bank\\Sort Code: 11-22-33}
>>
>> The bank details only appear in a letter when the property is set.
>>
>> Which is much neater than the special heading approach, something like
>> this:
>>
>> __
>>
>> ** Change of address
>>
>> *** Location field:location:
>> \usekomavar{frombank}
>
> But is it much neater than:
>
> ** bank details :location:
> Acc. no.: 12345
> Big Bank Corp
> Sort code: 1122 

Err, yes it is?  And anyway, that data is in my LCO file, I don't want
to duplicate it.

> For temporary data, I’d rather have it like in my example.  For permanent
> data I can keep it in a .lco file.

Yes, that is what I have done (hmmm, I am beginning to sense a
fundamental misunderstanding here).  My bank account details are
permanent data and are in a LCO file.

> And maybe #+include: "bank-info.org".

The way you have edited my original email in your reply makes it
difficult to follow what is being discussed.  I would like to clarify
the main point by quoting from my original message:

#+BEGIN_QUOTE
...I would still prefer this way for the simple case of
inserting bank details:

__

** Change of address
:EXPORT_LOCATION: \usekomavar{frombank}

I have moved.
__

Where the frombank variable has been set in the LCO file:

\setkomavar{frombank}{\raggedright Acc.~No.:\,1234567890\\at Big
  Bank\\Sort Code: 11-22-33}

The bank details only appear in a letter when the property is set.
#+END_QUOTE

That property mentioned is the :EXPORT_LOCATION: property.  You can set
it to whatever you like, referencing something in your LCO file or
temporary data.

Myles



Re: [O] [PATCH] ox-koma-letter.el: Add support for 'location' koma variable

2016-01-28 Thread Myles English

Hi Rasmus,

Rasmus writes:

> Thanks for your patch.
>
> It always makes me happy when someone is using ox-koma-letter.

Thanks for making it!

>> Often when writing a letter I want to include "Your Ref: xyz" or
>> "Account No.: 1234" and a good place to do this is below the sender's
>> address field and above the date (and 'place') field(s).  This space
>> becomes filled with the contents of the koma variable called 'location'.
>> This patch enables filling this variable via org-mode's contrib
>> ox-koma-letter exporter.
>
> Aside: it sounds like what you need is "yourref", maybe "yourmail",
> "myref", "customer", and "invoice".  These are typed in the same line as
> the date and place.  In my manual it’s described around pp. 180.

Thanks, those are all useful fields I didn't know about.  The
description of "frombank" indicates that "location" is still a good
place for bank account details.

> On to "location".  From the manual pp. 195 it looks like it is usually
> something akin to an address field on the right side of the head.  I think
> "location" should be settable via a special :location: heading, probably
> with special line breaking rules like the :to:/:from: special headings.
> We can allow a #+LOCATION keyword in addition, but need not.  All IMO.
> WDYT?

Given that "location" is intended as a "user's extension field" I
suppose that a special tagged :location: heading would be convenient for
some uses, if you want to add it.  For most cases however, I think its
use would break up the structure of the org-mode letter so I would still
prefer this way for the simple case of inserting bank details:

__

** Change of address
:EXPORT_LOCATION: \usekomavar{frombank}

I have moved.
__

Where the frombank variable has been set in the LCO file:

\setkomavar{frombank}{\raggedright Acc.~No.:\,1234567890\\at Big
  Bank\\Sort Code: 11-22-33}

The bank details only appear in a letter when the property is set.

Which is much neater than the special heading approach, something like
this:

__

** Change of address

*** Location field:location:
\usekomavar{frombank}

*** Rest of letter
I have moved.
__


Myles



[O] [PATCH] ox-koma-letter.el: Add support for 'location' koma variable

2016-01-27 Thread Myles English
Hello,

Often when writing a letter I want to include "Your Ref: xyz" or
"Account No.: 1234" and a good place to do this is below the sender's
address field and above the date (and 'place') field(s).  This space
becomes filled with the contents of the koma variable called 'location'.
This patch enables filling this variable via org-mode's contrib
ox-koma-letter exporter.

Please apply the attached patch.

Myles

>From 4495abd39d57abc0dd64361f852c3a638f86915b Mon Sep 17 00:00:00 2001
From: Myles English <mylesengl...@gmail.com>
Date: Wed, 27 Jan 2016 18:18:38 +
Subject: [PATCH] ox-koma-letter: Add support for LOCATION koma variable

* contrib/lisp/ox-koma-letter.el (koma-letter): Duplicated code
  used for 'place' variable, renamed as 'location'

Whenever OPTION keyword contains a 'location' item or LOCATION
keyword is used in the buffer, set KOMA option 'location' after
LCO inclusion.
---
 contrib/lisp/ox-koma-letter.el | 29 -
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el
index 9a4686e..8afeed2 100644
--- a/contrib/lisp/ox-koma-letter.el
+++ b/contrib/lisp/ox-koma-letter.el
@@ -41,6 +41,7 @@
 ;;   - PHONE_NUMBER: see `org-koma-letter-phone-number',
 ;;   - SIGNATURE: see `org-koma-letter-signature',
 ;;   - PLACE: see `org-koma-letter-place',
+;;   - LOCATION: see `org-koma-letter-location',
 ;;   - TO_ADDRESS:  If unspecified this is set to "\mbox{}".
 ;;
 ;; TO_ADDRESS and FROM_ADDRESS can also be specified using heading
@@ -58,6 +59,7 @@
 ;;   - phone (see `org-koma-letter-use-phone')
 ;;   - email (see `org-koma-letter-use-email')
 ;;   - place (see `org-koma-letter-use-place')
+;;   - location (see `org-koma-letter-use-location')
 ;;   - subject, a list of format options
 ;; (see `org-koma-letter-subject-format')
 ;;   - after-closing-order, a list of the ordering of headings with
@@ -188,6 +190,12 @@ This option can also be set with the PLACE keyword."
   :group 'org-export-koma-letter
   :type 'string)
 
+(defcustom org-koma-letter-location ""
+  "Sender's extension field, as a string.
+This option can also be set with the LOCATION keyword."
+  :group 'org-export-koma-letter
+  :type 'string)
+
 (defcustom org-koma-letter-opening ""
   "Letter's opening, as a string.
 
@@ -356,6 +364,13 @@ This option can also be set with the OPTIONS keyword, e.g.:
   :group 'org-export-koma-letter
   :type 'boolean)
 
+(defcustom org-koma-letter-use-location t
+  "Non-nil prints the contents of the letter's extension below the header.
+This option can also be set with the OPTIONS keyword, e.g.:
+\"location:nil\"."
+  :group 'org-export-koma-letter
+  :type 'boolean)
+
 (defcustom org-koma-letter-default-class "default-koma-letter"
   "Default class for `org-koma-letter'.
 The value must be a member of `org-latex-classes'."
@@ -406,6 +421,7 @@ e.g. \"title-subject:t\"."
 (:email "EMAIL" nil (org-koma-letter--get-value org-koma-letter-email) t)
 (:to-address "TO_ADDRESS" nil nil newline)
 (:place "PLACE" nil org-koma-letter-place)
+(:location "LOCATION" nil org-koma-letter-location)
 (:subject "SUBJECT" nil nil parse)
 (:opening "OPENING" nil org-koma-letter-opening parse)
 (:closing "CLOSING" nil org-koma-letter-closing parse)
@@ -425,6 +441,7 @@ e.g. \"title-subject:t\"."
 (:with-foldmarks nil "foldmarks" org-koma-letter-use-foldmarks)
 (:with-phone nil "phone" org-koma-letter-use-phone)
 (:with-place nil "place" org-koma-letter-use-place)
+(:with-location nil "location" org-koma-letter-use-location)
 (:with-subject nil "subject" org-koma-letter-subject-format)
 (:with-title-as-subject nil "title-subject" org-koma-letter-prefer-subject)
 (:with-headline-opening nil nil org-koma-letter-headline-is-opening-maybe)
@@ -435,12 +452,14 @@ e.g. \"title-subject:t\"."
 (:inbuffer-email "EMAIL" nil 'koma-letter:empty)
 (:inbuffer-phone-number "PHONE_NUMBER" nil 'koma-letter:empty)
 (:inbuffer-place "PLACE" nil 'koma-letter:empty)
+(:inbuffer-location "LOCATION" nil 'koma-letter:empty)
 (:inbuffer-signature "SIGNATURE" nil 'koma-letter:empty)
 (:inbuffer-with-backaddress nil "backaddress" 'koma-letter:empty)
 (:inbuffer-with-email nil "email" 'koma-letter:empty)
 (:inbuffer-with-foldmarks nil "foldmarks" 'koma-letter:empty)
 (:inbuffer-with-phone nil "phone" 'koma-letter:empty)
-(:inbuffer-with-place nil "place" 'koma-letter:empty))
+(:inbuffer-with-place nil "place" 'koma-letter:empty)
+(:inbuffer-with

Re: [O] Repeated tasks marked as DONE

2016-01-27 Thread Myles English

Hello Tomasz,

Tomasz Piotrowski writes:

> I have a simple question, yet couldn't find an equally simple answer to
> it. Namely, if I set a repeated task (everyday, say), the agenda
> shows this tasks _for all days_, even in the past.
>
> How can I mark a repeated task DONE if it is completed for a given day,
> while keeping it as TODO for the future?

This is what works for me, the last_repeat property seams to enable the
behaviour you describe, the logbook is something extra I vaguely
remember setting up:

* TODO Put recycle bin out
 SCHEDULED: <2016-01-28 Thu +2w>
:PROPERTIES:
:LAST_REPEAT: [2016-01-16 Sat 13:10]
:END:
:LOGBOOK:
- State "DONE"   from "TODO"   [2016-01-16 Sat 13:10]
- State "DONE"   from "TODO"   [2016-01-02 Sat 17:41]
- State "DONE"   from "TODO"   [2015-12-21 Mon 16:22]
:END:

Myles




Re: [O] Repeated tasks marked as DONE

2016-01-27 Thread Myles English

Myles English writes:

> Hello Tomasz,
>
> Tomasz Piotrowski writes:
>
>> I have a simple question, yet couldn't find an equally simple answer to
>> it. Namely, if I set a repeated task (everyday, say), the agenda
>> shows this tasks _for all days_, even in the past.
>>
>> How can I mark a repeated task DONE if it is completed for a given day,
>> while keeping it as TODO for the future?
>
> This is what works for me, the last_repeat property seams to enable the
> behaviour you describe, the logbook is something extra I vaguely
> remember setting up:
>
> * TODO Put recycle bin out
>  SCHEDULED: <2016-01-28 Thu +2w>
> :PROPERTIES:
> :LAST_REPEAT: [2016-01-16 Sat 13:10]
> :END:
> :LOGBOOK:
> - State "DONE"   from "TODO"   [2016-01-16 Sat 13:10]
> - State "DONE"   from "TODO"   [2016-01-02 Sat 17:41]
> - State "DONE"   from "TODO"   [2015-12-21 Mon 16:22]
> :END:

And see also the variable org-agenda-repeating-timestamp-show-all.
(Having read the available help, don't quite understand way it working
for me...)

Myles




Re: [O] Remaining time in effort estimates

2016-01-05 Thread Myles English
Hello Michael,

I did something like this a while ago but there was not much interest
at the time and I don't use it anymore:

http://thread.gmane.org/gmane.emacs.orgmode/61459/focus=61555

It would probably need updating but I hope it is useful to you.

Myles

Michael Gummelt writes:

> Hi,
>
> I set effort estimates on a list of subtasks.  I can sum those estimates as
> described here: http://orgmode.org/manual/Effort-estimates.html
>
> What I'd like to do is see the remaining effort estimate time in the
> supertask.  For example, if I have a supertask with 10 subtasks, and I mark
> 3 of them complete, I'd like to see the sum of the 7 incomplete tasks.  The
> link above shows how you can view a CLOCKSUM, but that is a different value.
>
> Knowing how long is remaining on a supertask seems to be a fundamental
> feature for project management.  Is there any solution in org mode?
>
> Thanks,
> Michael Gummelt




Re: [O] Capture and use export header numbering?

2015-11-05 Thread Myles English

Hello Lawrence,

Lawrence Bottorff writes:

> When an outline tree of headers
>
> * top 1
> ** something
> ** something
> ** something
> *** something
>  something
> * something
> ** something
>
> is exported, say, to html, org-mode produces a numerical outline as deep as
> the options are set
>
> 1. top
> 1.1. something
> 1.2. something
> 1.3. something
> 1.3.1. something
> 1.3.1.1. something
> 1.3.1.1.1. something
> 1.3.1.1.1.1. something
>
>
> Now, is there any way to actually capture that outline numeration for use
> in the original buffer? I'm thinking I would like to make a sort of tags or
> custom_id  system based on these numbers.

You might find something useful as a starting point in this old code I
posted here:

http://lists.gnu.org/archive/html/emacs-orgmode/2012-10/msg00245.html

Basically it exported to text to get the heading numbers.

Myles




Re: [O] sh - script: how to control the output.

2015-11-02 Thread Myles English
Hello Johann,

Johann Spies writes:

> In the normal shell, I can do:
>
>  echo '\d wos.wos_papers_by_subject_mv' | psql -h localhost -p 63334
> book_citation | grep '[+|]'
>
> and get the output:
>
>   Column  |  Type   | Modifiers
> --+-+---
>  id   | integer |
>  subject  | citext  |
>  articles | bigint  |
>
> When I try this in org-mode:
>
>
> #+BEGIN_SRC sh
>
> echo '\d wos.wos_papers_by_subject_mv' | psql -h localhost -p 63334
> book_citation | grep '[+|]'
>
>
> #+END_SRC
>
> #+results:
> | Column   |   |   | Type|   |   | Modifiers |
> | --+-+--- |   |   | |   |   |   |
> | id   |   |   | integer |   |   |   |
> | subject  |   |   | citext  |   |   |   |
> | articles |   |   | bigint  |   |   |   |
>
> What should I do to get the following in org-mode as a result:

You could try out some of the options for the ":results" header
argument, as described here:

http://orgmode.org/manual/results.html#results

Myles



Re: [O] pdflatex not found?

2015-10-26 Thread Myles English


John Hendy writes:

> On Mon, Oct 26, 2015 at 2:26 PM, Peter Davis  wrote:
>>
>> I'm trying to export PDF from org, but I'm getting the error:
>>
>> pdflatex: Command not found. [3 times]
>>
>> I've checked the definition of exec-path, and it includes "/usr/texbin", 
>> which is where tcsh tells me the executable is.
>
> Someone else might have a better answer, but can you check your system
> itself first? I'm guessing "exec-path" is an Org/Emacs variable?
>
> Just try:
>
> $ which pdflatex
>
> Or
>
> $ pdflatex --version
>
> That would be my suggestion for starters. At least then you know it's
> definitely not your system/setup (my bet is that it is, though).
>
>
> John
>
>>
>> Any ideas?
>>
>> Thank you!
>>
>> -pd

pd,

After trying what has alreaddy been suggested you might try putting your
cursor after the last bracket of this and pressing C-x C-e to see what
emacs thinks your shell PATH environment variable is set to:

(getenv "PATH")

If you can't see the correct path in there then it should probably be
set in ~/.profile or equivalent for tcsh rather than in ~/.tcshrc (I
don't use tcsh so I just guessed that filename).

Myles




Re: [O] Return Top-Level Heading

2015-10-19 Thread Myles English
Hello Zach,

Zach Sheffler writes:

> Is there a way to reference the top-level heading that a lower-level
> heading belongs to? For instance:
>
> * One
> ** Two
> *** Three
>
> If I have "Three", how can I get it to tell me that the top-level is "One"?
> For reference, this is for an org-agenda-prefix.

Perhaps this:

(defun findTop()
(interactive)
(let* ((tree (org-element-parse-buffer))
   (curs_pos (point))
   (up_tree (org-element-map tree 'headline
  (lambda (hl)
(and (> curs_pos (org-element-property :begin hl))
 (= (org-element-property :level hl) 1)
 (org-element-property :raw-value hl) 
   (local_up_tree (last up_tree)))
  local_up_tree))

Myles



Re: [O] Favorite way of syncing?

2015-09-14 Thread Myles English

Eric,

Eric Abrahamsen writes:

> Myles English <mylesengl...@gmail.com> writes:
>
>> https://myrepos.branchable.com
>> https://github.com/RichiH/vcsh
>> http://gitolite.com/gitolite/index.html
>
> Uh oh, I might have to start playing with this! Though there's something
> nice about the morning ritual of going through a bunch of repos and
> updating them.
>
> For doing version control of dotfiles or other collections of
> non-interrelated single files, I've been curious about (but haven't yet
> tried) ESR's src:
>
> http://www.catb.org/~esr/src/

Probably worth mentioning this alternative to vcsh:

https://github.com/capr/multigit

The only reason I chose vcsh is because it is more popular and I am a
bit a sheep.

Myles



Re: [O] Favorite way of syncing?

2015-09-11 Thread Myles English

Hi Tobias,

Tobias Frischholz writes:

> I was wondering what is your favorite way of syncing your org files and 
> everything.

For org files I use git combined with myrepos and it has been working
very well for me for several years.  For dotfiles I recently discovered
vcsh, also synced via myrepos.  It too is working nicely so far.

When I leave one computer I type 'mr update' and everything syncs to a
server running gitolite that manages bare repos.  When I get to another
computer I type 'mr update' to sync it again.

It is quite complicated but does the job.

https://myrepos.branchable.com
https://github.com/RichiH/vcsh
http://gitolite.com/gitolite/index.html

Myles



[O] help with MWE error: Variable binding depth exceeds max-specpdl-size

2015-07-03 Thread Myles English
Hello,

Using the latest git HEAD (048f0), I am trying to make a MWE for another
problem however, can someone please tell me what is missing from the
init file because I get an error when I press TAB in the table.

Starting emacs like this:

$ emacs a.org -Q -l init.el

with these files:

a.org
-
* x

| a |
|---|
| 1 |

init.el
---
(setq debug-on-error t)
(add-to-list 'load-path
 ~/.emacs.d/plugins/org-mode/lisp)

(add-to-list 'load-path
 ~/.emacs.d/plugins/org-mode/contrib/lisp t)
(require 'org)
;;(require 'org-index)


I get this traceback:

Debugger entered--Lisp error: (error Variable binding depth exceeds 
max-specpdl-size)
  outline-on-heading-p(t)
  org-at-heading-p()
  org-element--current-element(23 element nil nil)
  byte-code(`\212\306\307 \211\310P\311 
\210,`)\312\211\211\211\211\211\211*+,-./\306\307 \211\310 P\313 
\203Teb\210\314 \210m\204L\315 /V\203\205\316\317\312\\210\202\205\320 
\210\312y\210\314 \210m\204i\315 /V\203\205\316\317\321\312x\210\322 
\2100\204~\323d\306\\202\203\323d\306\C\\210,\322 
\210\324.\325,*$\211@-\326\f12\211;\203\263\327\31221$\202\304A\330A@21#\240\210+\2100\203\322+B+\3312;\203\351\332\3332#\202\361\334A@2\*\2113/W\204\f3/U\2053.U?\2053b)\204\211-4\204.\316\3170\203'+\202)\\210\202\211\3352;\203E\332\3332#\202M\334A@2\*\3362;\203e\332\3332#\202m\334A@2\*5\2116\203\2745\203\2746/V\204\2745/W\204\2746/U\203\232-\337\204\2745/U\203\317-\340\204\274-\341\203\3175b\210n\204\274m\204\317\316\3170\203\310+\202\312\\210\202@\342-\343\\203\344,\3452;\203\364\332\3332#\202\374\334A@2\**\2028\342-\344\\203\312,\2028\342-\346\\203!\347,\312*\2028\342-\350\\2032\351,\312*\2028\312\211,*5.6b\210*\202\211
 [org-called-with-limited-levels org-outline-regexp outline-regexp 
org-outline-regexp-bol parent prevs t org-get-limited-outline-regexp ^ 
outline-next-heading nil org-before-first-heading-p org-skip-whitespace 
line-beginning-position throw exit org-back-to-heading  \n 
beginning-of-line org-element-headline-parser org-element--current-element 
element :parent org-add-props plist-put :end get-text-property 0 plist-get 
:contents-begin :contents-end (plain-list table) (center-block drawer 
dynamic-block inlinetask property-drawer quote-block special-block) (item 
plain-list) eql plain-list item :structure property-drawer node-property table 
table-row struct trail special-flag type end origin keep-trail value ...] 10)
  org-element-at-point()
  org-table-begin(any)
  org-at-table\.el-p()
  org-element-table-parser(23 (5))
  org-element--current-element(23 element nil nil)
  byte-code(`\212\306\307 \211\310P\311 
\210,`)\312\211\211\211\211\211\211*+,-./\306\307 \211\310 P\313 
\203Teb\210\314 \210m\204L\315 /V\203\205\316\317\312\\210\202\205\320 
\210\312y\210\314 \210m\204i\315 /V\203\205\316\317\321\312x\210\322 
\2100\204~\323d\306\\202\203\323d\306\C\\210,\322 
\210\324.\325,*$\211@-\326\f12\211;\203\263\327\31221$\202\304A\330A@21#\240\210+\2100\203\322+B+\3312;\203\351\332\3332#\202\361\334A@2\*\2113/W\204\f3/U\2053.U?\2053b)\204\211-4\204.\316\3170\203'+\202)\\210\202\211\3352;\203E\332\3332#\202M\334A@2\*\3362;\203e\332\3332#\202m\334A@2\*5\2116\203\2745\203\2746/V\204\2745/W\204\2746/U\203\232-\337\204\2745/U\203\317-\340\204\274-\341\203\3175b\210n\204\274m\204\317\316\3170\203\310+\202\312\\210\202@\342-\343\\203\344,\3452;\203\364\332\3332#\202\374\334A@2\**\2028\342-\344\\203\312,\2028\342-\346\\203!\347,\312*\2028\342-\350\\2032\351,\312*\2028\312\211,*5.6b\210*\202\211
 [org-called-with-limited-levels org-outline-regexp outline-regexp 
org-outline-regexp-bol parent prevs t org-get-limited-outline-regexp ^ 
outline-next-heading nil org-before-first-heading-p org-skip-whitespace 
line-beginning-position throw exit org-back-to-heading  \n 
beginning-of-line org-element-headline-parser org-element--current-element 
element :parent org-add-props plist-put :end get-text-property 0 plist-get 
:contents-begin :contents-end (plain-list table) (center-block drawer 
dynamic-block inlinetask property-drawer quote-block special-block) (item 
plain-list) eql plain-list item :structure property-drawer node-property table 
table-row struct trail special-flag type end origin keep-trail value ...] 10)
  org-element-at-point()
  org-table-begin(any)
  org-at-table\.el-p()
  org-element-table-parser(23 (5))
  org-element--current-element(23 element nil nil)
  byte-code(`\212\306\307 \211\310P\311 
\210,`)\312\211\211\211\211\211\211*+,-./\306\307 \211\310 P\313 
\203Teb\210\314 \210m\204L\315 /V\203\205\316\317\312\\210\202\205\320 
\210\312y\210\314 \210m\204i\315 /V\203\205\316\317\321\312x\210\322 
\2100\204~\323d\306\\202\203\323d\306\C\\210,\322 

Re: [O] ox-koma-letter.el: subtree vs buffer, precedence of properties, superscript transcoding

2015-06-23 Thread Myles English

Rasmus writes:

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

 Somehow, when you specify it as a property it's not detected
 as :inbuffer-signature.

 Fixed in b07bd32081db62725af12b185a786aa0d7f99bae. Thank you.

 Thanks for fixing this, Nicolas.

Yes, and thanks both of you for looking into this.

Myles




[O] ox-koma-letter.el: subtree vs buffer, precedence of properties, superscript transcoding

2015-06-22 Thread Myles English

Hello,

I have noticed some strange things about koma letter exports (current
git master 329683).

1) subtree scope export results differently than buffer scope export

2) a signature specified in the subtree property does not take
   precedence in subtree export

3) superscripts on the dates behave differently in the subject and
   date properties, i.e. 20\textsuperscript{th}  20^{th}

The files included below constitute a Fairly Small Working Example (a
FSWE) that illustrate those things.  Using those files, I start emacs
like this:

emacs -Q -l config.el a.org   # or b.org

Thanks,
Myles


The Files
-

1) a.org  Export like this: C-c C-e C-s k o   

* Letter
:PROPERTIES:
:EXPORT_LaTeX_CLASS: my-min-letter
:EXPORT_LCO: mylco
:EXPORT_TITLE:
:EXPORT_PLACE: Here
:EXPORT_SUBJECT: The thing that happened on 20\textsuperscript{th} June 2015
:EXPORT_DATE: June 20^{th} 2015
:EXPORT_TO_ADDRESS: Orgsters\\Internet
:EXPORT_OPENING: Dear Mr X,
:EXPORT_AUTHOR: Ronald Reagan
:EXPORT_CLOSING: Yours sincerely,
:EXPORT_SIGNATURE: This is the sig I want
:END:

The thing that happened was completely unacceptable.
SUBTREE EXPORT

2) b.org  Export like this: C-c C-e k o   

#+LaTeX_CLASS: my-min-letter
#+LCO: mylco
#+TITLE:
#+PLACE: Here
#+SUBJECT: The thing that happened on 20\textsuperscript{th} June 2015
#+DATE: June 20^{th} 2015
#+TO_ADDRESS: Orgsters\\Internet
#+OPENING: Dear Mr X,
#+AUTHOR: Ronald Reagan
#+CLOSING: Yours sincerely,
#+SIGNATURE: This is the sig I want

* Letter
The thing that happened was completely unacceptable.
WHOLE BUFFER EXPORT

3) config.el  

(add-to-list 'load-path
 ~/.emacs.d/plugins/org-mode/lisp)
(add-to-list 'load-path
 ~/.emacs.d/plugins/org-mode/contrib/lisp t)

(require 'ox-latex)
(global-set-key (kbd C-c C-e) 'org-export-dispatch)

(eval-after-load 'ox '(require 'ox-koma-letter))

(eval-after-load 'ox-koma-letter
  '(progn
 (add-to-list 'org-latex-classes
  '(my-min-letter
\\documentclass[foldmarks=false]\{scrlttr2\}
 \\usepackage[UKenglish]{babel}
 \[DEFAULT-PACKAGES]
 \[PACKAGES]
 \[EXTRA]))
 (setq org-koma-letter-default-class my-min-letter)
 ))

4) mylco.lco  

\setkomavar{fromname}{Name in LCO file}
\setkomavar{fromaddress}{My house\\My street}
\setkomavar{signature}{\usekomavar{fromname}}



Re: [O] allow italic quote marks? org-emphasis-regexp-components

2015-06-19 Thread Myles English


Rasmus writes:

 Marcin Borkowski mb...@mbork.pl writes:

 On 2015-06-18, at 18:02, Kaushal kaushal.m...@gmail.com wrote:

 A quick google search comes up this these:

 http://tex.stackexchange.com/questions/83440/inputenc-error-unicode-char-u8-not-set-up-for-use-with-latex
 http://tex.stackexchange.com/questions/4268/inputenc-error-unicode-char-u8-error-while-trying-to-write-a-degree-symbol

 Based on those solutions, may be you can add

 \DeclareUnicodeCharacter{200b}{}

 I haven't tried it, so cannot guarantee if that will work.

 Thanks, I'll check it in my Spare Time™.

 I use something like this:

   (defcustom rasmus/org-latex-unicode-to-tex  '(( ~)
   (  \\,)
   (​ ))
 list of re rep pairs which are replaced during latex export)
   
   (defun rasmus/org-latex-unicode-to-tex (text backend info)
 Replace unicode strings with their TeX equivalents.

 Currently:  '' (no break space) to '~'
 ' ' (thin space) to '\,'
 '​'  (zero width space) to ''.
 (when (org-export-derived-backend-p backend 'latex)
   (cl-loop for (re rep) in rasmus/org-latex-unicode-to-tex do
(setq text (replace-regexp-in-string re rep text t t)))
   text))
   
   (add-to-list 'org-export-filter-final-output-functions
'rasmus/org-latex-unicode-to-tex)

Thanks, I am using this now.

Myles



Re: [O] allow italic quote marks? org-emphasis-regexp-components

2015-06-18 Thread Myles English

Marcin Borkowski writes:

 On 2015-06-18, at 05:19, Kaushal kaushal.m...@gmail.com wrote:

 The solution is simpler than you think; you simply need to add ZERO WIDTH
 SPACE unicode char between / and  (beginning) and  and / (end).

Thanks for your detailed answer Kaushal.  I hadn't heard of a 'zero
length space' before.

 Won't it break the LaTeX export?

I seems to work and manages to produce a pdf but does give this error:

! Package inputenc Error: Unicode char \u8:​ not set up for use with LaTeX.

Myles



[O] allow italic quote marks? org-emphasis-regexp-components

2015-06-15 Thread Myles English
Hello,

Can anyone tell me what to set org-emphasis-regexp-components to in
order to allow italic quote marks?

i.e. /like this/

I don't understand the documentation and am just not in the mood to
spend the next hour or so working it out.  (That is a rule of thumb for
me; if it involves a regular expression, it will take at least an hour,
and three cups of tea.)

Thanks,
Myles




Re: [O] Cannot get capture to work on Emacs 24.3.1 - Org itself does work

2015-06-12 Thread Myles English

Hello George,

George Taylor writes:

 I cannot get Capture to work.

 Summary:
 I have successfully installed and used emacs on my laptop, and am happily 
 using Org mode.
 I cannot get Capture to work. I have edited my .emacs file, but I am getting 
 an error when starting emacs, and C-c c does not work.

 Detail:
 I have installed 

 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-17 on MARVIN on my laptop running 
 Windows XP (Japanese).

 Org-mode works.

 I edited my .emacs file per 
 .../manual/Setting-up-capture.html#Setting-up-capture
 by adding

try this here, before the setq for org-default-notes-file below:

(setq org-directory c:/home/yadda/yadda)

or if you have already started emacs you can put the cursor after the
last bracket and hold down Ctl and press x then e to evaluate it.  Then
do the same for the line below that sets org-default-notes-file.  You
can check if the variable has been set properly by pressing Ctl-h v
then typing org-directory.

Myles

 (setq org-default-notes-file (concat org-directory /notes.org))
  (define-key global-map \C-cc 'org-capture)

 Now, when I start emacs normally, I get the warning:

 ...: An error occurred while loading `c:/home/.emacs':

 Symbol's value as variable is void: org-directory

 To ensure normal operation...

 I restarted emacs by running 

 runemacs.exe --debug-init

 and got the foolowing Backtrace:

 Debugger entered--Lisp error: (void-variable org-directory)
   (concat org-directory /notes.org)
   (setq org-default-notes-file (concat org-directory /notes.org))
   eval-buffer(#buffer  *load* nil c:/home/.emacs nil t)  ; Reading at 
 buffer position 1168
   load-with-code-conversion(c:/home/.emacs c:/home/.emacs t t)
   load(~/.emacs t t)
   #[0 \205\262 (and a lot of other code conversions that don't seem to copy 
 and paste)

 I have referred to the org manual, and read the FAQ. I do not see this 
 problem addressed. I hope you can help me.

 Why is the variable org-directory void?
 Do I need to edit some file other than .emacs?
 Is there something else I should do?




Re: [O] custom agenda on TODO keywords and catagory

2015-06-12 Thread Myles English

Hello Xebar,

Xebar Saram writes:

 im trying to create a custom agenda based on TODO keywords and category but
 with no success. i have this code block

 (z Office block agenda todo TODO|BGU|EXP
  (
   (tags-todo  CATEGORY=\work\)
   ))


 this does work but shows the 3 todo types from all agenda files and not
 just agenda files that have the #+CATEGORY: work on top

 any clue what im missing here?

I think you are mixing up the two ways of using the variable.  From the
help (view it by doing C-h v org-agenda-custom-commands) the two ways
are:

(key desc type match settings files)

(key desc (cmd1 cmd2 ...) general-settings-for-whole-set files)

Therefore, I think if you are aiming for the first version you would use
tags-todo in place of todo and merge the category clause into the todo
keyword clause and it should give you what you want.

Myles



Re: [O] Portable way to insert and display images in an org entry ?

2015-04-21 Thread Myles English

Hello Xavier,

Xavier writes:
 I use org-mode on many different OS (cygwin, OSX, GNU/linux), as such, I
 have problems when I want to include a link of the 'file:' family.

 Last example, I wanted to include a picture from my Dropbox into my org
 file which is ok. But, C-c C-x C-v can't do anything good on my cygwin
 installation since the link is:

 [[file:Captures d'écran/20150421-SOAINFRA-saturation.png][Illustration
 de la saturation du TBS I7_SOAINFRA_AA_DATA01]]

 What can be a good alternative ? Add my file as an attachment and link
 from it ? (is it even possible ?)

If you want to try that last idea, the syntax for the link is:

[[att:20150421-SOAINFRA-saturation.png]]

Myles



Re: [O] [bug] Effort and column view

2015-04-01 Thread Myles English

Hello,

Nicolas Goaziou writes:

 Myles English writes:

 Hello,

 I reported a possible bug a couple of weeks ago and since then I have
 notice related bugs in todays HEAD (that may have existed before).

I haven't reviewed that situation.

My original 'bug' was reported here:

 http://article.gmane.org/gmane.emacs.orgmode/93312/match=myles

 1) The column view of TODO items only shows the total Effort at the
 top and the Effort for the last item,

 2) The column view of the org-agenda (restricted to current buffer with
 '', get list of todos with 't') only shows the Effort for the last item
 and the total Effort at the top shows the same value as for the last
 item

 3) Narrowing by tag (the original possible bug reported) shows similar
 behaviour as above

 I saw the bug report, but didn't find time to investigate yet. Could you
 git bisect in order to know if some commit changed that recently?

This is now an old issue but I just did a little investigation and it is
likely that it has always worked this way, so is probably more of a
feature request than a bug.

I tried versions 8.2 and 8.2.9 and they both have the same behaviour.

I may have a look (in the next few months) to see if I can make it work
the way I would like.

Myles



[O] eval header arguments for ledger :cmdline?

2015-01-08 Thread Myles English
Hello,

Can anybody tell me how this could be achieved, please?

I would like to use parameters for ledger[1] source code blocks, and
understand that the :cmdline header argument means pass this straight
through to the command line, but effectively what I would like to do is
this:

#+PROPERTY: header-args :var ACC_PERIOD=-b 2013-04-06 -e 2014-04-06 
BAT_FILE=myledger.bat

#+begin_src ledger :cmdline bal ACC_PERIOD -f BAT_FILE

#+end_src

Is something like this currently possible or does it need further
development of ob-ledger.el?  Any volunteers||collaborators?

Myles



[1] http://www.ledger-cli.org/



Re: [O] Agenda capture possible to specific headlines?

2015-01-07 Thread Myles English

Hell Jay,

Jay Iyer writes:

 Is there a way to capture tasks/notes to a *specific headline* from the
 agenda buffer?  I use the k command to invoke capture templates, and it
 would be super helpful/efficient to create additional sub-headlines to a
 headline presented in the agenda buffer.

You can use the file+headline
thing like this:

(setq org-capture-templates (quote (
(t Groovy tune entry (file+headline (concat org-directory 
/journal.org) Tunes) * Tune: %? \n)
;; more templates here
)))

I don't know how to choose the target headline interactively however.

Myles




[O] [bug] Effort and column view

2014-12-22 Thread Myles English

I am sending this again because it doesn't show up on Gmane.

Myles English writes:

 Hello,

 I reported a possible bug a couple of weeks ago and since then I have
 notice related bugs in todays HEAD (that may have existed before).

That bug was reported here:
http://article.gmane.org/gmane.emacs.orgmode/93312/match=myles

 1) The column view of TODO items only shows the total Effort at the
 top and the Effort for the last item,

 2) The column view of the org-agenda (restricted to current buffer with
 '', get list of todos with 't') only shows the Effort for the last item
 and the total Effort at the top shows the same value as for the last
 item

 3) Narrowing by tag (the original possible bug reported) shows similar
 behaviour as above

 Myles




[O] [bug] Effort and column view

2014-12-17 Thread Myles English
Hello,

I reported a possible bug a couple of weeks ago and since then I have
notice related bugs in todays HEAD (that may have existed before).

1) The column view of TODO items only shows the total Effort at the
top and the Effort for the last item,

2) The column view of the org-agenda (restricted to current buffer with
'', get list of todos with 't') only shows the Effort for the last item
and the total Effort at the top shows the same value as for the last
item

3) Narrowing by tag (the original possible bug reported) shows similar
behaviour as above

Myles






Re: [O] CLOCKSUM counts appointments excluded by tag

2014-12-09 Thread Myles English
I made a mistake in my first mail: the totals are for the Effort property
not CLOCKSUM.

Can no one confirm this?  Is there something else wrong with my post?  The
situation is the same after pulling from master today.


On 4 December 2014 at 22:58, Myles English mylesengl...@gmail.com wrote:

 Hello,

 I am using git master from yesterday (commit 6d2a661f) and have found
 that when the agenda is narrowed by tag (i.e. all appointments marked
 with a certain tag are excluded), the clocksum still shows the
 un-narrowed total.  Is this the correct behaviour, or a bug?

 Selected variables:

 org-agenda-columns-add-appointments-to-effort-sum is t
 org-columns-default-format:
 %80ITEM(Task) %10Effort(Effort){:} %10Duration(Duration){:} %10CLOCKSUM

 org-global-properties:
 ((Effort_ALL . 0:00 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00
 16:00 24:00 32:00))

 Test org file:


 ;;,--
 ;;| * Nail org mode bug
 ;;|   SCHEDULED: 2014-12-04 Thu 9:00-10:00
 ;;|
 ;;| * Earn money
  :spouse:
 ;;|   SCHEDULED: 2014-12-04 Thu 09:00-20:00
 ;;|
 ;;| * Drink tea
 ;;|   SCHEDULED: 2014-12-04 Thu 10:00-16:00

 ;;`--


 C-c a  a   ;; get the agenda for the current test file
 C-c C-x C-c ;; turn on column view

 ;;,--
 ;;| Thursday4 December 2014 | 18:00 |
 ;;|8:00.. 
 ;;| * Nail org mode bug | 1:00  |
 ;;| * Earn money| 11:00 |
 ;;| * Drink tea | 6:00  |
 ;;`--


 / - TAB 'spouse' ;; narrow by excluding the item tagged 'spouse'

 See how the 18:00 has counted the 11:00 that should have been excluded:

 ;;,--
 ;;| Thursday4 December 2014 | 18:00 |
 ;;|8:00.. 
 ;;| * Nail org mode bug | 1:00  |
 ;;| * Drink tea | 6:00  |
 ;;`--

 I would have expected something this:

 ;;,-
 ;;| Thursday4 December 2014 | 7:00 |
 ;;|8:00.. 
 ;;| * Nail org mode bug | 1:00 |
 ;;| * Drink tea | 6:00 |
 ;;`-

 and am therefore disappointed.

 I haven't investigated if this happens for simple clocked time as well
 as appointments yet.

 Myles

 P.S. Sorry for the ugly boxes, I can't remember how to get the nice
 ones.




Re: [O] CLOCKSUM counts appointments excluded by tag

2014-12-09 Thread Myles English
On 9 December 2014 at 21:35, Myles English mylesengl...@gmail.com wrote:

 I made a mistake in my first mail: the totals are for the Effort property
 not CLOCKSUM.

 Can no one confirm this?  Is there something else wrong with my post?  The
 situation is the same after pulling from master today.


 On 4 December 2014 at 22:58, Myles English mylesengl...@gmail.com wrote:

 Hello,

 I am using git master from yesterday (commit 6d2a661f) and have found
 that when the agenda is narrowed by tag (i.e. all appointments marked
 with a certain tag are excluded), the clocksum still shows the
 un-narrowed total.  Is this the correct behaviour, or a bug?

 Selected variables:

 org-agenda-columns-add-appointments-to-effort-sum is t
 org-columns-default-format:
 %80ITEM(Task) %10Effort(Effort){:} %10Duration(Duration){:} %10CLOCKSUM

 org-global-properties:
 ((Effort_ALL . 0:00 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00
 16:00 24:00 32:00))

 Test org file:


 ;;,--
 ;;| * Nail org mode bug
 ;;|   SCHEDULED: 2014-12-04 Thu 9:00-10:00
 ;;|
 ;;| * Earn money
  :spouse:
 ;;|   SCHEDULED: 2014-12-04 Thu 09:00-20:00
 ;;|
 ;;| * Drink tea
 ;;|   SCHEDULED: 2014-12-04 Thu 10:00-16:00

 ;;`--


 C-c a  a   ;; get the agenda for the current test file
 C-c C-x C-c ;; turn on column view

 ;;,--
 ;;| Thursday4 December 2014 | 18:00 |
 ;;|8:00.. 
 ;;| * Nail org mode bug | 1:00  |
 ;;| * Earn money| 11:00 |
 ;;| * Drink tea | 6:00  |
 ;;`--


 / - TAB 'spouse' ;; narrow by excluding the item tagged 'spouse'

 See how the 18:00 has counted the 11:00 that should have been excluded:

 ;;,--
 ;;| Thursday4 December 2014 | 18:00 |
 ;;|8:00.. 
 ;;| * Nail org mode bug | 1:00  |
 ;;| * Drink tea | 6:00  |
 ;;`--

 I would have expected something this:

 ;;,-
 ;;| Thursday4 December 2014 | 7:00 |
 ;;|8:00.. 
 ;;| * Nail org mode bug | 1:00 |
 ;;| * Drink tea | 6:00 |
 ;;`-

 and am therefore disappointed.

 I haven't investigated if this happens for simple clocked time as well
 as appointments yet.


Yes, I can see similar behaviour for clocked tasks.  That is to say, with
this file contents:

#+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort){:} %CLOCKSUM
* TODO Earn money
  :PROPERTIES:
  :Effort:   0:10
  :END:

* TODO Drink tea  :a:
  :PROPERTIES:
  :Effort:   0:30
  :END:

#start emacs
$ emacs -Q

M-x org-agenda
 ;; narrow to current buffer
t   ;; see all TODOs
C-c C-x C-c  ;; see column view
/  - TAB a ;; exclude the item tagged :a:

And the result looks something like this:

Task   | Estimated
Effort

Global list of TODO items of type: ALL
Available with `N r': (0)[ALL] (1)TODO   | 0:40
  TODO Earn money  | 0:10


Myles


[O] CLOCKSUM counts appointments excluded by tag

2014-12-04 Thread Myles English
Hello,

I am using git master from yesterday (commit 6d2a661f) and have found
that when the agenda is narrowed by tag (i.e. all appointments marked
with a certain tag are excluded), the clocksum still shows the
un-narrowed total.  Is this the correct behaviour, or a bug?

Selected variables:

org-agenda-columns-add-appointments-to-effort-sum is t
org-columns-default-format:
%80ITEM(Task) %10Effort(Effort){:} %10Duration(Duration){:} %10CLOCKSUM

org-global-properties:
((Effort_ALL . 0:00 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00 16:00 
24:00 32:00))

Test org file:

;;,--
;;| * Nail org mode bug 
 
;;|   SCHEDULED: 2014-12-04 Thu 9:00-10:00
 
;;| 
 
;;| * Earn money 
:spouse:
;;|   SCHEDULED: 2014-12-04 Thu 09:00-20:00   
 
;;| 
 
;;| * Drink tea 
 
;;|   SCHEDULED: 2014-12-04 Thu 10:00-16:00   
 
;;`--


C-c a  a   ;; get the agenda for the current test file
C-c C-x C-c ;; turn on column view

;;,--
;;| Thursday4 December 2014 | 18:00 |
;;|8:00..    
;;| * Nail org mode bug | 1:00  |
;;| * Earn money| 11:00 |
;;| * Drink tea | 6:00  |
;;`--


/ - TAB 'spouse' ;; narrow by excluding the item tagged 'spouse'

See how the 18:00 has counted the 11:00 that should have been excluded:

;;,--
;;| Thursday4 December 2014 | 18:00 |
;;|8:00..    
;;| * Nail org mode bug | 1:00  |
;;| * Drink tea | 6:00  |
;;`--

I would have expected something this:

;;,-
;;| Thursday4 December 2014 | 7:00 |
;;|8:00..    
;;| * Nail org mode bug | 1:00 |
;;| * Drink tea | 6:00 |
;;`-

and am therefore disappointed.

I haven't investigated if this happens for simple clocked time as well
as appointments yet.

Myles

P.S. Sorry for the ugly boxes, I can't remember how to get the nice
ones.




Re: [O] Executing org shell blocks on remote machine over ssh

2014-11-17 Thread Myles English

Hi Dave,

David Bjergaard writes:

 Hi All,

 I'm sorry if this has been covered before, I've been searching for a
 while and haven't found anything.

 I use org mode as a lab notebook.  I write org-src blocks to keep track
 of tasks I do at the command line, and then I copy paste them into the
 terminal.  I would really like to hit C-c C-c on the source block and
 have it executed on the remote machine.  I know that you can specify
 the remote machine according to [1], however the software I use requires
 a fairly complicated setup to get going.  

 Ideally what I would have is my org-src blocks and another window with
 the ssh terminal open.  Then hitting C-c C-c would execute the block
 over a shared ssh connection and I could see the results in the other
 window (quasi-interactively).  Is that possible?

 Thanks for your time!

 Dave

 Footnotes: 
 [1]  
 http://home.fnal.gov/~neilsen/notebook/orgExamples/org-examples.html#sec-16

I had a quick go at this but get tramp errors.  I think you need a
terminal multiplexer e.g. tmux or screen.

In a terminal, connect using ssh (or mosh) then type 'tmux' to start a
new session or 'tmux attach' to attach to an existing one.

I would have thought that this should have worked, i.e. that the output
would have showed up in the terminal and in the buffer:

#+BEGIN_SRC sh  :prologue tmux attach :dir /my...@myhost.biz
echo $PWD
echo $HOSTNAME
#+END_SRC

Hope this is on the right track..

Myles



Re: [O] CV in orgmode for export to pdf (and html?)

2014-09-22 Thread Myles English


Myles English writes:

 Nicolas Goaziou writes:

 One option could be to define a specialized latex back-end dedicated to
 moderncv class, much like ox-koma-letter.el does for scrlttr2.

 I did actually make a start on this, I'll dig it out and put it
 somewhere accessible, soon.

..and here it is:

https://github.com/mylese/ox-cv

It kind of works, I haven't tried it with org more recent than about
July.  I'll be trying to develop it further myself but would welcome a
lot of input from others.  Alternatively, if someone wants to take it
over completely, that would be fine too.

Myles



Re: [O] CV in orgmode for export to pdf (and html?)

2014-09-21 Thread Myles English

Hello,

Nicolas Goaziou writes:

 Brady Trainor algeb...@uw.edu writes:

 And I did have a decent export to LaTeX resume from org, but after 
 discovering moderncv, I've switched, though I will be curious to read 
 others' methods of org-to-moderncv export.

 One option could be to define a specialized latex back-end dedicated to
 moderncv class, much like ox-koma-letter.el does for scrlttr2.

I did actually make a start on this, I'll dig it out and put it
somewhere accessible, soon.

Myles



[O] how to print org-element of type paragraph as a string?

2013-12-09 Thread Myles English
Hello,

This should be an easy question for someone.  Given the org file
content below, how would you get the result or the source block to be
here are the contents?

Thanks,
Myles

* heading
here are the contents

#+begin_src elisp :results output
(dolist
  (job (org-element-map (org-element-parse-buffer) 'paragraph 'identity))
(print (car (org-element-contents job
#+end_src

#+RESULTS:
:
: #(here are the contents
:  0 22 (:parent (paragraph (:begin 11 :end 34 :contents-begin 11
:contents-end 33 :post-blank 1 :post-affiliated 11 :parent (section
(:begin 11 :end 225 :contents-begin 11 :contents-end 224 :post-blank 1
:parent (headline (:raw-value heading :begin 1 :end 225 :pre-blank 0
:contents-begin 11 :contents-end 224 :level 1 :priority nil :tags nil
:todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil
:archivedp nil :commentedp nil :quotedp nil :CATEGORY nil :title
(#(heading 0 7 (:parent #6))) :parent (org-data nil #6)) #4)) #2
(src-block (:language elisp :switches nil :parameters :results
output :begin 34 :end 207 :number-lines nil :preserve-indent nil
:retain-labels t :use-labels t :label-fmt nil :value (dolist
:   (job (org-element-map (org-element-parse-buffer) 'paragraph 'identity))
: (print (car (org-element-contents job
:  :post-blank 1 :post-affiliated 34 :parent #4)) (fixed-width
(:begin 207 :end 224 :value nil
:  :post-blank 0 :post-affiliated 218 :results () :parent #4 #0)))



Re: [O] Anniversaries from BBDB available to calendar and diary?

2013-11-27 Thread Myles English

Hi Joseph,

j...@ftfl.ca writes:

 It makes sense to put birthdays and other anniversaries in BBDB as
 described in section 10.3.1 of the Org manual.

I wonder, did you look at the section of 10.3.1 titled Anniversaries
from BBDB?

 Why repeat information by putting it in the diary when you already
 have a contact entry in BBDB for the person? The only problem with
 this is that the anniversaries aren't marked in the calendar and don't
 show up the diary.  Is there away to make the calendar/diary aware of
 anniversaries in BBDB?

Myles





Re: [O] Org-mode issue with cyclic tasks and checkboxes

2013-11-27 Thread Myles English

Hi Borja,

I can't see that you have received a reply yet, which is unusual for
this excellent list.

borja.tarr...@gmail.com writes:

 I am working with cyclic or repetitive tasks in org-mode, inside this task,
 I have several checkboxes. So when I finished all the list, normally I put
 the task as done, and new task with sublist of checkboxes is created for
 the next cycle, however, those checkboxes appears as ticked and I think
 should be unticked as it is new cycle task, e.g.:

 * TODO Cyclic monthly home [0/5]
 SCHEDULED: 2013-11-30 Sat +1m
  - [ ] pay sauna
  - [ ] pay electricity
  - [ ] pay renting
  - [ ] pay internet
  - [ ] pay union

 Once I ticked all of them and put it as done, this is what I can see:

 * WIP Cyclic monthly home [5/5]
 SCHEDULED: 2014-01-30 Thu +1m
 - State DONE   from WIP[2013-11-06 Wed 20:49]
 :PROPERTIES:
 :LAST_REPEAT: [2013-11-06 Wed 20:49]
 :END:
  - [X] pay sauna --- this should be unticked
  - [X] pay electricity -- this should be unticked
  - [X] pay renting -- this should be unticked
  - [X] pay internet -- this should be unticked
  - [X] pay union -- this should be unticked

 Am I missing something? or is some bug that should be fixed?

May be use this:

;; uncheck tick boxes ---
(require 'org-checklist)
(defun my-uncheck-ticks()
Uncheck tick boxes in the TODO item when state is changed to DONE
( when (and (string= org-state DONE)
(org-get-repeat))
  (org-reset-checkbox-state-subtree)))

(add-hook 'org-after-todo-state-change-hook
  'my-uncheck-ticks)

 I am using those versions:

 Emacs version:
 GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2013-08-30 on apocalipsis

 Org-mode version:
 Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @
 /usr/local/share/emacs/24.3/lisp/org/)

Org 8 is out, may be time to upgrade?

Myles



Re: [O] links to attachments don't export anymore

2013-11-19 Thread Myles English

Nicolas,

 · Nicolas Goaziou n.goaz...@gmail.com wrote:


 Done for `org-entry-properties'. The regression should be fixed now.

 Thank you for the report.

Thanks very much, I'll test it soon.

Myles



[O] links to attachments don't export anymore

2013-11-12 Thread Myles English
Hi,

This used to work, back in August but I just updated today and Something
Has Changed.

After setting this option:

(setq org-link-abbrev-alist '((att . org-attach-expand-link)))

It was possible to insert a link to an attachment like this:

[[att:FigureA.jpg]]

and clicking on it would show the file (still works), and it would show
up in the exported document (no longer happens).

Inspecting the output shows that the link is wrong:

/home/myles/myorg/FigureA.jpg

When it should be:

/home/myles/myorg/data/ad/c7f168-33bb-4e38-83fa-6aea6708563b/FigureA.jpg

Can anyone tell me how to get the link exported correctly?  (And why has
the indenting of this email gone weird?)

Thanks,

Myles



Re: [O] Org-mode and continuing BBDB compatibility

2013-10-21 Thread Myles English

Hi Christopher,

crcul...@christopherculver.com writes:

 I am using org-mode version 20131021 and the latest checkout of the
 bbdb3 git repository.

I am using older versions.

 Although I have the following lines in my main .org file:

 * Anniversaries
:PROPERTIES:
:CATEGORY: Anniv
:END:
   %%(org-bbdb-anniversaries)

 I do not see anniversaries from my .bbdb file in the agenda. I know that
 some work was done in the past with making org-mode compatible with
 bbdb3, but are the two projects no longer compatible, or do I probably
 have some other problem on my end?

I think you might need:

(setq org-bbdb-anniversary-field 'birthday)

or 

(setq org-bbdb-anniversary-field 'anniversary)

depending on what you called the anniversary field.

If you work out how to display birthdays and anniversaries in the same
agenda please share.

Myles



Re: [O] timeline of tags

2013-10-14 Thread Myles English

Hi David,

da...@belohrad.ch writes:

 Dear All,

 could someone help me with following problem?

 - have multiple org files, where I tag by names, e.g. @Erik

 - I want to construct a timeline of all items having this tag through
   all the org files (as @Erik can be dispersed everywhere)

 Example:

 I use tag @Erik to note at which times my son has school holidays. Hence
 one such entry would be e.g.:

 ** TODO erik autumn holidays:@Erik:
:PROPERTIES:
:ID:   26f5503f-3db6-481a-b384-395625e39333
:END:
 2013-10-17 Thu--2013-10-27 Sun

 there are many entries like this. Now, my wife asks me: I wonder when
 Erik has holidays.

 I enter org-agenda, press 'm', type @Erik and voila - I get list of his
 holidays (and other stuff). 

 Trouble is, that this list does not show it in timeline, but only
 headings without these dates. Hence to get each datum I have to _open_
 the item, which is not desired. 

 Any hint how to solve it?

This is how I do something similar.  Essentially you treat an
event/appointment differently to a task (TODO) and store it in the diary
file (with the help of a capture template) so it looks like this:

* 2013
** 2013-05-30 Thursday
 Might go fishing:event:
2013-06-22 Sat--2013-06-23 Sun [2013-05-30 Thu 23:57]


and in the init file you have this:


;; not sure which of these are necessary:
(setq org-agenda-include-diary t)
(setq org-agenda-diary-file ~/org/org/diary.org)

;; so any time strings in the heading are shown in the agenda
(setq org-agenda-insert-diary-extract-time t)

(setq org-capture-templates (quote (
(a   - Appointment (compulsory) entry
 (file+datetree (concat org-directory /diary.org)) * %? 
:appt:\n%^T %U %a)
(e   - Event (optional) entry
 (file+datetree (concat org-directory /diary.org)) * %? 
:event:\n%^T %U %a

(setq org-agenda-custom-commands
  (quote ((v Events agenda 
   ((org-agenda-span 28)
(org-agenda-files '((concat org-directory /diary.org)


If your diary.org has at the top:

#+FILETAGS: diary


Then a C-a v gives you:

Wednesday  19 June 2013
Thursday   20 June 2013
Friday 21 June 2013
  Diary:   6:03.. Summer Solstice (BST)
Saturday   22 June 2013
  diary:  (1/2):  Might go fishing   :diary::event:
Sunday 23 June 2013
  diary:  (2/2):  Might go fishing   :diary::event:
Monday 24 June 2013 W26
Tuesday25 June 2013
Wednesday  26 June 2013

Myles



Re: [O] Time remaining report, anyone done it?

2013-10-08 Thread Myles English


Samuel/Konubinix,

konubi...@gmail.com writes:

 For what I can understand by tracing the CLOCKSUM property usage (grep
 'CLOCKSUM' being a starting point), it seems to be doable by modifying
 the org-columns and org-agenda-colview-compute defuns to set a text
 property like org-clock-sum does with :org-clock-minutes. Then, the
 defun org-dblock-write:clocktable should be edited to use that property.

 Hope that helps.

Thanks, it does help to have a fresh starting points.

I completely forgot that I already wrote about my progress in this
venture, a year ago:

http://lists.gnu.org/archive/html/emacs-orgmode/2012-10/msg00245.html

May be this time I will nail it.  Problem is I get it mostly working,
use it a few times, then don't use it for a while and org moves on.

Myles



Re: [O] capture, attach, link files from web

2013-10-08 Thread Myles English

e...@...net writes:

 I've often thought it would be nice to link to images in an org file
 with http: links, then at some arbitrary point in time call a
 hypothetical org-localize-external-resources command. That command would
 wget all the external resources, put them somewhere local, and switch
 the links to the file: type. Just a thought.

How about a derived export backend with a filter that does a wget and
rewrites the links?

One problem could be what if a wget fails?  As I am finding with my
implementation, some websites only allow browserlike access.

Myles



Re: [O] capture, attach, link files from web

2013-10-08 Thread Myles English

Hi Oleh,

ohwoeowho writes:

 I counter your tip with my own on capturing pdfs.
 Maybe you'll find some of this stuff useful for your case.

My use case is slightly different: I am looking for pictures and want to
insert a picture right here to show up in the exported document, and I
have a different solution to the use case you describe, but thanks, it
is useful to see how to attach files via capture templates.

I get almost the same result as you but get there in a different way;
using zotero as the capture mechanism, exporting from zotero to a bibtex
file[1], hacking reftex[2] to supply a file path and then end up with a
nice TODO with a clickable link in the properties to open the pdf.

* \cite{gawin_simulation_2009} - Simulation of Cavitation in Water Saturated 
Porous Media Considering Effects of Dissolved Air
:PROPERTIES:
:Created: 2013-03-05 Tue 14:13
:Custom_ID: gawin_simulation_2009
:file: 
[[library:/home/myles/.mozilla/firefox/5p1jxjph.default/zotero/storage/4RTT5M3F/Gawin%20and%20Sanavia%20-%20Simulation%20of%20Cavitation%20in%20Water%20Saturated%20Porous.pdf][file]]
:bib: [[bib:gawin_simulation_2009][bib]]
:END:

The only pain is that I have to patch reftex-cite.el every time it is
overwritten as I can't get my patch accepted due to a dead project.

Myles


Footnotes: 
[1]  http://lists.gnu.org/archive/html/emacs-orgmode/2012-06/msg00503.html

[2]  http://lists.gnu.org/archive/html/auctex-devel/2012-06/msg2.html



Re: [O] Makefile to export to html/pdf using emacsclient

2013-10-08 Thread Myles English

Hi Xavier,

I am not an expert but perhaps my reply will do until someone more
knowledgeable comes along.

garr...@lal.in2p3.fr writes:

 Dear orgers,

 Sometimes ago Eric Schulte posted a Makefile to run the exporter in a 
 asynchronous way (see 
 http://lists.gnu.org/archive/html/emacs-orgmode/2012-11/msg00788.html). 
 I am wondering if it is possible to use =emacsclient= in order not to 
 load any special init file but the current emacs settings. I have tried 
 to setup something like that

 emacsclient -n --eval '(org-beamer-export-to-pdf)' talk.org

 but then I get stuck inside my current emacs frame waiting for an output 
 file. Can someone helps me on this issue. Maybe the solution is trivial 
 and I'm too noob to catch it.

I think your command tells emacsclient to open talk.org.

You could try this:

emacs -Q --batch -l my-config.el --eval \
  '(progn (find-file talk.org)(org-beamer-export-to-pdf))'

Where my-config.el sets load paths and loads all the things it needs
(e.g. org-mode).  If you don't load a config file you need to specify
everything in the --eval option.  For example here is what I have been
using, (it has extra escape characters (i.e. \\) and no line
continuations because it was read from a file):

emacs -Q --batch --eval \(progn
  (add-to-list 'load-path
 (expand-file-name 
\\~/.emacs.d/plugins/org-mode/lisp/\\))
   (add-to-list 'load-path
  (expand-file-name 
\\~/.emacs.d/plugins/org-mode/contrib/lisp/\\ t))
  (require 'org)
   (require 'ox)
  (require 'org-exp)
   (require 'org-inlinetask)
  (require 'ob-plantuml)
   (setq org-plantuml-jar-path 
\\/home/myles/Downloads/plantuml.jar\\)
   (org-babel-do-load-languages
'org-babel-load-languages
  '((emacs-lisp . t)
  (sh . t)
  (plantuml . t)))
   (setq org-confirm-babel-evaluate nil)
   (setq org-latex-listings 'minted)
  (setq org-latex-with-hyperref nil)
 (add-to-list 'org-latex-packages-alist '(
 \\minted\\))
(add-to-list 'org-latex-classes 
'(\\mynewthesis\\ documentclass[11pt]{mythesis}\\
 (chapter{%s}\\ . chapter*{%s}\\)
 (section{%s}\\ . section*{%s}\\)
 (subsection{%s}\\ . subsection*{%s}\\)
 (subsubsection{%s}\\ . subsubsection*{%s}\\)
 (paragraph{%s}\\ . paragraph*{%s}\\)))
 (setq org-export-with-todo-keywords nil)
 (load-library \\/home/myles/lib/lisp/my-export.el\\)
 (add-to-list 'org-export-before-parsing-hook 
'my-export-delete-headlines-tagged-noheading)
 (add-to-list 'org-export-filter-link-functions 
'my-autoref-filter-link-func)
  (load-file \\thesis.el\\)
  (find-file \\${CMAKE_CURRENT_BINARY_DIR}/mainThesis.org\\)
  (org-latex-export-to-latex))\

Myles



[O] Time remaining report, anyone done it?

2013-10-07 Thread Myles English

Hello all,

I have a bit of time now so I am dusting off a slightly buggy way of
finding out how much time is remaining on a project.  The basic idea is
that:

:Effort: - [total clocked time] = [time remaining before completion]

The ultimate aim is to get a time remaining report, similar to a clocked
time report.

Before I get too stuck in I thought I would ask: Has anyone already done
this or thought about a good way to do it (I really hope so)?

Myles



[O] capture, attach, link files from web

2013-10-07 Thread Myles English

Hello,

Just thought I would share something I find useful.  What the code below
does is:

1) prompts for a link to a file on the internet
2) downloads the file
3) attaches the file to the current subtree
4) inserts at the current point a link to the attachment

This is useful if (e.g.) you are scouring Google images for ideas and
want to save lots of image files.

Requirements: wget, set $TMPDIR.
TODO: integrate properly with capture template

#+here_is_some elisp
(setq org-link-abbrev-alist '((att . org-attach-expand-link)))

(defun my-attach-and-link-web-file (lnk)
  Download a file, attach it to our heading, insert a link
  (interactive *sAttach and link to url: \n)
  (let ((tmpdir (expand-file-name (getenv TMPDIR)))
(fname (file-name-nondirectory lnk)))
(progn (message (concat Downloading  lnk  to  tmpdir / fname))
   (call-process wget nil '(*Messages* t) nil -P
 tmpdir -d
 lnk)
   (org-attach-attach (concat tmpdir / fname) nil 'mv)
   (insert (concat [[att: fname ]])

(define-key global-map \C-cs 'my-attach-and-link-web-file)
#+that_was_elisp

Myles



Re: [O] capture, attach, link files from web

2013-10-07 Thread Myles English

Hi Eric,

I am glad you like it.

e...@ericabrahamsen.net writes:

[..]

 Rather than sending downloaded files to $TMPDIR, it might be nice to
 have them just use whatever dir org-attach would have used. I use
 org-attach from time to time, and notice that everything ends up under
 ~/org/data/. I haven't actually investigated why that happens (I've got
 org-directory set to ~/org/), mostly because it strikes me as a fine
 default. When we've got that directory, setting a different TMPDIR seems
 unnecessary. I'll admit part of my hesitation comes from the fact that
 TMPDIR sounds like it's going to get automatically deleted at some
 point.

The $TMPDIR was just an environment variable I had set already so
assumed it was semi-standard (doesn't everyone have a $TMPDIR?).  When
my function calls:

(org-attach-attach (concat tmpdir / fname) nil 'mv)

it moves the file from $TMPDIR to the attachment directory, amongst
other things no doubt.

The attachment directory is decided by the (org-attach-dir) function and
I presume the new file could be downloaded straight there and then the
task/heading would have to be synchronised with it's attachments to get
the new file to show up in the heading's properties.

 I've often thought it would be nice to link to images in an org file
 with http: links, then at some arbitrary point in time call a
 hypothetical org-localize-external-resources command. That command would
 wget all the external resources, put them somewhere local, and switch
 the links to the file: type. Just a thought.

Good idea.  I look forward to your clever implementation with proper
indenting and informative comments.

 Regardless, thanks for posting this. It's fun to see other people
 thinking in familiar directions.

I agree, it is nice to supplement the daily diet of bug reports, help
requests, have you tried emacs -Q etc.

Myles



Re: [O] multiple indirect buffers, and limiting to a drawer

2013-10-01 Thread Myles English

Hi Matt,

mopto...@gmail.com writes:

 I am returning to my long-languishing idea of an org writer's room
 (https://github.com/titaniumbones/org-writers-room , see also gmail
 archives for a brief discussion about a year ago).  Coming to terms
 with some of my own coding limitations(!), I want to keep this
 relatively simple -- just a 3-paneled interface that shows

 (1) in a narrow window on the left, an outline of the whole org-file,
 which I take to represent a major writing project

 (2) in the main window, a heading element in an indirect buffer


 (3) in the right-hand panel, I'd like  to just show the properties
 drawer of the currently active heading.


 Can someone suggest the best way to create that third buffer (or more
 precisely, that second indirect buffer)?

I can't, but your description of a windowed layout sounds like
workgroups ( https://github.com/tlh/workgroups.el ), may be you can
reuse some code?

Myles





Re: [O] 'org-calendar-holiday's not in an org agenda org file

2013-09-10 Thread Myles English

Hi Enda,

Enda writes:

 In order to include holidays in the org agenda for current day or week(M-x 
 org-agenda RET a),you have to put the following line in one of the 
 org-agenda-files:

 %%(org-calendar-holiday)

 Is there a way to include holidays in the org agenda for current dayor week 
 without putting %%(org-calendar-holiday) in one of the orgagenda org files?

You set org-agenda-include-diary and may be holidays-in-diary-buffer.

Myles




Re: [O] running some elisp code when exporting a given file

2013-09-05 Thread Myles English

Hi Alan,

Alan Schmitt writes:

 Is there a way to have arbitrary code stored in the file being exported
 being evaluated before an export?

I think you can use org-export-before-processing-hook for this.


12.13 Advanced configuration


Hooks
-

Two hooks are run during the first steps of the export process.  The
first one, 'org-export-before-processing-hook' is called before
expanding macros, Babel code and include keywords in the buffer.  The
second one, 'org-export-before-parsing-hook', as its name suggests,
happens just before parsing the buffer.  Their main use is for heavy
duties, that is duties involving structural modifications of the
document.  For example, one may want to remove every headline in the
buffer during export.


Myles



Re: [O] clocking into an inline task before any headings

2013-08-30 Thread Myles English

Hi Carsten,

Carsten Dominik writes:

 On 14.8.2013, at 16:36, Myles English mylesengl...@gmail.com wrote:

 Are inline tasks allowed to be used before any other headings?  (I hope
 they are.)

 No, they are not.

 Why don't you just make it a normal headline?

Okay, I can put the inline task under a normal headline with a
:noheading: tag that causes a filter to omit the headline itself, and
this is good enough for my needs:

* Like This   :noheading:

*** TODO Something inline
*** END

Just to explain what I am doing though: writing a report, e.g.:

* Introduction
* Method
* Conclusions

Adding tasks as headings breaks up the structure undesirably:

* TODO Decide on a layout for the whole document
* Introduction
* TODO Finish writing the introduction
* Method
* Conclusions

Alternatively, using inline tasks, the document structure is still easy
to see (scanning down the left side) and they fold nicely:

*** TODO Decide on a layout for the whole document...
* Introduction
*** TODO Finish writing the introduction...
* Method
* Conclusions

Labouring the point at bit, I see the headlines as the fingers on my
left hand and the inline tasks are the fingers on my right hand and they
interleave:

*** TODO Decide on a layout for the whole document...
* Introduction
*** TODO Finish writing the introduction...
* Method
** Setup
*** Safety
*** TODO Add fire exits...
 Insurance
*** TODO Ring broker...
* Conclusions

Changing the inline task before the Introduction to be under a headline
works but breaks up the document a little at the start:

* First task   :noheading:
*** TODO Decide on a layout for the whole document...
* Introduction
*** TODO Finish writing the introduction...
* Method
** Setup
*** Safety
*** TODO Add fire exits...
 Insurance
*** TODO Ring broker...
* Conclusions

(Another issue that may be related to this is that the preamble in a
complicated document for LaTeX export takes up a whole screen and it
would be nice to be able to fold it.)

Thanks,

Myles



[O] clocking into an inline task before any headings

2013-08-14 Thread Myles English
Hello,

Are inline tasks allowed to be used before any other headings?  (I hope
they are.)

Starting with

 $ emacs -Q

and with nothing more than a

 (require 'org-inlinetask)

I am able to insert an inline task with C-c C-x t but when I try to
clock in, CLOCK: is inserted on a line directly below the task title
and I get this Backtrace:

Debugger entered--Lisp error: (error Before first headline at position 120 in 
buffer a.org)
  signal(error (Before first headline at position 120 in buffer a.org))
  error(Before first headline at position %d in buffer %s 120 #buffer a.org)
  byte-code(\300\301`p#\207 [error Before first headline at position %d in 
buffer %s] 4)
  org-back-to-heading(t)
  org-narrow-to-subtree()
  org-clock-sum-current-item(nil)
  byte-code(?\205\306 \307\211\211\310   
?\205\n@ABC\203=B\203+C\311=\203=D\204=   \204=\307\311D\312 
\210)E\313\232\203N\311F\314\307G\\210)E\315\232\203k\316\317!\211@\203g\320@!@\202k\321\322!\210E\323\232\203u\324
 
\210B\203\331\212@\204\204\325\311!\210\326H!@\203\224\326@!\202\225p\232\205\265\327H!@\203\251\327@!\202\252`U\205\265I\330\331
 
8\232)\203\304\332\333J\\210\334\335\307\\210K\327L!\326L!\223\210\311D\336\307\311\\210)m\203\350\337
 
\204\350\340\341!\202\351`\212@\203\n\326@!\203\n\342\326@!!q\210\327@!@\307\211\223\210\212\214~\210b\210\325\311!\210B\204
 K\307\211\223\210\212\307u\210\343\344!\210\345 \210)\346 
\210\347M!\203P\350N!\210M\351\352!!\211O\203L\353O!\210)\202fM\203f\350P\354M\355R!\204f\353M!\210\350N!\205y\330\225\205y\356\357\225\330\225{!QR\203\215\347R!\203\215R
 
\202\245\350N!\203\244\351\330!\203\244\360\361\362\351\330!#\202\245\363J\364J\365\307#J\366S!\210S\203\367\350\367T\370\371R!\203\367\332\372\351\357!\\210\373\351\357!\374QA\357\225b\210\375\376\377\351\357!!\U\201b`V\W\201c\201d
 !X\202\256S\201e=\203\332\201f!\210\201g 
\210\201h\352!\210\334\335\307\\210\202\256\201i\201j!\210\201ku\210\201l 
\210\212\341\210\201m )\203H\201n\357!\210\201o\201p 
\352Z!\210T\201q\261\210\201b`V\W\201c\201d 
!XF\203mG\206\236\203\225\201r\201s\201t\201u\201v 
!\201u!Z\201w\245\!\203\225\206\236Y\206\236\201v 
U\201xU\201y\201z#AL`\201{ \223\210H\212\325\311!\210`)\201{ 
\223\210\311Z[\201|=\204\333[\201}=\203\371\\\204\345\201~\\\201\\\204\371\201\200\\\201\201\\\[\201\202=\204[\201}=\203]^\201\203
 
\210_\203#\201\204_!\210\307_[\2034\201\205`\211\201\203#_a\203C\201\204a!\210\307a\201\205\201w\211\201\206#a\332\201\207A\f#\210\343\201\210!.
 \207 [org-clock-resolving-clocks-due-to-idleness 
org-clock-resolving-clocks org-clock-leftover-time leftover msg-extra 
target-pos org-clocking-p nil  t org-resolve-clocks (64) org-clock-in (4) 
org-clock-select-task Clock-in on task:  copy-marker error Abort (16) 
org-clock-mark-default-task org-back-to-heading marker-buffer marker-position 4 
org-heading-components message Clock continues in \%s\ throw abort 
org-clock-out org-at-heading-p point-at-bol 0 org-base-buffer run-hooks 
org-clock-in-prepare-hook org-clock-history-push org-clock-set-current 
functionp looking-at match-string 2 org-todo [ ]* \\ org-trim 1 
replace-regexp-in-string \\[\\[.*?\\]\\[\\(.*?\\)\\]\\] ...] 7)
  org-clock-in(nil)
  call-interactively(org-clock-in nil nil)

This is the behaviour as of commit 75f73e0b87a.

Inserting a heading above the tasks allows it to be clocked into.

Thanks,

Myles



Re: [O] Import files to babel blocks

2013-07-21 Thread Myles English

Hi Michael,

Michael Bach writes:

 Dear org-mode Users and Developers,

 I am trying to write a simple function for importing files to org-mode
 babel code blocks.

 My naive approach was

 --8---cut here---start-8---
 (defun import-to-org-from-files (path pattern progmode)
   (mapcar #'(lambda (filepath)
   (progn
 (insert (format
  \n#+name: %s\n (file-name-nondirectory
(file-name-sans-extension
 filepath
 (insert (format #+begin_src: %s :eval no\n progmode))
 (insert-file-contents filepath)

From the documentation (C-h f insert-file-contents), it says that it
returns list of absolute file name and number of characters but
doesn't move the marker forwards, unlike insert does.  So, I guess you
would have to then move the marker forwards by the number of characters.

 (insert \n#+end_src\n))
   )
   (directory-files path t pattern)))
 --8---cut here---end---8---

Myles



Re: [O] Embedded Tikz Picture

2013-07-14 Thread Myles English

Hi Julien,

Julien Cubizolles writes:

 What would be the best way to use some tikz code in an org-file?

I don't know what the best way is.

 I've succeeded so far by putting it in a 
 #+BEGIN_LaTeX
 #+END_LaTeX
 structure but from what I understand, this code will only be evaluated
 when I export to LaTeX.

That's right, (maybe beamer too?).

 I also tried embedding the corresponding LaTeX code, but I only got a
 white square for the picture.

Could this be a problem with different paper sizes?  If so, the use of
the standalone class (see below) may fix this.

 I guess the relevant packages weren't loaded. Is it possible to make
 the embedded LaTeX code use the class defined by #+LATEX_CLASS?

That should be happening already.

I had been using tikz like this, (note: this may not work and my
intention is not to preclude your ECM):

#+LATEX_HEADER: \usepackage{standalone}
#+LATEX_CLASS: report

#+begin_latex
\begin{figure}[htb]
\centering
\includestandalone[mode=tex,width=5cm]{/home/myles/docs/repo/ve/tex/axisymm}
\caption[1D and axisymmetric model domains]{\label{figure:axisymm}1D model 
domain and mesh of line elements
(left), and the axisymmetric variant (right) showing the increased
element volumes associated with the line elements.}
\end{figure}
#+end_latex

And then in /home/myles/docs/repo/ve/tex/axisymm.tex :

--
\documentclass{standalone}
\usepackage{subfig}
%\usepackage[pdftex,active,tightpage]{preview}
%\setlength\PreviewBorder{2mm} % use to add a border around the image
\usepackage{../texlib/mystyle}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,fit,positioning,backgrounds}
\usetikzlibrary{decorations.pathreplacing} % for braces

\begin{document}
%\begin{preview}
\tikzset{Model axes/.style={color=blue!50,-}}
\tikzset{Domain boundary/.style={color=black,thick}}
%\tikzset{Element boundary/.style={color=black!70}}

\begin{tikzpicture}[scale=3,
  %\basicBAxes;
  % arcs
  % dots
  place/.style={circle,draw=black,fill=black,
inner sep=0pt,minimum size=1mm}]
\node (dumm) at ( 0,0) [draw=white,minimum size=0.1mm] {};
\node (one) at ( 0.25,0.8) [place] {};
  \node (two) at ( 0.35,0.8) [place] {};
  \node (three) at ( 0.55,0.8) [place] {};
  \node (four) at ( 0.8,0.8) [place] {};
  
  \draw (one)--(four);
\end{tikzpicture}
\qquad
\begin{tikzpicture}[scale=3,
  %\basicBAxes;
  % arcs
  % dots
  place/.style={circle,draw=black,fill=black,
inner sep=0pt,minimum size=1mm}]
  
% front
  \draw[Domain boundary] (-90:0.25) arc (-90:90:0.25);
  \draw[Domain boundary] (-90:0.8) arc (-90:90:0.8);
  % horseshoe ends
  \draw[Domain boundary] (-90:0.8) -- (-90:0.25);
  \draw[Domain boundary] (90:0.8) -- (90:0.25);

  % back
  \draw[Domain boundary] (-90:0.25) arc (-90:90:0.25);
  \draw[Domain boundary] (-90:0.8) arc (-90:90:0.8);
  % horseshoe ends
  \draw[Domain boundary] (-90:0.8) -- (-90:0.25);
  \draw[Domain boundary] (90:0.8) -- (90:0.25);

  \node (one) at ( 0.25,0) [place] {};
  \node (two) at ( 0.35,0) [place] {};
  \node (three) at ( 0.55,0) [place] {};
  \node (four) at ( 0.8,0) [place] {};
  
  \draw (one)--(four);

  %\draw[Element boundary] (two) arc (0:90:0.35);
  %\draw[Element boundary] (two) arc (0:-90:0.35);
  \draw (two) arc (0:90:0.35);
  \draw (two) arc (0:-90:0.35);
  \draw (three) arc (0:90:0.55);
  \draw (three) arc (0:-90:0.55);
\end{tikzpicture}

%\end{preview}
\end{document}
--


Myles



Re: [O] advice needed: how do you guys sync org files between devices?

2013-07-02 Thread Myles English

Hi,

Rasmus writes:

 Another option is Git Annex.  In my experience, it takes some effort
 to get used to it, but perhaps less so if you're used to git.  One can
 configure it to use regular git for e.g. text files.  It's build with
 Haskell (and success of building it is more or less random), but the
 author now provides binary packages for 32 and 64 bits.

And git-annex is supported by the org attachment features, the author of
git-annex, Joey Hess, has also written a tool called 'mr'.

I sync between computers on a LAN and keep my org files in a git repo,
and the attachment directory, named 'data' by default, is another git
repo.  To sync both of these repos at the same time, they are collected
together in a .mrconfig file like this:


[DEFAULT]
lib =
syncOrg() {
git commit -a -m update || true
git pull pi master
git push pi master
}
[org]
update = syncOrg

[org/data]
update = syncOrg

other git repos can be added of course.  These pull and push to/from a
bare repos on a RaspberryPi that is always on.

There are some things that I wish worked better and I feel could be
improved:

1) when you add a repo (e.g. adding an attachment to an attachment will
result in a nested repo because an attachment isn't self-aware) the
corresponding bare repo must be added to the .mrconfig and the RaspPI.

2) git log shows lots of commit messages in the master branch that say

Merge branch 'master' of pi:org/etc

or

update

and so Made some really important changes becomes buried in the log.
I have a feeling that this could be fixed by using a separate branch for
syncing, but there would still be a merge commit message.

Myles



Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-14 Thread Myles English

Hi Seb,

Sebastien Vauban writes:

 Myles English wrote:

 I wonder if we need to allow a set of options to be passed to ps2pdf as
 we do for ps?

 And setting that in a custom command?

 #+begin_src emacs-lisp
   (add-to-list 'org-agenda-custom-commands
'(L Call list
  tags-todo phone
  ((ps-paper-type 'a4))
  (~/org-calls.pdf)) t)
 #+end_src

Sorry I don't understand what you mean.  The ps-paper-type is already
set to a4 but has no effect on the call to ps2pdf.

Myles



Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-13 Thread Myles English

Christian Egli writes:

 Myles English mylesengl...@gmail.com writes:

 Thanks for checking it.  Yes, I had to change this line in
 org-agenda.el:

 - (call-process ps2pdf nil nil nil
 + (call-process ps2pdf nil nil nil -sPAPERSIZE=a4

 I wonder if we need to allow a set of options to be passed to ps2pdf as
 we do for ps?

 Where do we pass options for ps?

Ok, options aren't passed to ps but variables can be customised for the
emacs PostScript generator:

(customize-group ps-print)

 A quick rgrep shows that ps2pdf is used in the agenda and two of the
 exporters (groff and man) so a better option might be to set the
 papersize via the environment (GS_OPTIONS).

This worked.  I added this to my ~/.zshrc :

export GS_OPTIONS=-sPAPERSIZE=a4

Thanks,

Myles




Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-13 Thread Myles English

Eric,

Eric S Fraga writes:

 Myles English mylesengl...@gmail.com writes:

 Thanks for checking it.  Yes, I had to change this line in
 org-agenda.el:

 - (call-process ps2pdf nil nil nil
 + (call-process ps2pdf nil nil nil -sPAPERSIZE=a4

 If you use a4 sized paper all (or most of) the time, you can set this in
 /etc/papersize on Linux.  I think this is what ps2pdf looks at by
 default.

 I think paperconfig (8) is used to set this property properly.

Thanks for the suggestions.  I looked into this for my Arch Linux but it
had no effect on ps2pdf.  Making the /etc/papersize file and then
setting PAPERSIZE=a4 or PAPERCONF=/etc/papersize did not produce an A4
pdf document (even after installing libpaper).

Setting GS_OPTIONS=-sPAPERSIZE=a4 worked.

What also worked was manually adding this to the .ps file:

%%BeginPaperSize: a4
%%EndPaperSize

I am wondering if ps-print should have known to add this because
ps-paper-type is set to a4?

Thanks,
Myles



Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-12 Thread Myles English

Hi Christian,

Christian Egli writes:

 Myles English mylesengl...@gmail.com writes:

 Trying to print an agenda to pdf always results in the paper size being
 US letter even though ps-paper-type is set to a4.

 Have you tried setting this variable with the custom interface, i.e. M-x
 customize-variable RET ps-paper-type RET?

The customise interface shows that ps-paper-type is indeed set to a4,
but still the agenda prints on US letter.

Any other ideas?

Myles



Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-12 Thread Myles English

Eric S Fraga writes:

 Myles English mylesengl...@gmail.com writes:

 Trying to print an agenda to pdf always results in the paper size being
 US letter even though ps-paper-type is set to a4.

 Have you checked to see if the postscript version uses the right paper
 size?  Just in case the ps - pdf conversion is at fault?  The pdf is
 created from the ps file.  In any case, both ps and pdf work just fine
 for me to A4 with ps-paper-type set to 'a4.

Thanks for checking it.  Yes, I had to change this line in
org-agenda.el:

- (call-process ps2pdf nil nil nil
+ (call-process ps2pdf nil nil nil -sPAPERSIZE=a4

I wonder if we need to allow a set of options to be passed to ps2pdf as
we do for ps?

Myles



[O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-11 Thread Myles English
Hello,

Trying to print an agenda to pdf always results in the paper size being
US letter even though ps-paper-type is set to a4.

This is how I try to print it:

(org-agenda-write /home/myles/tmp/agenda.pdf nil nil *Org Agenda(a)*)

and setting this doesn't fix it either:

(eval-after-load ps-print
  '(setq ps-paper-type 'a4))

Is there something else I need to customise?

Thanks,

Myles



Re: [O] Go to heading using LISP

2013-06-10 Thread Myles English

Hi Alexander,

Alexander Wingård writes:

 I want to create special key-bindings that use the org-refile goto
 interface to jump to specific headings.

It doesn't use org-refile but this is what I use:

(defun my-goto-heading(file heading-text)
  Visit file `file' and goto headline `heading-text'
  (find-file file)
  (org-element-map (org-element-parse-buffer 'headline) 'headline
  (lambda (x)
  (if (string= (org-element-property :raw-value x) heading-text)
  (goto-char (org-element-property :begin x))
  nil))
   nil t)) ;; stop at first find

(defun gtd()
  (interactive)
  (my-goto-heading (concat org-directory /gtd.org) Daily work)
  (org-show-entry)
  ;;(org-show-subtree)
  (reposition-window)
  (org-agenda-list))

In the gtd function I also set org-agenda-files but left it out for
clarity.

Myles



Re: [O] Importing all files into .org document source blocks

2013-05-24 Thread Myles English

Hi Rainer,

Rainer M. Krug writes:
 Is there a way of importing all files in a directory
 (/etc/apt/sources/list.d/) into an org document, with each being in a
 separate code block?

Maybe this?:

for i in `find . -maxdepth 1 -type f`; do
 echo #+BEGIN_SRC :tangle /this/dir/${i}  afile.org
 cat ${i}  afile.org
 echo #+END_SRC\n  afile.org
done

(this kind of reply is becoming a theme of mine)

Myles




Re: [O] How to initiate source edits

2013-05-03 Thread Myles English

Hi Andreas,

Andreas Röhler writes:

 Hi,

 have in some source file, let's assume Python, the following:


 foo = {
  bar: (
   baz,
   qux,
  ),
 }

 What is the best way to put this into an

 #+BEGIN_SRC python

 foo = {
  bar: (
   baz,
   qux,
  ),
 }

 #+END_SRC

A literal answer would be:

echo #+BEGIN_SRC python\n  newfile.org
cat somefile.py  newfile.org
echo \n#+END_SRC\n newfile.org

Myles



Re: [O] Latex export of tables

2013-04-17 Thread Myles English

Hi Suvayu,

Suvayu Ali writes:

 Actually, I am working on a workflow for large writing projects, my PhD
 thesis in this case :-p.  What I have in mind is have a Makefile based
 build system that uses `emacs --batch' to export to LaTeX and html.  The
 images are generated separately using babel blocks or standalone TeX
 files with TikZ code.  I intend to make pdf images for LaTeX and convert
 them to png/svg with imagemagick/inkscape.  Of course all of this is
 still a pipe dream; if I get it working, I'll definitely write a Worg
 page on it.  Of course it will be great if people with interesting ideas
 pitch in :).  I expect to have an early working environment in a couple
 of months.

I am looking forward to seeing what you come up with.  (I have mentioned
this before, however) I have been using a CMake system for LaTeX export:

http://cmake.org/Wiki/images/8/80/UseLATEX.cmake

This allows (amongst other things) generating graphics from stand alone
R scripts that get their own data from a database.  I believe the new
version has some kind of support for SVG.  I used this system for
several papers and my thesis and it has three main advantages:

1) out-of-source builds, so my working dir doesn't get cluttered with
LaTeX files

2) asynchronous export of org to LaTeX (although this is now available
with the new exporter)

3) the graphics are regenerated every time so I know it all still
works

I tangle a CMakeList.txt from every org file that I want to export, then
run cmake ~/path; make from the commandline.

(Version control as part of this workflow is possibly another topic: I
have been using git subtrees to make project-local copies of files such
as mystyle.sty and mybiblatex.bib and then update the main git repo with
the changes, and pull the changes down to another project.)

I'll just paste the whole CMakeList.txt so you can see what it looks
like, but the most interesting part is the emacs --batch command:

#+BEGIN_SRC sh :tangle CMakeLists.txt
  cmake_minimum_required(VERSION 2.8)

  project(relk NONE)

  include(/usr/share/cmake-2.8/Modules/UseLATEX.cmake)

  # export the .tex file from the .org file
  # using the emacs orgmode exporter
  latex_get_output_path(OUTPUT_DIR)

  file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/relkpaper.org DESTINATION 
${OUTPUT_DIR}/ )
  file(COPY /home/myles/lib/lisp/my-export.el DESTINATION ${OUTPUT_DIR}/ )
  
  add_custom_target( orgfile ALL
  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/relkpaper.org )
  
  add_custom_target( elfile ALL
  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/my-export.el )
  
  add_custom_command(
  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/relkpaper.tex
  COMMAND emacs --batch --eval \(progn
  (add-to-list 'load-path
  (expand-file-name \\~/.emacs.d/plugins/org-mode/lisp/\\))
(add-to-list 'load-path
  (expand-file-name \\~/.emacs.d/plugins/org-mode/contrib/lisp/\\ 
t))
  (require 'org)
(require 'ox)
  (require 'org-exp)
(require 'org-inlinetask)
  (org-babel-do-load-languages
  'org-babel-load-languages
  '((emacs-lisp . t)
  (sh . t)))
  (setq org-confirm-babel-evaluate nil)
  (setq org-export-with-todo-keywords nil)
  (setq org-export-babel-evaluate nil)
  (load-file \\my-export.el\\)
  (add-to-list 'org-export-before-parsing-hook 
'my-export-delete-headlines-tagged-noheading)
  (add-to-list 'org-export-filter-link-functions
  'my-autoref-filter-link-func)
  (find-file \\${CMAKE_CURRENT_BINARY_DIR}/relkpaper.org\\)
  (org-latex-export-to-latex))\
  DEPENDS orgfile elfile
  COMMENT Exporting orgmode file to LaTeX using emacs)
  
  add_custom_target( mainfile ALL
  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/relkpaper.tex )

  # Set R executable
  set(R_COMPILE /usr/bin/Rscript)
  # Set the location of data files
  ##set(DATA_DIR data)
  # Set the location of the directory for image files
  set(IMAGE_DIR graphicsauto)

  # Get a list of R files
  file(GLOB_RECURSE R_FILES *.R)

  # Copy over all R scripts
  # add_custom_command(
  #   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/R
  #   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/R
  #   COMMAND ${CMAKE_COMMAND} -E copy_directory
  # ${CMAKE_CURRENT_SOURCE_DIR}/R
  # ${CMAKE_CURRENT_BINARY_DIR}/R
  # )
  file( COPY ${CMAKE_CURRENT_SOURCE_DIR}/R
  DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
  file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${IMAGE_DIR})

  foreach(file ${R_FILES})
  message(processing ${file})
  get_filename_component(basename ${file} NAME_WE)
  #file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/R/${file} DESTINATION 
${CMAKE_CURRENT_BINARY_DIR}/R/${file})
  # # Replace strings in R files so data files can be found
  # file(READ
  # ${CMAKE_CURRENT_SOURCE_DIR}/${IMAGE_DIR}/${basename}.R
  # file_contents
  # )
  # string(REPLACE ${DATA_DIR} 

[O] latex italics in list, with quotation marks

2013-03-08 Thread Myles English

Hi,

Just wondering if there is a better way to italicise across more than two lines
for a list item, currently this is the only way that works for me:

- on the assumption of equilibrium: /``even if there is equilibrium at
  the pore sale, the upscaling, in this/ /if there is equilibrium at
  blah the equilibrium/''

Thanks,

Myles



Re: [O] [PATCH] ob-R.el, ox-latex.el: support for tikz graphics

2013-02-26 Thread Myles English

Hello,

'Scuse me for butting in but I would just like to share how I use tikz
graphics using the 'standalone' class, maybe its useful (and maybe not).
The advantage is that you can compile the tikz file by itself to see how
it looks and then \include it in the main document without having to
change it or compile it separately.

Achim Gratz writes:

 I don't understand.  What I currently need to do for TikZ is this:

 #+LaTeX: \begin{figure}[t]\centering
 #+LaTeX:   \input{oldModel.tikz}
 #+LaTeX:   \caption{Relative modelling error}
 #+LaTeX: \label{fig:oldModel}
 #+LaTeX: \end{figure}

 With the patch that becomes much easier (especially if you want to bounce it 
 to
 HTML eventually, even though the HTML exporter would need to grok that the 
 tikz
 picture should first be converted to SVG or PNG or some other image format):

 #+CAPTION:  Relative modelling error
 #+LABEL: fig:oldModel
 #+ATTR_LaTeX: :placement [t]
 [[file:oldModel.tikz]]

 Now, what I'd really like to do is to combine this with the production of the
 tikz file by Gnuplot like so:

 #+HEADERS:  :term tikz size 15cm,5cm :exports none :results yes
 #+BEGIN_SRC gnuplot :file oldModel.tikz :cache yes...

 #+RESULTS[4d90e02adddfd56f8fbf6bc99963b9bffe1f201e]:
 #+CAPTION:  Relative modelling error for DP0.7 model
 #+LABEL: fig:oldModel
 #+ATTR_LaTeX: :placement [t]
 [[file:oldModel.tikz]]

(This is not a MWE)

-- tikz file --

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%
decorations.pathreplacing,decorations.pathmorphing,shapes,%
matrix,shapes.symbols,shadows}

\begin{document}
\input{/home/myles/docs/repo/graphics/tikz/tikz_style.tex}
\begin{tikzpicture}[rotate=-40]
\cylAxes;
%\draw[help grid] (0,0) grid (5,5);
\node[draw=none,inner sep=0] at (2,4) (yy) {};
\draw[inner sep=0] (0,0) -- +(90:4cm) arc (180:0:1cm and .5cm) node[name=nn] {};
\node[ellipse,
  rotate=-40,
  draw,anchor=west,
  minimum height=1cm,
  minimum width=2cm,
  inner sep=0] (0,0) (bb) {};
\draw (bb.east) -- (yy);
% domain
\draw[Domain boundary,
  color=red,
  inner sep=0] (bb.50) -- ++(40:8) -- ++(90:4) -- (bb.50|-+90:4.5) -- (bb.50);
\end{tikzpicture}
\end{document}

# - org doc -
#+LATEX_HEADER: \usepackage{standalone}
#+LATEX_CLASS: report
#+LATEX_CLASS_OPTIONS: [10pt,a4paper]
#+LATEX_HEADER: \DeclareGraphicsExtensions{.pdf,.png,.jpg,.mps}
#+LATEX_HEADER: \usepackage{subfig}
#+LATEX_HEADER: \usepackage{tikz}
#+LATEX_HEADER: \usetikzlibrary{shapes,arrows,fit,positioning,backgrounds}
#+LATEX_HEADER: \usetikzlibrary{decorations.pathreplacing} % for braces

#+begin_latex
\begin{figure}[htb]
\centering
\includestandalone[mode=tex,width=5cm]{/home/myles/docs/repo/graphics/tikz/2daxial}
\caption[2D linked domain]{\label{figure:2D_linked_domain}Tunnel domains.}
\end{figure}
#+end_latex

#---

Myles



Re: [O] [new exporter][latex] does org-preview-latex-fragment use #+latex_header ?

2013-02-26 Thread Myles English

Nicolas Goaziou writes:

 Myles English mylesengl...@gmail.com writes:

 Thanks for looking at this, I tried just now and can't see any change in
 what I reported above.

 Since the patch, \[ \mysymbol = f \] is correctly displayed after C-c
 C-x C-l here (I just changed ~/bug with bug as bug.sty is not
 located in my home directory).

I still can't get it to work.  I have just updated doing 'make clean,
git pull, make all', the only messages that looked odd were these:

#-
Making generated-autoload-file local to  *autoload-file* while
let-bound!

In org-make-checklist-export:
org-checklist.el:122:14:Warning: print called with 0 arguments, but requires
1-2
org-checklist.el:126:54:Warning: reference to free variable `a2ps-switches'

In org-checklist:
org-checklist.el:132:17:Warning: reference to free variable `org-state'

In end of data:
org-checklist.el:141:1:Warning: the function `a2ps-buffer' is not known
to be
#-

Then I started emacs as before:

emacs -Q -l minimal.el bug.org

M-x locate-library org RET finds the correct library from git:

Library is file ~/.emacs.d/plugins/org-mode/lisp/org.elc

Any ideas?
Can anyone else verify that this works or not?

Myles



Re: [O] [new exporter][latex] does org-preview-latex-fragment use #+latex_header ?

2013-02-26 Thread Myles English

Bastien writes:

 Hi Myles,

 Myles English mylesengl...@gmail.com writes:

 #+LATEX_HEADER: \usepackage{~/bug}

 you want

 #+LATEX_HEADER: \usepackage{/full/path/bug}

I do use the full path but cut it down for the example, which was
incorrect, because it should have had a full path, so thanks for
pointing that out.

These fragments still don't work for me though.  Do they work for anyone
else apart from Nicolas?  I have done make clean and build, started with
emacs -Q, checked that the correct org library is found, I don't know
what else to try.

Myles



Re: [O] [new exporter][latex] does org-preview-latex-fragment use #+latex_header ?

2013-02-26 Thread Myles English

Hi Evan,

Evan Misshula writes:

 I followed the directions.  I created bug.sty and minimal.el in the
 same directory and it worked for me.

 My ox.elc was in /home/evan/Documents/org/elisp/org-mode.
 My bug.sty was in /home/evan/Documents/org/exporter
 My minimal.el was in /home/evan/Documents/org/exporter
 My bug.org was in /home/evan/Documents/org/exporter

Thanks for checking it.  I found the problem but it is too embarrassing
to post here.

And thank you again to Nicolas for fixing it.

Myles




Re: [O] [new exporter][latex] does org-preview-latex-fragment use #+latex_header ?

2013-02-25 Thread Myles English

Nicolas Goaziou writes:

 I have a problem where org-preview-latex-fragment appears not to use a
 style file the latex header.

 Starting emacs like this:

 emacs -Q -l ~/minimal.el ~/file.org

 When I export the whole buffer to pdf it looks right.

 When I call org-preview-latex-fragment on the fragment the definitions
 in a.sty are not picked up.  This previously worked when using the
 new exporter before it was merged.
 -- ~/bug.sty --
 \newcommand{\mysymbol}{\mathbf v}

 -- minimal.el 
 (add-to-list 'load-path ~/.emacs.d/plugins/org-mode/lisp)
 (require 'ox)

 -- file.org ---

 #+STARTUP: indent
 #+LATEX_HEADER: \usepackage{~/bug}


 * heading

 \[ \mysymbol = f \]-- NO WORK

 \[ 0 = f \]-- WORKS

 --

 I removed this functionality when clearing out old exporter from org.el.
 It should be back in master.

Thanks for looking at this, I tried just now and can't see any change in
what I reported above.

Myles



[O] [new exporter][latex] does org-preview-latex-fragment use #+latex_header ?

2013-02-24 Thread Myles English

Hi,

I have just pulled from git and have been migrating to use the new
exporter.

I have a problem where org-preview-latex-fragment appears not to use a
style file the latex header.

Starting emacs like this:

emacs -Q -l ~/minimal.el ~/file.org

When I export the whole buffer to pdf it looks right.

When I call org-preview-latex-fragment on the fragment the definitions
in a.sty are not picked up.  This previously worked when using the
new exporter before it was merged.

Can anyone help?

Thanks,
Myles


-- ~/bug.sty --
\newcommand{\mysymbol}{\mathbf v}

-- minimal.el 
(add-to-list 'load-path ~/.emacs.d/plugins/org-mode/lisp)
(require 'ox)

-- file.org ---
#+STARTUP: indent
#+LATEX_HEADER: \usepackage{~/bug}

* heading

\[ \mysymbol = f \]-- NO WORK

\[ 0 = f \]-- WORKS

--



Re: [O] [new exporter][latex] does org-preview-latex-fragment use #+latex_header ?

2013-02-24 Thread Myles English

Just adding some more information.  It gets curiouser and curiouser...


Myles English writes:

 Hi,

 I have just pulled from git and have been migrating to use the new
 exporter.

 I have a problem where org-preview-latex-fragment appears not to use a
 style file the latex header.

 Starting emacs like this:

 emacs -Q -l ~/minimal.el ~/file.org

 When I export the whole buffer to pdf it looks right.

 When I call org-preview-latex-fragment on the fragment the definitions
 in a.sty are not picked up.  This previously worked when using the
 new exporter before it was merged.

 Can anyone help?

 Thanks,
 Myles


 -- ~/bug.sty --
 \newcommand{\mysymbol}{\mathbf v}

 -- minimal.el 
 (add-to-list 'load-path ~/.emacs.d/plugins/org-mode/lisp)
 (require 'ox)

 -- file.org ---
 #+STARTUP: indent
 #+LATEX_HEADER: \usepackage{~/bug}

 * heading

 \[ \mysymbol = f \]-- NO WORK

 \[ 0 = f \]-- WORKS

\[ \dfrac{\partial a}{\partial b} \]  -- The fragment is perfect,
showing it as da/db but the pdf file shows it as dadb instead.

Another strange thing is that if the \[\] is the last thing in the file
apart from some empty lines then org will fold at the end of it i.e. I
see \[\]...


 --

Myles



Re: [O] python :session issues

2013-02-07 Thread Myles English

Hi Andreas,

Andreas Röhler writes:

 Am 06.02.2013 16:17, schrieb John Kitchin:
 Thanks for the -Q reminder. I get the same output if I run with emacs -Q
 (although I do have to add :results output to each block. I had that set as
 a default in my init files).

 I had the problem described in the footnote you listed, and that is why I
 am using python-mode 5.2, which doesn't have that issue.

 John


 Should be fixed in current trunk.

 bzr branch lp:python-mode

Thanks for looking at this Andreas, I have tried the bzr trunk and still
have problems.

John, I hope I am not hijacking your thread but I am not sure what
problem is meant to be have been fixed above so I am just jumping in and
assuming that we would both like to fix the same thing.

Using org-mode from git, commit b810431 from Jan 22.

If I start emacs like this:

$ emacs -Q testPy.org -l init.el

then executing the src blocks in order, *restarting Emacs between
attempts*, shows the problems.

-/ init.el /--
;; use the git trunk for org mode
(add-to-list 'load-path ~/.emacs.d/plugins/org-mode/lisp)
(add-to-list 'load-path ~/.emacs.d/plugins/org-mode/contrib/lisp t)
(require 'org)

;; use the bzr trunk for python-mode
(setq py-install-directory /home/myles/.emacs.d/plugins/python-mode)
(add-to-list 'load-path py-install-directory)
(require 'python-mode)

(org-babel-do-load-languages
 'org-babel-load-languages
 '((python . t)))
---/ end init.el /---

-/ testPy.org /--
* First attempt :doesnotwork:

#+begin_src python :results output :session a
import sys
#+end_src

Message:

inferior-python-mode: Wrong type argument: keymapp, py-down-exception

* Second attempt: set org-babel-python-mode first   :doesnotwork:

#+begin_src elisp
(setq org-babel-python-mode 'python-mode)
(setq org-babel-python-command python2
  py-python-command python2)
#+end_src

I would expect this to open a Python 2 session, however it opens a
Python 3 session:

#+begin_src python :results output :session a
import sys
print(sys.path)
#+end_src

* Third attempt: try python3  :works:

#+begin_src elisp
(setq org-babel-python-mode 'python-mode)
(setq org-babel-python-command python3
  py-python-command python3)
#+end_src

#+begin_src python :results output :session a
import sys
print(sys.path)
#+end_src

Works ok.
---/ end testPy.org /---

Perhaps I am not using it correctly?

Thanks,

Myles



Re: [O] python :session issues

2013-02-06 Thread Myles English

Hi John,

John Kitchin writes:

 I have been trying to use the :session feature of babel for python code
 blocks. I have noticed a few things that might be areas for
 improvement. Some issues are related to what I think might be a need for
 sanitizing the code blocks and the output.

 I am using (insert (org-version)) 7.9.3a
 I am using python-mode 5.2 (more modern versions do not work with
 :session for me)

 The first small detail is illustrated here:

 #+BEGIN_SRC python :session
 a = 5

 b = 6

 print a + b
 #+END_SRC

 #+RESULTS:
 :
 :11

 In the output, there are three sets of , due to the two empty
 lines. Compare this to

 #+BEGIN_SRC python :session
 a = 5
 b = 6
 print a + b
 #+END_SRC

 #+RESULTS:
 :
 :  11

 I think it would be nice to sanitize the python code block sent to the
 interpreter to eliminate the empty lines, and avoid the multiple  in
 output. It would also be nice to have an option to not print those at
 all.

 The second issue is related. The following code does not work for me in
 :session, but it works fine as a standalone block. The issue is related
 to the presence of an empty line in the function definition. I like
 whitespace like this in functions sometimes for readability.

 #+BEGIN_SRC python :session
 def func(x):
 'doc string'

 return x**2

 print func(2)
 #+END_SRC

 #+RESULTS:
 :
 : ...File stdin, line 1
 : return x**2
 : ^
 : IndentationError: unexpected indent
 :  None

 Removing the blank line works fine, but still has some non-pretty
 output.

 #+BEGIN_SRC python :session
 def func(x):
 'doc string'
 return x**2

 print func(2)
 #+END_SRC

 #+RESULTS:
 :
 : ... ...  4

 One of the ellipsis is due to the doc string.
 #+BEGIN_SRC python :session
 def func(x):
 return x**2

 print func(2)
 #+END_SRC

 #+RESULTS:
 :
 : ...  4

 Interestingly, this did not work, because there is no empty line after
 the function definition. So, sanitizing could be tricky.

 #+BEGIN_SRC python :session
 def func(x):
 'doc string'
 return x**2
 print func(2)
 #+END_SRC

 #+RESULTS:
 :
 : ... ...   File stdin, line 4
 : print func(2)
 : ^
 : SyntaxError: invalid syntax

 I think if there was a way to strip all the empty lines from the input,
 it would go a long way to making the output look like what I think most
 people would expect and want.

 Anyway, those are the examples I wanted to highlight in this
 post.


 1. Do you see similar behavior, or is this a feature of my setup?

I haven't tried your examples (no time) but you would be able to tell if
it was a feature of your setup by making a minimum working example and
starting emacs with 'emacs -Q'.  If you see the thread in the footnote
it contains such an example.

 2. Is there any interest in sanitizing the input and output of a
 python :session to get prettier output? if so, Any hints on where to
 start with that?

I had some problems recently with :session, there was a short discussion[1],
and last I heard the maintainer of python-mode.el is looking into it.

Myles

Footnotes: 
[1]  https://lists.gnu.org/archive/html/emacs-orgmode/2013-01/msg00888.html





Re: [O] Problem reading Geoconcept GXT

2013-02-01 Thread Myles English

daniel.gne...@vevey.ch writes:

 Hi,

 I have a problem trying to read a GXT file with OGR and the following 
 command : 

 ogr2ogr -f ESRI Shapefile eu_collecteur.shp Villeneuve_test.gxt 
 ASSAINISSEMENT.Collecteur

org ? ogr ?


 I get this error : 

 ERROR 1: 'Subclass' expected.
 Geoconcept export syntax error at line 8.

 FAILURE:
 Unable to open datasource `Villeneuve_test.gxt' with the following 
 drivers.
   - ESRI Shapefile
   - MapInfo File
 ...

 The subclass seems to be correctly defined in GXT : 
 
 //$FIELDS Class=ASSAINISSEMENT; Subclass=Collecteur; Kind=2; 
 Fields=Private#Identifier   Private#Class   Private#Subclass 
 Private#NamePrivate#NbFieldsID  Nom commune Numéro 
 commune RemarqueID  [0] Nom commune [0] Numéro commune [0] 
 Remarque [0]GestionnaireRéférence dossier   Réseau  Tracé   No 
 objet   Contenu Année de pose/construction  Dernier constat Etat 
 Reférence plan  Image / schéma 1Image / schéma 2Dernier 
 entretien   Mode d'acquisition  Date d'acquisition  Nom du 
 propriétaireValeur économique de remplacement   No tournée de 
 contrôleFréquence des contrôles (mois)  Priorité d'intervention 
 Année de remplacement projetée  Date de création fiche  Auteur fiche Date 
 de mise à jour  Auteur de mise à jour   Date d'estimation   Nom du 
 gestionnaireValeur résiduelle comptable Valeur résiduelle 
 technique   No PGEE Détermination planimétrique Prix unitaire 
 Profil du collecteurMatériauCode matériau   Etat 
 d'exploitation  Altitude amont (m)  Altitude aval (m)   Pente 
 réelle (%)  Diamètre/hauteurLongueur horizontaleCode du 
 profil  CaractéristiquesNom collecteur  Matériau chemisage  No 
 bande vidéo Débit nominal (Qnom) (l/s)  No du sous bassin versant 
 Temps de retour considéré T1 pour le débit maximal  Débit maximal 
 (Qmax) pour T1 (l/s)Charge hydraulique pour T1 (%)  Débit min. par 
 temps sec (l/s) No tournée de curageFréquence de curage Quantité 
 ECP permanentes Quantité ECP saisonnières   Travaux futurs  Contenu 
 futur   Age Temps de retour considéré T5 pour le débit maximal Débit 
 maximal (Qmax) pour T5 (l/s)Charge hydraulique pour T5 (%)  Temps de 
 retour considéré T10 pour le débit maximal  Débit maximal (Qmax) pour 
 T10 (l/s)   Charge hydraulique pour T10 (%) Temps de retour considéré 
 T4 pour le débit maximalDébit maximal (Qmax) pour T4 (l/s) Charge 
 hydraulique pour T4 (%) Capacité pour T1Capacité pour T5 Capacité 
 pour T10Capacité pour T4Durée de vie calc.  Largeur 
 Dimensions  Charge Hydraulique T1 calc. Charge Hydraulique T2 
 calc.   Charge Hydraulique T3 calc. Charge Hydraulique T4 calc. No 
 objet amont No objet aval   Durée de vieEtat d'exploitation futur 
 Diamètre futur  Inspection TV   FonctionGenre de raccordement Lit 
 de pose enrobageMatériau SIA 405Année dernier curage 
 Méthode d'entretien Pente admise (%)Temps de retour considéré 
 T2 pour le débit maximalTemps de retour considéré T3 pour le débit 
 maximal Capacité pour T3Degré d'urgence Sml Private#X 
 Private#Y   Private#XP  Private#YP  Private#Graphics
 

 Any suggestion ?

Try gdal-...@lists.osgeo.org ?

Myles



Re: [O] [bug] latex fragment preview with dvipng ignores :foreground specification

2013-01-28 Thread Myles English

Eric S Fraga writes:

 Myles English mylesengl...@gmail.com writes:

 Please could you clarify a couple of things for me?

 From your investigations can you say if there is a bug in the orgmode
 use of dvipng, or has dvipng changed so that the expected behaviour is
 no longer supported?  I too use a dark display (emacs theme
 zenburn-emacs), get the black fragments in normal latex blocks in org
 files (i.e. not beamer), and org-format-latex-options has no visible
 effect, how can I have white formulae again?

 Thanks for prompting me on this.  I've explored the code a bit
 further.  The two approaches, i.e. dvipng vs imagemagick, differ not
 only in the tool used to create the image and the source of the image
 (dvi versus pdf) but also in the latex code actually created to generate
 the image in the first place.

 The dvipng route does not specify any colours in the latex and relies on
 dvipng to change explicitly the background and foreground colours.  The
 imagemagick route, however, creates a latex file that has the colour
 specifications directly and the conversion does change any colours.

 So, it could be that dvipng has changed and no longer changes the
 colours correctly or it may be that latex has changed in how the dvi
 file specifies colours?

 However, I have verified that dvipng will work just fine, without asking
 for colour changes, if the dvi is created using the latex code used for
 the imagemagick case.  This leads me to suggest that both cases (dvipng
 and imagemagick) use the same latex code and, in fact, it may be
 possible to fold both functions org-create-formula-image-with-dvipng and
 org-create-formula-image-with-imagemagick into one...  but maybe this
 has other repercussions.  One such repercussion could be the use of
 transparent colour specifications: dvipng would appear to support this
 but imagemagick might not (as org appears to use white when transparent
 is specified for a background colour, if I understood the code.

Thanks for looking into it.  Until a conclusion is reached with dvipng
this gets things back to normal for me:

(setq org-latex-create-formula-image-program 'imagemagick)

Myles



Re: [O] [bug] latex fragment preview with dvipng ignores :foreground specification

2013-01-27 Thread Myles English

Hi Eric,

Eric S Fraga writes:

 Nick Dokos nicholas.do...@hp.com writes:

 I tried the imagemagick setting, set the options variable to black background
 and red foreground - lo and behold, that's what I get in the preview.

 I was correct in my conclusion last night that I needed to go to
 bed...  I was making a silly mistake (and I won't go into details ;-).

 This does indeed work!  Thanks again.

Please could you clarify a couple of things for me?

From your investigations can you say if there is a bug in the orgmode
use of dvipng, or has dvipng changed so that the expected behaviour is
no longer supported?  I too use a dark display (emacs theme
zenburn-emacs), get the black fragments in normal latex blocks in org
files (i.e. not beamer), and org-format-latex-options has no visible
effect, how can I have white formulae again?

Thanks,

Myles



Re: [O] #+headers: :tangle doesn't work

2013-01-26 Thread Myles English

Hi Eric,

Thanks for taking a look at this.

Eric Schulte writes:

 Myles English mylesengl...@gmail.com writes:

 I'd just like to record a minor inconsistency in case anyone is looking
 at the code and decides they can change it.  The tangle variable can't
 go in the #+headers line:

 #+headers: :tangle a.sh
 #+begin_src sh
 echo this won't be tangled
 #+end_src

 #+begin_src sh :tangle a.sh
 echo this will be tangled
 #+end_src


 Please ensure that you have the latest version of Org-mode loaded.

Using a very recent git.

 When I tangle a file containing the above two code blocks both are
 tangled correctly to a.sh.  If I then remove the #+headers: line only
 the second block is tangled,

I get that too.

 so it appears everything is working as expected.

Not so fast, if I try to tangle each block separately C-u C-c C-v t then
the one with #+headers: doesn't tangle and there is the message:

tangled 0 code blocks from x.org

Myles



Re: [O] Exporting to LaTeX to use it with \input

2013-01-25 Thread Myles English

Hi Seweryn,

Seweryn Kokot writes:

 I would like to have a main text of the document in LaTeX and only some parts 
 as
 org files (using tables and babel functionality). Then these files I want to
 export to .tex files and include to the main tex file with \input{myorgfile1}.
 My question: is it possible to export to LaTeX without preamble and postable? 
 Or
 how to automatically get rid of this redundant text to use it in
 \input?

Have a look at the standalone package, it ignores everything before
\begin{document} in the \input file.

You might be able to see the documentation by typing:

$ texdoc standalone


Myles



Re: [O] [PATCH] session with python-mode.el complains of void py-toggle-shells

2013-01-23 Thread Myles English

Hi Nick,

Nick Dokos writes:

 Myles English mylesengl...@gmail.com wrote:

 I think it should be possible to execute a python block in a session
 using python-mode.el but get this message:
 
 Symbol's function definition is void: py-toggle-shells

I have made a bit of progress with the patch below.  The breakage may
have been due to changes in python-mode.el .  The patch works for
versions 6.0.10 and 6.1.0.

 I get in trouble much sooner than you do: when evaluating the first code
 block.  The error in my case was that run-python was called with the
 wrong number of args (from the same function: it's a couple of lines
 before py-toggle-shells is called). I'm running

 GNU Emacs 24.3.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.4) of 
 2012-12-29

 and run-python does indeed need a required arg in this version:

 ,
 | run-python is an interactive autoloaded compiled Lisp function in
 | `python.el'.
 | 
 | (run-python CMD optional DEDICATED SHOW)
 | 
 | Run an inferior Python process.
 | Input and output via buffer named after
 | `python-shell-buffer-name'.  If there is a process already
 | running in that buffer, just switch to it.
 `

 So I changed the call to


   (run-python py-python-command)

 and then all the code blocks could execute with no problem. Has
 run-python changed signature recently?

Doing git blame ob-python.el shows that not much has changed in that
file over the last couple of years.

 This may or may not be the problem you are running into however.

I have made some progress and the patch below passes this test:

#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path
 ~/.emacs.d/plugins/org-mode/lisp)
  (require 'org)
  (org-babel-do-load-languages
   'org-babel-load-languages
   '((python . t)))
(setq org-babel-python-mode 'python-mode)
#+END_SRC

#+begin_src python :results output :session a
import sys
#+end_src

#+begin_src python :results output :session a
print(sys.path)
#+end_src

Patch:

--- lisp/ob-python.el
+++ lisp/ob-python.el
@@ -32,7 +32,7 @@
 
 (declare-function org-remove-indentation org )
 (declare-function py-shell ext:python-mode (optional argprompt))
-(declare-function py-toggle-shells ext:python-mode (arg))
+(declare-function py-toggle-shell ext:python-mode (arg))
 (declare-function run-python ext:python (optional cmd noshow new))
 
 (defvar org-babel-tangle-lang-exts)
@@ -162,16 +162,17 @@ then create.  Return the initialized session.
;; Make sure that py-which-bufname is initialized, as otherwise
;; it will be overwritten the first time a Python buffer is
;; created.
-   (py-toggle-shells py-default-interpreter)
+   (py-toggle-shell py-default-interpreter)
;; `py-shell' creates a buffer whose name is the value of
;; `py-which-bufname' with '*'s at the beginning and end
(let* ((bufname (if (and python-buffer (buffer-live-p python-buffer))
(replace-regexp-in-string ;; zap surrounding *
 ^\\*\\([^*]+\\)\\*$ \\1 python-buffer)
  (concat Python- (symbol-name session
-  (py-which-bufname bufname))
- (py-shell)
- (setq python-buffer (concat * bufname *
+  (py-buffer-name bufname))
+ (setq python-buffer (concat * bufname *))
+ (py-shell nil nil nil nil nil python-buffer)
+ ))
(t
(error No function available for running an inferior Python)))
   (setq org-babel-python-buffers



Myles



[O] #+headers: :tangle doesn't work

2013-01-23 Thread Myles English

Hi,

I'd just like to record a minor inconsistency in case anyone is looking
at the code and decides they can change it.  The tangle variable can't
go in the #+headers line:

#+headers: :tangle a.sh
#+begin_src sh
echo this won't be tangled
#+end_src

#+begin_src sh :tangle a.sh
echo this will be tangled
#+end_src

Thanks,

Myles



[O] session with python-mode.el complains of void py-toggle-shells

2013-01-22 Thread Myles English
Hi,

I think it should be possible to execute a python block in a session
using python-mode.el but get this message:

Symbol's function definition is void: py-toggle-shells

Using the latest git head and opening this file with:

$ emacs -Q thisfile.org

then executing these src blocks in order, shows the problem:

#+BEGIN_SRC emacs-lisp
  (require 'org)
  (org-babel-do-load-languages
   'org-babel-load-languages
   '((python . t)))
#+END_SRC

#+RESULTS:
| (python . t) |

* A heading

This works okay:

#+begin_src python :results output :session a
import sys
#+end_src

#+RESULTS:

Try with python3:

#+begin_src elisp
(setq org-babel-python-command python3
  py-python-command python3
)
#+end_src

#+RESULTS:
: python3

works also:

#+begin_src python :results output :session a
import sys
#+end_src

#+RESULTS:

Try using python-mode.el:

#+begin_src elisp
(setq org-babel-python-mode 'python-mode)
(load-file /usr/share/emacs/site-lisp/python-mode.el)
#+end_src

#+RESULTS:
: t

#+begin_src python :results output :session a
import sys
#+end_src

Gives this *Message*:

org-babel-python-initiate-session-by-key: Symbol's function definition
is void: py-toggle-shells

Do I need to configure something else?

Thanks,

Myles



Re: [O] OBBDB(3) or org-contacts

2013-01-14 Thread Myles English


Hi Gour,

Eric S Fraga writes:

 Gour g...@atmarama.net writes:

 Do you use bbdb3 and what are important things it brings over 
 bbdb2? 

 Org will interpret the anniversary (e.g. birthdays, wedding 
 anniversary, other dates) field in bbdb entries to bring in 
 information into the agenda view, if desired.  Look at 
 =org-bbdb-anniversary-format-alist=.

I could never get this to work satisfactorily, I can either see
birthdays or wedding anniversaries in the agenda but not both.
 
 Have you, maybe, tried mu4e or should I simply stick with proven 
 Gnus? 

I used to use gnus but changed to mu4e.  My gnus broke during the change
to emacs24 and I couldn't find the help out there to fix it.  Mu4e has
good documentation and a very helpful developer.  It was very easy to
change to mu4e.  If I had a very high volume of emails I would consider
having another go at gnus.

Myles



[O] noweb reference to #+call

2013-01-03 Thread Myles English

Hi,

It would be useful to be able to use the noweb reference syntax to refer
to #+CALL: lines:

e.g.:

#+name: myFunction
#+BEGIN_SRC sh :var A= :noweb yes
echo $A
#+END_SRC

#+CALL: myFunction[:results output](A=aaa) :noweb-ref mynoweb

#+header: :noweb yes
#+begin_src sh
mynoweb
#+end_src

#+RESULTS:
: aaa ( -- Fiction)

However it is not currently working for me.  It is not clear to me from
the manual whether it was ever possible so this is probably a Feature
Request.  (Unless is was possible then it may be a regression.)

My experiments are in the attached file if anyone wants to take a look.

Thanks,

Myles


* Function

#+name: myFunction
#+BEGIN_SRC sh :var A= :noweb yes
echo $A
#+END_SRC

* Test 1 - FAILS

#+CALL: myFunction[:results output](A=aaa) :noweb-ref mynoweb

#+RESULTS: myFunction[:results output](A=aaa):noweb-ref mynoweb
: aaa

Expect: : aaa :

#+header: :noweb yes
#+begin_src sh
mynoweb
#+end_src

#+RESULTS:

* Test 2 - FAILS

#+CALL: myFunction[:results output :noweb yes](A=aaa) :noweb-ref mynoweb2

#+RESULTS: myFunction[:results output :noweb yes](A=aaa):noweb-ref mynoweb2
: aaa

Expect: : aaa :

#+header: :noweb yes
#+begin_src sh
mynoweb2
#+end_src

#+RESULTS:

* Test 3 - FAILS

#+CALL: myFunction[:results output :noweb yes](A=aaa) :noweb yes :noweb-ref 
mynoweb3

#+RESULTS: myFunction[:results output :noweb yes](A=aaa):noweb yes :noweb-ref 
mynoweb3
: aaa

Expect: : aaa :

#+header: :noweb yes
#+begin_src sh
mynoweb3
#+end_src

#+RESULTS:

* Test 4 - WORKS
  Testing the :noweb-ref PROPERTY
** function
  :PROPERTIES:
  :noweb-ref: mynoweb4
  :END:
#+BEGIN_SRC sh :var A= :noweb yes
echo $A
#+END_SRC

** result

#+header: :noweb yes
#+begin_src sh
mynoweb4
#+end_src

#+RESULTS:
||
| noCall |

* Test 5 - FAILS
  Testing the :noweb-ref PROPERTY with a CALL
** function
  :PROPERTIES:
  :noweb-ref: mynoweb5
  :END:

#+CALL: myFunction[:results output](A=aaa)

** result

#+header: :noweb yes
#+begin_src sh
mynoweb5
#+end_src

#+RESULTS:

* Test 6 - WORKS

#+name: noCall
#+header: :noweb yes :noweb-ref mynoweb4
#+begin_src sh 
echo noCall
#+end_src

#+RESULTS: noCall
: noCall

Expect: : noCall :

#+header: :noweb yes
#+begin_src sh
mynoweb4
#+end_src

#+RESULTS:
: noCall


Re: [O] [Latex+orgmode] #+LaTeX:\printbibliography AND '(:noexport:)

2012-12-27 Thread Myles English

Hi celano,

celano writes:

 Hello

 This is my file.org (I use it then with latex: C-c C-e l):

 #+LaTeX_CLASS:book
 * First part
 ** First chapter
 ** Second chapter '(:noexport:)
 ** Third chapter '(:noexport:)
 #+LaTeX: \printbibliography

 * Second part
 ** 4th chapter
 ** 5th chapter

 As you see, \printbibliography is under the *noexport* tag, and will not 
 appear in the file.tex

 *How should I do to export the bibliography without creating a new
 chapter?*

I think this does what you want:

[Re: [O] Bibtex export 18 December 2012]
http://lists.gnu.org/archive/html/emacs-orgmode/2012-12/msg00634.html



 Thank you for helping me
 Celano

Myles



Re: [O] Bibtex export

2012-12-20 Thread Myles English

mohamed writes:

 Myles,
 Thank you for this answer. 
 I tried it with 
 ---
 (add-to-list 'org-export-preprocess-hook
 'my-export-delete-headlines-tagged-noheading)
 ---

Sorry, I should have said: add it to org-export-before-processing-hook,
so you use it like this:

#+begin_src emacs-lisp
(defun my-export-delete-headlines-tagged-noheading (backend)
  (dolist (hl (nreverse (org-element-map (org-element-parse-buffer 'headline)
 'headline
 'identity)))
(when (member noheading (org-element-property :tags hl))
  (goto-char (org-element-property :begin hl))
  (delete-region (point) (progn (forward-line) (point))

(add-to-list 'org-export-before-processing-hook
 'my-export-delete-headlines-tagged-noheading)
#+end_src

Myles



 But I got some errors when exporting

 -
 Exporting to LaTeX...  run-hooks: Wrong number of
 arguments: (lambda (backend) (dolist (hl (nreverse (org-element-map
 (org-element-parse-buffer (quote headline)) (quote headline) (quote 
 identity
 (when (member noheading (org-element-property :tags hl)) (goto-char
 (org-element-property :begin hl)) (delete-region (point) (progn (forward-line)
 (point)), 0 (my-export-delete-headlines-tagged-noheading)
 -


 I guess I have to use it in another way. My knowledge of lisp programming is
 very limited.

 Regards,
 Mohamed




Re: [O] org bingo

2012-12-20 Thread Myles English

Tony Day writes:

 I have exactly 386 TODO entries and may as well introduce some
 randomness to get to them.

 org-random-entry: select and goto a random todo entry. Prefix allows you
 to select which todo keyword.

 https://gist.github.com/4343164

Thanks, I'm using this already.  One less decision to make...

Myles



  1   2   3   >