Changeset 33 for lang

Show
Ignore:
Timestamp:
04/26/08 15:46:34 (17 years ago)
Author:
tsuyoshi
Message:

Fix j,k,n,p functions error.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/elisp/twittering-mode/branches/tsuyoshi/twittering-mode.el

    r31 r33  
    946946  (let ((pos)) 
    947947    (setq pos (twittering-get-next-username-face-pos (point))) 
    948     (when pos 
    949       (goto-char pos)))) 
     948    (if pos 
     949        (goto-char pos) 
     950      (message "End of status.")))) 
    950951 
    951952(defun twittering-get-next-username-face-pos (pos) 
    952953  (interactive) 
    953954  (let ((prop)) 
    954     (while (not (eq prop twittering-username-face)) 
    955       (setq pos (next-single-property-change pos 'face)) 
    956       (setq prop (get-text-property pos 'face))) 
     955    (catch 'not-found 
     956      (while (and pos (not (eq prop twittering-username-face))) 
     957        (setq pos (next-single-property-change pos 'face)) 
     958        (when (eq pos nil) (throw 'not-found 0)) 
     959        (setq prop (get-text-property pos 'face)))) 
    957960    pos)) 
    958961 
     
    962965  (let ((pos)) 
    963966    (setq pos (twittering-get-previous-username-face-pos (point))) 
    964     (when pos 
    965       (goto-char pos)))) 
     967    (if pos 
     968        (goto-char pos) 
     969      (message "Start of status.")))) 
    966970 
    967971(defun twittering-get-previous-username-face-pos (pos) 
    968972  (interactive) 
    969973  (let ((prop)) 
    970     (while (not (eq prop twittering-username-face)) 
    971       (setq pos (previous-single-property-change pos 'face)) 
    972       (setq prop (get-text-property pos 'face))) 
     974    (catch 'not-found 
     975      (while (and pos (not (eq prop twittering-username-face))) 
     976        (setq pos (previous-single-property-change pos 'face)) 
     977        (when (eq pos nil) (throw 'not-found 0)) 
     978        (setq prop (get-text-property pos 'face)))) 
    973979    pos)) 
    974980 
     
    978984  (let ((user-name (twittering-get-username-at-pos (point))) 
    979985        (pos (twittering-get-next-username-face-pos (point)))) 
    980     (while (not (equal (twittering-get-username-at-pos pos) user-name)) 
    981       (setq pos (twittering-get-next-username-face-pos pos))) 
    982     (goto-char pos))) 
     986    (catch 'not-found 
     987      (while (not (equal (twittering-get-username-at-pos pos) user-name)) 
     988        (setq pos (twittering-get-next-username-face-pos pos)) 
     989        (when (eq pos nil) (throw 'not-found 0)))) 
     990    (if pos 
     991        (goto-char pos) 
     992      (message "End of %s's status." user-name)))) 
    983993 
    984994(defun twittering-goto-previous-status-of-user () 
     
    987997  (let ((user-name (twittering-get-username-at-pos (point))) 
    988998        (pos (twittering-get-previous-username-face-pos (point)))) 
    989     (while (not (equal (twittering-get-username-at-pos pos) user-name)) 
    990       (setq pos (twittering-get-previous-username-face-pos pos))) 
    991     (goto-char pos))) 
     999    (catch 'not-found 
     1000      (while (not (equal (twittering-get-username-at-pos pos) user-name)) 
     1001        (setq pos (twittering-get-previous-username-face-pos pos)) 
     1002        (when (eq pos nil) (throw 'not-found 0)))) 
     1003    (if pos 
     1004        (goto-char pos) 
     1005      (message "Start of %s's status." user-name)))) 
    9921006 
    9931007(defun twittering-get-username-at-pos (pos)