Re: [O] tabularx from org to latex not recognized

2016-05-01 Thread Nick Dokos
"vendo.li...@libero.it"  writes:

> Hello Org-mode users' group, 
>
> I'm having trouble with tables, in particular with trying to get Org-mode to 
> understand the attributes in #+ATTR_LATEX. 
> I have a 7x3 (rows x columns) table that has lots of text in the 2 column. 
> This means I can't properly see the table if Emacs' window is reduced rather 
> than in full-screen view. The rows
> and column are all jumbled up. I've read in the Org online manual (section 
> 3.2) that you must type something like  where n is an integer so that the 
> column restricts the number of
> visible characters in an otherwise overflowing text. I've tried it by placing 
> <10> in the header of the column but it doesn't work. Can someone help me 
> out? 
>
> Furthermore, when I try to get the pdf via LaTeX export (C-c C-e l o), in 
> spite of adding the necessary package to #+LATEX_HEADER and to the 
> add-to-alist within the .emac configuration
> file, the table gets exported in a "tabular" environment instead of 
> "tabularx" which allows for adaptable columns. In LaTeX it should be:
>
> \begin{table}[htb]
>   \centering
>   \begin{tabularx}{\textwidth}{lXX}
> \toprule
> NAME & CHARACTERISTICS & EXAMPLES\\
> [...]
>
> I've read extensively sec.12.7.5 of the org-manual but I don't know how to 
> get {\textwidth}{lXX} for tabularx recognized by Org-mode. Can someone show 
> me how, with an example specific to
> my case? 
>
> Here's some of the preamble from my org file. I've since continued to type 
> the document in LaTeX because the org-exported pdf had an overflowing table 
> that I couldn't control. Can someone
> shed some light into all this matter, please?
>
> #+TITLE: My Title
> #+AUTHOR: Me
> #+DATE: April 2016
> #+STARTUP: nolatexpreview align
> #+OPTIONS: toc:nil
> #+LATEX_CLASS: article
> #+LATEX_CLASS_OPTIONS: [a4paper,10pt]
> #+ATTR_LATEX: :booktabs :environment tabularx :width textwidth :align lXX
> [...]
> #+LATEX_HEADER: \usepackage{tabularx,booktabs}
> #+LATEX_HEADER: \setcounter{secnumdepth}{0}
> [...]
>
> This is how the table appears if I use TAB to hop from one field to the other.
>
> | NAME  | CHARACTERISTICS 
>   
>
>  | EXAMPLES   |
> |
> ---++
> |
> | Metals| <10> metallic bonding: adjacent atoms share electrons 
> in a non-directional way; opaque, shiny, electrically conductive, they 
> reflect photons, light rays from the
> environment  | a metal pan|
>
> Any help is highly appreciated. Thank you.

The  specification is on a row of its own, in the same column
that it is supposed to control. Try the following:

--8<---cut here---start->8---
#+ATTR_LATEX: :environment tabularx :width \textwidth :align lXl
| NAME   | CHARACTERISTICS  | EXAMPLES|
|+--+-|
|| <20> | |
| Metals | metallic bonding: adjacent atoms share electrons in a 
non-directional way; opaque, shiny, electrically conductive, they reflect 
photons, light rays from the Qenvironment | a metal pan |

--8<---cut here---end--->8---

--
Nick




[O] tabularx from org to latex not recognized

2016-05-01 Thread vendo.li...@libero.it
Hello Org-mode users' group, 
I'm having trouble with tables, in particular with trying to get Org-mode to 
understand the attributes in #+ATTR_LATEX. I have a 7x3 (rows x columns) table 
that has lots of text in the 2 column. This means I can't properly see the 
table if Emacs' window is reduced rather than in full-screen view. The rows and 
column are all jumbled up. I've read in the Org online manual (section 3.2) 
that you must type something like  where n is an integer so that the column 
restricts the number of visible characters in an otherwise overflowing text. 
I've tried it by placing <10> in the header of the column but it doesn't work. 
Can someone help me out? 
Furthermore, when I try to get the pdf via LaTeX export (C-c C-e l o), in spite 
of adding the necessary package to #+LATEX_HEADER and to the add-to-alist 
within the .emac configuration file, the table gets exported in a "tabular" 
environment instead of "tabularx" which allows for adaptable columns. In LaTeX 
it should be:
\begin{table}[htb]  \centering  \begin{tabularx}{\textwidth}{lXX}\toprule
NAME  CHARACTERISTICS  EXAMPLES\\[...]
I've read extensively sec.12.7.5 of the org-manual but I don't know how to get 
{\textwidth}{lXX} for tabularx recognized by Org-mode. Can someone show me how, 
with an example specific to my case? 
Here's some of the preamble from my org file. I've since continued to type the 
document in LaTeX because the org-exported pdf had an overflowing table that I 
couldn't control. Can someone shed some light into all this matter, please?
#+TITLE: My Title#+AUTHOR: Me#+DATE: April 2016#+STARTUP: nolatexpreview 
align#+OPTIONS: toc:nil#+LATEX_CLASS: article#+LATEX_CLASS_OPTIONS: 
[a4paper,10pt]#+ATTR_LATEX: :booktabs :environment tabularx :width textwidth 
:align lXX[...]
#+LATEX_HEADER: \usepackage{tabularx,booktabs}
#+LATEX_HEADER: \setcounter{secnumdepth}{0}[...]

This is how the table appears if I use TAB to hop from one field to the other.
| NAME  | CHARACTERISTICS   

 | EXAMPLES 
  
||---++||
 Metals| <10> metallic bonding: adjacent atoms share electrons in a 
non-directional way; opaque, shiny, electrically conductive, they reflect 
photons, light rays from the environment  | a metal pan 
   |

Any help is highly appreciated. Thank you.

Re: [O] PATCH: invoking RET on agenda clock log line ends up with point in closed clock drawer

2016-05-01 Thread Derek Feichtinger
Hi Nicolas

Thanks for the fast fix and also for the pointers to interesting functions.

Regards,
Derek

On Sun, May 1, 2016 at 1:34 AM, Nicolas Goaziou 
wrote:

> Hello,
>
> Derek Feichtinger  writes:
>
> > A longer time ago, hitting RET on an agenda clock log line brought up the
> > respective org buffer with the cursor positioned on the clock line. At
> some
> > point this stopped to work cleanly, at least when using clock drawers.
> The
> > clock drawer would always be closed (even when it was opened in the org
> > buffer before jumping.) with the cursor being in the hidden drawer. So,
> it
> > became impossible to find the target clock line for e.g. modifying it.
>
> This is fixed. Thank you.
>
> > ;; when jumping to the agenda from a log message, the point ends up at
> > ;; a CLOCK item in a LOGBOOK drawer, but the drawer gets closed, even
> > ;; if the drawer was open before. I add a drawer opening function to
> > ;; the respective agenda hook
> > (defun org-open-if-in-drawer ()
> >   (let ((element (org-element-at-point)))
> > (while (and element
> >   (not (memq (org-element-type element)
> >  '(drawer property-drawer
> >   (setq element (org-element-property :parent element)))
>
> See `org-element-lineage'.
>
> > (when element
> >   (let ((pos (point)))
> >   (goto-char (org-element-property :begin element))
> >   (org-flag-drawer nil)
> >   (goto-char pos)
> >
> > (add-hook 'org-agenda-after-show-hook #'org-open-if-in-drawer)
>
> Hooks are for user convenience, as you used it; I don't think any core
> feature should be
> implemented through hooks.
>
> Note that you can also call `org-flag-drawer' on a specific drawer using
> optional argument.
>
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] Fwd: bug#23299: 25.1.50; org-timestamp-change: Invalid time zone specification: (nil nil nil)

2016-05-01 Thread Marcin Borkowski

On 2016-05-01, at 09:56, Nicolas Goaziou  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> it seems that this is not yet applied to master (or am I mistaken?).
>> If I'm correct, could someone apply this patch in the Org-mode
>> repository?
>
> Isn't e0acd8a15a40cb15bd5c5c26c5a345900762c2f1 equivalent?

True - sorry for the noise (I downloaded fresh Org, but forgot to `make'
- stupid me...)

> Regards,

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



Re: [O] Fwd: bug#23299: 25.1.50; org-timestamp-change: Invalid time zone specification: (nil nil nil)

2016-05-01 Thread Nicolas Goaziou
Hello,

Marcin Borkowski  writes:

> it seems that this is not yet applied to master (or am I mistaken?).
> If I'm correct, could someone apply this patch in the Org-mode
> repository?

Isn't e0acd8a15a40cb15bd5c5c26c5a345900762c2f1 equivalent?

Regards,

-- 
Nicolas Goaziou



[O] Fwd: bug#23299: 25.1.50; org-timestamp-change: Invalid time zone specification: (nil nil nil)

2016-05-01 Thread Marcin Borkowski
Hi,

it seems that this is not yet applied to master (or am I mistaken?).
If I'm correct, could someone apply this patch in the Org-mode
repository?

On 2016-04-20, at 09:11, Paul Eggert  wrote:

> Thanks for reporting the problem. As Eli suggested, it was a typo in org.el 
> that 
> was exposed by recent changes to encode-time. I installed into master the 
> attached patch, which I think fixes the bug.

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
>From 313e98ceb078468498998305749b2790b7ba Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Wed, 20 Apr 2016 00:06:01 -0700
Subject: [PATCH] Fix org-timestamp-change typo
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Problem reported by Peter Münster (Bug#23299).
* lisp/org/org.el (org-timestamp-change): Fix typo that relied
on undocumented behavior in ‘encode-time’.  In practice the
old code used local time, so use that.
---
 lisp/org/org.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/org/org.el b/lisp/org/org.el
index 3abf627..b0e1e20 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -17459,8 +17459,7 @@ org-timestamp-change
 (+ (if (eq org-ts-what 'hour) n 0)   (nth 2 time0))
 (+ (if (eq org-ts-what 'day) n 0)(nth 3 time0))
 (+ (if (eq org-ts-what 'month) n 0)  (nth 4 time0))
-(+ (if (eq org-ts-what 'year) n 0)   (nth 5 time0))
-(nthcdr 6 time0)))
+(+ (if (eq org-ts-what 'year) n 0)   (nth 5 time0
   (when (and (member org-ts-what '(hour minute))
 extra
 (string-match "-\\([012][0-9]\\):\\([0-5][0-9]\\)" extra))
-- 
2.5.5



[O] [PATCH] org-capture: Adapt user-error for aborting by user

2016-05-01 Thread Chunyang Xu

Hi,

Sometimes I turn on lisp debugger with M-x toggle-debug-on-error for
some reason, then aborting org-capture with 'q' or 'C-g' enters the
debugger, which is annoying. I think `user-error' is better than `error'
in this case.

>From 9d950e96c48b8e1a0dad779cdf34a4f8a76621db Mon Sep 17 00:00:00 2001
From: Chunyang Xu 
Date: Sun, 1 May 2016 12:47:14 +0800
Subject: [PATCH] org-capture: Adapt user-error for aborting by user

When `org-capture` is aborted by user with 'q' or 'C-g', `user-error' is
better than `error' to use to exit.
---
 lisp/org-capture.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 008f0a6..34a6817 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -590,7 +590,7 @@ of the day at point (if any) or the current HH:MM time."
((equal entry "C")
 	(customize-variable 'org-capture-templates))
((equal entry "q")
-	(error "Abort"))
+	(user-error "Abort"))
(t
 	(org-capture-set-plist entry)
 	(org-capture-get-template)
@@ -1504,7 +1504,7 @@ only the bare key is returned."
 	(setq pressed (char-to-string (read-char-exclusive
 	  (when (equal pressed "\C-g")
 	(kill-buffer buffer)
-	(error "Abort"))
+	(user-error "Abort"))
 	  (when (and (not (assoc pressed table))
 		 (not (member pressed des-keys))
 		 (assoc pressed specials))
-- 
2.8.0