Changeset 31 for lang/elisp
- Timestamp:
- 04/26/08 12:04:46 (17 years ago)
- Location:
- lang/elisp/twittering-mode/branches/gan2
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/elisp/twittering-mode/branches/gan2/ChangeLog
r28 r31 1 2008-04-26 gan2 <gan2.ruby@gmail.com> 2 3 * twittering-mode.el: n, p でポイント上のユーザの次(前)の発言に移動する設定を追加 4 (twittering-goto-next-status): twittering-next-message の名前を変更 5 (twittering-get-next-username-face-pos): twittering-next-username-face-pos の名前を変更 6 (twittering-goto-previous-status): twittering-previous-message の名前を変更 7 (twittering-get-previous-username-face-pos): twittering-previous-username-face-pos の名前を変更 8 (twittering-goto-next-status-of-user): ポイント上のユーザの次の発言へ移動する関数を定義 9 (twittering-goto-previous-status-of-user): ポイント上のユーザの前の発言へ移動する関数を定義 10 (twittering-get-username-at-pos): ポイント上のユーザ名を返す関数を定義 11 (twittering-mode-map): n, p でポイント上のユーザの次(前)の発言に移動する設定を追加 12 1 13 2008-04-25 gan2 <gan2.ruby@gmail.com> 2 14 -
lang/elisp/twittering-mode/branches/gan2/twittering-mode.el
r30 r31 235 235 ;; (define-key km "j" 'next-line) 236 236 ;; (define-key km "k" 'previous-line) 237 (define-key km "j" 'twittering- next-status)238 (define-key km "k" 'twittering- previous-status)237 (define-key km "j" 'twittering-goto-next-status) 238 (define-key km "k" 'twittering-goto-previous-status) 239 239 (define-key km "l" 'forward-char) 240 240 (define-key km "h" 'backward-char) … … 242 242 (define-key km "^" 'beginning-of-line-text) 243 243 (define-key km "$" 'end-of-line) 244 (define-key km "n" 'twittering-goto-next-status-of-user) 245 (define-key km "p" 'twittering-goto-previous-status-of-user) 244 246 (define-key km [backspace] 'backward-char) 245 247 (define-key km "G" 'end-of-buffer) … … 939 941 (setq twittering-password (read-passwd "twittering-mode: ")))) 940 942 941 (defun twittering- next-status ()943 (defun twittering-goto-next-status () 942 944 "Go to next status." 943 945 (interactive) 944 946 (let ((pos)) 945 (setq pos (twittering- next-username-face-pos (point)))947 (setq pos (twittering-get-next-username-face-pos (point))) 946 948 (when pos 947 949 (goto-char pos)))) 948 950 949 (defun twittering- next-username-face-pos (pos)951 (defun twittering-get-next-username-face-pos (pos) 950 952 (interactive) 951 953 (let ((prop)) … … 955 957 pos)) 956 958 957 (defun twittering- previous-status ()959 (defun twittering-goto-previous-status () 958 960 "Go to previous status." 959 961 (interactive) 960 962 (let ((pos)) 961 (setq pos (twittering- previous-username-face-pos (point)))963 (setq pos (twittering-get-previous-username-face-pos (point))) 962 964 (when pos 963 965 (goto-char pos)))) 964 966 965 (defun twittering- previous-username-face-pos (pos)967 (defun twittering-get-previous-username-face-pos (pos) 966 968 (interactive) 967 969 (let ((prop)) … … 971 973 pos)) 972 974 975 (defun twittering-goto-next-status-of-user () 976 "Go to next status of user." 977 (interactive) 978 (let ((user-name (twittering-get-username-at-pos (point))) 979 (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))) 983 984 (defun twittering-goto-previous-status-of-user () 985 "Go to previous status of user." 986 (interactive) 987 (let ((user-name (twittering-get-username-at-pos (point))) 988 (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))) 992 993 (defun twittering-get-username-at-pos (pos) 994 (let ((start-pos pos) 995 (end-pos)) 996 (while (eq (get-text-property start-pos 'face) twittering-username-face) 997 (setq start-pos (1- start-pos))) 998 (setq start-pos (1+ start-pos)) 999 (setq end-pos (next-single-property-change pos 'face)) 1000 (buffer-substring start-pos end-pos))) 1001 973 1002 (provide 'twittering-mode) 974 1003 ;;; twittering.el ends here