Re: [O] Bug: org-master (release_8.3beta-56-gdb0130) ascii exporter ignores org-export-preserve-breaks

2014-09-06 Thread Nicolas Goaziou
Hello,

Yijun Yuan bbb...@fedoraproject.org writes:

 The commit b15a9c0c1 breaks my use case. In the document of option Org
 Export Preserve Breaks, ASCII export is explicitly mentioned: In ASCII
 export, line breaks will always be preserved, regardless of this
 variable.

This is not true anymore since Org 8.0. Line breaks are not preserved in
ASCII export unless the appropriate variable is non-nil (which is not
the case by default).


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Incorrect folding of source blocks [8.2.7c (8.2.7c-51-g896fa6-elpa @ /Users/sean/Dropbox/.emacs.d/elpa/org-20140825/)]

2014-09-06 Thread Nicolas Goaziou
Hello,

Sean Allred c...@seanallred.com writes:

 Consider the following:

 #+begin_src snippet :tangle .emacs.d/snippets/org-mode/emacs-lisp
 # -*- mode: snippet; require-final-newline: nil -*-
 # name: emacs-lisp
 # key: el
 # binding: direct-keybinding
 # --
 ,#+begin_src emacs-lisp
 $0
 ,#+end_src
 test
 #+end_src

 Now, fold the section. You will see

 #+begin_src snippet :tangle .emacs.d/snippets/org-mode/emacs-lisp...
 test
 #+end_src

 My guess is the folding function is going up to the first end_src it
 sees and stopping there, not checking to see whether it is actually an
 active line.

This bug should already be fixed in Org 8.3. However, the fix cannot be
backported to Org 8.2.


Regards,

-- 
Nicolas Goaziou



Re: [O] Moving my init.el to Org

2014-09-06 Thread Eduardo Ochs
Hi all, I hope you don't mind me jumping into this thread to ask an
org-beginner question...

My .emacs is about 15000 lines long, and that's fine for me because I
have anchors at some points of it, and an index at the top, and
convenient ways to jump quickly to any anchors. If anyone is curious,
here are some links - my package that implements those things is
called eev.

  http://angg.twu.net/.emacs.html
  http://angg.twu.net/eev-intros/find-eval-intro.html
  http://angg.twu.net/eev-intros/find-anchors-intro.html
  http://angg.twu.net/#eev

I know that Org implements something similar to that, but I don't know
how to use it. This sexp, when executed,

  (find-angg .emacs unquote-printable)

Jumps to the first occurrence of the string unquote-printable in
my ~/.emacs - in the htmlized version, the target of that sexp is:

  http://angg.twu.net/.emacs.html#unquote-printable

So, questions:

1) what is the user-ish way to create a link in Org to the first
   occurrence of the string unquote-printable in ~/.emacs?

2) I know that Org lets users implement new kinds of hyperlinks. If
   the syntax for doing what I asked in (1) is too clumsy, how do we
   implement a better syntax?

3) The

 (find-angg .emacs unquote-printable)

   calls my functions to visit a file and jump to a position. How can
   I jump to that position using Org's functions *from Lisp*? Or,
   better, how do we write sexps to expose what Org does? My guess is
   that that would be done be several sexps, more or less like this
   pseudocode:

 (org-hyperlink-method-and-args file:///~/.emacs#unquote-printable)
 ;; -- (file-and-anchor ~/.emacs unquote-printable)

 (org-hyperlink-do 'file-and-anchor ~/.emacs unquote-printable)


  Thanks in advance! =)
  Eduardo Ochs
  eduardoo...@gmail.com
  http://angg.twu.net/#eev

On Fri, Sep 5, 2014 at 11:49 PM, Thorsten Jolitz tjol...@gmail.com wrote:
 Marcin Borkowski mb...@wmi.amu.edu.pl writes:

 Hi,

 and thanks for all the great replies!

 I ended up using orgstruct mode, which is probably the simplest one,
 and (AFAIU) it will enable me to switch easily to outshine if (when?)
 orgstruct is not enough for me.

 And now there's another problem: I'd like to have my init file
 collapsed to only headlines on opening.  Since I visit my init file
 through a custom command (which finds it and turns on orgstruct), I
 don't need to use file local variables for that - I just need a
 command to do it.  So:

 how do I (programmatically, in elisp) collapse the view of
 an orgstruct .el file?

 Try 'org-overview'. Both, 'org-overview' and 'show-all' work
 with outshine too, so they should work with org-struct.

 --
 cheers,
 Thorsten





[O] tables question

2014-09-06 Thread Jude DaShiell
Can anything be put into a table for org-mode that will prompt a user with 
each column heading as the user tabs into that column?  I expect for 
especially large tables either horizontally or vertically this would be of 
assistance to data entry so as to prevent wrong information from getting 
into wrong columns.



jude jdash...@shellworld.net




Re: [O] Moving my init.el to Org

2014-09-06 Thread Thorsten Jolitz
Eduardo Ochs eduardoo...@gmail.com writes:

Hi, 

 So, questions:

 1) what is the user-ish way to create a link in Org to the first
occurrence of the string unquote-printable in ~/.emacs?

see http://orgmode.org/manual/Internal-links.html


 2) I know that Org lets users implement new kinds of hyperlinks. If
the syntax for doing what I asked in (1) is too clumsy, how do we
implement a better syntax?

and if its not too clumpsy? ;)

 3) The

  (find-angg .emacs unquote-printable)

calls my functions to visit a file and jump to a position. How can
I jump to that position using Org's functions *from Lisp*? 


maybe calling

,[ C-h f org-store-link RET ]
| org-store-link is an interactive autoloaded compiled Lisp function in
| `org.el'.
| 
| (org-store-link ARG)
| 
| Store an org-link to the current location.
| This link is added to `org-stored-links' and can later be inserted
| into an org-buffer with C-c C-l.
| 
| For some link types, a prefix arg is interpreted.
| For links to Usenet articles, arg negates `org-gnus-prefer-web-links'.
| For file links, arg negates `org-context-in-file-links'.
| 
| A double prefix arg force skipping storing functions that are not
| part of Org's core.
| 
| A triple prefix arg force storing a link for each line in the
| active region.
| 
| [back]
`

Unfortunately many many org commands do not expose their args as
function arguments but unconditionally prompt for them, which makes
(re)using them in programs pretty difficult and is a real shame IMO.

One would need to change signature and interactive spec for many org
commands to make them easily available as kind of 'library functions',
and add an option for suppressing any user prompting for non-interactive
use. Then direct binding to keys would not be possible anymore, one
would need to use convenience commands or lambda expressions that take
care of the function arguments. 

-- 
cheers,
Thorsten




Re: [O] crypt and sync

2014-09-06 Thread Alexis

Hannes Schulz writes:

 Shouldn't org-crypt disregard property drawers?

The current org-contacts format stores contact details in property
drawers; were it ignored by org-crypt, all those details would be lost
in the encryption process. So ignoring of property drawers by org-crypt
would probably best be controlled by an in-buffer setting or an
org-crypt variable.


Alexis.



[O] Tangle source block with options :comments org

2014-09-06 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?

I use org-mode 8.2.5h on Linux.

Thank you very much for your help!

Cheers,

Roland.











Re: [O] [PATCH] remap orgtbl-ascii-plot to C-c #

2014-09-06 Thread Thierry Banel
Le 03/09/2014 20:22, Nicolas Goaziou a écrit :

 It looks good but I realized (a bit late) we cannot use C-c p as it is
 reserved to users, as any C-c LETTER combination.



Here is a patch to change the key-binding of `orgtbl-ascii-plot'
from C-c p to C-c #
(The little grid symbol # seems appropriate for a plot).
(But of course another key combination is still possible).

C-c # is already mapped to `org-update-statistics-cookies'.
It makes sense only on a header with a cookie like this:
* Header [12/45]

Therefore I made this key-binding context-sensitive.
The current behavior remains unchanged.

(Many other Org key bindings are context-sensitive:
 C-c C-x L`org-shiftmetaleft'
 C-c down`org-shiftdown'
 C-c C-x M-w `org-copy-special'
 C-c *`org-ctrl-c-star'
 and so on).

Have fun
Thierry


From 3b333fa06f706a06485a5795005b3d571cd1526b Mon Sep 17 00:00:00 2001
From: Thierry Banel tbanelweb...@free.fr
Date: Sat, 6 Sep 2014 15:59:18 +0200
Subject: [PATCH] orgtbl-ascii-plot remapped from C-c p to C-c #

* org-table.el (orgtbl-setup): change key-binding
from C-c p to C-c #
* org.el (orgtbl-ascii-plot): declare `orgtbl-ascii-plot'
(org-update-statistics-cookies-or-plot): a new dispatcher
function
(org-mode-map): remap C-c # from `org-update-statistics-cookies'
to `org-update-statistics-cookies-or-plot',
remove old C-c p key-binding
---
 lisp/org-table.el |  2 +-
 lisp/org.el   | 14 --
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index 547f933..4695745 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -4327,7 +4327,7 @@ to execute outside of tables.
 	 [Move Column Right org-metaright :active (org-at-table-p) :keys M-right]
 	 [Delete Column org-shiftmetaleft :active (org-at-table-p) :keys M-S-left]
 	 [Insert Column org-shiftmetaright :active (org-at-table-p) :keys M-S-right]
-	 [Ascii plot orgtbl-ascii-plot :active (org-at-table-p) :keys C-c p])
+	 [Ascii plot orgtbl-ascii-plot :active (org-at-table-p) :keys C-c #])
 	(Row
 	 [Move Row Up org-metaup :active (org-at-table-p) :keys M-up]
 	 [Move Row Down org-metadown :active (org-at-table-p) :keys M-down]
diff --git a/lisp/org.el b/lisp/org.el
index 649808c..e6a13ef 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -163,6 +163,7 @@ Stars are put in group 1 and the trimmed body in group 2.)
 (declare-function org-table-paste-rectangle org-table ())
 (declare-function org-table-maybe-eval-formula org-table ())
 (declare-function org-table-maybe-recalculate-line org-table ())
+(declare-function orgtbl-ascii-plot org-table (optional ask))
 
 (declare-function org-element-at-point org-element ())
 (declare-function org-element-cache-reset org-element (optional all))
@@ -12842,6 +12843,16 @@ This should be called with the cursor in a line with a statistics cookie.
 	(goto-char pos)
 	(move-marker pos nil)
 
+(defun org-update-statistics-cookies-or-plot (arg)
+  Update statistic cookie or plot.
+Calls `orgtbl-ascii-plot' or `org-update-statistics-cookies',
+depending on context.
+See the individual commands for more information.
+  (interactive P)
+  (if (org-at-table-p)
+  (orgtbl-ascii-plot arg)
+(org-update-statistics-cookies arg)))
+
 (defvar org-entry-property-inherited-from) ;; defined below
 (defun org-update-parent-todo-statistics ()
   Update any statistics cookie in the parent of the current headline.
@@ -19464,7 +19475,7 @@ boundaries.
 (org-defkey org-mode-map \C-c^'org-sort)
 (org-defkey org-mode-map \C-c\C-c 'org-ctrl-c-ctrl-c)
 (org-defkey org-mode-map \C-c\C-k 'org-kill-note-or-show-branches)
-(org-defkey org-mode-map \C-c#'org-update-statistics-cookies)
+(org-defkey org-mode-map \C-c#'org-update-statistics-cookies-or-plot)
 (org-defkey org-mode-map [remap open-line] 'org-open-line)
 (org-defkey org-mode-map [remap comment-dwim] 'org-comment-dwim)
 (org-defkey org-mode-map [remap forward-paragraph] 'org-forward-paragraph)
@@ -19477,7 +19488,6 @@ boundaries.
 (org-defkey org-mode-map \C-c='org-table-eval-formula)
 (org-defkey org-mode-map \C-c''org-edit-special)
 (org-defkey org-mode-map \C-c`'org-table-edit-field)
-(org-defkey org-mode-map \C-cp'orgtbl-ascii-plot)
 (org-defkey org-mode-map \C-c|'org-table-create-or-convert-from-region)
 (org-defkey org-mode-map [(control ?#)] 'org-table-rotate-recalc-marks)
 (org-defkey org-mode-map \C-c~'org-table-create-with-table.el)
-- 
1.9.1



[O] Bug? Or new behavior? Paragraphs in HTML

2014-09-06 Thread Richard Lawrence
Hi everyone,

After updating this morning, I notice that when

#+BEGIN_SRC org
* My headline
Some text here.
#+END_SRC

is exported to HTML, the paragraph below the headline is no longer
wrapped in a paragraph tag:

#+BEGIN_SRC html
h2 id=sec-1span class=section-number-21/span My headline/h2
div class=outline-text-2 id=text-1
Some text here.
/div
#+END_SRC

Whereas if there is more than one paragraph below the headline, they
are:

#+BEGIN_SRC org
* My headline
Some text here.

What about here?

Or here?
#+END_SRC 

becomes

#+BEGIN_SRC html
h2 id=sec-1span class=section-number-21/span My headline/h2
div class=outline-text-2 id=text-1
p
Some text here.
/p

p
What about here?
/p

p
Or here?
/p
/div
#+END_SRC 

I am guessing this is the result of commit
9a34a13c077f592c5528d95c155ecdf2d655937e.

Is this now the expected behavior for paragraphs, even *outside* of
lists?  Personally I find this a bit unexpected.  It broke my CSS, and I
am not sure what the best way to fix it is.  What should I do if I want
to style all the blocks of text on a page, since some will be wrapped in
p tags and others won't be, depending on whether there are other
paragraphs in the same div?
 
Best,
Richard




Re: [O] Bug? Or new behavior? Paragraphs in HTML

2014-09-06 Thread Nicolas Goaziou
Hello,

Richard Lawrence richard.lawre...@berkeley.edu writes:

 After updating this morning, I notice that when

 #+BEGIN_SRC org
 * My headline
 Some text here.
 #+END_SRC

 is exported to HTML, the paragraph below the headline is no longer
 wrapped in a paragraph tag:

[...]

 Is this now the expected behavior for paragraphs, even *outside* of
 lists?

No, it's a bug, which should now be fixed. Thank you.


Regards,

-- 
Nicolas Goaziou



[O] [PATCH] Refresh appointments from org files exclusively

2014-09-06 Thread Jorge A. Alfaro-Murillo

Hi,

I sometimes use appt-add as an alarm clock, as it is described in 
(info (emacs) Appointments). Recently I started using 
org-agenda-to-appt, and I wanted to update my appointments every 
time that I call the agenda, something like:


#+BEGIN_SRC emacs-lisp
 (add-hook 'org-agenda-finalize-hook (lambda () 
 (org-agenda-to-appt t))) 
#+END_SRC


But this removes the entries that appt-add has added, in other 
words it removes my alarms.


The attached patch permits that, when refreshing, only 
appointments that have the text property org-headline set to t are 
deleted. So it would leave any appointments set by appt-add. I do 
not know if all the entries that org-agenda-to-appt adds have an 
org-headline set to t, from my tests it seems like that is the 
case.


The functionality has backward compatibility (uses C-u C-u), but 
perhaps it would make more sense to use C-u for refreshing only 
org entries and C-u C-u for refreshing everything, or even never 
setting appt-time-msg-list to nil from org.


If the patch is approved to refresh the appointments after every 
agenda buffer is built while keeping those appointments added by 
appt-add, you can do:


#+BEGIN_SRC emacs-lisp
 (add-hook 'org-agenda-finalize-hook (lambda () 
 (org-agenda-to-appt '(16 
#+END_SRC


Best,

--  Jorge. 

From 2a5bf43b8ce112eab30df55f25e1744a7b388d64 Mon Sep 17 00:00:00 2001
From: Jorge A. Alfaro Murillo jorge.alfaro-muri...@yale.edu
Date: Sat, 6 Sep 2014 18:01:20 -0400
Subject: [PATCH] org-agenda.el: Refresh appointments from org files

* lisp/org-agenda.el (org-agenda-to-appt): Double prefix arg refresh
only the list of appointments that come from org files.

Uses the text-properties in appt-time-msg-list to see if an entry has
an org-heading property.

TINYCHANGE
---
 lisp/org-agenda.el | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index bcbacf0..ff4a448 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -10046,7 +10046,9 @@ tag and (if present) the flagging note.
 (defun org-agenda-to-appt (optional refresh filter rest args)
   Activate appointments found in `org-agenda-files'.
 With a \\[universal-argument] prefix, refresh the list of
-appointments.
+appointments. With a double prefix arg \\[universal-argument]
+\\[universal-argument], refresh only the list of appointments
+that come from org files.
 
 If FILTER is t, interactively prompt the user for a regular
 expression, and filter out entries that don't match it.
@@ -10076,7 +10078,15 @@ details and examples.
 If an entry has a APPT_WARNTIME property, its value will be used
 to override `appt-message-warning-time'.
   (interactive P)
-  (if refresh (setq appt-time-msg-list nil))
+  (if (equal refresh '(4))
+  (setq appt-time-msg-list nil))
+  (if (equal refresh '(16))
+  (let (new-appt-time-msg-list)
+	(dolist (entry appt-time-msg-list)
+	  (if (not (text-property-any 1 (length (cadr entry))
+  'org-heading t (cadr entry)))
+	  (add-to-list 'new-appt-time-msg-list entry)))
+	(setq appt-time-msg-list new-appt-time-msg-list)))
   (if (eq filter t)
   (setq filter (read-from-minibuffer Regexp filter: )))
   (let* ((cnt 0) ; count added events
@@ -10119,8 +10129,6 @@ to override `appt-message-warning-time'.
  (and (stringp evt-filter)
   (string-match evt-filter evt)))
 	  (wrn (get-text-property 1 'warntime x)))
-	 ;; FIXME: Shall we remove text-properties for the appt text?
-	 ;; (setq evt (set-text-properties 0 (length evt) nil evt))
 	 (when (and ok tod)
 	   (setq tod (concat 00 (number-to-string tod))
 		 tod (when (string-match
-- 
2.0.1