Skip to content

Commit

Permalink
Add the variable `twittering-fallback-image-format'.
Browse files Browse the repository at this point in the history
* twittering-mode.el: Add the variable
`twittering-fallback-image-format'.
(twittering-fallback-image-format): new variable.
(twittering-create-image-pair): use the value of
`twittering-fallback-image-format' as the fallback format instead
of directly using 'xpm.
  • Loading branch information
cvmat committed Apr 8, 2011
1 parent 701a9d4 commit cfca5f7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
edit skeleton. edit skeleton.
(twittering-edit-skeleton-inherit-mentions): likewise. (twittering-edit-skeleton-inherit-mentions): likewise.


* twittering-mode.el: Add the variable
`twittering-fallback-image-format'.
(twittering-fallback-image-format): new variable.
(twittering-create-image-pair): use the value of
`twittering-fallback-image-format' as the fallback format instead
of directly using 'xpm.

2011-03-27 Tadashi MATSUO <tad@mymail.twin.jp> 2011-03-27 Tadashi MATSUO <tad@mymail.twin.jp>


* twittering-mode.el: Discard standard error of the program * twittering-mode.el: Discard standard error of the program
Expand Down
8 changes: 8 additions & 0 deletions NEWS
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@
`twittering-switch-edit-skeleton'. `twittering-switch-edit-skeleton'.
The footer string, `twittering-edit-skeleton-footer', can be changed The footer string, `twittering-edit-skeleton-footer', can be changed
by invoking `twittering-edit-skeleton-change-footer'. by invoking `twittering-edit-skeleton-change-footer'.
* Variable of fallback image format.
You can change the fallback format of images by changing the
variable `twittering-fallback-image-format'. The default format is
XPM. Images which Emacs does not supports are displayed by
converting them into the fallback format.
By the following configuration, you may avoid strange behaviors when
displaying XPM images on NTEmacs. Thanks to Silver Chariot.
(setq twittering-fallback-image-format 'png)
* ... * ...


### Bug fixes ### Bug fixes
Expand Down
8 changes: 8 additions & 0 deletions NEWS.ja
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@
るにはことができます。 るにはことができます。
また、フッタ文字列`twittering-edit-skeleton-footer'の内容は関数 また、フッタ文字列`twittering-edit-skeleton-footer'の内容は関数
`twittering-edit-skeleton-change-footer'で変更できます。 `twittering-edit-skeleton-change-footer'で変更できます。
* 代替画像形式を指定する変数
アイコン画像の形式がEmacsにサポートされていない形式である場合、画像
をEmacsがサポートする形式に変換してから表示するのですが、その際の変
換先の画像形式を指定する変数`twittering-fallback-image-format'を追加
しました。デフォルトの形式はXPMです。
下記のように設定すれば、NTEmacsでXPMを表示する際の不自然な挙動を回避
できるかもしれません。 Thanks to Silver Chariot.
(setq twittering-fallback-image-format 'png)
* ... * ...


### バグ修正 ### バグ修正
Expand Down
10 changes: 8 additions & 2 deletions twittering-mode.el
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4750,6 +4750,11 @@ is the display property for the icon.")
is non-nil. If this variable is non-nil, icon images are converted by is non-nil. If this variable is non-nil, icon images are converted by
invoking \"convert\". Otherwise, cropped images are displayed.") invoking \"convert\". Otherwise, cropped images are displayed.")


(defvar twittering-fallback-image-format 'xpm
"*Fallback format used for displaying an image without a supproted format.
Images which Emacs does not supports are converted into the fallback image
format.")

(defvar twittering-use-profile-image-api nil (defvar twittering-use-profile-image-api nil
"*Whether to use `profile_image' API for retrieving scaled icon images. "*Whether to use `profile_image' API for retrieving scaled icon images.
NOTE: This API is rate limited.") NOTE: This API is rate limited.")
Expand Down Expand Up @@ -4874,9 +4879,10 @@ available and `twittering-use-convert' is non-nil."
image-pair) image-pair)
(twittering-use-convert (twittering-use-convert
(let ((converted-data (let ((converted-data
(twittering-convert-image-data image-data 'xpm))) (twittering-convert-image-data image-data
twittering-fallback-image-format)))
(if converted-data (if converted-data
`(xpm . ,converted-data) `(,twittering-fallback-image-format . ,converted-data)
twittering-error-icon-data-pair))) twittering-error-icon-data-pair)))
(t (t
twittering-error-icon-data-pair)))) twittering-error-icon-data-pair))))
Expand Down

0 comments on commit cfca5f7

Please sign in to comment.