- Timestamp:
- 03/15/08 10:35:08 (17 years ago)
- Location:
- lang/elisp/twittering-mode/branches/RB-0.3
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/elisp/twittering-mode/branches/RB-0.3/ChangeLog
r11 r25 1 2008-03-15 Y. Hayamizu <haya@haya-laptop-ubuntu> 2 3 * twittering-mode.el : pushをfree variableと誤認識されるバグ(再現できていない)のため,clのpushをlist-pushで置きかえ. 4 (list-push): clのpushの代替として定義. 5 1 6 2008-02-08 Tsuyoshi CHO <Tsuyoshi.CHO+develop@Gmail.com> 2 7 -
lang/elisp/twittering-mode/branches/RB-0.3/twittering-mode.el
r11 r25 7 7 ;; Tsuyoshi CHO <Tsuyoshi.CHO+develop@Gmail.com> 8 8 ;; Created: Sep 4, 2007 9 ;; Version: SVN-HEAD9 ;; Version: 0.3 10 10 ;; Keywords: twitter web 11 11 ;; URL: http://lambdarepos.svnrepository.com/share/trac.cgi/browser/lang/elisp/twittering-mode … … 50 50 (defvar twittering-mode-map (make-sparse-keymap)) 51 51 52 (defvar twittering-timer nil )52 (defvar twittering-timer nil "Timer object for timeline refreshing will be stored here. DO NOT SET VALUE MANUALLY.") 53 53 54 54 (defvar twittering-idle-time 20) … … 107 107 (defun assocref (item alist) 108 108 (cdr (assoc item alist))) 109 (defmacro list-push (value listvar) 110 `(setq ,listvar (cons ,value ,listvar))) 109 111 110 112 ;;; Proxy … … 432 434 (setq c (string-to-char (match-string-no-properties 1 format-str))) 433 435 (if (> found-at cursor) 434 ( push (substring format-str cursor found-at) result)436 (list-push (substring format-str cursor found-at) result) 435 437 "|") 436 438 (setq cursor (match-end 1)) … … 438 440 (case c 439 441 ((?s) ; %s - screen_name 440 ( push (attr 'user-screen-name) result))442 (list-push (attr 'user-screen-name) result)) 441 443 ((?S) ; %S - name 442 ( push (attr 'user-name) result))444 (list-push (attr 'user-name) result)) 443 445 ((?i) ; %i - profile_image 444 ( push (profile-image) result))446 (list-push (profile-image) result)) 445 447 ((?d) ; %d - description 446 ( push (attr 'user-description) result))448 (list-push (attr 'user-description) result)) 447 449 ((?l) ; %l - location 448 ( push (attr 'user-location) result))450 (list-push (attr 'user-location) result)) 449 451 ((?L) ; %L - " [location]" 450 452 (let ((location (attr 'user-location))) 451 453 (unless (or (null location) (string= "" location)) 452 ( push (concat " [" location "]") result)) ))454 (list-push (concat " [" location "]") result)) )) 453 455 ((?u) ; %u - url 454 ( push (attr 'user-url) result))456 (list-push (attr 'user-url) result)) 455 457 ((?j) ; %j - user.id 456 ( push (attr 'user-id) result))458 (list-push (attr 'user-id) result)) 457 459 ((?p) ; %p - protected? 458 460 (let ((protected (attr 'user-protected))) 459 461 (when (string= "true" protected) 460 ( push "[x]" result))))462 (list-push "[x]" result)))) 461 463 ((?c) ; %c - created_at (raw UTC string) 462 ( push (attr 'created-at) result))464 (list-push (attr 'created-at) result)) 463 465 ((?C) ; %C{time-format-str} - created_at (formatted with time-format-str) 464 ( push (twittering-local-strftime466 (list-push (twittering-local-strftime 465 467 (or (match-string-no-properties 2 format-str) "%H:%M:%S") 466 468 (attr 'created-at)) … … 474 476 (let ((secs (+ (* (- (car now) (car created-at)) 65536) 475 477 (- (cadr now) (cadr created-at))))) 476 ( push (cond ((< secs 5) "less than 5 seconds ago")478 (list-push (cond ((< secs 5) "less than 5 seconds ago") 477 479 ((< secs 10) "less than 10 seconds ago") 478 480 ((< secs 20) "less than 20 seconds ago") … … 488 490 result)))) 489 491 ((?t) ; %t - text 490 ( push ;(clickable-text)492 (list-push ;(clickable-text) 491 493 (attr 'text) 492 494 result)) … … 494 496 (let ((truncated (attr 'truncated))) 495 497 (when (string= "true" truncated) 496 ( push "..." result))))498 (list-push "..." result)))) 497 499 ((?f) ; %f - source 498 ( push (attr 'source) result))500 (list-push (attr 'source) result)) 499 501 ((?#) ; %# - id 500 ( push (attr 'id) result))502 (list-push (attr 'id) result)) 501 503 (t 502 ( push (char-to-string c) result)))504 (list-push (char-to-string c) result))) 503 505 ) 504 ( push (substring format-str cursor) result)506 (list-push (substring format-str cursor) result) 505 507 (apply 'concat (nreverse result)) 506 508 ))) … … 779 781 encoded-str cursor)) 780 782 (when (> found-at cursor) 781 ( push (substring encoded-str cursor found-at) result))783 (list-push (substring encoded-str cursor found-at) result)) 782 784 (let ((number-entity (match-string-no-properties 2 encoded-str)) 783 785 (letter-entity (match-string-no-properties 3 encoded-str))) 784 786 (cond (number-entity 785 ( push787 (list-push 786 788 (char-to-string 787 789 (twittering-ucs-to-char 788 790 (string-to-number number-entity))) result)) 789 791 (letter-entity 790 (cond ((string= "gt" letter-entity) ( push ">" result))791 ((string= "lt" letter-entity) ( push "<" result))792 (t push "?" result)))793 (t ( push "?" result)))792 (cond ((string= "gt" letter-entity) (list-push ">" result)) 793 ((string= "lt" letter-entity) (list-push "<" result)) 794 (t (list-push "?" result)))) 795 (t (list-push "?" result))) 794 796 (setq cursor (match-end 0)))) 795 ( push (substring encoded-str cursor) result)797 (list-push (substring encoded-str cursor) result) 796 798 (apply 'concat (nreverse result))) 797 799 ""))