Skip to content

Commit

Permalink
fix tinyurl for emacs22
Browse files Browse the repository at this point in the history
* twittering-mode.el (twittering-tinyurl-get): fix for emacs22.
In emacs22, there's "^M" at the end of a buffer created by
url-retrieve
  • Loading branch information
hayamiz committed Dec 22, 2009
1 parent 611138f commit e2badbe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
@@ -1,3 +1,9 @@
2009-12-23 Yuto Hayamizu <y.hayamizu@gmail.com>

* twittering-mode.el (twittering-tinyurl-get): fix for emacs22.
In emacs22, there's "^M" at the end of a buffer created by
url-retrieve

2009-12-22 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-tinyurl-get): retrieves a
Expand Down
10 changes: 6 additions & 4 deletions twittering-mode.el
Expand Up @@ -1442,10 +1442,12 @@ If STATUS-DATUM is already in DATA-VAR, return nil. If not, return t."
(let ((buffer (url-retrieve-synchronously (concat api longurl))))
(set-buffer buffer)
(goto-char (point-min))
(search-forward-regexp "^$")
(prog1
(buffer-substring (1+ (point)) (point-max))
(kill-buffer buffer))))
(search-forward-regexp "\r?\n\r?\n")
(let ((start-pt (point)))
(search-forward-regexp "\r?\n")
(prog1
(buffer-substring start-pt (match-beginning 0))
(kill-buffer buffer)))))
nil)))

(defun twittering-tinyurl-replace-at-point ()
Expand Down

0 comments on commit e2badbe

Please sign in to comment.