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

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

[emacs-wiki-discuss] Re: Problem this morning with marking tasks


From: Sacha Chua
Subject: [emacs-wiki-discuss] Re: Problem this morning with marking tasks
Date: Wed, 15 Dec 2004 01:27:04 +0900
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

John Sullivan <address@hidden> writes:

> After updating dev this morning, when I mark a task status, the X or o appears
> on about the 10th character of the line, over top of the task description.

Oh, dear. That's certainly very odd. This is what planner-mark-task became:

(defun planner-mark-task (mark &optional this-only)
  "Change task status to MARK.
If THIS-ONLY is non-nil, the linked planner page is not
updated."
  (let ((case-fold-search nil)
        (info (planner-current-task-info)))
    (save-excursion
      (when info
        (goto-char (line-beginning-position))
        (skip-chars-forward "^[:space:]" (line-end-position))
        (skip-chars-forward "[:space:]" (line-end-position))
        (delete-char 1)
        (insert mark)
        (unless this-only
          (planner-update-task))))))

It seems to work over here. Could you step through it and see if it's
deleting the right character?
          
We used to delete the entire line, which screwed up save-excursion.
(for the people who are panicking because their system broke; so sorry!)

(defun planner-mark-task (mark &optional this-only)
  "Change task status to MARK.
If THIS-ONLY is non-nil, the linked planner page is not
updated."
  (let ((case-fold-search nil)
        (info (planner-current-task-info)))
    (save-excursion
      (when info
        (delete-region (line-beginning-position)
                       (line-end-position))
        (insert (planner-format-task info nil nil mark))
        (unless this-only
          (planner-update-task))))))
          
-- 
Sacha Chua <address@hidden> - open source geekette
http://sacha.free.net.ph/ - PGP Key ID: 0xE7FDF77C
interests: emacs, gnu/linux, personal information management, CS ed
applying as a Debian new maintainer | looking for a grad school




reply via email to

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