Re: [O] latex header lines vs latex block

2014-09-10 Thread Sebastien Vauban
Thorsten Jolitz wrote:
 Sebastien Vauban sva-n...@mygooglest.com
 writes:

 See http://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg00744.html
 for Nicolas' answer on this point:

   ╭
   │ I suggest to use existing solutions instead: configure
   │ `org-latex-classes'.
   ╰


 a related question: is this the right format to create the preamble
 string:

 #+BEGIN_SRC emacs-lisp
 '(;; Name
   obb-article-full-page
   ;; Preamble
   (concat
\\documentclass{article}\n
[DEFAULT-PACKAGES]\n
[PACKAGES]\n
[EXTRA]\n
\\usepackage[cm]{fullpage}\n)
   ;; Sectioning Structure
   (\\part{%s} . \\part*{%s})
   (\\chapter{%s} . \\chapter*{%s}) ...)
 #+END_SRC

 not sure if I need the line-feeds ...

Working example:

--8---cut here---start-8---
(add-to-list 'org-latex-classes
 '(koma-article
   \\documentclass{scrartcl}
   [NO-DEFAULT-PACKAGES]
   [EXTRA]
   (\\section{%s} . \\section*{%s})
   (\\subsection{%s} . \\subsection*{%s})
   (\\subsubsection{%s} . \\subsubsection*{%s})
   (\\paragraph{%s} . \\paragraph*{%s})
   (\\subparagraph{%s} . \\subparagraph*{%s})))
--8---cut here---end---8---

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] latex header lines vs latex block

2014-09-10 Thread Sebastien Vauban
Sebastien Vauban wrote:
 Thorsten Jolitz wrote:
 Sebastien Vauban sva-n...@mygooglest.com
 writes:

 See http://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg00744.html
 for Nicolas' answer on this point:

   ╭
   │ I suggest to use existing solutions instead: configure
   │ `org-latex-classes'.
   ╰


 a related question: is this the right format to create the preamble
 string:

 #+BEGIN_SRC emacs-lisp
 '(;; Name
   obb-article-full-page
   ;; Preamble
   (concat
\\documentclass{article}\n
[DEFAULT-PACKAGES]\n
[PACKAGES]\n
[EXTRA]\n
\\usepackage[cm]{fullpage}\n)
   ;; Sectioning Structure
   (\\part{%s} . \\part*{%s})
   (\\chapter{%s} . \\chapter*{%s}) ...)
 #+END_SRC

 not sure if I need the line-feeds ...

 Working example:

 (add-to-list 'org-latex-classes
  '(koma-article
\\documentclass{scrartcl}
[NO-DEFAULT-PACKAGES]
[EXTRA]
(\\section{%s} . \\section*{%s})
(\\subsection{%s} . \\subsection*{%s})
(\\subsubsection{%s} . \\subsubsection*{%s})
(\\paragraph{%s} . \\paragraph*{%s})
(\\subparagraph{%s} . \\subparagraph*{%s})))

For your example to work, you'd have to replace the quote (') by
a backquote (`) so that the `concat' can be executed...

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Missing Agenda Export in ICS

2014-09-10 Thread SabreWolfy
Eric S Fraga e.fraga at ucl.ac.uk writes:

 Have you looked at the actual calendar entry in the ics file?

The entry is not in the ICS file.




Re: [O] Missing Agenda Export in ICS

2014-09-10 Thread SabreWolfy
Eric S Fraga e.fraga at ucl.ac.uk writes:

 Have you looked at the actual calendar entry in the ics file?

The entry does not appear in the ICS file. Some events are being exported,
some are not.




Re: [O] default headers for source code blocks

2014-09-10 Thread Sebastien Vauban
Ken Mankoff wrote:
 What about custom template expansions?

 http://nicholasvanhorn.com/2014/04/07/org-structure-completion/

 Advantage: your C-c C-v d sql RET becomes only sql TAB.

And the last (?) solution is YASnippet: create your skeleton, and bind
it to whatever (sql TAB, for example -- even shorter, of one key
stroke, than the easy template ;-)).

Best regards,
  Seb

-- 
Sebastien Vauban




[O] Easy way of inspecting / showing value of property?

2014-09-10 Thread Rainer M Krug
Hi

From time to time my exports / tangles / executions of code blocks do
not work as expected, and in many cases this is caused by a wrong value
in the :header-arguments property.

Is there an easy way to inspect the value of this (or any other?)
property in org?

If I use the column view defined as 

,
| #+PROPERTY: header-args :tangle-mode (identity #o444)
| #+PROPERTY: header-args+ :tangle no
| #+PROPERTY: header-args+ :mkdirp yes
| #+PROPERTY: header-args+ :exports both
| #+PROPERTY: header-args+ :comments both
| #+PROPERTY: header-args+ :padline yes
| #+PROPERTY: header-args+ :eval no-export
| 
| #+PROPERTY: header-args:R :session *R_proMixStands*
| 
| #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO %header-args
`

the header-args column is always empty, although the property is set at
the file level (see above) and also at the subtree level.

Also, column view does not show the properties of code blocks.

Is there a way of showing the value of the property :header-args?

Thanks,

Rainer

-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


pgplF0E5Ozhcf.pgp
Description: PGP signature


Re: [O] latex header lines vs latex block

2014-09-10 Thread Thorsten Jolitz
Sebastien Vauban sva-n...@mygooglest.com
writes:

 Sebastien Vauban wrote:
 Thorsten Jolitz wrote:
 Sebastien Vauban sva-n...@mygooglest.com
 writes:

 See
 http://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg00744.html
 for Nicolas' answer on this point:

   ╭
   │ I suggest to use existing solutions instead: configure
   │ `org-latex-classes'.
   ╰


 a related question: is this the right format to create the preamble
 string:

 #+BEGIN_SRC emacs-lisp
 '(;; Name
   obb-article-full-page
   ;; Preamble
   (concat
\\documentclass{article}\n
[DEFAULT-PACKAGES]\n
[PACKAGES]\n
[EXTRA]\n
\\usepackage[cm]{fullpage}\n)
   ;; Sectioning Structure
   (\\part{%s} . \\part*{%s})
   (\\chapter{%s} . \\chapter*{%s}) ...)
 #+END_SRC

 not sure if I need the line-feeds ...

 Working example:

 (add-to-list 'org-latex-classes
  '(koma-article
\\documentclass{scrartcl}
[NO-DEFAULT-PACKAGES]
[EXTRA]
(\\section{%s} . \\section*{%s})
(\\subsection{%s} . \\subsection*{%s})
(\\subsubsection{%s} . \\subsubsection*{%s})
(\\paragraph{%s} . \\paragraph*{%s})
(\\subparagraph{%s} . \\subparagraph*{%s})))

 For your example to work, you'd have to replace the quote (') by
 a backquote (`) so that the `concat' can be executed...

Yes, the preamble as one string, no extra linefeeds, and no quoted
function calls ... I figured that out by trial-and-error already, but
thanks for you tips anyway!

-- 
cheers,
Thorsten




[O] Opening a code block in an indirect buffer makes the source file edited

2014-09-10 Thread Sebastien Vauban
Hello,

If you press C-c ' on a code block to open it in an indirect buffer, do
*nothing*, and press C-c ' to return to your source Org buffer, it's now
flagged as being modified.

Could this be fixed, so that the source buffer only appears as modified
in case the code block really was touched?

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Missing Agenda Export in ICS

2014-09-10 Thread Eric S Fraga
On Wednesday, 10 Sep 2014 at 07:38, SabreWolfy wrote:
 Eric S Fraga e.fraga at ucl.ac.uk writes:

 Have you looked at the actual calendar entry in the ics file?

 The entry does not appear in the ICS file. Some events are being exported,
 some are not.

Ah, so the problem is with the export from org and not the import into
Google's calendar.  Your original post was ambiguous!

Have you tried exporting that entry alone?  Have you looked at the
*Messages* buffer for any errors?  What is the entry just before the one
that doesn't export?  In other words, what have you looked at?
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.1, Org release_8.3beta-320-gb5c9de


signature.asc
Description: PGP signature


Re: [O] [PATCH] babel: ob-C with Visual C++ and compilation-mode

2014-09-10 Thread Achim Gratz
Eric Schulte writes:
 Ernesto Durante stobos...@gmail.com writes:
 + First patch, modify org-babel-eval to load compilation-mode in case
of errors


 Applied.

These are missing a proper changelog so Bastien will be less happy. 

 org-babel-eval: compilation-mode to deal with errors in (C/C++/D)

Despite the title, the change is implemented for all Babel error
buffers.  I'm not sure that's the right thing to do, but I don't see
off-hand how to easily make this a per-language setting.

 +  (compilation-mode)

Setting a mode from within lisp is pretty heavy-handed.  Since we're
calling upon an existing buffer we should check if it's already in that
mode.

 +  ;;compilation-mode enforces read-only
 +  (read-only-mode 0

That doesn't work on Emacs  24.3 and does a few other things that again
should not be done from Lisp.  I'll change this to just

 (setq buffer-read-only nil)

but compilation mode in an editable buffer is somewhat strange.  Instead
we should probably bind (inhibit-read-only t) around those places where
Babel wants to modify the buffer, but I'm not sure how to easily find
them all.

(Done in ec8f245.)


Regards
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds




Re: [O] Missing Agenda Export in ICS

2014-09-10 Thread SabreWolfy
Eric S Fraga e.fraga at ucl.ac.uk writes:

 Ah, so the problem is with the export from org and not the import into
 Google's calendar.  Your original post was ambiguous!

Yes. Thanks for the suggestion to look at the ICS file as well. I should
have thought of that :)

 Have you tried exporting that entry alone?  Have you looked at the
 *Messages* buffer for any errors?  What is the entry just before the one
 that doesn't export?  In other words, what have you looked at?

No entries of relevance in the *Messages* buffer. I was looking for
suggestions as to *what* I should look at to start trouble-shooting this.

I have solved it though. I was exporting the default week view, and
looking for entries further in the future :) I think I assumed that the
entire Agenda would be exported, not (just) the current view. If I switch
to the fortnightly view, for example, then the entry in question is
correctly exported.

Apologies for the noise.





Re: [O] Make html password protected?

2014-09-10 Thread Ian Barton

On 08/09/14 11:22, Rainer M Krug wrote:

Hi

I do not have much experience with html and websites (what an
understatement!) but I would like to publish / export a simple html page
password protected. Is ther an easy way to do it in word?

The content is not highly confidential or sensitive, just some analysis
for a paper of which I would like to provide regular feedback to my
co-authors and which should not be to easily readable by others.

Any suggestions?



It depends if you have access to your web server configuration.	If you 
are able to modify it the simplest way is to create an .htacess file in 
the directory containing your file:


AuthNameJournal
AuthTypeDigest file:
AuthUserFile/etc/httpd/journal.passwd
Require valid-user
Order   allow,deny
Satisfy any

You can create a password file with:

htdigest -c /etc/httpd/journal.passwd Journal username

To add more users omit the -c argument, which will create a new file.

Make sure you use digest authentication not basic (ie don't use 
htpasswd). Basic authentication transmits user names and passwords in 
plain text.


Ian.




Re: [O] Easy way of inspecting / showing value of property?

2014-09-10 Thread Thorsten Jolitz
Rainer M Krug rai...@krugs.de writes:

Hi,

 From time to time my exports / tangles / executions of code blocks do
 not work as expected, and in many cases this is caused by a wrong value
 in the :header-arguments property.

 Is there an easy way to inspect the value of this (or any other?)
 property in org?

 If I use the column view defined as 

 ,
 | #+PROPERTY: header-args :tangle-mode (identity #o444)
 | #+PROPERTY: header-args+ :tangle no
 | #+PROPERTY: header-args+ :mkdirp yes
 | #+PROPERTY: header-args+ :exports both
 | #+PROPERTY: header-args+ :comments both
 | #+PROPERTY: header-args+ :padline yes
 | #+PROPERTY: header-args+ :eval no-export
 | 
 | #+PROPERTY: header-args:R :session *R_proMixStands*
 | 
 | #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO %header-args
 `

 the header-args column is always empty, although the property is set at
 the file level (see above) and also at the subtree level.

 Also, column view does not show the properties of code blocks.

 Is there a way of showing the value of the property :header-args?

Try this:

#+PROPERTY: header-args :tangle-mode (identity #o444)
#+PROPERTY: header-args+ :tangle no
#+PROPERTY: header-args+ :mkdirp yes
#+PROPERTY: header-args+ :exports both
#+PROPERTY: header-args+ :comments both
#+PROPERTY: header-args+ :padline yes
#+PROPERTY: header-args+ :eval no-export
#+PROPERTY: header-args:R :session *R_proMixStands*

#+BEGIN_SRC R 
2 + 2
#+END_SRC

#+BEGIN_SRC emacs-lisp
(defun tj/get-property-values ()
  (interactive)
  (let (lst)
(org-element-map (org-element-parse-buffer) 'keyword
  (lambda (--kw)
(when (equal (org-element-property :key --kw) PROPERTY)
  (let ((val (org-element-property :value --kw)))
(setq lst
  (cons (split-string val  : t) lst))
lst))
#+END_SRC

#+results:
: tj/get-property-values

#+BEGIN_SRC emacs-lisp :results table
(tj/get-property-values)
#+END_SRC

#+results:
| header-args:R | session *R_proMixStands* |
| header-args+  | eval no-export   |
| header-args+  | padline yes  |
| header-args+  | comments both|
| header-args+  | exports both |
| header-args+  | mkdirp yes   |
| header-args+  | tangle no|
| header-args   | tangle-mode (identity #o444) |


-- 
cheers,
Thorsten




Re: [O] latex header lines vs latex block

2014-09-10 Thread Mike McLean
On Tue, Sep 9, 2014 at 10:52 AM, Thorsten Jolitz tjol...@gmail.com wrote:

 Sebastien Vauban sva-n...@mygooglest.com
 writes:

  See
 http://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg00744.html
  for Nicolas' answer on this point:
 
╭
│ I suggest to use existing solutions instead: configure
│ `org-latex-classes'.
╰


 a related question: is this the right format to create the preamble
 string:

 #+BEGIN_SRC emacs-lisp
 '(;; Name
   obb-article-full-page
   ;; Preamble
   (concat
\\documentclass{article}\n
[DEFAULT-PACKAGES]\n
[PACKAGES]\n
[EXTRA]\n
\\usepackage[cm]{fullpage}\n)
   ;; Sectioning Structure
   (\\part{%s} . \\part*{%s})
   (\\chapter{%s} . \\chapter*{%s}) ...)
 #+END_SRC

 not sure if I need the line-feeds ...


I don't think you do. I build my org-latex-classes with add-to-list, so an
example of mine is:

(add-to-list 'org-latex-classes
 '(MikeMcLean
   \\documentclass{MikeMcLean}
 [DEFAULT-PACKAGES]
 [PACKAGES]
 [EXTRA]
 
   (\\chapter{%s} . \\chapter*{%s})
   (\\section{%s} . \\section*{%s})
   (\\subsection{%s} . \\subsection*{%s})
   (\\subsubsection{%s} . \\subsubsection*{%s})
   (\\paragraph{%s} . \\paragraph*{%s})
   (\\subparagraph{%s} . \\subparagraph*{%s})))

The MikeMcLean document class (all of my 3-4 main classes, really) are a
moderate wrapper around the memoir class. A document I produce for myself
looks different than one that I produce as part of my employment or
volunteer effort(s), even though I produce them all from Org.

- Sets some class options
- Requires some packages I use a lot (minted, e.g.)
- Defines some fonts and colors.
- Sets page options (footers, chapter headers, sectioning, etc.)
- Defines a title page






 --
 cheers,
 Thorsten





Re: [O] Managing articles in orgmode and collaboration

2014-09-10 Thread Christoph Groth
Jorge A. Alfaro-Murillo wrote:

 Thomas S. Dye writes: 

 I don't manage my bibliography references in Org mode.  I am used to
 managing a bibtex database and have never found the need to move
 everything to Org.

 Same here.

My motivation for keeping bibliography in org was to keep all local
information about a paper (including notes and comments) in one place.
This should make it easier to find it.

Meanwhile I found org-bibtex.  It seems to implement just what I had in
mind and is even included in orgmode by default.  The following function
can be used to save a org-bibtex headline into the kill-ring in bib
format, so that it can be yanked into a project-specific .bib-file:

(defun my-org-bibtex-kill-ring-save-headline ()
  (interactive)
  (kill-new (org-bibtex-headline)))

 Either a separate bibtex file for each article, or separate bibtex
 files for each co-author.

 Or better do both...

 #+BEGIN_SRC latex 
   \bibliography{/home/you/references/articles.bib}
   % \bibliography{/home/collaborator_1/references/articles.bib}
   % \bibliography{/home/collaborator_2/references/articles.bib}
   ...
   \bibliography{references}
  
 #+END_SRC

 When a collaborator_i is working on the file she/he comments the first
 line and uncomments the i-th line AND everybody runs
 reftex-create-bibtex-file (or copy paste the new references for the
 unfortunate non-emacs user) after adding new references and finishing
 editing. Everybody shares a current version of the .tex file and the
 references.bib file.

I like to keep papers under version control, and the commenting that you
suggest does not seem to fit this way of working very well.




Re: [O] Missing Agenda Export in ICS

2014-09-10 Thread Eric S Fraga
On Wednesday, 10 Sep 2014 at 09:24, SabreWolfy wrote:

[...]

 I have solved it though. I was exporting the default week view, and
 looking for entries further in the future :) I think I assumed that the
 entire Agenda would be exported, not (just) the current view. If I switch
 to the fortnightly view, for example, then the entry in question is
 correctly exported.

Ah, this makes sense although it can be confusing initially.  Glad you
sorted it.  We always welcome changes to the documentation, by the
way...

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.1, Org release_8.3beta-320-gb5c9de


signature.asc
Description: PGP signature


[O] Bug (regression) in org-replace-disputed-keys. Bisected.

2014-09-10 Thread Teika Kazura
Hello, org-world. I experience a regression in org-replace-disputed-keys, and I 
git-bisected it.

* Symptom: org-replace-disputed-keys doesn't work for me.
Emacs version: GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.0.12)

* How to reproduce it:
1. Put the org to /tmp/org-mode
2. Save the following lisp to foo.el
---
(progn
  (setq org-replace-disputed-keys t)
  (setq org-disputed-keys
'(([(shift up)] . [(ctrl up)])
  ([(shift down)] . [(ctrl down)])
  ([(shift left)] . [(ctrl left)])
  ([(shift right)] . [(ctrl right)])
  ([(shift meta right)] . [(shift control right)])
  ([(shift meta left)] . [(shift control left)])
  ([(shift meta up)] . [(shift control up)])
  ([(shift meta down)] . [(shift control down)])
  ([(shift control right)] . [(shift meta right)])
  ([(shift control left)] . [(shift meta left)]))
)
  (add-to-list 'load-path (expand-file-name /tmp/org-mode/lisp))
  (pop-to-buffer *scratch*)
  (insert *  (org-version)  ( (org-git-version) )\n )
  (require 'org)
  (org-mode))

3. Run emacs with 
  $ emacs -Q -l foo.el
4. M-x org-schedule, and press ctrl+cursor.

It should replace shift+cursor, but it doesn't. `describe-key' for C-down 
says:

C-down runs the command forward-paragraph, which is an interactive
compiled Lisp function in `paragraphs.el'

* The bad commit
The exact bad commit can't be tracked (org fails to initialize), but I narrowed 
it down to 6 commits. It was done between 
9a0e84fbd7b0e25cf49613e787d572f3c71723dc and 
8ad6f534f9b24f273b7699199df34c0f44f9059f .
I here show the diff for org.el in that period. The last 2 hunks looks 
relevant:

diff --git a/lisp/org.el b/lisp/org.el
index aebf58f..7f0717e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6897,7 +6897,7 @@ of the first headline in the buffer.  This is important, 
because if the
 first headline is not level one, then (hide-sublevels 1) gives confusing
 results.
   (interactive)
-  (let ((l (org-current-line))
+  (let ((pos (point))
(level (save-excursion
 (goto-char (point-min))
 (if (re-search-forward (concat ^ outline-regexp) nil t)
@@ -6906,7 +6906,7 @@ results.
   (funcall outline-level))
 (and level (hide-sublevels level))
 (recenter '(4))
-(org-goto-line l)))
+(goto-char pos)))
 
 (defun org-content (optional arg)
   Show all headlines in the buffer, like a table of contents.
@@ -14050,10 +14050,19 @@ See also `org-scan-tags'.
minus tag mm
tagsmatch todomatch tagsmatcher todomatcher kwd matcher
orterms term orlist re-p str-p level-p level-op time-p
-   prop-p pn pv po gv rest)
+   prop-p pn pv po gv rest (start 0) (ss 0))
 ;; Expand group tags
 (setq match (org-tags-expand match))
-(if (string-match /+ match)
+
+;; Check if there is a TODO part of this match, which would be the
+;; part after a /.  TO make sure that this slash is not part of
+;; a property value to be matched against, we also check that there
+;; is no  after that slash.
+;; First, find the last slash
+(while (string-match /+ match ss)
+  (setq start (match-beginning 0) ss (match-end 0)))
+(if (and (string-match /+ match start)
+(not (save-match-data (string-match \ match start
;; match contains also a todo-matching request
(progn
  (setq tagsmatch (substring match 0 (match-beginning 0))
@@ -16126,7 +16135,8 @@ So these are more for recording a certain time/date.
 (defvar org-read-date-inactive)
 
 (defvar org-read-date-minibuffer-local-map
-  (let ((map (make-sparse-keymap)))
+  (let* ((org-replace-disputed-keys nil)
+(map (make-sparse-keymap)))
 (set-keymap-parent map minibuffer-local-map)
 (org-defkey map (kbd .)
 (lambda () (interactive)
@@ -16286,7 +16296,6 @@ user.
  (calendar-current-date
(org-eval-in-calendar nil t)
(let* ((old-map (current-local-map))
-  (org-replace-disputed-keys nil)
   (map (copy-keymap calendar-mode-map))
   (minibuffer-local-map
(copy-keymap org-read-date-minibuffer-local-map)))


Thank you very much for developing org-mode.

Kind regards,
Teika (Teika kazura)

# Hey, it was almost exacly a year ago. Only few use this feature? ;]



[O] [bug suspected] Org tangles #+HEADER in the source code when using :comments org

2014-09-10 Thread Roland Donat
Dear orgmode community,

My problem is very simple. I have the following piece of org buffer :

 My piece of org buffer 
* Exemple : =hello_world=

Some very explicit comments...

#+HEADER: :tangle ./hello_world.py
#+HEADER: :padline yes
#+HEADER: :eval no
#+HEADER: :comments org
#+HEADER: :exports none
#+BEGIN_SRC python
a = Hello World!
#+END_SRC
 end of org buffer 

When I tangle the file, I would have expected this :

 expected hello_world.py 
## Exemple : hello_world

## Some very explicit comments

a = Hello World
 end of expected hello_world.py 

But instead, I get :

 hello_world.py 
## Exemple : hello_world

## Some very explicit comments

## #+HEADER: :tangle ./hello_world.py
## #+HEADER: :padline yes
## #+HEADER: :eval no
## #+HEADER: :comments org
## #+HEADER: :exports none
a = Hello World
 end of hello_world.py 

I can imagine my question : Why org keeps the ## #+HEADER lines when 
tangling? Is it possible to remove it? Is it a bug?

I use org-mode 8.2.5h on Linux.

Thank you very much for your help!

Cheers,

Roland.





Re: [O] [PATCH] org-table-beginning/end-of-field

2014-09-10 Thread Nicolas Goaziou
Hello,

Florian Beck f...@miszellen.de writes:

 I hope the new version is an improvement.

Thanks for the update.

 But as long as I have a table cell ancestor, I should be fine. Am
 I missing something?

Yes. There are some place where `org-element-context' will return
a `table-row' or `table' object even though you can technically move to
the next (or maybe previous) cell. You may want to try
`org-element-context' in the following places, where X denotes cursor:

  | a | b |
  X c | d |

  X a | b |
  | c | d |

X | a | b |
  | c | d |

  | a | b | X
  | c | d |

  | a | b |
X | c | d |

 I added a function `org-element-get' to help with that. What do you
 think? (If `cl-labels' is a no-go, we could split out a helper
 function.)

I don't think `org-element-get' should go into org-element.el in its
current implementation. It is tied to a position, which implies to take
care of boring stuff like buffer narrowing. It doesn't allow to re-use
an already computed element or object either, which is sub-optimal.

However, the feature is useful enough that some function could provide
something similar. Maybe the following one:

  (defun org-element-parent (blob optional types genealogy)
Return BLOB's parent, or nil.

  BLOB is an object or element.

  When optional argument TYPES is a list of symbols, return the
  first element or object between BLOB and its ancestors whose type
  belongs to that list.

  When optional argument GENEALOGY is non-nil, return a list of all
  ancestors, from closest to farthest.

  When BLOB is obtained through `org-element-context' or
  `org-element-at-point', only ancestors from its section can be
  found. There is no such limitation when BLOB belongs to a full
  parse tree.
(if (not (or types genealogy)) (org-element-property :parent blob)
  (let ((up blob) ancestors)
(while (and up (not (memq (org-element-type up) types)))
  (when genealogy (push up ancestors))
  (setq up (org-element-property :parent up)))
(if genealogy (nreverse ancestors) up

Its name is a bit confusing since it can return BLOB under some optional
argument combination (i.e., if BLOB's type belongs to TYPES). However,
it covers most, if not all, needs about ancestors. WDYT?

 I added a couple of tests. Not really succinct, though.

Thanks.

 Also, I modified `org-element-table-cell-parser', because otherwise
 :contents-begin and :contents-end point to the end of the cell. Not sure
 if this breaks anything.

Usually, when an object has no contents (e.g., a link without
description), both :contents-begin and :contents-end are nil. It is less
confusing than providing an arbitrary buffer position.

 +(let ((cell (or (org-element-get 'table-cell)
 + ;; Fuzzy matching when on a table border:
 + (org-element-get 'table-cell (1+ (point)))
 + (org-element-get 'table-cell (1- (point))

We need to be more careful here, as explained above.

 +  (should
 +   (org-test-with-temp-text
 +| Cell:1   | Cell2 |Cell3|\n| Cell4 | | Cell5|
 +(search-forward :)

Minor note: you can insert point in the string to avoid finding the
correct position later. E.g.,

  | Cell:point1   | Cell2 |Cell3|\n| Cell4 | | Cell5|


Regards,

-- 
Nicolas Goaziou



[O] Intermittent issues with hyperlinks in org docs

2014-09-10 Thread Haider Rizvi
Lately, I have a problem with hyperlinks in org-mode. Wondering if
anyone has seen this issue.

From time to time, some hyperlinks in an org document show up as if
they are regular text, instead of a collapsed hyperlink. So the
following just shows as plain text:

[[https://news.google.com/news][Google News]]

instead of showing up as a collapsed hyperlink as it should: 

Google News

At this time, only a few hyperlinks in the doc behave this way, and if
I go to the link above and edit something (e.g, add a space at the
end, etc.) it collapses immediately.

I am running org-mode from melpa-stable:
Org-mode version 8.2.7c (8.2.7c-57-g37bf05-elpa @ 
/usr/local/Cellar/emacs-mac/emacs-24.3-mac-4.8/share/emacs/24.3/lisp/org/)
GNU Emacs 24.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2013-03-13 
on bob.porkrind.org

Anyone seen this, or have a hint on where can I look. It may very well
in something in my init, but I haven't changed much re: org settings
for a while.

I did a quick test with the base Emacs, no init files, and the default
org-mode drop:

Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ 
/Applications/Emacs.app/Contents/Resources/lisp/org/)

Didn't see the same issue immediately.


Regards, 
-- 
Haider




Re: [O] Managing articles in orgmode and collaboration

2014-09-10 Thread Jorge A. Alfaro-Murillo
Christoph Groth writes: 

My motivation for keeping bibliography in org was to keep all 
local information about a paper (including notes and comments) 
in one place.  This should make it easier to find it. 


In BibTeX if any field contains an entry that is not part of the 
required or optional entries for the field type, that entry is 
ignored.  So you can do want you want in a single bib file, just 
include for every field that you want a COMMENTS entry. The 
NOTE entry is an optional entry for the field type article and 
book, so you have to use something else, I use ANNOTE, since it 
is the standard to be ignored entry in the emacs BibTeX mode.


I like to keep papers under version control, and the commenting 
that you suggest does not seem to fit this way of working very 
well. 


Then change it to:

#+BEGIN_SRC latex
 \include{personal_references}
 \bibliography{references.bib}
#+END_SRC

And in personal_references.tex, every user has just one line:

#+BEGIN_SRC latex
 \bibliography{the_user_path_to_her/his_references.bib}
#+END_SRC

Add personal_references.tex to the .gitignore file (or the 
equivalent if you are not using git), and then you have version 
control and no more commenting/uncommenting.


Perhaps I am biased because I learned LaTeX and BibTeX before Org, 
but I think that for references BibTeX (plus a little bit of emacs 
configuration) has everything I could need. I guess if you are 
more used to Org, it might be worth to invest time and come up 
with a org-based solution. Please keep us posted, I find this a 
very interesting thread.


Cheers,

--
Jorge.




Re: [O] [PATCH] org-table-beginning/end-of-field

2014-09-10 Thread Florian Beck
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 the next (or maybe previous) cell. You may want to try
 `org-element-context' in the following places, where X denotes cursor:

   | a | b |
   X c | d |

   X a | b |
   | c | d |

This I did.


 X | a | b |
   | c | d |

   | a | b | X
   | c | d |

   | a | b |
 X | c | d |

This is arguably outside the scope of org-table-beginning/end, isn't it?

Come to think of it, these functions should only move to the
beginning or end of the field, period. Then handle the special case in
org-forward/backward-sentence or create two new functions.

 I don't think `org-element-get' should go into org-element.el in its
 current implementation. It is tied to a position, which implies to take
 care of boring stuff like buffer narrowing. It doesn't allow to re-use
 an already computed element or object either, which is sub-optimal.

Yes, it should be split into two functions.

 However, the feature is useful enough that some function could provide
 something similar. Maybe the following one:

   (defun org-element-parent (blob optional types genealogy)
 Return BLOB's parent, or nil.

   BLOB is an object or element.

   When optional argument TYPES is a list of symbols, return the
   first element or object between BLOB and its ancestors whose type
   belongs to that list.

   When optional argument GENEALOGY is non-nil, return a list of all
   ancestors, from closest to farthest.

   When BLOB is obtained through `org-element-context' or
   `org-element-at-point', only ancestors from its section can be
   found. There is no such limitation when BLOB belongs to a full
   parse tree.
 (if (not (or types genealogy)) (org-element-property :parent blob)
   (let ((up blob) ancestors)
 (while (and up (not (memq (org-element-type up) types)))
   (when genealogy (push up ancestors))
   (setq up (org-element-property :parent up)))
 (if genealogy (nreverse ancestors) up

 Its name is a bit confusing since it can return BLOB under some optional
 argument combination (i.e., if BLOB's type belongs to TYPES). However,
 it covers most, if not all, needs about ancestors. WDYT?

Yes this works. Making TYPES into a list is a nice touch. However:
 - the advertised functionality (returning the parent) is only
 marginally useful and handled in half a line of code; whereas most of
 the functionality is hidden as optional;
 - this leads to confusing behaviour, as you have noted, because
 the type of object I'm looking for, is not necessarily the parent;
 - BLOB on the other hand should be optional, because defaulting it to
 org-element-context would be highly useful.
 - not sure what GENEALOGY is useful for; if the user also specified
 TYPES, this returns the ancestors up to but NOT including those of TYPE.

 Also, I modified `org-element-table-cell-parser', because otherwise
 :contents-begin and :contents-end point to the end of the cell. Not sure
 if this breaks anything.

 Usually, when an object has no contents (e.g., a link without
 description), both :contents-begin and :contents-end are nil. It is less
 confusing than providing an arbitrary buffer position.

That's another possibility. Unlike a link without description, one might
argue that an empty cell has a natural contents position.


 Minor note: you can insert point in the string to avoid finding the
 correct position later. E.g.,

   | Cell:point1   | Cell2 |Cell3|\n| Cell4 | | Cell5|

Great, thanks!


-- 
Florian Beck




[O] Lisp error: wrong-number-of-arguments when publishing current project file

2014-09-10 Thread Sebastien Vauban
Hello,

When publishing a site project, or some file from it, I get the
following error:

--8---cut here---start-8---
Debugger entered--Lisp error: (wrong-number-of-arguments #[(optional force) 
\303 ^X\304\216   ?\205^K^@
^Z\305\306 !+\207 [wconfig force org-publish-use-timestamps-flag 
current-window-configuration ((set-window-configuration wconfig)) 
org-publish-file buffer-file-name] 2 (c:/Program Files 
(x86)/emacs-24.3/lisp/org/org-publish.elc . 30759) P] 2)
  org-publish-current-file(nil nil)
  (cond ((eql action (quote template)) (org-export-insert-default-template nil 
optns)) ((eql action (quote stack)) (org-export-stack)) ((eql action (quote 
publish-current-file)) (org-publish-current-file (memq (quote force) optns) 
(memq (quote async) optns))) ((eql action (quote publish-current-project)) 
(org-publish-current-project (memq (quote force) optns) (memq (quote async) 
optns))) ((eql action (quote publish-choose-project)) (org-publish (assoc 
(org-icompleting-read Publish project:  org-publish-project-alist nil t) 
org-publish-project-alist) (memq (quote force) optns) (memq (quote async) 
optns))) ((eql action (quote publish-all)) (org-publish-all (memq (quote force) 
optns) (memq (quote async) optns))) (t (save-excursion (if arg (progn (if (eq 
(marker-buffer org-export-dispatch-last-position) (org-base-buffer ...)) 
(goto-char org-export-dispatch-last-position) (move-marker 
org-export-dispatch-last-position nil (funcall action (and (memq (quote 
async) optns) t) (and (memq (quote subtree) optns) t) (and (memq (quote 
visible) optns) t) (and (memq (quote body) optns) t)
  (let* ((input (cond ((equal arg (quote (16))) (quote (stack))) ((and arg 
org-export-dispatch-last-action)) (t (let ((wconfig ...)) (unwind-protect 
(progn ...) (set-window-configuration wconfig)) (action (car input)) (optns 
(cdr input))) (if (memq (quote subtree) optns) nil (move-marker 
org-export-dispatch-last-position nil)) (cond ((eql action (quote template)) 
(org-export-insert-default-template nil optns)) ((eql action (quote stack)) 
(org-export-stack)) ((eql action (quote publish-current-file)) 
(org-publish-current-file (memq (quote force) optns) (memq (quote async) 
optns))) ((eql action (quote publish-current-project)) 
(org-publish-current-project (memq (quote force) optns) (memq (quote async) 
optns))) ((eql action (quote publish-choose-project)) (org-publish (assoc 
(org-icompleting-read Publish project:  org-publish-project-alist nil t) 
org-publish-project-alist) (memq (quote force) optns) (memq (quote async) 
optns))) ((eql action (quote publish-all)) (org-publish-all (memq (quote force) 
optns) (memq (quote async) optns))) (t (save-excursion (if arg (progn (if (eq 
... ...) (goto-char org-export-dispatch-last-position) (move-marker 
org-export-dispatch-last-position nil (funcall action (and (memq (quote 
async) optns) t) (and (memq (quote subtree) optns) t) (and (memq (quote 
visible) optns) t) (and (memq (quote body) optns) t))
  org-export-dispatch(nil)
  funcall(org-export-dispatch nil)
--8---cut here---end---8---

Do you have an idea how to chase this problem?

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Some thoughts on MobileOrg and its development ....

2014-09-10 Thread Samuel Loury
Samuel Loury konubi...@gmail.com writes:

 I have been using the XML-RPC trac plugin³ for a while now and I made we
 wonder if we could reproduce this in the scope of mobile org. With an
 RPC interface, one would be free to create their own interface easily
 (at least python xml-rpc library is really easy to manipulate) and an
 official interface could emerge from that.
I have made a some research on the net and found epc¹. This library
appears to do exactly what I am looking for: a remote procedure call
mechanism in emacs.

For what I have tried so far, it looks very promising.

To install the python side, just run:
--8---cut here---start-8---
pip install epc
--8---cut here---end---8---

To install the emacs server part, it is a bit trickier since elpa ships
only the client part. It was not so hard though.  I installed deferred²,
ctable³ and epc⁴. Then I could launch the emacs rpc server.

For the time being, I only tried exporting the org agenda files. And it
was really easy.

The server code (in emacs) looks like:
--8---cut here---start-8---
(require 'cl)
(require 'epcs)

(defvar pyepc-epcs
  (epcs:server-start
   (lambda (mngr)
 (lexical-let ((mngr mngr))
   (epc:define-method mngr 'org-agenda-files 'org-agenda-files)
   )
 )
   9998
   )
  )
--8---cut here---end---8---

The client code (in python) looks like:
--8---cut here---start-8---
From epc.client import EPCClient
client = EPCClient((localhost, 9998), log_traceback=True)
print str(client.methods_sync())
print str(client.call_sync('org-agenda-files', []))
client.close()
--8---cut here---end---8---

In conclusion, the communication between emacs and python is very
easy. The difficult part now, is to re-factorise the emacs org-mode code
that creates the agenda so that it may provide a data structure
representing the information. I have only had a quick look, but it does
not look straight.

I think it is not much work to get a workable emacs on android⁵ and I
honestly don't know on iPhone.

Once it is done, it would be hopefully easy to configure emacs to run
the epcs code and use anything python based to communicate with it. I
will probably use sl4a⁶ since it is totally awesome.

The aspect I like about the design I propose is that the core (emacs +
epcs) is loosely coupled with the interface. This way, anyone would be
free to provide their one.

What do you think about this project. Do you think it could work? I
think I will eventually start it anyway (just to see). Off course, since
I am also a busy person, it would probably slow, but I honestly think it
would be worth it. Anyone would like to contribute?

Thanks for reading.

¹ http://python-epc.readthedocs.org/en/latest/
² https://github.com/kiwanami/emacs-deferred.git
³ https://github.com/kiwanami/emacs-ctable.git
⁴ https://github.com/kiwanami/emacs-epc.git
⁵ http://article.gmane.org/gmane.emacs.orgmode/77698
⁶ https://code.google.com/p/android-scripting/
--
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpEzYPVBLQ0D.pgp
Description: PGP signature


Re: [O] Lisp error: wrong-number-of-arguments when publishing current project file

2014-09-10 Thread Nick Dokos
Sebastien Vauban sva-n...@mygooglest.com
writes:

 Hello,

 When publishing a site project, or some file from it, I get the
 following error:

 Debugger entered--Lisp error: (wrong-number-of-arguments #[(optional force) 
 \303 ^X\304\216 ?\205^K^@
 ^Z\305\306 !+\207 [wconfig force org-publish-use-timestamps-flag 
 current-window-configuration ((set-window-configuration wconfig)) 
 org-publish-file buffer-file-name] 2 (c:/Program Files 
 (x86)/emacs-24.3/lisp/org/org-publish.elc . 30759) P] 2)
   org-publish-current-file(nil nil)
   ...

 Do you have an idea how to chase this problem?


First thing I would do is delete the org-publish.elc file and try with
uncompiled org-publish.el. That should at least give you a better
backtrace.

Nick