(autoload 'w3m-retrieve "w3m")
(autoload 'url-retrieve-synchronously "url"))
-(defconst mixi-revision "$Revision: 1.201 $")
+(defconst mixi-revision "$Revision: 1.202 $")
(defgroup mixi nil
"API library for accessing to mixi."
:type 'number
:group 'mixi)
+(defcustom mixi-replace-tab-and-space-to-nbsp t
+ "*If non-nil, replace tab and space to for keeping formatted."
+ :type 'boolean
+ :group 'mixi)
+
(defcustom mixi-cache-expires nil
"*Seconds for expiration of a cached object."
:type '(radio (integer :tag "Expired seconds")
(setq pos (+ (match-end 0) 1)))
string))
+(defun mixi-replace-tab-and-space-to-nbsp (string)
+ (when mixi-replace-tab-and-space-to-nbsp
+ (let ((pos 0))
+ (while (or (string-match "\t" string pos)
+ (string-match " " string pos))
+ (if (string= (match-string 0 string) "\t")
+ (setq string (replace-match (make-string tab-width ?\ )
+ nil nil string))
+ (setq string (replace-match " " nil nil string))
+ (setq pos (+ (match-end 0) 1))))
+ string)))
+
;; Object.
(defconst mixi-object-prefix "mixi-")
(setq fields `(("post_key" . ,post-key)
("id" . ,(mixi-friend-id (mixi-make-me)))
("diary_title" . ,title)
- ("diary_body" . ,content)
+ ("diary_body" . ,(mixi-replace-tab-and-space-to-nbsp
+ content))
("submit" . "confirm")))
(with-mixi-post-form (mixi-post-diary-page) fields
(unless (re-search-forward mixi-post-succeed-regexp nil t)
(mixi-post-error 'cannot-find-key community)))
(setq fields `(("post_key" . ,post-key)
("bbs_title" . ,title)
- ("bbs_body" . ,content)
+ ("bbs_body" . ,(mixi-replace-tab-and-space-to-nbsp
+ content))
("submit" . "confirm")))
(with-mixi-post-form (mixi-post-topic-page community) fields
(unless (re-search-forward mixi-post-succeed-regexp nil t)
(setq fields
`(("post_key" . ,post-key)
("owner_id" . ,(mixi-friend-id (mixi-diary-owner parent)))
- ("comment_body" . ,content)
+ ("comment_body" . ,(mixi-replace-tab-and-space-to-nbsp
+ content))
("submit" . "confirm")))
(setq fields `(("post_key" . ,post-key)
- ("comment" . ,content)
+ ("comment" . ,(mixi-replace-tab-and-space-to-nbsp
+ content))
("submit" . "confirm"))))
(with-mixi-post-form (funcall page parent) fields
(unless (re-search-forward mixi-post-succeed-regexp nil t)
(mixi-post-error 'cannot-find-key friend)))
(setq fields `(("post_key" . ,post-key)
("subject" . ,title)
- ("body" . ,content)
+ ("body" . ,(mixi-replace-tab-and-space-to-nbsp content))
("yes" . "¡¡Á÷¡¡¿®¡¡")
("submit" . "confirm")))
(with-mixi-post-form (mixi-post-message-page friend) fields