Skip to content

Commit

Permalink
Filling a tweet text as a paragraph is now a effect of "%t".
Browse files Browse the repository at this point in the history
* twittering-mode.el (twittering-status-format): modify the
meaning of the specifier "%t" to remove implicit filling as a
paragraph.
(twittering-render-timeline): remove implicit filling a text as a
paragraph. In addition, a newline as a delimiter is added by
`twittering-format-status'.
(twittering-format-status): with "%t", fill a text as a paragraph.
This function adds a newline at the end of status instead of
`twittering-render-timeline'. Then, the newline as a delimiter
also has the same text properties as the body of the tweet.
  • Loading branch information
cvmat committed Jan 10, 2010
1 parent ef602ac commit bbf4b74
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
13 changes: 13 additions & 0 deletions ChangeLog
@@ -1,3 +1,16 @@
2010-01-11 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-status-format): modify the
meaning of the specifier "%t" to remove implicit filling as a
paragraph.
(twittering-render-timeline): remove implicit filling a text as a
paragraph. In addition, a newline as a delimiter is added by
`twittering-format-status'.
(twittering-format-status): with "%t", fill a text as a paragraph.
This function adds a newline at the end of status instead of
`twittering-render-timeline'. Then, the newline as a delimiter
also has the same text properties as the body of the tweet.

2010-01-10 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-remove-duplicates): add for
Expand Down
20 changes: 14 additions & 6 deletions twittering-mode.el
Expand Up @@ -166,7 +166,7 @@ Items:
%c - created_at (raw UTC string)
%C{time-format-str} - created_at (formatted with time-format-str)
%@ - X seconds ago
%t - text
%t - text filled as one paragraph
%' - truncated
%f - source
%# - id
Expand Down Expand Up @@ -1606,10 +1606,7 @@ If STATUS-DATUM is already in DATA-VAR, return nil. If not, return t."
(erase-buffer)
(mapc (lambda (status)
(insert (twittering-format-status
status twittering-status-format))
(fill-region-as-paragraph
(line-beginning-position) (point))
(insert "\n"))
status twittering-status-format)))
twittering-timeline-data)
(if (and twittering-image-stack window-system)
(clear-image-cache))
Expand Down Expand Up @@ -1814,9 +1811,20 @@ following symbols;

("S" . ,(attr 'user-name))
("s" . ,(attr 'user-screen-name))
("t" . ,(attr 'text))
("t" .
,(lambda (context)
(let* ((str (cdr (assq 'processed-string context)))
(prefix (if (string-match "\\([^\n]*\\)\\'" str)
(match-string 1 str)
""))
(text (concat prefix (attr 'text))))
(with-temp-buffer
(insert text)
(fill-region-as-paragraph (point-min) (point-max))
(buffer-substring (1+ (length prefix)) (point-max))))))
("u" . ,(attr 'user-url))
))
(format-str (concat format-str "\n"))
(formatted-status
(twittering-format-string format-str "%" replace-table)))
(add-text-properties
Expand Down

0 comments on commit bbf4b74

Please sign in to comment.