unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Bastien <bzg@gnu.org>
Cc: emacs-devel@gnu.org
Subject: New version of todo-mode.el (code)
Date: Mon, 10 Jun 2013 22:51:41 +0200	[thread overview]
Message-ID: <87zjux8zaa.fsf@rosalinde.fritz.box> (raw)
In-Reply-To: <87mwqyt40l.fsf@bzg.ath.cx> (Bastien's message of "Mon, 10 Jun 2013 16:49:14 +0200")

[-- Attachment #1: Type: text/plain, Size: 3616 bytes --]

On Mon, 10 Jun 2013 16:49:14 +0200 Bastien <bzg@gnu.org> wrote:

> Stephen Berman <stephen.berman@gmx.net> writes:
>
>> I think it would be if I compressed it, but I'm still waiting for
>> the go-ahead from the list admin or someone else who knows.
>
> I suggest you go ahead and send the compressed version on the list.
> If this is not acceptable, it will not be accepted and publishing it
> elsewhere will be the solution.  But I guess it will be accepted.

Your argument (plus an unfortunate mistake I just made, which I posted
separately about) convinces me, so here it is (I hope), compressed with
bzip2.  I'm also attaching a patch for diary-lib.el, which is needed if
todo files made using the package are included in the diary file for the
Fancy Diary display.

Steve Berman

*** /home/steve/bzr/emacs/trunk/lisp/calendar/diary-lib.el	2013-06-05 11:41:31.000000000 +0200
--- /home/steve/bzr/emacs/todos/lisp/calendar/diary-lib.el	2013-06-10 22:28:48.000000000 +0200
***************
*** 1040,1063 ****
    "Jump to the diary entry for the BUTTON at point."
    (let* ((locator (button-get button 'locator))
           (marker (car locator))
!          markbuf file)
      ;; If marker pointing to diary location is valid, use that.
      (if (and marker (setq markbuf (marker-buffer marker)))
          (progn
            (pop-to-buffer markbuf)
!           (goto-char (marker-position marker)))
        ;; Marker is invalid (eg buffer has been killed).
        (or (and (setq file (cadr locator))
                 (file-exists-p file)
                 (find-file-other-window file)
                 (progn
                   (when (eq major-mode (default-value 'major-mode)) (diary-mode))
                   (goto-char (point-min))
!                  (if (re-search-forward (format "%s.*\\(%s\\)"
!                                                 (regexp-quote (nth 2 locator))
!                                                 (regexp-quote (nth 3 locator)))
!                                         nil t)
!                      (goto-char (match-beginning 1)))))
            (message "Unable to locate this diary entry")))))
  
  (defun diary-fancy-display ()
--- 1040,1073 ----
    "Jump to the diary entry for the BUTTON at point."
    (let* ((locator (button-get button 'locator))
           (marker (car locator))
!          markbuf file opoint)
!     ;; FIXME: Is there a better way to conditionally require todos.el?
!     (catch 'found
!       (dolist (f diary-included-files)
! 	(when (string-match "\\.todo\\'" f)
! 	  (require 'todos)
! 	  (throw 'found nil))))
      ;; If marker pointing to diary location is valid, use that.
      (if (and marker (setq markbuf (marker-buffer marker)))
          (progn
            (pop-to-buffer markbuf)
! 	  (when (eq major-mode 'todos-mode) (widen))
!           (goto-char (marker-position marker))
! 	  (todos-diary-goto-entry))
        ;; Marker is invalid (eg buffer has been killed).
        (or (and (setq file (cadr locator))
                 (file-exists-p file)
                 (find-file-other-window file)
                 (progn
                   (when (eq major-mode (default-value 'major-mode)) (diary-mode))
+ 		 (when (eq major-mode 'todos-mode) (widen))
                   (goto-char (point-min))
!                  (when (re-search-forward (format "%s.*\\(%s\\)"
! 						  (regexp-quote (nth 2 locator))
! 						  (regexp-quote (nth 3 locator)))
! 					  nil t)
! 		   (goto-char (match-beginning 1))
! 		   (todos-diary-goto-entry))))
            (message "Unable to locate this diary entry")))))
  
  (defun diary-fancy-display ()


[-- Attachment #2: todos.el -- new version of todo-mode.el --]
[-- Type: application/x-bzip2, Size: 46008 bytes --]

  reply	other threads:[~2013-06-10 20:51 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-09 23:31 New version of todo-mode.el (announcement + user guide) Stephen Berman
2013-06-10 13:24 ` Bastien
2013-06-10 14:35   ` Stephen Berman
2013-06-10 14:49     ` Bastien
2013-06-10 20:51       ` Stephen Berman [this message]
2013-08-30 18:31         ` New version of todo-mode.el (code) Jambunathan K
2013-09-08 21:09           ` Stephen Berman
2013-06-10 14:52     ` New version of todo-mode.el (announcement + user guide) Óscar Fuentes
2013-06-10 20:52       ` Stephen Berman
2013-06-11  0:20         ` Stefan Monnier
2013-06-11 18:36           ` Stephen Berman
2013-06-11 21:48             ` Stefan Monnier
2013-06-12 21:37               ` Stephen Berman
2013-06-13  1:06                 ` Stefan Monnier
2013-06-13 20:53                   ` Stephen Berman
2013-06-12 17:28             ` Glenn Morris
2013-06-12 21:26               ` Stefan Monnier
2013-06-12 21:37               ` Stephen Berman
2013-06-13  1:18                 ` Stefan Monnier
2013-06-13 20:53                   ` Stephen Berman
2013-06-14  0:21                     ` Stefan Monnier
2013-06-14 21:37                       ` Stephen Berman
2013-06-15  0:40                         ` Glenn Morris
2013-06-15  1:49                         ` Stefan Monnier
2013-06-15 12:52                           ` Stephen Berman
2013-06-16  0:44                             ` Stefan Monnier
2013-06-16 22:52                               ` Stephen Berman
2013-06-17  0:37                                 ` Stefan Monnier
2013-06-17 19:50                                 ` Glenn Morris
2013-06-17 22:33                                   ` Stephen Berman
2013-06-12 18:30             ` Wolfgang Jenkner
2013-06-12 21:38               ` Stephen Berman
2013-06-13  1:24                 ` Wolfgang Jenkner
2013-06-13 20:54                   ` Stephen Berman
2013-06-13 10:59 ` Vitalie Spinu
2013-06-13 20:54   ` Stephen Berman
2013-08-31  3:55 ` Jambunathan K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zjux8zaa.fsf@rosalinde.fritz.box \
    --to=stephen.berman@gmx.net \
    --cc=bzg@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).