Re: [O] searching for csv utilities

2015-06-04 Thread e.fraga
On Wednesday,  3 Jun 2015 at 22:05, Michael Brand wrote:

[...]

> I just found the Calc function apply() which leads to this
> simplification:
>
> | Date |Sys |Dia |Pul |  Sugar |
> |--++++|
> | [2014-04-27 Sun] |125 | 88 | 78 | 92 |
> | [2014-04-28 Mon] |102 | 88 | 86 | 92 |
> |--++++|
> | vmean| 113.50 |  88.00 |  82.00 |  92.00 |
> | vcount   |   2.00 |   2.00 |   2.00 |   2.00 |
> | vmax | 125.00 |  88.00 |  86.00 |  92.00 |
> | vmedian  | 113.50 |  88.00 |  82.00 |  92.00 |
> | vmin | 102.00 |  88.00 |  78.00 |  92.00 |
> | vstdev   |   0.00 |   0.00 |   0.00 |   0.00 |
> | vsum | 227.00 | 176.00 | 164.00 | 184.00 |
> |--++++|
>
> #+TBLFM: @>>>$2..@>$> = apply($1, @I..@II); %.2f
>
> Michael

very nice!  one to remember.

however, vstdev does not appear to work?

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-790-gb719c1.dirty



Re: [O] searching for csv utilities

2015-06-04 Thread Michael Brand
Hi Eric

On Thu, Jun 4, 2015 at 9:21 AM,   wrote:
> however, vstdev does not appear to work?

My mistake, it should be vsdev or vpsdev.

Michael



Re: [O] orgmode to markdown

2015-06-04 Thread Rasmus
Nicolas Goaziou  writes:

> If this is common enough, we could also add a defcustom to toggle this
> behaviour (yet, off by default). But is it common enough?

I never use the md exporter, and I'd never use md for a complex documents.

So to me it would be wasted effort.

That being said, I guess it would be not too much work.  Essentially it'd
be a mapping of a keyword-type (title, subtitle, author, date...) to a
format string, I guess.

Rasmus

-- 
Hooray!




Re: [O] orgmode to markdown

2015-06-04 Thread flow
Hi Nicolas!

El jue, 04-06-2015 a las 00:18 +0200, Nicolas Goaziou escribió:
> flow  writes:
> 
> > I guessed setext support 6 levels so I don't know why ox-md supprot just
> > 2 levels although my exporter seems to support 3 levels. Why?
> 
> Setext style supports only 2 levels. Atx supports 6 of them, per
> .

I'm sorry I mixed between setext and atx :)

> > That's a good question but not what I wanted to know. What I want -and
> > I would like to know whay ox-md doesn't- is to export org as org-mode
> > to html does:
> >
> > - The title becomes h1, so the org title becomes # or ===, I don't mind
> > - The * becomes h2, so the org * becomes ## or 
> > - The ** becomes h3, so the org ** becomes ### (in case it supports 3
> > leveles)
> > - etc.
> >
> > What do you think about it?
> 
> I think it is very opinionated and may be undesirable in the general
> case. It means that every headline would be numbered 1.xxx. 

I wasn't talking about numbering headings but creating headings :)

> Also some Markdown extensions provide meta-data keywords to specify,
> e.g., the title of the document. This behaviour would just get in the
> way for them since headlines would get one too many level with no real
> reason.
> 
> There are several workarounds:
> 
>   - you can define filters to add another level to each headline and
> title at the beginning of the document.
> 
>   - you can use a {{{title}}} macro, e.g.,
> 
>   @@md:#@@ {{{title}}}
> 
> and shift other headlines
> 
> If this is common enough, we could also add a defcustom to toggle this
> behaviour (yet, off by default). But is it common enough?

That's a good question and also why ox.md works in this way.

I probably didn't explain it properly and it is because I'm used to
write #+title header in org-mode. #+title it is exported to html as h1
what is great.

I think that's a common header when you write org-mode, isn't it?

So I guess if orgmode to html exports title-orgmode as h1-html, I think
it could be exported also to md because it alrealdy exists.

The exporter then could look for both title options:
1. the org-mode header and if there is a #+title, it could be h1 and the
others org-mode headings (* ** ***, etc) md headings (## ### ###). 
2. or {{{title}}

If none of them are included, it should keep the behaviour it already
has. If not, it could translate it to markdown heading1

If you think this is an uncommon use of org-mode, then I should use you
suggestion or make something different ;)

Best!

> 
> Regards,

-- 
"La tradición de los oprimidos nos enseña que la regla es el «estado de
excepción» en el que vivimos." Walter Benjamin, Tesis de Filosofía de la
historia



signature.asc
Description: This is a digitally signed message part


[O] Displaying all sublevel numbers (e.g. "1.1.5." rather than "5.") in lists in emacs itself?

2015-06-04 Thread Ulva
Hello,

I'm looking to use org-mode numbered lists, and I gather that it is possible
to /export/ them into a format like so:

1.
  1.1.
  1.2.
2.

rather than:

1.
  1.
  2.
2.

But is it also possible to display them in the former, 'full' format within
emacs/org-mode itself? This might come in handy to orient myself in the
document: "6.1.1.5." is unambiguous, whereas if there are many list items
and subitems, if I only see "5." it may be less apparent where in the
document I am.

Thank you!




Re: [O] searching for csv utilities

2015-06-04 Thread Nick Dokos
Michael Brand  writes:

> Hi Eric
>
> On Thu, Jun 4, 2015 at 9:21 AM,   wrote:
>> however, vstdev does not appear to work?
>
> My mistake, it should be vsdev or vpsdev.
>

I mispelled it the same way: I can never remember the right name.

Also, if one uses a format on an undefined function (e.g. using
vmode(@I..@II); %.2f), I get 0.0 as a result and the error is hidden -
if the format is omitted, the literal vmode([...]) appears in the table,
so in that case at least one gets a hint that something is wrong. That
probably qualifies as a bug, but I don't know how easy it would be to fix.

Nick





Re: [O] searching for csv utilities

2015-06-04 Thread Nick Dokos
Nick Dokos  writes:

>
> I mispelled it the same way: I can never remember the right name.
>

... and I misspelled "misspelled" :-)





Re: [O] searching for csv utilities

2015-06-04 Thread Michael Brand
Hi Nick

On Thu, Jun 4, 2015 at 5:22 PM, Nick Dokos  wrote:
> Also, if one uses a format on an undefined function (e.g. using
> vmode(@I..@II); %.2f), I get 0.0 as a result and the error is hidden -
> if the format is omitted, the literal vmode([...]) appears in the table,
> so in that case at least one gets a hint that something is wrong. That
> probably qualifies as a bug, but I don't know how easy it would be to fix.

Yes. Anyway, Calc has its own formatter which can be a solution:

| Date |  Sys |Dia |
Pul |  Sugar |
|--+--+++|
| [2014-04-27 Sun] |  125 | 88 |
78 | 92 |
| [2014-04-28 Mon] |  102 | 88 |
86 | 92 |
|--+--+++|
| vmean|   113.50 |  88.00 |
82.00 |  92.00 |
| vcount   | 2.00 |   2.00 |
2.00 |   2.00 |
| vmax |   125.00 |  88.00 |
86.00 |  92.00 |
| vmedian  |   113.50 |  88.00 |
82.00 |  92.00 |
| vmin |   102.00 |  88.00 |
78.00 |  92.00 |
| vstdev   | vstdev(125, 102) | vstdev(88, 88) | vstdev(78,
86) | vstdev(92, 92) |
| vsum |   227.00 | 176.00 |
164.00 | 184.00 |
|--+--+++|
#+TBLFM: @>>>$2..@>$> = apply($1, @I..@II) +.0; f-2

See also the Worg FAQ
http://orgmode.org/worg/org-faq.html#table-float-fraction

Michael



[O] (1) global cycling for numbered lists? (2) adaptive links to list item numbers?

2015-06-04 Thread Ulva
Hello again,

Two more questions:

(1) S-Tab is very handy to collapse list sublevels globally, but it only
seems to work if the first level of the list is 'bulleted' (*), not if it
consists of numbers. Is this correct, and is there a way around it?

(2) Taking a cue from Insert>Cross-Reference in LibreOffice, suppose I would
like to refer in section (say) 4.1.1 to section 2.1. Something like "As
mentioned in 2.1, frogs are often green". But I would like this "2.1"
reference to update automatically if later the 2.1 content ends up somewhere
else in the document. E.g. if a first-level section is added at the top of
the list and everything else shifts, 4.1.1 becomes 5.1.1 and should update
to "As mentioned in 3.1, frogs are often green". Is this possible in
emacs/org-mode?

Thanks!

PS: /Are/ frogs in fact often green? What are the stats? ;-)




[O] Bug: todo states not logged to drawer when using narrowed indirect buffer [8.3beta (release_8.3beta-1203-g93cc5f) ]

2015-06-04 Thread Mark Edgington
To reproduce this bug, do the following:

1.  edit / open the following org file:

#+TODO: TODO(t) WAIT(w!) | DONE(d!) CANCELED(c!)
#+STARTUP: logdrawer
* testing A
some stuff
* testing B

2.  execute (org-tree-to-indirect-buffer) on the 'testing A' headline

3.  go to the end of the indirect buffer, and add a new headline.  for example:

* testing C

4. change the TODO state of this new headline to TODO, and then to WAIT.

You should now notice that a drawer was created in the initial
(non-indirect) buffer, but is not visible in the indirect buffer.
Furthermore, the logged state change appears *above* the drawer, and
not inside it.


Emacs  : GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.9)
 of 2015-03-21 on kissel, modified by Debian
Package: Org-mode version 8.3beta (release_8.3beta-1203-g93cc5f @
/home/edgimar/.emacs.d/scripts/org-mode/lisp/)

current state:
==
(setq
 org-tab-first-hook '(org-hide-block-toggle-maybe
  org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook
  org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-shell-link-function 'yes-or-no-p
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook org-show-block-all append
local]
   5]
 #[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook org-babel-show-result-all
append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )



Re: [O] Bug: Export to html inserts strange unicode characters at line breaks because of fci-mode [8.2.7c (8.2.7c-64-g01f736-elpa @ /home/kmodi/.emacs.d/elpa/org-20140915/)]

2015-06-04 Thread Kaushal
Hi all,

I was finally able to solve this problem without tweaking anything inside
ox-html.el

I noticed that htmlize has provided few hooks and I used those.

Here is the code that I now have in my emacs init to disable fci (and
flyspell too) while htmlize-region is doing its job:

(defvar modi/htmlize-initial-fci-state nil
  "Variable to store the state of `fci-mode' when `htmlize-buffer' is
called.")
(defvar modi/htmlize-initial-flyspell-state nil
  "Variable to store the state of `flyspell-mode' when `htmlize-buffer'
is called.")

(defun modi/htmlize-before-hook-fn ()
  (when (fboundp 'fci-mode)
(setq modi/htmlize-initial-fci-state fci-mode)
(when fci-mode
  (fci-mode -1)))
  (when (fboundp 'flyspell-mode)
(setq modi/htmlize-initial-flyspell-state flyspell-mode)
(when flyspell-mode
  (flyspell-mode -1
(add-hook 'htmlize-before-hook #'modi/htmlize-before-hook-fn)

(defun modi/htmlize-after-hook-fn ()
  (when (fboundp 'fci-mode)
(when modi/htmlize-initial-fci-state
  (fci-mode 1)))
  (when (fboundp 'flyspell-mode)
(when modi/htmlize-initial-flyspell-state
  (flyspell-mode 1
(add-hook 'htmlize-after-hook #'modi/htmlize-after-hook-fn)

I would suggest that that fci-mode specific code be removed from the master.


On Sat, Sep 27, 2014 at 3:25 PM Aaron Ecay  wrote:

> Hi Nicolas and Kaushal,
>
> 2014ko irailak 26an, Nicolas Goaziou-ek idatzi zuen:
> >
> > Hello,
> >
> > Kaushal  writes:
> >
> >> I have fci-mode installed and enabled for programming modes.
> >>
> >> When org exports to html, htmlize figures out the syntax highlighting of
> >> the code by calling  =(funcall lang-mode)=.
> >>
> >> That activates =fci-mode=.
> >>
> >> =fci-mode= shows the fill column using a unicode character. The issue is
> >> that org export to html exports that character as well.
> >>
> >> Those characters show up in html as below!
> >> http://i.imgur.com/8WplTqw.png
> >>
> >> So the solution is to fix the =orx-html-fontify-code= function.
> >
> > I don't think so. `fill-column-indicator' is not even in core Emacs. We
> > shouldn't provide a workaround for every package out there.
>
> For better or for worse, Bastien already installed this fix on master as
> commit 44d8, in response to Kaushal’s earlier bug report on this
> issue.  See .
>
> The fix has not yet been merged to the release branch, so it won’t yet
> show up in the ELPA version of org which Kaushal seems to be using.
>
> --
> Aaron Ecay
>


Re: [O] searching for csv utilities

2015-06-04 Thread Thierry Banel
You may want to consider a slightly different approach. It may (or
maynot) be relevant depending on your context.

First, denormalize your table into a "fact table" (which is handy when
dealingwith cubes):

#+name: data
| date | type  |   q |
|--+---+-|
| [2014-04-27 Sun] | Sys   | 125 |
| [2014-04-28 Mon] | Sys   | 102 |
| [2014-04-29 Tue] | Sys   | 115 |
| [2014-04-27 Sun] | Dia   |  88 |
| [2014-04-28 Mon] | Dia   |  88 |
| [2014-04-29 Tue] | Dia   |  88 |
| [2014-04-27 Sun] | Pul   |  78 |
| [2014-04-28 Mon] | Pul   |  86 |
| [2014-04-29 Tue] | Pul   |  85 |
| [2014-04-27 Sun] | Sugar |  92 |
| [2014-04-28 Mon] | Sugar |  92 |
| [2014-04-29 Tue] | Sugar |  95 |

Then using a package named "org-aggregate" (on Melpa) you can derivean
aggregated table:

#+name: aggr
#+BEGIN: aggregate :table data :cols "type vcount() vmean(q) vmax(q)
vsdev(q);f3"
| type  | vcount() | vmean(q) | vmax(q) | vsdev(q);f3 |
|---+--+--+-+-|
| Sys   |3 |  114 | 125 |  11.533 |
| Dia   |3 |   88 |  88 |   0 |
| Pul   |3 |   83 |  86 |   4.359 |
| Sugar |3 |   93 |  95 |   1.732 |
#+END:

If you want to rotate this table, apply a transposition on it(provided
by the same package):

#+BEGIN: transpose :table "aggr"
| type|   |Sys | Dia |   Pul | Sugar |
| vcount()|   |  3 |   3 | 3 | 3 |
| vmean(q)|   |114 |  88 |83 |93 |
| vmax(q) |   |125 |  88 |86 |95 |
| vsdev(q);f3 |   | 11.533 |   0 | 4.359 | 1.732 |
#+END:

You can sort the "data" table on dates without changing theaggregation.

Thierry

Le 02/06/2015 13:44, Jude DaShiell a écrit :
> | Date |   Sys | Dia | Pul | Sugar |
> |--+---+-+-+---|
> | [2014-04-27 Sun] |   125 |  88 |  78 |92 |
> | [2014-04-28 Mon] |   102 |  88 |  86 |92 |
> | Averages:| =$2=vmean(@<..@>) | | |   |
> #+TBLFM: $2=$2=vmean(@<..@>)
>
> This is a cut down version of my full record set.  Sometimes when I
> key formulas in I get ?ERROR back for a result after keying in c-c+c-c
> once I've completed the formula and hit tab.  If I do c-u+c-c+c-c that
> sometimes generated ?ERROR.  Other times I key in a formula and the
> cursor gets locked and I have to hit c-g to exit #+TBLFM: mode; I
> don't know what's actually happening when that situation arises since
> other than suddenly finding the cursor locked I can neither tell what
> state I'm in or if a few more keystrokes are needed or if I've
> generated an error situation.
>
>  --
>
>
>




Re: [O] Links in #+caption: lines

2015-06-04 Thread Thomas S. Dye
Rasmus  writes:

> In the patch I guess this is the passage you disagree with:
>
> +  ((equal dc1 "+caption:")
> +   (org-remove-flyspell-overlays-in (match-end 2) (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)
> +'(font-lock-fontified t face org-meta-line))
> +   (add-text-properties (match-beginning 6) (+ (match-end 6) 1)
> +'(font-lock-fontified t face org-block)))
>
> Perhaps it is possible to let normal fontification rule in region six
> above?

How would I change this so descriptive links are shown in #+caption:
lines?

All the best,
Tom

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



[O] calc vmode function is probably broken

2015-06-04 Thread Jude DaShiell
I write that since a few minutes ago, I sorted columns 2-5 in numerical 
order with m-x org-table-sort-lines then returned to the top of file and 
did cu+cc+cc and checked the mode row and vmode still returned only zeros.




--




Re: [O] Links in #+caption: lines

2015-06-04 Thread Rasmus
Hi,

t...@tsdye.com (Thomas S. Dye) writes:

>> In the patch I guess this is the passage you disagree with:
>>
>> +  ((equal dc1 "+caption:")
>> +   (org-remove-flyspell-overlays-in (match-end 2) (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)
>> +'(font-lock-fontified t face org-meta-line))
>> +   (add-text-properties (match-beginning 6) (+ (match-end 6) 1)
>> +'(font-lock-fontified t face org-block)))
>>
>> Perhaps it is possible to let normal fontification rule in region six
>> above?
>
> How would I change this so descriptive links are shown in #+caption:
> lines?

Try the attached patch.

I have done 20 second of testing (I'm traveling) so there may be adverse
effects.  But it looked OK.

Have a nice weekend.

—Rasmus

-- 
With monopolies the cake is a lie!
>From bdfbda33ee01200f52393884c51e8fc865f8ec0c Mon Sep 17 00:00:00 2001
From: Rasmus 
Date: Fri, 5 Jun 2015 07:38:13 +0200
Subject: [PATCH] org.el: Alter caption label formatting

* org.el (org-fontify-meta-lines-and-blocks-1): Caption labels
  retain normally formatted.
---
 lisp/org.el | 4 
 1 file changed, 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 62684e9..81d1022 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5951,12 +5951,8 @@ by a #."
 	   '(font-lock-fontified t face org-document-info
 	   ((equal dc1 "+caption:")
 	(org-remove-flyspell-overlays-in (match-end 2) (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)
  '(font-lock-fontified t face org-meta-line))
-	(add-text-properties (match-beginning 6) (+ (match-end 6) 1)
- '(font-lock-fontified t face org-block))
 	t)
 	   ((member dc3 '(" " ""))
 	(org-remove-flyspell-overlays-in beg (match-end 0))
-- 
2.4.2



Re: [O] Displaying all sublevel numbers (e.g. "1.1.5." rather than "5.") in lists in emacs itself?

2015-06-04 Thread Nicolas Goaziou
Hello,

Ulva  writes:

> I'm looking to use org-mode numbered lists, and I gather that it is possible
> to /export/ them into a format like so:
>
> 1.
>   1.1.
>   1.2.
> 2.
>
> rather than:
>
> 1.
>   1.
>   2.
> 2.
>
> But is it also possible to display them in the former, 'full' format within
> emacs/org-mode itself?

It is not possible.


Regards,

-- 
Nicolas Goaziou



Re: [O] Links in #+caption: lines

2015-06-04 Thread Nicolas Goaziou
Hello,

Rasmus  writes:

> Try the attached patch.
>
> I have done 20 second of testing (I'm traveling) so there may be adverse
> effects.  But it looked OK.

With this patch, you remove fontification from caption contents, which
is not desirable. Caption is an affiliated keyword and should be marked
as such.


Regards,

-- 
Nicolas Goaziou