From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: How about allowing indirect buffers for agenda restriction? Date: Tue, 31 Oct 2006 11:40:39 +0100 Message-ID: <107e678a0e53b4bdf713f739698967a3@science.uva.nl> References: Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ger35-00057v-7G for emacs-orgmode@gnu.org; Tue, 31 Oct 2006 05:40:51 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ger32-00056w-Po for emacs-orgmode@gnu.org; Tue, 31 Oct 2006 05:40:50 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ger32-00056e-BA for emacs-orgmode@gnu.org; Tue, 31 Oct 2006 05:40:48 -0500 Received: from [146.50.4.51] (helo=imap.science.uva.nl) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Ger31-0006ra-BO for emacs-orgmode@gnu.org; Tue, 31 Oct 2006 05:40:47 -0500 In-Reply-To: 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: Alex Bochannek Cc: emacs-orgmode@gnu.org There is a better way of doing this, which I am implementing for 4.53. Thanks. - Carsten On Oct 31, 2006, at 9:55, Alex Bochannek wrote: > 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) > > > > _______________________________________________ > Emacs-orgmode mailing list > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > -- Carsten Dominik Sterrenkundig Instituut "Anton Pannekoek" Universiteit van Amsterdam Kruislaan 403 NL-1098SJ Amsterdam phone: +31 20 525 7477