Changeset 136 for lang/elisp
- Timestamp:
- 06/17/09 16:02:50 (15 years ago)
- Location:
- lang/elisp/twittering-mode/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/elisp/twittering-mode/trunk/ChangeLog
r135 r136 1 2009-06-18 Alberto Garcia <agarcia@igalia.com> 2 3 * twittering-mode.el 4 (twittering-status-to-status-datum): 5 Read 'in_reply_to_status_id' and 'in_reply_to_user_id' attributes. 6 (twittering-format-status): 7 Add new '%r' format string for " in reply to user". 8 (twittering-update-status-if-not-blank): 9 Code refactoring. No need to use (format) to convert a string. 10 11 2009-06-18 Tsuyoshi CHO <tsuyoshi_cho@yahoo.co.jp> 12 13 * twittering-mode.el (twittering-status-format) 14 (twittering-format-status, twittering-status-to-status-datum) 15 (twittering-update-status-if-not-blank, twittering-enter): Fix 16 in_reply_to_status_id support not work problem, and marge Alberl 17 patch below. 18 1 19 2009-06-17 Tsuyoshi CHO <Tsuyoshi.CHO+develop@Gmail.com> 2 20 3 * twittering-mode.el (twittering-last-timeline-interactive): New add variable. 21 * twittering-mode.el (twittering-last-timeline-interactive): New 22 add variable. 4 23 (twittering-new-tweets-count): Ditto. 5 24 (twittering-new-tweets-hook): Ditto. -
lang/elisp/twittering-mode/trunk/twittering-mode.el
r135 r136 98 98 99 99 (defvar twittering-status-format nil) 100 (setq twittering-status-format "%i %s, %@:\n %t // from %f%L ")100 (setq twittering-status-format "%i %s, %@:\n %t // from %f%L%r") 101 101 ;; %s - screen_name 102 102 ;; %S - name … … 105 105 ;; %l - location 106 106 ;; %L - " [location]" 107 ;; %r - " in reply to user" 107 108 ;; %u - url 108 109 ;; %j - user.id … … 540 541 ((?j) ; %j - user.id 541 542 (list-push (attr 'user-id) result)) 543 ((?r) ; %r - in_reply_to_status_id 544 (let ((reply-id (attr 'in-reply-to-status-id)) 545 (reply-name (attr 'in-reply-to-screen-name))) 546 (unless (or (null reply-id) (string= "" reply-id) 547 (null reply-name) (string= "" reply-name)) 548 (let ((in-reply-to-string (format "in reply to %s" reply-name)) 549 (url (twittering-get-status-url reply-name reply-id))) 550 (add-text-properties 551 0 (length in-reply-to-string) 552 `(mouse-face highlight 553 face twittering-uri-face 554 uri ,url) 555 in-reply-to-string) 556 (list-push (concat " " in-reply-to-string) result))))) 542 557 ((?p) ; %p - protected? 543 558 (let ((protected (attr 'user-protected))) … … 603 618 (let ((formatted-status (apply 'concat (nreverse result)))) 604 619 (add-text-properties 0 (length formatted-status) 605 `(username ,(attr 'user-screen-name)) 620 `(username ,(attr 'user-screen-name) 621 id ,(attr 'id)) 606 622 formatted-status) 607 623 formatted-status) … … 744 760 (let* ((status-data (cddr status)) 745 761 id text source created-at truncated 762 in-reply-to-status-id 763 in-reply-to-screen-name 746 764 (user-data (cddr (assq 'user status-data))) 747 765 user-id user-name … … 761 779 (setq created-at (assq-get 'created_at status-data)) 762 780 (setq truncated (assq-get 'truncated status-data)) 781 (setq in-reply-to-status-id 782 (twittering-decode-html-entities 783 (assq-get 'in_reply_to_status_id status-data))) 784 (setq in-reply-to-screen-name 785 (twittering-decode-html-entities 786 (assq-get 'in_reply_to_screen_name status-data))) 763 787 (setq user-id (assq-get 'id user-data)) 764 788 (setq user-name (twittering-decode-html-entities … … 779 803 `(mouse-face highlight 780 804 uri ,(concat "http://twitter.com/" user-screen-name) 781 status-id ,id782 805 face twittering-username-face) 783 806 user-name) … … 788 811 `(mouse-face highlight 789 812 uri ,(concat "http://twitter.com/" user-screen-name) 790 status-id ,id791 813 face twittering-username-face) 792 814 user-screen-name) … … 841 863 `(,sym . ,(symbol-value sym))) 842 864 '(id text source created-at truncated 865 in-reply-to-status-id 866 in-reply-to-screen-name 843 867 user-id user-name user-screen-name user-location 844 868 user-description … … 917 941 (if (string-match "^\\s-*\\(?:@[-_a-z0-9]+\\)?\\s-*$" status) 918 942 nil 919 (let ((parameters `(("status" . ,status) 920 ("source" . "twmode")))) 921 (twittering-http-post "statuses" "update" 922 (if reply-to-id 923 (cons `("in_reply_to_status_id" . ,(format "%s" reply-to-id)) 924 parameters) 925 parameters))) 943 (let ((parameters (append `(("status" . ,status) 944 ("source" . "twmode")) 945 (if reply-to-id 946 `(("in_reply_to_status_id" 947 . ,reply-to-id)))))) 948 (twittering-http-post "statuses" "update" parameters)) 926 949 t)) 927 950 … … 1070 1093 (interactive) 1071 1094 (let ((username (get-text-property (point) 'username)) 1072 ( status-id (get-text-property (point) 'status-id))1095 (id (get-text-property (point) 'id)) 1073 1096 (uri (get-text-property (point) 'uri))) 1074 1097 (if username 1075 (twittering-update-status-from-minibuffer (concat "@" username " ") 1076 status-id) 1098 (twittering-update-status-from-minibuffer (concat "@" username " ") id) 1077 1099 (if uri 1078 1100 (browse-url uri)))))