emacs-wiki-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emacs-wiki-discuss] Re: Errors trying to use Planner with XEmacs


From: Michael Olson
Subject: [emacs-wiki-discuss] Re: Errors trying to use Planner with XEmacs
Date: Thu, 25 Aug 2005 12:40:36 -0500
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

Jason Karney <address@hidden> writes:

> One other thing -- previously I was seeing an error about
> (line-beginning-position). When I explicitly require emacs-wiki.el
> in my init.el, that error goes away. I only get this error under
> XEmacs.  It must be something with the compatibility functions,
> although I'm not sure exactly what.

Hmm ... you might want to make sure that you have the latest
emacs-wiki version installed (2.70).  Previous versions messed around
with the XEmacs namespace, causing issues like the one you described.

All instances of line-beginning-position should be changed to
planner-line-beginning-position.  Perhaps, though, we should
s/planner-line-beginning-position/point-at-bol/g and
s/planner-line-end-position/point-at-eol/g, since Emacs21, Emacs22,
and XEmacs21 all have point-at-(b|e)ol.  It would be two less
compatibility functions :^) .  Easier to type, too.

Here's a (corrected) function that still used line-beginning-position.

(defun planner-extract-tasks (pages &optional condition)
  "Parse PAGES and extract all tasks.
If CONDITION is non-nil, it should be a function that
accepts the task info as an argument and returns t if
the task should be added to the list."
  (with-temp-buffer
    (let ((list (planner-file-alist))
          result)
      (while pages
        (erase-buffer)
        (insert-file-contents (cdr (assoc (car pages) list)))
        (goto-char (point-max))
        (while (re-search-backward "^#[A-C]" nil t)
          (let ((info
                 (planner-task-info-from-string
                  (car pages)
                  (buffer-substring
                   (planner-line-beginning-position)
                   (planner-line-end-position)))))
            (when (and info
                       (if condition
                           (funcall condition info)
                         t))
              (setq result (append (list info) result)))))
        (setq pages (cdr pages)))
      result)))

-- 
Michael Olson -- FSF Associate Member #652 -- http://www.mwolson.org/
Interests: anime, Debian, XHTML, wiki, Emacs Lisp
  /` |\ | | | IRC: mwolson on freenode.net: #hcoop, #muse, #pulug
 |_] | \| |_| Jabber: mwolson_at_hcoop.net

Attachment: pgprnzuhomyoV.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]