[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: URLのエコ ーとtextarea のminor化



# この話題は全然参加していなかったので、どこに reply をつけたら
# いいかわからないためオリジナルのメールに :-)

From: Tsuyoshi CHO <mfalcon_sky@emailuser.net> さん曰く
Subject: [emacs-w3m:07481] URLのエコーとtextareaのminor化
Message-ID: <uwttvnler.wl%mfalcon_sky@emailuser.net>
Date: Sun, 30 Jan 2005 21:36:44 +0900

> 1.リンクのURL echo/balloon のデコード
> 
> 私はWikipediaの編集・閲覧が多いのですが、リンク先はどうなのかをリンクのエコーで
> 確認したりします。

で、default 設定の w3m-show-decoded-url が有効、になっていると、
エラーするページがあるようです。Emacs-22.0.50 と 20.7 ではエラー
になりました。

例えば須藤さんち <URL:http://pub.ks-and-ks.ne.jp/> とかで、
w3m-next-anchor()しただけで、添付のエラーになります。

こちらは w3m-current-coding-system が undecided-unix になるので
すが、めぐりめぐって、

(w3m-detect-coding-region 1 4 '(undecided japanese-shift-jis))
のように呼ばれて、

(coding-system-category 'undecided) => nil 

なので、エラーになっちゃうみたいです。

(defun w3m-detect-coding-region (start end &optional priority-list)
  (let (category categories)
    (dolist (codesys priority-list)
      (setq category (coding-system-category codesys))
      (unless (or (null category) (assq category categories))
	(push (cons category codesys) categories)))
    (car (detect-coding-with-priority start end (nreverse categories)))))

ぐらいならすぐ考え付くのですが、categories が nil になっちゃった
らどうするの?とかわからないので、どなたかお願いします (_ _)

-- 
白井秀行 (mailto:shirai@meadowy.org)
Debugger entered--Lisp error: (setting-constant nil)
  set(nil undecided-unix)
  (lambda (x) (set (car x) (cdr x)))((nil . undecided-unix))
  mapc((lambda (x) (set (car x) (cdr x))) ((nil . undecided-unix) (coding-category-sjis . shift_jis)))
  (let* ((prio-list ...) (coding-category-list coding-category-list) (coding-category-utf-16-le coding-category-utf-16-le) (coding-category-utf-16-be coding-category-utf-16-be) (coding-category-utf-8 coding-category-utf-8) (coding-category-iso-8-2 coding-category-iso-8-2) (coding-category-iso-7-tight coding-category-iso-7-tight) (coding-category-sjis coding-category-sjis) (coding-category-iso-7-else coding-category-iso-7-else) (coding-category-iso-8-1 coding-category-iso-8-1) (coding-category-iso-7 coding-category-iso-7) (coding-category-iso-8-else coding-category-iso-8-else) (coding-category-emacs-mule coding-category-emacs-mule) (coding-category-raw-text coding-category-raw-text) (coding-category-big5 coding-category-big5) (coding-category-ccl coding-category-ccl) (coding-category-binary coding-category-binary)) (mapc (function ...) prio-list) (set-coding-priority (mapcar ... prio-list)) (detect-coding-region start end))
  (unwind-protect (let* (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (mapc ... prio-list) (set-coding-priority ...) (detect-coding-region start end)) (set-coding-priority coding-category-list) (update-coding-systems-internal))
  (detect-coding-with-priority start end (nreverse categories))
  (car (detect-coding-with-priority start end (nreverse categories)))
  (let (category categories) (dolist (codesys priority-list) (setq category ...) (unless ... ...)) (car (detect-coding-with-priority start end ...)))
  w3m-detect-coding-region(1 33 (undecided-unix shift_jis))
  (save-current-buffer (set-buffer temp-buffer) (set-buffer-multibyte nil) (insert str) (w3m-detect-coding-region (point-min) (point-max) coding))
  (with-current-buffer temp-buffer (set-buffer-multibyte nil) (insert str) (w3m-detect-coding-region (point-min) (point-max) coding))
  (unwind-protect (with-current-buffer temp-buffer (set-buffer-multibyte nil) (insert str) (w3m-detect-coding-region ... ... coding)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (let ((temp-buffer ...)) (unwind-protect (with-current-buffer temp-buffer ... ... ...) (and ... ...)))
  (with-temp-buffer (set-buffer-multibyte nil) (insert str) (w3m-detect-coding-region (point-min) (point-max) coding))
  (setq coding (with-temp-buffer (set-buffer-multibyte nil) (insert str) (w3m-detect-coding-region ... ... coding)))
  (progn (setq coding (with-temp-buffer ... ... ...)))
  (if (listp coding) (progn (setq coding ...)))
  (when (listp coding) (setq coding (with-temp-buffer ... ... ...)))
  (progn (when (listp coding) (setq coding ...)) (decode-coding-string str (or coding w3m-default-coding-system w3m-coding-system ...)))
  (w3m-static-if (and (featurep ...) (featurep ...)) (w3m-decode-coding-string-with-priority str coding) (when (listp coding) (setq coding ...)) (decode-coding-string str (or coding w3m-default-coding-system w3m-coding-system ...)))
  (let ((start 0) (buf)) (while (string-match "+\\|%\\(0D%0A\\|\\([0-9a-fA-F][0-9a-fA-F]\\)\\)" str start) (push ... buf) (push ... buf) (setq start ...)) (setq str (apply ... ...)) (w3m-static-if (and ... ...) (w3m-decode-coding-string-with-priority str coding) (when ... ...) (decode-coding-string str ...)))
  w3m-url-decode-string("http://pub.ks-and-ks.ne.jp/prog/"; (undecided-unix shift_jis))
  (if rule (w3m-url-decode-string url (if ... ... rule)) url)
  (let ((rule ...)) (if rule (w3m-url-decode-string url ...) url))
  (progn (let (...) (if rule ... url)))
  (if (stringp url) (progn (let ... ...)))
  (when (stringp url) (let (...) (if rule ... url)))
  w3m-url-readable-string("http://pub.ks-and-ks.ne.jp/prog/";)
  (or (w3m-url-readable-string url) (and (w3m-action) "There is a form") "There is no url")
  (w3m-message "%s" (or (w3m-url-readable-string url) (and ... "There is a form") "There is no url"))
  (progn (and url interactive-p (kill-new url)) (w3m-message "%s" (or ... ... "There is no url")))
  (if (or url interactive-p) (progn (and url interactive-p ...) (w3m-message "%s" ...)))
  (when (or url interactive-p) (and url interactive-p (kill-new url)) (w3m-message "%s" (or ... ... "There is no url")))
  (let ((url ...)) (when (or url interactive-p) (and url interactive-p ...) (w3m-message "%s" ...)))
  w3m-print-this-url()
  (if (< arg 0) (w3m-previous-anchor (- arg)) (while (> arg 0) (unless ... ... ...) (setq arg ...) (if ... ... ...)) (w3m-horizontal-on-screen) (w3m-print-this-url))
  w3m-next-anchor(1)
  call-interactively(w3m-next-anchor)