Change in Org Capture target parsing

2024-02-21 Thread Derek Chen-Becker
Hi,

I started getting an error after updating to the latest commit on main:

Invalid capture target specification: (file+headline org-default-notes-file
"Tasks")

I bisected it down to 0a58a53edac955381266e49bd68d1140fbece33e, but I can't
tell from the commit what's wrong with my definition or how to fix it. I
found this thread in the mailing list, but it doesn't help me shed light on
what I'm doing wrong:

https://lists.gnu.org/archive/html/emacs-orgmode/2024-02/msg00153.html

Is it because I'm using the variable "org-default-notes-file" and not a
string? If that's the case then it's probably easy for me to fix in my
config, but I wanted to check first.

Thanks,

Derek

-- 
+-------+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and   |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---+


Re: High CPU with org-set-tags-command in org-capture buffer

2023-09-15 Thread Derek Chen-Becker
Well, I haven't had time to try and repro, but I did a straight-pull to get
a newer version of Org and now the issue isn't happening anymore. I'm not
sure if there's any cause/effect there, but for any future folks looking at
this thread it might be worth a try.

Cheers,

Derek

On Wed, Aug 16, 2023 at 11:37 AM Ihor Radchenko  wrote:

> Derek Chen-Becker  writes:
>
> > ... It looks
> > like a duplicate of what was reported in
> > https://lists.gnu.org/archive/html/emacs-orgmode/2023-05/msg00402.html.
>
> Hard to say, because I was not able to reproduce.
>
> > ... Am
> > I correct that this is unresolved/unreproducible by others? If so, I'll
> see
> > if I can get a minimal repro.
>
> That would be nice. I cannot help without being able to see the problem.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
+---+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and   |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---+


High CPU with org-set-tags-command in org-capture buffer

2023-08-16 Thread Derek Chen-Becker
Hi, I recently upgrade to Emacs 29.1 and I also pulled the latest org
(commit cc435cba7), and I just noticed that when I'm in an org capture
buffer and try to execute org-set-tags-command, the CPU goes to 100% and
just seems to stay there (I gave up and hit ctrl-G after a couple of
minutes). The same command works fine outside of a capture buffer. It looks
like a duplicate of what was reported in
https://lists.gnu.org/archive/html/emacs-orgmode/2023-05/msg00402.html. Am
I correct that this is unresolved/unreproducible by others? If so, I'll see
if I can get a minimal repro.

Thanks,

Derek

-- 
+---+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and   |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---+


Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-04-07 Thread Derek Chen-Becker
In the code I posted, I had to explicitly (require 'sh-script) to ensure
that the sh-ancestor-alist is loaded before the code. I'm not enough of an
elisp guru to know if there's a way to defer that.

Cheers,

Derek

On Fri, Apr 7, 2023 at 9:30 AM Matt  wrote:

>
>   On Tue, 04 Apr 2023 08:30:34 -0400  Ihor Radchenko  wrote ---
>
>  > See the attached tentative patch.
>
> After applying the patch, I get the following error when trying to load
> Emacs:
>
> Warning (comp): /home/ahab/Projects/org-mode/lisp/org.el: Error: Symbol's
> value as variable is void sh-ancestor-alist
>
> I wasn't able to resolve it.  I suspect the issue is on my end, such as a
> mixed install or the need to  re-byte-compile  `sh-script.el'.
>
> To run Org from source I do one of the following:
>
> ;; When using my init
> (use-package org :straight (:local-repo "/home/ahab/Projects/org-mode"))
>
> ;; When running emacs -q
> (add-to-list 'load-path "/home/ahab/Projects/org-mode/lisp")
> (require 'org-loaddefs)
>
> If I need to recompile Emacs byte code, I'm not sure how I'd do that since
> I'm running Guix and those files live in the write protected /gnu/store.
>


-- 
+---+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and   |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---+


Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-04-04 Thread Derek Chen-Becker
The patch looks good to me!

Thanks,

Derek

On Tue, Apr 4, 2023 at 6:30 AM Ihor Radchenko  wrote:

> Derek Chen-Becker  writes:
>
> > I fiddled around a little bit this weekend and confirmed that this
> (sloppy)
> > code makes highlighting work for all shell types that sh-script supports:
> >
> > ;;A quick hack to try and support more shells syntax highlight in org
> babel
> > (require 'sh-script)
> > (require 'ob-shell)
> > (let ((shells (seq-filter (lambda (shell) (not (eq shell 'sh)))
> > (flatten-tree sh-ancestor-alist
>
> See the attached tentative patch.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
+---+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and   |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---+


Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-04-03 Thread Derek Chen-Becker
I fiddled around a little bit this weekend and confirmed that this (sloppy)
code makes highlighting work for all shell types that sh-script supports:

;;A quick hack to try and support more shells syntax highlight in org babel
(require 'sh-script)
(require 'ob-shell)
(let ((shells (seq-filter (lambda (shell) (not (eq shell 'sh)))
(flatten-tree sh-ancestor-alist
  (let ((toAppend (mapcar (lambda (shell) `(,(symbol-name shell) . sh))
shells)))
(setq org-src-lang-modes (-distinct (append toAppend
org-src-lang-modes)

I'm a relative newcomer to elisp, so comments and suggestions are welcome.
This is basically what I meant by "dynamically amend org-src-lang-modes
based on the contents of sh-ancestor-alist".

Thanks,

Derek

On Sat, Apr 1, 2023 at 5:22 PM Matt  wrote:

>
>   On Thu, 30 Mar 2023 04:55:32 -0400  Ihor Radchenko  wrote ---
>  > Matt m...@excalamus.com> writes:
>  >
>  > > I think this approach will work fine.   I tried examples for each
> shell type and keywords like if/then/else and function names are
> highlighted.
>  >
>  > Even for posh (powershell)?
>
> Yes.  It's not great since sh-mode looks for Korn-based keywords.  It does
> string highlighting and common keywords like 'if', 'exit', and 'param'.
>
>

-- 
+---+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and   |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---+


Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-03-31 Thread Derek Chen-Becker
When I asked the question I was just thinking of using it as a reference
for expanding the current org-src-lang-modes values, but now that you've
asked the question, perhaps we could dynamically amend org-src-lang-modes
based on the contents of sh-ancestor-alist. Does that make sense?

Thanks,

Derek

On Fri, Mar 31, 2023 at 7:06 AM Ihor Radchenko  wrote:

> Derek Chen-Becker  writes:
>
> > Would it be fair to use the sh-ancestor-alist as a basis for all of the
> > supported shell variants?
> >
> >
> https://github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/sh-script.el#L177
>
> How can we use it?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
+---+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and   |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---+


Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-03-30 Thread Derek Chen-Becker
Would it be fair to use the sh-ancestor-alist as a basis for all of the
supported shell variants?

https://github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/sh-script.el#L177

Cheers,

Derek

On Thu, Mar 30, 2023 at 2:54 AM Ihor Radchenko  wrote:

> Matt  writes:
>
> > I think this approach will work fine.   I tried examples for each shell
> type and keywords like if/then/else and function names are highlighted.
>
> Even for posh (powershell)?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
+---+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and   |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---+


Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-03-29 Thread Derek Chen-Becker
Cool, I would be happy to submit a patch!

Thanks,

Derek

On Wed, Mar 29, 2023 at 3:33 AM Ihor Radchenko  wrote:

> Matt  writes:
>
> >  Does anyone know which function is responsible for re-fontifing source
> blocks?
>
> `org-src-font-lock-fontify-block', which is using major-mode's native
> fontification. The major mode is determined by `org-src-get-lang-mode',
> which can be customized using `org-src-lang-modes'.
>
> Org provides some defaults for bash in `org-src-lang-modes' but not for
> other shell flavours. I guess we can add more defaults to
> `org-src-lang-modes', if we know for sure that e.g. zsh can be fontified
> sh-mode.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
+---+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and   |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---+


Font lock for org-babel shell scripts?

2023-03-28 Thread Derek Chen-Becker
Hi,

I'm trying to figure out whether there's a bug or just a misconfiguration
on my end with font lock for org-babel shell source blocks. If I run emacs
28.2 (with -q) and open the following org file, I can evaluate both source
blocks but only the "bash" block has syntax highlighting. I've confirmed
that opening a zsh script (e.g. with a zsh shebang) highlights correctly.
If this list isn't the right place to ask about this issue, does someone
know where I could look for help?

Thanks,

Derek

#+begin_src bash
  if [ -z $TEST ]; then
  echo Good
  fi
#+end_src

#+begin_src zsh
  if [ -z $TEST ]; then
  echo Good
  fi
#+end_src

# Local Variables:
# org-babel-load-languages: ((shell . t))
# End:



-- 
+---+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and   |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---+


Re: [BUG] Effort range format broken [9.5.5 (release_9.5.5 @ /usr/local/share/emacs/28.2/lisp/org/)]

2023-03-03 Thread Derek Chen-Becker
Confirmed, I upgraded to 9.6.1 and it works for me. Thanks!

On Fri, Mar 3, 2023 at 9:03 AM Ihor Radchenko  wrote:

> Derek Chen-Becker  writes:
>
> > Here is the minimal org file to repro:
> >
> > 
> > #+COLUMNS: %ITEM(Task) %Effort(Estimate){est+}
> >
> > * Table
> > #+BEGIN: columnview :id input
> >
> > #+END
> > ...
>
> With point at #+BEGIN, pressing C-c C-c works just fine for me.
> Using Org 9.6.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
+---+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and   |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---+


[BUG] Effort range format broken [9.5.5 (release_9.5.5 @ /usr/local/share/emacs/28.2/lisp/org/)]

2023-03-02 Thread Derek Chen-Becker
The Org manual (https://orgmode.org/manual/Column-attributes.html)
indicates that an Effort property may be entered as a range like "1-10",
but if I do that I get the error:

org-duration-to-minutes: Invalid duration format: "2-3"

Here is the minimal org file to repro:


#+COLUMNS: %ITEM(Task) %Effort(Estimate){est+}

* Table
#+BEGIN: columnview :id input

#+END


* Stuff
:PROPERTIES:
:ID:   input
:END:

** First
:PROPERTIES:
:Effort:   2-3
:END:


Here's the backtrace:


Debugger entered--Lisp error: (error "Invalid duration format: \"2-3\"")
  signal(error ("Invalid duration format: \"2-3\""))
  error("Invalid duration format: %S" "2-3")
  org-duration-to-minutes("2-3")
  org-refresh-property(((effort . identity) (effort-minutes .
org-duration-to-minutes)) "2-3" nil)
  org-refresh-properties("Effort" ((effort . identity) (effort-minutes .
org-duration-to-minutes)))
  org-refresh-effort-properties()
  org-agenda-prepare-buffers(("/ssdhome/derek/min-org-effort-bug.org"))
  org-map-entries(#f(compiled-function () #)
nil tree archive comment)
  org-columns--capture-view(nil nil nil nil nil 96)
  org-dblock-write:columnview((:name "columnview" :id input
:indentation-column 0 :content #("\n" 0 1 (fontified t
  org-update-dblock()
  org-dblock-update(nil)
  funcall-interactively(org-dblock-update nil)
  call-interactively(org-dblock-update nil nil)
  command-execute(org-dblock-update)


Emacs  : GNU Emacs 28.2 (build 3, x86_64-pc-linux-gnu, GTK+ Version
3.24.33, cairo version 1.16.0)
 of 2023-02-22
Package: Org mode version 9.5.5 (release_9.5.5 @
/usr/local/share/emacs/28.2/lisp/org/)

current state:
==
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-archive-hook '(org-attach-archive-delete-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-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook
change-major-mode-hook org-show-all append local] 5]
 #[0 "\300\301\302\303\304$\207" [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-confirm-shell-link-function 'yes-or-no-p
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-link-shell-confirm-function 'yes-or-no-p
 org-babel-pre-tangle-hook '(save-buffer)
 org-agenda-loop-over-headlines-in-active-region nil
 org-occur-hook '(org-first-headline-recenter)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-link-parameters '(("attachment" :follow org-attach-follow :complete
org-attach-complete-link)
   ("id" :follow org-id-open) ("eww" :follow
org-eww-open :store org-eww-store-link)
   ("rmail" :follow org-rmail-open :store
org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store
org-mhe-store-link)
   ("irc" :follow org-irc-visit :store
org-irc-store-link :export org-irc-export)
   ("info" :follow org-info-open :export
org-info-export :store org-info-store-link)
   ("gnus" :follow org-gnus-open :store
org-gnus-store-link)
   ("docview" :follow org-docview-open :export
org-docview-export :store org-docview-store-link)
   ("bibtex" :follow org-bibtex-open :store
org-bibtex-store-link)
   ("bbdb" :follow org-bbdb-open :export
org-bbdb-export :complete org-bbdb-complete-link :store
org-bbdb-store-link)
   ("w3m" :store org-w3m-store-link) ("doi" :follow
org-link-doi-open :export org-link-doi-export)
   ("file+sys") ("file+emacs") ("shell" :follow
org-link--open-shell)
   ("news" :follow #[514 "\301\300\302Q\"\207" ["news"
browse-url ":"] 6 "\n\n(fn URL ARG)"

Re: Effort range support broken? (est+)

2023-03-02 Thread Derek Chen-Becker
It does seem broken for me on 28.2 (Org 9.5.5). I'll put together a minimum
repro and submit. Thanks!

Cheers,

Derek

On Thu, Mar 2, 2023 at 4:34 AM Ihor Radchenko  wrote:

> Derek Chen-Becker  writes:
>
> > https://lists.gnu.org/archive/html/emacs-orgmode/2020-09/msg00571.html),
> > and it appears that the range support for effort is still broken. I'm
> > wondering if anyone knows how this could be fixed, since effort ranges
> > would be really helpful for estimation. I'm a passable elisper, so I'm
> > happy to help fix this if someone can point me in the right direction.
>
> Thanks for reporting!
>
> The next reply in the thread claims that the issue has been fixed:
> https://list.orgmode.org/87zgww8i59@gnu.org/
>
> Is it broken for you now, on the latest Org?
> If so, could you please provide a reproducer?
> See https://orgmode.org/manual/Feedback.html#Feedback
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
+---+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and   |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---+


Effort range support broken? (est+)

2023-03-01 Thread Derek Chen-Becker
Hi,

I was just reading
https://randomthoughts.dk/posts/2023/org-mode-for-project-estimation/ and
started learning about columnview and org mode. One thing I've run into is
that effort range values seem to be broken. The last mention of this on the
mailing list was back in 2020 (
https://lists.gnu.org/archive/html/emacs-orgmode/2020-09/msg00571.html),
and it appears that the range support for effort is still broken. I'm
wondering if anyone knows how this could be fixed, since effort ranges
would be really helpful for estimation. I'm a passable elisper, so I'm
happy to help fix this if someone can point me in the right direction.

Thanks,

Derek

-- 
+---+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and   |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---+


Re: state of the art in org-mode tables e.g. join, etc

2021-02-22 Thread Derek Feichtinger
Hi John,

I invested time some years ago in preparing babel examples, and a lot of
the description went into using tables. The most detailed documents I
had for elisp and python.

In order to be productive, e.g. for producing all kinds of scientific
graphs, but also for doing the finances and planning for our scientific
computing section I ended up the same as you with mostly going to python
and leveraging Pandas. I think all of us end up using ":colnames no" as
the most convenient solution.

https://github.com/dfeich/org-babel-examples/blob/master/python3/python3-babel.org

(especially look at the Pandas section 10)

In that file I also tangle a python library "orgbabelhelper" that is
available in Conda and PyPi. I mainly use that to work with my tables.

Best regards
Derek

-- 
Paul Scherrer Institut
Dr. Derek Feichtinger   Phone:   +41 56 310 47 33
Group Head HPC and Emerging Technologies  Email: derek.feichtin...@psi.ch
Building/Room No. OHSA/D17
Forschungsstrasse 111
CH-5232 Villigen PSI 

On Sun, Feb 21 2021, John Kitchin  wrote:

> For fun, here is the sqlite equivalent of the Pandas example using the same
> tables as before
>
>
> ** aggregation example
>
> Examples from https://github.com/tbanel/orgaggregate
>
>
> #+NAME: original
> | Day   | Color | Level | Quantity |
> |---+---+---+--|
> | Monday| Red   |30 |   11 |
> | Monday| Blue  |25 |3 |
> | Tuesday   | Red   |51 |   12 |
> | Tuesday   | Red   |45 |   15 |
> | Tuesday   | Blue  |33 |   18 |
> | Wednesday | Red   |27 |   23 |
> | Wednesday | Blue  |12 |   16 |
> | Wednesday | Blue  |15 |   15 |
> | Thursday  | Red   |39 |   24 |
> | Thursday  | Red   |41 |   29 |
> | Thursday  | Red   |49 |   30 |
> | Friday| Blue  | 7 |5 |
> | Friday| Blue  | 6 |8 |
> | Friday| Blue  |11 |9 |
>
>
> #+begin_src sqlite :db ":memory:" :var orgtable=original :colnames yes
> drop table if exists testtable;
> create table testtable(Day str, Color str, Level int, Quantity int);
> .mode csv testtable
> .import $orgtable testtable
> select Color, count(*) from testtable group by Color;
> #+end_src
>
> #+RESULTS:
> | Color | count(*) |
> |---+--|
> | Blue  |7 |
> | Red   |7 |
>
> ** join example
>
> Example from https://github.com/tbanel/orgtbljoin
>
> #+name: nutrition
> | type | Fiber | Sugar | Protein | Carb |
> |--+---+---+-+--|
> | eggplant |   2.5 |   3.2 | 0.8 |  8.6 |
> | tomatoe  |   0.6 |   2.1 | 0.8 |  3.4 |
> | onion|   1.3 |   4.4 | 1.3 |  9.0 |
> | egg  | 0 |  18.3 |31.9 | 18.3 |
> | rice |   0.2 | 0 | 1.5 | 16.0 |
> | bread|   0.7 |   0.7 | 3.3 | 16.0 |
> | orange   |   3.1 |  11.9 | 1.3 | 17.6 |
> | banana   |   2.1 |   9.9 | 0.9 | 18.5 |
> | tofu |   0.7 |   0.5 | 6.6 |  1.4 |
> | nut  |   2.6 |   1.3 | 4.9 |  7.2 |
> | corn |   4.7 |   1.8 | 2.8 | 21.3 |
>
>
> #+name: recipe
> | type | quty |
> |--+--|
> | onion|   70 |
> | tomatoe  |  120 |
> | eggplant |  300 |
> | tofu |  100 |
>
>
> #+begin_src sqlite :db ":memory:" :var nut=nutrition rec=recipe :colnames
> yes
> drop table if exists nutrition;
> drop table if exists recipe;
> create table nutrition(type str, Fiber float, Sugar float, Protein float,
> Carb float);
> create table recipe(type str, quty int);
>
> .mode csv nutrition
> .import $nut nutrition
>
> .mode csv recipe
> .import $rec recipe
>
> select * from recipe, nutrition where recipe.type=nutrition.type;
> #+end_src
>
> #+RESULTS:
> | type | quty | type | Fiber | Sugar | Protein | Carb |
> |--+--+--+---+---+-+--|
> | onion|   70 | onion|   1.3 |   4.4 | 1.3 |  9.0 |
> | tomatoe  |  120 | tomatoe  |   0.6 |   2.1 | 0.8 |  3.4 |
> | eggplant |  300 | eggplant |   2.5 |   3.2 | 0.8 |  8.6 |
> | tofu |  100 | tofu |   0.7 |   0.5 | 6.6 |  1.4 |
>
>
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
>
> On Sun, Feb 21, 2021 at 10:03 AM John Kitchin 
> wrote:
>
>> Thanks Tim and Greg. I had mostly come to the same conclusions that it is
>> probably best to outsource this. I worked out some examples from
>> the orgt

Re: org-tables with monetary amounts

2020-10-13 Thread Derek Feichtinger
Hi,

On Mon, Oct 12 2020, Eric S Fraga  wrote:

> On Monday, 12 Oct 2020 at 10:22, Christian Moe wrote:
>> I think I was thinking about adding mode flags for unit computations,
>> like in the imagined example above (`$3=$2+$1;u'), similar to what has
>> been done for duration computations. 
>
> This would be very useful, actually.  I use embedded calc all the time
> with units; being able to use some of the same expressions in a table
> would be highly welcome.

The functions that one can use in calc formulas can be extended using
the 'defmath' lisp command. I paste here from my notes (not about
monetary units, but easily adapted):

+++
Defining a new calc function for unit conversion with defmath
#+BEGIN_SRC emacs-lisp
(defmath uconv (expr target-units  pure)
  (math-convert-units expr target-units pure))
#+END_SRC

#+RESULTS:
: calcFunc-uconv

| km | ft   |
|+--|
| 2.5 km | 8202.0997 ft |
#+TBLFM: $2=uconv($1, ft)

Using the units from the table header (if the 3rd arg is given to
uconv, the output is stripped of the unit):

|  km |ft |
|-+---|
| 2.5 | 8202.0997 |
#+TBLFM: $2 = uconv($1 * @<$1, @<$2, t)

The standard calc function usimplify also works for this use
case:

|  km |ft |
|-+---|
| 2.5 | 8202.0997 |
#+TBLFM: $2 = usimplify($1 * @<$1 / @<$2)

A lisp equivalent of the above
#+begin_src elisp
(calc-eval "usimplify(2.5 km / ft)")
#+end_src

#+RESULTS:
: 8202.09973753

Let's define a function that converts to base units
#+begin_src elisp
  (defmath ustd (expr) (math-simplify-units (math-to-standard-units expr nil)))
#+end_src

#+RESULTS:
: calcFunc-ustd

| distance | time   | speed   | std unit speed   | speed in ft/s|
|--++-+--+--|
| 3 km | 2.5 hr | 1.2 km / hr | 0. m / s | 1.0936133 ft / s |
#+TBLFM: @2$3=$1/$2::@2$4=ustd($3)::@2$5=uconv($-1, ft/s)
++++


-- 
Paul Scherrer Institut
Dr. Derek Feichtinger   Phone:   +41 56 310 47 33
Group Head HPC and Emerging Technologies  Email: derek.feichtin...@psi.ch
Building/Room No. OHSA/D17
Forschungsstrasse 111
CH-5232 Villigen PSI 



Re: Bug or not a bug? dot expansion in ob-shell

2020-02-20 Thread Derek Feichtinger
+1 - I also think that this is the correct behavior, and that the
average user's expectations can be best fulfilled by making ":results output"
the default. Adding the option will make it more difficult to share code
blocks and documents.

Best regards,
Derek

On Thu, Feb 20 2020, Tim Cross  wrote:

> +1 - this is basically my feeling as well. I've spent the last couple of
> days thinking about the additional option suggestion, but something just
> didn't feel right to me. I think Nick has hit the nail on the head.
>
> Adding the additional option seems to be making things more confusing.
> The basic idea that result value is what the block returns i.e. the
> return value of the last statement for shell blocks and result output is
> what the code in the block sends to stdout/stderr. This seems the most
> intuitive to me.
>
>
> Nick Dokos  writes:
>
>> Hi Bastien,
>>
>> Bastien  writes:
>>
>>> Hi Diego,
>>>
>>> Diego Zamboni  writes:
>>>
>>>> I'm late to the discussion so I apologize in advance, but this fix
>>>> seems counterintuitive to me. In my mind, for any shell code:
>>>>
>>>> - Return value: exit code of the last command
>>>> - Output: whatever the commands print
>>>
>>> Yes, that's what is *now* possible if you set
>>> ob-shell-return-value-is-exit-status to t.
>>>
>>> Unless I miss something, it was not possible before today.
>>>
>>> #+begin_src shell
>>> echo Hello!
>>> #+end_src
>>>
>>> would simply return "Hello!" as a return.
>>>
>>> No exit code was *never* output.
>>>
>>>> So to me, it's intuitive that =:exports value= would return the exit
>>>> code of the last command, and =:exports output= would produce the
>>>> output of the commands. I don't understand why a new option is
>>>> needed.
>>>
>>> ... because it was not the case before.  Or maybe *I* miss something.
>>>
>>> Can you show me something that was working before and that is not
>>> anymore?
>>>
>>> Thanks,
>>
>> I welcome the fix but not the option: the option situation in Org mode
>> was pretty horrible, then ca 2010, you did a survey and some options
>> were eliminated (not sure about the year or whether it *was* you who
>> did the survey, but I'm pretty sure there was one): that was the right
>> direction to go, but it wasn't enough. Org mode needs to be put into
>> an option diet, so adding another one here (and a rather gratuitous
>> one in my view) is not the way to go.
>>
>> `:results value' should *always* produce the value of the last expression,
>> which for shell programs is the exit status of the last command.
>>
>> `:results output' should *always* produce all of the output of the program.
>>
>> An argument can be made that `:results value' is the default, but it
>> is the less useful option for shell programs. So maybe for shell
>> blocks, make the default to be `:results output' instead: people get
>> what they always got before the fix without lifting a finger, the exit status
>> is now available with `:results value', and the option can go away
>> quietly and quickly, before it becomes another contributor to the Org
>> mode technical debt.


-- 
Paul Scherrer Institut
Dr. Derek Feichtinger   Phone:   +41 56 310 47 33
Group Head HPC and Emerging Technologies  Email: derek.feichtin...@psi.ch
Building/Room No. WHGA/U126
Forschungsstrasse 111
CH-5232 Villigen PSI 



[O] src block indentation causing problems due to tab/space mixing - proposed fix

2018-07-27 Thread Derek Feichtinger
Dear Org developers

I think that the current way of indenting source blocks
(with org-src-preserve-indentation is set to nil) is not ideal in regard
to languages that dislike mixing of tabs and spaces.

I'm currently switching to python3 and this forbids the mixing.
Setting org-src-preserve-indentation to t would basically create
problems with many of my older files, and I also dislike the reduced
readability resulting from the code block contents being aligned at
column 0.

I just checked out the org mode master f79545f and made sure
that the relevant lines match my current active version of
org-plus-contrib-20180709.

Looking at the code:

org-edit-src-exit calls org-src--contents-for-write-back for writing the
contents of the source buffer. Inside of that function, all leading whitespace
of each line is replaced using indent-to. This leads to mixing tabs and
spaces and causes problems with python3.

in org-src--contents-for-write-back:

 #+BEGIN_SRC elisp
   (when (> indentation-offset 0)
 (while (not (eobp))
   (skip-chars-forward " \t")
   (unless (eolp)   ;ignore blank lines
 (let ((i (current-column)))
   (delete-region (line-beginning-position) (point))
   (indent-to (+ i indentation-offset
   (forward-line)))
 #+END_SRC

I tested this simple alternative which just uses indent-to to fill up
the columns needed for the source blocks basic indentation offset, but
which does not affect any leading whitespace from the code's buffer.

 #+BEGIN_SRC elisp
  (when (> indentation-offset 0)
(while (not (eobp))
  (unless (eolp)
(indent-to indentation-offset))
  (forward-line)))
 #+END_SRC

This still allows org mode to use tabs for the block's basic indentation
offset, so that the block is nicely aligned with the rest of the org
buffer, but it prevents modification of the whitespace which is relevant
to the block itself.

I just tested it also with some tangled files, and it seems to work
nicely for my test cases. Still, I may have overlooked something, and
there is a deeper reason for the original implementation.

Best regards,
Derek

--
Paul Scherrer Institut
Dr. Derek Feichtinger   Phone:   +41 56 310 47 33
Section Head Science-IT Email: derek.feichtin...@psi.ch
Building/Room No. WHGA/U126
CH-5232 Villigen PSI



[O] Bug: org-babel-expand-src-block expands sh blocks independent of shell defined by src block [9.0.5 (9.0.5-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20170210/)]

2017-05-07 Thread Derek Feichtinger

Hi

When using =org-babel-expand-src-block= with a shell src block one 
always gets the same code expansion (in my case bash) independent of the 
shell that is used while the execution of the shell block uses the 
correct expansion.



I define the following table to illustrate the problem:

#+NAME: tbltest
| col1 | col2 | col3 |
|   11 |   12 |   13 |
|   21 |   22 |   23 |
|   31 |   32 |   33 |

Now for the example source block where I read in the table

#+BEGIN_SRC sh :results value  :exports both :var tbl=tbltest :colnames yes
  echo $tbl
#+END_SRC

When expanding the sh source block above with 
=org-babel-expand-src-block= it is wrongly expanded to the
bash expansion and not to the sh expansion that is used when the block 
is executed. So, instead of the

sh expansion,

 tbl='111213
 212223
 313233'


I see the following bash related expansion in the opened buffer:

#+BEGIN_EXAMPLE
   unset tbl
   declare -A tbl
   tbl['11']='12
   13'
   tbl['21']='22
   23'
   tbl['31']='32
   33'
   echo $tbl
#+END_EXAMPLE

Reason:

The case distinction in =org-babel-variable-assignments:shell= is
made based on the shell-file-name which is a standard emacs
variable set by emacs in C code. This is pointing to "/bin/bash"
for my installation.

#+BEGIN_SRC elisp :exports source
   (defun org-babel-variable-assignments:shell (params)
"Return list of shell statements assigning the block's variables."
(let ((sep (cdr (assq :separator params)))
  (hline (when (string= "yes" (cdr (assq :hlines params)))
   (or (cdr (assq :hline-string params))
   "hline"
  (mapcar
   (lambda (pair)
 (if (string-suffix-p "bash" shell-file-name)
 (org-babel--variable-assignments:bash
  (car pair) (cdr pair) sep hline)
   (org-babel--variable-assignments:sh-generic
(car pair) (cdr pair) sep hline)))
   (org-babel--get-vars params
#+END_SRC

Looking at the calls stack for the case where we execute the source 
block and where we just expand it, we see

the following call stack for execution

#+BEGIN_EXAMPLE
org-babel-variable-assignments:shell
org-babel-execute:shell
org-babel-execute:sh
org-babel-execute-src-block
#+END_EXAMPLE

while in the case of just expanding the source block we have

#+BEGIN_EXAMPLE
   org-babel-variable-assignments:sh
   org-babel-expand-src-block
#+END_EXAMPLE

Note that =org-babel-variable-assignments:sh= is an alias for
=org-babel-variable-assignments:shell=.

A bit of investigation shows that for all shell languages there
are aliases defined that finally call
=org-babel-execute:shell=. This is set up in the
=org-babel-shell-initialize= function. And it is set up in a way
that =shell-file-name= is overridden by the name of the
particular shell, and this then leads to the correct case
distinction using =shell-file-name= in
=org-babel-variable-assignments:shell=.

#+BEGIN_SRC elisp :exports source
   (defun org-babel-shell-initialize ()
"Define execution functions associated to shell names.
   This function has to be called whenever `org-babel-shell-names'
   is modified outside the Customize interface."
(interactive)
(dolist (name org-babel-shell-names)
  (eval `(defun ,(intern (concat "org-babel-execute:" name))
 (body params)
   ,(format "Execute a block of %s commands with Babel." name)
   (let ((shell-file-name ,name))
 (org-babel-execute:shell body params
  (eval `(defalias ',(intern (concat 
"org-babel-variable-assignments:" name))

   'org-babel-variable-assignments:shell
   ,(format "Return list of %s statements assigning to the block's \
   variables."
name)
#+END_SRC

The same kind of overriding would have to be in place when
=org-babel-expand-src-block= calls
=org-babel-variable-assignments:shell= in the simple code expansion 
case. But that
would be a bit hacky since the generic =org-babel-expand-src-block= 
function should

not override variables needed in just one subclass of backends. It would be
cleaner to have different functions =org-babel-variable-assignments:XXX= 
for the

different shells.



Emacs  : GNU Emacs 25.2.3 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2017-04-25
Package: Org mode version 9.0.5 (9.0.5-elpaplus @ 
~/.emacs.d/elpa/org-plus-contrib-20170210/)



--
Paul Scherrer Institut
Dr. Derek Feichtinger   Phone:   +41 56 310 47 33
Section Head Science-IT Email: derek.feichtin...@psi.ch
Building/Room No. WHGA/U126
CH-5232 Villigen PSI




Re: [O] org-export-babel-evaluate=nil ignores ":exports results" setting - this has changed

2017-02-22 Thread Derek Feichtinger

Hi Colin

On 22.02.2017 16:27, Colin Baxter wrote:

Hi.

On Tue, Feb 21 2017, Charles C. Berry wrote:


On Mon, 20 Feb 2017, Derek Feichtinger wrote:


Hi Chuck

On 21.02.2017 00:54, Charles C. Berry wrote:

On Mon, 20 Feb 2017, Derek Feichtinger wrote:


When org-export-babel-evaluate is set to nil, I see a different
behavior now as compared to earlier versions of org.

Indeed.

It is now *obsolete* and its behavior has intentionally been
changed as noted here:




So, I still feel that this is a very much needed functionality that
has been lost on the way.

Nothing is lost here.

Reread the part of my post that you deleted in your reply:

: | ...  Users
: | who wish to avoid evaluating code on export should use the header
: | argument ‘:eval never-export’.
: |

which is how to do what you want.

And maybe review how to set header args buffer wide or system-wide.


I agree very much with the sentiments expressed by Derek
Feichtinger. The old org-export-babel-evaluate allowed a setting to be made
for one or several files. Perhaps I've not understood correctly, but the
new arrangement would seem to suggest that the user has to insert what
they want at each src_code block.

Based on the documentation one can set the header arguments system wide 
using these variables:


org-babel-default-header-args (for all)
org-babel-default-header-args:   (language specific)

File wide using PROPERTY:
#+PROPERTY: header-args :eval never-export

Org heading wide using a local property setting:
 * sample header
   :PROPERTIES:
   :header-args::eval never-export
   :END:

The last two ways I tested. So, in the end, with some changes to most of 
my files I can get the same behavior again, which is good.


It's a matter of taste or use case whether to define the default 
behavior to eval on export. I would have made the case the eval on 
export is the more rare use case. I almost never have this, except for 
certain kinds of reports, e.g. if you want to gather the state of a 
server with a number of prepared queries in the org file. For me, most 
org files are like a number of measurements taken at a certain point in 
time, and I want to conserve the output of the evaluation exactly like 
it was. E.g. when working at speeding up code, I very much like to do 
the whole thing inside of an org file where I document the speed 
measurements, my changes to code and what the effect was. So, more like 
some kind of interactive lab journal.


But as I said, it is a matter of taste, and I am happy that I can get 
the original functionality without too much effort.


Best regards,
Derek


--
Paul Scherrer Institut
Dr. Derek Feichtinger   Phone:   +41 56 310 47 33
Section Head Science-IT Email: derek.feichtin...@psi.ch
Building/Room No. WHGA/U126
CH-5232 Villigen PSI




Re: [O] org-export-babel-evaluate=nil ignores ":exports results" setting - this has changed

2017-02-20 Thread Derek Feichtinger

Hi Chuck

On 21.02.2017 00:54, Charles C. Berry wrote:

On Mon, 20 Feb 2017, Derek Feichtinger wrote:

When org-export-babel-evaluate is set to nil, I see a different 
behavior now as compared to earlier versions of org.


Indeed.

It is now *obsolete* and its behavior has intentionally been changed 
as noted here:


In my current version from MELPA the info text is not yet reflecting 
this change. Thanks for pointing me to it.




,[ C-h v org-export-babel-evaluate RET ]
| org-export-babel-evaluate is a variable defined in ‘org-compat.el’.
| Its value is t
|
|   This variable is an alias for ‘org-export-use-babel’.
|   This variable is obsolete since Org 9.1;
|   use ‘org-export-use-babel’ instead.

and here

 (info "(org) Exporting code blocks")


I think that this should be considered a bug.


Allowing header args to be processed (as before) also allows for 
arbitrary code to be executed.  The point of setting 
‘org-export-use-babel’ or `org-export-babel-evaluate' to nil was to 
prevent this.  For that reason the former behavior was a bug.


OK. I can see that one wants to prevent most header args of babel blocks 
from being reeavaluated, but the :exports argument does not affect 
evaluation, but simply the representation of the result exported to the 
target document. So, I think that this argument still should be 
observed. Otherwise the resulting document would be completely changed 
once I introduce ‘org-export-use-babel’. I might want to introduce it to 
conserve the current code block results, while still being very much 
interested in exporting it to a different format, or re-exporting it at 
a later point (after having added new chapters that are manually evaluated).


So, I still feel that this is a very much needed functionality that has 
been lost on the way. I have made many documents over the last few years 
that relied on this functionality, e.g. files collecting logs or 
producing analysis results that were dependent on a particular state of 
a system at that moment of time. I hope that the observing of the 
:exports argument can be reintroduced.


Derek

--
Paul Scherrer Institut
Dr. Derek Feichtinger   Phone:   +41 56 310 47 33
Section Head Science-IT Email: derek.feichtin...@psi.ch
Building/Room No. WHGA/U126
CH-5232 Villigen PSI




[O] org-export-babel-evaluate=nil ignores ":exports results" setting - this has changed

2017-02-20 Thread Derek Feichtinger
When org-export-babel-evaluate is set to nil, I see a different behavior 
now as compared to earlier versions of org.


Now it seems that all header arguments of a code block are ignored, 
including the arguments to the :exports setting. Even when I have set 
":exports results" or ":exports code" I always get code and results 
exported in the resulting document. If org-export-babel-evaluate is set 
to t then everything behaves the way I was used to, ":exports results" 
just exports the results and when set to "code" just the code is exported.


I think that this should be considered a bug. I frequently (even most of 
the time) want to evaluate the org blocks manually, not upon export, but 
I want to be able to define whether only the results should be visible 
in the exported document. For generated pictures this is usually the 
normal case.


I am using org 9.0.5 from MELPA now, and I can't completely say when 
this changed, but I am very sure that a few weeks ago the behavior was 
different, since I am using org a lot for preparing documents.


Simple test document:

#
* Test

  #+BEGIN_SRC elisp :results output :exports code
(princ (format "This should only export the code\nemacs %s\norg %s" 
emacs-version org-version))

  #+END_SRC

  #+RESULTS:
  : This should only export the code
  : emacs 25.1.1
  : org 9.0.5

  #+BEGIN_SRC elisp :results output :exports results
(princ (format "This should only export the results\nemacs %s\norg 
%s" emacs-version org-version))

  #+END_SRC

  #+RESULTS:
  : This should only export the results
  : emacs 25.1.1
  : org 9.0.5


* COMMENT Org babel settings
Local Variables:
org-export-babel-evaluate: nil
End:


ASCII exported document when org-export-babel-evaluate: nil


1 Test
==

  ,
  | (princ (format "This should only export the code\nemacs %s\norg %s" 
emacs-version org-version))

  `

  ,
  | This should only export the code
  | emacs 25.1.1
  | org 9.0.5
  `

  ,
  | (princ (format "This should only export the results\nemacs %s\norg 
%s" emacs-version org-version))

  `

  ,
  | This should only export the results
  | emacs 25.1.1
  | org 9.0.5
  `


ASCII exported document when org-export-babel-evaluate: t

1 Test
==

  ,
  | (princ (format "This should only export the code\nemacs %s\norg %s" 
emacs-version org-version))

  `

  ,
  | This should only export the results
  | emacs 25.1.1
  | org 9.0.5
  `


Best regards,
Derek


--
Paul Scherrer Institut
Dr. Derek Feichtinger   Phone:   +41 56 310 47 33
Section Head Science-IT Email: derek.feichtin...@psi.ch
Building/Room No. WHGA/U126
CH-5232 Villigen PSI




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 <m...@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Derek Feichtinger <dfe...@gmail.com> 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] whether in drawer?

2016-04-27 Thread Derek Feichtinger
Hi

Samuel Wales  gmail.com> writes:

> 
> can one tell whether point is in a drawer?
> 
> 
By coincidence just posted a patch request which contains the functionality
you desire. I use org-element-at-point and then test for drawer/property drawer:

(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)))
(when element
  (let ((pos (point)))
(goto-char (org-element-property :begin element))
(org-flag-drawer nil)
(goto-char pos)


Cheers,
Derek




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

2016-04-27 Thread Derek Feichtinger
Hello

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.

I had fixed it for myself a longer time ago and forgot to submit my proposal
for a patch, until yesterday another user raised my attention to it.

My proposal for a patch is


;; 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)))
(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)


Best regards,
Derek





Re: [O] Problem with org-timestamp-up and timezones

2016-04-15 Thread Derek Feichtinger
Hi

Robert Eckl  gmx.de> writes:

> > 8.3.4 / 8.3.4-15-gdd9be3-elpaplus). So this must be an incompatibility
> > introduced in the emacs core development.
> > 
> The bug seems to be introduced after emacs commit c23c965bb9d0
> 

Thanks for the pointer. I can see that something with the timezones was
changed, but cursorily looking just showed me some changes in the comments.
I only had time now to have a closer look. But I decided to try fix it in
org mode, since this seemed easier.

The problematic statement is in org.el, defun org-timestamp-change, where
the argument list to encode time evaluates to something like

(encode-time 0 0 0 30 11 2013 '(nil nil nil))

i.e. the 7th argument is a list, while the function would be ok with getting
the three nil values not packed into a list. So, just introducing an "apply"
in front fixes this for now.

So from the following code in org-timestamp-change

   ...
  (setq time
(encode-time (or (car time0) 0)
 (+ (if (eq org-ts-what 'minute) n 0) (nth 1 time0))
 (+ (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)))
   ...

I just modify to the following

   ...
  (setq time
(apply
 'encode-time (or (car time0) 0)
 (+ (if (eq org-ts-what 'minute) n 0) (nth 1 time0))
 (+ (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)))
   ...


Afterwards the time shifts on the clock lines works fine, again. But I do
not know whether this fixes all cases, or what really is the deeper reason
that this error surfaced right now.

Cheers,
Derek






Re: [O] Problem with org-timestamp-up and timezones

2016-04-15 Thread Derek Feichtinger
Hi

> 
> I ran into the same problem right now. Also with org mode from MELPA and the
> current emacs master from git.
> - GNU Emacs 25.1.50.5 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of
>   2016-04-15
> - Org-mode version 8.3.4 (8.3.4-34-gacfd41-elpaplus
> 
> Debugger entered--Lisp error: (error "Invalid time zone specification" (nil
> nil nil))
>   encode-time(0 0 12 15 4 2016 (nil nil nil))
>   org-timestamp-change(1 nil updown)
>   org-timestamp-up(1)
>   funcall-interactively(org-timestamp-up 1)
>   call-interactively(org-timestamp-up)
>   org-shiftup(nil)
>   funcall-interactively(org-shiftup nil)
>   call-interactively(org-shiftup nil nil)
>   command-execute(org-shiftup)
> 
> Cheers,
> Derek
> 
> 

Sorry, should have confirmed that before sending the last mail: I get the
same behavior using the older org version from my backup (Org-mode version
8.3.4 / 8.3.4-15-gdd9be3-elpaplus). So this must be an incompatibility
introduced in the emacs core development.

Cheers,
Derek





Re: [O] Problem with org-timestamp-up and timezones

2016-04-15 Thread Derek Feichtinger
Hi

Jesse  gmail.com> writes:

> 
> Eric Abrahamsen  ericabrahamsen.net> writes:
> 
> > 
> > Hey, I just tried using org-shiftup on a timestamp, and got the
> > following traceback. I'm using the Org package, and Emacs master from
> > git.
> 
> I too am experiencing this issue under the same conditions (Emacs master + 
> MELPA org 20160411). My trace is nearly identical.
> 
> 

I ran into the same problem right now. Also with org mode from MELPA and the
current emacs master from git.
- GNU Emacs 25.1.50.5 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of
  2016-04-15
- Org-mode version 8.3.4 (8.3.4-34-gacfd41-elpaplus



Debugger entered--Lisp error: (error "Invalid time zone specification" (nil
nil nil))
  encode-time(0 0 12 15 4 2016 (nil nil nil))
  org-timestamp-change(1 nil updown)
  org-timestamp-up(1)
  funcall-interactively(org-timestamp-up 1)
  call-interactively(org-timestamp-up)
  org-shiftup(nil)
  funcall-interactively(org-shiftup nil)
  call-interactively(org-shiftup nil nil)
  command-execute(org-shiftup)

Cheers,
Derek





Re: [O] org table with auto-incrementing numbers in a column

2016-02-16 Thread Derek Feichtinger
Hi


> >
> > Try this
> >
> >   | N |   |
> >   |---+---|
> >   |   |   |
> >   |   |   |
> >   |   |   |
> >   |   |   |
> >   #+TBLFM: $1..>$1= -1 + 1:: 2$1=1
> >

Sorry, I had a typo from copying and replacing  in my formula

should be


  | N |   |
  |---+---|
  | 1 |   |
  | 2 |   |
  | 3 |   |
  | 4 |   |
  #+TBLFM: 3$1..>$1= -1 + 1:: 2$1=1


> 
> I don't know exactly why  "N" is *not* erased but the following is
> working for me (org 8.2.10).

Hmmm... I just tested. Seems that org is treating the cells before the first
horizontal separator line as special... nice. But I seem to remember that
this was not always like this.

This made me now investigate more closely, using the formula debugger (C-c
{) for investigating the original formula.

When I use this formula

#+TBLFM: $1= @-1 + 1:: @2$1=1

Then org will first fill this part of the table (starting at cell 2$1)

  | N |   |
  |---+---|
  |   |   |
  | 1 |   |
  | 2 |   |
  | 3 |   |
  #+TBLFM: $1= -1 + 1:: 2$1=1

Then it will execute the second formula, which sets the value in row 2:

  | N |   |
  |---+---|
  | 1 |   |
  | 1 |   |
  | 2 |   |
  | 3 |   |

Only upon a second evaluation of the whole table, it will arrive at

  | N |   |
  |---+---|
  | 1 |   |
  | 2 |   |
  | 3 |   |
  | 4 |   |

So, this is one of the cases where one needs to carry our iterations until
the table stays constant (can use org-table-iterate).

I also tried the same with changing the order of the two formulas. Seems
that the row formula always is executed first. So, at least this is
consistent. Why it starts at row 3 one would need to look up in the source...


> 
> | N |
> |---|
> | 1 |
> | 2 |
> | 3 |
> | 4 |
> | 5 |
> #+TBLFM: $1=  #-1
> 
> > Placing point on the TBLFM line and doing C-c C-c should recalculate the
> > whole table.

That formula works fine. It's just a difference in functionality.. the above
formula calculates a value based on the numeric position of the current row,
while the other formula looks up the value above the current row.

Cheers,
Derek






Re: [O] org table with auto-incrementing numbers in a column

2016-02-15 Thread Derek Feichtinger
Hi

Kaushal Modi  gmail.com> writes:

> 
> Hi,
> I am trying to get auto-incrementing numbers in the first column in an org
table. The goal is to recalculate the numbers after adding/removing rows.
> 
> I checked out the org
FAQ: 
http://orgmode.org/worg/org-faq.html#fill-table-column-with-incremental-numbers
> 
> 
> But I am still not getting it to work as I need to.
> 
> Below is the minimum working example. Paste the below in an org buffer.
> 
> 
> 
> | N |   |
> |---+---|
> |   |   |
> |   |   |
> |   |   |
> |   |   |
> #+TBLFM: $1=  -1+1::  2$1=1
> 
> 

Try this

  | N |   |
  |---+---|
  |   |   |
  |   |   |
  |   |   |
  |   |   |
  #+TBLFM: $1..>$1= -1 + 1:: 2$1=1


One problem is that $1 also includes the first row with the "N" heading.
that is why in your example the second and third lines both will at first
contain 1 (at least with my org version 8.3.3), and in the second iteration
only show the correct series.

> Now with the point anywhere in the table, when I hit "C-c *" or M-x
org-table-recalculate, I expect the first column to be auto-populated with
numbers 1,2,3,4 (or that's how I understood from the tutorial in the FAQ
link above).
> 
> But it does not work that way. Instead I need to go to each row and hit C-c *.

Placing point on the TBLFM line and doing C-c C-c should recalculate the
whole table.


Cheers,
Derek




[O] Bug: HTML export of equations leads to error [8.3.3 (8.3.3-17-gce80a0-elpaplus @ /home/dfeich/.emacs.d/elpa/org-plus-contrib-20160118/)]

2016-01-24 Thread Derek Feichtinger
Dear Org maintainers

HTML export of equations leads to an error since my last update from
MELPA, yesterday. I can trace it back to the invocation of
org-element-context in a temporary buffer in fundamental mode. A more
exact analysis follows.

Emacs  : GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
 of 2015-05-04 on dflt1w
Package: Org-mode version 8.3.3 (8.3.3-17-gce80a0-elpaplus @
/home/dfeich/.emacs.d/elpa/org-plus-contrib-20160118/)


The error can be reproduced using a minimal org file with these contents:

#+BEGIN_EXAMPLE
* Equation export error

  This equation produces an error on html export

  $$
U = R \cdot I
  $$

#+END_EXAMPLE

Upon export to html the following error and backtrace result (I took
the liberty of cutting the lines to avoid special characters).

#+BEGIN_EXAMPLE
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  looking-at(nil)
  byte-code("\212\214~\210...
  org-element-context()
  org-format-latex("" "" nil "Creating LaTeX Image..." nil mathjax)
  org-html-format-latex("$$\n ...
  org-html-latex-fragment((latex-fragment ...
  org-export-data((latex-fragment ...
  #[(element)...
  mapconcat(#[(element)...
  org-export-data((paragraph...
  #[(element) "\302...
  mapconcat(#[(element)...
  org-export-data((section...
  #[(element) "\302...
  mapconcat(#[(element)...
  org-export-data((headline...
  #[(element) "\302...
  mapconcat(#[(element) "\302...
  org-export-data((org-data nil (headline (:raw-value "Equation export
error" :begin 1 :end 108 :pre-blank 1 :contents-begin 26 :contents-end 104
:level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil
:post-blank 2 :footnote-section-p nil :archivedp nil :commentedp nil
:post-affiliated 1 :title (#("Equation export error" 0 21 (:parent #1)))
:parent #0) (section (:begin 26 :end 108 :contents-begin 26 :contents-end
104 :post-blank 2 :post-affiliated 26 :parent #1) (paragraph (:begin 26
:end 76 :contents-begin 26 :contents-end 75 :post-blank 1 :post-affiliated
26 :parent #2) #("This equation produces an error on html export\n" 0 47
(:parent #3))) (paragraph (:begin 76 :end 104 :contents-begin 76
:contents-end 104 :post-blank 0 :post-affiliated 76 :parent #2) ""
(latex-fragment (:value "$$\nU = R \\cdot I\n  $$" :begin 78 :end 103
:post-blank 0 :parent #3)) #("\n" 0 1 (:parent #3)) (:export-options
nil :input-buffer "err-example.org" :input-file "/tmp/html-exp-error/
err-example.org" :html-doctype "xhtml-strict" :html-container "div"
:description nil :keywords nil :html-html5-fancy nil :html-link-use-abs-url
nil :html-link-home "" :html-link-up "" :html-mathjax "" :html-postamble
auto :html-preamble t :html-head "" :html-head-extra "" :subtitle nil
:html-head-include-default-style t :html-head-include-scripts t
:html-allow-name-attribute-in-anchors nil :html-divs ((preamble "div"
"preamble") (content "div" "content") (postamble "div" "postamble"))
:html-checkbox-type ascii :html-extension "html" :html-footnote-format
"%s" :html-footnote-separator ", " ...))
  org-export-as(html nil nil nil (:output-file "./err-example.html"))
  org-export-to-file(html "./err-example.html" nil nil nil nil nil)
  org-html-export-to-html(nil nil nil nil)
  org-export-dispatch(nil)
  call-interactively(org-export-dispatch nil nil)
  command-execute(org-export-dispatch)
#+END_EXAMPLE

>From the debugger I can see that the org-element-context is executed in a
temporary buffer:

: Debugger Eval ((point)): 1
: Debugger Eval (major-mode): fundamental-mode
: Debugger Eval ((buffer-name)):  *temp*-831342
: Debugger Eval ((buffer-string)): $$
: U = R \cdot I
:   $$


I can reproduce the error by creating a file and filling it with the
contents
that "buffer-string" yielded and opening it in fundamental mode.
#+BEGIN_EXAMPLE
$$
U = R \cdot I
$$
#+END_EXAMPLE

When I now execute "org-element-context" with point at 1 then I get the
same error:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  looking-at(nil)
  byte-code("\212\214~\210...
  org-element-context()
  eval((org-element-context) nil)
  eval-expression((org-element-context) nil)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

If the buffer is set to org-mode, the error does not appear, and
org-element-context
correctly recognizes the text as a latex-fragment.


Best regards,
Derek


Re: [O] Bug: HTML export of equations leads to error [8.3.3 (8.3.3-17-gce80a0-elpaplus @ /home/dfeich/.emacs.d/elpa/org-plus-contrib-20160118/)]

2016-01-24 Thread Derek Feichtinger
Hello

On Sun, Jan 24, 2016 at 6:18 PM, Nicolas Goaziou <m...@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Derek Feichtinger <dfe...@gmail.com> writes:
>
> > I was able to repair the problem by setting the temp buffer that is
> created
> > within ort-html-format-latex to org-mode. I put the function with the
> > added line marked by PATCH here:
>
> Thank you. However, I think it only papers over the problem: I see no
> reason for the parser to fail in fundamental mode.
>
> I cannot reproduce the error, neither on master nor on maint. OTOH,
> there was a bug related to $$...$$ constructs, which I fixed.
>
> Could you try again? Also, if the problem persists, could you send
> a full backtrace, without compiling Org?
>
>
I discovered some files from a previous package installation that somehow
had not been cleaned up completely. After removing the older directory, the
error does not appear again, so it must have been due to an interference.
Sorry for having led you onto a wild goose chase.

Thanks a lot for your help,
Derek


Re: [O] Bug: org-resolve-clocks should not iterate over non-agenda org files [8.3.3 (8.3.3-elpaplus @ /home/dfeich/.emacs.d/elpa/org-plus-contrib-20160108/)

2016-01-21 Thread Derek Feichtinger
Hi Nicolas

Ok, that makes sense, then. Probably there are other users who indeed will
rely on clocking in non-agenda files.

The thing which made it hard for me to identify the initial problem was
that the test CLOCK lines I had in the testing file where placed there
without a heading. When later in the day I wanted to clock in to my tasks,
 I then just ended up with a "outline-back-to-heading: before first
heading" error, but with no indicator which of my ~60 open org files was
the culprit. Maybe one could insert the file location in that error message?

Since org is so extremely useful, and I almost spend 80% of my day in org
files (also some of my collaborators are beginning to use it... it is
viral), I often have >50 files with all kinds of purposes open: agenda,
various notes, beamer, html-exports, wiki-authoring, project-organization,
bookkeeping... the thing is just too useful. So, I think clashes between
the many uses of org files probably are natural.

This being emacs  :-) I just decided to advise org-resolve-clocks.

(defun dfeich/org-resolve-clocks (orig-function  only-dangling-p
prompt-fn last-valid)
  (cl-letf (((symbol-function 'org-files-list) 'org-agenda-files))
(apply orig-function only-dangling-p prompt-fn last-valid)))

(advice-add #'org-resolve-clocks :around #'dfeich/org-resolve-clocks)

Thanks for maintaining and developing an environment which made my time in
front of the keyboard so much more efficient.

Derek

On Wed, Jan 20, 2016 at 2:14 PM, Nicolas Goaziou <m...@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Derek Feichtinger <dfe...@gmail.com> writes:
>
> > org-resolve-clock loops over all open org buffers for detecting open
> > clocks (using function org-files-list). Is this really intended? I think
> > it should just loop over the org-agenda-files.
> >
> > I was working on an extension for clocking and was recording my testing
> > results
> > into a separate org file. I also had put there examples of
> > various clock lines to test regexps against. The example clock lines
> > effectively prevented me from clocking in to a task from my normal
> > agenda files.
> >
> > Since org has so many usages, I think it should not be assumed that each
> > org buffer is related to the agenda functionality.
>
> Clocking is not just an agenda functionality. Since every Org document
> can contain clocks, it makes sense to use `org-files-list' instead of
> `org-agenda-files'.
>
> You could test your extension in a dedicated Emacs process, with
> `org-agenda-files' being nil and Org documents opened piece-wise.
>
>
> Regards,
>
> --
> Nicolas Goaziou
>


[O] Bug: org-resolve-clocks should not iterate over non-agenda org files [8.3.3 (8.3.3-elpaplus @ /home/dfeich/.emacs.d/elpa/org-plus-contrib-20160108/)

2016-01-19 Thread Derek Feichtinger
Hi

org-resolve-clock loops over all open org buffers for detecting open
clocks (using function org-files-list). Is this really intended? I think
it should just loop over the org-agenda-files.

I was working on an extension for clocking and was recording my testing
results
into a separate org file. I also had put there examples of
various clock lines to test regexps against. The example clock lines
effectively prevented me from clocking in to a task from my normal
agenda files.

Since org has so many usages, I think it should not be assumed that each
org buffer is related to the agenda functionality.

Best regards,
Derek


[O] footnote fontify causing massive slowdown

2015-12-07 Thread Derek Feichtinger

While diagnosing a server condition, I was listing parts of a system log
via a babel expression. The 130 lines in the babel output are wrapped in
an example block. This block caused massive slowdown of scrolling and
other operations.

Using the emacs profiler I see:

- redisplay_internal (C function) 8232  88%
 - jit-lock-function 8226  88%
  - jit-lock-fontify-now 8226  88%
   - funcall 8226  88%
- #  8226  88%
 - run-hook-with-args 8226  88%
  - font-lock-fontify-region 8226  88%
   - font-lock-default-fontify-region 8226  88%
- font-lock-fontify-keywords-region 8226  88%
 - org-activate-footnote-links 8158  87%
  - org-footnote-next-reference-or-definition 8158  87%
   - byte-code 8158  87%
- org-footnote-at-reference-p 4114  44%
 - org-footnote-in-valid-context-p 4106  44%
  + org-inside-LaTeX-fragment-p 2380  25%
  + org-in-block-p 1563  16%
  + org-in-verbatim-emphasis 159   1%
org-at-comment-p 4   0%

Checking for footnote pattern matches (org-footnote-re) in the wrapped 
block, I see that

every line matches based on the very simple and trivial pattern of
number enclosed in angular brackets, so all the process numbers
following the "sshd" in these lines like "sshd[1234]" do match and cause 
load.


#
/var/log/secure-20151129:Nov 23 02:25:36 some-host sshd[20089]: 
Rhosts authentication refused for userXYZ: bad ownership or modes for 
home directory.
/var/log/secure-20151129:Nov 23 02:25:36 some-host sshd[20089]: 
Rhosts authentication refused for userXYZ: bad ownership or modes for 
home directory.
/var/log/secure-20151129:Nov 23 02:25:41 some-host sshd[20089]: 
pam_ldap: error trying to bind as user "x" (Invalid credentials)

#

Since this kind of pattern is so common in logs and 130 lines are really 
not a large number, it makes it hard to use

org for this purpose. Can this be turned off selectively, or can it be
prevented in example blocks?

Using [8.3.2 (8.3.2-37-gd45217-elpaplus @ 
/home/dfeich/.emacs.d/elpa/org-plus-contrib-20151116/)] with GNU Emacs 
24.5.1.


Best regards,
Derek




--
Paul Scherrer Institut
Dr. Derek Feichtinger   Phone:   +41 56 310 47 33
Section Head Scientific Computing   Email: derek.feichtin...@psi.ch
Building/Room No. WHGA/U126
CH-5232 Villigen PSI




[O] footnote fontify causing massive slowdown

2015-12-03 Thread Derek Feichtinger
While diagnosing a server condition, I was listing parts of a system log
via a babel expression. The 130 lines in the babel output are wrapped in
an example block. This block caused massive slowdown of scrolling and
other operations.

Using the emacs profiler I see:

- redisplay_internal (C function) 8232  88%
 - jit-lock-function 8226  88%
  - jit-lock-fontify-now 8226  88%
   - funcall 8226  88%
- #  8226  88%
 - run-hook-with-args 8226  88%
  - font-lock-fontify-region 8226  88%
   - font-lock-default-fontify-region 8226  88%
- font-lock-fontify-keywords-region 8226  88%
 - org-activate-footnote-links 8158  87%
  - org-footnote-next-reference-or-definition 8158  87%
   - byte-code 8158  87%
- org-footnote-at-reference-p 4114  44%
 - org-footnote-in-valid-context-p 4106  44%
  + org-inside-LaTeX-fragment-p 2380  25%
  + org-in-block-p 1563  16%
  + org-in-verbatim-emphasis 159   1%
org-at-comment-p 4   0%

Checking for footnote pattern matches (org-footnote-re) in the wrapped
block, I see that
every line matches based on the very simple and trivial pattern of
number enclosed in angular brackets, so all the process numbers
following the "sshd" in these lines like "sshd[1234]" do match and cause load.

#
/var/log/secure-20151129:Nov 23 02:25:36 some-host sshd[20089]: Rhosts
authentication refused for userXYZ: bad ownership or modes for home directory.
/var/log/secure-20151129:Nov 23 02:25:36 some-host sshd[20089]: Rhosts
authentication refused for userXYZ: bad ownership or modes for home directory.
/var/log/secure-20151129:Nov 23 02:25:41 some-host sshd[20089]:
pam_ldap: error trying to bind as user "x" (Invalid credentials)
#

Since this kind of pattern is so common in logs and 130 lines are really not
a large number, it makes it hard to use
org for this purpose. Can this be turned off selectively, or can it be
prevented in example blocks?

Using [8.3.2 (8.3.2-37-gd45217-elpaplus @
/home/dfeich/.emacs.d/elpa/org-plus-contrib-20151116/)] with GNU Emacs 24.5.1.

Best regards,
Derek





[O] Bug: exporter bug [8.3.1 (8.3.1-elpaplus @ /home/dfeich/.emacs.d/elpa/org-plus-contrib-20150805/)]

2015-08-06 Thread Derek Feichtinger
Hi

The current MELPA version (see version details below) seems to have
problems with
the exporter. I reinstalled several times from older configurations to
try and exlude local effects. I get the error with all exporters I tried

The file I am exporting is
https://github.com/dfeich/org-babel-examples/blob/master/latex/latex-example.org

Best regards
Derek

Backtrace (long lines cut for this mail):


Debugger entered--Lisp error: (wrong-type-argument listp #(Derek
Feichtinger 0 17 (:parent (#1
  org-element-set-contents(#(Derek Feichtinger 0 17 (:parent (#0 ...
  ...
  org-element-map((#(Derek Feichtinger 0 17 (:parent #0))) plain-text ...
  org-export--get-inbuffer-options([cl-struct-org-export-backend latex nil
...
  org-export-get-environment([cl-struct-org-export-backend latex nil ...
  org-export-as(latex nil nil nil (:output-file ./latex-example.tex))
  org-export-to-file(latex ./latex-example.tex nil nil nil nil nil
#[(file) ...
  org-latex-export-to-pdf(nil nil nil nil)
  (org-open-file (org-latex-export-to-pdf nil s v b))
  (if a (org-latex-export-to-pdf t s v b) (org-open-file
(org-latex-export-to-pdf nil s v b)))
  (lambda (a s v b) (if a (org-latex-export-to-pdf t s v b) (org-open-file
(org-latex-export-to-pdf nil s v b(nil nil nil nil)
  org-export-dispatch(nil)
  call-interactively(org-export-dispatch nil nil)
  command-execute(org-export-dispatch)
#


Configuration
#

Emacs  : GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
 of 2015-05-04 on dflt1w
Package: Org-mode version 8.3.1 (8.3.1-elpaplus @
/home/dfeich/.emacs.d/elpa/org-plus-contrib-20150805/)

current state:
==
(setq
 org-src-lang-modes '((ipython . python) (ocaml . tuareg) (elisp .
emacs-lisp)
 (ditaa . artist) (asymptote . asy) (dot . fundamental)
 (sqlite . sql) (calc . fundamental) (C . c) (cpp . c++)
 (C++ . c++) (screen . shell-script) (shell . sh) (bash . sh))
 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-time-clocksum-format '(:hours %d :require-hours t :minutes :%02d
:require-minutes t)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-html-format-drawer-function '(lambda (name contents) contents)
 org-log-done 'time
 org-latex-format-inlinetask-function
'org-latex-format-inlinetask-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-latex-pdf-process '(pdflatex -shell-escape -interaction nonstopmode
-output-directory %o %f pdflatex -shell-escape -interaction nonstopmode
-output-directory %o %f pdflatex -shell-escape -interaction nonstopmode
-output-directory %o %f)
 org-file-apps '((\\.pdf.gz\\' . evince %s) (\\.pdf\\' . evince %s)
(auto-mode . emacs)
(\\.mm\\' . default) (\\.x?html?\\' . default))
 org-agenda-custom-commands '((n Agenda and all TODO's ((agenda )
(alltodo)))
 (s Agenda and waiting tasks
  ((agenda  ((org-agenda-span 1) (org-agenda-show-log t)))
(todo WAIT) (todo WAITFM)
(todo TODO
((org-agenda-skip-function
  (quote
   (org-agenda-skip-entry-if (quote scheduled) (quote deadline))
   )
  )
 (org-agenda-overriding-header
  unscheduled TODOs without a deadline:)
 )
)
)
  )
 (h . my custom searches) (hd todo DONE)
 (ha todo-tree DONE) (hw waiting tasks todo WAIT)
 (hc tags CLOSED=\-4w\) (hm tags-todo +mbo)
 (hu unscheduled and no deadline todo TODO
  ((org-agenda-skip-function
(quote
 (org-agenda-skip-entry-if (quote scheduled) (quote deadline)))
)
(org-agenda-overriding-header
unscheduled TODOs without a deadline:)
)
  )
 )
 org-latex-format-headline-function
'org-latex-format-headline-default-function
 org-capture-templates '((t Todo entry
 (file+headline (concat org-directory tasks.org) Captured Tasks)
 (concat * TODO %?\n   :LOGBOOK:
- State \TODO\   from \\   %U\n  %i\n   :END:\n
%a)
 (n Notes + Link entry (file (concat org-directory notes.org))
  * %?\nEntered on %U\n  %i\n  %a)
 )
(j Journal + Link entry
 (file+datetree (concat org-directory journal.org))
 * %?\nEntered on %U\n  %i\n  %a)
)
 org-agenda-include-diary t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function '(lambda (name contents) contents)
 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-latex-to-mathml-jar-file ~/.emacs.d/javalib/mathtoweb.jar
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(my-org-hook-additions my-org-file-apps-additions
org-clock-load
#[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

Re: [O] Bug: exporter bug [8.3.1 (8.3.1-elpaplus @ /home/dfeich/.emacs.d/elpa/org-plus-contrib-20150805/)]

2015-08-06 Thread Derek Feichtinger
Hi Nicolas

I must apologize to you. Following your mail, I now did a completely clean
rebuild from a naked emacs -Q, and it works fine. I should have made that
my default way of installing org for a long time, but the simple
recompiling often worked fine - not this time... sorry, again.

Thank you very much for your prompt reaction
Derek

On Thu, Aug 6, 2015 at 9:27 AM, Nicolas Goaziou m...@nicolasgoaziou.fr
wrote:

 Hello,

 Derek Feichtinger dfe...@gmail.com writes:

  The current MELPA version (see version details below) seems to have
  problems with
  the exporter. I reinstalled several times from older configurations to
  try and exlude local effects. I get the error with all exporters I tried
 
  The file I am exporting is
 
 https://github.com/dfeich/org-babel-examples/blob/master/latex/latex-example.org

 I cannot reproduce it. Could you send the full backtrace?

 Regards,

 --
 Nicolas Goaziou



[O] Bug: fix for latex export of doi links [8.2.10 (8.2.10-35-g19a7d6-elpaplus @ .../elpa/org-plus-contrib-20150330/)]

2015-04-03 Thread Derek Feichtinger
Hi

The current org latex export will export a link doi:10.xyz/abcd without
the protocol prefix as 10.xyz/abcd. Correctly, it should retain the
prefix.

An easy fix is adding doi to the list of protocols that retain
the link type string in ox-latex.el, below.

### ox-latex.el ###
(defun org-latex-link (link desc info)
  Transcode a LINK object from Org to LaTeX.

DESC is the description part of the link, or the empty string.
INFO is a plist holding contextual information.  See
`org-export-data'.
  (let* ((type (org-element-property :type link))
 (raw-path (replace-regexp-in-string
% \\% (org-element-property :path link) nil t))
 ;; Ensure DESC really exists, or set it to nil.
 (desc (and (not (string= desc )) desc))
 (imagep (org-export-inline-image-p
  link org-latex-inline-image-rules))
 (path (cond
;; - NEXT LINE CONTAINS THE FIX ---
((member type '(http https ftp mailto doi))
 (concat type : raw-path))
((and (string= type file) (file-name-absolute-p raw-path))
 (concat file: raw-path))
(t raw-path)))
 protocol)
#

Best regards,
Derek


Re: [O] Bug: fix for latex export of doi links [8.2.10 (8.2.10-35-g19a7d6-elpaplus @ .../elpa/org-plus-contrib-20150330/)]

2015-04-03 Thread Derek Feichtinger
Patch for the latex export of doi links is attached to this mail.

Cheers,
Derek

On Fri, Apr 3, 2015 at 9:19 PM, Nicolas Goaziou m...@nicolasgoaziou.fr
wrote:

 Hello,

 Derek Feichtinger dfe...@gmail.com writes:

  The current org latex export will export a link doi:10.xyz/abcd without
  the protocol prefix as 10.xyz/abcd. Correctly, it should retain the
  prefix.
 
  An easy fix is adding doi to the list of protocols that retain
  the link type string in ox-latex.el, below.
 
  ### ox-latex.el ###
  (defun org-latex-link (link desc info)
Transcode a LINK object from Org to LaTeX.
 
  DESC is the description part of the link, or the empty string.
  INFO is a plist holding contextual information.  See
  `org-export-data'.
(let* ((type (org-element-property :type link))
   (raw-path (replace-regexp-in-string
  % \\% (org-element-property :path link) nil t))
   ;; Ensure DESC really exists, or set it to nil.
   (desc (and (not (string= desc )) desc))
   (imagep (org-export-inline-image-p
link org-latex-inline-image-rules))
   (path (cond
  ;; - NEXT LINE CONTAINS THE FIX ---
  ((member type '(http https ftp mailto doi))
   (concat type : raw-path))
  ((and (string= type file) (file-name-absolute-p raw-path))
   (concat file: raw-path))
  (t raw-path)))
   protocol)
  #

 Indeed. Thank you.

 Would you mind preparing a patch with git format-patch for correct
 attribution? See http://orgmode.org/worg/org-contribute.html for
 details.

 Regards,

 --
 Nicolas Goaziou

From b1e74964890f1b602d7c144cec8b83518a21ddd7 Mon Sep 17 00:00:00 2001
From: Derek Feichtinger derek.feichtin...@psi.ch
Date: Fri, 3 Apr 2015 22:11:15 +0200
Subject: [PATCH] fix for latex export of doi type links

* lisp/ox-latex.el: Add doi to the list of link types that retain
the protocol prefix in the exported link.

TINYCHANGE
---
 lisp/ox-latex.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index cfd1fdf..57962c1 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2032,7 +2032,7 @@ INFO is a plist holding contextual information.  See
 	 (imagep (org-export-inline-image-p
 		  link (plist-get info :latex-inline-image-rules)))
 	 (path (cond
-		((member type '(http https ftp mailto))
+		((member type '(http https ftp mailto doi))
 		 (concat type : raw-path))
 		((and (string= type file) (file-name-absolute-p raw-path))
 		 (concat file: raw-path))
-- 
1.9.2



Re: [O] Bug: fix for latex export of doi links [8.2.10 (8.2.10-35-g19a7d6-elpaplus @ .../elpa/org-plus-contrib-20150330/)]

2015-04-03 Thread Derek Feichtinger
Hi, Nicolas

thanks for responding so fast. Sure, I'll try and submit the patch.
Thanks for all your great work!

Happy Easter,
Derek

On Fri, Apr 3, 2015 at 9:19 PM, Nicolas Goaziou m...@nicolasgoaziou.fr
wrote:

 Hello,

 Derek Feichtinger dfe...@gmail.com writes:

  The current org latex export will export a link doi:10.xyz/abcd without
  the protocol prefix as 10.xyz/abcd. Correctly, it should retain the
  prefix.
 
  An easy fix is adding doi to the list of protocols that retain
  the link type string in ox-latex.el, below.
 
  ### ox-latex.el ###
  (defun org-latex-link (link desc info)
Transcode a LINK object from Org to LaTeX.
 
  DESC is the description part of the link, or the empty string.
  INFO is a plist holding contextual information.  See
  `org-export-data'.
(let* ((type (org-element-property :type link))
   (raw-path (replace-regexp-in-string
  % \\% (org-element-property :path link) nil t))
   ;; Ensure DESC really exists, or set it to nil.
   (desc (and (not (string= desc )) desc))
   (imagep (org-export-inline-image-p
link org-latex-inline-image-rules))
   (path (cond
  ;; - NEXT LINE CONTAINS THE FIX ---
  ((member type '(http https ftp mailto doi))
   (concat type : raw-path))
  ((and (string= type file) (file-name-absolute-p raw-path))
   (concat file: raw-path))
  (t raw-path)))
   protocol)
  #

 Indeed. Thank you.

 Would you mind preparing a patch with git format-patch for correct
 attribution? See http://orgmode.org/worg/org-contribute.html for
 details.

 Regards,

 --
 Nicolas Goaziou



Re: [O] Bug: clock table total time parsed incorrectly [8.2.7c (8.2.7c-elpa at /home/loic/.emacs.d/elpa/org-20140730/)]

2014-08-13 Thread Derek
Hi Loic



Loic Dachary loic at dachary.org writes:

 
 Hi,
 
 In the following clock table:
 
 #+BEGIN: clocktable :maxlevel 3 :emphasize nil :scope file
 :block 2014-08 :formula % :narrow 100
 #+CAPTION: Clock summary at [2014-08-11 lun. 10:17], for août 2014.
 | 100  
 ||  |   |   |
 | Headline   
 |   Time |  |   | % |

|--
++--+---+---|
 | *Total time*   
 | *1d 16:04* |  |   | 100.0 |

|
--++--+---+---|
 | STARTED Read mail  
 |   8:23 |  |   |  52.2 |
 | STARTED GSoC   
 |   0:49 |  |   |   5.1 |
 ...
 #+TBLFM: $5='(org-clock-time%  at 3$2 $2..$4);%.1f
 #+END: clocktable
 
 The total time is apparently parsed as 16:04 instead of 1d 16:04 which
leads to the incorrect conclusion
 that 8:23 is 52.2% of the time.
 
 Emacs  : GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7)
  of 2014-03-07 on lamiak, modified by Debian
 Package: Org-mode version 8.2.7c (8.2.7c-elpa  at 
/home/loic/.emacs.d/elpa/org-20140730/)
 

This is a workaround for your problem (that I also faced) in order to
have the clocktables sum correctly. One just sets the time format to
hours and minutes. A real bugfix naturally would be much nicer.

---
;; format string used when creating CLOCKSUM lines and when generating a
;; time duration (avoid showing days. some clocktable functions cannot
;; digest
;; day formats, e.g. org-clock-time%)
(setq org-time-clocksum-format
  '(:hours %d :require-hours t :minutes :%02d :require-minutes t))


Cheers,
Derek






Re: [O] using Agenda org-agenda-files variable

2014-01-10 Thread Derek
Hi

Renato Pontefice renato.pontefice at gmail.com writes:

 Hi,
 following this tutorial
http://orgmode.org/worg/org-tutorials/orgtutorial_dto.html;
 at this point:A taste of advanced featuresit's written to add this text,
on my init.el file (I'm working on win).(setq org-agenda-files (list
~/org/work.org
  ~/org/school.org 
  ~/org/home.org))I've done it.
 Continuing the tutorial, I find some operation to do in my org file Press
C-c a t to enter the global todo list
 I do that, but I receive in the *Org Agenda* buffer, the following
text:_Global list of TODO items of type:
ALLAvailable with `N r': (0)[ALL]__
 and nothing else.
 I have on my 1.org the following line:*** configure   SCHEDULED:
2014-01-08 mer
 So, I'm expecting, that i could find at least this TODO line on the
Agenda. But nothing...
 What I've done wrong?

Your todo item line must start with a TODO keyword, by default TODO (you
can configure more states in org), so that it looks like this

*** TODO configure 

Then it will be found in that search.

Read
http://orgmode.org/org.html#TODO-Items

Cheers
Derek

 
 Do someone can link me some page example? Or something similar where I can
get help?
 TIA
 Renato
 ps
 I don' t find the file work, school and home .org, on the folder where my
org file (1.org) are stored  )







[O] Bug: property drawer created within other drawers

2014-01-06 Thread Derek Feichtinger
Dear developers

Property drawers for certain items end up getting created within an
already existing LOGBOOK drawer.

The problem is that the first while loop in org-insert-property-drawer
is also matching CLOCK lines within the drawer, so it reads into the
drawer instead of stopping before it. I discovered a matching report
that was already submitted by Sebastien Vauban
(http://article.gmane.org/gmane.emacs.orgmode/78881).

Problematic code in org.el:
(defun org-insert-property-drawer ()
;...
  (let ((indent (if org-adapt-indentation
(- (match-end 0) (match-beginning 0))
  0))
(beg (point))
(re (concat ^[ \t]* org-keyword-time-regexp))
end hiddenp)
(outline-next-heading)
(setq end (point))
(goto-char beg)
(while (re-search-forward re end t))   ; === problem

I did a quick fix using the following construct:

  (let ((indent (if org-adapt-indentation
(- (match-end 0) (match-beginning 0))
  0))
(beg (point))
(re (concat ^[ \t]* org-keyword-time-regexp))
end hiddenp)
(outline-next-heading)
(setq end (point))
(goto-char beg)
(next-line)
(while (looking-at re) (next-line))
(setq hiddenp (outline-invisible-p))
; comment-out: (end-of-line 1)
; comment-out: (and (equal (char-after) ?\n) (forward-char 1))

Here's a typical task, where the original code will fail and place the
property drawer just before the end of the LOGBOOK drawer.

*** DONE some task
CLOSED: [2013-07-10 Wed 14:11] DEADLINE: 2013-06-03 Mon SCHEDULED:
2013-07-08 Mon
:LOGBOOK:
- State DONE   from WAIT   [2013-07-10 Wed 14:11]
CLOCK: [2013-05-17 Fri 17:07]--[2013-05-17 Fri 17:16] =  0:09
CLOCK: [2013-05-08 Wed 14:30]--[2013-05-08 Wed 15:30] =  1:00
CLOCK: [2013-05-06 Mon 14:55]--[2013-05-06 Mon 15:30] =  0:35
- State WAIT   from TODO   [2013-04-03 Wed 14:31] \\
  sent mail
- State TODO   from DONE   [2013-03-20 Wed 11:25]
- State DONE   from TODO   [2012-11-22 Thu 15:05]
CLOCK: [2012-11-22 Thu 14:40]--[2012-11-22 Thu 15:04] =  0:24
- State TODO   from[2012-11-20 Tue 16:14]
:END:
- bla
- some more bla


Emacs  : GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2014-01-03 on akhlut, modified by Debian
Package: Org-mode version 8.2.4 (8.2.4-18-g4ee7e6-elpaplus @
/home/dfeich/.emacs.d/elpa/org-plus-contrib-20131230/)

Best regards,
Derek


[O] Bug: odt table exporter bug with rel-width [8.2.1 (8.2.1-30-g757f00-elpaplus @ /home/dfeich/.emacs.d/elpa/org-plus-contrib-20131104/)]

2013-11-05 Thread Derek Feichtinger
Dear developers

When exporting a document containing a table and using the :rel-width
modifier (as documented in [info:org#Tables in ODT export]), an error is
returned:

 #+ATTR_ODT: :rel-width 50
 | Area/Month|   Jan |   Feb |   Mar |   Sum |
 |---+---+---+---+---|
 | / |  |   |   |  |
 | l13 |  r5 |  r5 |  r5 |  r6 |
 | North America | 1 |21 |   926 |   948 |
 | Middle East   | 6 |75 |   844 |   925 |
 | Asia Pacific  | 9 |27 |   790 |   826 |
 |---+---+---+---+---|
 | Sum   |16 |   123 |  2560 |  2699 |

OpenDocument export failed: Format specifier doesn't match argument type

Reason is that the plist-get in line 1458 of ox-odt.el returns a string
reprensentation 50 of the :rel-width number, but the
org-odt-table-style-format
variable contains a %d conversion string for this parameter.

  (loop for (style-name props) in
(plist-get org-odt-automatic-styles 'Table) do
(when (setq props (or (plist-get props :rel-width) 96))
  (insert (format org-odt-table-style-format style-name props

Either the conversion string should be changed to a %s or the plist-get
obtained value should get converted to a string.

Emacs  : GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2013-10-03 on hamsa, modified by Debian
Package: Org-mode version 8.2.1 (8.2.1-30-g757f00-elpaplus @
/home/dfeich/.emacs.d/elpa/org-plus-contrib-20131104/)

Best regards
Derek


[O] Change latex export to use cref

2013-06-25 Thread Derek Thomas
Is there a variable that can be set so that latex export uses \cref instead
of \ref?  Thanks,

Derek


Re: [O] org-agenda-show-log, org-timeline bugs

2013-02-16 Thread Derek Upham

Bastien writes:
 Sorry, no special effort is made to fix bugs in org-timeline because
 its future is uncertain: there is significant overlap between this
 feature from the early days of Org, and the general agenda views
 mechanism.

 We'll make a decision about org-timeline before releasing Org 8.0: 
 if it stays, let's fix it.  If it goes, let's forget it!

I found these bugs when I was using org-timeline to get an overview of
work done during the past several months.  The rest of the agenda code
is forward-facing, so looking at historical data is one area where there
is no overlap.  Whether or not it needs to be part of the agenda
framework is another matter.

Derek

-- 
Derek Upham
s...@blarg.net



Re: [O] org-agenda-show-log, org-timeline bugs

2013-02-07 Thread Derek Upham
Can someone please verify these bugs?  Thanks.

Derek

Derek Upham writes:

 I tried running org-timeline on an Org file with lots of timestamped
 TODO - DONE state changes, and didn't see the matches I was expecting.
 While poking around, I found two problems.

 1. `org-timeline' isn't setting the text properties necessary to refresh
 the timeline buffer.  This means that none of the special keys to update
 the display actually work.  Here's the `org-timeline' version:

 (add-text-properties (point-min) (point-max) '(org-agenda-type timeline))

 Here's the same chunk in `org-agenda-list' for comparison:

 (add-text-properties (point-min) (point-max)
  `(org-agenda-type agenda
org-last-args (,arg ,start-day ,span)
org-redo-cmd ,org-agenda-redo-command
org-series-cmd ,org-cmd))

 2. Even when the `org-timeline' function has refresh set up properly,
 `org-agenda-log-mode' (via the `l' hotkey) doesn't work.  It looks like
 the function changes the buffer-local copy of the `org-agenda-show-log'
 variable, but the refresh code looks at the global version of the
 variable (possibly because the refresh is happening through eval?).  In
 order to see the log entries, you need to set `org-agenda-show-log'
 outside of the timeline buffer (using `setq').

 Can someone take a look at these?  This is all with the latest sources
 from the repo.  Thanks.

 Derek



[O] org-agenda-show-log, org-timeline bugs

2013-02-04 Thread Derek Upham
I tried running org-timeline on an Org file with lots of timestamped
TODO - DONE state changes, and didn't see the matches I was expecting.
While poking around, I found two problems.

1. `org-timeline' isn't setting the text properties necessary to refresh
the timeline buffer.  This means that none of the special keys to update
the display actually work.  Here's the `org-timeline' version:

(add-text-properties (point-min) (point-max) '(org-agenda-type timeline))

Here's the same chunk in `org-agenda-list' for comparison:

(add-text-properties (point-min) (point-max)
 `(org-agenda-type agenda
   org-last-args (,arg ,start-day ,span)
   org-redo-cmd ,org-agenda-redo-command
   org-series-cmd ,org-cmd))

2. Even when the `org-timeline' function has refresh set up properly,
`org-agenda-log-mode' (via the `l' hotkey) doesn't work.  It looks like
the function changes the buffer-local copy of the `org-agenda-show-log'
variable, but the refresh code looks at the global version of the
variable (possibly because the refresh is happening through eval?).  In
order to see the log entries, you need to set `org-agenda-show-log'
outside of the timeline buffer (using `setq').

Can someone take a look at these?  This is all with the latest sources
from the repo.  Thanks.

Derek

-- 
Derek Upham
s...@blarg.net



[O] Inserting new images

2012-01-03 Thread Derek Thomas
I'm looking for a good way to insert sketches into org files.  I'm
preparing notes that consist of text and diagrams.  As I'm outlining,
I was thinking that it would be great if I could bind a key command to
insert a link to an svg file and then launch inkscape or something
similar to edit the file.  If anyone has done anything similar or has
any ideas, I would be interested to hear them.  By the way, I looked
at inkmacs and had some issues with dbus-proxy, so I'm completely open
to quick and dirty solutions.  Thanks!

Derek



[O] Face color for LaTeX preview

2011-09-23 Thread Derek Thomas
Since my last pull from git master, the preview images of my LaTeX
fragments have been black.  I've tried customizing
org-format-latex-options, but while the :scale property works,
changing the :foreground property has no effect.  I would like to have
it use my default foreground color.  Any help would be appreciated,

Derek



Re: [O] ODT image export

2011-09-21 Thread Derek Thomas
Jambunathan,

Thanks that looks like it's exactly what I need.  I have been
partially successful in getting the exporter running, but it stalls
out after creating the odt file and opening it in openoffice.  Any
tips for getting ppt or odp export up and running.  One thing I have
noticed is if I have openoffice opent when I initialize an export, I
get an error:

/home/dthomas/Dropbox/Presentations/Indy2011/macro:///BasicODConverter.Main.Convert(file:///home/dthomas/Dropbox/Presentations/Indy2011/indy.odt,odp,file:///home/dthomas/Dropbox/Presentations/Indy2011/indy.odp)
does not exist.

Any suggestions?  Thanks for your help, the ODT exporter is awesome!

Derek



Re: [O] ODT image export

2011-09-21 Thread Derek Thomas
 It is important that

 M-: (executable-find soffice)

 should report some valid path.

This returns a valid result.  Also, executing the printed soffice
command at the command line works.  Internally, emacs prints a failed
message after the command in the *Messages* buffer.

It seems that the exporter strips the images from the ppt/odp export.
They are there when I export the odt from orgmode, but don't appear in
the presentation.

Derek



[O] ODT image export

2011-09-20 Thread Derek Thomas
I got the odt export working and I'm very excited about the
possibility of using it, but when I export a file with an image link,
the image isn't embedded.  Instead there's a link to the file.  Do I
need to take any special steps to embed images in export?

A few other questions, is there any functionality for export to ODP,
that would be great.  If it is possible to export to ODP, would it be
possible to include the latex code for any embedded images in the
comments of the slides?  Finally, in odt export, is it possible to
export tikz diagrams as images and embed those in the file?

Thanks,

Derek



Re: [O] slides precess in html5presentation

2011-09-20 Thread Derek Thomas
On Tue, Sep 20, 2011 at 11:46 AM, Matt Price mopto...@gmail.com wrote:
 and it for the most part works really great, except that the slides
 'precess' ovr time - -that is, the slides slowly slide ot the left,
 until eventually (after about 20 slides) the left side of a slide will
 become invisible.  Has anyone else encountered this, and if so, have
 you found a solution?

I find that this happens when I use firefox (5.0).  It doesn't happen
when I use chrome.

Derek



Re: [O] Convert list to paragraph

2011-08-27 Thread Derek Thomas
 Nick Dokos nicholas.do...@hp.com writes:

 (defun org-list-to-paragraph ()
   Convert the list at point into a paragraph.
   (interactive)
   (insert (org-list-to-generic (org-list-parse-list t) '(:ustart  :splice 
 t :isep   :nobr t 


 (defun org-lists-to-paragraphs ()
   (goto-char (point-min))
   (condition-case nil
       (while (org-list-search-forward + )
       (org-list-to-paragraph))
     (error nil)))

 (add-hook 'org-export-preprocess-hook (function org-lists-to-paragraphs))

This looks like it will do what I want.  Is there any way to restrict
this export option to certain org files?  Thanks,

Derek



[O] Convert list to paragraph

2011-08-26 Thread Derek Thomas
I find it convenient to outline LaTeX documents using org-mode.  I
often find myself with every sentence in a paragraph as an item in an
org list.  This makes it convenient to manipulate the paragraph.  Is
it possible to export a certain list bullet style (+,-, etc.) as a
paragraph instead of as a list?  Here's an example of what I would
like to achieve:

+ Here is my first sentence.
+ Another sentence.
+ One more sentence.

would export to:

Here is my first sentence.  Another sentence.  One more sentence.

Thanks,

Derek



Re: [O] Org-babel results preamble

2011-08-25 Thread Derek Thomas
On Thu, Aug 25, 2011 at 9:50 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote:
 I am slowly going through all the org emails that I have received in the
 three weeks I was off.  This was one of them and appears to not have
 been answered?

 In any case, possibly naming the src block may achieve what you want
 because then the results are placed in the same place every time
 regardless of where the results block is...  not tested, especially in
 the context of plotting mind you.

Thanks for the response, naming the src block has been working great so far.

Derek



[O] Org-babel results preamble

2011-07-30 Thread Derek Thomas
I have found that using org-plot to plot the results output of an
org-babel code block is very useful in prototyping my code.  One minor
annoyance is the need to remove and replace the #+PLOT: header at the
beginning of the results output.  Is it possible to specify a
preamble in the source block?  I am looking to produce something
like this:

#+begin_src sh :results wrap
./dtest
#+end_src
#+PLOT: ind:1 deps:(2)
#+results:
#+BEGIN_RESULT
| 0.000E+000 | 1.0 |
| 9.99776482582E-003 |   0.99000223517 |
| 1.99955296516E-002 |   0.98000447035 |
| 2.99932944775E-002 |   0.97000670552 |
| 3.99910593033E-002 |0.9600089407 |
| 4.99888241291E-002 |   0.95001117587 |
#+END_RESULT
Thanks,

Derek



[O] Maxima session support

2011-07-06 Thread Derek Thomas
I've been poking around in the ob-maxima.el and maxima.el files and I
believe that maxima.el provides the commands necessary to simulate
session support in org-babel.  Unfortunately my elisp skills are
rudimentary and I don't know how to write a function that when called
by C-c C-c in the source block will pass each line of the source block
to the function maxima-send-region and insert the output into the
results portion of the org file using maxima-insert-last-output (both
of these functions are provided by maxima.el).  If anyone can point me
in the right direction for a similar function that I can modify, or
can provide a commented example of how this would be done, that would
be great.  Thanks,

Derek



[O] Daisy chain file/heading links

2011-05-10 Thread Derek Thomas
Hi, is there a way to daisy chain the searches in links?  I'm linking
several files that are organized in a heading, subheading, paragraph
format (paragraphs are numbered) and I'd like to specify a link like
this [[file:example.org::*Heading::*Subheading::P. 1][test link]].
The problem is that the subheadings and paragraph numbers are not
unique.  I also don't really want to set CUSTOM_ID properties for
every paragraph.  Thanks.

Derek



[O] Maxima persistence between code blocks

2011-04-27 Thread Derek Thomas
I'm interested in using org-mode with babel to organize my maxima
code.  Am I correct in my reading of ob-maxima.el that the babel
module for maxima doesn't support persistent variables between code
blocks?  If so, this seems like a severe limitation.  I did some
searching and found this guide
(http://www.math.utexas.edu/pipermail/maxima/2010/021027.html) for
setting up a local maxima server.  I'm trying to implement an org
interface to this process, but my elisp skills are extremely
rudimentary.  If anyone has any suggestions or recommendations for
code that does something similar, that would be great.  Thanks,

Derek



Re: [Orgmode] Uncover bullet points with BEAMER_env: ignoreheading

2011-02-26 Thread Derek Thomas
It seems that with the options you suggested, the [+-] argument is
passed to the \columns environment instead of the \itemize environment
within the column.  Beamer doesn't accept this argument for the
columns environment.  Is there a way to pass the argument to \itemize?
Thanks,

Derek

On Fri, Feb 25, 2011 at 4:17 PM, Eric S Fraga e.fr...@ucl.ac.uk wrote:
 Derek Thomas derekctho...@gmail.com writes:

 I've been using BEAMER_env: ignoreheading to generate columns of
 bulleted lists as follows
 #+begin_src org
 * hidden heading 1                                  :BMCOL:B_ignoreheading:
   :PROPERTIES:
   :BEAMER_col: 0.5
   :BEAMER_env: ignoreheading
   :BEAMER_envargs: [+-]
   :END:
 ** Item 1
 ** Item 2
 * hidden heading 2                                  :BMCOL:B_ignoreheading:
   :PROPERTIES:
   :BEAMER_col: 0.5
   :BEAMER_env: ignoreheading
   :BEAMER_envargs: [+-]
   :END:
 ** Item 3
 ** Item 4
 #+begin_src org

 But the [+-] is not included in the LaTeX export so the bullets
 are not revealed sequentially.  Is there a way to include this flag in
 the export?  Thanks,

 To answer your explicit question, you need to specify either c or C
 for a column envargs setting, as in c[+-] or C[+-], the
 difference being that with lower case c, the argument applies to the
 column and with upper case C, it applies to the columns environment.
 You need one of these to get the export to work.

 Having said this, I have no idea how to get beam to do automatic
 column overlays, as you seem to want.  I have always had to use 1-
 etc.  So I would have envargs for the first column set to c1- (note,
 no square brackets) and c2- for the second.

 HTH,
 eric
 --
 : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
 : using Org-mode version 7.4 (release_7.4.532.g7b21.dirty)


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Uncover bullet points with BEAMER_env: ignoreheading

2011-02-24 Thread Derek Thomas
I've been using BEAMER_env: ignoreheading to generate columns of
bulleted lists as follows
#+begin_src org
* hidden heading 1:BMCOL:B_ignoreheading:
  :PROPERTIES:
  :BEAMER_col: 0.5
  :BEAMER_env: ignoreheading
  :BEAMER_envargs: [+-]
  :END:
** Item 1
** Item 2
* hidden heading 2:BMCOL:B_ignoreheading:
  :PROPERTIES:
  :BEAMER_col: 0.5
  :BEAMER_env: ignoreheading
  :BEAMER_envargs: [+-]
  :END:
** Item 3
** Item 4
#+begin_src org

But the [+-] is not included in the LaTeX export so the bullets
are not revealed sequentially.  Is there a way to include this flag in
the export?  Thanks,

Derek Thomas

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: Re: [Orgmode] Beamer export questions/suggestions

2011-02-23 Thread Derek Thomas
Eric and Chris,

Thanks for your responses.

Eric,

I'm currently using latex directly in org, but this method doesn't
play nicely with export to a regular tex file.  Would it be possible
to use something similar to this?

#+begin_src org
** A plain slide
*** [path/to/fig]
  :PROPERTIES:
  :FIGURE_envargs:
  Figure placement options
  :END:
#+end_src

The ability to specify placement in beamer would allow figures to be
placed correctly in beamer slides and also display inline for general
org export.  Thanks for your help,

Derek
On Wed, Feb 23, 2011 at 12:24 PM,  chris.m.mal...@gmail.com wrote:
 Hi Eric,

 Thanks for that useful bit of info!

 Chris
 On Feb 23, 2011 11:47am, Eric S Fraga e.fr...@ucl.ac.uk wrote:
 Chris Malone chris.m.mal...@gmail.com writes:



  Hi Derek,

 

  Re your first question:

 

  One simple, albeit somewhat hackish way of achieving this would be to

  utilize =org-mode='s #+begin_beamer ... #+end_beamer syntax with
  =beamer='s

  frame option =plain=   For example:



 You don't need to do this.  You can pass options to frames using the

 BEAMER_envargs property:



 #+begin_src org

 ** A plain slide

   :PROPERTIES:

   :BEAMER_envargs: [plain]

   :END:

   - a list

   - with few entries

   - but more than I thought

 #+end_src



 I use this all the time for options such as shrink and allowframebreaks.



 --

 : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1

 : using Org-mode version 7.4 (release_7.4.528.gd457)

 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode





On Wed, Feb 23, 2011 at 12:24 PM,  chris.m.mal...@gmail.com wrote:
 Hi Eric,

 Thanks for that useful bit of info!

 Chris
 On Feb 23, 2011 11:47am, Eric S Fraga e.fr...@ucl.ac.uk wrote:
 Chris Malone chris.m.mal...@gmail.com writes:



  Hi Derek,

 

  Re your first question:

 

  One simple, albeit somewhat hackish way of achieving this would be to

  utilize =org-mode='s #+begin_beamer ... #+end_beamer syntax with
  =beamer='s

  frame option =plain=   For example:



 You don't need to do this.  You can pass options to frames using the

 BEAMER_envargs property:



 #+begin_src org

 ** A plain slide

   :PROPERTIES:

   :BEAMER_envargs: [plain]

   :END:

   - a list

   - with few entries

   - but more than I thought

 #+end_src



 I use this all the time for options such as shrink and allowframebreaks.



 --

 : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1

 : using Org-mode version 7.4 (release_7.4.528.gd457)

 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Beamer export questions/suggestions

2011-02-18 Thread Derek Thomas
Before I get to my questions, I would like to commend all those
involved in the development of org-mode.  I'm a new user and I've been
amazed by the features, utility, and the support/documentation
provided.

My first question relates to frames in beamer export.  Is it possible
to set a tag or otherwise indicate that a frame should appear without
a title, or as an empty frame (no header or footer)?  My second
question may be more of a suggestion if the feature is not available.
I currently use the testpos package in latex to position my figures in
beamer.  Is there a native org method to specify figure location in
org-beamer?  If not, it could be a nice feature for those preparing
presentations in org especially if it had the option to specify
quadrant location and relative size in a simple manner.  Thanks again,

Derek

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode