[O] [PATCH] Bugfix open 1 link from list; doc more link types

2011-11-26 Thread Michael Brand
Hi all

Bugfix open 1 link from list; doc more link types

* doc/org.texi (External links): Document the link types file+sys and
file+emacs, slightly narrow used page width.
* lisp/org.el (org-offer-links-in-entry): Make list when assigning a
single link.

M-1 C-c C-o or (org-open-at-point 1) or (org-offer-links-in-entry 1)
on a headline followed by two links enters Lisp error.  Both changes
are remainders of the commit release_6.33f-189-g3e0c61d.

Michael
From 74b56643881618a030252959722a83a4b8720c79 Mon Sep 17 00:00:00 2001
From: Michael Brand michael.ch.br...@gmail.com
Date: Sat, 26 Nov 2011 10:39:54 +0100
Subject: [PATCH] Bugfix open 1 link from list; doc more link types

* doc/org.texi (External links): Document the link types file+sys and
file+emacs, slightly narrow used page width.
* lisp/org.el (org-offer-links-in-entry): Make list when assigning a
single link.

M-1 C-c C-o or (org-open-at-point 1) or (org-offer-links-in-entry 1)
on a headline followed by two links enters Lisp error.  Both changes
are remainders of the commit release_6.33f-189-g3e0c61d.
---
 doc/org.texi |6 --
 lisp/org.el  |2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index fdad8ba..833e969 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -3170,7 +3170,7 @@ @section External links
 ./papers/last.pdf @r{same as above}
 file:/myself@@some.where:papers/last.pdf   @r{file, path on remote machine}
 /myself@@some.where:papers/last.pdf@r{same as above}
-file:sometextfile::NNN@r{file with line number to jump to}
+file:sometextfile::NNN@r{file, jump to line number}
 file:projects.org @r{another Org file}
 file:projects.org::some words @r{text search in Org file}@footnote{
 The actual behavior of the search will depend on the value of
@@ -3180,7 +3180,9 @@ @section External links
 then an exact headline will be searched; if it is not found, then the user
 will be queried to create it.}
 file:projects.org::*task title@r{heading search in Org file}
-docview:papers/last.pdf::NNN  @r{open file in doc-view mode at 
page NNN}
+file+sys:/path/to/file@r{open via OS, like double-click}
+file+emacs:/path/to/file  @r{force opening by Emacs}
+docview:papers/last.pdf::NNN  @r{open in doc-view mode at page}
 id:B7423F4D-2E8A-471B-8810-C40F074717E9   @r{Link to heading by ID}
 news:comp.emacs   @r{Usenet link}
 mailto:adent@@galaxy.net   @r{Mail link}
diff --git a/lisp/org.el b/lisp/org.el
index c10aa11..2dc9060 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9678,7 +9678,7 @@ (defun org-offer-links-in-entry (optional nth zero)
  ((equal (length links) 1)
   (setq link (list (car links
  ((and (integerp nth) (= (length links) (if have-zero (1+ nth) nth)))
-  (setq link (nth (if have-zero nth (1- nth)) links)))
+  (setq link (list (nth (if have-zero nth (1- nth)) links
  (t ; we have to select a link
   (save-excursion
(save-window-excursion
-- 
1.7.4.2



[O] Capture aborts after selecting template

2011-11-26 Thread Felix
I am using GNU Emacs 23.1.1 with org-mode version 7.7. I want to use C-c c t to
capture a task and send it to ~/todo.org as defined in the org-capture-template
 below. On pressing C-c c, the Org Select buffer opens but when I hit t, I get
the error message Capture abort: (void-function nil) and nothing gets written
to todo.org. The relevant lines from my
.emacs and a backtrace from uncompiled code are shown below.  Please help me fix
this.  

.EMACS
(define-key global-map \C-cc 'org-capture)
(setq org-directory ~/)

(setq org-capture-templates
  (quote 
  ((t Todo entry (file+headline ~/todo.org Tasks)
 * TODO %?\n  %i\n  %a)
(j Journal entry (file+datetree ~/journal.org)
 * %?\nEntered on %U\n  %i\n  %a

BACKTRACE (Although I followed the instructions carefully, my backtrace still
has some byte code that I couldn't paste here.)
Debugger entered--Lisp error: (void-function nil)
  nil()
  run-hooks(text-mode-hook outline-mode-hook org-mode-hook)
  apply(run-hooks (text-mode-hook outline-mode-hook org-mode-hook))
  run-mode-hooks(org-mode-hook)
  org-mode()
  set-auto-mode-0(org-mode nil)
  byte-code(...*Ň [modes mode --dolist-tail-- done keep-mode-if-same nil
functionp message Ignoring unknown mode `%s' t set-auto-mode-0 throw nop] 4)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#buffer todo.org ~/todo.org nil nil ~/todo.org
(305483 2049))
  find-file-noselect(/home/vadmin/todo.org)
  org-capture-target-buffer(~/todo.org)
  org-capture-set-target-location()
  org-capture(nil)
  call-interactively(org-capture nil nil)







Re: [O] Capture aborts after selecting template

2011-11-26 Thread Bernt Hansen
Felix felixf...@gmail.com writes:

 I am using GNU Emacs 23.1.1 with org-mode version 7.7. I want to use C-c c t 
 to
 capture a task and send it to ~/todo.org as defined in the 
 org-capture-template
  below. On pressing C-c c, the Org Select buffer opens but when I hit t, I get
 the error message Capture abort: (void-function nil) and nothing gets 
 written
 to todo.org. The relevant lines from my
 .emacs and a backtrace from uncompiled code are shown below.  Please help me 
 fix
 this.  

 .EMACS
 (define-key global-map \C-cc 'org-capture)
 (setq org-directory ~/)

 (setq org-capture-templates
   (quote 
   ((t Todo entry (file+headline ~/todo.org Tasks)
  * TODO %?\n  %i\n  %a)
 (j Journal entry (file+datetree ~/journal.org)
  * %?\nEntered on %U\n  %i\n  %a

 BACKTRACE (Although I followed the instructions carefully, my backtrace still
 has some byte code that I couldn't paste here.)
 Debugger entered--Lisp error: (void-function nil)
   nil()
   run-hooks(text-mode-hook outline-mode-hook org-mode-hook)
   apply(run-hooks (text-mode-hook outline-mode-hook org-mode-hook))

Hi Felix,

What are your values for text-mode-hook, outline-mode-hook, and
org-mode-hook?

From your backtrace it looks like invoking one of these hooks is the
problem.

Regards,
Bernt



Re: [O] Publish HTML Without Title

2011-11-26 Thread Rasmus Pank Roulund
Nick Dokos nicholas.do...@hp.com writes:

 Rasmus ras...@gmx.us wrote:

 Hi,

 I publish my website with Org. have defined my title in
 org-publish-project-alist under the :html-preamble.

 However, it seems that recent Orgs have become 'smart' and now I don't
 know how to disable the publishing of title and I have the title printed
 twice.  As I recall this was not an issue before.

 It seems to stem from org-html. el around 1358:

 #+begin_src emacs-lisp
  ;; begin wrap around body
  (insert (format \ndiv id=\%s\
  ;; FIXME org-export-html-content-div is obsolete since 
 7.7
  (or org-export-html-content-div
  (nth 1 org-export-html-divs)))
  ;; FIXME this should go in the preamble but is here so
  ;; that org-infojs can still find it
  \nh1 class=\title\ title /h1\n))
 #+end_src

 Are there any known solutions to this at the moment?


 I spent 10 minutes trying to recreate the problem, and decided that I
 have no idea what you are talking about.

 So in my role as the official and perpetual nag on this list: can you
 please post your org-publish-project-list -or at least the relevant
 subset-
 and (unless, as I suspect, the org file is completely trivial) an ECM
 exhibiting the problem?

In my publish file I have (Warning: 'destructive' example that setq
rather than add-to-list).

#+begin_src emacs-lisp
(setq org-publish-project-alist
  '(
   (test
:base-directory ~/test
:publishing-directory ~/test
:html-preamble 
div id=\top\
h1 class=\title\%t/h1
div id=\menu\
 a href=\index.html\ Home/a |
 a href=\emacs.html\ Emacs/a |
/div
/div
)))
#+end_src

Now use ~/test/index.org
#+begin_src org
#+TITLE: TEST

* First head
  1. point
  2. two
  3. three
#+end_src

Publish it as HTML.  Here is relevant snips from the sourced code.
#+begin_src html
[...]
head
titleTEST/title
[]
body

div id=preamble

div id=top
h1 class=titleTEST/h1
div id=menu
 a href=index.html Home/a |
 a href=emacs.html Emacs/a |
/div
/div
/div

div id=content
h1 class=titleTEST/h1
[...]
#+end_src

Note, I never asked for the second title and this is the one I want to
go away, but I don't know how.  As I pointed out in the previous case,
it seems that it may be hardcoded, but I don't know.

I use Emacs-bzr 106282 and Org-git of 2026.

–Rasmus

--
Sent from my Emacs



Re: [O] Capture aborts after selecting template

2011-11-26 Thread Felix
Thanks, Bernt. The values are as shown below. Please suggest any changes.

Sincerely,
Felix

text-mode-hook's value is 
(nil text-mode-hook-identify)

outline-mode-hook's value is nil

org-mode-hook is a variable defined in `org.el'.
Its value is 
(#[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook org-show-block-all append local]
   5]
 #[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook org-babel-show-result-all append 
local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)







Re: [O] Capture aborts after selecting template

2011-11-26 Thread Bernt Hansen
Felix felixf...@gmail.com writes:

 Thanks, Bernt. The values are as shown below. Please suggest any changes.

 Sincerely,
 Felix

 text-mode-hook's value is 
 (nil text-mode-hook-identify)

 outline-mode-hook's value is nil

 org-mode-hook is a variable defined in `org.el'.
 Its value is 
 (#[nil \300\301\302\303\304$\207
[org-add-hook change-major-mode-hook org-show-block-all append local]
5]
  #[nil \300\301\302\303\304$\207
[org-add-hook change-major-mode-hook org-babel-show-result-all append 
 local]
5]
  org-babel-result-hide-spec org-babel-hide-all-hashes)

I think the problem is your 'nil' entries.

My text-mode-hook looks like this:

--8---cut here---start-8---
text-mode-hook's value is 
(text-mode-hook-identify)
--8---cut here---end---8---

I would remove the nil entries and see if that helps

My org-mode-hook looks like this:
--8---cut here---start-8---
Value: 
(org-clock-load
 (lambda nil
   (abbrev-mode 1))
 (lambda nil
   (add-hook 'before-save-hook 'org-encrypt-entries nil t))
 (lambda nil
   (org-add-hook 'change-major-mode-hook 'org-show-block-all 'append 'local))
 (lambda nil
   (org-add-hook 'change-major-mode-hook 'org-babel-show-result-all 'append 
'local))
 org-babel-result-hide-spec org-babel-hide-all-hashes turn-on-flyspell
 (lambda nil
   (org-defkey org-mode-map [ 'undefined)
   (org-defkey org-mode-map ] 'undefined))
 (lambda nil
   (local-set-key
(kbd C-c M-o)
'bh/mail-subtree)))
--8---cut here---end---8---

I'm on GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-12-11 
on raven, modified by Debian

Regards,
Bernt



Re: [O] M-RET and C-RET

2011-11-26 Thread Tom Prince
On Fri, 25 Nov 2011 17:49:09 +0100, sindikat sindi...@mail36.net wrote:
 Hello everyone, 
 
 M-RET works with both headings and plainlists, it's DWIM.
 C-RET works only with headings. I wanted to ask, why C-RET is not DWIM? 
 Wouldn't users want to add new list item respecting the content? 

You can use M-RET-may-split-line, to make it respect content in lists,
more or less. I would guess the reason that they are different is to be
able to always easily start a new heading.

  Tom



[O] Links with link text like [2011-10-10] fail to export properly

2011-11-26 Thread Tom Prince
With Org-mode version 7.7 (release_7.7.601.g55e4d)
and minimal init,

the following link

[[http://www.google.com][2011-09-16]]

gets exported to html as

[[http://www.google.com] span class=timestamp-wrapper span 
class=timestamp2011-09-16/span/span]

not as a link.

  Tom



Re: [O] Capture aborts after selecting template

2011-11-26 Thread Felix
 
 I think the problem is your 'nil' entries.
 
 My text-mode-hook looks like this:
 
 --8---cut here---start-8---
 text-mode-hook's value is 
 (text-mode-hook-identify)
 --8---cut here---end---8---
 
 I would remove the nil entries and see if that helps
 
 My org-mode-hook looks like this:
 --8---cut here---start-8---
 Value: 
 (org-clock-load
  (lambda nil
(abbrev-mode 1))
  (lambda nil
(add-hook 'before-save-hook 'org-encrypt-entries nil t))
  (lambda nil
(org-add-hook 'change-major-mode-hook 'org-show-block-all 'append 'local))
  (lambda nil
(org-add-hook 'change-major-mode-hook 'org-babel-show-result-all 'append
'local))
  org-babel-result-hide-spec org-babel-hide-all-hashes turn-on-flyspell
  (lambda nil
(org-defkey org-mode-map [ 'undefined)
(org-defkey org-mode-map ] 'undefined))
  (lambda nil
(local-set-key
 (kbd C-c M-o)
 'bh/mail-subtree)))
 --8---cut here---end---8---
 
 I'm on GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-12-11
on raven, modified by Debian
 
 Regards,
 Bernt
 
 

Please forgive the question, but how do you remove the nil entries?

In .emacs I have (add-hook 'text-mode-hook (setq adaptive-fill-mode nil))
and so I'm not sure how text-mode-hook ends up with (nil
(text-mode-hook-identify)). 

I tried (add-hook 'text-mode-hook (text-mode-hook-identify)) but this set
text-mode-hook to (t text-mode-hook-identify) and when I tried C-c c t
to enter a task, I get the message Capture template 't':
org-called-interactively-p and nothing happens.






Re: [O] Capture aborts after selecting template

2011-11-26 Thread Bernt Hansen
Felix felixf...@gmail.com writes:

 
 I think the problem is your 'nil' entries.
 
 My text-mode-hook looks like this:
 
 --8---cut here---start-8---
 text-mode-hook's value is 
 (text-mode-hook-identify)
 --8---cut here---end---8---
 

snip

 

 Please forgive the question, but how do you remove the nil entries?

 In .emacs I have (add-hook 'text-mode-hook (setq adaptive-fill-mode nil))
 and so I'm not sure how text-mode-hook ends up with (nil
 (text-mode-hook-identify)). 

 I tried (add-hook 'text-mode-hook (text-mode-hook-identify)) but this set
 text-mode-hook to (t text-mode-hook-identify) and when I tried C-c c t
 to enter a task, I get the message Capture template 't':
 org-called-interactively-p and nothing happens.

I think your add-hook is used wrong and is what is causing your problem.
Your add-hook call is inserting nil and not a function that sets the
variable you want to nil.

If you want to set adaptive-fill-mode to nil you need something like
this instead:

(add-hook 'text-mode-hook '(lambda () (setq adaptive-fill-mode nil)))

which is an anonymous function that sets adaptive-fill-mode to nil.

Your original case inserts a list where nil is one of the elements and
this is trying to be invoked as a function which causes the failure you
are seeing.

Before your original hook was called text-mode-hook's value is
(text-mode-hook-identify)

Your original value after running your incorrect hook was
--8---cut here---start-8---
text-mode-hook's value is 
(nil text-mode-hook-identify)
--8---cut here---end---8---

which is the result of your add-hook call with (setq adaptive-fill-mode
nil).  This evaluates your setq immediately and returns the result nil
which you add to your text-mode-hook (at the front)

You need to provide a function that the hook can invoke (it's
essentially a list of functions to call).  If you don't want to
explicitly name your functions with defun then you can use a lambda
anonymous function instead.

When you changed your hook and got 't' it was probably run from some
buffer already in text mode - so (text-mode-hook-identify) returns t.
Your second try should have been like this instead

(add-hook 'text-mode-hook 'text-mode-hook-identify)
or
(setq text-mode-hook 'text-mode-hook-identify) if there was already
stuff in the hook you want to clear out.

The quote prevents evaluation of the form you provide for the hook so
that you can evaluate it later.

HTH,
Bernt



[O] M-RET and C-RET

2011-11-26 Thread sindikat

You can use M-RET-may-split-line, to make it respect content in lists,

more or less. I would guess the reason that they are different is to be
able to always easily start a new heading. 

This is very helpful, thank you. But how to make it so M-RET will: 


1. not split line;
2. add new list item while on plain list;
AND
3. add new heading after content of the current heading? 

Maybe there should be a variable in addition to 'org-M-RET-may-split-line' 
such as 'org-M-RET-add-after-content'. 

Btw, i think it is bad to name an Emacs after keyboard combination, because 
it is ambiguous in case user remap M-RET. This is a minor issue, but still 
:)




Re: [O] Publish HTML Without Title

2011-11-26 Thread Nick Dokos
Rasmus ras...@gmx.us wrote:

 Hi,
 
 I publish my website with Org. have defined my title in
 org-publish-project-alist under the :html-preamble.
 
 However, it seems that recent Orgs have become 'smart' and now I don't
 know how to disable the publishing of title and I have the title printed
 twice.  As I recall this was not an issue before.
 
 It seems to stem from org-html. el around 1358:
 
 #+begin_src emacs-lisp
   ;; begin wrap around body
   (insert (format \ndiv id=\%s\
   ;; FIXME org-export-html-content-div is obsolete since 
 7.7
   (or org-export-html-content-div
   (nth 1 org-export-html-divs)))
   ;; FIXME this should go in the preamble but is here so
   ;; that org-infojs can still find it
   \nh1 class=\title\ title /h1\n))
 #+end_src
 
 Are there any known solutions to this at the moment?
 

Thanks for providing your setup. I think you are right about the code and
I don't see any way to turn it off.

It looks like another band-aid to me (and org-html definitely has more
than its fair share of those), particularly given the comment about
org-infojs: presumably, after org-infojs is fixed to look for it in
the preamble, then the h1 header can be deleted from the content div
(although anything I say about HTML should be taken with a large grain
of salt).

Next question: can't you get rid of the instance in your preamble at least
temporarily? Does it have to be in the top div?

Nick

PS. BTW, if you want to play the blame (git blame that is) game, here
are the relevant commits:

$ git blame -L1371,1378 lisp/org-html.el
5a373f64 (David Maus 2011-09-11 16:01:59 +0200 1371)(insert (format 
\ndiv id=\%s\
8d25fdc7 (Bastien Guerry 2011-07-27 19:23:24 +0200 1372)
;; FIXME org-export-html-content-div is obsolete since 7.7
5a373f64 (David Maus 2011-09-11 16:01:59 +0200 1373)
(or org-export-html-content-div
8d25fdc7 (Bastien Guerry 2011-07-27 19:23:24 +0200 1374)
(nth 1 org-export-html-divs)))
8d25fdc7 (Bastien Guerry 2011-07-27 19:23:24 +0200 1375);; 
FIXME this should go in the preamble but is here so
8d25fdc7 (Bastien Guerry 2011-07-27 19:23:24 +0200 1376);; that 
org-infojs can still find it
8d25fdc7 (Bastien Guerry 2011-07-27 19:23:24 +0200 1377)\nh1 
class=\title\ title /h1\n))
70de130b (Bastien Guerry 2011-03-12 05:22:41 +0100 1378) 







Re: [O] Bug: Cloning tasks deletes clock time in the original [7.7 (release_7.7-571-gf558105)]

2011-11-26 Thread Bernt Hansen
David Maus dm...@ictsoc.de writes:

 At Sat, 19 Nov 2011 21:37:08 -0500,
 Bernt Hansen wrote:

 I have the entries I want but my original clock lines have been deleted.
 I would expect this behaviour for the newly created clones only - not
 the original entry.

 Pushed a fix for this problem. Could you check it works out for you?


Hi David,

This works for me.  Thanks!

Regards,
Bernt



[O] Some commands are not exported to LaTeX

2011-11-26 Thread Rafael

With Emacs 23.3.1 in Ubuntu 11.10, and recent org (Org-mode version 7.7
(release_7.7.601.g55e4d), loaded after emacs -Q), consider the following
file. When exporting to LaTeX, the rows starting with #+attr_html,
#attr_latex, #+caption, do not appear. Both html and odt export are
fine.

#+TITLE: Hello, World

* An org mode code example

#+begin_src org
  ,#+title: Hello
  
  ,* This is an example
  
  ,#+attr_html: width=50%
  ,#+attr_latex: height=0.5\textheight
  ,#+attr_odt: (:scale 0.5)
  ,#+caption: A caption
  ,[[file:figure.jpg]]
#+end_src



[O] [PATCH] Add tikzDevice support to ob-R

2011-11-26 Thread Thomas S. Dye
Aloha all,

The attached patch adds tikzDevice support to ob-R.  It requires that
the tikzDevice package be available to R, so it must be installed and
loaded.  Something like the following code in .Rprofile will load the
package by default:

old - getOption(defaultPackages)
options(defaultPackages = c(old, tikzDevice))

Then, specify a .tex file in the :file header argument of the R source
code block, e.g., :file intervals.tex, and the graphic will be produced
by tikzDevice.

The advantage of this for LaTeX export is that the resulting file will
be set with the fonts of its surrounding document.

Something like this works for me, where the \sffamily command uses the
document's sans serif font and the file is called intervals.tex:

\begin{figure}[htb!]
  \centering
  \sffamily
  \input{../figure/intervals}
  \caption[Elapsed time between Polynesian colonization of Hawai`i and fire-pit 
use]{Elapsed time between Polynesian colonization of Hawai`i and fire-pit use.}
  \label{fig:elapsed-time}
\end{figure}
 
All the best,
Tom

From 7f144d05f898565be0c3e17c8417ce81d01442b3 Mon Sep 17 00:00:00 2001
From: Thomas Dye dk@poto.local
Date: Sat, 26 Nov 2011 21:17:00 -1000
Subject: [PATCH] * lisp/ob-R.el: Added tikzDevice support.

---
 lisp/ob-R.el |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lisp/ob-R.el b/lisp/ob-R.el
index 79cc0be..d8c3d6b 100644
--- a/lisp/ob-R.el
+++ b/lisp/ob-R.el
@@ -197,6 +197,7 @@ current code buffer.
 	 '((:bmp . bmp)
 	   (:jpg . jpeg)
 	   (:jpeg . jpeg)
+	   (:tex . tikz)
 	   (:tiff . tiff)
 	   (:png . png)
 	   (:svg . svg)
@@ -214,7 +215,7 @@ current code buffer.
 (setq device (or (and device (cdr (assq (intern (concat : device))
 	devices))) png))
 (setq filearg
-	  (if (member device '(pdf postscript svg)) file filename))
+	  (if (member device '(pdf postscript svg tikz)) file filename))
 (setq args (mapconcat
 		(lambda (pair)
 		  (if (member (car pair) allowed-args)
-- 
1.7.5.4


-- 
T.S. Dye  Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com