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

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

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


From: John Sullivan
Subject: Re: [emacs-wiki-discuss] Re: Problem this morning with marking tasks
Date: Tue, 14 Dec 2004 22:46:00 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Dryice Liu <address@hidden> writes:

> Sacha Chua <address@hidden> wrote:
>
>> 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.
>
> I got the same problem here, "GNU Emacs 21.3.1 (i386--freebsd, X toolkit, 
> Xaw3d scroll bars)
>  of 2004-10-16 on gohan13.freebsd.org"
>
>> 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))
>
> After this line, the cursor stops at some where random in the task
> description. Didn't figure out a pattern though.
>

So, (skip-chars-forward "^[:space:]") working properly is a CVSism.

This replacement seems to be working for me:

(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
      (if (null info)
          (error "There is no task on the current line.")
        (goto-char (line-beginning-position))
        (while (not (looking-at "[[:space:]]"))
          (forward-char))
        (while (looking-at "[[:space:]]")
          (forward-char))
        (delete-char 1)
        (insert mark)
        (unless this-only
          (planner-update-task))))))

Not sure if that (error) is warranted or not, but maybe it is :)

-- 
[= John Sullivan       =]
[= www.wjsullivan.net  =]
[= GPG Key: AE8600B6   =]





reply via email to

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