Changeset 36 for lang/elisp/twittering-mode
- Timestamp:
- 04/28/08 14:42:51 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/elisp/twittering-mode/branches/tsuyoshi/twittering-mode.el
r34 r36 959 959 (while (and pos (not (eq prop twittering-username-face))) 960 960 (setq pos (next-single-property-change pos 'face)) 961 (when (eq pos nil) (throw 'not-found 0))962 (setq prop (get-text-property pos 'face))) )963 pos))961 (when (eq pos nil) (throw 'not-found nil)) 962 (setq prop (get-text-property pos 'face))) 963 pos))) 964 964 965 965 (defun twittering-goto-previous-status () … … 978 978 (while (and pos (not (eq prop twittering-username-face))) 979 979 (setq pos (previous-single-property-change pos 'face)) 980 (when (eq pos nil) (throw 'not-found 0))981 (setq prop (get-text-property pos 'face))) )982 pos))980 (when (eq pos nil) (throw 'not-found nil)) 981 (setq prop (get-text-property pos 'face))) 982 pos))) 983 983 984 984 (defun twittering-goto-next-status-of-user () … … 987 987 (let ((user-name (twittering-get-username-at-pos (point))) 988 988 (pos (twittering-get-next-username-face-pos (point)))) 989 (catch 'not-found 990 (while (not (equal (twittering-get-username-at-pos pos) user-name)) 991 (setq pos (twittering-get-next-username-face-pos pos)) 992 (when (eq pos nil) (throw 'not-found 0)))) 989 (while (and (not (eq pos nil)) 990 (not (equal (twittering-get-username-at-pos pos) user-name))) 991 (setq pos (twittering-get-next-username-face-pos pos))) 993 992 (if pos 994 993 (goto-char pos) 995 (message "End of %s's status." user-name)))) 994 (if user-name 995 (message "End of %s's status." user-name) 996 (message "Invalid user-name."))))) 996 997 997 998 (defun twittering-goto-previous-status-of-user () … … 1000 1001 (let ((user-name (twittering-get-username-at-pos (point))) 1001 1002 (pos (twittering-get-previous-username-face-pos (point)))) 1002 (catch 'not-found 1003 (while (not (equal (twittering-get-username-at-pos pos) user-name)) 1004 (setq pos (twittering-get-previous-username-face-pos pos)) 1005 (when (eq pos nil) (throw 'not-found 0)))) 1003 (while (and (not (eq pos nil)) 1004 (not (equal (twittering-get-username-at-pos pos) user-name))) 1005 (setq pos (twittering-get-previous-username-face-pos pos))) 1006 1006 (if pos 1007 1007 (goto-char pos) 1008 (message "Start of %s's status." user-name)))) 1008 (if user-name 1009 (message "Start of %s's status." user-name) 1010 (message "Invalid user-name."))))) 1009 1011 1010 1012 (defun twittering-get-username-at-pos (pos) 1011 1013 (let ((start-pos pos) 1012 1014 (end-pos)) 1013 (while (eq (get-text-property start-pos 'face) twittering-username-face) 1014 (setq start-pos (1- start-pos))) 1015 (setq start-pos (1+ start-pos)) 1016 (setq end-pos (next-single-property-change pos 'face)) 1017 (buffer-substring start-pos end-pos))) 1015 (catch 'not-found 1016 (while (eq (get-text-property start-pos 'face) twittering-username-face) 1017 (setq start-pos (1- start-pos)) 1018 (when (or (eq start-pos nil) (eq start-pos 0)) (throw 'not-found nil))) 1019 (setq start-pos (1+ start-pos)) 1020 (setq end-pos (next-single-property-change pos 'face)) 1021 (buffer-substring start-pos end-pos)))) 1018 1022 1019 1023 ;;;###autoload