Re: [O] custom emacs org-emphasis-alist breaks EXPORT, help ;-) ?

2013-11-03 Thread Xebar Saram
Thank you Eric and Jambunathan

Eric: i tried with the added backslash but that dosent seem to work as
well, would you mind testing the snippet below on your system? is it still
something wrong im doing?

;test
(font-lock-add-keywords
'org-mode
'(("\\b[Ss]alt\\b)" (0 '(:weight ultra-bold :foregroun "#FF9800") t

Jambunathan:  hi-lock-mode looks interesting and i will investigate it
soon, is it per file settings, or can you define a word/fg-bg rule that
will apply to all files?

thanks alot guys, really appreciate it!



On Sun, Nov 3, 2013 at 6:15 AM, Eric Abrahamsen 
wrote:
>
> Xebar Saram  writes:
>
> > Thanks Eric , really appreciate the continuous help!
> >
> > i do plan to get into rexeg on the future (i promise :)) but real
> > life now just allow me to allocate time (i started an assistant
> > professor position and time is at a huge premium..).
> >
> > i tried using this as i tried to understand from your email, but i
> > guess im again doing something wrong. shouldn't the below example
> > color "salt", it dosent see to work.
> >
> > ;test
> > (font-lock-add-keywords
> >  'org-mode
> > '(("\b[Ss]alt\\b)" (0 '(:weight ultra-bold :foregroun "#FF9800")
> > t
>
> Looks like you're missing a backslash at the beginning of the regexp --
> make sure it reads "\\b...
>
> E
>
> > thank you for all your help
> >
> >
> >
> > On Sat, Nov 2, 2013 at 12:15 PM, Eric Abrahamsen <
> > e...@ericabrahamsen.net> wrote:
> >
> > Xebar Saram  writes:
> >
> > > Hi again all
> > >
> > > i have been using the before discussed font lock with great
> > success
> > > over the past few weeks, thx alot for that tip!
> > >
> > > one short question i have from using it thourhgly is weather
> > its
> > > possible to color specific words , IE not just text bound
> > between
> > > symbols ( ie > !text! ) but rather lets say i always want to
> > make the
> > > word server appear with blue FG. is this possible? currently i
> > tried
> > >
> > > (font-lock-add-keywords
> > >  'org-mode
> > > '(("\\(server[^server\n]+server\\)" (0 '(:foreground "#00"
> > > :underline t :background "#FF9AEA" :weight ultra-bold) t
> >
> > At some point you're definitely going to want to read up on
> > regular
> > expressions!
> >
> > But in the meantime yes, it's entirely (mostly) possible. A
> > regular
> > expression is just a way of finding desired pieces of text in a
> > larger
> > run of text. Think of the regexp as an instruction that starts:
> > "Find
> > all pieces of text that are..."
> >
> > All the special regexp characters are just a way of making the
> > instruction general (_any_ number, four of _any_ character,
> > _anything_
> > that's not a "p").
> >
> > In the most basic case, however, a regexp is simply the text you
> > want to
> > find: "Find all pieces of text that are 'server'". In this case,
> > that's
> > your regexp: "server".
> >
> > The reason regexps are difficult, of course, is that they can't
> > read
> > your mind, and will find things you didn't want, and not find
> > things you
> > did want. So much of messing with regexps is telling them: _yes_
> > this
> > too, _no_ not that. In your case, you'd probably want to put word
> > boundaries around the regexp ("\b" on either side), and find both
> > capitalized and lowercase instances of the word. So your
> > instruction
> > might be:
> >
> > "Find all pieces of text that are 'server' or 'Server', but only
> > as a
> > complete word."
> >
> > Which would look like
> >
> > "\\b[Ss]erver\\b"
> >
> > Give that a shot. You're jumping into the middle of something
> > fairly
> > complicated, so be patient and go slow!
> >
> > E
> >
> > > instead of the original
> > >
> > > (font-lock-add-keywords
> > >  'org-mode
> > > '(("\\(₆[^₆\n]+₆\\)" (0 '(:foreground "#00" :underline t
> > > :background "#FF9AEA" :weight ultra-bold) t
> > >
> > >
> > > again i apologize for my regrex ignorance :)
> > >
> > > best
> > >
> > > Z
> > >
> > >
> > >
> > >
> > > On Sun, Oct 6, 2013 at 8:04 AM, Eric Abrahamsen <
> > > e...@ericabrahamsen.net> wrote:
> > >
> > > Xebar Saram  writes:
> > >
> > > > thx again Eric
> > > >
> > > > i still have an issue with this when one of the symbols
> > used to
> > > start
> > > > /end the highlight is used in a sentence, for example
> > using
> > > your
> > > > code:
> > > >
> > > > (font-lock-add-keywords
> > > >  'org-mode
> > > >  '(("-1-\\([^-1-]+\\)-1-" (0 '(:weight ultra-bold
> > :background "
> > > #
> > > > DDFFDD" :foreground "#00") t
> > > >
> > > > if i write this:
> > > 

Re: [O] Beamer export: one question and one bug

2013-11-03 Thread Jarmo Hurri

Greetings.

> Set '#OPTIONS: H:2', then top level headlines become sections (and are
> listed in the table of contents) and second-level headlines become the
> frames.

Yep, that will happen. However, the original idea was to get frame
headlines into the table of contents.  In order to achieve this I would
have to have H:2 and repeat the frame title as follows:

# 
#+TITLE: Beamer test
#+OPTIONS: ':nil *:t -:t ::t <:t H:2 \n:nil ^:t arch:headline
#+OPTIONS: author:t c:nil creator:comment d:(not LOGBOOK) date:t e:t
#+OPTIONS: email:nil f:t inline:t num:t p:nil pri:nil prop:nil stat:t
#+OPTIONS: tags:t tasks:t tex:t timestamp:t toc:t todo:t |:t
#+CREATOR: Emacs 24.2.1 (Org mode 8.2.1)
#+DESCRIPTION:
#+EXCLUDE_TAGS: noexport
#+KEYWORDS:
#+LANGUAGE: en
#+SELECT_TAGS: export

* This is the first slide
** This is the first slide
  - with some fancy text
* And this is the second slide
** And this is the second slide
  - with one commented item...
# 

The output is correct, but requires duplication of information, which is
practically always a bad idea.

Jarmo




[O] [patch] correct link following

2013-11-03 Thread Daniel Clemente

Hi, I sent this patch 1 month ago but it wasn't included in org. I still need 
it for link following to work, otherwise I get:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("^id:" nil)
  org-open-at-point(nil)
  call-interactively(org-open-at-point nil nil)
  command-execute(org-open-at-point)


  I remember seeing another bug report on this list providing the same solution.

Thanks.


diff --git a/lisp/org.el b/lisp/org.el
index c42b9eb..01b39be 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10517,7 +10517,8 @@ application the system uses for this file type."
   ((and (string= type "thisfile")
 (or (run-hook-with-args-until-success
  'org-open-link-functions path)
-(and (string-match "^id:" link)
+(and link
+ (string-match "^id:" link)
  (or (featurep 'org-id) (require 'org-id))
  (progn
(funcall (nth 1 (assoc "id" org-link-protocols))



Re: [O] [patch] correct link following

2013-11-03 Thread Nicolas Goaziou
Hello,

Daniel Clemente  writes:

> Hi, I sent this patch 1 month ago but it wasn't included in org. I still need 
> it for link following to work, otherwise I get:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   string-match("^id:" nil)
>   org-open-at-point(nil)
>   call-interactively(org-open-at-point nil nil)
>   command-execute(org-open-at-point)

Applied. Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Simple cache mechanism for `org-element-at-point'

2013-11-03 Thread Nicolas Goaziou
Hello,

Eric Abrahamsen  writes:

> I wasn't expecting to report back anything meaningful on this issue
> unless I saw a bug or problem. I've done quite a bit of day-to-day using
> these patches -- editing, agenda stuff, and exporting -- with no
> noticeable ill effects... so there's my report!

Thank you very much for testing it. I pushed it on master branch.

Hopefully, the more functions use `org-element-at-point' and
`org-element-context', the more it will be beneficial.


Regards,

-- 
Nicolas Goaziou



Re: [O] org-mode in the wild

2013-11-03 Thread Rasmus
John Kitchin  writes:

> We had another manuscript written in org-mode accepted in Topics in
> Catalysis (http://link.springer.com/article/10.1007%2Fs11244-013-0166-3)!
> Check out references 14, 39 and 40 ;)

Congrats!  And thanks for sharing.

> The supporting information seems to be freely available (
> http://link.springer.com/content/esm/art:10.1007/s11244-013-0166-3/file/MediaObjects/11244_2013_166_MOESM1_ESM.pdf)
> was also prepared in org-mode. It is probably best read with the Adobe PDF
> reader. This file is an interesting hybrid of data sharing methods. Some of
> the data is in the pdf, some of it is embedded in the pdf, including the
> org-mode files for the manuscript and the supporting information file
> itself. Anyone interested in seeing how we did it can check it out.

With Evince 3.10, the GNOME document viewer, I'm able to save
attachments.  Do you use other features?.  It's catching up.
Supposedly, Okular is also quite feature-rich.

On matplotlib: looks great!
Are you aware that matplotlib now supports pgf out-of-the-box?  You
just specify it as an extension (pgf).  .pgf is also recognized as an
image in Org for a while.  The main benefit is that fonts magically
get the right size.

–Rasmus

-- 
Dung makes an excellent fertilizer




Re: [O] Beamer export: one question and one bug

2013-11-03 Thread Ista Zahn
On Sun, Nov 3, 2013 at 5:06 AM, Jarmo Hurri  wrote:
>
> Greetings.
>
>> Set '#OPTIONS: H:2', then top level headlines become sections (and are
>> listed in the table of contents) and second-level headlines become the
>> frames.
>
> Yep, that will happen. However, the original idea was to get frame
> headlines into the table of contents.


As far as I know this is a beamer design decision. The idea seems to
be that if your presentation is short enough that the individual frame
titles would fit in a table of contents then you don't actually need
one; see the beamer user guide at
http://ctan.mackichan.com/macros/latex/contrib/beamer/doc/beameruserguide.pdf.

Best,
Ista

  In order to achieve this I would
> have to have H:2 and repeat the frame title as follows:
>
> # 
> #+TITLE: Beamer test
> #+OPTIONS: ':nil *:t -:t ::t <:t H:2 \n:nil ^:t arch:headline
> #+OPTIONS: author:t c:nil creator:comment d:(not LOGBOOK) date:t e:t
> #+OPTIONS: email:nil f:t inline:t num:t p:nil pri:nil prop:nil stat:t
> #+OPTIONS: tags:t tasks:t tex:t timestamp:t toc:t todo:t |:t
> #+CREATOR: Emacs 24.2.1 (Org mode 8.2.1)
> #+DESCRIPTION:
> #+EXCLUDE_TAGS: noexport
> #+KEYWORDS:
> #+LANGUAGE: en
> #+SELECT_TAGS: export
>
> * This is the first slide
> ** This is the first slide
>   - with some fancy text
> * And this is the second slide
> ** And this is the second slide
>   - with one commented item...
> # 
>
> The output is correct, but requires duplication of information, which is
> practically always a bad idea.
>
> Jarmo
>
>



Re: [O] Setting properties when scrolling around buffer puts property in wrong headline

2013-11-03 Thread John Hendy
On Nov 1, 2013 3:34 PM, "Thorsten Jolitz"  wrote:
>
> John Hendy  writes:
>
> >> I'm supposing there's no way around this... but I'm creating a
> >> taskjuggler document that's fairly wrong. I often find myself in a
> >> situation where I go to set a :depends: property to reference another
> >> headline and need to go see what it's task_id is. So, I scroll down,
> >> look at the task, then enter the correct task_id in the minibuffer
> >> (which is still active after doing C-c C-x p property-name RET), and
> >> then find that it's been inserted in a different headline since
> >> scrolling moves the point/cursor to a different headline.
>
> I would say its the expected behaviour - when the mini-buffer is still
> active, the command wasn't sent yet, and when you finally send it,
> Org-mode acts on the property drawer where point is at that moment.
>

Understood, and that's what I figured but wanted to check!

> You might want to read about using the mark, i.e. how to set the mark
> before searching the task-id, and then go back to that point before
> sending the command from the mini-buffer:

Will do. I constantly lose my mark when searching and selecting, so sounds
really helpful.

Thanks,
John

>
>
,--
> |
http://www.gnu.org/software/emacs/manual/html_node/emacs/Mark-Ring.html#Mark-Ring
>
`--
>
> --
> cheers,
> Thorsten
>
>


[O] [ANN] Improved Flyspell check

2013-11-03 Thread Nicolas Goaziou
Hello,

I'd like to submit the following patch for review, testing and,
hopefully, inclusion.

>From the user point of view, it improves checks when using Flyspell,
removing false-positive and allowing to check more areas.

More importantly, it doesn't rely anymore on fontification, which means
that activating checks is very demanding for the parser. So, it is
a good stress test for the newly integrated cache mechanism.


Feedback welcome.


Regards,

-- 
Nicolas Goaziou
>From 56bbebbd926e04ad4382cc9f37fb9e23d548130a Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou 
Date: Sun, 3 Nov 2013 15:15:07 +0100
Subject: [PATCH] Improve Flyspell check

* lisp/org.el (org-mode-flyspell-verify): Rewrite function using
  "org-element.el".  In particular, it doesn't rely on fontification
  anymore.
(org-remove-flyspell-overlays-in): Remove function.
(org-do-emphasis-faces, org-activate-plain-links)
(org-fontify-meta-lines-and-blocks-1, org-activate-footnote-links)
(org-activate-target-links, org-activate-tags, org-activate-code)
(org-activate-angle-links): Don't call
`org-remove-flyspell-overlays-in'.
* contrib/lisp/org-wikinodes.el (org-wikinodes-activate-links): Don't
  call `org-remove-flyspell-overlays-in'.
---
 contrib/lisp/org-wikinodes.el |   5 --
 lisp/org.el   | 111 ++
 2 files changed, 70 insertions(+), 46 deletions(-)

diff --git a/contrib/lisp/org-wikinodes.el b/contrib/lisp/org-wikinodes.el
index 4efc373..c6f2006 100644
--- a/contrib/lisp/org-wikinodes.el
+++ b/contrib/lisp/org-wikinodes.el
@@ -79,15 +79,10 @@ to `directory'."
   (if (re-search-forward org-wikinodes-camel-regexp limit t)
 	  (if (equal (char-after (point-at-bol)) ?*)
 	  (progn
-		;; in  heading - deactivate flyspell
-		(org-remove-flyspell-overlays-in (match-beginning 0)
-		 (match-end 0))
 		(add-text-properties (match-beginning 0) (match-end 0)
  '(org-no-flyspell t))
 		t)
 	;; this is a wiki link
-	(org-remove-flyspell-overlays-in (match-beginning 0)
-	 (match-end 0))
 	(add-text-properties (match-beginning 0) (match-end 0)
  (list 'mouse-face 'highlight
    'face 'org-link
diff --git a/lisp/org.el b/lisp/org.el
index 2382a9c..a7ab90f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5459,8 +5459,6 @@ The following commands are available:
   (abbrev-table-put org-mode-abbrev-table
 		:parents (list text-mode-abbrev-table)))
 
-(put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify)
-
 (defsubst org-fix-ellipsis-at-bol ()
   (save-excursion (goto-char (window-start)) (recenter 0)))
 
@@ -5685,9 +5683,6 @@ The time stamps may be either active or inactive.")
 	(font-lock-prepend-text-property (match-beginning 2) (match-end 2)
 	 'face
 	 (nth 1 a))
-	(and (nth 2 a)
-		 (org-remove-flyspell-overlays-in
-		  (match-beginning 0) (match-end 0)))
 	(add-text-properties (match-beginning 2) (match-end 2)
  '(font-lock-multiline t org-emphasis t))
 	(when org-hide-emphasis-markers
@@ -5753,7 +5748,6 @@ prompted for."
   (let (f hl)
 (when (and (re-search-forward (concat org-plain-link-re) limit t)
 	   (not (org-in-src-block-p)))
-  (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
   (setq f (get-text-property (match-beginning 0) 'face))
   (setq hl (org-match-string-no-properties 0))
   (if (or (eq f 'org-tag)
@@ -5770,7 +5764,6 @@ prompted for."
 (defun org-activate-code (limit)
   (if (re-search-forward "^[ \t]*\\(:\\(?: .*\\|$\\)\n?\\)" limit t)
   (progn
-	(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
 	(remove-text-properties (match-beginning 0) (match-end 0)
 '(display t invisible t intangible t))
 	t)))
@@ -5812,7 +5805,6 @@ by a #."
 	  (cond
 	   ((member dc1 '("+html:" "+ascii:" "+latex:"))
 	;; a single line of backend-specific content
-	(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
 	(remove-text-properties (match-beginning 0) (match-end 0)
 '(display t invisible t intangible t))
 	(add-text-properties (match-beginning 1) (match-end 3)
@@ -5901,7 +5893,6 @@ by a #."
   (if (and (re-search-forward org-angle-link-re limit t)
 	   (not (org-in-src-block-p)))
   (progn
-	(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
 	(add-text-properties (match-beginning 0) (match-end 0)
 			 (list 'mouse-face 'highlight
    'keymap org-mouse-map))
@@ -5913,7 +5904,6 @@ by a #."
   (let ((fn (org-footnote-next-reference-or-definition limit)))
 (when fn
   (let ((beg (nth 1 fn)) (end (nth 2 fn)))
-	(org-remove-flyspell-overlays-in beg end)
 	(add-text-properties beg end
 			 (list 'mouse-face 'highlight
    'keymap org-mouse-map
@@ -5941,7 +5931,6 @@ by a #."
 		   'htmlize-link `(:uri ,hl
 	;; We need to remove the invisible property here.  Table narrowing
 	;; may have made some of this invisible.
-	(org-remove-flyspell-overlay

Re: [O] Writing Challenge

2013-11-03 Thread Ivan Andrus
FWIW, I have added nanowrimo.el to MELPA.

-Ivan

On Oct 19, 2013, at 9:22 PM, Ivan Andrus  wrote:

> Very interesting! I have been working on a mode which gives the current 
> word-count, WPM and an estimate of the time it will take to hit today's quota 
> in the modeline.  I would be interested in feedback as well as integrating it 
> with your spreadsheet.  You can find it at
> 
> https://bitbucket.org/gvol/nanowrimo.el
> 
> -Ivan
> 
> On Oct 19, 2013, at 3:03 PM, Bob Newell  wrote:
> 
>> A couple of us who are writers have worked on a "writing challenge"
>> spreadsheet. This year, for the upcoming National Novel Writing Month,
>> I've greatly modified (read: made more complex) the challenge
>> spreadsheet, and implemented it in org-mode.
>> 
>> It's attached, for anyone who's interested. I know there are other
>> writers and WriMos out there.
>> 
>> It probably has bugs. No, it surely has bugs. Comments welcomed.
>> 
>> I'm kind of attachment-challenged so if it doesn't appear below, get it
>> at
>> 
>> http://www.bobnewell.net/filez/newchallenge.org
>> 
>> -- 
>> Bob Newell
>> Honolulu, Hawai`i




Re: [O] Beamer export: one question and one bug

2013-11-03 Thread Jarmo Hurri

> As far as I know this is a beamer design decision. The idea seems to
> be that if your presentation is short enough that the individual frame
> titles would fit in a table of contents then you don't actually need
> one.

Ok, so be it, I can live with that decision.

All the best,

Jarmo




[O] Exporting book handouts

2013-11-03 Thread Jarmo Hurri

Greetings.

I have been writing a math book, and am still exploring the possibility
of using org for the task. Currently all my material is still in plain
LaTeX. The tools used are LaTeX, Asymptote, and R.

We all know many advantages that the use of org would bring. ;-) For me,
one of the possible benefits would be the use of org to export in
different formats: a PDF containing the whole book, an HTML site with
the same contents, and last, but not least, a set of Beamer handout
slides containing _only some parts_ of the material. I am using the
material to teach, and sometimes give handouts to students. Having to
create the handouts separately is boring and counterproductive.

Usually handouts contain relatively little information. There is a
title, often accompanied by a figure, and perhaps a sentence or two with
some equations. Typically at least parts of the equations are the same
as in the main text (we may derive the final results in class). The
figures in the book and handouts contain the same information, but the
handout figures may have e.g. larger fonts. The title of a handout may
be a part of the book text, or it may not.

I guess the things I would need include the following.

1. A way to denote that a certain element (figure, equation, part of a
   longer equation, a piece of text etc.) goes into the Beamer
   export. By default, material should _not_ be included in the Beamer
   export. I don't know how to achieve this.

   I did find SELECT_TAGS in the manual, so if I were to export entire
   subtrees into Beamer, maybe I could change the value of this when I
   am doing a Beamer export. But could I use this for individual
   elements, such as an equation or a figure?

2. A way to add some material into the Beamer handouts, material that is
   not in the book. I think this is easy to achieve with #+BEAMER and
   #+BEGIN_BEAMER ... #+END_BEAMER.

3. A way to change some values in Asymptote and R Babel blocks depending
   on whether I am exporting a Beamer or regular PDF / HTML. I don't
   know yet how to achieve this.

I am still in an explorative stage, so I am sure I will come up with
10^6 other questions when I need to face the details. But I would first
like to clear these general issues before I even try to proceed.

All the best,

Jarmo




Re: [O] [ANN] Improved Flyspell check

2013-11-03 Thread Nicolas Goaziou
Nicolas Goaziou  writes:

Updated patch.


-- 
Nicolas Goaziou
>From 13f68648a0ff468385668f6b141748607d3f8103 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou 
Date: Sun, 3 Nov 2013 15:15:07 +0100
Subject: [PATCH] Improve Flyspell check

* lisp/org.el (org-mode-flyspell-verify): Rewrite function using
  "org-element.el".  In particular, it doesn't rely on fontification
  anymore.
(org-remove-flyspell-overlays-in): Remove function.
(org-do-emphasis-faces, org-activate-plain-links)
(org-fontify-meta-lines-and-blocks-1, org-activate-footnote-links)
(org-activate-target-links, org-activate-tags, org-activate-code)
(org-activate-angle-links): Don't call
`org-remove-flyspell-overlays-in'.
* contrib/lisp/org-wikinodes.el (org-wikinodes-activate-links): Don't
  call `org-remove-flyspell-overlays-in'.
---
 contrib/lisp/org-wikinodes.el |   5 --
 lisp/org.el   | 109 ++
 2 files changed, 68 insertions(+), 46 deletions(-)

diff --git a/contrib/lisp/org-wikinodes.el b/contrib/lisp/org-wikinodes.el
index 4efc373..c6f2006 100644
--- a/contrib/lisp/org-wikinodes.el
+++ b/contrib/lisp/org-wikinodes.el
@@ -79,15 +79,10 @@ to `directory'."
   (if (re-search-forward org-wikinodes-camel-regexp limit t)
 	  (if (equal (char-after (point-at-bol)) ?*)
 	  (progn
-		;; in  heading - deactivate flyspell
-		(org-remove-flyspell-overlays-in (match-beginning 0)
-		 (match-end 0))
 		(add-text-properties (match-beginning 0) (match-end 0)
  '(org-no-flyspell t))
 		t)
 	;; this is a wiki link
-	(org-remove-flyspell-overlays-in (match-beginning 0)
-	 (match-end 0))
 	(add-text-properties (match-beginning 0) (match-end 0)
  (list 'mouse-face 'highlight
    'face 'org-link
diff --git a/lisp/org.el b/lisp/org.el
index 2382a9c..452babb 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5459,8 +5459,6 @@ The following commands are available:
   (abbrev-table-put org-mode-abbrev-table
 		:parents (list text-mode-abbrev-table)))
 
-(put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify)
-
 (defsubst org-fix-ellipsis-at-bol ()
   (save-excursion (goto-char (window-start)) (recenter 0)))
 
@@ -5685,9 +5683,6 @@ The time stamps may be either active or inactive.")
 	(font-lock-prepend-text-property (match-beginning 2) (match-end 2)
 	 'face
 	 (nth 1 a))
-	(and (nth 2 a)
-		 (org-remove-flyspell-overlays-in
-		  (match-beginning 0) (match-end 0)))
 	(add-text-properties (match-beginning 2) (match-end 2)
  '(font-lock-multiline t org-emphasis t))
 	(when org-hide-emphasis-markers
@@ -5753,7 +5748,6 @@ prompted for."
   (let (f hl)
 (when (and (re-search-forward (concat org-plain-link-re) limit t)
 	   (not (org-in-src-block-p)))
-  (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
   (setq f (get-text-property (match-beginning 0) 'face))
   (setq hl (org-match-string-no-properties 0))
   (if (or (eq f 'org-tag)
@@ -5770,7 +5764,6 @@ prompted for."
 (defun org-activate-code (limit)
   (if (re-search-forward "^[ \t]*\\(:\\(?: .*\\|$\\)\n?\\)" limit t)
   (progn
-	(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
 	(remove-text-properties (match-beginning 0) (match-end 0)
 '(display t invisible t intangible t))
 	t)))
@@ -5812,7 +5805,6 @@ by a #."
 	  (cond
 	   ((member dc1 '("+html:" "+ascii:" "+latex:"))
 	;; a single line of backend-specific content
-	(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
 	(remove-text-properties (match-beginning 0) (match-end 0)
 '(display t invisible t intangible t))
 	(add-text-properties (match-beginning 1) (match-end 3)
@@ -5901,7 +5893,6 @@ by a #."
   (if (and (re-search-forward org-angle-link-re limit t)
 	   (not (org-in-src-block-p)))
   (progn
-	(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
 	(add-text-properties (match-beginning 0) (match-end 0)
 			 (list 'mouse-face 'highlight
    'keymap org-mouse-map))
@@ -5913,7 +5904,6 @@ by a #."
   (let ((fn (org-footnote-next-reference-or-definition limit)))
 (when fn
   (let ((beg (nth 1 fn)) (end (nth 2 fn)))
-	(org-remove-flyspell-overlays-in beg end)
 	(add-text-properties beg end
 			 (list 'mouse-face 'highlight
    'keymap org-mouse-map
@@ -5941,7 +5931,6 @@ by a #."
 		   'htmlize-link `(:uri ,hl
 	;; We need to remove the invisible property here.  Table narrowing
 	;; may have made some of this invisible.
-	(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
 	(remove-text-properties (match-beginning 0) (match-end 0)
 '(invisible nil))
 	(if (match-end 3)
@@ -5965,7 +5954,6 @@ by a #."
   (if (and (re-search-forward org-tsr-regexp-both limit t)
 	   (not (equal (char-before (match-beginning 0)) 91)))
   (progn
-	(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
 	(add-text-properties (match-beginnin

Re: [O] Exporting book handouts

2013-11-03 Thread Thomas S. Dye
Aloha Jarmo,

I find it easiest to use separate sub-trees for the various different
documents I create from a given body of material.  In your case, I would
make a sub-tree for the book and a sub-tree for the handout.

If I try to create two different documents under the same heading, the
complexity overwhelms me.  Of course, you're writing a math book, so
your tolerance for complexity probably exceeds mine :)

Where possible, I #+name: the elements that will be used in more than
one place and then use #+call: lines to place them where I want.  

For figures, the source code blocks can be written to expose the
variables that let you set font size, etc., so the figures can look
different wherever they appear.

For other elements, the echo() function, which is part of the library of
babel, can be used.

** Echo function

#+name: test-list
  - One
  - Two
  - Three

#+name: test-table
| One   | Two |
| Three | Four |

#+name: echo-table
#+call: echo(input=test-table) :results table

#+results: echo-table
| One   | Two  |
| Three | Four |

#+name: echo-list
#+call: echo(input=test-list) :results list

#+results: echo-list
- One
- Two
- Three

I don't know off-hand the full list of elements that can be named and
echoed this way.

hth,
Tom


Jarmo Hurri  writes:

> Greetings.
>
> I have been writing a math book, and am still exploring the possibility
> of using org for the task. Currently all my material is still in plain
> LaTeX. The tools used are LaTeX, Asymptote, and R.
>
> We all know many advantages that the use of org would bring. ;-) For me,
> one of the possible benefits would be the use of org to export in
> different formats: a PDF containing the whole book, an HTML site with
> the same contents, and last, but not least, a set of Beamer handout
> slides containing _only some parts_ of the material. I am using the
> material to teach, and sometimes give handouts to students. Having to
> create the handouts separately is boring and counterproductive.
>
> Usually handouts contain relatively little information. There is a
> title, often accompanied by a figure, and perhaps a sentence or two with
> some equations. Typically at least parts of the equations are the same
> as in the main text (we may derive the final results in class). The
> figures in the book and handouts contain the same information, but the
> handout figures may have e.g. larger fonts. The title of a handout may
> be a part of the book text, or it may not.
>
> I guess the things I would need include the following.
>
> 1. A way to denote that a certain element (figure, equation, part of a
>longer equation, a piece of text etc.) goes into the Beamer
>export. By default, material should _not_ be included in the Beamer
>export. I don't know how to achieve this.
>
>I did find SELECT_TAGS in the manual, so if I were to export entire
>subtrees into Beamer, maybe I could change the value of this when I
>am doing a Beamer export. But could I use this for individual
>elements, such as an equation or a figure?
>
> 2. A way to add some material into the Beamer handouts, material that is
>not in the book. I think this is easy to achieve with #+BEAMER and
>#+BEGIN_BEAMER ... #+END_BEAMER.
>
> 3. A way to change some values in Asymptote and R Babel blocks depending
>on whether I am exporting a Beamer or regular PDF / HTML. I don't
>know yet how to achieve this.
>
> I am still in an explorative stage, so I am sure I will come up with
> 10^6 other questions when I need to face the details. But I would first
> like to clear these general issues before I even try to proceed.
>
> All the best,
>
> Jarmo
>
>
>

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] Exporting book handouts

2013-11-03 Thread Nicolas Goaziou
Hello,

Jarmo Hurri  writes:

> 1. A way to denote that a certain element (figure, equation, part of a
>longer equation, a piece of text etc.) goes into the Beamer
>export. By default, material should _not_ be included in the Beamer
>export. I don't know how to achieve this.
>
>I did find SELECT_TAGS in the manual, so if I were to export entire
>subtrees into Beamer, maybe I could change the value of this when I
>am doing a Beamer export. But could I use this for individual
>elements, such as an equation or a figure?

You can use drawers:

  * Some section

:HANDOUT:
...
:END:

:BOOK:
...
:END:

Then, you can play with `org-export-with-drawers' and its OPTIONS
counterpart:

  #+OPTIONS: d:("BOOK")

for a book-only export.

  #+OPTIONS: d:(not "HANDOUT")

for an everything-but-handout export...


Regards,

-- 
Nicolas Goaziou



[O] Line breaks in org-mode having version control in mind

2013-11-03 Thread Dror Atariah
I am trying to extend my usage of org, and one of the things I want to 
integrate is version controlling of my org files. This is obviously straight 
forward, but I am wondering about the best line breaking approach to use. In my 
LaTeX docs I maintain one physical line per sentence [1]. This way, when I 
change one word in a paragraph, it affects only one line, and looking for 
differences between versions is easy. Otherwise, when using fill-paragraph for 
instance, one gets messy changes of the file, as the one word change can 
influence the whole paragraph.

Therefore, as I mentioned, in LaTeX I use visual-line-mode and I insert 
manually line breaks at the end of sentences (or where *I* find appropriate). 
What would be the best practice for org? I understand that visual-line-mode has 
some problems when it comes to tables... What other issues are there? What do 
you do when you keep your org file under VC? 

Thanks in advance,
Dror

[1] http://tex.stackexchange.com/a/4378/412


Re: [O] Arbitrary lisp functions in column-attributes

2013-11-03 Thread Aaron Ecay
Hi Mark,

How about using an elisp babel block, with tabular results?  Something
like (tested only very lightly):

#+BEGIN_SRC elisp :results table
  (cons
   (list "Header A" "Header B")
   (cons 'hline
 (org-map-entries
  (lambda ()
(list
 (princ (org-entry-get (point) "FOO"))
 (princ (identity (org-entry-get (point) "BAR"
#+END_SRC

Replace ‘identity’ with your desired lisp-level processing.

-- 
Aaron Ecay



[O] freemind export?

2013-11-03 Thread Christof Spitz
Hello,

seems the freemind export is no longer supported in org.mode. Though I
found the ox-freemind.el somewhere on the net, I am desperately looking for
a documentation. I want to position nodes on the left, for example, but I
don't know how to pass optional parameters to the converter.

Thanks
Christof


Re: [O] org-writers-room sort of works! just in time for NaNoWriMo

2013-11-03 Thread Thorsten Jolitz
Matt Price  writes:

Hi Matt, 

I've pushed a new version of org-writers-room to the repo,
>
> https://github.com/titaniumbones/org-writers-room
>
> It's still rather simple, but some of the awful usability bugs are
> less severe: - org-writers-room can only be called from an org-mode
> buffer - when disabled, org-writers-room gets rid of the extra windows
> it created Doesn't restore a pre-existing windowing setup yet,
> unfortunately -- I would love some advice about how to do that.

these are the lines in outorg.el that deal with the window
configuration, maybe they can give you an idea of the simple way I saved
and restored the initial window-config when launching/killing the
outorg-edit-buffer:

,
| 12 matches for "window" in buffer: outorg.el
| 145:(defvar outorg-initial-window-config nil
| 146:  "Initial window-configuration when editing as Org.")
| 217:first line of the window showing the editing buffer."
| 359:(setq outorg-initial-window-config nil)
| 442:(setq outorg-initial-window-config
| 443:  (current-window-configuration))
| 654:(if (one-window-p) (split-window-sensibly (get-buffer-window)))
| 655:(switch-to-buffer-other-window edit-buffer)
|1038:  (setq outorg-initial-window-config
|1039:(current-window-configuration))
|1063:  (set-window-configuration
|1064:   outorg-initial-window-config)
`


> - the guide window displays a half-decent collapsed outline of the
> document by default.
>
> Unfortunately, one you start typing the guide mode starts to display
> your new text.  I don't know if there's a way around this, and
> probably it would be better to use one of the existing outline modes
> for the guide window, but I don't know how to use those.  Maybe
> Thorsten or someone can comment on how to improve that.

unfortunately I have no time to checkout your writers mode right now,
although I find the idea quite interesting and will give it a try next
time I have a writing project. 

If the doc is an Org-mode doc, navi-mode.el should work out of the box -
just follow the installation instructions. It offers many views on the
associated document, outlines, keywords, and combinations of both. You
can customize (improve) the current keyword searches, and define your
own keyword searche too, simply by customizing 2 variables.

You would have to make the *Navi* buffer pop up in the right window in
your config, then you can switch back and forth from the document to
*Navi* buffer (with M-s M-s and d or s or o).

-- 
cheers,
Thorsten




Re: [O] Arbitrary lisp functions in column-attributes

2013-11-03 Thread Mark Edgington
> How about using an elisp babel block, with tabular results?  Something
> like (tested only very lightly):
>
> #+BEGIN_SRC elisp :results table
>   (cons
>(list "Header A" "Header B")
>(cons 'hline
>  (org-map-entries
>   (lambda ()
> (list
>  (princ (org-entry-get (point) "FOO"))
>  (princ (identity (org-entry-get (point) "BAR"
> #+END_SRC
>
> Replace ‘identity’ with your desired lisp-level processing.

Hi Aaron,

I think this could be useful for doing some more general processing of
the properties of trees (e.g. using functions of multiple properties),
but it requires more "low-level" programming than just using a COLUMNS
definition.  Furthermore, as far as I can tell, you would need to use
something other than org-entry-get to get an entry's headline (e.g.
'ITEM' in the COLUMNS definition).  If you used babel to do this, you
would also not be able to (without reinventing them in elisp) use any
of the special summary functions, like when you specify COLUMNS to
include %MYPROP(Col Title){mean}.  Also, it requires extra conditional
code to limit the results to the properties of a particular subtree.
With dynamic blocks, I can just specify an ID.

I do like the flexibility that the babel-block method offers, but
maybe this same flexibility could be offered via a different kind of
column-attribute definition -- perhaps a syntax like %FUNC(Col
Title){myfunc,PROP1NAME,PROP2NAME,...}   (or simply omit 'FUNC') which
would pass PROP1NAME and PROP2NAME to myfunc.  Thoughts?

Regards,

Mark



Re: [O] custom emacs org-emphasis-alist breaks EXPORT, help ;-) ?

2013-11-03 Thread Eric Abrahamsen
Xebar Saram  writes:

> Thank you Eric and Jambunathan
>
> Eric: i tried with the added backslash but that dosent seem to work
> as well, would you mind testing the snippet below on your system? is
> it still something wrong im doing?
>
> ;test
> (font-lock-add-keywords
> 'org-mode
> '(("\\b[Ss]alt\\b)" (0 '(:weight ultra-bold :foregroun "#FF9800")
> t

What!? You mean I should actually test my suggestions!? :)

You've got one more typo I didn't see -- there's a spurious close
parenthesis at the end of the regexp, just inside the quote. I promise I
actually tried it this time, and taking that parenthesis out works!

E

> Jambunathan:  hi-lock-mode looks interesting and i will investigate
> it soon, is it per file settings, or can you define a word/fg-bg rule
> that will apply to all files?
>
> thanks alot guys, really appreciate it!
>
>
>
> On Sun, Nov 3, 2013 at 6:15 AM, Eric Abrahamsen <
> e...@ericabrahamsen.net> wrote:
>>
>> Xebar Saram  writes:
>>
>> > Thanks Eric , really appreciate the continuous help!
>> >
>> > i do plan to get into rexeg on the future (i promise :)) but real
>> > life now just allow me to allocate time (i started an assistant
>> > professor position and time is at a huge premium..).
>> >
>> > i tried using this as i tried to understand from your email, but
> i
>> > guess im again doing something wrong. shouldn't the below example
>> > color "salt", it dosent see to work.
>> >
>> > ;test
>> > (font-lock-add-keywords
>> >  'org-mode
>> > '(("\b[Ss]alt\\b)" (0 '(:weight ultra-bold :foregroun "#FF9800")
>> > t
>>
>> Looks like you're missing a backslash at the beginning of the
> regexp --
>> make sure it reads "\\b...
>>
>> E
>>
>> > thank you for all your help
>> >
>> >
>> >
>> > On Sat, Nov 2, 2013 at 12:15 PM, Eric Abrahamsen <
>> > e...@ericabrahamsen.net> wrote:
>> >
>> >     Xebar Saram  writes:
>> >
>> >     > Hi again all
>> >     >
>> >     > i have been using the before discussed font lock with great
>> >     success
>> >     > over the past few weeks, thx alot for that tip!
>> >     >
>> >     > one short question i have from using it thourhgly is
> weather
>> >     its
>> >     > possible to color specific words , IE not just text bound
>> >     between
>> >     > symbols ( ie > !text! ) but rather lets say i always want
> to
>> >     make the
>> >     > word server appear with blue FG. is this possible?
> currently i
>> >     tried
>> >     >
>> >     > (font-lock-add-keywords
>> >     >  'org-mode
>> >     > '(("\\(server[^server\n]+server\\)" (0 '(:foreground "#
> 00"
>> >     > :underline t :background "#FF9AEA" :weight ultra-bold)
> t
>> >
>> >     At some point you're definitely going to want to read up on
>> >     regular
>> >     expressions!
>> >
>> >     But in the meantime yes, it's entirely (mostly) possible. A
>> >     regular
>> >     expression is just a way of finding desired pieces of text in
> a
>> >     larger
>> >     run of text. Think of the regexp as an instruction that
> starts:
>> >     "Find
>> >     all pieces of text that are..."
>> >
>> >     All the special regexp characters are just a way of making
> the
>> >     instruction general (_any_ number, four of _any_ character,
>> >     _anything_
>> >     that's not a "p").
>> >
>> >     In the most basic case, however, a regexp is simply the text
> you
>> >     want to
>> >     find: "Find all pieces of text that are 'server'". In this
> case,
>> >     that's
>> >     your regexp: "server".
>> >
>> >     The reason regexps are difficult, of course, is that they
> can't
>> >     read
>> >     your mind, and will find things you didn't want, and not find
>> >     things you
>> >     did want. So much of messing with regexps is telling them:
> _yes_
>> >     this
>> >     too, _no_ not that. In your case, you'd probably want to put
> word
>> >     boundaries around the regexp ("\b" on either side), and find
> both
>> >     capitalized and lowercase instances of the word. So your
>> >     instruction
>> >     might be:
>> >
>> >     "Find all pieces of text that are 'server' or 'Server', but
> only
>> >     as a
>> >     complete word."
>> >
>> >     Which would look like
>> >
>> >     "\\b[Ss]erver\\b"
>> >
>> >     Give that a shot. You're jumping into the middle of something
>> >     fairly
>> >     complicated, so be patient and go slow!
>> >
>> >     E
>> >
>> >     > instead of the original
>> >     >
>> >     > (font-lock-add-keywords
>> >     >  'org-mode
>> >     > '(("\\(₆[^₆\n]+₆\\)" (0 '(:foreground "#00" :underline
> t
>> >     > :background "#FF9AEA" :weight ultra-bold) t
>> >     >
>> >     >
>> >     > again i apologize for my regrex ignorance :)
>> >     >
>> >     > best
>> >     >
>> >     > Z
>> >     >
>> >     >
>> >     >
>> >     >
>> >     > On Sun, Oct 6, 2013 at 8:04 AM, Eric Abrahamsen <
>> >     > e...@ericabrahamsen.net> wrote:
>> >     >
>> >     >     Xebar Saram  writes:
>> >     >
>> >     >     > thx again Eric
>> >     >     >
>> >     >    

Re: [O] freemind export?

2013-11-03 Thread Christof Spitz
Hello Jambunathan,

thanks for your quick reply.

> I am desperately looking for a documentation.
>
> M-x find-library RET ox-freemind RET
>
> Just look at English strings there.  That should give you a pretty good
> idea of what you can do.
>
> Yes, I looked at the file for hours to try to figure out how it works. I
am probably too stupid, sorry (not joking here).

The beginning of the file says:

>> See ox.el for more details on how this exporter works. <<

I did look, but didn't find any information there.

You can also search for the string - left or right - and you know that
> the exporter already has some trick up it's sleeve.
>

I searched, but didn't understand the "trick".

>
> > I want to position nodes on the left, for example, but I don't know
> > how to pass optional parameters to the converter.
>
> Unless you give an example, it is difficult for me to understand what
> you want to achieve.  How does your Org file look like and what node you
> want to position left.
>

Like this:

#+TITLE: SUBJEKT
#+AUTHOR: Christof
#+OPTIONS: H:4

* Headline 1

** Sub 1.1
** Sub 1.2

* Headline 2

** Sub 2.1
** Sub 2.2

Branch "Headline 2" should be place to the left of the central SUBJECT in
Freemind.

I also don't understand how to access the other styles 0-5 that a
predefined.

Thanks again

Christof


Re: [O] custom emacs org-emphasis-alist breaks EXPORT, help ;-) ?

2013-11-03 Thread Xebar Saram
hehe, works like a charm now :)

thx again Eric!

have a great day

Z


On Mon, Nov 4, 2013 at 6:03 AM, Eric Abrahamsen wrote:

> Xebar Saram  writes:
>
> > Thank you Eric and Jambunathan
> >
> > Eric: i tried with the added backslash but that dosent seem to work
> > as well, would you mind testing the snippet below on your system? is
> > it still something wrong im doing?
> >
> > ;test
> > (font-lock-add-keywords
> > 'org-mode
> > '(("\\b[Ss]alt\\b)" (0 '(:weight ultra-bold :foregroun "#FF9800")
> > t
>
> What!? You mean I should actually test my suggestions!? :)
>
> You've got one more typo I didn't see -- there's a spurious close
> parenthesis at the end of the regexp, just inside the quote. I promise I
> actually tried it this time, and taking that parenthesis out works!
>
> E
>
> > Jambunathan:  hi-lock-mode looks interesting and i will investigate
> > it soon, is it per file settings, or can you define a word/fg-bg rule
> > that will apply to all files?
> >
> > thanks alot guys, really appreciate it!
> >
> >
> >
> > On Sun, Nov 3, 2013 at 6:15 AM, Eric Abrahamsen <
> > e...@ericabrahamsen.net> wrote:
> >>
> >> Xebar Saram  writes:
> >>
> >> > Thanks Eric , really appreciate the continuous help!
> >> >
> >> > i do plan to get into rexeg on the future (i promise :)) but real
> >> > life now just allow me to allocate time (i started an assistant
> >> > professor position and time is at a huge premium..).
> >> >
> >> > i tried using this as i tried to understand from your email, but
> > i
> >> > guess im again doing something wrong. shouldn't the below example
> >> > color "salt", it dosent see to work.
> >> >
> >> > ;test
> >> > (font-lock-add-keywords
> >> >  'org-mode
> >> > '(("\b[Ss]alt\\b)" (0 '(:weight ultra-bold :foregroun "#FF9800")
> >> > t
> >>
> >> Looks like you're missing a backslash at the beginning of the
> > regexp --
> >> make sure it reads "\\b...
> >>
> >> E
> >>
> >> > thank you for all your help
> >> >
> >> >
> >> >
> >> > On Sat, Nov 2, 2013 at 12:15 PM, Eric Abrahamsen <
> >> > e...@ericabrahamsen.net> wrote:
> >> >
> >> > Xebar Saram  writes:
> >> >
> >> > > Hi again all
> >> > >
> >> > > i have been using the before discussed font lock with great
> >> > success
> >> > > over the past few weeks, thx alot for that tip!
> >> > >
> >> > > one short question i have from using it thourhgly is
> > weather
> >> > its
> >> > > possible to color specific words , IE not just text bound
> >> > between
> >> > > symbols ( ie > !text! ) but rather lets say i always want
> > to
> >> > make the
> >> > > word server appear with blue FG. is this possible?
> > currently i
> >> > tried
> >> > >
> >> > > (font-lock-add-keywords
> >> > >  'org-mode
> >> > > '(("\\(server[^server\n]+server\\)" (0 '(:foreground "#
> > 00"
> >> > > :underline t :background "#FF9AEA" :weight ultra-bold)
> > t
> >> >
> >> > At some point you're definitely going to want to read up on
> >> > regular
> >> > expressions!
> >> >
> >> > But in the meantime yes, it's entirely (mostly) possible. A
> >> > regular
> >> > expression is just a way of finding desired pieces of text in
> > a
> >> > larger
> >> > run of text. Think of the regexp as an instruction that
> > starts:
> >> > "Find
> >> > all pieces of text that are..."
> >> >
> >> > All the special regexp characters are just a way of making
> > the
> >> > instruction general (_any_ number, four of _any_ character,
> >> > _anything_
> >> > that's not a "p").
> >> >
> >> > In the most basic case, however, a regexp is simply the text
> > you
> >> > want to
> >> > find: "Find all pieces of text that are 'server'". In this
> > case,
> >> > that's
> >> > your regexp: "server".
> >> >
> >> > The reason regexps are difficult, of course, is that they
> > can't
> >> > read
> >> > your mind, and will find things you didn't want, and not find
> >> > things you
> >> > did want. So much of messing with regexps is telling them:
> > _yes_
> >> > this
> >> > too, _no_ not that. In your case, you'd probably want to put
> > word
> >> > boundaries around the regexp ("\b" on either side), and find
> > both
> >> > capitalized and lowercase instances of the word. So your
> >> > instruction
> >> > might be:
> >> >
> >> > "Find all pieces of text that are 'server' or 'Server', but
> > only
> >> > as a
> >> > complete word."
> >> >
> >> > Which would look like
> >> >
> >> > "\\b[Ss]erver\\b"
> >> >
> >> > Give that a shot. You're jumping into the middle of something
> >> > fairly
> >> > complicated, so be patient and go slow!
> >> >
> >> > E
> >> >
> >> > > instead of the original
> >> > >
> >> > > (font-lock-add-keywords
> >> > >  'org-mode
> >> > > '(("\\(₆[^₆\n]+₆\\)" (0 '(:foreground "#00" :underline
> > t
> >> > > :backgr