From stephen.berman@gmx.net Tue Dec 1 08:41:05 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 1 Dec 2009 16:41:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.7 required=4.0 tests=AWL,FVGT_m_MULTI_ODD, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB1Gf3sE017359 for ; Tue, 1 Dec 2009 08:41:04 -0800 Received: from mail.gnu.org ([199.232.76.166]:42600 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1NFVmg-0007ps-C0 for emacs-pretest-bug@gnu.org; Tue, 01 Dec 2009 11:41:02 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NFVmd-0004Vk-KH for emacs-pretest-bug@gnu.org; Tue, 01 Dec 2009 11:41:01 -0500 Received: from mail.gmx.net ([213.165.64.20]:40800) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1NFVmd-0004VS-2N for emacs-pretest-bug@gnu.org; Tue, 01 Dec 2009 11:40:59 -0500 Received: (qmail invoked by alias); 01 Dec 2009 16:40:55 -0000 Received: from i59F57E74.versanet.de (EHLO escher.local.home) [89.245.126.116] by mail.gmx.net (mp048) with SMTP; 01 Dec 2009 17:40:55 +0100 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX19/oytoIk9/kzypfEnlHChts5Xf2EjnwfSvRT0Zda 4pbymO1njtfvkp Received: by escher.local.home (Postfix, from userid 1000) id C4A711D1866; Tue, 1 Dec 2009 17:40:53 +0100 (CET) From: Stephen Berman To: emacs-pretest-bug@gnu.org Subject: 23.1.50; including diary entries from narrowed buffers Sender: steve@escher.local.home Date: Tue, 01 Dec 2009 17:40:53 +0100 Message-ID: <87y6lmodey.fsf@escher.local.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Y-GMX-Trusted: 0 X-FuHaFi: 0.53,0.6 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) --=-=-= 1. Save a ~/.todo-do file with entries in two categories, e.g. (this file can be created from emacs -Q, e.g. by calling todo-show): ==cut== -*- mode: todo; todo-categories: ("test" "Todo"); -*- */* --- test */* 2009-11-30 00:47 steve: another item --- End */* --------------------------------------------------------------------------- */* --- Todo */* 2009-11-29 21:48 steve: todo item --- End */* --------------------------------------------------------------------------- ==cut== 2. Save ~/diary with a line to include the todo file: ==cut== #include "~/.todo-do" ==cut== 3. Save ~/.emacs with the following content (or start from emacs -Q and either use the Custom interface for diary-list-entries-hook or eval (add-hook 'diary-list-entries-hook 'diary-include-other-diary-files)): ==cut== (custom-set-variables '(diary-list-entries-hook (quote (diary-include-other-diary-files)))) ==cut== 4. Restart Emacs, type `M-x diary', answer y to the question about applying the local variables list for todo-categories. => A buffer pops up with the following fancy diary display: Tuesday, December 1, 2009 ========================= --- test 2009-11-30 00:47 steve: another item --------------------------------------------------------------------------- --- Todo 2009-11-29 21:48 steve: todo item --------------------------------------------------------------------------- 5. Type `M-x todo-show' to visit the todo file in Todo mode (category "test"), then type type `M-x diary' again. => Now fancy diary display looks like this: Tuesday, December 1, 2009 ========================= 2009-11-29 00:47 steve: another item The output after step 5 is incomplete, in contrast to the output after step 4. (The latter is the intended output, as seen by the lines in ~/.todo-do with the prefix '*/*', which are added to each day's diary entries.) This is because diary-list-entries-2 in diary-lib.el, which contains the search routine for new diary entries, does not take possible narrowing into account, and that is in effect in Todo mode. The patch below fixes this. It assumes that narrowing should always be suspended when searching for new diary entries, which seems reasonable (the alternative would, AFAICT, require checking individual major modes). The problem also exists in Emacs 22, but that needs a separate patch to list-diary-entries, due to this function being split up in Emacs 23. I don't have the Emacs 22 CVS branch at hand, so I can't include the needed patch. Steve Berman 2009-12-01 Stephen Berman * calendar/diary-lib.el (diary-list-entries-2): Use save-restriction and widen in order to include all entries from files being visited with narrowing, as in Todo mode (bug#5XXX). --=-=-= Content-Disposition: inline Content-Description: patch *** emacs/lisp/calendar/diary-lib.el.~1.195.~ 2009-11-12 22:21:21.000000000 +0100 --- emacs/lisp/calendar/diary-lib.el 2009-12-01 17:07:35.000000000 +0100 *************** *** 648,682 **** (if symbol (regexp-quote symbol) "") (mapconcat 'eval date-form "\\)\\(?:"))) entry-start date-start temp) ! (goto-char (point-min)) ! (while (re-search-forward regexp nil t) ! (if backup (re-search-backward "\\<" nil t)) ! ;; regexp moves us past the end of date, onto the next line. ! ;; Trailing whitespace after date not allowed (see diary-file). ! (if (and (bolp) (not (looking-at "[ \t]"))) ! ;; Diary entry that consists only of date. ! (backward-char 1) ! ;; Found a nonempty diary entry--make it ! ;; visible and add it to the list. ! (setq date-start (line-end-position 0)) ! ;; Actual entry starts on the next-line? ! (if (looking-at "[ \t]*\n[ \t]") (forward-line 1)) ! (setq entry-found t ! entry-start (point)) ! (forward-line 1) ! (while (looking-at "[ \t]") ; continued entry ! (forward-line 1)) ! (unless (and (eobp) (not (bolp))) ! (backward-char 1)) ! (unless list-only ! (remove-overlays date-start (point) 'invisible 'diary)) ! (setq temp (diary-pull-attrs ! (buffer-substring-no-properties ! entry-start (point)) globattr)) ! (diary-add-to-list ! (or gdate date) (car temp) ! (buffer-substring-no-properties (1+ date-start) (1- entry-start)) ! (copy-marker entry-start) (cadr temp)))))) entry-found)) (defvar original-date) ; from diary-list-entries --- 648,684 ---- (if symbol (regexp-quote symbol) "") (mapconcat 'eval date-form "\\)\\(?:"))) entry-start date-start temp) ! (save-restriction ! (widen) ! (goto-char (point-min)) ! (while (re-search-forward regexp nil t) ! (if backup (re-search-backward "\\<" nil t)) ! ;; regexp moves us past the end of date, onto the next line. ! ;; Trailing whitespace after date not allowed (see diary-file). ! (if (and (bolp) (not (looking-at "[ \t]"))) ! ;; Diary entry that consists only of date. ! (backward-char 1) ! ;; Found a nonempty diary entry--make it ! ;; visible and add it to the list. ! (setq date-start (line-end-position 0)) ! ;; Actual entry starts on the next-line? ! (if (looking-at "[ \t]*\n[ \t]") (forward-line 1)) ! (setq entry-found t ! entry-start (point)) ! (forward-line 1) ! (while (looking-at "[ \t]") ; continued entry ! (forward-line 1)) ! (unless (and (eobp) (not (bolp))) ! (backward-char 1)) ! (unless list-only ! (remove-overlays date-start (point) 'invisible 'diary)) ! (setq temp (diary-pull-attrs ! (buffer-substring-no-properties ! entry-start (point)) globattr)) ! (diary-add-to-list ! (or gdate date) (car temp) ! (buffer-substring-no-properties (1+ date-start) (1- entry-start)) ! (copy-marker entry-start) (cadr temp))))))) entry-found)) (defvar original-date) ; from diary-list-entries --=-=-=-- From rgm@gnu.org Tue Dec 1 19:05:48 2009 Received: (at 5093-done) by emacsbugs.donarmstrong.com; 2 Dec 2009 03:05:48 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-7.2 required=4.0 tests=AWL,HAS_BUG_NUMBER, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB235lQ2008273 for <5093-done@emacsbugs.donarmstrong.com>; Tue, 1 Dec 2009 19:05:48 -0800 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1NFfXG-0006jy-Ol; Tue, 01 Dec 2009 22:05:46 -0500 From: Glenn Morris To: 5093-done@debbugs.gnu.org Subject: Re: bug#5093: 23.1.50; including diary entries from narrowed buffers References: <87y6lmodey.fsf@escher.local.home> X-Spook: SWAT ASPIC MD5 LLNL SCUD missile Baranyi Fedayeen X-Ran: /Wq0EAt)k6UN=!'rO0>&Y_%A*65(>b[Y!M)"z2Io*3joBN*+qI-],(C(}kUr0vICZ67mbu X-Hue: blue X-Debbugs-No-Ack: yes X-Attribution: GM Date: Tue, 01 Dec 2009 22:05:46 -0500 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I installed a similar fix. From unknown Fri Sep 05 08:20:29 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 30 Dec 2009 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator