Ticket #32723

inline patch で "Args out of range: x, y" エラー

오픈 날짜: 2013-12-28 20:39 마지막 업데이트: 2013-12-28 20:39

Reporter:
소유자:
(None)
Type:
Status:
Open
Component:
(None)
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
None
File:
None

Details

http://blog.y-satou.jp/2012/01/cocoa-emacs-inline-patch-args-out-of.html のパッチ自体は今の inline patch には含まれているようなので、最初のデバッグプリントの部分を参考にして、

  1. (defun ns-insert-marked-text (pos len)
  2. "Insert contents of `ns-working-text' as UTF-8 string and mark with
  3. `ns-working-overlay' and `ns-marked-overlay'. Any previously existing
  4. working text is cleared first. The overlay is assigned the faces
  5. `ns-working-text-face' and `ns-marked-text-face'."
  6. (message "DEBUG: pos=[\%d] len=[\%d] ns-working-text=[\%s] text-len=[\%d]" pos len ns-working-text (length ns-working-text))
  7. (ns-delete-working-text)
  8. (message "DEBUG: ns-delete-working-text done")
  9. (let ((start (point)))
  10. (if (<= pos (length ns-working-text))
  11. (progn
  12. (put-text-property pos len 'face 'ns-working-text-face ns-working-text)
  13. (message "DEBUG: put-text-property pos len 'face 'ns-working-text-face ns-working-text done")
  14. (insert ns-working-text)
  15. (message "DEBUG: insert-ns-working-text done")
  16. (if (= len 0)
  17. (overlay-put (setq ns-working-overlay
  18. (make-overlay start (point) (current-buffer) nil t))
  19. 'face 'ns-working-text-face)
  20. (overlay-put (setq ns-working-overlay
  21. (make-overlay start (point) (current-buffer) nil t))
  22. 'face 'ns-unmarked-text-face)
  23. (overlay-put (setq ns-marked-overlay
  24. (make-overlay (+ start pos) (+ start pos len)
  25. (current-buffer) nil t))
  26. 'face 'ns-marked-text-face))
  27. (goto-char (+ start pos)))
  28. (message "DEBUG: SKIPPED put-text-property pos len 'face 'ns-working-text-face ns-working-text")
  29. )))

として調べてみたところ、(入力が速くて追いつかなかったときに?)確定した文字列が消えて次の入力だけ残った時に text-len より len が大きくなって Args out of range になるようです。

ns-insert-marked-text の呼び出し元の ns-put-marked-text が ns-win.el になくて、どこから呼ばれているのかすぐにはわからなかったので、ここまでしか調査できていません。

Ticket History (1/1 Histories)

2013-12-28 20:39 Updated by: znz
  • New Ticket "inline patch で "Args out of range: x, y" エラー" created

Attachment File List

No attachments

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login