Re: dotime property on non-dated item

2024-07-14 Thread Florian Lindner

Am 14.07.24 um 11:46 schrieb Ihor Radchenko:

Florian Lindner  writes:


* TODO dated item
SCHEDULED: <2024-07-04 Do 14:00>
* TODO undated item

which is in org-agenda-files. Using "org-agenda t" and executing "C-x
C-x =" (what-cursor-position) yields "dotime t" for both entries.

I have found no documentation on the "dotime" property, my understanding
is that the "undated item" should have this property set to nil.

Some background:

org-super-agenda uses this property to determine if items are to appear
on the time grid, when using the time-grid property, see that discussion
https://github.com/alphapapa/org-super-agenda/issues/264

What is the definition of the dotime property?
Is there maybe another property or way to determine if entries should
appear on the time time grid?

DOTIME is an internal property storing arguments to
`org-ageda-format-item'.

Use 'time-of-day instead.


Thanks for advise! However, I was unable to get something else but nil 
for time-of-day for these entries:


* TODO dated and timed item
SCHEDULED: <2024-07-14 So 14:00>
* TODO timed item
<2024-07-14 So>
* TODO undated item

 using the procedure described above.

Best,
Florian




dotime property on non-dated item

2024-07-13 Thread Florian Lindner

Hello,

Given a simple org file:

* TODO dated item
SCHEDULED: <2024-07-04 Do 14:00>
* TODO undated item

which is in org-agenda-files. Using "org-agenda t" and executing "C-x 
C-x =" (what-cursor-position) yields "dotime t" for both entries.


I have found no documentation on the "dotime" property, my understanding 
is that the "undated item" should have this property set to nil.


Some background:

org-super-agenda uses this property to determine if items are to appear 
on the time grid, when using the time-grid property, see that discussion 
https://github.com/alphapapa/org-super-agenda/issues/264


What is the definition of the dotime property?
Is there maybe another property or way to determine if entries should 
appear on the time time grid?


Versions are:

Org mode version 9.7.6 (9.7.6-7a4527 @ 
/home/florian/Cloud.XGM/super-agenda/elpa/org-9.7.6/)
GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42, 
cairo version 1.18.0)


Best Thanks,
Florian




log-done and org-after-todo-state-change-hook

2022-04-27 Thread Florian Lindner

Hello,

I have an org-todo-keywords like "DONE(d!)" which logs a time stamp 
everytime that todo is reached.


I also use org-after-todo-state-change-hook to copy that node somewhere 
else, as soon as it is finished.


My problem now is that the logging seems to happen after hook, which 
made me end up with a original node:


DONE letzter note
:LOGBOOK:
- State "DONE"   from "TODO"   [2022-04-27 Mi 21:42]
:END:
[2022-04-27 Mi]


which is copied to

** DONE letzter note
[2022-04-27 Mi]

How can make the hook to be executed after the logging of done or some 
other way to have the log entry included in the copy?


Thanks!
Florian



invalid-function (date date) after update to 9.5

2021-10-04 Thread Florian Lindner
Hello,

after the upgrade to 9.5 (9.5-g0a86ad @ /home/florian/.emacs.d/elpa/org-9.5/) 
on 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 
1.16.0) of 2020-09-19 my agenda stopped working

(org-agenda) -> any keyword (a, t or n) gives:

Debugger entered--Lisp error: (invalid-function (date date))
(date date)()
org-agenda-get-day-entries("/home/florian/org/capture.org" (10 4 2021) 
:deadline :scheduled :timestamp :sexp)
apply(org-agenda-get-day-entries "/home/florian/org/capture.org" (10 4 2021) 
(:deadline :scheduled :timestamp :sexp))
org-agenda-list(nil)
funcall-interactively(org-agenda-list nil)
call-interactively(org-agenda-list)
#f(compiled-function () #)()
funcall(#f(compiled-function () #))
(let nil (funcall '#f(compiled-function () #)))
eval((let nil (funcall '#f(compiled-function () #
org-agenda-run-series("Agenda and all TODOs" (((agenda "") (alltodo ""
org-agenda(nil)
funcall-interactively(org-agenda nil)
call-interactively(org-agenda nil nil)
command-execute(org-agenda)

When I move capture.org out of the way, it happens to another file. Any hint 
what can be the problem here or where I can start looking?

I have seen the problem mentioned in 
www.reddit.com/r/DoomEmacs/comments/mlc7qi/orgagenda_stopped_working_after_upgrade/
 but that basically says to reinstall. I deleted my elpa folder and 
reinstalled, but nothing changed.

Thanks!



org-timer-start at specified time stamp

2021-07-28 Thread Florian Lindner
Hello,

frequently, when taking notes at a meeting with org-timer active, I happened to 
forget to start the timer at the beginning of the meeting:

* Meeting
Start: <2021-07-30 Fri 15:37>

- 0:00:05 :: started the timer to late
- 0:00:18 :: want to set zero to the time above 15:37
- 0:00:34 :: how do so?

The documentation of org-timer-start says:

> Set the starting time for the relative timer to now.
> When called with prefix argument OFFSET, prompt the user for an offset time,
> with the default taken from a timer stamp at point, if any.
> If OFFSET is a string or an integer, it is directly taken to be the offset
> without user interaction.

This is about a timer stamp, not a timestamp.  Of course, it's possible, but to 
get the offset, I need to compute the amount of time from timer start to 
meeting start.

> When called with a double prefix arg, all timer strings in the active
> region will be shifted by a specific amount.  You will be prompted for
> the amount, with the default to make the first timer string in
> the region 0:00:00.

My proposal is to enhance C-u org-timer-start to also determine if it is 
located at a timestamp and use that as zero time.

Furthermore C-u C-u org-timer-start also can accept a timestamp and shift the 
region as if the timer was started at that time.

All that requires to distinguish between a timestamp and a timestamp. For the 
first part, it is possible, as the timestamp includes a date, for the second 
part it's more hairy, as 15:37 could be a shift by 15m and 37s or the timestamp 
of 15:37 (3:37 pm).

Alternatively, a new function can be introduced that manipulated the the 
running timer accordingly.

What do you think about that proposal? I am happy to work on that myself, but 
probably need some assistance from you!

Best, Florian




Get list of top-level headings

2021-05-19 Thread Florian Lindner

Hello,

I, an Emacs Lisp newbie, want to get a list of all top-level headings of the 
current buffer. My approach so far is:

(defun test-org-map()
  (interactive)
  (setq headings '())
  (org-map-entries (lambda ()
 (setq current-header-item (org-element-property :title 
(org-element-at-point))
 (message "Header: %s" current-header-item)
 (message "Is String: %s" (stringp (org-element-property 
:title (org-element-at-point
 (setq headings (append current-header-item headings))
 )
   "LEVEL=1"
   )
  (dolist (heading headings)
    (message "Header Item: %s" heading)
    )
  )

This gives the otput:

Header: AAA
Is String: t
Header: BBB
Is String: t
Header Item: 66 [3 times]
Header Item: 65 [3 times]

so basically the (org-element-property :title (org-element-at-point) does 
exactly what I want, but building the list does not what I want. I suppose that 
comes from a fundamental misunderstanding of how strings work in elisp.

I would appreciate a short explanation (or pointers) why this does not work. 
And of course, I am very open to completely different, likely better, approches 
to that simply problem!

Thanks,
Florian
 


Re: Set archive location relative to property

2021-02-28 Thread Florian Lindner

Am 26.02.21 um 20:30 schrieb TRS-80:

On 2021-02-25 15:49, Florian Lindner wrote:

Am 25.02.21 um 21:22 schrieb Florian Lindner:

is this possible with org-mode? Given a tree:

* Name
:PROPERTIES:
:ARCHIVE:  ???
:END:
** Archive    :ARCHIVE:
** Some node

Upon archiving "Some node" (or any direct or indirect sub-node of
Projectname) I want to end it up under "** Archive". The archive
location should always be relative to the node where the property
ARCHIVE is set.

The documentation org-archive-location does not suggest that is
possible.


An alternative idea would be a setting for the ARCHIVE property that
searches the tree upward until it finds a node with an :ARCHIVE: tag
and use that as archive location. Maybe indicated by a setting of
"::%a".

What do you think?


I could be wrong, but my feeling (in either case) is something like
that would probably require writing a custom archive function.
Luckily, Orgmode allows you to do that.


Ok, I expected that's the way to go. Unfortunately, I wasn't able to 
find how to set a custom archive function. Could you give me a pointer?





Re: Set archive location relative to property

2021-02-25 Thread Florian Lindner

Am 25.02.21 um 21:22 schrieb Florian Lindner:

is this possible with org-mode? Given a tree:

* Name
:PROPERTIES:
:ARCHIVE:  ???
:END:
** Archive    :ARCHIVE:
** Some node

Upon archiving "Some node" (or any direct or indirect sub-node of 
Projectname) I want to end it up under "** Archive". The archive 
location should always be relative to the node where the property 
ARCHIVE is set.


The documentation org-archive-location does not suggest that is possible.


An alternative idea would be a setting for the ARCHIVE property that 
searches the tree upward until it finds a node with an :ARCHIVE: tag and 
use that as archive location. Maybe indicated by a setting of "::%a".


What do you think?



Set archive location relative to property

2021-02-25 Thread Florian Lindner

Hello,

is this possible with org-mode? Given a tree:

* Name
:PROPERTIES:
:ARCHIVE:  ???
:END:
** Archive:ARCHIVE:
** Some node

Upon archiving "Some node" (or any direct or indirect sub-node of 
Projectname) I want to end it up under "** Archive". The archive 
location should always be relative to the node where the property 
ARCHIVE is set.


The documentation org-archive-location does not suggest that is possible.

Is that possible?

Thanks,
Florian



error "Can’t expand minibuffer to full frame"

2021-02-22 Thread Florian Lindner

Hello,
I try to configure my org mode (Org mode version  ( @ 
/lhome/lindnfl/.emacs.d/elpa/org-9.4.4/)) to ask for a note and also for a 
specific property when moving a state to WAIT. For that I use

(setq
  org-todo-keywords '((sequence "NEXT" "TODO" "WAIT(w@)" "|" "DONE(d!)" 
"NODO(n@)"))
  org-log-into-drawer t
)

(defun flo/org-state-change()
  (when (string= org-state "WAIT")
    (org-set-property "DELEGATED_TO" (read-string "Delegate To: "

(setq org-after-todo-state-change-hook 'flo/org-state-change)


However, I suspect the state-change-hook and the note when leaving WAIT state 
conflict:

Error in post-command-hook (org-add-log-note): (error "Can’t expand minibuffer 
to full frame")

resulting in that I am only asked to set the property, note the note.

What can i do about it? I don't really care in which order I enter the two note 
/ property.

Thanks,
Florian
 


Templating of PDF export

2020-02-02 Thread Florian Lindner
Hello,

I am collecting my cooking recipes in an org-mode file. While that
certainly works for, I would like to have a nice LaTeX export for
non-nerd mortals to look at. All recipes are in one file and each one
looks like:

* Pancakes
** Ingredients
+ 6 Eggs
+ 3 Apples
** Directions
Just do it!
** Source
My mother

Sometimes I take a photo of the meal and ATTACH it.

Most guides how to customize org export are about modifying the document
class and latex snippets there there. However, the basic association
with * Pancakes -> \section, ** Ingredients -> \subsection stays the same.

Is there something builtin org-mode which allows to use a templating
language that allows for a more freely combination of elements, similar
to Jinja or alike?

For example, I want to embed the attachment in the export, appropriately
scaled and nicely placed and have a line break after each recipe.

I know about org-chef, but AFAIK it's more about importing templates
from websites, not about a nice export.

Any ideas for that?

Thanks!
Florian



Bug: Display problem with certain links

2019-12-10 Thread Florian Lindner
Hello,

the two links:

[[http://localhost/A-+-B][AAA]] [[http://localhost/A-+-B][BBB]]

are displayed in org mode as

AAA BBB>/a>

meaning the first AAA + whitespaces are strike-through and normal face,
and the BBB is correctly displayed as link. However, both work as links.

I noticed the problem with links from Atlassian Confluence.

Org mode version 9.3 (9.3-elpa)
GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) of
2019-08-29


Best Regards,
Florian






[O] Show breadcrumbs of nodes in agenda

2019-07-26 Thread Florian Lindner
Hello,

the agenda only shows the title of nodes, like:

capture:TODO Task 1

Often, I have a structure like

* Project A
** Task 1

* Project B
** Task 1

then, I get no idea, from what project the task actually is.

Is there a way to also show the title of the parent in agenda buffer or even 
full breadcrumbs?

Thanks,
Florian



[O] [Bug] org-attach-set-directory

2018-07-18 Thread Florian Lindner
Hello,

doing C-a s  on an entry with an existing attachement produces

make-directory: Die Datei existiert bereits: /home/florian/test/data/

(translation: File already exists)

Actually, I implemented this functionality with the help of Nicolas Goaziou, 
but it seems an org mode or emacs upgrade broke it.

I will try to debug that further, but right now, my time is very limited, only 
undershot by my elisp knowledge.

Maybe someone can more quickly fix that... ;-)

Best,
Florian

Backtrace:

Debugger entered--Lisp error: (file-already-exists "Die Datei existiert 
bereits" "/home/florian/test/mydata")
  make-directory-internal("/home/florian/test/mydata")
  make-directory("/home/florian/test/mydata" nil)
  
copy-directory("/home/florian/test/data/c1/32d552-b7bb-43b1-b0d8-c57c00d61f9b" 
"/home/florian/test/mydata" t nil t)
  org-attach-set-directory(nil)
  funcall-interactively(org-attach-set-directory nil)
  call-interactively(org-attach-set-directory)
  org-attach()
  funcall-interactively(org-attach)
  call-interactively(org-attach nil nil)
  command-execute(org-attach)

Org mode version 9.1.13 (9.1.13-elpa @ 
/home/florian/.emacs.d/elpa/org-20180716/)





Re: [O] Capture template stopped working: nil

2017-06-30 Thread Florian Lindner
Hey Nicolas, hey Bastien,

might you give a hint why

 ("j" "Journal" item
  (file+datetree "journal.org")
  "%?\n%i" :kill-buffer t)

which still gives the same error: org-capture: Capture template ‘j’: nil

Thanks a lot,
Florian

Am 25.06.2017 um 21:23 schrieb Florian Lindner:
> Am 25.06.2017 um 21:09 schrieb Nicolas Goaziou:
>> Hello,
>>
>> Florian Lindner <mailingli...@xgm.de> writes:
>>
>>
>>> since recently, one of my capture templates stopped working. Message is:
>>>
>>> Template key:
>>> org-capture: Capture template ‘j’: nil
>>>
>>> and:
>>>
>>> - %?
>>>
>>> is added to journal.org. I have also tried some other template text like 
>>> "foo" (without any keys), but the message is the same.
>>>
>>> value of org-capture-templates is:
>>
>>>  ("j" "Journal" item
>>>   (file+datetree
>>>(concat org-directory "/journal.org"))
>>
>> It should be (lambda () (concat org-directory "/journal.org")).
>>
>> See ORG-NEWS.
> 
> Hey,
> 
> ok, found it there.
> 
> However, it seems that I don't need it anyways, since "When an absolute path 
> is not specified for a target, it is taken as relative to ‘org-directory’."
> 
> So, I changed it to:
> 
>  ("j" "Journal" item
>   (file+datetree "journal.org")
>   "%?\n%i" :kill-buffer t)
> 
> which still gives the same error.
> 
> Sorry... what is still wrong there?
> 
> Best,
> Florian
> 



Re: [O] Moving and resetting attachments

2017-06-28 Thread Florian Lindner
Am 24.06.2017 um 10:53 schrieb Nicolas Goaziou:> Hello,
>
> Florian Lindner <mailingli...@xgm.de> writes:
>
>> Ok, so it's basically a conversion to bool.
>
> Correct.
>
>> That I'm not so sure of. I try to get myself aquainted to ert, but my elisp 
>> knowledge, you surely know, is very limited.
>
> I think you're doing well so far.
>
>> Do I understand correctly, that there is no test for any org-attach stuff so 
>> far? I've found
lisp/test-org-attach-annex.el, but that's for git-annex
>> stuff.
>
> That's correct. Anyway, tests can be postponed to a later patch. It can
> be cumbersome to play with temporary files without clobbering the
> repository.
>
> However, I think tests are important in this case, considering we're
> moving user's data around.

Hey,

I have attached a patch, based on the current git master. I'm not sure how the 
contribution process works. Do I need to
sign stuff such as copyright assignement? Do you use a Git webinterface, GitHub 
or Lab?

Writing a test for it is on my todo list.

Best,
Florian





Re: [O] Capture template stopped working: nil

2017-06-25 Thread Florian Lindner
Am 25.06.2017 um 21:09 schrieb Nicolas Goaziou:
> Hello,
> 
> Florian Lindner <mailingli...@xgm.de> writes:
> 
> 
>> since recently, one of my capture templates stopped working. Message is:
>>
>> Template key:
>> org-capture: Capture template ‘j’: nil
>>
>> and:
>>
>> - %?
>>
>> is added to journal.org. I have also tried some other template text like 
>> "foo" (without any keys), but the message is the same.
>>
>> value of org-capture-templates is:
> 
>>  ("j" "Journal" item
>>   (file+datetree
>>(concat org-directory "/journal.org"))
> 
> It should be (lambda () (concat org-directory "/journal.org")).
> 
> See ORG-NEWS.

Hey,

ok, found it there.

However, it seems that I don't need it anyways, since "When an absolute path is 
not specified for a target, it is taken as relative to ‘org-directory’."

So, I changed it to:

 ("j" "Journal" item
  (file+datetree "journal.org")
  "%?\n%i" :kill-buffer t)

which still gives the same error.

Sorry... what is still wrong there?

Best,
Florian



[O] Capture template stopped working: nil

2017-06-25 Thread Florian Lindner
Hello,

since recently, one of my capture templates stopped working. Message is:

Template key:
org-capture: Capture template ‘j’: nil

and:

- %?

is added to journal.org. I have also tried some other template text like "foo" 
(without any keys), but the message is the same.

value of org-capture-templates is:

 (("t" "Todo" entry
  (file+headline "" "Tasks")
  "* TODO %?\n%t\n%i")
 ("q" "Question" entry
  (file+headline "" "Questions")
  "* %?\n%t\n%i")
 ("c" "Code Question" entry
  (file+headline "" "Code Questions")
  "* %?\n%t %F\n%i")
 ("j" "Journal" item
  (file+datetree
   (concat org-directory "/journal.org"))
  "%?\n%i" :kill-buffer t)
 ("m" "Mail" entry
  (file+headline "" "Mail")
  "* TODO %? %a\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t 
\"+0d\"))\nFrom: %:from")
 ("h" "CSC Todo" entry
  (file+headline "~/Dropbox/CSC/CSC.org" "TODOs")
  "* TODO %?\n%t\n%i"))


All templates are working just fine, only the Journal one not.

Org mode version 9.0.9 (9.0.9-elpa @ /home/florian/.emacs.d/elpa/org-20170622/)

Any idea anyone?

Thanks!
Florian



Re: [O] Moving and resetting attachments

2017-06-20 Thread Florian Lindner
Am 13.06.2017 um 23:41 schrieb Nicolas Goaziou:
> Hello,
> 
> Florian Lindner <mailingli...@xgm.de> writes:
> 
>> What is the use of (and org-attach-allow-inheritance t)? Doesn't it always 
>> returns org-attach-allow-inheritance?
> 
> It return nil if `org-attach-allow-inheritance' is nil, t otherwise. In
> particular, if `org-attach-allow-inheritance' is set to `selective', the
> S-exp returns t.

Ok, so it's basically a conversion to bool.

>> Anyways, I'm not really sure if I understand the doc of org-entry-get 
>> correctly. Does org-entry-get not automatically
>> take inheritance into account, based on the the per-entry or global
>> setting?
> 
> No it doesn't. The caller choose if it should ignore inheritance (the
> default), use it unconditionally (a non-nil INHERIT argument), or let
> the user decide (`selective' INHERIT argument).
>>> ;; FIXME: Need a special case for directory reset (non-nil ARG).
>>
>> Why that? Aren't old and new holding the appropriate dirs in that case
>> and copy over / delete as they should?
> 
> Probably. I was thinking to some special case that may not exist, after
> all. Never mind then.
> 
>> Latest version:
>>
>> (defun flo/org-attach-move ( arg)
>>   "Move current attachements to another directory.
>>   When ARG is non-nil, reset attach directory.  Create directory if
>>   needed."
>>   (interactive "P")
>>   (let ((old (org-attach-dir))
>> (new
>>  (progn
>>(if arg (org-entry-delete nil "ATTACH_DIR")
>>  (let ((dir (read-directory-name
>>  "Attachment directory: "
>>  (org-entry-get nil
>> "ATTACH_DIR"
>> (and org-attach-allow-inheritance 
>> t)
>>(org-entry-put nil "ATTACH_DIR" dir)))
>>(org-attach-dir t
>> (unless (or (string= old new)
>> (not old))
>>   ;; FIXME: Need a special case for directory reset (non-nil ARG).
>>   (when (yes-or-no-p "Copy over attachments from old directory? ")
>> (copy-directory old new t nil t))
>>   (when (yes-or-no-p (concat "Delete " old))
>> (delete-directory old t)
> 
> It looks good.
> 
> Could you provide a patch for that, and an entry in ORG-NEWS? Also, it

Sure, I will do that.

> would be nice to provide test for the feature.

That I'm not so sure of. I try to get myself aquainted to ert, but my elisp 
knowledge, you surely know, is very limited.

Do I understand correctly, that there is no test for any org-attach stuff so 
far? I've found lisp/test-org-attach-annex.el, but that's for git-annex
stuff.

Best,
Florian



Re: [O] Moving and resetting attachments

2017-06-13 Thread Florian Lindner
Am 10.06.2017 um 09:36 schrieb Nicolas Goaziou:
> Hello,
> 
> Florian Lindner <mailingli...@xgm.de> writes:
> 
>> Ok, my new version is here. It should be able to replace
>> org-attach-set-directory
> 
> Thank you. Comments follow.
> 
>> Some questions about the code
>>
>> * Is that the correct way to deal with a boolean prefix arg? I'm not 
>> interested in the value of the prefix arg, only if
>> it's given or not.
> 
> No, it should be (interactive "P") so PREFIX, or more commonly, ARG, is
> nil when not provided.

Thanks!.

>> * The code changes the semantics of org-attach-set-directory, because it 
>> creates the newly set attach dir. IMHO this
>> makes more sense.
> 
> OK.
> 
>> * It deletes only the first part of the dir, e.g. data/83/1234567, it only 
>> deletes the 1234567 dir, even if 83 is empty
>> afterwards. But I think that's ok.
> 
> OK.
> 
> Here is an update of your function, with comments and FIXME. The
> docstring could certainly be improved, but you get the idea.

Yeah, docstring is usually the last I add, since I should at least know what 
the function is supposed to do ;-)

>   (defun flo/org-attach-move ( arg)
> "Move current attachements to another directory.
>   When ARG is non-nil, reset attach directory.  Create directory if
>   needed."
> (interactive "P")
> (let ((old (org-attach-dir))
>   (new
>(progn
>  (if arg (org-entry-delete nil "ATTACH_DIR")
>(let ((dir (read-directory-name
>"Attachment directory: "
>(org-entry-get nil
>   "ATTACH_DIR"
>   (and org-attach-allow-inheritance 
> t)

What is the use of (and org-attach-allow-inheritance t)? Doesn't it always 
returns org-attach-allow-inheritance?
Anyways, I'm not really sure if I understand the doc of org-entry-get 
correctly. Does org-entry-get not automatically
take inheritance into account, based on the the per-entry or global setting?

>  (org-entry-put nil "ATTACH_DIR" dir)))
>  (org-attach-dir t
>   (message "old-attach-dir = %S" old) ;FIXME: remove?
>   (message "new-attach-dir = %S" new) ;FIXME: remove?

Yes, of course.

>   (unless (or (string= old new)
>   (not old))
> ;; FIXME: Need a special case for directory reset (non-nil ARG).

Why that? Aren't old and new holding the appropriate dirs in that case and copy 
over / delete as they should?

> ;; FIXME: Maybe `yes-or-no-p' is safer when moving data around?

Ok. I wasn't aware of the difference, since I have (fset 'yes-or-no-p 
'y-or-n-p) in my .emacs.

> (when (y-or-n-p "Copy over attachments from old directory? ")
>   (copy-directory old-attach-dir new t nil t))
> (when (y-or-n-p (concat "Delete " old))
>   ;; FIXME: Why not `delete-directory'?
>   (shell-command (format "rm -fr %s" old))

I took it from org-attach-delete-all. But you're delete-directory is probably 
better than a shell-command.

Latest version:

(defun flo/org-attach-move ( arg)
  "Move current attachements to another directory.
  When ARG is non-nil, reset attach directory.  Create directory if
  needed."
  (interactive "P")
  (let ((old (org-attach-dir))
(new
 (progn
   (if arg (org-entry-delete nil "ATTACH_DIR")
 (let ((dir (read-directory-name
 "Attachment directory: "
 (org-entry-get nil
"ATTACH_DIR"
(and org-attach-allow-inheritance t)
   (org-entry-put nil "ATTACH_DIR" dir)))
   (org-attach-dir t
(unless (or (string= old new)
(not old))
  ;; FIXME: Need a special case for directory reset (non-nil ARG).
  (when (yes-or-no-p "Copy over attachments from old directory? ")
(copy-directory old new t nil t))
  (when (yes-or-no-p (concat "Delete " old))
(delete-directory old t)



Best,
Florian



Re: [O] Moving and resetting attachments

2017-06-13 Thread Florian Lindner
Am 10.06.2017 um 09:36 schrieb Nicolas Goaziou:
> Hello,
> 
> Florian Lindner <mailingli...@xgm.de> writes:
> 
>> Ok, my new version is here. It should be able to replace
>> org-attach-set-directory
> 
> Thank you. Comments follow.
> 
>> Some questions about the code
>>
>> * Is that the correct way to deal with a boolean prefix arg? I'm not 
>> interested in the value of the prefix arg, only if
>> it's given or not.
> 
> No, it should be (interactive "P") so PREFIX, or more commonly, ARG, is
> nil when not provided.

Thanks!.

>> * The code changes the semantics of org-attach-set-directory, because it 
>> creates the newly set attach dir. IMHO this
>> makes more sense.
> 
> OK.
> 
>> * It deletes only the first part of the dir, e.g. data/83/1234567, it only 
>> deletes the 1234567 dir, even if 83 is empty
>> afterwards. But I think that's ok.
> 
> OK.
> 
> Here is an update of your function, with comments and FIXME. The
> docstring could certainly be improved, but you get the idea.

Yeah, docstring is usually the last I add, since I should at least know what 
the function is supposed to do ;-)

>   (defun flo/org-attach-move ( arg)
> "Move current attachements to another directory.
>   When ARG is non-nil, reset attach directory.  Create directory if
>   needed."
> (interactive "P")
> (let ((old (org-attach-dir))
>   (new
>(progn
>  (if arg (org-entry-delete nil "ATTACH_DIR")
>(let ((dir (read-directory-name
>"Attachment directory: "
>(org-entry-get nil
>   "ATTACH_DIR"
>   (and org-attach-allow-inheritance 
> t)

What is the use of (and org-attach-allow-inheritance t)? Doesn't it always 
returns org-attach-allow-inheritance?
Anyways, I'm not really sure if I understand the doc of org-entry-get 
correctly. Does org-entry-get not automatically
take inheritance into account, based on the the per-entry or global setting?

>  (org-entry-put nil "ATTACH_DIR" dir)))
>  (org-attach-dir t
>   (message "old-attach-dir = %S" old) ;FIXME: remove?
>   (message "new-attach-dir = %S" new) ;FIXME: remove?

Yes, of course.

>   (unless (or (string= old new)
>   (not old))
> ;; FIXME: Need a special case for directory reset (non-nil ARG).

Why that? Aren't old and new holding the appropriate dirs in that case and copy 
over / delete as they should?

> ;; FIXME: Maybe `yes-or-no-p' is safer when moving data around?

Ok. I wasn't aware of the difference, since I have (fset 'yes-or-no-p 
'y-or-n-p) in my .emacs.

> (when (y-or-n-p "Copy over attachments from old directory? ")
>   (copy-directory old-attach-dir new t nil t))
> (when (y-or-n-p (concat "Delete " old))
>   ;; FIXME: Why not `delete-directory'?
>   (shell-command (format "rm -fr %s" old))

I took it from org-attach-delete-all. But you're delete-directory is probably 
better than a shell-command.

Latest version:

(defun flo/org-attach-move ( arg)
  "Move current attachements to another directory.
  When ARG is non-nil, reset attach directory.  Create directory if
  needed."
  (interactive "P")
  (let ((old (org-attach-dir))
(new
 (progn
   (if arg (org-entry-delete nil "ATTACH_DIR")
 (let ((dir (read-directory-name
 "Attachment directory: "
 (org-entry-get nil
"ATTACH_DIR"
(and org-attach-allow-inheritance t)
   (org-entry-put nil "ATTACH_DIR" dir)))
   (org-attach-dir t
(unless (or (string= old new)
(not old))
  ;; FIXME: Need a special case for directory reset (non-nil ARG).
  (when (yes-or-no-p "Copy over attachments from old directory? ")
(copy-directory old new t nil t))
  (when (yes-or-no-p (concat "Delete " old))
(delete-directory old t)



Best,
Florian




Re: [O] Moving and resetting attachments

2017-06-07 Thread Florian Lindner
Am 02.06.2017 um 11:19 schrieb Eric Abrahamsen:> Florian Lindner 
<mailingli...@xgm.de> writes:
>
>> Am 01.06.2017 um 06:39 schrieb Eric Abrahamsen:
>>> Florian Lindner <mailingli...@xgm.de> writes:
>>>
>>>> Hello,
>>>>
>>>> two questions about moving attachments to org files:
>>>>
>>>> C-c C-a a attaches a file and stores it under ./data/ID/...
>>>>
>>>> Using C-c C-a s I can set another directory a attachment directory.
>>>> Can I make org-mode move the content of the previous
>>>> directory to the new directory?
>>>>
>>>> Can I "reset" the attachment directory, i.e. like C-c C-a s but
>>>> :ATTACH_DIR: is deleted and the contents of the previous
>>>> directory are moved to ./data/ID?
>
>> I hacked together some lines of lisp that should achieve that. It's my first 
>> non-trivial (from my point of trivialness)
>> piece of code. I'm open for any suggestions:
>>
[...]
>
> Looks like a good start! My first comment is, this should definitely be
> written as a patch to `org-attach-set-directory'. It's useful
> functionality, and fits well into the whole system -- so long as you
> give users a chance to say no, I don't see why it shouldn't be part of
> the library.
>
> Various comments:
>
> 1. Use the prefix arg to differentiate between setting and unsetting a
>directory. Ie, no prefix arg means set (and an empty string for
>directory name aborts),
>prefix arg means unset. The `org-attach' dispatch mechanism will pass
>the prefix arg through to this function.
> 2. Definitely use `read-directory-name'!
> 3. This is a good use of `copy-directory' with the COPY-CONTENTS flag,
>but I'd still recommend using `directory-files' and then looping over
>all the files with a `map-y-or-n-p'. That will give users a chance to
>selectively choose files to move. This is a matter of taste. If you
>stick with `copy-directory', at least ask the user first.
> 4. I think you're right not to delete the directory afterwards. Best not
>to assume too much.
> 5. The "else" branch of an `if' statement has an implicit `progn', you
>don't need to add it.
> 6. Convention is to not put closing parentheses on their own line. Just
>pile them up at the end of the last form.
> 7. Personally I'd rework things so you only call `org-attach-dir' once.
>How to handle this depends a bit on when when-let was introduced into
>Emacs, and whether Org is okay to support it. Probably safest to use
>when-let*. so:
>
> (when-let* ((attach-dir (org-attach-dir))
> (target (read-directory-name "Move attachments to: ")))
>
> That way everything will bail if there's no attach dir.

Ok, my new version is here. It should be able to replace 
org-attach-set-directory

(defun flo/org-attach-move (prefix)
  "If PREFIX arg, reset attach directory, else set target directory."
  (interactive "p") ; Correct check for boolean prefix?

  (let ((old-attach-dir (org-attach-dir))
(new-attach-dir (if (eq prefix 1)
(let ((dir (org-entry-get nil "ATTACH_DIR")))
  (setq dir (read-directory-name "Attachment 
directory: " dir))
  (org-entry-put nil "ATTACH_DIR" dir)
  (org-attach-dir t)) ; Changes semantics
  (org-entry-delete nil "ATTACH_DIR")
  (org-attach-dir t

(message "old-attach-dir = %s" old-attach-dir)
(message "new-attach-dir = %s" new-attach-dir)
(unless (or (string= old-attach-dir new-attach-dir)
(not old-attach-dir))
  (when (y-or-n-p "Copy over attachments from old directory? ")
(copy-directory old-attach-dir new-attach-dir t nil t))
  (when (y-or-n-p (concat "Delete " old-attach-dir))
(shell-command (format "rm -fr %s" old-attach-dir))


Some questions about the code

* Is that the correct way to deal with a boolean prefix arg? I'm not interested 
in the value of the prefix arg, only if
it's given or not.

* The code changes the semantics of org-attach-set-directory, because it 
creates the newly set attach dir. IMHO this
makes more sense.

* It deletes only the first part of the dir, e.g. data/83/1234567, it only 
deletes the 1234567 dir, even if 83 is empty
afterwards. But I think that's ok.

> 1. Use the prefix arg to differentiate between setting and unsetting a
>directory. Ie, no prefix arg means set (and an empty string for
>directory name aborts),
>prefix arg means unset. Th

Re: [O] Moving and resetting attachments

2017-06-06 Thread Florian Lindner
Am 05.06.2017 um 01:25 schrieb Eric Abrahamsen:
> Nicolas Goaziou  writes:
> 
>> Hello,
>>
>> Eric Abrahamsen  writes:
>>
>>> What I meant was, first ask the user for a directory, then cycle through
>>> the files and ask whether to move each file to that directory. The user
>>> wouldn't specify the directory itself for each file. And with
>>> `map-y-or-n-p', the user can just hit "!" to take care of all files.
>>>
>>> Am I misunderstanding your concern? The only time the ID attachment
>>> directory scheme (which is indeed opaque) would come into play is when
>>> the command was called with a prefix argument -- ie, when removing a
>>> custom directory, and reverting to the automatic directory. In that
>>> case, the directory would be automatically derived, and the user would
>>> simply be presented with the choice to move each file there, or not.
>>
>> When asking for each file if it should be moved or not, you can end up
>> with files in both the old and the new directory. My concern is that,
>> when the old directory is a default ID directory, there is no simple way
>> to get the files back. So, I think we should automatically move files in
>> this case.
>>
>> I also agree with your special case described above.
> 
> Okay, makes sense. I hope we haven't totally scared off Florian...
> 
> Florian, are you interested in doing another version of the patch?

Haha, I couldn't follow everything in your discussion, but I'm happy to hear, 
that you two deem that a worthy feature to
integrate.

I will try to modify my code accordingly and count on your assistance!

Best,
Florian




Re: [O] Moving and resetting attachments

2017-06-01 Thread Florian Lindner
Am 01.06.2017 um 06:39 schrieb Eric Abrahamsen:
> Florian Lindner <mailingli...@xgm.de> writes:
> 
>> Hello,
>>
>> two questions about moving attachments to org files:
>>
>> C-c C-a a attaches a file and stores it under ./data/ID/...
>>
>> Using C-c C-a s I can set another directory a attachment directory.
>> Can I make org-mode move the content of the previous
>> directory to the new directory?
>>
>> Can I "reset" the attachment directory, i.e. like C-c C-a s but
>> :ATTACH_DIR: is deleted and the contents of the previous
>> directory are moved to ./data/ID?
>>
>> Rationale:
>>
>> I use org mode as a document management system. Create an entry Papers -> 
>> Interpolation -> ECCOMAS. I know create an
>> custom attachment directory ECCOMAS, next to the org file as long as I
>> am working on that paper. When it's finished, I
>> want to move the contents of the ECCOMAS attachment directory to ./data/ID/.
> 
> It doesn't work this way now, but I think it makes sense, and I would
> also find that helpful. `org-attach-set-directory' could be changed to
> check for existing files, and offer to move them. There's no
> `org-attach-unset-directory', but I suppose there could be.

Hey,

I hacked together some lines of lisp that should achieve that. It's my first 
non-trivial (from my point of trivialness)
piece of code. I'm open for any suggestions:

(defun flo/org-attach-move ()
  (interactive)
  (when (org-attach-dir)
(let ((target (read-string "Move attachments to: ")) ; read-directory-name 
here?
  (attach-dir (org-attach-dir)))

  (if (string= target "")
  (progn
(org-entry-delete nil "ATTACH_DIR")
(setq target (org-attach-dir t)))
(progn
  (org-entry-put nil "ATTACH_DIR" target)
  (make-directory target t))
)

  (unless (string= target attach-dir)
(copy-directory attach-dir target t nil t)
(message "Deleting %s" attach-dir)
;; (shell-command "rm -rf %s" attach-dir)
)
  )
)
  )


Best,
Florian




[O] Moving and resetting attachments

2017-05-31 Thread Florian Lindner
Hello,

two questions about moving attachments to org files:

C-c C-a a attaches a file and stores it under ./data/ID/...

Using C-c C-a s I can set another directory a attachment directory. Can I make 
org-mode move the content of the previous
directory to the new directory?

Can I "reset" the attachment directory, i.e. like C-c C-a s but :ATTACH_DIR: is 
deleted and the contents of the previous
directory are moved to ./data/ID?

Rationale:

I use org mode as a document management system. Create an entry Papers -> 
Interpolation -> ECCOMAS. I know create an
custom attachment directory ECCOMAS, next to the org file as long as I am 
working on that paper. When it's finished, I
want to move the contents of the ECCOMAS attachment directory to ./data/ID/.

Thanks,
Florian




Re: [O] Set org-agenda-span per file

2017-05-31 Thread Florian Lindner
Am 31.05.2017 um 07:22 schrieb Loris Bennett:
> Hi,
> 
> Florian Lindner <mailingli...@xgm.de> writes:
> 
>> Hello,
>>
>> is it possible to set the number of days that are shown in the agenda,
>> i.e. org-agenda-span on a per file basis?
>>
>> I want to show two weeks of deadlines in my own org file, and just 4
>> days of appointments in the org file synced from the department's
>> calendar.
> 
> I don't know the answer to your question, but I am interested in how you
> are creating an org file synced from your departmental calendar.  Could
> you share some details of the setup?

Sure! My department uses a shared ownCloud calendar and I use org-caldav to 
sync.

https://github.com/dengste/org-caldav

configuration is simple:

(setq org-caldav-url 
"https://invalid.org/cloud/remote.php/dav/calendars/lindner;
  org-caldav-calendar-id "sgskalender"
  org-caldav-inbox "~/sgs.org"
  org-icalendar-timezone "Europe/Berlin"
  org-caldav-files nil)

Best,
Florian




[O] Set org-agenda-span per file

2017-05-30 Thread Florian Lindner
Hello,

is it possible to set the number of days that are shown in the agenda, i.e. 
org-agenda-span on a per file basis?

I want to show two weeks of deadlines in my own org file, and just 4 days of 
appointments in the org file synced from
the department's calendar.

Thanks,
Florian




[O] Key bindings for org calendar selection

2017-03-01 Thread Florian Lindner
Hello,

the usual emacs calendar (M-x calendar) can be controlled using these key 
bindings:
https://www.gnu.org/software/emacs/manual/html_node/emacs/Calendar-Unit-Motion.html

But how can the calendar be controlled when invoked by org-mode, e.g. by C-c 
C-s to set a scheduled date on an entry?
The key bindings from standard calendar do not work, neither editing the mini 
buffer works out.

Thanks,
Florian




Re: [O] Why is Org PDF LaTeX Output not readonly?

2017-02-19 Thread Florian Lindner
Am 17.02.2017 um 13:35 schrieb Nicolas Goaziou:
> Hello,
> 
> Florian Lindner <mailingli...@xgm.de> writes:
> 
>> Am 16.02.2017 um 14:47 schrieb Eric S Fraga:
>>> On Thursday, 16 Feb 2017 at 08:33, Florian Lindner wrote:
>>>> It would be much easier to close it quickly this way and it would be
>>>> consistent with other buffers that serve the same
>>>> purpose, like the beforementioned Auctex output buffer.
>>>
>>> It would indeed be easier.  The buffer is created in org-latex-compile
>>> and I guess it would be the case of setting the mode for the buffer?
>>> Beyond my level of elisp expertise however.
>>
>> There is with-output-to-temp-buffer with redirects the output to a temp 
>> buffer that behaves like a help window and shows
>> that buffer Using this function however makes only sense, when org mode 
>> defaults to displaying the latex output in case
>> something goes wrong. Which, imo would be as sensible default too.
>>
>> Changing that is also way beyond my elisp knowlege.
> 
> In development version, Org now switches compilation buffers to
> `compilation-mode'.

http://orgmode.org/w/org-mode.git?p=org-mode.git;a=commit;h=67c84c161fa4e97c1f98ef1bbc72fa0f6098e1fd

Great! Thanks!




Re: [O] Why is Org PDF LaTeX Output not readonly?

2017-02-16 Thread Florian Lindner
Am 16.02.2017 um 14:47 schrieb Eric S Fraga:
> On Thursday, 16 Feb 2017 at 08:33, Florian Lindner wrote:
>> It would be much easier to close it quickly this way and it would be
>> consistent with other buffers that serve the same
>> purpose, like the beforementioned Auctex output buffer.
> 
> It would indeed be easier.  The buffer is created in org-latex-compile
> and I guess it would be the case of setting the mode for the buffer?
> Beyond my level of elisp expertise however.

There is with-output-to-temp-buffer with redirects the output to a temp buffer 
that behaves like a help window and shows
that buffer Using this function however makes only sense, when org mode 
defaults to displaying the latex output in case
something goes wrong. Which, imo would be as sensible default too.

Changing that is also way beyond my elisp knowlege.

Best,
Florian





Re: [O] Why is Org PDF LaTeX Output not readonly?

2017-02-16 Thread Florian Lindner
Am 15.02.2017 um 17:37 schrieb Eric S Fraga:
> On Wednesday, 15 Feb 2017 at 16:07, Florian Lindner wrote:
>> The exported PDF opens in okular (xdg-open) and I'm perfectly happy with it. 
>> I think we're talking about different
>> things. I mean the buffer that contains the output of the latex command and 
>> potential error message, looking like:
> 
> Oh, sorry, I misunderstood.  Well, as Nick says, does it really matter
> as editing it won't affect anything?
> 
> Funnily enough, I never see this buffer unless I go looking for
> it.  Maybe there's an org setting that causes this buffer to be
> displayed or not?  I cannot see one.

It would be much easier to close it quickly this way and it would be consistent 
with other buffers that serve the same
purpose, like the beforementioned Auctex output buffer.

For me, it would just the right thing.

Florian





Re: [O] Why is Org PDF LaTeX Output not readonly?

2017-02-15 Thread Florian Lindner
Am 15.02.2017 um 15:22 schrieb Eric S Fraga:
> On Wednesday, 15 Feb 2017 at 14:02, Florian Lindner wrote:
>> Hello,
>>
>> is there any reason why the output buffer of org mode exporting to
>> LaTeX is not read-only? Read-only is probably not the
>> right expression, what I mean is that e.g. q calls quit-window and
>> closes the window. This way it's done by Auctex.
> 
> It is for me as the PDF is displayed in a docview window.  I.e. if I
> export to "PDF and open" and then type 'q' in that buffer, the window is
> buried ('k' kills the window).  What version of emacs are you using?

Hey,

I'm using

GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.7) of 2017-02-07
Org mode version 9.0.5 (9.0.5-elpa @ /home/florian/.emacs.d/elpa/org-20170210/)

The exported PDF opens in okular (xdg-open) and I'm perfectly happy with it. I 
think we're talking about different
things. I mean the buffer that contains the output of the latex command and 
potential error message, looking like:

Latexmk: This is Latexmk, John Collins, 5 Sep. 2016, version: 4.48.
Rule 'pdflatex': Rules & subrules not known to be previously run:
   pdflatex
Rule 'pdflatex': The following rules & subrules became out-of-date:
  'pdflatex'

Run number 1 of rule 'pdflatex'


Running 'pdflatex  -recorder  "./RBF.tex"'

Latexmk: applying rule 'pdflatex'...
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Arch Linux) 
(preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./RBF.tex
LaTeX2e <2016/03/31> patch level 3
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size11.clo))
[...]

Best,

Florian




[O] Why is Org PDF LaTeX Output not readonly?

2017-02-15 Thread Florian Lindner
Hello,

is there any reason why the output buffer of org mode exporting to LaTeX is not 
read-only? Read-only is probably not the
right expression, what I mean is that e.g. q calls quit-window and closes the 
window. This way it's done by Auctex.

Thanks,
Florian




Re: [O] Default application for org-reveal

2017-01-08 Thread Florian Lindner
Am 07.01.2017 um 11:39 schrieb Marco Wahl:
> Hi,
> 
> Florian Lindner <mailingli...@xgm.de> writes:
> 
>> Hello,
>>
>> the Org Attach dispatcher offers a key "f" to open the attachment directory 
>> not in Emacs.
>>
>> (defun org-attach-reveal ( if-exists)
>>   "Show the attachment directory of the current task.
>> This will attempt to use an external program to show the directory."
>>   (interactive "P")
>>   (let ((attach-dir (org-attach-dir (not if-exists
>> (and attach-dir (org-open-file attach-dir
>>
>> On my two systems this is the same a F, it opens in dired. xdg-open . uses 
>> dolphin to open inode/directory. How does Emacs/org determine which
>> application to use? How can I influence it?
> 
> The documentation of `org-open-file' points to variable `org-file-apps'.
> You can customize `org-file-apps'.
> 
> E.g. the entry
> 
> [INS] [DEL] Cons-cell:
> Choice: [Value Menu] Links to a directory
> Choice: [Value Menu] Command: firefox %s
> 
> stands for opening directories in firefox.

Ok, thanks. I've set org-file-apps like that now

org-file-apps '((system . "xdg-open %s")
("\\.pdf\\'" . system)
(directory . system)
(auto-mode . emacs)))

and it seems to work.

IMHO should mailcap be deprecated in favor of xdg-open.

Best,
Florian





[O] Default application for org-reveal

2017-01-06 Thread Florian Lindner
Hello,

the Org Attach dispatcher offers a key "f" to open the attachment directory not 
in Emacs.

(defun org-attach-reveal ( if-exists)
  "Show the attachment directory of the current task.
This will attempt to use an external program to show the directory."
  (interactive "P")
  (let ((attach-dir (org-attach-dir (not if-exists
(and attach-dir (org-open-file attach-dir

On my two systems this is the same a F, it opens in dired. xdg-open . uses 
dolphin to open inode/directory. How does Emacs/org determine which
application to use? How can I influence it?

Thanks,
Florian

P.S. Why are file associations such a mess on Linux. Emacs? KDE and Thunderbird 
all use different applications to open the same file...




[O] Problem with python session

2016-10-06 Thread Florian Lindner
Hello,

I have an org file:

* Overview of available basis functions
#+BEGIN_SRC python :session generateBFpics :exports results :results file
  import matplotlib.pyplot as plt
  import numpy as np

  def set_plotoptions():
  plt.xlabel("x")
  plt.ylabel("$\phi(x)$")
  plt.grid()


  np.seterr(invalid='ignore')

  x = np.linspace(-3, 3, 1000)

  plt.plot(x,  np.log(abs(x))*np.power(x, 2))
  plt.suptitle("Thin Plate Splines")
  plt.title("$\phi(|x|) = \log(x) \cdot x^2$")
  set_plotoptions()
  plt.savefig("bf-tps.pdf")
  plt.close()
  "bf-tps.pdf"
#+END_SRC

#+RESULTS:
[[file:bf-tps.pdf]]

#+BEGIN_SRC python :session generateBFpics :exports results :results file
  for shape in [1, 2, 3, 4]:
  plt.plot(x, np.power(shape, 2) + np.power(x,2), label = "s = %i" % shape)
  plt.suptitle("Multi Quadrics")
  plt.title("$\phi(|x|) = s^2 + x^2$")
  plt.legend()
  set_plotoptions()
  plt.savefig("bf-multiquadrics.pdf")
  plt.close()
  "bf-multiquadrics.pdf"
#+END_SRC

#+RESULTS:
[[file:bf-multiquadrics.pdf]]



Both PDFs are generated. But only the first one has the content I expect, the 
othe one is an empty plot (it's a plot,
yes, but empty axes.

When I copy these pieces of code into on .py file it works just great. To my 
understanding that just how session mode works.

What could be the problem here?

Thanks,
Florian




Re: [O] How to add a label in LaTeX export

2016-09-09 Thread Florian Lindner
Am 06.09.2016 um 10:59 schrieb Nicolas Goaziou:
> Hello,
> 
> Florian Lindner <mailingli...@xgm.de> writes:
> 
>> I have this org mode document:
>>
>> #+BEGIN_SRC python :exports results :results file
>>   import matplotlib.pyplot as plt, numpy as np
>>   x = np.linspace(-2, 2, 1000)
>>   plt.plot(x, np.exp(-np.power(4*x, 2)), label="shape-parameter=4")
>>   plt.plot(x, np.exp(-np.power(2*x, 2)), label="shape-parameter=2")
>>   for i in range(-6, 7): plt.axvline(1/6 * i, ymax = 0.1, ls = "-.", 
>> color="r")
>>   plt.grid()
>>   plt.legend()
>>   plt.savefig('rbf-gaussian-4.pdf')
>>   return "rbf-gaussian-4.pdf"
>> #+END_SRC
>> #+NAME: fig:GaussianExample
>> #+CAPTION: Gaussian Basis functions with vertex distances marked at $n \cdot 
>> \frac{1}{6}$.
>> #+RESULTS:
>> [[file:rbf-gaussian-4.pdf]]
>>
>>
>> which exports to:
>>
>>
>> \begin{document}
>>
>> \tableofcontents
>>
>> \begin{figure}[htb]
>> \centering
>> \includegraphics[width=.9\linewidth]{rbf-gaussian-4.pdf}
>> \caption{\label{fig:orgparagraph1}
>> Gaussian Basis functions with vertex distances marked at \(n \cdot 
>> \frac{1}{6}\).}
>> \end{figure}
>> \end{document}
>>
>>
>> The #+NAME which I expect to translate to a label is ignored.
> 
> It isn't. It is changed into
> 
>  \label{fig:orgparagraph1}
> 
> See also `org-latex-prefer-user-labels'.

Thanks, see related issue for org-ref: 
https://github.com/jkitchin/org-ref/issues/285

Florian




[O] How to add a label in LaTeX export

2016-09-06 Thread Florian Lindner
Hello,

I have this org mode document:

#+BEGIN_SRC python :exports results :results file
  import matplotlib.pyplot as plt, numpy as np
  x = np.linspace(-2, 2, 1000)
  plt.plot(x, np.exp(-np.power(4*x, 2)), label="shape-parameter=4")
  plt.plot(x, np.exp(-np.power(2*x, 2)), label="shape-parameter=2")
  for i in range(-6, 7): plt.axvline(1/6 * i, ymax = 0.1, ls = "-.", color="r")
  plt.grid()
  plt.legend()
  plt.savefig('rbf-gaussian-4.pdf')
  return "rbf-gaussian-4.pdf"
#+END_SRC

#+NAME: fig:GaussianExample
#+CAPTION: Gaussian Basis functions with vertex distances marked at $n \cdot 
\frac{1}{6}$.
#+RESULTS:
[[file:rbf-gaussian-4.pdf]]


which exports to:


\begin{document}

\tableofcontents

\begin{figure}[htb]
\centering
\includegraphics[width=.9\linewidth]{rbf-gaussian-4.pdf}
\caption{\label{fig:orgparagraph1}
Gaussian Basis functions with vertex distances marked at \(n \cdot 
\frac{1}{6}\).}
\end{figure}
\end{document}


The #+NAME which I expect to translate to a label is ignored. I also tried 
using #+LABEL or transposing NAME and caption
but same result.

What is wrong there?

Thanks,
Florian




Re: [O] There is no line to end here at LaTeX org-ref export

2016-09-05 Thread Florian Lindner
Am 02.09.2016 um 15:12 schrieb Eric S Fraga:
> Can you post an actual org test file as an attachment?  And also the
> resulting LaTeX file on export?

Hey,

sorry for the late reply. I tried to reproduce the problem firstly using emacs 
-Q but it worked like that.

After some bisect debugging I found out that setting

(setq org-latex-pdf-process '("latexmk -f -pdf %f"))

triggered the error.

But the usual latex process also causes the error, but gives the error message

Processing LaTeX file ./test2.tex...
PDF file produced with errors.

and continues. You have no errors using that snippet? Can you compile ther 
resulting tex file using auctex or the
latexmk command above? And why does latexmk -f does not continue despite the 
error? That's what the -f option should do?
I want to use latexmk to include also bibtex generation.

Ok, after some debugging and bisecting my .emacs, org-export-preserve-breaks t 
seems to cause the faulty export.

Best,
Florian









Re: [O] There is no line to end here at LaTeX org-ref export

2016-09-02 Thread Florian Lindner
Am 01.09.2016 um 08:02 schrieb Nick Dokos:

> Try this:
> 
> --8<---cut here---start->8---
> An example without org-ref that produces this error:
> 
> #+NAME: fig:org_fig
> #+BEGIN_SRC python :exports results :results file
>   import matplotlib.pyplot as plt, numpy as np
>   x = np.linspace(-2, 2, 1000)
>   plt.plot(x, np.exp(-np.power(4*x, 2)), label="shape-parameter=4")
>   plt.savefig('rbf-gaussian-4.pdf')
>   return "rbf-gaussian-4.pdf"
> #+END_SRC
> 
> #+CAPTION: Org Fig
> #+RESULTS: fig:org_fig
> [[file:rbf-gaussian-4.pdf]]
> 
> 
> Some text
> --8<---cut here---end--->8---
> 

Some story, nothing changed. Still no line to end here.

Best,
Florian




Re: [O] There is no line to end here at LaTeX org-ref export

2016-09-01 Thread Florian Lindner
org-version is

Org-mode version 8.3.5 (8.3.5-4-g2dfdaf-elpa @ 
/home/florian/.emacs.d/elpa/org-20160829/)

Am 30.08.2016 um 10:22 schrieb Florian Lindner:
> Hello,
> 
> I learn to use org-ref and try to export a simple document:
> 
> * Section
> label:Testlabel Some citations cite:Bungartz2015 and cite:Torres2009 and a 
> reference to a label ref:Testlabel
> 
> bibliographystyle:unsrt
> [[bibliography:/home/florian/Mendeley/library.bib]]
> 
> This exports to:
> 
> \section{Section}
> \label{sec-1}
> \label{Testlabel} Some citations \cite{Bungartz2015} and \cite{Torres2009} 
> and a reference to a label \ref{Testlabel} \\
> 
> \bibliographystyle{unsrt} \\
> \bibliography{../../Mendeley/library} \\
> % Emacs 24.5.1 (Org mode 8.2.10)
> \end{document}
> 
> Compilation gives: LaTeX Error: There's no line here to end.
> 
> Removing the last two double slashes after \bibliography and 
> \bibliographystyle fixes it.
> 
> In https://github.com/jkitchin/org-ref/issues/279 the author says it probably 
> not related to org-ref, however I was
> unable to reproduce it without it.
> 
> All I configured when it comes to org / latex is:
> 
> org-latex-packages-alist '(("" "listings") ("" "color"))
> org-latex-pdf-process '("latexmk -f -pdf %f")
> org-latex-table-caption-above nil
> 
> However, I was doing the compile manually, so pdf-process is irrelevant here.
> 
> Any ideas how to fix that?
> 
> Thanks!
> Florian
> 
> 
> 





Re: [O] There is no line to end here at LaTeX org-ref export

2016-08-31 Thread Florian Lindner
Am 30.08.2016 um 10:22 schrieb Florian Lindner:

> In https://github.com/jkitchin/org-ref/issues/279 the author says it probably 
> not related to org-ref, however I was
> unable to reproduce it without it.

An example without org-ref that produces this error:

#+BEGIN_SRC python :exports results :results file
  import matplotlib.pyplot as plt, numpy as np
  x = np.linspace(-2, 2, 1000)
  plt.plot(x, np.exp(-np.power(4*x, 2)), label="shape-parameter=4")
  plt.savefig('rbf-gaussian-4.pdf')
  return "rbf-gaussian-4.pdf"
#+END_SRC
#+NAME: fig:org_fig
#+CAPTION: Org Fig
#+RESULTS: fig:org_fig
[[file:rbf-gaussian-4.pdf]]
Some text


Gives, when compiled to latex gives also: There is no line here to end:

ERROR: LaTeX Error: There's no line here to end.

--- TeX said ---

See the LaTeX manual or LaTeX Companion for explanation.
Type  H   for immediate help.
 ...

l.40 S
  ome text \\
--- HELP ---
A \newline or \\ command appears between paragraphs, where it makes no
sense. If you're trying to ``leave a blank line'', use a \vspace
command.


Thanks,
Florian



Re: [O] Add caption to babel-generated images

2016-08-30 Thread Florian Lindner
Am 30.08.2016 um 13:54 schrieb Florian Lindner:
> Am 30.08.2016 um 13:04 schrieb Georgiy Tugai:
>> I don't know if it'll work for Python, but here's an example of what
>> works for me with Ditaa:
>>
>>> #+BEGIN_SRC ditaa :file figs/-mininet-ovsk.png :cache yes
>>>/+ /+ /+ /+
>>>|host| |host| |host| |host|   Containers
>>>+-+--/ +-+--/ +--+-/ +--+-/
>>>  |  |   |  |
>>>   -
>>>  |  |   |  |
>>>+-+--+---+--+-+
>>>|  Open VSwitch   |  Host kernel
>>>+-+-+---=-+
>>>  | |
>>>   +--+-+ +-+--+
>>>   | controller | | controller |  Host userspace
>>>   ++ ++
>>> #+END_SRC
>>>
>>> #+ATTR_LATEX: :width "" :options [scale=0.75]
>>> #+CAPTION: [[label:fig:mininet-arch]]Mininet with OpenVSwitch architecture
>>> #+RESULTS[1d367d39f18523f4eb247cb13aabd6c6f633fbdf]: 
>>> [[file:figs/-mininet-ovsk.png]]
>>
>> First, execute your Babel block in order to generate a #+RESULTS line.
>> Then, add CAPTION, ATTR_LATEX etc. lines before the RESULTS line.
> 
> This seems to work mostly, yes. Problem is, that org puts the label inside 
> the caption:
> 
> \begin{figure}[htb]
> \centering
> \includegraphics[width=.9\linewidth]{rbf-gaussian-4.pdf}
> \caption{\label{fig:GaussianExample}Gaussian Basis functions with vertex 
> distances marked at $n \cdot \frac{1}{6}$.}
> \end{figure}
> 
> This way the label does not work, i.e. won't be found by ref links.
> 
> #+BEGIN_SRC python :exports results :results file
>   import matplotlib.pyplot as plt, numpy as np
>   x = np.linspace(-2, 2, 1000)
>   plt.plot(x, np.exp(-np.power(4*x, 2)), label="shape-parameter=4")
>   for i in range(-4, 5): plt.axvline(1/6 * i, ymax = 0.1, ls = "-.", 
> color="r")
>   plt.grid()
>   plt.savefig('rbf-gaussian-4.pdf')
>   return "rbf-gaussian-4.pdf"
> #+END_SRC
> 
> #+LABEL: fig:GaussianExample
> #+CAPTION: Gaussian Basis functions with vertex distances marked at $n \cdot 
> \frac{1}{6}$.
> #+RESULTS:
> [[file:rbf-gaussian-4.pdf]]
> 
> 
> Using NAME instead of caption results in the same latex output.

Of course, using NAME instead of CAPTION. But I just learned that CAPTION is 
just an obsolete alias for NAME.





Re: [O] Add caption to babel-generated images

2016-08-30 Thread Florian Lindner
Am 30.08.2016 um 13:04 schrieb Georgiy Tugai:
> I don't know if it'll work for Python, but here's an example of what
> works for me with Ditaa:
> 
>> #+BEGIN_SRC ditaa :file figs/-mininet-ovsk.png :cache yes
>>/+ /+ /+ /+
>>|host| |host| |host| |host|   Containers
>>+-+--/ +-+--/ +--+-/ +--+-/
>>  |  |   |  |
>>   -
>>  |  |   |  |
>>+-+--+---+--+-+
>>|  Open VSwitch   |  Host kernel
>>+-+-+---=-+
>>  | |
>>   +--+-+ +-+--+
>>   | controller | | controller |  Host userspace
>>   ++ ++
>> #+END_SRC
>>
>> #+ATTR_LATEX: :width "" :options [scale=0.75]
>> #+CAPTION: [[label:fig:mininet-arch]]Mininet with OpenVSwitch architecture
>> #+RESULTS[1d367d39f18523f4eb247cb13aabd6c6f633fbdf]: 
>> [[file:figs/-mininet-ovsk.png]]
> 
> First, execute your Babel block in order to generate a #+RESULTS line.
> Then, add CAPTION, ATTR_LATEX etc. lines before the RESULTS line.

This seems to work mostly, yes. Problem is, that org puts the label inside the 
caption:

\begin{figure}[htb]
\centering
\includegraphics[width=.9\linewidth]{rbf-gaussian-4.pdf}
\caption{\label{fig:GaussianExample}Gaussian Basis functions with vertex 
distances marked at $n \cdot \frac{1}{6}$.}
\end{figure}

This way the label does not work, i.e. won't be found by ref links.

#+BEGIN_SRC python :exports results :results file
  import matplotlib.pyplot as plt, numpy as np
  x = np.linspace(-2, 2, 1000)
  plt.plot(x, np.exp(-np.power(4*x, 2)), label="shape-parameter=4")
  for i in range(-4, 5): plt.axvline(1/6 * i, ymax = 0.1, ls = "-.", color="r")
  plt.grid()
  plt.savefig('rbf-gaussian-4.pdf')
  return "rbf-gaussian-4.pdf"
#+END_SRC

#+LABEL: fig:GaussianExample
#+CAPTION: Gaussian Basis functions with vertex distances marked at $n \cdot 
\frac{1}{6}$.
#+RESULTS:
[[file:rbf-gaussian-4.pdf]]


Using NAME instead of caption results in the same latex output.

Thanks,
Florian

> 
> Good luck!
> Georgiy
> 
> On 30 Aug, Florian Lindner wrote:
>> Hello,
>>
>> I have this code block:
>>
>> #+BEGIN_SRC python :exports results :results file
>>   import matplotlib.pyplot as plt, numpy as np
>>   x = np.linspace(-2, 2, 1000)
>>   plt.plot(x, np.exp(-np.power(4*x, 2)), label="shape-parameter=4")
>>   for i in range(-4, 5): plt.axvline(1/6 * i, ymax = 0.1, ls = "-.", 
>> color="r")
>>   plt.grid()
>>   plt.savefig('rbf-gaussian-4.pdf')
>>   return "rbf-gaussian-4.pdf"
>> #+END_SRC
>>
>> When exporting to latex it nicely compiles into 
>> \includegraphics[width=.9\linewidth]{rbf-gaussian-4.pdf}.
>>
>> Now I want to have this \includegraphics in a figure environement including 
>> a label (to reference it) and a caption.
>>
>> How can do this best?
>>
>> I have found:
>> http://emacs.stackexchange.com/questions/12150/add-caption-to-an-image-generated-by-a-code-block
>>
>> but it doesn't work for me.
>>
>> Thanks,
>> Florian
>>
>>





Re: [O] Add caption to babel-generated images

2016-08-30 Thread Florian Lindner
Am 30.08.2016 um 12:11 schrieb Nicolas Goaziou:
> Hello,
> 
> Florian Lindner <mailingli...@xgm.de> writes:
> 
>> I have this code block:
>>
[...]

>> When exporting to latex it nicely compiles into 
>> \includegraphics[width=.9\linewidth]{rbf-gaussian-4.pdf}.
>>
>> Now I want to have this \includegraphics in a figure environement including 
>> a label (to reference it) and a caption.
>>
>> How can do this best?
> 
>> I have found:
>> http://emacs.stackexchange.com/questions/12150/add-caption-to-an-image-generated-by-a-code-block
>>
>> but it doesn't work for me.
> 
> What did you write? What doesn't work?

This org mode document

#+NAME: fig:org_fig
#+BEGIN_SRC python :exports results :results file
  import matplotlib.pyplot as plt, numpy as np
  x = np.linspace(-2, 2, 1000)
  plt.plot(x, np.exp(-np.power(4*x, 2)), label="shape-parameter=4")
  for i in range(-4, 5): plt.axvline(1/6 * i, ymax = 0.1, ls = "-.", color="r")
  plt.grid()
  plt.savefig('rbf-gaussian-4.pdf')
  return "rbf-gaussian-4.pdf"
#+END_SRC
#+CAPTION: Org Fig
#+LABEL: fig:org_fig

Exports to:

\begin{document}

\maketitle
\tableofcontents

\includegraphics[width=.9\linewidth]{rbf-gaussian-4.pdf} \\
% Emacs 24.5.1 (Org mode 8.2.10)
\end{document}

Additionally, when evaluating it's changed to:

[...]
#+END_SRC

#+RESULTS: fig:org_fig
[[file:rbf-gaussian-4.pdf]]

#+CAPTION: Org Fig
#+LABEL: fig:org_fig


Splitting off the caption and label.

Best,
Florian




[O] Add caption to babel-generated images

2016-08-30 Thread Florian Lindner
Hello,

I have this code block:

#+BEGIN_SRC python :exports results :results file
  import matplotlib.pyplot as plt, numpy as np
  x = np.linspace(-2, 2, 1000)
  plt.plot(x, np.exp(-np.power(4*x, 2)), label="shape-parameter=4")
  for i in range(-4, 5): plt.axvline(1/6 * i, ymax = 0.1, ls = "-.", color="r")
  plt.grid()
  plt.savefig('rbf-gaussian-4.pdf')
  return "rbf-gaussian-4.pdf"
#+END_SRC

When exporting to latex it nicely compiles into 
\includegraphics[width=.9\linewidth]{rbf-gaussian-4.pdf}.

Now I want to have this \includegraphics in a figure environement including a 
label (to reference it) and a caption.

How can do this best?

I have found:
http://emacs.stackexchange.com/questions/12150/add-caption-to-an-image-generated-by-a-code-block

but it doesn't work for me.

Thanks,
Florian




[O] There is no line to end here at LaTeX org-ref export

2016-08-30 Thread Florian Lindner
Hello,

I learn to use org-ref and try to export a simple document:

* Section
label:Testlabel Some citations cite:Bungartz2015 and cite:Torres2009 and a 
reference to a label ref:Testlabel

bibliographystyle:unsrt
[[bibliography:/home/florian/Mendeley/library.bib]]

This exports to:

\section{Section}
\label{sec-1}
\label{Testlabel} Some citations \cite{Bungartz2015} and \cite{Torres2009} and 
a reference to a label \ref{Testlabel} \\

\bibliographystyle{unsrt} \\
\bibliography{../../Mendeley/library} \\
% Emacs 24.5.1 (Org mode 8.2.10)
\end{document}

Compilation gives: LaTeX Error: There's no line here to end.

Removing the last two double slashes after \bibliography and \bibliographystyle 
fixes it.

In https://github.com/jkitchin/org-ref/issues/279 the author says it probably 
not related to org-ref, however I was
unable to reproduce it without it.

All I configured when it comes to org / latex is:

org-latex-packages-alist '(("" "listings") ("" "color"))
org-latex-pdf-process '("latexmk -f -pdf %f")
org-latex-table-caption-above nil

However, I was doing the compile manually, so pdf-process is irrelevant here.

Any ideas how to fix that?

Thanks!
Florian




[O] Table Layout at LaTeX Export

2016-08-19 Thread Florian Lindner
Hello,

I try to achieve a table layout using vertical lines between each colum

\begin{tabular}{|l|l|l|}

but I'm unable to get it using org-mode tables

Using a first table row like that:

| /   | <| <|

Is the best I was able to achieve, it produces {l|l|l}.

How can I produce the desired output above?

Thanks,
Florian




[O] org-beamer: How to leave a block?

2016-07-07 Thread Florian Lindner
Hello,

I have

*** MATLAB vs. PETSc:B_quote:
:PROPERTIES:
:BEAMER_env: quote
:END:
some lengthy quote

from the manual

Now I want to put the "from the manual" below the quote environment, not 
inside, like that:

\begin{frame}
\begin{quote} %% MATLAB vs. PETSc
some lengthy quote
\end{quote}
from the manual
\end{frame}

How can I achieve that which org-mode beamer, i.e. leave a block?

Thanks,
Florian




Re: [O] Adding [fragile] to a LaTeX Beamer slide

2016-07-07 Thread Florian Lindner
Am 06.07.2016 um 22:49 schrieb Nicolas Goaziou:
> Hello,
> 
> Florian Lindner <mailingli...@xgm.de> writes:
> 
>> How can I add a fragile option to the frame
> 
> You can set :BEAMER_OPT property accordingly.

Great, works:

:PROPERTIES:
:BEAMER_OPT: fragile
:END:

Just one more question, btw. When I used this property syntax:

#+PROPERTY: BEAMER_OPT fragile

The only difference is that this property would be inherited to children?


>> or make the BEGIN_src block use the lstlisting environment?
> 
> See `org-latex-listings'.

Works fine by setting:

(setq org-latex-listings t
  org-latex-packages-alist '(("" "listings") ("" "color"


Thanks for your help!

Florian




[O] Adding [fragile] to a LaTeX Beamer slide

2016-07-06 Thread Florian Lindner
Hello,

I try to put some source code, using the listings package in my slides:

** Source Code
#+BEGIN_LATEX
\begin{lstlisting}
for (int i = 1; i != 10; ++i) 
std::cout << i << ": hello, world!"
  << std::endl;
\end{lstlisting}
#+END_LATEX

Problem is, this, in contrast to

#+BEGIN_SRC c
foobar
#+END_SRC

does not add the fragile option the frame and therefore it does not compile.

I would prefer the latter option, but it renders to a verbatim environment, not 
a lstlisting.

How can I add a fragile option to the frame or make the BEGIN_src block use the 
lstlisting environment?

Thanks,
Florian




Re: [O] Some LaTeX Beamer / org-mode questions

2016-06-02 Thread Florian Lindner


On Wed, 01 Jun 2016 12:26:07 +0200
Rasmus <ras...@gmx.us> wrote:

> Florian Lindner <mailingli...@xgm.de> writes:
> 
> > On Mon, 30 May 2016 13:53:52 +0200
> > Rasmus <ras...@gmx.us> wrote:
> >  
> >> Hi,
> >> 
> >> Florian Lindner <mailingli...@xgm.de> writes:
> >>   
> >> >> #+options: title:nil
> >> >
> >> > Sorry, can't make it work.
> >> >> #+subtitle:
> >> >
> >> > Neither that works for me
> >> 
> >> Are you sure you are using an up-to-date version of Org?
> >> M-x org-version should return 8.3.something.  
> >
> > Ah, you were right. I used the builtin org version.
> >
> > It works now, however, when I set the title:nil is does not produce
> > a title page at all.
> >
> > #+BEGIN_LATEX
> > \maketitle
> > #+END_LATEX  
> 
> Or:
> 
> @@latex:\maketitle@@.
> 
> What exactly are you missing from the standard title page support of
> Org?

Nothing really, but when I use title:t, org mode sets a
\title{presentation} in the tex file which overwrites my own title. If
I set title:nil, it sets \title{} still overwriting my own title.

> > inserts a title page, but after the table of contents.
> >
> > Any way to work around that?  
> 
> Yes, the #+TOC keyword combined with the option toc:nil.

Ah, ok, I think I got using these settings now:

#+startup: beamer
#+LATEX_CLASS: beamer
#+LATEX_CLASS_OPTIONS: [presentation]
#+BEAMER_THEME: Boadilla
#+OPTIONS: H:2 num:t title:nil toc:nil

#+BEGIN_LATEX
\author[me]{me and the coauthors}
\title[short title]{long title \\ next line}
\subtitle{subtitle}
\institute[short institute]{long institute}
\maketitle
#+END_LATEX


As I said, all I want is to have a standard title page followed by a
toc, but I need to set also the short version of title, institute and
author.

Well it works, albeit not very elegant.

Best,
Florian





Re: [O] Some LaTeX Beamer / org-mode questions

2016-06-01 Thread Florian Lindner


On Mon, 30 May 2016 13:53:52 +0200
Rasmus <ras...@gmx.us> wrote:

> Hi,
> 
> Florian Lindner <mailingli...@xgm.de> writes:
> 
> >> #+options: title:nil  
> >
> > Sorry, can't make it work.  
> >> #+subtitle:  
> >
> > Neither that works for me  
> 
> Are you sure you are using an up-to-date version of Org?
> M-x org-version should return 8.3.something.

Ah, you were right. I used the builtin org version.

It works now, however, when I set the title:nil is does not produce a
title page at all.

#+BEGIN_LATEX
\maketitle
#+END_LATEX

inserts a title page, but after the table of contents.

Any way to work around that?

Best,
Florian




Re: [O] Some LaTeX Beamer / org-mode questions

2016-05-30 Thread Florian Lindner


On Mon, 30 May 2016 11:19:52 +0200
Rasmus <ras...@gmx.us> wrote:

> Hi,
> 
> Florian Lindner <mailingli...@xgm.de> writes:
> 
> > I'm working on my first presentation using org mode together with
> > latex beamer (until now, I produce the slide using beamer only).
> >
> > The top of my org file looks like that:
> >
> > #+startup: beamer
> > #+LATEX_CLASS: beamer
> >
> > #+LATEX_CLASS_OPTIONS: [presentation]
> > #+BEAMER_THEME: Boadilla
> > #+LATEX_HEADER: \author[me]{\underline{me}, co1, co2}
> > #+LATEX_HEADER: \title[short title]{multi line long title}
> > #+LATEX_HEADER: \subtitle{subtitle}
> > #+LATEX_HEADER: \institute[short institute]{multi line long
> > institute}
> >
> > This works so far, except the title. Since I do not set a title
> > using #+TITLE, org-mode sets a default \title{presentation}. How
> > can I omit that?  
> 
> #+options: title:nil

Sorry, can't make it work.
> 
> > Is there a more elegant way to achieve the settings like above?
> > Especially
> >
> > - The short and version of title, author and institute.  
> 
> Don't know.
> 
> > - The multi line (\\) formatting  
> 
> \\ at eol is org syntax for forced line break.
> 
> > - The subtitle  
> 
> #+subtitle:

Neither that works for me

#+startup: beamer
#+LATEX_CLASS: beamer
#+LATEX_CLASS_OPTIONS: [presentation]
#+BEAMER_THEME: Boadilla
#+LATEX_HEADER: \author[me]{me and the coauthors}
#+LATEX_HEADER: \title[short title]{long title \\ next line}
#+LATEX_HEADER: \institute[short institute]{long institute}
#+subtitle: subtitle
#+OPTIONS: H:2 toc:t num:t title:nil

The subtitle is ignored and the resulting tex file still contains
\title{presentation}

Thanks,
Florian





[O] Some LaTeX Beamer / org-mode questions

2016-05-30 Thread Florian Lindner
Hello,

I'm working on my first presentation using org mode together with latex
beamer (until now, I produce the slide using beamer only).

The top of my org file looks like that:

#+startup: beamer
#+LATEX_CLASS: beamer
#+LATEX_CLASS_OPTIONS: [presentation]
#+BEAMER_THEME: Boadilla
#+LATEX_HEADER: \author[me]{\underline{me}, co1, co2}
#+LATEX_HEADER: \title[short title]{multi line long title}
#+LATEX_HEADER: \subtitle{subtitle}
#+LATEX_HEADER: \institute[short institute]{multi line long institute}

This works so far, except the title. Since I do not set a title using
#+TITLE, org-mode sets a default \title{presentation}. How can I omit that?

Is there a more elegant way to achieve the settings like above? Especially

- The short and version of title, author and institute.
- The multi line (\\) formatting
- The subtitle

Thanks!

Florian




[O] Expire deadline of none TODO items

2016-01-04 Thread Florian Lindner
Hello,

some of my nodes have a deadline but a TODO. Therefore they can't be
DONE. Yet, in the org-agenda they are displayed indefinitly until I set
a DONE for them, which I do not want (because they weren't a TODO in
the first place).

Can I make org-mode auto expire items that have a deadline but not a
TODO item? So that they are now shown in the agenda, when the deadline
have passed for e.g. 5 days.

Thanks,
Florian




[O] Bug: Capture templates: file-olp

2015-05-07 Thread Florian Lindner
Hello,

I just noticed, that if I use a capture template like 

(p foo entry (file+olp  foo) * %?\n%t\n%i)

It complains about:

Template key: 
org-find-olp: Wrong type argument: stringp, nil

It works when using

(p foo entry (file+olp org-default-notes-file foo) * %?\n%t\n%i)

However, documentation claims:

If that file name is the empty string, it defaults to org-default-notes-
file.

http://orgmode.org/manual/Template-elements.html#Template-elements

org-mode that was shipped with Emacs 24.5.

Is that a known bug? Or is it no bug at all?

Best Regards,
Florian




[O] Showing next items in agenda + deadline in past

2015-01-14 Thread Florian Lindner
Hello,

two questions regarding agenda views. The agenda for the current week looks 
like that:

Week-agenda (W03):
Monday 12 January 2015 W03
  capture:TODO Stellwände für kommenden Montag besorgen
Tuesday13 January 2015
Wednesday  14 January 2015
  uni:75 d. ago:  Abstract
  uni:In   6 d.:  TODO Registration
Thursday   15 January 2015
Friday 16 January 2015
Saturday   17 January 2015
Sunday 18 January 2015


1) How can I configure it to show not the next n days, but the next n events 
like:

Next events-agenda (W03):
Monday 12 January 2015 W03
  capture:TODO Stellwände für kommenden Montag besorgen
Wednesday  14 January 2015 
  uni:75 d. ago:  Abstract
  uni:In   6 d.:  TODO Registration
Saturday   17 January 2015 (+ 3d)
  whatever

(I also added a (+ 3d) to days as an idea)

2) There is this 75 d. ago Abstract DEADLINE. How am I supposed to act on 
deadlines in the past? The item has no TODO/DONE marker, just the DEADLINE. 
How to say that the action that relates to this deadline is done?

Thanks,
Florian





Re: [O] archive subtree with complete structure

2014-10-13 Thread Florian Lindner
Julien Cubizolles wrote:

 Can org-archive-subtree be made to archive the whole parent structure
 along with the subtree selected ?
 
 I'm using an the same org file every year and I'd like to archive some
 of its contents at the end of the year. Something like:
 
 
[...]

You mean that:

http://comments.gmane.org/gmane.emacs.orgmode/86901

It's a feature I've been searching too for some time, but to no success.

I even thought about a bug bounty for that:

http://lists.gnu.org/archive/html/emacs-orgmode/2014-10/msg00228.html

Best Regards,
Florian





[O] Feature Request Bounty?

2014-10-09 Thread Florian Lindner
Hello,

first question: Are bug/feature request bounties are ok here?

I have a FR that I really want to have resolved. Described here:

http://lists.gnu.org/archive/html/emacs-orgmode/2014-05/msg01186.html

http://orgmode.org/worg/org-hacks.html#sec-1-7-1 does not do the job (tried 
the slightly more complex version).

Since I would really benefit in my workflow I thought about bringing out a 
bug bounty for that. 

Are bounties fine or seen as inappropiate?

What amount would you deem appropriate for implementation?

Best Regards,
Florian




[O] [FR] Archive subtree with parent structure

2014-05-28 Thread Florian Lindner

org-archive-subtree archives a subtree.

* A
** AA
*** AAA
** AB
*** ABA

Archiving AA will remove the subtree from the original file and create
it like that in archive target:

* AA
** AAA

What I want (wish for) is to create it like that in the archive target:

* A
** AA
*** AAA

If I also archive AB after that, it gets inserted in the structure which
is now identical to the structure we started with.

Use case: I tend to archive small pieces of a project's subtree long
before I'm ready to archive the entire project. This way I build (want
to build) an archived mirror of the project's subtree bit by bit.

Thanks a lot to the org-mode developers.




[O] Make org-iswitchb see all agenda files (not only opened ones)

2014-05-28 Thread Florian Lindner

Hello,

can I make org-iswitchb consider not only already opened files but all 
agenda files, just like org-agenda?


I tried one and two prefix arguments, but org-iswitchb always considers 
only files that are already opened.


Thanks!
Florian



[O] Bug: Archive subtree with parent structure [7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/)]

2014-05-16 Thread Florian Lindner
This is not a bug report but a wishlist item.

org-archive-subtree archives a subtree.

* A
** AA
*** AAA 
** AB
*** ABA

Archiving AA will remove the subtree from the original file and create
it like that in archive target:

* AA
** AAA 

What I want (wish for) is to create it like that in the archive target:

* A
** AA
*** AAA

If I also archive AB after that, it gets inserted in the structure which
is now identical to the structure we started with.

Use case: I tend to archive small pieces of a project's subtree long
before I'm ready to archive the entire project. This way I build (want
to build) an archived mirror of the project's subtree bit by bit.

Thanks a lot to the org-mode developers.



Emacs  : GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.7)
 of 2014-01-28 on var-lib-archbuild-extra-x86_64-juergen
Package: Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ 
/usr/share/emacs/24.3/lisp/org/)




Re: [O] Archive subtree with parent structure

2014-05-15 Thread Florian Lindner

Am 18.04.2014 13:36, schrieb Bastien:

Hi Florian,

Florian Lindner mailingli...@xgm.de writes:


is it possible to org-archive-subtree a subtree and keep the entire
parent structure? e.g.

* A
** AA
** AB
** AC


AB will be archived to:

* A
** AB


No, but each subtree can contain an :ARCHIVE: property that will help
you come close to this.

For example:

* A
  :PROPERTIES:
  :ARCHIVE: basement_archive::* A
  :END

** AA
** AB
** AC

then C-c $ on AA AB and AC will archive them under the * A subtree
of the basement_archive file.


Hey,

sorry for that reply after a long time.

Problem is that this kind of archivement does not fit my workflow. I 
tend to archive small pieces of a project's subtree long before I'm 
ready to archive the entire project. This way I build (want to build) an 
archived mirror of the project's subtree bit by bit.


Do you know what is the appropriate place to file such an feature as a 
whishlist item? M-x org-submit-bug-report RET ?


Thx,
Florian





[O] Archive subtree with parent structure

2014-04-15 Thread Florian Lindner

Hello,

is it possible to org-archive-subtree a subtree and keep the entire 
parent structure? e.g.


* A
** AA
** AB
** AC


AB will be archived to:

* A
** AB


Another question, just out of interest: Why is there 
org-archive-subtree-default at all? According to documentation and 
source it just calls the function in org-archive-default-command:


(defun org-archive-subtree-default ()
  Archive the current subtree with the default command.
This command is set with the variable `org-archive-default-command'.
  (interactive)
  (call-interactively org-archive-default-command))

Isn't the emacs way to rather just set org-archive-subtree to another 
function or rebind the key? Just a question from an interessted emacs 
novice.


Best Regards,
Florian



[O] Electric-indent-mode and lists

2014-01-25 Thread Florian Lindner
Hello,

Emacs 24.3.1 on Arch.

emacs -Q
M-x electric-indent-mode
C-x C-f some/nonexistent/file.org

Now entering

* abc
  + a
+ b
  + c

Each list entry is idented furthermore. I doesn't happen if I use M-Ret to 
enter a list item.

Or is this behavior intended?

Thanks!
Florian



[O] PROPERTIES added when cycling state

2012-06-26 Thread Florian Lindner
Hello,

recently (I think it could be after the emacs 24 update) I have a
behavior of org-mode that it adds some PROPERTIES drawer when cyling
the state TODO/DONE/ I was not really able to reproduce that. I'm
not using todo inter-dependencies or alike so I see no reason why that
should be needed.

** TODO pfcbcreator an neue Templates anpassen
:PROPERTIES:
:ID: 6d054c0d-905d-42d4-b748-1c5072bc6bea
:END:

My org-mode config is:

(setq org-directory ~/Dropbox/org/)
(setq org-agenda-files '(~/Dropbox/org/))
(setq org-mobile-directory ~/Dropbox/org/mobile/)
(setq org-mobile-inbox-for-pull ~/Dropbox/org/mobile.org)
(setq org-log-done t)
(setq org-startup-indented t)

How can I stop that?

Thanks,

Florian