From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Bochannek Subject: How about allowing indirect buffers for agenda restriction? Date: Tue, 31 Oct 2006 00:55:45 -0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GepPT-0005Ns-LX for emacs-orgmode@gnu.org; Tue, 31 Oct 2006 03:55:51 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GepPR-0005Mg-5f for emacs-orgmode@gnu.org; Tue, 31 Oct 2006 03:55:50 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GepPR-0005Ma-15 for emacs-orgmode@gnu.org; Tue, 31 Oct 2006 03:55:49 -0500 Received: from [207.17.137.64] (helo=colo-dns-ext2.juniper.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1GepPQ-00076v-Lp for emacs-orgmode@gnu.org; Tue, 31 Oct 2006 03:55:49 -0500 Received: from magenta.juniper.net (magenta.juniper.net [172.17.28.122]) by colo-dns-ext2.juniper.net (8.12.3/8.12.3) with ESMTP id k9V8tl1Z058797 for ; Tue, 31 Oct 2006 00:55:47 -0800 (PST) (envelope-from alexb@juniper.net) Received: from ALEXB-LT ([172.23.1.114]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id k9V8tjE49726 for ; Tue, 31 Oct 2006 00:55:46 -0800 (PST) (envelope-from alexb@juniper.net) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This is related to the narrowing patch I sent. Basically, I create a indirect buffer clone, which I narrow to my Projects outline, but still want to be able to call agenda commands that limit to the file. Since indirect buffers have no file associated with them, I thought the code below may be sufficient to do what I need it to. Not well tested. Alex. $ diff -bu ../org-4.52/org.el org.el --- ../org-4.52/org.el 2006-10-04 02:14:17.000000000 -0700 +++ org.el 2006-10-31 00:48:09.047839000 -0800 @@ -6883,6 +6884,8 @@ first press `1' to indicate that the agenda should be temporarily (until the next use of \\[org-agenda]) restricted to the current file." (interactive "P") + (save-excursion + (set-buffer (or (buffer-base-buffer) (current-buffer))) (catch 'exit (let ((restrict-ok (and buffer-file-name (org-mode-p))) (buf (current-buffer)) @@ -6995,7 +6998,7 @@ (org-let lprops '(org-occur match))) (t (error "Invalid custom agenda command type %s" type)))) (org-run-agenda-series (cddr entry)))) - (t (error "Invalid key")))))) + (t (error "Invalid key"))))))) ;; FIXME: what is the meaning of WINDOW????? (defun org-run-agenda-series (series &optional window)