Re: [O] Problem with hourly repeater

2012-10-10 Thread Martin Pohlack
Hi,

This has been discussed several times before and the conclusion was that
hourly repeaters are not supported:

http://www.mail-archive.com/emacs-orgmode@gnu.org/msg20032.html
http://www.mail-archive.com/emacs-orgmode@gnu.org/msg15142.html

On 08.10.2012 16:37, Memnon Anon wrote:
 Hi, 
 
 I am trying the hourly repeaters and see a problem.
 
 Steps to reproduce:
 * emacs -Q
 * load minimal setup:
 
 --8---cut here---start-8---
 ;;; adjust path as needed!
 (setq load-path (cons ~/org-mode/lisp load-path))
 (setq load-path (cons ~/org-mode/contrib/lisp load-path))
 (setq load-path (cons ~/org-mode/contrib/babel/lisp load-path))
 (require 'org)
 (setq org-clock-persist t)
 (org-clock-persistence-insinuate)
 (setq org-clock-history-length 50
   org-clock-in-switch-to-state STRT
   org-clock-idle-time 5
   org-log-done 'time
   org-log-reschedule 'time
   org-log-into-drawer LOGBOOK)
 
 (setq org-agenda-files (quote (~/agenda.org)))
 (setq debug-on-error t)
 --8---cut here---end---8---
 
 * Minimal agenda file ~/agenda.org:
 
 --8---cut here---start-8---
 #+SEQ_TODO: TODO STRT | DONE DEFD CNCL
 
 * TODO Test
   Scheduled: 2012-10-08 Mo 18:00 +6h
 --8---cut here---end---8---
 
 * M-x org-agenda a -
 Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p
 nil)
 [...]
 
 This is with
 Org-mode version 7.9.2 (release_7.9.2-424-g0ccf65 @ 
 and 
 GNU Emacs 24.2.50.1 (i486-pc-linux-gnu, GTK+ Version 3.4.2) of
 2012-10-04 on dex, modified by Debian
 
 Anyone else see this?
 
 Memnon
 
 


-- 
Martin Pohlack, AMD Operating System Research Center
martin.pohl...@amd.com, Tel. +49 351 448356721, www.amd64.org

Advanced Micro Devices GmbH, Einsteinring 24,
85609 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632, WEEE-Reg-Nr. DE 12919551



Re: [O] new tag query parser [1/5] -- the motivating issues

2012-08-18 Thread Martin Pohlack
Hi Christopher,

If I understand your descriptions correctly, your proposed changes are
very cool.

Could you elaborate a little bit on performance?

* Are we going to see speedups?  In what cases?  How much?

* If we lose performance, could you quantify that a bit with some examples?

A question regarding backwards compatibility (I might have missed that
in the description, sorry):  Are you converting existing queries on the
fly each time, or do we have to convert our queries once?  If yes, is
there some assisting code?

Thanks,
Martin




Re: [O] Using org-mode as day planner

2012-08-13 Thread Martin Pohlack
On 12.08.2012 17:48, John Hendy wrote:
 On Sat, Aug 11, 2012 at 4:34 AM, Bastien b...@gnu.org wrote:
 Hi John,

 John Hendy jw.he...@gmail.com writes:

 Date trees are the obvious way to be able to do this, but they don't
 have any of the neat search functionality that I know of.

 Can you describe the search functionality you would like for date-trees?
 I'm not sure I groked it.
 
 Date trees allow for a very nice way for filing notes in chronological
 order, but =C-c / dateRange= does not work for date trees. Previously,
 active time stamps worked, but I didn't want all my notes showing up
 in my agenda, so I just dealt with not having a great solution. Then
 you provided one with the sparse-tree search timestamp-type selection
 ability, which rocks.
 
 Date trees are still the best way to use capture for foolproof
 chronological storage of notes quickly... but I wouldn't be able to
 extract notes in a particular date-range with current functionality.

Hi John,

I have a very similar use case.  I capture all my stuff into a date tree
and for my weekly report I parse that and extract a subset.  It looks a
bit crude (hardcoded stuff for my setup) but works for now.  I must say
that date-trees in their current form feel a bit un-org-mody as they use
a completely different data format:

--

(defun mp26/org-find-headline-prefix-in-buffer (heading optional buffer
pos-only)
  Find node with heading-prefix HEADING in BUFFER.
Return a marker to the heading if it was found, or nil if not.
If POS-ONLY is set, return just the position instead of a marker.

The heading prefix must match as prefix of the full headline.  It
may have a TODO keyword, a priority cookie and tags in the
standard locations.
  (with-current-buffer (or buffer (current-buffer))
(save-excursion
  (save-restriction
(widen)
(goto-char (point-min))
(let (case-fold-search)
  (if (re-search-forward
   (format org-complex-heading-regexp-format
   (concat (regexp-quote heading) .*)) nil t)
  (if pos-only
  (match-beginning 0)
(move-marker (make-marker) (match-beginning 0)

; fixme: optional parameter for starting date
(defun mp26/org-week-from-journal ()
  Insert a copy of the current week from the journal.
  (interactive)
  (insert
   (mapconcat
'identity
(with-current-buffer Journal.orgDaten
  (loop for days in '(-6 -5 -4 -3 -2 -1 0)
collect
(let* ((date (calendar-current-date days))
   (date-string
(format %d-%02d-%02d
(nth 2 date) (nth 0 date) (nth 1 date
  (setq pos (mp26/org-find-headline-prefix-in-buffer
 date-string nil t))
  (when pos
(goto-char pos)
(org-copy-subtree)
(car kill-ring)
   )))

--




[O] bug#11774: bug#11774: org-mode causes undo boundaries to be lost

2012-07-03 Thread Martin Pohlack
On 03.07.2012 11:57, Toby Cubitt wrote:
 On Mon, Jul 02, 2012 at 08:51:48AM +0200, Martin Pohlack wrote:
 I'm still not entirely convinced that the boundary discarding logic in
 org-self-insert-command is correct. For example, if I do the following:

 1. Type some text at some location in an org-mode buffer
 2. Move to another location very far away
(without invoking any commands other than point motion)
 3. Type some more text

 then org-self-insert-cluster-for-undo collapses the undo changesets for
 these two changes into one. Undoing then reverts both sets of changes at
 once, even though those changes might be so far apart that they aren't
 both visible at the same time in the buffer.

 That seems very undesirable to me.

 Having been involved in org-mode's collapsing code I am interested in
 this, but I cannot reproduce your problem.  I used a very large org-mode
 file, inserted some text, moved down some pages and inserted some text
 again (3 chars each).  Undoing was split between both parts, exactly as
 desired.  Could you provide more details please?
 
 
 Sure. The following steps produce the effect I described, at least for
 me. This is on a fairly recent (a couple of weeks old) bzr build of
 Emacs, and a similarly recent git build of org-mode:
 
 1. $ emacs -Q
 2. C-x C-f test.org
 3. M-x org-mode   [not really necessary since already in org-mode]
 5. C-u 50 M-x newline
 6. M-
 7. type a
 8. M-
 9. type bc
 
 buffer-undo-list now contains:
 
 (nil (52 . 54) (1 . 2) nil (1 . 51) (t . -1))
 
 Note the lack of undo boundary between (52 . 54) and (1 . 2), which means
 that undoing once (C-/) deletes both bc *and* a in one step.

Understood.  I tried exactly the same thing with an older emacs (GNU
Emacs 23.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.4) of 2011-04-04 on
crested, modified by Debian) and org-mode (6.33x and 7.6) and have this
result:

(nil (53 . 54) (52 . 53) nil (1 . 2) nil (1 . 51) (t 65535 . 65535))

Which is what one wants.  Someone seems to be merging the self-insert
commands in your situation.  Probably the native merging code has
changed in recent emacs itself.

If this is confirmed, we could modify org-mode's merging code to only
merge undo entries that span one character.

Martin






[O] bug#11774: bug#11774: org-mode causes undo boundaries to be lost

2012-07-03 Thread Martin Pohlack
On 25.06.2012 13:35, Toby Cubitt wrote:
 On Sun, Jun 24, 2012 at 11:52:41PM +0200, Toby Cubitt wrote:
 On Sun, Jun 24, 2012 at 11:39:08PM +0200, Bastien wrote:
 Hi Toby,

 Toby Cubitt ts...@cantab.net writes:

 For some unknown reason, org-mode is causing the undo boundary between
 the (2 . 4) and (1 . 2) entries to be removed from `buffer-undo-list'.

 Can you try again with

   (setq org-self-insert-cluster-for-undo nil)

 and report?

 Yup, that fixes the problem.

 I don't fully understand the purpose of
 `org-self-insert-cluster-for-undo', given that the Emacs command loop
 already groups consecutive undo entries together, but presumably it
 enables a more aggressive form of clustering.

Just to clarify this little piece here: I originally introduces this
clustering code to mimic emacs' behavior in text mode.  Org-mode's
aggressive interception seemed to prevent that and undoing in org-mode
felt unnatural compared to vanilla text mode.  It was never meant to be
*more* aggressive than emacs' original behavior.

The grouping did not happen at the time.  The original thread is here:

http://lists.gnu.org/archive/html/emacs-orgmode/2009-02/msg00691.html

Martin





[O] bug#11774: bug#11774: org-mode causes undo boundaries to be lost

2012-07-02 Thread Martin Pohlack
Hi Toby,

On 25.06.2012 13:35, Toby Cubitt wrote:
 On Sun, Jun 24, 2012 at 11:52:41PM +0200, Toby Cubitt wrote:
 On Sun, Jun 24, 2012 at 11:39:08PM +0200, Bastien wrote:
 Hi Toby,

 Toby Cubitt ts...@cantab.net writes:

 For some unknown reason, org-mode is causing the undo boundary between
 the (2 . 4) and (1 . 2) entries to be removed from `buffer-undo-list'.

 Can you try again with

   (setq org-self-insert-cluster-for-undo nil)

 and report?

 Yup, that fixes the problem.

 I don't fully understand the purpose of
 `org-self-insert-cluster-for-undo', given that the Emacs command loop
 already groups consecutive undo entries together, but presumably it
 enables a more aggressive form of clustering.

 [snip]

 I could try to work around this in undo-tree-mode, but it seems to me
 that org-mode shouldn't be throwing away an undo boundary that comes
 before an entry which definitely shouldn't be clustered with anything
 (namely the undo-tree-canary symbol, which is meaningless to org-mode).
 
 I've now added a work-around for this in undo-tree-mode (currently only
 in git, but I'll push to ELPA once it's sufficiently tested).
 
 I'm still not entirely convinced that the boundary discarding logic in
 org-self-insert-command is correct. For example, if I do the following:
 
 1. Type some text at some location in an org-mode buffer
 2. Move to another location very far away
(without invoking any commands other than point motion)
 3. Type some more text
 
 then org-self-insert-cluster-for-undo collapses the undo changesets for
 these two changes into one. Undoing then reverts both sets of changes at
 once, even though those changes might be so far apart that they aren't
 both visible at the same time in the buffer.
 
 That seems very undesirable to me.

Having been involved in org-mode's collapsing code I am interested in
this, but I cannot reproduce your problem.  I used a very large org-mode
file, inserted some text, moved down some pages and inserted some text
again (3 chars each).  Undoing was split between both parts, exactly as
desired.  Could you provide more details please?

Thanks,
Martin





Re: [O] Compose emails in ogr, but send them via thunderbird?

2012-04-05 Thread Martin Pohlack
On 05.04.2012 11:33, Rainer M Krug wrote:
 id definitely does. I have implemented it and am playing at the moment with 
 the external editor
 (combined with the message-mode and the get_address.sh script) and it looks 
 quite nice at the
 moment.

Here is a link to external editor:
* http://globs.org/articles.php?lng=enpg=2

Here is a link to a small mode that I use for composing email in emacs
that I later send with thunderbird:
* http://os.inf.tu-dresden.de/~mp26/download/tbemail.el

HTH,
Martin



Re: [O] Date-tree navigation question

2012-03-09 Thread Martin Pohlack
Hi Robert,

Not sure what you want to do after opening but I have some code that
extracts a time range out of a date tree.  Maybe you can reuse the
searching parts ...

Cheers,
Martin

--
(defun mp26/org-find-headline-prefix-in-buffer (heading optional buffer 
pos-only)
  Find node with heading-prefix HEADING in BUFFER.
Return a marker to the heading if it was found, or nil if not.
If POS-ONLY is set, return just the position instead of a marker.

The heading prefix must match as prefix of the full headline.  It
may have a TODO keyword, a priority cookie and tags in the
standard locations.
  (with-current-buffer (or buffer (current-buffer))
(save-excursion
  (save-restriction
(widen)
(goto-char (point-min))
(let (case-fold-search)
  (if (re-search-forward
   (format org-complex-heading-regexp-format
   (concat (regexp-quote heading) .*)) nil t)
  (if pos-only
  (match-beginning 0)
(move-marker (make-marker) (match-beginning 0)

(defun mp26/org-week-from-journal ()
  Insert a copy of the current week from the journal.
  (interactive)
  (insert
   (mapconcat
'identity
(with-current-buffer Journal.orgDaten
  (loop for days in '(-6 -5 -4 -3 -2 -1 0)
collect
(let* ((date (calendar-current-date days))
   (date-string
(format %d-%02d-%02d
(nth 2 date) (nth 0 date) (nth 1 date
  (setq pos (mp26/org-find-headline-prefix-in-buffer
 date-string nil t))
  (when pos
(goto-char pos)
(org-copy-subtree)
(car kill-ring)
   )))
--



[O] org-remember - org-capture: % functionality

2012-02-03 Thread Martin Pohlack
Hi,

org-remember templates could contain a % to jump to target location
immediately after storing note.

I can't find a similar thing for org-capture.  Is there a trick /
official way to achieve a similar effect with org-capture?

I like to tweak some entry in their context after capturing.

Thanks,
Martin



Re: [O] org-remember to org-capture

2012-01-28 Thread Martin Pohlack
Hi Bastien,

thanks for your reply.

On 28.01.2012 17:00, Bastien wrote:
 Hi Martin,
 
 Martin Pohlack m...@os.inf.tu-dresden.de writes:
 
 I am in the process of switching from org-remember to org-capture.
 
 Possibly useless hint: M-x org-capture-import-remember-templates RET

Yes thanks.  Unfortunately, this does not convert my custom function :-).

In fact, it does not convert anything (with org-mode 7.6).

 Can you restate the problem more directly?  What are your capture
 template, what is it supposed to achieve, how does it fail to do 
 what you want -- we'll work out something from there.

All right, here is my (stripped down) setup:

 '(org-remember-templates (quote (
   (Inbox-Arbeit 97 * INBOX %^{Title}
  %U%?
  %i ~/Daten/plan_arbeit.org my-org-remember-headline nil)
   (Inbox-Privat 112 * INBOX %^{Title}
  %U%?
  %i ~/Daten/plan_privat.org my-org-remember-headline nil)
   (Journal 106 * %^{Eintrag}%?%i% ~/Daten/Journal.org
return_formated_date nil

Let' focus on the first entry (Inbox-Arbeit): the only non-standard
thing here is the function my-org-remember-headline.

8
(defun my-host-name ()
  Returns the name of the current host minus the domain.
  (let ((hostname (downcase (system-name
(save-match-data
  (substring hostname (string-match ^[^.]+ hostname) (match-end 0)

(defun my-org-remember-headline ()
  (concatenate 'string Inbox: (my-host-name)))
8

Run on “host1” it will return “Inbox:host1”, etc.

My “plan_arbeit.org” file contains this structure:

8
* Inbox
*** Inbox:host1
*** Inbox:host2
8

So that each machine has a separate inbox under a global container.
This reduces git merge conflicts when I merge my plan files from
different machines (but this is a side discussion).

What changed from org-remember to org-capture is that custom functions
used to return a string with a target parent headline.  Now they are
expected to modify “point” as a side effect before the actual capturing
happens (and not return anything).

Here is my new capture template:

 '(org-capture-templates (quote (
   (a Inbox-Arbeit entry
(file+function ~/Daten/plan_arbeit.org my-org-capture-function)
* INBOX %^{Title}
  %U%?
  %i

I drafted this new function for org-capture:

8
(defun my-org-capture-function ()
  (goto-char
   (org-find-exact-headline-in-buffer
(concatenate 'string Inbox: (my-host-name)) nil t))
  (org-end-of-line)
  (org-insert-subheading ))
8

This shall capture again under “Inbox/Inbox:$hostname”.

The function feels clumsy because this functionality should already be
in org-mode (e.g., the refiling stuff).  Also, it files new items as
first child under the target and not as last child.

The question is simply: Is there a more elegant approach, maybe using
the refiling mechanism?  Have I overlooked something obvious?

Thanks,
Martin



[O] org-remember to org-capture

2012-01-27 Thread Martin Pohlack
Hi,

I am in the process of switching from org-remember to org-capture.

I used a custom function with org-remember to capture into a
host-specific sub-tree under * Inbox in order to minimize git merge
conflicts between my machines.

My tree typically looks like this:

* Inbox
*** Inbox:host1
* INBOX idea 1
* INBOX idea 2
*** Inbox:host2
* INBOX idea 3

The custom function with org-remember only needed to create the target
headline's name.  Org-remember would find it or create it (IIRC):

8
(defun my-host-name ()
  Returns the name of the current host minus the domain.
  (let ((hostname (downcase (system-name
(save-match-data
  (substring hostname (string-match ^[^.]+ hostname) (match-end 0)

(defun my-org-remember-headline ()
  (concatenate 'string Inbox: (my-host-name)))
8

The problem is now that org-capture expects a function that creates
the target node and positions point at a child of the target, is this
correct?

My hacky solution is to use the file+function template and looks like
this:

8
(defun my-org-capture-function ()
  (goto-char
   (org-find-exact-headline-in-buffer
(concatenate 'string Inbox: (my-host-name)) nil t))
  (org-end-of-line)
  (org-insert-subheading ))
8

But it looks clumsy and always inserts as first child.  Is there a
more elegant approach, maybe using the refiling mechanism?

Thanks,
Martin



Re: [O] [PATCH] Implement priority inheritance for agenda views.

2011-11-21 Thread Martin Pohlack
Hi All,

On 26.05.2011 14:21, Michael Hohmuth wrote:
 * lisp/org.el (org-use-prio-inheritance): New customizable for using
 priority inheritance in agenda views.  Defaults to off
 (org-get-priority-char): Factored out from org-get-priority.  Return
 priority token from headline, defaulting to an optional fallback or
 org-default-priority.
 (org-get-priority): Use org-get-priority-char. Default to an optional
 fallback or org-default-priority.
 (org-scan-tags): Assign and display priority according to
 org-use-prio-inheritance.
 ---
 This patch can be pulled from branch prio-inherit at
 git://github.com/altruizine/org-mode.git .
 
 I am aware that priority inheritance for to-do items has been
 requested and rejected in the past, on the grounds of inherited
 priorities allegedly inflating the number of assigned priorities,
 thereby defeating the purpose of priorities.  Well, I disagree, as I
 have found inherited priorities useful in practice.

I would be interested in this functionality.  What is needed to merge this?

Thanks,
Martin



Re: [Orgmode] How to align tag to the right margin

2010-12-07 Thread Martin Pohlack
On 07.12.2010 21:48, Chao LU wrote:
 Hi Eric,
 
 Yes, it works, by (setq org-tags-column 90). But new question arise, it does
 not apply to the tags which have already been there (only new tags after the
 modification of the alignment number), so how could I get all the tags
 updated?

org-align-all-tags, should be bound to c-u c-u c-c c-c.

HTH,
Martin

___
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: [Orgmode] [PATCH] Apply patch for hour/minute repeater support

2010-09-15 Thread Martin Pohlack
On 14.09.2010 19:06, Andrew J. Korty wrote:
 This patch adds hour and minute granularity to repeaters.  Let me know 
 if there's interest in incorporating it, and I'll start the FSF 
 paperwork process.

There was a related discussion here:

http://www.mail-archive.com/emacs-orgmode@gnu.org/msg15142.html

Cheers,
Martin

___
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: [Orgmode] Backspacing into folded items

2010-09-03 Thread Martin Pohlack

Hi Bastien

On 03.09.2010 02:02, Bastien wrote:

Hi Martin,

Martin Pohlackm...@os.inf.tu-dresden.de  writes:


* You could add a modification hook to all hidden areas to unfold them
   on modification, or
* You could set the read-only property for all hidden areas.  This could
   be setup at the same location where hiding is done.


I'm interested in testing both solutions, as I often delete hidden text
by accident as well.

Can you give more details on how to set this up?


These were just quick ideas, I have no working code here.

Let me quickly draft something up:
* If you want to go for the modification hook:
  You could do something very similar to what I did here:
  http://patchwork.newartisans.com/patch/31/

  You would have to find all places again where the hidden property is
  set.  There you would also add the modification hook.

  The hook would be the place to remove the hidden property again.
  You might have to have some policy in there, for example, to only
  uncover a single headline at a time etc.  I am not sure if hidden
  areas are merged and at what granularity the property is set.

  Later, you might stumble upon code that tries to modify in hidden
  areas under the hood and you don't want all the text to be uncovered
  by such actions.  You should then bind inhibit-modification-hooks
  in these functions.

* If you want to go for the read-only property:
  You would have to find all places where the hidden property for
  regions is set or unset and also set or unset the read-only
  property there.

  In theory.

  There may exist code that wants to modify text blocks that are
  hidden.  In this code, you would have to temporarily remove the
  read-only property (not sure if there is a way to override it).

  You may also get into trouble modifying text directly next to a
  read-only area because of stickiness

(http://www.gnu.org/software/emacs/elisp/html_node/Sticky-Properties.html#Sticky-Properties).
  I just found this in the manual, not sure if this is a problem in
  practice.

HTH,
Martin

___
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: [Orgmode] Backspacing into folded items

2010-08-25 Thread Martin Pohlack
Hi David,

On 25.08.2010 11:22, David Abrahams wrote:
 I've gotten myself in trouble several times today by backspacing after
 an org-link that ends a headline.  That's a typical pattern for
 editing an org-link, right?  Well it turns out that if the item is
 folded, then the backspace writes over the end of the un-folded item
 but **appears to have no effect**, and you can easily hit backspace
 several times to test your sanity before you realize that something is
 wrong, badly corrupting your file.

I have had similar such accidents, but not involving links.  You
probably backspaced into the ...?

 Seems to me that attempts to edit a folded item should either:
 
 a) restrict changes to the item's headline, or
 b) unfold the item and do nothing
 
 Is there a way to set that up?

Just two quick ideas from me here:
* You could add a modification hook to all hidden areas to unfold them
  on modification, or
* You could set the read-only property for all hidden areas.  This could
  be setup at the same location where hiding is done.

See also here:
http://www.gnu.org/software/emacs/elisp/html_node/Special-Properties.html#Special-Properties

I proposed a patch for image overlay which show a related problem here:
http://patchwork.newartisans.com/patch/31/

Cheers,
Martin

___
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: [Orgmode] Re: skip entry with inherited tags

2010-08-16 Thread Martin Pohlack

Hi Carsten,

[...]


The internal logic of the filter and the preset filter is such that
it applies to the entire view, and you should not set in the local
options for a command that is part of a block agenda view.


Well, it is already partly there in that local filters are stored in
text properties for each line.  Maybe we can extend this a bit to
remove
this limitation?


I think this will be tidious.


Yes, I saw this on my first attempts to look at the code :-).  I have 
not yet given up on this though ...



For block agendas, I guess a skip
condition will be better than filtering.


This does not help with inherited tags, AFAIK.  For example, if I mark a 
whole tree of things with :maybe:, the inheriting items in the tree 
cannot easily be skipped.


Cheers,
Martin

___
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: [Orgmode] Re: skip entry with inherited tags

2010-08-04 Thread Martin Pohlack
Hi Carsten,

On 22.07.2010 09:38, Carsten Dominik wrote:
 Hi Martin,
 
 On Jul 21, 2010, at 4:32 PM, Carsten Dominik wrote:
 
 Hi Martin,

 I just looked at your patch.

 If I have a normal agenda (i.e. *not* a block agenda), then your
 patch will cause the preset filter *not* to be applied.
 
 OK, that was obviously incorrect, sorry about that.
 
 However, it still does not work correctly, here is the counter example:
 
 -
 * TODO test 1   :a:
 * TODO test 2   :b:
 
 * at 1
   :a:
SCHEDULED: 2010-07-22 Thu
 * at 1
   :b:
SCHEDULED: 2010-07-22 Thu
 --

Here is what I found to be incorrect.

* For unmodified org-mode, this ignores the org-agenda-filter-preset.
  Is this what you mean or is anything else broken?

* For my patched version, too much is hidden and only revealed after
  clearing the global filter.  Did you mean anything else?

 With this custom command:
 
 (setq org-agenda-custom-commands
'((x testmartin
((agenda  ((org-agenda-filter-preset '(+a
 (alltodo  ((org-agenda-filter-preset '(+b)
nil nil)))
 
 the result is incorrect, both with and without your patch.

But in different ways, as state above.

 The internal logic of the filter and the preset filter is such that
 it applies to the entire view, and you should not set in the local
 options for a command that is part of a block agenda view.

Well, it is already partly there in that local filters are stored in
text properties for each line.  Maybe we can extend this a bit to remove
this limitation?

I will look into it if I have more time.

Cheers,
Martin

___
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: [Orgmode] Re: skip entry with inherited tags

2010-07-13 Thread Martin Pohlack
Hi Carsten,

On 13.07.2010 13:49, Carsten Dominik wrote:
 Sorry for taking so much time for this.
 I am still holding the patch because I have an almost unconscious itch
 that something is wrong with it.  I cannot say what exactly it is
 (if anything).  The logic of what needs to be done when in
 block agendas has some reason.  One of the things I can say already
 it that with such a local filter, I am afraid that updating the
 agenda, or modifying the filter might fail or lead to strange results.
 This is actually something you might want to work on testing.

Hard to respond to this vague situation :-).

It would be great if you could point me at more specific situations that
might break or if others could test the patch.  I have been using it for
more than a month now without problems.

 I will only be able to study this more closely after the release.

Take your time, I will wait for more details to emerge or feedback from
other testers.

One more note here: The current situation for block agendas is a bit
problematic as their limitations are not documented afaik.

Writing custom agendas is not easy in itself.  If things don't work, it
is really hard to distinguish between driver errors and limitations of
the block agendas.

Cheers,
Martin

___
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: [Orgmode] Re: skip entry with inherited tags

2010-07-13 Thread Martin Pohlack
Hi Carsten and Matt,

On 13.07.2010 20:48, Carsten Dominik wrote:
 On Jul 13, 2010, at 7:41 PM, Martin Pohlack wrote:
 Hard to respond to this vague situation :-).

 It would be great if you could point me at more specific situations  
 that
 might break or if others could test the patch.  I have been using it  
 for
 more than a month now without problems.
 
 The specific one I meant is if you use r or g to rebuild the agenda,
 if you do something like a refile command which does an automatic  
 rebuild,
 do you get back the view you expected?

Yes, I regularly use 'r'.  It works for me.  Refiling a single entry did
not show a problem.

 Also, if you apply other filter commands, either with /, or narrowing
 the filter with /, does that give the expected results while you are
 in your block agenda?

I quickly applied a tag filter using '/' 'tab'.  Only the relevant
entries were shown.  Some block agendas become empty as expected.
Clearing the filter restores the expected full view.

I am not entirely sure that the patch does not have problems though.

Matt: could you give the patch a quick test at your end?

 I will only be able to study this more closely after the release.

 Take your time, I will wait for more details to emerge or feedback  
 from
 other testers.

 One more note here: The current situation for block agendas is a bit
 problematic as their limitations are not documented afaik.

 Writing custom agendas is not easy in itself.  If things don't work,  
 it
 is really hard to distinguish between driver errors and limitations of
 the block agendas.
 
 Do you have suggestions on how to improve the situation?

* Well, the best thing to do would be to remove the limitations of the
  block agendas, obviously :-), which I hope this patch does.

* The second best thing is to document them.

I am aware of this tag filter limitation, but no others from the top of
my head.  Do others know more?

Cheers,
Martin

___
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: [Orgmode] Re: skip entry with inherited tags

2010-07-07 Thread Martin Pohlack

Hi Carsten,

On 04.06.2010 14:11, Martin Pohlack wrote:

On 04.06.2010 13:27, Carsten Dominik wrote:

Hi Martin,

maybe you can summarize this discussion so that I can see when should
be done?  Thanks.


* org-agenda-filter-preset is ignored for multi-part agendas (broken)
* I have a patch that fixes this by applying filtering for each sub-part
* The patch works for me


May I inquire the state of this item?

The patch seems to have vanished from the default view in patchwork it 
is only shown here:


http://patchwork.newartisans.com/project/org-mode/list/?archive=both

But it is still Under Review by you.

Do you need assistance with the patch?

Cheers,
Martin

___
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: [Orgmode] Question: org-remember and level1 target headline [resent]

2010-06-22 Thread Martin Pohlack
On 22.06.2010 15:38, Martin Pohlack wrote:
 Is there documentation for migrating from org-remember or will there be
 once org-capture shows up in the manual?

Never mind the question, I just saw the exhaustive other mail describing
org-remember :-).

Cheers,
Martin

___
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: [Orgmode] Question: org-remember and level1 target headline [resent]

2010-06-22 Thread Martin Pohlack
On 22.06.2010 14:54, Carsten Dominik wrote:
 Hi Martin,
 
 I am rejecting this patch, but only because because I think this issue
 is taken care of in org-capture.el   Let me know if you do not agree.

The documentation for outline path looks promising.  Even header paths
are supported -- nice!

Is there documentation for migrating from org-remember or will there be
once org-capture shows up in the manual?

Cheers,
Martin

___
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: [Orgmode] Both todo and tag search

2010-06-18 Thread Martin Pohlack
Hi,

On 18.06.2010 06:40, Chao Lu wrote:
 For the custom agenda command, is it possible to define a search performing
 both todo and tag search, for example, the items whose todo state is ACTIVE,
 and the context(defined by tag) is Office?

Yes, that should be possible.  These two threads may provide valid
examples how to to this:

  http://www.mail-archive.com/emacs-orgmode@gnu.org/msg21269.html

  http://www.mail-archive.com/emacs-orgmode@gnu.org/msg25260.html

A lot of information is also in the manual:

  http://orgmode.org/org.html#Agenda-Views

HTH,
Martin

___
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: [Orgmode] Re: skip entry with inherited tags

2010-06-04 Thread Martin Pohlack

On 04.06.2010 13:27, Carsten Dominik wrote:

Hi Martin,

maybe you can summarize this discussion so that I can see when should
be done?  Thanks.


* org-agenda-filter-preset is ignored for multi-part agendas (broken)
* I have a patch that fixes this by applying filtering for each sub-part
* The patch works for me

Cheers,
Martin

___
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] Re: skip entry with inherited tags

2010-06-03 Thread Martin Pohlack
Hi All,

I finally found some hours to walk through the code.

On 18.05.2010 19:25, Matt Lundin wrote:
 Martin Pohlack m...@os.inf.tu-dresden.de writes:
 
 Hi,

 On 18.05.2010 09:42, Matthias Teege wrote:
 Moin,

 I'm using a simple skip-function to exclude todos from a list.

 (defun my-skip-someday-and-scheduled ()

   (org-agenda-skip-entry-if 'scheduled 'regexp :SOMEDAY:))

 That works when the tag was assigned to an entry but not when it was
 inherited from a parent. How do I get all tags for an entry?

 I have been using the same approach with the same limitations.  I
 stumbled upon the tags filter preset, which supposedly should filter
 out headlines with a specific tag set.

 I tried to set it to -maybe but it did not seem to have an effect
 with the default Agenda type.  Is this supposed to work?
 
 Did you set the variable as a list? 
 
 --8---cut here---start-8---
 (setq org-agenda-custom-commands
   '((x No maybe todo 
((org-agenda-filter-preset '(-maybe))
 --8---cut here---end---8---
 
 BTW, I believe one solution to the original question is:
 
 --8---cut here---start-8---
 (setq org-agenda-custom-commands
   '((x No scheduled or someday todo 
((org-agenda-todo-ignore-scheduled t)
 (org-agenda-filter-preset '(-SOMEDAY))
 --8---cut here---end---8---

Thanks for your suggestion Matt.

I now think the problem is that I have a multi-agenda.

org-finalize-agenda is called for each subagenda here but the branch
where org-agenda-filter-apply would be called is never taken as it is
scoped with unless org-agenda-multi.  I have also found no other
non-interactive trigger for org-agenda-filter-apply.

I see two possible solutions here:
* Run org-agenda-filter-apply on a narrowed agenda buffer (only for
  the sub-agenda).  In fact, the agenda buffer seems to be narrowed
  down at this point already.  This would be the perfect solution as
  each sub-agenda could install its own org-agenda-filter-preset.

  Find attached a patch which achieves this.  It seems to work well for
  my short tests.

* Run org-agenda-filter-apply once for the whole buffer with a global
  org-agenda-filter-preset.  This would be mostly ok for some use cases
  (I only want to globally remove all maybe entries, including the
  inherited ones).

Cheers,
Martin
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 19ea87c..033c981 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2760,7 +2760,9 @@ bind it in the options section.)
 
 (defun org-finalize-agenda ()
   Finishing touch for the agenda buffer, called just before displaying it.
-  (unless org-agenda-multi
+  (if org-agenda-multi
+  (when (get 'org-agenda-filter :preset-filter)
+(org-agenda-filter-apply org-agenda-filter))
 (save-excursion
   (let ((inhibit-read-only t))
(goto-char (point-min))
___
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] [PATCH] add modification hook for inline images

2010-06-01 Thread Martin Pohlack
Hi,

this patch adds a modification hook to remove inline-image overlays if
the underlying text is modified.  This prevents blind editing of text
behind images.

Cheers,
Martin Pohlack
diff --git a/lisp/org.el b/lisp/org.el
index 62131be..5a00236 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15565,8 +15565,17 @@ BEG and END default to the buffer boundaries.
(overlay-put ov 'display img)
(overlay-put ov 'face 'default)
(overlay-put ov 'org-image-overlay t)
+   (overlay-put ov 'modification-hooks
+(list 'org-display-inline-modification-hook))
(push ov org-inline-image-overlays)
 
+(defun org-display-inline-modification-hook (ov after beg end optional len)
+  Remove inline-display overlay if a corresponding region is modified.
+  (let ((inhibit-modification-hooks t))
+(when (and ov after)
+  (delete ov org-inline-image-overlays)
+  (delete-overlay ov
+
 (defun org-remove-inline-images ()
   Remove inline display of images.
   (interactive)
___
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: [Orgmode] Question: org-remember and level1 target headline [resent]

2010-05-27 Thread Martin Pohlack

[resending to get into the patch tracker]

Hi,

On 15.05.2010 08:42, Carsten Dominik wrote:

On May 14, 2010, at 5:42 AM, Samuel Wales wrote:

On 2010-05-13, Martin Pohlackm...@os.inf.tu-dresden.de  wrote:

Is there interest to define remember targets via paths or via ID?


ID would be useful, I think.


ID certainly - path could be useful to avoid ambiguities.


Please find attached a first version of a patch adding support for IDs
as remember targets.

Feedback welcome.

Cheers,
Martin
This patch adds support for specifying the ID of a target headline.

Open issues:
* Using a cons cell seems a bit ugly.  A string would be fine too but
  this is already used by the headline itself in the choice element.
* The visual appearance of the ID choice is suboptimal.  Is there any
  way to hide the const visually?
* The comments in the remember buffer seems to be setup wrong, where
  must I hook in to support IDs there?

diff --git a/home/mpohlack/src/org-mode/lisp/org-remember.el b/org-remember.el
index 59e015f..a0dbac4 100644
--- a/home/mpohlack/src/org-mode/lisp/org-remember.el
+++ b/org-remember.el
@@ -108,7 +108,8 @@ An optional fifth element can specify the headline in that file that should
 be offered first when the user is asked to file the entry.  The default
 headline is given in the variable `org-remember-default-headline'.  When
 this element is `top' or `bottom', the note will be placed as a level-1
-entry at the beginning or end of the file, respectively.
+entry at the beginning or end of the file, respectively.  You can also specify
+the `ID' of a target headline.
 
 An optional sixth element specifies the contexts in which the template
 will be offered to the user.  This element can be a list of major modes
@@ -195,7 +196,8 @@ calendar   |  %:type %:date
 		 (const :tag Use `org-remember-default-headline' nil)
 		 (const :tag At beginning of file top)
 		 (const :tag At end of file bottom)
-		 (const :tag In a date tree date-tree))
+		 (const :tag In a date tree date-tree)
+ (cons :tag ID (const :tag  ID) (string :tag ID)))
 		(choice :tag Context
 		 (const :tag Use in all contexts nil)
 		 (const :tag Use in all contexts t)
@@ -974,6 +976,10 @@ See also the variable `org-reverse-note-order'.
 		(org-datetree-find-date-create reference-date)
 		(setq reversed nil)
 		(setq org-goto-start-pos (point)))
+	   ((consp heading)
+		(setq org-goto-start-pos (org-find-entry-with-id (cdr heading)))
+(when (not org-goto-start-pos)
+  (error Target headline with ID '%s' not found (cdr heading
 	   ((and (stringp heading) (string-match \\S- heading))
 		(goto-char (point-min))
 		(if (re-search-forward


___
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: [Orgmode] Announce: Org-mode's Patchwork server up and running

2010-05-21 Thread Martin Pohlack

On 20.05.2010 23:29, John Wiegley wrote:

Any patches submitted to this mailing list are automatically registered for 
review at the following server:

 http://patchwork.newartisans.com/project/org-mode/list/


This sounds aweseome.

Are we supposed to resend patches or does it also cover the past?

Currently I'm not seeing any patches at:

http://patchwork.newartisans.com/project/org-mode/list/

Do I have to log in to see any?

Cheers,
Martin Pohlack

___
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: [Orgmode] Announce: Org-mode's Patchwork server up and running

2010-05-21 Thread Martin Pohlack

On 21.05.2010 11:59, John Wiegley wrote:

On May 21, 2010, at 5:28 AM, Martin Pohlack wrote:


Currently I'm not seeing any patches at:

http://patchwork.newartisans.com/project/org-mode/list/


Try:

   http://patchwork.newartisans.com/project/org-mode/list/?state=*archive=both


Ah thanks.  I didn't notice the Filters thingy.

Cheers,
Martin

___
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: [Orgmode] skip entry with inherited tags

2010-05-18 Thread Martin Pohlack

Hi,

On 18.05.2010 09:42, Matthias Teege wrote:

Moin,

I'm using a simple skip-function to exclude todos from a list.

(defun my-skip-someday-and-scheduled ()
   
  (org-agenda-skip-entry-if 'scheduled 'regexp :SOMEDAY:))

That works when the tag was assigned to an entry but not when it was
inherited from a parent. How do I get all tags for an entry?


I have been using the same approach with the same limitations.  I 
stumbled upon the tags filter preset, which supposedly should filter 
out headlines with a specific tag set.


I tried to set it to -maybe but it did not seem to have an effect with 
the default Agenda type.  Is this supposed to work?



Maybe this can help in your case:

For custom Tags search agenda entries I directly inline all relevant 
tag queries like so:


TODO=INBOX-maybe|TODO=WAIT-maybe+SCHEDULED=today|TODO=TICK-maybe+SCHEDULED=today

Cheers,
Martin

___
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: [Orgmode] Question: org-remember and level1 target headline

2010-05-18 Thread Martin Pohlack
Hi,

On 15.05.2010 08:42, Carsten Dominik wrote:
 On May 14, 2010, at 5:42 AM, Samuel Wales wrote:
 On 2010-05-13, Martin Pohlackm...@os.inf.tu-dresden.de  wrote:
 Is there interest to define remember targets via paths or via ID?

 ID would be useful, I think.

 ID certainly - path could be useful to avoid ambiguities.

Please find attached a first version of a patch adding support for IDs
as remember targets.

Feedback welcome.

Cheers,
Martin

This patch adds support for specifying the ID of a target headline.

Open issues:
* Using a cons cell seems a bit ugly.  A string would be fine too but
  this is already used by the headline itself in the choice element.
* The visual appearance of the ID choice is suboptimal.  Is there any
  way to hide the const visually?
* The comments in the remember buffer seems to be setup wrong, where
  must I hook in to support IDs there?

diff --git a/home/mpohlack/src/org-mode/lisp/org-remember.el b/org-remember.el
index 59e015f..a0dbac4 100644
--- a/home/mpohlack/src/org-mode/lisp/org-remember.el
+++ b/org-remember.el
@@ -108,7 +108,8 @@ An optional fifth element can specify the headline in that file that should
 be offered first when the user is asked to file the entry.  The default
 headline is given in the variable `org-remember-default-headline'.  When
 this element is `top' or `bottom', the note will be placed as a level-1
-entry at the beginning or end of the file, respectively.
+entry at the beginning or end of the file, respectively.  You can also specify
+the `ID' of a target headline.
 
 An optional sixth element specifies the contexts in which the template
 will be offered to the user.  This element can be a list of major modes
@@ -195,7 +196,8 @@ calendar   |  %:type %:date
 		 (const :tag Use `org-remember-default-headline' nil)
 		 (const :tag At beginning of file top)
 		 (const :tag At end of file bottom)
-		 (const :tag In a date tree date-tree))
+		 (const :tag In a date tree date-tree)
+ (cons :tag ID (const :tag  ID) (string :tag ID)))
 		(choice :tag Context
 		 (const :tag Use in all contexts nil)
 		 (const :tag Use in all contexts t)
@@ -974,6 +976,10 @@ See also the variable `org-reverse-note-order'.
 		(org-datetree-find-date-create reference-date)
 		(setq reversed nil)
 		(setq org-goto-start-pos (point)))
+	   ((consp heading)
+		(setq org-goto-start-pos (org-find-entry-with-id (cdr heading)))
+(when (not org-goto-start-pos)
+  (error Target headline with ID '%s' not found (cdr heading
 	   ((and (stringp heading) (string-match \\S- heading))
 		(goto-char (point-min))
 		(if (re-search-forward

___
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: [Orgmode] Question: org-remember and level1 target headline

2010-05-13 Thread Martin Pohlack
Hi,

interest in this problem was indicated to me in private mail, so let my
sum up my findings so far.

I walked through the code in org-remember.el:org-remember-handler.

There seems to be no support for path traversal for the non-interactive
case.  The first headline matching is found regardless of its depth.

I now use the following structure for my plan files:

* Inbox
*** Inbox:host1
*** Inbox:host2
*** Inbox:host3

I use these two functions for computing the current target headline:

--
(defun my-host-name ()
  Returns the name of the current host minus the domain.
  (let ((hostname (downcase (system-name
(save-match-data
  (substring hostname (string-match ^[^.]+ hostname)
  (match-end 0)

(defun my-org-remember-headline ()
  (concatenate 'string Inbox: (my-host-name)))
--

In one of the interactive paths in org-remember-handler, org-refile
infrastructure is used for inquiring a target from the user.  When
refiling, / in headline names are replaced with \.  Verbatim \ in
headlines are also presented as \.  That means that test/test and
test\test cannot be distinguished for refiling.

Is there a specification of what are valid characters in a headline?

Is there interest to define remember targets via paths or via ID?

Cheers,
Martin

___
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: [Orgmode] Question: org-remember and level1 target headline

2010-05-11 Thread Martin Pohlack

Let my rephrase the question.

How do I specify the target for a org-remember template such that new 
entries become children of b:


* a
** b
*** new entry

If I specify a/b, a new node named a/b is created

* a
** b
* a/b
** new entry

Cheers,
Martin

___
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] Question: org-remember and level1 target headline

2010-05-10 Thread Martin Pohlack
Hi all,

to practically prevent merge conflicts between the different machines
that I use I want to capture new items not directly under the global
Inbox headline, but under Inbox/$HOSTNAME.

For example, I often capture new items on my desktop and my notebook
and later sync.  The new items will always conflict as they are placed as
last child of Inbox.

I now switched my org-remember templates from statically specifying
Inbox as target headline to a helper function:

--

(defun my-host-name ()
  Returns the name of the current host minus the domain.
  (let ((hostname (downcase (system-name
(save-match-data
  (substring hostname (string-match ^[^.]+ hostname) (match-end 0)

(defun my-org-remember-headline ()
  (concatenate 'string Inbox/ (my-host-name)))

--

The problem now is that I would like the target to be:

* Inbox
*** $HOSTNAME
* new item

Instead, I get this:

* Inbox/$HOSTNAME
*** new items

My question now is how to specify the headline hierarchy here?

Cheers,
Martin

___
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: [Orgmode] Flyspell highlighting (again)

2010-04-06 Thread Martin Pohlack

On 06.04.2010 19:05, Ivan Vilata i Balaguer wrote:

Here Matthew Lundin reported Flyspell highlighting URL components:
http://www.mail-archive.com/emacs-orgmode@gnu.org/msg14029.html

The issue should be fixed according to the thread, but URLs like
http://example.com/foo_blarghaa still cause problems (blarghaa is
highlighted by Flyspell).

For the wishlist, it'd also be nice to exclude #+FOO options from
flyspelling, since they tend to get highlighted when writing non-English text.


I'm also seeing my todo states highlighted whenever they are invalid 
words (TODO, PROJ, CONT, etc.).


Would this also be the place to exclude those?

Cheers,
Martin


___
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: [Orgmode] A testing framework

2010-03-21 Thread Martin Pohlack
Hi Carsten, all,

On 21.03.2010 08:26, Carsten Dominik wrote:
 we had an earlier threads about testing frameworks:
 
 http://orgmode.org/worg/org-tests/index.php
 
 http://thread.gmane.org/gmane.emacs.orgmode/8759/focus=8775
 
 http://thread.gmane.org/gmane.emacs.orgmode/8743/focus=8743

Very interesting, I just went through all this.

From above material, two general approaches have been considered for
testing org-mode:
* Lisp based unit testing.
* Example-file based feature testing.

I am targeting the second approach here for now as I think it may
provide more benefit per time spent and would allow more people to
participate easily.

I hope that every emacs user will be able to write tests with my
framework.  Basically only an example test case and the expected
result should be need for tests, together with a minimal description
of the setup.

If only an example file triggering a bug is available, a corresponding
test can be crafted with minimal effort.


For now I have a minimal framework running with two tests
demonstrating expected behavior for folding and a bug in the version
I'm using.

I would like to enquire comments regarding the following open issues,
where I have no satisfying solution yet:

* I would like to start the test in something like a temporally stable
  setup, such that generated timestamps would be somewhat predictable
  (basically with the system clock set to 1.1.2005 20:00, or something
  like that).

  There are several levels where this could be achieved, ranging from:
  1. Experimental patches to the Linux kernel,
  2. Library wrappers using LD_PRELOAD around emacs to virtualize the
 time and gettimeofday system calls,
  3. Advised lisp functions for obtaining time stamps, and
  4. Post processing the test output to generalized time stamps.

  Currently, I'm going with 4, 3 may make sense if someone could
  identify the hopefully 2-3 functions to be advised.

  2 and 1 are probably too Linux specific and I'm not sure if 2 works
  with emacs.

  Comments?

* Currently I use a list of lisp functions for specifying the behavior
  to be executed in a test, for example:

  (org-todo)

  or

  (org-end-of-line)
  (org-cycle)

  This is not very intuitive for users.  I would rather like something
  like a recorded macro to execute.

  For example:

  end, tab

  Does anyone here has a tip how to specify a list of user-input
  actions in a file and play that back?

* For visual comparison I currently simply save the visible part of
  buffers.

  One may get a step further here and also capture properties, faces and
  the cursor position.  I remember vaguely that there is such a
  facility somewhat related to rich text in emacs, but wasn't able to
  find it again.  Do you guys know of such a thing?

 I think it would be great to have a testing framework and a
 lot of tests, but I do not have time to make this happen.
 Maybe you can try to get the people who were active in those
 threads and energize them?

I assumed everyone still interested in contributing to org-mode is
still lurking in this list.  So speak up if you are interested in
contributing to the tests :-).

Cheers,
Martin


___
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] A testing framework (was: Testing)

2010-03-19 Thread Martin Pohlack
Hi Again,

I assume all of you ignored my previous email due to me choosing a
clever subject :-/.

I went ahead anyway and implemented a first version of the framework.

It currently contains 2 sample test cases, one that works and one that
fails with my org-mode version.

 3. and 4. may need some wild-card representation for the timestamps in
 order to make the equality comparison portable.

This problem is currently solved by filtering the output and comparing
generalized output.

Please have a look at the framework here:

  http://github.com/martinp26/org-mode-test

Cheers,
Martin Pohlack


___
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] Testing

2010-03-01 Thread Martin Pohlack
Hi All,

I have been using org-mode for a while now and am quite happy with the
features it provides.  Occasionally, I update to the current git head
to get some fancy new features ;-).

I am, however, more and more reluctant to do so out of fear of loosing
parts of my data due to newly introduced bugs.

Just to be clear, I'm not writing here to blame anyone for bugs.  I
understand that they are probably inevitable on the path to new
features.

In the last time I often found long-corrupted entries in rarely
expanded subtrees of my org files.  That kind of scares me as it
greatly reduces the trust I can have in “my system”.

For example, I started using mrd-org-smartwrap.el for wrapping long
lines.  As it turned out (much later) some irregularities in this mode
distort the parsing of headline / entry boundaries.  Consequently, I
corrupted some entries in my trees without noticing it for a long time.
One particularly nasty effect was that recurring items where finally
marked as DONE with mrd-org-smartwrap active, instead of jumping to
the next recurrence.

What I want to propose here is to have a collection of test cases
which could be used to verify org-mode's integrity with regard to
certain features.  This email is meant to start a discussion on this
topic.

I currently envision each test-case to have five parts:

1. An input file: This file is the basis for a test and contains the
   initial state of an org-mode file.
2. A sequence of actions to operate on the input file.
3. An expected output file: This file resembles the transformed input
   file after the action sequence.  The actual output file can be
   compared to this expected file.
4. An expected visual representation of the org-mode buffer in emacs
   after the action sequence (like a screenshot but character based).
   This is required to capture visibility related bugs.  Those would
   not be visible from the actual output file alone.
5. An environment with an init.el / .emacs to customize org-mode for a
   certain test run.

So 1., 2., and 5. are the input of the test process.  The test succeeds
if the captured visual representation equals 4 and if the captured
output file equals 3.


Let me give you an example:

1.
--8--8--8--8--8--
* TODO test
  SCHEDULED: 2010-03-01 Mo +1w
--8--8--8--8--8--

2.
--8--8--8--8--8--
(beginning-of-buffer)
(org-todo 'done)
(save-buffer)
--8--8--8--8--8--

3.
--8--8--8--8--8--
* TODO test
  SCHEDULED: 2010-03-08 Mo +1w
  - State WAIT   from TODO   [2010-03-01 Mo 09:45]
  :PROPERTIES:
  :LAST_REPEAT: [2010-03-01 Mo 09:45]
  :END:
--8--8--8--8--8--

4.
--8--8--8--8--8--
* TODO test
  SCHEDULED: 2010-03-08 Mo +1w
  - State WAIT   from TODO   [2010-03-01 Mo 09:45]
  :PROPERTIES:…
--8--8--8--8--8--

5.
(My current setup emitted for brevity.)


1. and 3. may have to be extended to a set of files if more complex
features should be tested like querying several files or export to PDF
/ ….

3. and 4. may need some wild-card representation for the timestamps in
order to make the equality comparison portable.

I imagine that bug reports could be accompanied by such test cases.
An example, the expected output, and a sequence of actions should
belong there anyways :-).

What do you guys think?

Cheers,
Martin Pohlack


___
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: [Orgmode] Partial tags match in custom agenda?

2010-01-14 Thread Martin Pohlack
Hi Paul,

Paul Mead wrote:
 Hi
 
 I have a convention in my org file which uses @name as a gtd-type
 'agenda' item, so if an action is related to Liz, I tag it with @liz for
 example. 
 
 Is there any way of matching that '@' in setting up a custom agenda
 view? I'd like if possible to have a block agenda view which lists all
 of my @liz, @bob, @joe - type items in one view, rather than having to
 maintain a list of all the possible names in the block agenda setup.

You can do regexp matching on tags.  My agenda tags all start with ag_
(for people), agM_ (meetings) or agC_ (calls).

This snippet from my org-agenda-custom-commands shows how to use this:

(tags {^ag[MC]_.*}-maybe-TODO=\\-SCHEDULED\today\
  ((org-agenda-overriding-header Agendas (regular):)
   (org-agenda-sorting-strategy
'(tag-up))
   (org-agenda-skip-function
'(org-agenda-skip-subtree-if 'regexp ^\\*+ 
\\(DONE\\|CANC\\|CONT\\|PROJ\\|MAYBE\\) 
(tags {^ag_.*}-maybe-TODO=\\-SCHEDULED\today\
  ((org-agenda-overriding-header Agendas (non-regular):)
   (org-agenda-sorting-strategy
'(tag-up))
   (org-agenda-skip-function
'(org-agenda-skip-subtree-if 'regexp ^\\*+ 
\\(DONE\\|CANC\\|CONT\\|PROJ\\|MAYBE\\) 

Cheers,
Martin


___
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] Bug: Not on a heading seen on indenting headlines with an indented list as content [6.34]

2010-01-11 Thread Martin Pohlack
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


When indenting headlines via org-demote-subtree etc. the following
error is shown: Not on a heading.

The headline itself is indented, but not its content.

The following example file triggers the bug here:

--8--8--8--8--8--
*** daksd lksa ndlksa
* 
--8--8--8--8--8--

After indentation the the buffer has the following content:
--8--8--8--8--8--
* daksd lksa ndlksa
* 
--8--8--8--8--8--

I would have expected the following:
--8--8--8--8--8--
* daksd lksa ndlksa
  * 
--8--8--8--8--8--

This happens with the current git version (from 2010-01-11 10:00 MET).


Emacs  : GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.14.7)
 of 2009-09-17 on monat400
Package: Org-mode version 6.34

current state:
==
(setq
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-link-frame-setup '((vm . vm-visit-folder-other-frame)
(gnus . gnus-other-frame) (file . find-file))
 org-special-ctrl-a/e 'reversed
 org-agenda-show-inherited-tags nil
 org-hide-leading-stars t
 org-disputed-keys '(([(meta left)] . [(meta shift left)])
 ([(meta right)] . [(meta shift right)]))
 org-agenda-skip-timestamp-if-done t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-archive-location ::* Archiv
 org-odd-levels-only t
 org-special-ctrl-k t
 org-agenda-restore-windows-after-quit t
 org-deadline-warning-days 7
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-agenda-skip-scheduled-if-done t
 org-stuck-projects '(+LEVEL=2-maybe/+PROJECT
  (TODO NEXT INBOX WAITING TICKLER) nil )
 org-export-preprocess-hook '(org-export-blocks-preprocess)
 org-tab-first-hook '(org-hide-block-toggle-maybe)
 org-src-mode-hook '(org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-todo-keywords '((sequence TODO(t) INBOX(i) | WAITING(w!)
  MAYBE(m) TICKLER(k) DONE(d!) CANCELED(c!)
  PROJECT(p) BLOCKED(b) CONTAINER(o))
 )
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-n-level-faces 1
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-export-preprocess-before-normalizing-links-hook 
'(org-remove-file-link-modifiers)
 org-agenda-window-frame-fractions '(0.25 . 0.5)
 org-replace-disputed-keys t
 org-agenda-mouse-1-follows-link t
 org-mode-hook '(mrd-org-smartwrap-mode visual-line-mode
 (lambda nil (local-set-key l (quote org-store-link))
  (local-set-key a (quote org-agenda))
  (local-set-key b (quote org-iswitchb))
  (local-set-key (quote [(control up)])
   (quote outline-previous-visible-heading))
  (local-set-key (quote [(control down)])
   (quote outline-next-visible-heading))
  (local-set-key (quote [(control meta left)])
   (quote outline-up-heading))
  (local-set-key (quote [(control meta right)])
   (quote org-cycle))
  (make-local-variable (quote filladapt-token-table))
  (set (quote filladapt-token-table)
   (quote
((^ beginning-of-line) (+ citation-)
 (\\(\\w\\|[0-9]\\)[^'`\ \n]*[  ]*
  supercite-citation)
 (;+ lisp-comment) (# ABC sh-comment)
 (%+ postscript-comment) (///* c++-comment)
 (@c[  ] texinfo-comment)
 (@comment[] texinfo-comment)
 (item[] bullet)
 ([0-9]+\\.[   ] bullet)
 ([0-9]+\\(\\.[0-9]+\\)+[  ] bullet)
 ([A-Za-z]\\.[ ] bullet)
 ((?[0-9]+)[   ] bullet)
 ((?[A-Za-z])[ ] bullet)
 ([0-9]+[A-Za-z]\\.[   ] bullet)
 ((?[0-9]+[A-Za-z])[   ] bullet)
 ([-~+#→]+[] bullet) ([  ]+[*][  ] bullet)
 (o[   ] bullet) ([  ]+ space) ($ end-of-line)
   

Re: [Orgmode] Bug: Not on a heading seen on indenting headlines with an indented list as content [6.34]

2010-01-11 Thread Martin Pohlack
Hi Carsten and Matthew,

I think the problem is related to mrd-org-smartwrap-mode, but I cannot
further pinpoint it.

Here is a small startup file for reproducing (init.mrd.el):
--8--8--8--8--8--
; path to current org-mode here
(add-to-list 'load-path ~/.emacs.d/lisp/)
(add-to-list 'load-path ~/.emacs.d/lisp/org-mode/)

(require 'org)
(require 'org-docbook)
(require 'mrd-org-smartwrap)
(add-hook 'org-mode-hook 'mrd-org-smartwrap-mode)
--8--8--8--8--8--

Example file that triggers the bug (test.org):
--8--8--8--8--8--
* test für list childs
  *
--8--8--8--8--8--

emacs -q --no-site-file -l init.mrd.el test.org

Cheers,
Martin

Carsten Dominik wrote:
 Hi Martin,
 
 I am unable to reproduce this.
 
 Could you please try to create a minimal setup with a minimum  
 configuration?
 
 Thanks.
 
 - Carsten
 
 On Jan 11, 2010, at 10:16 AM, Martin Pohlack wrote:
 
 Remember to cover the basics, that is, what you expected to happen and
 what in fact did happen.  You don't know how to make a good report?   
 See

 http://orgmode.org/manual/Feedback.html#Feedback

 Your bug report will be posted to the Org-mode mailing list.
 

 When indenting headlines via org-demote-subtree etc. the following
 error is shown: Not on a heading.

 The headline itself is indented, but not its content.

 The following example file triggers the bug here:

 --8--8--8--8--8--
 *** daksd lksa ndlksa
*
 --8--8--8--8--8--

 After indentation the the buffer has the following content:
 --8--8--8--8--8--
 * daksd lksa ndlksa
*
 --8--8--8--8--8--

 I would have expected the following:
 --8--8--8--8--8--
 * daksd lksa ndlksa
  *
 --8--8--8--8--8--

 This happens with the current git version (from 2010-01-11 10:00 MET).


 Emacs  : GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.14.7)
 of 2009-09-17 on monat400
 Package: Org-mode version 6.34

 current state:
 ==
 (setq
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial- 
 vars)
 org-link-frame-setup '((vm . vm-visit-folder-other-frame)
(gnus . gnus-other-frame) (file . find-file))
 org-special-ctrl-a/e 'reversed
 org-agenda-show-inherited-tags nil
 org-hide-leading-stars t
 org-disputed-keys '(([(meta left)] . [(meta shift left)])
 ([(meta right)] . [(meta shift right)]))
 org-agenda-skip-timestamp-if-done t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-archive-location ::* Archiv
 org-odd-levels-only t
 org-special-ctrl-k t
 org-agenda-restore-windows-after-quit t
 org-deadline-warning-days 7
 org-export-latex-format-toc-function 'org-export-latex-format-toc- 
 default
 org-agenda-skip-scheduled-if-done t
 org-stuck-projects '(+LEVEL=2-maybe/+PROJECT
  (TODO NEXT INBOX WAITING TICKLER) nil  
 )
 org-export-preprocess-hook '(org-export-blocks-preprocess)
 org-tab-first-hook '(org-hide-block-toggle-maybe)
 org-src-mode-hook '(org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-todo-keywords '((sequence TODO(t) INBOX(i) | WAITING(w!)
  MAYBE(m) TICKLER(k) DONE(d!) CANCELED(c!)
  PROJECT(p) BLOCKED(b) CONTAINER(o))
 )
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-n-level-faces 1
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide- 
 drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-export-preprocess-before-normalizing-links-hook '(org-remove- 
 file-link-modifiers)
 org-agenda-window-frame-fractions '(0.25 . 0.5)
 org-replace-disputed-keys t
 org-agenda-mouse-1-follows-link t
 org-mode-hook '(mrd-org-smartwrap-mode visual-line-mode
 (lambda nil (local-set-key l (quote org-store- 
 link))
  (local-set-key a (quote org-agenda))
  (local-set-key b (quote org-iswitchb))
  (local-set-key (quote [(control up)])
   (quote outline-previous-visible-heading))
  (local-set-key (quote [(control down)])
   (quote outline-next-visible-heading))
  (local-set-key (quote [(control meta left)])
   (quote outline-up-heading))
  (local-set-key (quote [(control meta right)])
   (quote org-cycle

Re: [Orgmode] Smart(er) word wrapping with org-mode and visual-line-mode

2010-01-10 Thread Martin Pohlack
Hi Carsten and Matthew,

On 08.01.2010 18:24, Carsten Dominik wrote:
 On Jan 6, 2010, at 4:25 PM, Martin Pohlack wrote:
 I just tried this out (only for headlines up to now) and it seems to
 work great.

 Are there any plans to integrate something like this into upstream?
 Especially the wrapping of headlines would enable extensive tag usage.
 
 I have been thinking about that, but not arrived at a conclusion.  One  
 thing is the interaction with org-indent-mode.  That mode already does  
 the wrapping for headlines correctly by adding `wrap-prefix', and it  
 will look really good if you set the variable word-wrap to t.   

Ah, I wasn't aware of that.  I think the documentation to org-indent
doesn't mention wrapping (14.6 A cleaner outline view).  How about
something like this:

  org-indent-mode also sets the wrap-prefix property, such that
  visual-line-mode (or purely setting word-wrap) wraps long lines
  (including headlines) correctly indented.

 However, the showstoppers are the following:
 
 1. I cannot bring myself to turn off truncate-lines, because it
 messes up tables and code examples badly, and these are major
 components of my work.

Right, I haven't used it to much up to now.

 I have actually put in a feature
 request into Emacs for a property `truncate-line', to be
 able to control this line by line.  I got positive feedback,
 but I don't know when any of the developers finds time
 to implement it - I cannot do that myself.

Awesome.  This sounds like the way to go.

 2. Visual-line-mode is also a no go for me, I use keyboard
 macros a lot and need to be able to rely on the fact that
 [down] move the cursor into the next physical line.

I sometimes like visual navigation in wrapped text and my own motion
commands.  I have two commands to move visually explicitly (bound to
s-down, s-up (super-...)).

(defun next-visual-line (optional arg try-vscroll)
  (interactive ^p\np)
  (let ((line-move-visual t))
(with-no-warnings
  (next-line arg try-vscroll

(defun previous-visual-line (optional arg try-vscroll)
  (interactive ^p\np)
  (let ((line-move-visual t))
(with-no-warnings
  (previous-line arg try-vscroll

 So I am not sure how to handle this.  We could turn Matthews
 code into a module that users can turn on if they wish.

I'm using Matthew's module right now for two reasons.

* I had some trouble configuring org-indent-mode to only handle
  line-wrapping for headlines, i.e., it shall only set wrap-prefix and
  do nothing else.  It always wanted to indent my headlines and body
  texts additionally.  Is this possible?

* Also, emacs segfaulted deterministically after globally collapsing
  all trees with org-indent-mode active.  I have to look into this ...

Cheers,
Martin


___
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: [Orgmode] Org-mode version 6.32trans and 6.21b; Strange interaction between whitespace-mode and cust. org-ellipsis

2009-12-14 Thread Martin Pohlack
Hi Carsten,

On 14.12.2009 17:27, Carsten Dominik wrote:
 i can follow your arguments and would like to improve this.
 
 What I do not understand yet is this:
 
 I was under the impression that normally, there is only a single
 display table in Emacs, and that is the global one and every buffer
 will use it.

Interesting, I had the opposite impression.  I'm not exactly sure why
though.  Maybe from the documentation and name of the variable
buffer-display-table?

Maybe you had standard-display-table in mind?

  Variable: Display table to use for buffers that specify none.
   See `buffer-display-table' for more information.

I have, however, never seen a spelled out convention regarding deep
sharing of display tables.

 So it would seem to me that whitespace-mode would normally
 *make* a local table in order to put its changes in there.  However,
 that does not seem to be the case here.  Can you see why?

I think whitespace-mode usually assumes that the local display tables
is, well, local.  Therefore, no action would be required.

I forwarded my original bug-report to Vinicius Jose Latorre
(whitespace-mode's maintainer) after you mentioned it would be a
whitespace-mode bug.

He replied:

 Well, the problem was due to the way whitespace deal with 
 buffer-display-table variable.
 
 I've just fixed this problem in Emacs CVS and EmacsWiki.

Here is the patch:

http://lists.gnu.org/archive/html/emacs-diffs/2009-12/msg00184.html

He basically creates a deep copy (the copy-sequence line) of the local
display table and installs it.  This should solve the problem.


I still have this nagging feeling that the sharing of the display table
is not the right thing to do and would regard the fix in whitespace-mode
as a kind of emergence case backup.  But this is probably purely a style
thing.

Thanks for getting back to me on this matter,
Martin


___
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: [Orgmode] Org-mode version 6.32trans and 6.21b; Strange interaction between whitespace-mode and cust. org-ellipsis

2009-12-04 Thread Martin Pohlack
Carsten Dominik wrote:
 On Dec 3, 2009, at 10:34 PM, Martin Pohlack wrote:
 
 Carsten Dominik wrote:
 Hi Martin, this looks to me like a bug in whitespace.el, why does it
 override the display table org-mode is using?
 Hmm, my understanding is that each buffer can have its own display
 table, buffer-display-table.  whitespace-mode has to modify this table
 (or install an own one) if it wants to do buffer-local modifications.
 So I think it modifies org-mode's table but doesn't override it.

 My irritation is that by doing so, it does modifies some global state
 that effects other buffers.

 A short look into org.el shows that org-display-table is never made
 buffer local, so this data structure is shared across all org-mode  
 buffers?
 
 Yes, this is the idea, and it seems only logical to me.  So why
 do you want different settings in different Org buffers for
 whitespace?  So far I am unconvinced that creating a new
 table in each buffer with the right thing to do.

Ok, I have three argument to support this.

1. Let me start by describing a helper and how I use it.  This is a
   snippet from my init.el:

8--8
;;;
;;; whitespace stuff
;;;
(when (require 'whitespace nil t)
  (require 'column-marker)

  (defvar cycle-whitespace-modes-state 0
whitespace mode states:
 0 - no whitespace stuff,
 1 - highlighting of stray whitespace, 72  80 column lines
 2 - ws highlighting and identification for tabs and spaces (», ·))
  (make-variable-buffer-local 'cycle-whitespace-modes-state)

  (defun my-cycle-whitespace-modes (optional state)
(interactive)
(if state
(setq cycle-whitespace-modes-state state)
  (setq cycle-whitespace-modes-state
(mod (1+ cycle-whitespace-modes-state) 3)))
(case cycle-whitespace-modes-state
  (0
   (whitespace-mode 0)
   (column-marker-1 -2)
   (column-marker-2 -2)
   (column-marker-3 -2))
  (1
   (whitespace-mode 0)
   (whitespace-mode 1)
   (column-marker-1 72)
   (column-marker-2 80))
  (otherwise
   (whitespace-mode 0)
   (whitespace-mode 1)
   (whitespace-toggle-options (list 'tab-mark 'space-mark))
   (column-marker-1 72)
   (column-marker-2 80

  (global-set-key [f10] 'my-cycle-whitespace-modes)

  (defun my-whitespace-modes-none () (my-cycle-whitespace-modes 0))
  (defun my-whitespace-modes-some () (my-cycle-whitespace-modes 1))
  (defun my-whitespace-modes-full () (my-cycle-whitespace-modes 2))

  (add-hook 'c-mode-common-hook 'my-whitespace-modes-some)
  ;…
  )
8--8

I usually have whitespace mode active in a medium warning level
(my-whitespace-modes-some), which show whitespace at end of line etc.

Sometimes, I want to see all spaces and tabs in a single buffer
explicitly, e.g. for aligning stuff manually or debugging things
(my-whitespace-modes-full).

At other times, I want to deactivate all whitespace highlighting
(my-whitespace-modes-none), e.g., when dealing with long lines or when
crafting some ASCII drawings.

I make, all of these decision per buffer.


2. Whitespace-mode is usually buffer local.  Having it modify other
   buffers is irritating.  If global effects are desired there is the
   variable whitespace-global-modes


3. (whitespace-toggle-options …) is documented to modify the local
   buffer only.


Org's global display table de-localizes all of whitespace-mode's local
functionality.

Cheers,
Martin


___
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: [Orgmode] Org and git blame integration?

2009-12-03 Thread Martin Pohlack
Hi Jason,

Jason Dunsmore wrote:
[...]

 git blame todo.org|cut -c29-|cut -c 20-25 --complement|sort -n|less -S
 
 I made a couple of bash functions based on this:
 
 function org_history () {
 git blame $1|cut -c29-|cut -c 20-25 --complement|sort -n|less -S
 }
 
 # Limit the output to Org headlines
 function org_history_headings () {
 git blame $1|grep ') \*'|cut -c29-|cut -c 20-25 --complement|sort -n|less 
 -S
 }
 
 But I still have to go back and forth between the git-blame output and
 Org.
 
 It'd be nice if I could view and edit the git-blame output in org-mode,
 group the sort by a certain level heading, cycle body visibility, etc...
 I'm not sure how difficult that would be to implement.  Does this sound
 like a reasonable feature request?

I'm not sure how git blame would help with finding stuck projects, but
if you tweak the output to be similar to this:

  file:line: message/string

or

  file:line:col: message/string

You could call the script from a compile buffer (M-x compile).  In this
buffer, this kind of output is linked back to the original files and you
could iterated over the found lines.

Cheers,
Martin Pohlack


___
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: [Orgmode] Org-mode version 6.32trans and 6.21b; Strange interaction between whitespace-mode and cust. org-ellipsis

2009-12-03 Thread Martin Pohlack
Carsten Dominik wrote:
 Hi Martin, this looks to me like a bug in whitespace.el, why does it  
 override the display table org-mode is using?

Hmm, my understanding is that each buffer can have its own display
table, buffer-display-table.  whitespace-mode has to modify this table
(or install an own one) if it wants to do buffer-local modifications.
So I think it modifies org-mode's table but doesn't override it.

My irritation is that by doing so, it does modifies some global state
that effects other buffers.

A short look into org.el shows that org-display-table is never made
buffer local, so this data structure is shared across all org-mode buffers?

The following hack seems to solve this problem:

--- org.el.bak  2009-12-03 22:31:07.0 +0100
+++ org.el  2009-12-03 22:31:48.0 +0100
@@ -427,9 +427,6 @@
 (face :tag Face :value org-warning)
 (string :tag String :value ...#)))

-(defvar org-display-table nil
-  The display table for org-mode, in case `org-ellipsis' is non-nil.)
-
 (defgroup org-keywords nil
   Keywords in Org-mode.
   :tag Org Keywords
@@ -4170,8 +4167,7 @@
   (when (and org-ellipsis
  (fboundp 'set-display-table-slot) (boundp
'buffer-display-table)
 (fboundp 'make-glyph-code))
-(unless org-display-table
-  (setq org-display-table (make-display-table)))
+(setq org-display-table (make-display-table))
 (set-display-table-slot
  org-display-table 4
  (vconcat (mapcar


Cheers,
Martin


___
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] Org-mode version 6.32trans and 6.21b; Strange interaction between whitespace-mode and cust. org-ellipsis

2009-12-02 Thread Martin Pohlack
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


I observe a strange interaction between whitespace-mode and org-mode
if org-ellipsis is set.

Whenever I use whitespace-toggle-options for customizing
whitespace-mode in a buffer, all org-mode buffers are effected.
Probably their display table is overwritten which only has effect if
org-ellipsis is set?

Steps to reproduce:

* Start emacs as follows (no local init file, start attached minimal
  init file, open two small org-files, also attached):

  $ emacs -q -l init.test.el test1.org test2.org

* Hit F10 in one org-mode buffer once.

* Look at other org-mode buffer to see that spaces are visualized via a
  centered dot.

What *is* happening:

* Other buffers are effected by a supposedly local action (display
  table?).

What *should* be happening:

* No change to other buffers should occur.

I'm not entirely convinced that org-mode is to blame here ...

Emacs  : GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.14.7)
 of 2009-09-17 on monat400
Package: Org-mode version 6.21b
Package: Org-mode version 6.32trans

Org-settings see attachment.
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(org-ellipsis …))

(require 'whitespace)

(defvar cycle-whitespace-modes-state 0
  whitespace mode states:
   0 - highlighting of stray whitespace, 72  80 column lines
   1 - ws highlighting and identification for tabs and spaces (», ·))
(make-variable-buffer-local 'cycle-whitespace-modes-state)

(defun my-cycle-whitespace-modes (optional state)
  (interactive)
  (if state
  (setq cycle-whitespace-modes-state state)
(setq cycle-whitespace-modes-state
  (mod (1+ cycle-whitespace-modes-state) 2)))
  (case cycle-whitespace-modes-state
(0
 (whitespace-mode 0)
 )
(otherwise
 (whitespace-mode 0)
 (whitespace-mode 1)
 (whitespace-toggle-options (list 'tab-mark 'space-mark))
 )))
(global-set-key [f10] 'my-cycle-whitespace-modes)
abc def
abc def
___
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] Org-mode version 6.32trans and 6.21b; Strange interaction between whitespace-mode and cust. org-ellipsis

2009-12-02 Thread Martin Pohlack
(sorry for the resent, this time with minimal init.test.el)

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


I observe a strange interaction between whitespace-mode and org-mode
if org-ellipsis is set.

Whenever I use whitespace-toggle-options for customizing
whitespace-mode in a buffer, all org-mode buffers are effected.
Probably their display table is overwritten which only has effect if
org-ellipsis is set?

Steps to reproduce:

* Start emacs as follows (no local init file, start attached minimal
  init file, open two small org-files, also attached):

  $ emacs -q -l init.test.el test1.org test2.org

* Hit F10 in one org-mode buffer once.

* Look at other org-mode buffer to see that spaces are visualized via a
  centered dot.

What *is* happening:

* Other buffers are effected by a supposedly local action (display
  table?).

What *should* be happening:

* No change to other buffers should occur.

I'm not entirely convinced that org-mode is to blame here ...

Emacs  : GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.14.7)
 of 2009-09-17 on monat400
Package: Org-mode version 6.21b
Package: Org-mode version 6.32trans

Org-settings see attachment.

abc def

abc def

(custom-set-variables
 '(org-ellipsis …))

(require 'whitespace)

(defun my-whitespace-on ()
  (interactive)
  (whitespace-mode 1)
  (whitespace-toggle-options (list 'space-mark)))

(global-set-key [f10] 'my-whitespace-on)
___
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: [Orgmode] scheduling: reschedule on hourly basis

2009-11-28 Thread Martin Pohlack
Hi Patrick,

Patrick Drechsler wrote:
 Hi,
 
 is it possible to reschedule on an hourly basis?
 
 * TODO foo
SCHEDULED: 2009-11-27 Fr ++2h
 
 Maybe even something like every 2h between 8:00 and 17:00?

You may want to look at this thread:

http://www.mail-archive.com/emacs-orgmode@gnu.org/msg15142.html

I think hour and minute parts are not supported for repeaters.

Cheers,
Martin


___
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: [Orgmode] Org-mode for diary writing

2009-11-18 Thread Martin Pohlack
Hi T o n g,

T o n g wrote:
 I found people are using org-mode for diary writing in recent mlist 
 archive, but wasn't able to find such tutorials. 
 
 Anyone can enlighten me with such tutorial, which is for org-mode newbies 
 and focusing on how to make most use of applicable org-mode features, and 
 maybe a bonus best-practice diary writing with org-mode?

No tutorial, but this is how I write my journal:

(custom-set-variables
 '(org-remember-templates
   (quote ((Journal 106 * %^{Eintrag}%?%i% ~/Daten/Journal.org
return_formated_date nil)

With this helper function:

;;;
;;; time and date, date in international format: -MM-DD
;;;
(defun return_formated_date ()
  (let ((time (decode-time)))
(format %d-%02d-%02d (nth 5 time) (nth 4 time) (nth 3 time

My journal looks like this:

...
* 2009-11-13
*** abc
*** def
...

Cheers,
Martin


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


Re: [Orgmode] Best way to implement Keywords feature

2009-11-10 Thread Martin Pohlack
Hi All,

Martin Pohlack wrote:
 Alan E. Davis wrote:
 In some cases, a single headword entry can relate to a large number of
 topics.  I have tried dealing with longer tag lists: automatic
 adjustment of tags column (on this list a little utility was posted:
 org-adjust-tags-column-reset-tags.  I THINK that a keyword list may
 allow more freedom to cross-index, especially if it is easy to use.

 Can someone suggest a way to implement a keywording system, perhaps with
 a custom agenda search?  Or have others dealt with this issue in
 innovative ways?

 I would appreciate any ideas.
 
 I still have the feeling that tags are the way to go.  Searching etc.
 already works with tags.  Their disadvantage seems to be that lines get
 cluttered if many tags are used.
 
 Maybe this can be solved with two approaches:
 * In agendas, one could have a filter for which tags to show / hide.
   This would be useful otherwise too, as it would allow to hide context
   tags in already defined agendas.
 
   org-agenda-hide-tags-regex
 
   For example, all my contexts start with @, so I would set it to be
   ^...@work$ to hide redundant information in my work agendas, or use
   ^@ to remove all context information from a specific agenda.
 
 * For plain view, could we have a soft newline between tags and content
   for an item (like in long-lines-mode)?
   Tags would be shown on a new line (with indentation etc.) but would be
   stored on the same line in files?
 
   For example, the file content (\ added by me, should be one long
   line):

Please find attached a patch that implements tag filtering for agenda views.

Feedback welcome.

Cheers,
Martin
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 708b193..e146bc0 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1202,6 +1202,14 @@ When non-nil, this must be the number of minutes, e.g. 60 for one hour.
   :group 'org-agenda-line-format
   :type 'boolean)
 
+(defcustom org-agenda-hide-tags-regexp nil
+  Regular expression used to fitler away specific tags in agenda views.
+Nil means hide no tags.
+  :group 'org-agenda-line-format
+  :type '(choice
+	  (const  :tag Hide none nil)
+	  (string :tag Regexp   )))
+
 (defcustom org-agenda-remove-tags nil
   Non-nil means, remove the tags from the headline copy in the agenda.
 When this is the symbol `prefix', only remove tags when
@@ -4507,9 +4515,20 @@ Any match of REMOVE-RE will be removed from TXT.
   (save-match-data
 ;; Diary entries sometimes have extra whitespace at the beginning
 (if (string-match ^ + txt) (setq txt (replace-match  nil nil txt)))
-(when org-agenda-show-inherited-tags
-  ;; Fix the tags part in txt
-  (setq txt (org-agenda-add-inherited-tags txt tags)))
+;; filter tags here
+(when org-agenda-hide-tags-regexp
+  (setq tags (apply 'append (mapcar
+ (lambda (x)
+   (if (string-match org-agenda-hide-tags-regexp x)
+   nil
+ (list x)))
+ tags
+;; Fix the tags part in txt
+(if org-agenda-show-inherited-tags
+(setq txt (org-agenda-add-inherited-tags txt tags))
+  (when org-agenda-hide-tags-regexp
+(setq txt (org-agenda-add-local-tags txt tags
+
 (let* ((category (or category
 			 org-category
 			 (if buffer-file-name
@@ -4640,6 +4659,24 @@ Any match of REMOVE-RE will be removed from TXT.
 	'extra extra
 	'dotime dotime
 
+(defun org-agenda-add-local-tags (txt tags)
+  Remove tags string from TXT, and add non-inherited list of tags.
+Inherited tags in TAGS are ignored.
+  (if (string-match (org-re \\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$) txt)
+  (setq txt (substring txt 0 (match-beginning 0
+  (when tags
+;; drop inherited tags
+(let ((mytags (apply 'append (mapcar
+  (lambda (x)
+(if (get-text-property 0 'inherited x)
+nil
+  (list x)))
+  tags
+  ;; continue with remainder
+  (when ( (length mytags) 0)
+(setq txt (concat txt  : (mapconcat (lambda (x) x) mytags :) : )
+  txt)
+
 (defun org-agenda-add-inherited-tags (txt tags)
   Remove tags string from TXT, and add complete list of tags.
 The new list includes inherited tags.  If any inherited tags are present,
___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] (Possible Feature Request) Hiding Tags in Agenda View/Implementing Contexts in Org

2009-10-08 Thread Martin Pohlack
Hi Migual, all,

Miguel Fernando Cabrera wrote:
[…]
 I have several files, gtd.org (I put the name after a tutorial, but I
 don't implement pure gtd) and home.org. One if for work related tasks
 and the other for personal projects and task that are usually
 performed at home.

I use a very similar setup as you do, one file for work, one for home.
I tagged the topmost hierarchy in each file with a corresponding tag
(:@work:, :@home:) and use inheritance for context propagation.

I also use distinct agenda views for home and work stuff.

(w Agenda and work items at work
 ((agenda  ((org-agenda-ndays 1)
  (org-agenda-prefix-format %?-12t% s)
  (org-agenda-files (quote (~/Daten/plan_work.org)))
  (org-agenda-skip-function
   (quote (org-agenda-skip-entry-if (quote regexp) maybe)
  (todo INBOX
((org-agenda-skip-function
  (quote (org-agenda-skip-entry-if (quote scheduled
 (org-agenda-files (quote (~/Daten/plan_work.org)
  (stuck  ((org-agenda-files (quote (~/Daten/plan_work.org)
  (alltodo  ((org-agenda-skip-function
(quote (org-agenda-skip-entry-if
(quote notregexp) ^\\*+ \\(TICKLER\\|WAITING\\)
(quote regexp) ^\\*+ NEXT .*:ag_
(quote scheduled
   (org-agenda-overriding-header
Buggy items (missing schedule / agenda):)
   (org-agenda-files (quote (~/Daten/plan_work.org)
  (tags {^ag_.*}-{^ag_.*_\\(meeting\\|call\\)$}-maybe
((org-agenda-sorting-strategy (quote (tag-up)))
 (org-agenda-skip-function
  (quote
   (org-agenda-skip-subtree-if
(quote regexp)
^\\*+ \\(DONE\\|CANCELED\\|CONTAINER\\|PROJECT\\|MAYBE\\) )))
 (org-agenda-overriding-header Agendas (non-regular):)
 (org-agenda-files (quote (~/Daten/plan_work.org)
  (tags 
LEVEL1...@work-maybe-todo=\MAYBE\-TODO=\DONE\-TODO=\CANCELED\-TODO=\PROJECT\-TODO=\CONTAINER\-TODO=\\
((org-agenda-skip-function (quote (org-agenda-skip-entry-if
   (quote scheduled)))
 ((org-agenda-prefix-format )))


[…]

 Now, to really do what I want would be cool to have a way of saying to
 org that don't show the @work tag.

This sounds like an intriguing feature to me.  For my setup, I
sometimes have each tag twice in each agenda line as refiling inlines
inherited tags.

In my work agenda I have many lines similar to this one:

  In   1 d.:  TODO task A  :@work::@work:

So the @work context is there *three* times on screen:
* from the whole agenda title,
* directly as tag in the task, and
* inherited in the task.

So I have two partially orthogonal feature requests here.
* Could we show tags only once, for example, for cases where a task
  has a tag directly and if it has inherited it?
* Could we have a filter for not showing certain tags in agenda views
  at all, for example, if the tag information would be redundant due
  to information provided by the whole agenda (work agenda - don't
  show :@work:).

Note that I cannot easily disable tag inheritance in my setup as I use
it also for propagating the :maybe: tag to descendants of projects.

Cheers,
Martin Pohlack


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


[Orgmode] Unhiding edited areas

2009-07-30 Thread Martin Pohlack
Hi there,

I'm using undo from time to time in org-mode buffers and sometimes the
area covered by the undo step is hidden (folded away) at the undo
time.  I feel somewhat uncomfortable in this situation as I,
apparently, rely on the visual appearance of the buffer when undoing
and redoing several steps.

For interactive search, the area around point is unfolded incrementally.

Is there a way to always show the area where edits are done?

Cheers,
Martin Pohlack


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


Re: [Orgmode] Unhiding edited areas

2009-07-30 Thread Martin Pohlack
Hi Samuel,

Samuel Wales wrote:
 Hi Martin,
 
 This is a huge issue.[1]
 
 Here is what I do to try to work around it.
 
 I use git, to limit the damage from confusion.

Yes, this or a versioning filesystem is probably advisable.

 I expand the entire buffer if I think I am about to be confused.
 
 ;;i like the idea of clustering undo but find it disconcerting
 (setf org-self-insert-cluster-for-undo nil)
 ;;somebody, I think Carsten, suggested this, and it might work for
 you, but for some reason I commented it out.  I don't remember what
 the reason was.  Maybe speed.
 '(defadvice undo (after org-undo-reveal activate)
  Make point and context visible after an undo command in Org-mode.
  (and (org-mode-p) (org-reveal)))
 ;;(ad-unadvise 'undo)

Awesome, this is exactly what I was looking for!

 [1]  It is even more important when combined with what is IMO Emacs's
 greatest need for improvement, which is that you can undo, and undo an
 undo, and this is considered to be sufficient since you can get
 anywhere in the timeline in principle -- but many users, myself
 included, prefer a true redo command, both because undoing an undo
 does not let you do commands (such as copying) in the middle of an
 undo sequence without going the other direction, and because it feels
 more intuitive to tell emacs where in the timeline we want to go, and
 go forward or backward if we overshoot, thus making it possible to
 view the timeline the same way as we go backward and forward in any
 linear sequence.  (redo.el provides the functionality, but it corrupts
 the buffer.)  Of course, many are comfortable with the traditional
 undo-the-undo mechanism, so that should stay possible, but there are
 many who are not, and a redo mechanism would satisfy them.  It is
 possible to get more fancy with a tree.

The current undo system is very powerful as it doesn't lose history
(unless you hit a quota limit).  With undo-redo systems you usually can
lose history if you edit things in an old state.  Suddenly redo is not
available anymore.  You can only access the most recent branch in the
history tree.

In emacs this will not happen as you can reach all nodes in the buffer
history, but these states are not easily accessible, especially, if you
went back and forth some times.  I cannot track the list of states in my
mind or imagine the current structure of the undo tree, I can only go
step by step and look at the situation in the buffer and decide whether
this is what I wanted or not.

I recently stumbled upon an article which, I think, quiet nicely
summarized what one wants:

  http://e-texteditor.com/blog/2006/making-undo-usable

But it's not available for emacs ...

Cheers,
Martin


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


Re: [Orgmode] Strange hiccups when running in server (also: Folding stops working)

2009-07-29 Thread Martin Pohlack
Martin Pohlack wrote:
 Sorry for the noise.
 
 A local package globally modified outline-heading-end-regexp which broke
 folding via outline-mode.

It wasn't a local package after all: simple-wiki.el is to blame here.

It globally modifies outline-regexp and outline-heading-end-regexp.

For those using simple-wiki.el, please find a patch attached (already
reported upstream).

Cheers,
Martin

PS.: This is probably the same problem as described in an earlier thread
called Folding stops working.
--- simple-wiki.el.orig	2009-07-29 10:53:26.706233000 +0200
+++ simple-wiki.el	2009-07-07 10:08:02.981394000 +0200
@@ -815,6 +817,8 @@
   (set (make-local-variable (car pair)) (cdr pair
 
   (unless (equal simple-wiki-outline-patterns 'none)
+(make-local-variable 'outline-regexp)
+(make-local-variable 'outline-heading-end-regexp)
 (setq outline-regexp (car simple-wiki-outline-patterns))
 (setq outline-heading-end-regexp (cdr simple-wiki-outline-patterns)))
 
___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Problem with org-refile

2009-07-27 Thread Martin Pohlack
Hi all,

I just stumbled upon a problem with org-refile.

After hitting C-c C-w, the interactive prompt asks me where to refile
to.  For some reason I started scrolling in the original buffer (using
the mouse wheel) to gain some insight where to refile to.  A side effect
of the scrolling was a moving of the cursor.

After I choose the refile target, not the item of my original cursor
position was refiled but the one where I scrolled to.

I suggest to use the cursor position at the time of invoking org-refile,
not the one at the time of completing the target prompt.

Cheers,
Martin Pohlack


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


Re: [Orgmode] Strange hiccups when running in server

2009-07-07 Thread Martin Pohlack
Sorry for the noise.

A local package globally modified outline-heading-end-regexp which broke
folding via outline-mode.

Cheers,
Martin


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


[Orgmode] Problem with recurring timestamps

2009-07-06 Thread Martin Pohlack
Hi all,

I have problems with the following recurring timestamp:
--
* TODO test3
  DEADLINE: 2009-07-07 Di 15:00 +1w -1h
--

When I mark the item as done, it loses the warning period (-1h) and the
recurrence markup (+1w).  Marking it as done again, will finally mark it
as done.

Org-version reports 6.21b.

Cheers,
Martin Pohlack


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


Re: [Orgmode] Re: Problem with recurring timestamps

2009-07-06 Thread Martin Pohlack
Tassilo Horn wrote:
 Martin Pohlack m...@os.inf.tu-dresden.de writes:
 
 Hi Martin,
 
 I have problems with the following recurring timestamp:
 --
 * TODO test3
   DEADLINE: 2009-07-07 Di 15:00 +1w -1h
 --

 When I mark the item as done, it loses the warning period (-1h) and
 the recurrence markup (+1w).  Marking it as done again, will finally
 mark it as done.

 Org-version reports 6.21b.
 
 I can confirm that with 6.28trans.  When removing the warning period, it
 works as expected.  Also, when removing the recurrence markup, changing
 the item to DONE keeps the -1h intact.

The problem seems to be that [+-]xh is not yet supported.

Given that timestamps can have an hour and minute component, the h
syntax seems logical, right?

Cheers,
Martin Pohlack


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


Re: [Orgmode] Re: Problem with recurring timestamps

2009-07-06 Thread Martin Pohlack
Carsten Dominik wrote:
 On Jul 6, 2009, at 11:53 AM, Martin Pohlack wrote:
 
 Tassilo Horn wrote:
 Martin Pohlack m...@os.inf.tu-dresden.de writes:

 Hi Martin,

 I have problems with the following recurring timestamp:
 --
 * TODO test3
  DEADLINE: 2009-07-07 Di 15:00 +1w -1h
 --

 When I mark the item as done, it loses the warning period (-1h) and
 the recurrence markup (+1w).  Marking it as done again, will finally
 mark it as done.

 Org-version reports 6.21b.
 I can confirm that with 6.28trans.  When removing the warning  
 period, it
 works as expected.  Also, when removing the recurrence markup,  
 changing
 the item to DONE keeps the -1h intact.
 The problem seems to be that [+-]xh is not yet supported.
 
 yes, prewarning periods for deadlines have to de d, w, m, or y.
 Hours and minutes are not supported.  How are you planing to use this?

I have a weekly recurring event which is due Friday 17:00, but I can
only start working on it shortly before, say 2 h.

I would like it not to appear in the agenda until 15:00 at Friday, or it
could appear at Friday's agenda, with an extended timestamp (15:00), so
I know it has to be done later.

I could also be handled like this item:

--
* TODO test4
  DEADLINE: 2009-07-06 Mo 14:00 SCHEDULED: 2009-07-06 Mo 13:00
--

In the agenda:

Monday  6 July 2009 W28
   8:00.. 
  10:00.. 
  12:00.. 
 file.org:13:00.. Scheduled:  TODO test4
 file.org:14:00.. Deadline:   TODO test4
  14:00.. 
  16:00.. 
  18:00.. 
  20:00.. 

Cheers,
Martin Pohlack


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


Re: [Orgmode] Re: Problem with recurring timestamps

2009-07-06 Thread Martin Pohlack
Carsten Dominik wrote:
[...]
 I could also be handled like this item:

 --
 * TODO test4
  DEADLINE: 2009-07-06 Mo 14:00 SCHEDULED: 2009-07-06 Mo 13:00
 --
 
 This looks like a very good way to handle this use case.
 
 The daily agenda is really about what is up today, and it
 should tell you in the morning what stuff is waiting for you
 instead of giving you nasty surprises at 3 in the afternoon.
 
 You can add a repeater to both the deadline and the
 scheduled item, they will both be kicked forward when
 you mark the entry done.

Ahh, this solves my problem, thanks.  I didn't know they were completed
in one step.

Cheers,
Martin Pohlack


PS.: There is only this little symmetry itching thing left ;-).


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


[Orgmode] Strange hiccups when running in server

2009-07-06 Thread Martin Pohlack
Hi all,

I often edit org-mode files in my emacs server.  After some time,
org-mode behaves strangely and can only be brought back to normal by
rebooting the emacs server.

The symptom is that tree folding does not work anymore.  Everything is
expanded (also when loading new org files) and hitting tab, C-tab
etc. on items results in no action but the message “FOLDED” in the
minibuffer.

I tried to debug this but didn't get too far.

I'm using the following wrapper for (debug …) in order to capture all
the leaf-nodes of the backtraces when single stepping with ‘d’:

--
(defun debug-with-leaf-trace (rest debugger-args)
  Wrapper for debug which generates a backtrace for each step
and captures the current leave node in the backtrace into a
continous trace in another buffer.
  (interactive)
  (with-output-to-temp-buffer _backtraces (backtrace))
  (save-excursion
(set-buffer _backtraces)
(setq err1 (goto-line 4))
(setq start (point))
(setq err2 (beginning-of-line 2))
(setq end (point))
(if (and (eq err1 0) (eq err2 nil))
; this does not really append sometimes but inserts somewhere
; in the middle ?
(append-to-buffer _backtraces2 start end)
  (debug-print XXX\n))
  (debug debugger-args)))
--

I traced org-cycle with above's debug wrapper active on the following
file:

--debug_tab.org---
* a
  b
--

By evaling this:

(debug-on-entry 'org-cycle)
(setq debugger 'debug-with-leaf-trace)

then

  M-x show-all

in the debug_tab.org buffer to trace the closing of a tree part.

I single stepped through the first part but the diverse hooks took
forever to step through, so I hit ‘c’ several times later on in the
trace.

After a first glance, the traces do not show a significant difference
in the first part.  I'm quiet sure, that debugging somehow interferes
with the later part.  Anyway, please find the traces attached.

I'm not sure if this is a sensible approach to debugging this
problem.  How would you go about this?

Cheers,
Martin Pohlack
  implement-debug-on-entry()
* (org-load-modules-maybe)
* (when (or force (not org-modules-loaded)) (mapc (lambda ... ...) org-modules) 
(setq org-modules-loaded t))
* #[(cond rest body) \302\303BE\207 [cond body if progn] 4 
2151788]((or force (not org-modules-loaded)) (mapc (lambda (ext) 
(condition-case nil ... ...)) org-modules) (setq org-modules-loaded t))
* #[(cond rest body) \302\303BE\207 [cond body if progn] 4 
2151788]((or force (not org-modules-loaded)) (mapc (lambda (ext) 
(condition-case nil ... ...)) org-modules) (setq org-modules-loaded t))
* (when (or force (not org-modules-loaded)) (mapc (lambda ... ...) org-modules) 
(setq org-modules-loaded t))
* org-load-modules-maybe()
* (unless (run-hook-with-args-until-success (quote org-tab-first-hook)) (let* 
(... ... ... ... ... ...) (if ... ...) (cond ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ...)))
* #[(cond rest body) \302\303BBB\207 [cond body if nil] 4 
2151976]((run-hook-with-args-until-success (quote org-tab-first-hook)) (let* 
((limit-level ...) (nstars ...) (outline-regexp ...) (bob-special ...) 
(org-cycle-hook ...) (pos ...)) (if (or bob-special ...) (setq arg t)) (cond 
(... ... ...) (... ... ...) (... ...) (...) (... ...) (... ...) (... ...) (... 
...) (buffer-read-only ...) (...) (...) (...) (... ...) (... ...) (t ...
* #[(cond rest body) \302\303BBB\207 [cond body if nil] 4 
2151976]((run-hook-with-args-until-success (quote org-tab-first-hook)) (let* 
((limit-level ...) (nstars ...) (outline-regexp ...) (bob-special ...) 
(org-cycle-hook ...) (pos ...)) (if (or bob-special ...) (setq arg t)) (cond 
(... ... ...) (... ... ...) (... ...) (...) (... ...) (... ...) (... ...) (... 
...) (buffer-read-only ...) (...) (...) (...) (... ...) (... ...) (t ...
* (unless (run-hook-with-args-until-success (quote org-tab-first-hook)) (let* 
(... ... ... ... ... ...) (if ... ...) (cond ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ...)))
* run-hooks(activate-menubar-hook)
* (normal-top-level)
* message(Back to top level.)
* message(Back to top level.)
* normal-top-level()
* run-hooks(activate-menubar-hook)
* (normal-top-level)
* message(Back to top level.)
* message(Back to top level.)
* normal-top-level()
* run-hooks(activate-menubar-hook)
* (normal-top-level)
* normal-top-level()
  implement-debug-on-entry()
* (org-load-modules-maybe)
* (when (or force (not org-modules-loaded)) (mapc (lambda ... ...) org-modules) 
(setq org-modules-loaded t))
* #[(cond rest body) \302\303BE\207 [cond body if progn] 4 
2151788]((or force (not org-modules-loaded)) (mapc (lambda (ext) 
(condition-case nil ... ...)) org-modules) (setq org-modules-loaded t

Re: [Orgmode] [Patch] Add another bullet type (→)

2009-03-16 Thread Martin Pohlack
Carsten Dominik wrote:
 On Mar 16, 2009, at 2:04 AM, Daniel Clemente wrote:

[...]

  However, I have done it always like this:

   - Topic
 - Fact 1
 - Fact 2
 - → Conclusion
 
 
 This is, actually, a much better idea, so let's not go there
 and make the item bullets configurable.  It is possible that
 too much confusion will arrise from it.

This sounds reasonable, thanks.

Cheers,
Martin



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


[Orgmode] [Patch] Add another bullet type (→)

2009-03-13 Thread Martin Pohlack
Hi All,

I tend to use a right arrow (→, U2192) from time to time in plain
lists to separate normal item from conclusions / next actions etc.:

  - Topic
- Fact 1
- Fact 2
→ Conclusion

I would appreciate it if org-mode could support this type of bullet
point.  The attached patch implements what I had in mind.

I'm not sure if the adaptation in /org-cycle-list-bullet/ is useful
for others --- I don't use the arrow for many items in a list, but
only single ones --- But I included it in the patch for completeness.

(Also, there may be better ways to encode unicode chars in regexp than
using the utf-8 encoding, that the patch uses.)

Cheers,
Martin
--- /home/mp26/src/org-mode/lisp/org-list.el2009-03-13 23:42:05.0 
+0100
+++ org-list.el 2009-03-13 19:57:51.0 +0100
@@ -118,7 +118,7 @@
   :type 'integer)
 
 (defvar org-list-beginning-re
-  ^\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) +\\(.*\\)$)
+  ^\\([ \t]*\\)\\([-+*→]\\|[0-9]+[.)]\\) +\\(.*\\)$)
 
 (defcustom org-list-radio-list-templates
   '((latex-mode % BEGIN RECEIVE ORGLST %n
@@ -158,9 +158,9 @@
   (goto-char (point-at-bol))
   (looking-at
(cond
-   ((eq llt t)  \\([ \t]*\\([-+]\\|\\([0-9]+[.)]\\)\\)\\|[ \t]+\\*\\)\\( 
\\|$\\))
-   ((= llt ?.)  \\([ \t]*\\([-+]\\|\\([0-9]+\\.\\)\\)\\|[ \t]+\\*\\)\\( 
\\|$\\))
-   ((= llt ?\)) \\([ \t]*\\([-+]\\|\\([0-9]+))\\)\\|[ \t]+\\*\\)\\( 
\\|$\\))
+   ((eq llt t)  \\([ \t]*\\([-+→]\\|\\([0-9]+[.)]\\)\\)\\|[ 
\t]+\\*\\)\\( \\|$\\))
+   ((= llt ?.)  \\([ \t]*\\([-+→]\\|\\([0-9]+\\.\\)\\)\\|[ 
\t]+\\*\\)\\( \\|$\\))
+   ((= llt ?\)) \\([ \t]*\\([-+→]\\|\\([0-9]+))\\)\\|[ \t]+\\*\\)\\( 
\\|$\\))
(t (error Invalid value of 
`org-plain-list-ordered-item-terminator')))
 
 (defun org-at-item-bullet-p ()
@@ -205,7 +205,7 @@
  (looking-at [ \t]*$)
   (timerp (and descp
(save-match-data
- (string-match ^[-+*][ \t]+[0-9]+:[0-9]+:[0-9]+$
+ (string-match ^[-+*→][ \t]+[0-9]+:[0-9]+:[0-9]+$
descp
   (eow (save-excursion (beginning-of-line 1) (looking-at [ \t]*)
(match-end 0)))
@@ -337,7 +337,7 @@
  (condition-case nil (org-back-to-heading t)
(error (throw 'exit nil)))
  (unless (org-entry-get nil ORDERED) (throw 'exit nil))
- (if (re-search-forward ^[ \t]*[-+*0-9.)] \\[[- ]\\] end t)
+ (if (re-search-forward ^[ \t]*[-+*→0-9.)] \\[[- ]\\] end t)
  (org-current-line)
nil))
 
@@ -360,7 +360,7 @@
  (end (move-marker (make-marker)
(progn (outline-next-heading) (point
  (re \\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\))
- (re-box ^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[- X]\\]\\))
+ (re-box ^[ \t]*\\([-+→*]\\|[0-9]+[.)]\\) +\\(\\[[- X]\\]\\))
  (re-find (concat re \\| re-box))
  beg-cookie end-cookie is-percent c-on c-off lim
  eline curr-ind next-ind continue-from startsearch
@@ -674,7 +674,7 @@
   Cycle through the different itemize/enumerate bullets.
 This cycle the entire list level through the sequence:
 
-   `-' -  `+'  -  `*'  -  `1.'  -  `1)'
+   `-'  -  `+'  -  `→'  -  `*'  -  `1.'  -  `1)'
 
 If WHICH is a string, use that as the new bullet.  If WHICH is an integer,
 0 means `-', 1 means `+' etc.
@@ -688,11 +688,12 @@
 new old)
  (setq new (cond
((and (numberp which)
- (nth (1- which) '(- + * 1. 1)
+ (nth (1- which) '(- + → * 1. 1)
((string-match - current) (if prevp 1) +))
((string-match \\+ current)
-(if prevp - (if (looking-at \\S-) 1. *)))
-   ((string-match \\* current) (if prevp + 1.))
+(if prevp - (if (looking-at \\S-) 1. →)))
+   ((string-match → current) (if prevp + *))
+   ((string-match \\* current) (if prevp → 1.))
((string-match \\. current)
 (if prevp (if (looking-at \\S-) + *) 1)))
((string-match ) current) (if prevp 1. -))
@@ -929,7 +930,7 @@
((and (condition-case nil (progn (org-previous-item) t)
   (error nil))
 (or (forward-char 1) t)
-(re-search-forward ^\\([ \t]*\\([-+]\\|\\([0-9]+[.)]\\)\\)\\|[ 
\t]+\\*\\)\\( \\|$\\) bolpos t))
+(re-search-forward ^\\([ \t]*\\([-+→]\\|\\([0-9]+[.)]\\)\\)\\|[ 
\t]+\\*\\)\\( \\|$\\) bolpos t))
(setq ind-down (org-get-indentation)))
((and (goto-char pos)
 (org-at-item-p))
@@ -956,8 +957,8 @@
   (setq itemsep [0-9]+\\(?:\\.\\|)\\)
 ltype 'ordered))
  ((string-match ^.*:: (match-string 0))
-  (setq itemsep [-+] ltype 'descriptive))
- (t (setq 

[Orgmode] undo grouping

2009-02-25 Thread Martin Pohlack
Hi All,

I hacked together a small workaround for the ungrouped undo-list entries
(undo works only characterwise in org-mode, but usually chunks together
several key strokes in, e.g., text-mode).

I have this piece of code in my emacs startup script.

-–-8---
;; implement undo grouping for org-mode
(setq org-self-insert-command-undo-counter 0)
(defadvice org-self-insert-command (after compact-undo-list () activate)
  Compact the undo list by removing some boundaries.
  (if (not (eq last-command 'org-self-insert-command))
  (setq org-self-insert-command-undo-counter 1)
(if (= org-self-insert-command-undo-counter 20)
(setq org-self-insert-command-undo-counter 1)
  (when ( org-self-insert-command-undo-counter 0)
(when buffer-undo-list
  (when (not (cadr buffer-undo-list)) ; remove nil entry
(setcdr buffer-undo-list (cddr buffer-undo-list)
  (incf org-self-insert-command-undo-counter
-–-8---

The advice post-processes the local buffer-undo-list and removes some
undo-boundaries.  The behavior is modeled after emacs' command_loop.

Feedback welcome.

Cheers,
Martin


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


[Orgmode] undo grouping

2009-02-25 Thread Martin Pohlack
[resent, as the previous attempts didn't make it to the list ...]

Hi All,

I hacked together a small workaround for the ungrouped undo-list entries
(undo works only characterwise in org-mode, but usually chunks together
several key strokes in, e.g., text-mode).

I have this piece of code in my emacs startup script.

-–-8---
;; implement undo grouping for org-mode
(setq org-self-insert-command-undo-counter 0)
(defadvice org-self-insert-command (after compact-undo-list () activate)
  Compact the undo list by removing some boundaries.
  (if (not (eq last-command 'org-self-insert-command))
  (setq org-self-insert-command-undo-counter 1)
(if (= org-self-insert-command-undo-counter 20)
(setq org-self-insert-command-undo-counter 1)
  (when ( org-self-insert-command-undo-counter 0)
(when buffer-undo-list
  (when (not (cadr buffer-undo-list)) ; remove nil entry
(setcdr buffer-undo-list (cddr buffer-undo-list)
  (incf org-self-insert-command-undo-counter
-–-8---

The advice post-processes the local buffer-undo-list and removes some
undo-boundaries.  The behavior is modeled after emacs' command_loop.

Feedback welcome.

Cheers,
Martin



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


Re: [Orgmode] undo grouping

2009-02-25 Thread Martin Pohlack
[...]

 (undo works only characterwise in org-mode, but usually chunks together
  ^ emacs

 several key strokes in, e.g., text-mode).



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