austin----- / weibo.emacs

Sina weibo client in Emacs
https://github.com/austin-----/weibo.emacs
105 stars 28 forks source link

mac os lion下,aquamacs 无法下载图片 #15

Closed meiosischen closed 12 years ago

meiosischen commented 12 years ago

hi: 我的os是mac os lion,在console中打开emacs 24可以下载图片(~/.t.weibo.emacs.d/cache下有临时文件),但是console下无法看到图,于是我用aquamacs (mac 下 emacs的变种,带窗口) 打开weibo-timeline,发现之前console下的图片能看,但是新的图片无法下载,信息永远是“剩余xx图片”,不会刷新,且没有额外错误信息,  由于我对elisp不熟,我看到源码中有"weibo-download-image-in-queue",于是我打开新buffer,执行(weibo-download-image-in-queue),报错如下 if: Wrong number of arguments: #[(url callback &optional cbargs) "Ã Ä B#‡" [url callback cbargs url-retrieve-internal nil] 5 ("/Applications/Aquamacs.app/Contents/Resources/lisp/url/url.elc" . 2414)], 4 byte-code: End of buffer [8 times] byte-code: End of buffer

请问是否能解决这个问题? 谢谢

austin----- commented 12 years ago

@meiosischen 你好,我在Mountain Lion中没有遇到这个问题。请你贴一下weibo-download-image-in-queue报错时的_Traceback_中显示的完整traceback好吗? 谢谢。

meiosischen commented 12 years ago

@austin 你好,我尝试调试了一下,发现我用aquamacs的时候,在weibo-download-image-in-queue中,url-retrieve 永远不会调用回调的lambda,在别的版本的emacs中没有这个问题,可能是我的url.el的版本问题? 后来我尝试了多个方法,发现一旦去掉url-retrieve的最后一个参数 "t",就能正常下载图片了,也就是 将86行的  (,image-file ,weibo-timeline-data ,buffer ,url) t)) 改为 (,image-file ,weibo-timeline-data ,buffer ,url) )) 之后就正常了,我不太懂lisp,C-h f 看了url-retrieve的文档,也没明白最后一个参数是干嘛的。

另外,我发现在打开图片的时候,我的aquamacs经常看不到,因为默认光标在图片末尾,对大的图片,可能被换行了,要网上拖拽一下才能看到图片,因此我建议修改一下weibo-show-image 在125行 (setq buffer-read-only t) 之后加一行 (beginning-of-buffer)

这样在我这边能确保看到图片,不管多大。lisp我还是初学,讲得不对的地方还请指正,谢谢。

On Aug 27, 2012, at 10:21 PM, austin----- wrote:

@meiosischen 你好,我在Mountain Lion中没有遇到这个问题。请你贴一下weibo-download-image-in-queue报错时的_Traceback_中显示的完整traceback好吗? 谢谢。

— Reply to this email directly or view it on GitHub.

austin----- commented 12 years ago

@meiosischen 谢谢你的反馈。这些可能是aquamacs的兼容问题。在emacs.app中没有发现这些问题。

url-retrieve的最后一个t参数是silent的意思。

weibo-show-image中加入beginning-of-buffer看来可以解决aquamacs的图片显示问题,我会加入到代码中。

austin----- commented 12 years ago

@meiosischen weibo-show-image已经更新。关于url.el的兼容问题,请确认你没有引入别的版本的url.el,以及aquamacs是否是最新版本(请也确认aquamacs与emacs的兼容性)。

meiosischen commented 12 years ago

From: austin----- notifications@github.com Subject: Re: [weibo.emacs] mac os lion下,aquamacs 无法下载图片 (#15) Date: Fri, 31 Aug 2012 11:51:18 -0700

@meiosischen weibo-show-image已经更新。关于url.el的兼容问题,请确认你没有引入别的版本的url.el,以及aquamacs是否是最新版本(请也确认aquamacs与emacs的兼容性)。


Reply to this email directly or view it on GitHub: https://github.com/austin-----/weibo.emacs/issues/15#issuecomment-8201591

hi austin: 我尝试找了一下url.el, 发现aquamacs和一般的emacs应该引入的是同一个版本, 我不敢确定是aquaemacs还是url.el的问题, 能确定的是aquamacs是最新版本的。

austin----- commented 12 years ago

@meiosischen 请试试用"emacs -Q"启动aquamacs,然后引入weibo.emacs,看看问题是否还是存在。另外,C-h f后,输入url-retrieve显示的帮助是什么样的呢?

meiosischen commented 12 years ago

hi austin: 我发现aquamacs -q 启动还是一样有问题,我学着用find-library找有问题和没问题的url.el做了对比,发现是有不一样的地方,但是我用emacs 24的url.el提换掉aquamacs的url.el之后,下载图片的时候会报这个错误(这时候,silent的t我是加上去的) ad-Orig-error: No setf-method known for url-silent

我不太明白这是啥意思,是不是我要重新替换url的其他模块,类似重新编译?因为不知道问题出在哪里,我把有问题的aquamacs的url.el.gz模块发到附件里,想麻烦你看下,如果这个没问题,我估计是不是url.el依赖的什么库的问题?

austin----- commented 12 years ago

@meiosischen 我看了一下,silent参数只有在emacs24中才支持。请你看看alt-: emacs-major-version的输出是什么?我可以对应的修改。

meiosischen commented 12 years ago

hi austin: aquamacs中输出结果为  23 (#o27, #x17) aquamacs目前还没支持24,只能用23的

austin----- commented 12 years ago

@meiosischen 谢谢你的反馈,已修改代码,请你测试一下现在能用了么?

meiosischen commented 12 years ago

@austin 更新了weibo.emacs之后,aquamacs能正常显示图片了。谢谢fix