松尾です。
はやみずさん、commitを取り込んでいただきありがとう
ございます。ただ、現状のmasterではこちらの環境で
twittering-tinyurl-getが動作しなくなってしまっています。
> Emacs22だと、url-retrieve でとってきた結果のバッファ
> 末尾に ^M が入ってしまうので、そのへんをちょっと修正
> してマージしました。
こちらのGNU Emacs 22.2.1とGNU Emacs 21.4.1 (どちらも
Debian 5.0.3)とGNU Emacs 22.1.1(cygwin)では^Mは付きま
せんでした。
また、twittering-tinyurl-get内のurl-retrieveで生成した
bufferの末尾に改行(\n)も付いていないため、2回目の
(search-forward-regexp "\r?\n")
が失敗してしまいます。
buffer内の改行の扱いは個人の設定や環境に依存するのかも
しれません。
こういうのはどうでしょうか。
(defun twittering-tinyurl-get (longurl)
"Tinyfy LONGURL"
(require 'url)
(let ((api (cdr (assoc twittering-tinyurl-service
twittering-tinyurl-services-map))))
(unless api
(error (concat
"invalid service try one of "
(mapconcat (lambda (x)
(symbol-name (car x)))
twittering-tinyurl-servies-map ", "))))
(if longurl
(save-excursion
(let ((buffer (url-retrieve-synchronously (concat api longurl))))
(set-buffer buffer)
(goto-char (point-min))
(search-forward-regexp "\n\r?\n\\([^\n\r]*\\)")
(prog1
(match-string-no-properties 1)
(kill-buffer buffer))))
nil)))
^Mと末尾の改行のあるなしに関係なく動くようにした
つもりです。確認していただけますでしょうか。
---
松尾 直志 <[email protected]>
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
twmode-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/twmode-users