emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Question re. Bernt's agenda setup
@ 2012-11-15 19:24 Manish
  2012-11-15 21:42 ` Viktor Rosenfeld
  0 siblings, 1 reply; 17+ messages in thread
From: Manish @ 2012-11-15 19:24 UTC (permalink / raw)
  To: Org-Mode

Hello Bernt and others,

I was picking up tips from Bernt's awesome and famous document at
http://doc.norang.ca/org-mode.html.  In section 7.1, just between the
two screenshots, I came across following text:

,----[ excerpt from section 7.1 ]
| After selecting a project (with P on any task in the agenda) the block
| agenda changes to show the project and any subprojects in the Projects
| section. Tasks show project-related tasks that are hidden when not
| narrowed to a project.
`----

The feature/concept seems very useful to be able to zoom into a project
of interest but I could't figure out how =P= helps with this since it
seems to move to previous item while in the ageda view.

Can someone (or Bernt) using the setup point me to right direction
please?

Regards
--Manish

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-15 19:24 Question re. Bernt's agenda setup Manish
@ 2012-11-15 21:42 ` Viktor Rosenfeld
  2012-11-16  7:59   ` Alan Schmitt
                     ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Viktor Rosenfeld @ 2012-11-15 21:42 UTC (permalink / raw)
  To: Manish; +Cc: Org-Mode

Hi Manish,

it's Shift-P and you need to bind the function bh/narrow-to-project to
the keycode. See the code blocks in the following two sections:

http://doc.norang.ca/org-mode.html#SpeedCommands
http://doc.norang.ca/org-mode.html#NarrowToSubtree

Cheers,
Viktor

PS: I agree that Bernt's document is absolutely awesome!


Manish wrote:

> Hello Bernt and others,
> 
> I was picking up tips from Bernt's awesome and famous document at
> http://doc.norang.ca/org-mode.html.  In section 7.1, just between the
> two screenshots, I came across following text:
> 
> ,----[ excerpt from section 7.1 ]
> | After selecting a project (with P on any task in the agenda) the block
> | agenda changes to show the project and any subprojects in the Projects
> | section. Tasks show project-related tasks that are hidden when not
> | narrowed to a project.
> `----
> 
> The feature/concept seems very useful to be able to zoom into a project
> of interest but I could't figure out how =P= helps with this since it
> seems to move to previous item while in the ageda view.
> 
> Can someone (or Bernt) using the setup point me to right direction
> please?
> 
> Regards
> --Manish
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-15 21:42 ` Viktor Rosenfeld
@ 2012-11-16  7:59   ` Alan Schmitt
  2012-11-16 10:55     ` Viktor Rosenfeld
  2012-11-16 11:58   ` Manish
  2012-11-24  6:47   ` Bernt Hansen
  2 siblings, 1 reply; 17+ messages in thread
From: Alan Schmitt @ 2012-11-16  7:59 UTC (permalink / raw)
  To: Manish; +Cc: Org-Mode

Viktor Rosenfeld <listuser36@gmail.com> writes:

> Hi Manish,
>
> it's Shift-P and you need to bind the function bh/narrow-to-project to
> the keycode. See the code blocks in the following two sections:
>
> http://doc.norang.ca/org-mode.html#SpeedCommands
> http://doc.norang.ca/org-mode.html#NarrowToSubtree

I managed to make this work, but if I run the command in the agenda I
need to refresh it afterwards (using 'g'). Are you seeing the same
thing?

And I also want to say I have learned a lot implementing the suggestions
in that document.

Alan

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-16  7:59   ` Alan Schmitt
@ 2012-11-16 10:55     ` Viktor Rosenfeld
  2012-11-24  6:55       ` Bernt Hansen
  0 siblings, 1 reply; 17+ messages in thread
From: Viktor Rosenfeld @ 2012-11-16 10:55 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: Org-Mode

Alan Schmitt wrote:

> Viktor Rosenfeld <listuser36@gmail.com> writes:
> 
> > Hi Manish,
> >
> > it's Shift-P and you need to bind the function bh/narrow-to-project to
> > the keycode. See the code blocks in the following two sections:
> >
> > http://doc.norang.ca/org-mode.html#SpeedCommands
> > http://doc.norang.ca/org-mode.html#NarrowToSubtree
> 
> I managed to make this work, but if I run the command in the agenda I
> need to refresh it afterwards (using 'g'). Are you seeing the same
> thing?

Yes, unfortunately. I think I remember that it used to refresh the
agenda automatically. This is above my pay grade, I'm afraid.

Cheers,
Viktor

> 
> And I also want to say I have learned a lot implementing the suggestions
> in that document.
> 
> Alan
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-15 21:42 ` Viktor Rosenfeld
  2012-11-16  7:59   ` Alan Schmitt
@ 2012-11-16 11:58   ` Manish
  2012-11-16 13:09     ` Memnon Anon
  2012-11-24  6:47   ` Bernt Hansen
  2 siblings, 1 reply; 17+ messages in thread
From: Manish @ 2012-11-16 11:58 UTC (permalink / raw)
  To: Manish, Org-Mode

  >> Hello Bernt and others,
  >>
  >> I was picking up tips from Bernt's awesome and famous document at
  >> http://doc.norang.ca/org-mode.html.  In section 7.1, just between
  >> the two screenshots, I came across following text:
  >>
  >> ,----[ excerpt from section 7.1 ]
  >> | After selecting a project (with P on any task in the agenda) the
  >> | block agenda changes to show the project and any subprojects in
  >> | the Projects section. Tasks show project-related tasks that are
  >> | hidden when not narrowed to a project.
  >> `----
  >>
  >> The feature/concept seems very useful to be able to zoom into a
  >> project of interest but I could't figure out how =P= helps with
  >> this since it seems to move to previous item while in the ageda
  >> view.
  >>
  >> Can someone (or Bernt) using the setup point me to right direction
  >> please?

  On Fri, Nov 16, 2012 at 3:12 AM, Viktor Rosenfeld wrote:
  > Hi Manish,
  >
  > it's Shift-P and you need to bind the function bh/narrow-to-project
  > to the keycode. See the code blocks in the following two sections:
  >
  > http://doc.norang.ca/org-mode.html#SpeedCommands
  > http://doc.norang.ca/org-mode.html#NarrowToSubtree
  >

Thank you!  I should learn to read better, I guess.  By any chance,
would you also know if all the configuration is available in one place,
perhaps a git repo (it's not in org-mode-doc repo) or perhaps a way to
pick out all #+begin_src parts from the .org version?

Cheers,
Manish

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-16 11:58   ` Manish
@ 2012-11-16 13:09     ` Memnon Anon
  2012-11-17 12:55       ` Manish
  2012-11-24  6:50       ` Bernt Hansen
  0 siblings, 2 replies; 17+ messages in thread
From: Memnon Anon @ 2012-11-16 13:09 UTC (permalink / raw)
  To: emacs-orgmode

Manish <mailtomanish.sharma@gmail.com> writes:

> a way to
> pick out all #+begin_src parts from the .org version?

(org-babel-tangle &optional ONLY-THIS-BLOCK TARGET-FILE LANG),
bound to `C-c C-v t' by default.
Not all emacs-lisp blocks are set to :tangle yes, though.

Or use a quick Keyboard macro (info "(emacs)Keyboard Macros") .

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-16 13:09     ` Memnon Anon
@ 2012-11-17 12:55       ` Manish
  2012-11-18 16:05         ` Manish
  2012-11-24  6:50       ` Bernt Hansen
  1 sibling, 1 reply; 17+ messages in thread
From: Manish @ 2012-11-17 12:55 UTC (permalink / raw)
  To: Memnon Anon; +Cc: Org-Mode

On Fri, Nov 16, 2012 at 6:39 PM, Memnon Anon wrote:
>
> Manish writes:
>
> > a way to
> > pick out all #+begin_src parts from the .org version?
>
> (org-babel-tangle &optional ONLY-THIS-BLOCK TARGET-FILE LANG),
> bound to `C-c C-v t' by default.
> Not all emacs-lisp blocks are set to :tangle yes, though.
>

> Or use a quick Keyboard macro (info "(emacs)Keyboard Macros") .
>

Thank you.

Last night I went through the .org version trimming it line-by-line.  It
was not efficient but it forced me to go slow and read carefully.  It
was so much more enlightening to see the workflow of an org expert.
Midway through the file I realized that this _is_ the .emacs I was
looking for. :-)

=F12 SPC= with =V= is so much better at doing project reviews than
anything else I have ever seen.  My only gripe is that functions called
by =V= and =P= do not refresh the agenda.  I am trying to understand
enough elisp to be able to call org-agenda-redo and beginning-of-buffer
in some right places..

I am officially a fan now.

Cheers!
--Manish

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-17 12:55       ` Manish
@ 2012-11-18 16:05         ` Manish
  2012-11-19 14:04           ` Alan Schmitt
  0 siblings, 1 reply; 17+ messages in thread
From: Manish @ 2012-11-18 16:05 UTC (permalink / raw)
  To: Memnon Anon; +Cc: Org-Mode

On Sat, Nov 17, 2012 at 6:25 PM, Manish wrote:
[snip (21 lines)]
>
> =F12 SPC= with =V= is so much better at doing project reviews than
> anything else I have ever seen.  My only gripe is that functions called
> by =V= and =P= do not refresh the agenda.  I am trying to understand
> enough elisp to be able to call org-agenda-redo and beginning-of-buffer
> in some right places..

My bad.  While making the same setup from scratch in home laptop found
that everything works as advertised.  My work setup must have something
interfering with it.

Cheers!
Manish

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-18 16:05         ` Manish
@ 2012-11-19 14:04           ` Alan Schmitt
  2012-11-19 19:18             ` Manish
  0 siblings, 1 reply; 17+ messages in thread
From: Alan Schmitt @ 2012-11-19 14:04 UTC (permalink / raw)
  To: Manish; +Cc: Memnon Anon, Org-Mode

Manish <mailtomanish.sharma@gmail.com> writes:

> On Sat, Nov 17, 2012 at 6:25 PM, Manish wrote:
> [snip (21 lines)]
>>
>> =F12 SPC= with =V= is so much better at doing project reviews than
>> anything else I have ever seen.  My only gripe is that functions called
>> by =V= and =P= do not refresh the agenda.  I am trying to understand
>> enough elisp to be able to call org-agenda-redo and beginning-of-buffer
>> in some right places..
>
> My bad.  While making the same setup from scratch in home laptop found
> that everything works as advertised.  My work setup must have something
> interfering with it.

I'd be really curious to know what it is. I'm in the same situation here
where the agenda is not refreshed when doing a P or V from within it.
(Doing a W works, though).

Alan

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-19 14:04           ` Alan Schmitt
@ 2012-11-19 19:18             ` Manish
  2012-11-24  7:00               ` Bernt Hansen
  0 siblings, 1 reply; 17+ messages in thread
From: Manish @ 2012-11-19 19:18 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: Memnon Anon, Org-Mode

On Mon, Nov 19, 2012 at 7:34 PM, Alan Schmitt wrote:
> Manish writes:
>
>> On Sat, Nov 17, 2012 at 6:25 PM, Manish wrote:
>> [snip (21 lines)]
>>>
>>> =F12 SPC= with =V= is so much better at doing project reviews than
>>> anything else I have ever seen.  My only gripe is that functions called
>>> by =V= and =P= do not refresh the agenda.  I am trying to understand
>>> enough elisp to be able to call org-agenda-redo and beginning-of-buffer
>>> in some right places..
>>
>> My bad.  While making the same setup from scratch in home laptop found
>> that everything works as advertised.  My work setup must have something
>> interfering with it.
>
> I'd be really curious to know what it is. I'm in the same situation here
> where the agenda is not refreshed when doing a P or V from within it.
> (Doing a W works, though).

Strangely, it refreshes fine on Ubuntu but not on Windows (both with no
code other than Bernt's).  I am using Emacs 24.2 and git head from
master branch.

My half-baked attempts to add some bits to relevant functions to call
org-agenda-redo followed by beginning-of-buffer did not work.  I am now
looking to using AutoHotKey as a duct tape solution.

Cheers!
--Manish

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-15 21:42 ` Viktor Rosenfeld
  2012-11-16  7:59   ` Alan Schmitt
  2012-11-16 11:58   ` Manish
@ 2012-11-24  6:47   ` Bernt Hansen
  2 siblings, 0 replies; 17+ messages in thread
From: Bernt Hansen @ 2012-11-24  6:47 UTC (permalink / raw)
  To: Viktor Rosenfeld; +Cc: Org-Mode

Viktor Rosenfeld <listuser36@gmail.com> writes:

> it's Shift-P and you need to bind the function bh/narrow-to-project to
> the keycode. See the code blocks in the following two sections:
>
> http://doc.norang.ca/org-mode.html#SpeedCommands
> http://doc.norang.ca/org-mode.html#NarrowToSubtree
>
> Cheers,
> Viktor
>
> PS: I agree that Bernt's document is absolutely awesome!
> Manish wrote:
>
>> Hello Bernt and others,
>> 
>> I was picking up tips from Bernt's awesome and famous document at
>> http://doc.norang.ca/org-mode.html.  In section 7.1, just between the
>> two screenshots, I came across following text:


Hi,

Yes it is capital P.  Do I need to make this more explicit in the
document?

My document is famous??!!??  Eeek! :)

Thanks for the feedback :)

Regards,
Bernt

PS. I'm a bit behind in reading the org-mode list... almost 1000 unread
    messages :(.  If you want a faster response please send emails
    directly to me and cc the list.

>> 
>> ,----[ excerpt from section 7.1 ]
>> | After selecting a project (with P on any task in the agenda) the block
>> | agenda changes to show the project and any subprojects in the Projects
>> | section. Tasks show project-related tasks that are hidden when not
>> | narrowed to a project.
>> `----
>> 
>> The feature/concept seems very useful to be able to zoom into a project
>> of interest but I could't figure out how =P= helps with this since it
>> seems to move to previous item while in the ageda view.
>> 
>> Can someone (or Bernt) using the setup point me to right direction
>> please?
>> 
>> Regards
>> --Manish
>> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-16 13:09     ` Memnon Anon
  2012-11-17 12:55       ` Manish
@ 2012-11-24  6:50       ` Bernt Hansen
  1 sibling, 0 replies; 17+ messages in thread
From: Bernt Hansen @ 2012-11-24  6:50 UTC (permalink / raw)
  To: Memnon Anon, Manish; +Cc: emacs-orgmode

Memnon Anon <gegendosenfleisch@googlemail.com> writes:

> Manish <mailtomanish.sharma@gmail.com> writes:
>
>> a way to
>> pick out all #+begin_src parts from the .org version?
>
> (org-babel-tangle &optional ONLY-THIS-BLOCK TARGET-FILE LANG),
> bound to `C-c C-v t' by default.
> Not all emacs-lisp blocks are set to :tangle yes, though.

The org version of the document is available at
http://doc.norang.ca/org-mode.org

You should be able to load that in org-mode and then tangle it with C-c
C-v C-t to generate org-mode.el with all of the elisp from the document
in it.

Some of the code blocks in the document are explicitly set to :tangle no
because one or more of the following apply:

  - The code block is replaced with another that allows overriding
    values in a users .emacs
  - The code block shows an old setting that I don't use anymore
  - The code block is a repeat of a setting that is included in another
    block

Let me know if you find something missing from the tangled version that
you think should be there.

I guess I should add a "How To Use This Document" section with these
details.

Thanks for the feedback :)

Regards,
Bernt

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-16 10:55     ` Viktor Rosenfeld
@ 2012-11-24  6:55       ` Bernt Hansen
  2012-11-25 17:53         ` Manish
  0 siblings, 1 reply; 17+ messages in thread
From: Bernt Hansen @ 2012-11-24  6:55 UTC (permalink / raw)
  To: Viktor Rosenfeld; +Cc: Alan Schmitt, Org-Mode

Viktor Rosenfeld <listuser36@gmail.com> writes:

> Alan Schmitt wrote:
>
>> Viktor Rosenfeld <listuser36@gmail.com> writes:
>> 
>> > it's Shift-P and you need to bind the function bh/narrow-to-project to
>> > the keycode. See the code blocks in the following two sections:
>> >
>> > http://doc.norang.ca/org-mode.html#SpeedCommands
>> > http://doc.norang.ca/org-mode.html#NarrowToSubtree
>> 
>> I managed to make this work, but if I run the command in the agenda I
>> need to refresh it afterwards (using 'g'). Are you seeing the same
>> thing?
>
> Yes, unfortunately. I think I remember that it used to refresh the
> agenda automatically. This is above my pay grade, I'm afraid.
>
> Cheers,
> Viktor
>
>> 
>> And I also want to say I have learned a lot implementing the suggestions
>> in that document.
>> 
>> Alan

I have also noticed this in Windows at work and actually toyed with the
idea of dropping the commands from the agenda that don't refresh
properly anymore ... but quickly found I can't live without that
functionality.  So I too am doing 'g' to refresh as required ATM.

If I figure out a fix I'll post that.

Thanks for the feedback :)

Regards,
Bernt

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-19 19:18             ` Manish
@ 2012-11-24  7:00               ` Bernt Hansen
  0 siblings, 0 replies; 17+ messages in thread
From: Bernt Hansen @ 2012-11-24  7:00 UTC (permalink / raw)
  To: Manish; +Cc: Alan Schmitt, Org-Mode, Memnon Anon

Manish <mailtomanish.sharma@gmail.com> writes:

> On Mon, Nov 19, 2012 at 7:34 PM, Alan Schmitt wrote:
>> Manish writes:
>>
>>> On Sat, Nov 17, 2012 at 6:25 PM, Manish wrote:
>>> [snip (21 lines)]
>>>>
>>>> =F12 SPC= with =V= is so much better at doing project reviews than
>>>> anything else I have ever seen.  My only gripe is that functions called
>>>> by =V= and =P= do not refresh the agenda.  I am trying to understand
>>>> enough elisp to be able to call org-agenda-redo and beginning-of-buffer
>>>> in some right places..
>>>
>>> My bad.  While making the same setup from scratch in home laptop found
>>> that everything works as advertised.  My work setup must have something
>>> interfering with it.
>>
>> I'd be really curious to know what it is. I'm in the same situation here
>> where the agenda is not refreshed when doing a P or V from within it.
>> (Doing a W works, though).
>
> Strangely, it refreshes fine on Ubuntu but not on Windows (both with no
> code other than Bernt's).  I am using Emacs 24.2 and git head from
> master branch.
>
> My half-baked attempts to add some bits to relevant functions to call
> org-agenda-redo followed by beginning-of-buffer did not work.  I am now
> looking to using AutoHotKey as a duct tape solution.

I've noticed this as well.  I'm using Emacs 23.2 on Debian Linux and
23.1 (I think) on Windows at work.  It may be related to changes in git
master but I haven't had time to look into it yet and won't before the
Christmas holidays with my current work schedule.

Regards,
Bernt

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-24  6:55       ` Bernt Hansen
@ 2012-11-25 17:53         ` Manish
  2012-11-26  0:45           ` Bernt Hansen
  0 siblings, 1 reply; 17+ messages in thread
From: Manish @ 2012-11-25 17:53 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: Alan Schmitt, Org-Mode

On Sat, Nov 24, 2012 at 12:25 PM, Bernt Hansen wrote:
> Viktor Rosenfeld writes:
>
>> Alan Schmitt wrote:
>>
>>> Viktor Rosenfeld writes:
>>>
>>> > it's Shift-P and you need to bind the function bh/narrow-to-project to
>>> > the keycode. See the code blocks in the following two sections:
>>> >
>>> > http://doc.norang.ca/org-mode.html#SpeedCommands
>>> > http://doc.norang.ca/org-mode.html#NarrowToSubtree
>>>
>>> I managed to make this work, but if I run the command in the agenda I
>>> need to refresh it afterwards (using 'g'). Are you seeing the same
>>> thing?
>>
>> Yes, unfortunately. I think I remember that it used to refresh the
>> agenda automatically. This is above my pay grade, I'm afraid.
>>
>> Cheers,
>> Viktor
>>
>>>
>>> And I also want to say I have learned a lot implementing the suggestions
>>> in that document.
>>>
>>> Alan
>
> I have also noticed this in Windows at work and actually toyed with the
> idea of dropping the commands from the agenda that don't refresh
> properly anymore ... but quickly found I can't live without that
> functionality.  So I too am doing 'g' to refresh as required ATM.
>
> If I figure out a fix I'll post that.

Meanwhile after wasting a couple of hours trying to make it work with
AutoHotKey, I just recorded an Emacs macro, named and dumped it and tied
it to a keychord. Following seems to be working well for me:

#+begin_src emacs-lisp
;; work around for V not refreshing on Windows
;; use when in agenda after F12-SPC
(global-set-key (kbd "C-<f7>")
                (fset 'my-next-project
                      (lambda (&optional arg) "Keyboard macro."
                        (interactive "p")
                        (kmacro-exec-ring-item (quote ("Vg\274" 0 "%d")) arg))))
#+end_src

Cheers
Manish

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-25 17:53         ` Manish
@ 2012-11-26  0:45           ` Bernt Hansen
  2012-11-27  6:12             ` Manish
  0 siblings, 1 reply; 17+ messages in thread
From: Bernt Hansen @ 2012-11-26  0:45 UTC (permalink / raw)
  To: Manish; +Cc: Alan Schmitt, Org-Mode

Manish <mailtomanish.sharma@gmail.com> writes:

> On Sat, Nov 24, 2012 at 12:25 PM, Bernt Hansen wrote:
>> Viktor Rosenfeld writes:
>>
>>> Alan Schmitt wrote:
>>>
>>>> Viktor Rosenfeld writes:
>>>>
>>>> > it's Shift-P and you need to bind the function bh/narrow-to-project to
>>>> > the keycode. See the code blocks in the following two sections:
>>>> >
>>>> > http://doc.norang.ca/org-mode.html#SpeedCommands
>>>> > http://doc.norang.ca/org-mode.html#NarrowToSubtree
>>>>
>>>> I managed to make this work, but if I run the command in the agenda I
>>>> need to refresh it afterwards (using 'g'). Are you seeing the same
>>>> thing?
>>>
>>> Yes, unfortunately. I think I remember that it used to refresh the
>>> agenda automatically. This is above my pay grade, I'm afraid.
>>>
>>> Cheers,
>>> Viktor
>>>
>>>>
>>>> And I also want to say I have learned a lot implementing the suggestions
>>>> in that document.
>>>>
>>>> Alan
>>
>> I have also noticed this in Windows at work and actually toyed with the
>> idea of dropping the commands from the agenda that don't refresh
>> properly anymore ... but quickly found I can't live without that
>> functionality.  So I too am doing 'g' to refresh as required ATM.
>>
>> If I figure out a fix I'll post that.
>
> Meanwhile after wasting a couple of hours trying to make it work with
> AutoHotKey, I just recorded an Emacs macro, named and dumped it and tied
> it to a keychord. Following seems to be working well for me:
>
> #+begin_src emacs-lisp
> ;; work around for V not refreshing on Windows
> ;; use when in agenda after F12-SPC
> (global-set-key (kbd "C-<f7>")
>                 (fset 'my-next-project
>                       (lambda (&optional arg) "Keyboard macro."
>                         (interactive "p")
>                         (kmacro-exec-ring-item (quote ("Vg\274" 0 "%d")) arg))))
> #+end_src

This workaround also seems to fix V on windows:

--8<---------------cut here---------------start------------->8---
(defun bh/view-next-project ()
  (interactive)
  (unless (marker-position org-agenda-restrict-begin)
    (goto-char (point-min))
    (setq bh/current-view-project (point)))
  (bh/widen)
  (goto-char bh/current-view-project)
  (forward-visible-line 1)
  (while (and (< (point) (point-max))
	      (or (not (org-get-at-bol 'org-hd-marker))
		  (org-with-point-at (org-get-at-bol 'org-hd-marker)
		    (or (not (bh/is-project-p))
			(bh/is-project-subtree-p)))))
    (forward-visible-line 1))
  (setq bh/current-view-project (point))
  (if (org-get-at-bol 'org-hd-marker)
      (progn
	(bh/narrow-to-project)
	(org-agenda-redo)
	(beginning-of-buffer))
    (error "All projects viewed.")))
--8<---------------cut here---------------end--------------->8---

I would prefer something that is consistent on linux and windows
though...

Regards,
Bernt

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Question re. Bernt's agenda setup
  2012-11-26  0:45           ` Bernt Hansen
@ 2012-11-27  6:12             ` Manish
  0 siblings, 0 replies; 17+ messages in thread
From: Manish @ 2012-11-27  6:12 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: Alan Schmitt, Org-Mode

On Mon, Nov 26, 2012 at 6:15 AM, Bernt Hansen wrote:
> Manish writes:
>
>> On Sat, Nov 24, 2012 at 12:25 PM, Bernt Hansen wrote:
>>> Viktor Rosenfeld writes:
>>>
>>>> Alan Schmitt wrote:
>>>>
>>>>> Viktor Rosenfeld writes:
>>>>>
>>>>> > it's Shift-P and you need to bind the function bh/narrow-to-project to
>>>>> > the keycode. See the code blocks in the following two sections:
>>>>> >
>>>>> > http://doc.norang.ca/org-mode.html#SpeedCommands
>>>>> > http://doc.norang.ca/org-mode.html#NarrowToSubtree
>>>>>
>>>>> I managed to make this work, but if I run the command in the agenda I
>>>>> need to refresh it afterwards (using 'g'). Are you seeing the same
>>>>> thing?
>>>>
>>>> Yes, unfortunately. I think I remember that it used to refresh the
>>>> agenda automatically. This is above my pay grade, I'm afraid.
>>>>
>>>> Cheers,
>>>> Viktor
>>>>
>>>>>
>>>>> And I also want to say I have learned a lot implementing the suggestions
>>>>> in that document.
>>>>>
>>>>> Alan
>>>
>>> I have also noticed this in Windows at work and actually toyed with the
>>> idea of dropping the commands from the agenda that don't refresh
>>> properly anymore ... but quickly found I can't live without that
>>> functionality.  So I too am doing 'g' to refresh as required ATM.
>>>
>>> If I figure out a fix I'll post that.
>>
>> Meanwhile after wasting a couple of hours trying to make it work with
>> AutoHotKey, I just recorded an Emacs macro, named and dumped it and tied
>> it to a keychord. Following seems to be working well for me:
>>
>> #+begin_src emacs-lisp
>> ;; work around for V not refreshing on Windows
>> ;; use when in agenda after F12-SPC
>> (global-set-key (kbd "C-<f7>")
>>                 (fset 'my-next-project
>>                       (lambda (&optional arg) "Keyboard macro."
>>                         (interactive "p")
>>                         (kmacro-exec-ring-item (quote ("Vg\274" 0 "%d")) arg))))
>> #+end_src
>
> This workaround also seems to fix V on windows:
>
> --8<---------------cut here---------------start------------->8---
> (defun bh/view-next-project ()
>   (interactive)
>   (unless (marker-position org-agenda-restrict-begin)
>     (goto-char (point-min))
>     (setq bh/current-view-project (point)))
>   (bh/widen)
>   (goto-char bh/current-view-project)
>   (forward-visible-line 1)
>   (while (and (< (point) (point-max))
>               (or (not (org-get-at-bol 'org-hd-marker))
>                   (org-with-point-at (org-get-at-bol 'org-hd-marker)
>                     (or (not (bh/is-project-p))
>                         (bh/is-project-subtree-p)))))
>     (forward-visible-line 1))
>   (setq bh/current-view-project (point))
>   (if (org-get-at-bol 'org-hd-marker)
>       (progn
>         (bh/narrow-to-project)
>         (org-agenda-redo)
>         (beginning-of-buffer))
>     (error "All projects viewed.")))
> --8<---------------cut here---------------end--------------->8---
>
> I would prefer something that is consistent on linux and windows
> though...

Nice. Thanks.  I will try to find the right place to place a progn to
wrap narrow, redo and b-o-b to fix =P= as well. :)

Cheers
Manish

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-11-27  6:12 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-15 19:24 Question re. Bernt's agenda setup Manish
2012-11-15 21:42 ` Viktor Rosenfeld
2012-11-16  7:59   ` Alan Schmitt
2012-11-16 10:55     ` Viktor Rosenfeld
2012-11-24  6:55       ` Bernt Hansen
2012-11-25 17:53         ` Manish
2012-11-26  0:45           ` Bernt Hansen
2012-11-27  6:12             ` Manish
2012-11-16 11:58   ` Manish
2012-11-16 13:09     ` Memnon Anon
2012-11-17 12:55       ` Manish
2012-11-18 16:05         ` Manish
2012-11-19 14:04           ` Alan Schmitt
2012-11-19 19:18             ` Manish
2012-11-24  7:00               ` Bernt Hansen
2012-11-24  6:50       ` Bernt Hansen
2012-11-24  6:47   ` Bernt Hansen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).