From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manish Subject: Re: Question re. Bernt's agenda setup Date: Tue, 27 Nov 2012 11:42:01 +0530 Message-ID: References: <20121115214217.GA5492@kenny.fritz.box> <20121116105558.GA6576@kenny.fritz.box> <8738zztrqo.fsf@norang.ca> <87ehjhp4yk.fsf@norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:55018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdEPK-00006l-Hi for emacs-orgmode@gnu.org; Tue, 27 Nov 2012 01:12:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdEPJ-00079g-Ak for emacs-orgmode@gnu.org; Tue, 27 Nov 2012 01:12:34 -0500 Received: from mail-pb0-f41.google.com ([209.85.160.41]:33680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdEPJ-00079b-4J for emacs-orgmode@gnu.org; Tue, 27 Nov 2012 01:12:33 -0500 Received: by mail-pb0-f41.google.com with SMTP id xa7so8880388pbc.0 for ; Mon, 26 Nov 2012 22:12:31 -0800 (PST) In-Reply-To: <87ehjhp4yk.fsf@norang.ca> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org 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-") >> (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