* erc-button.el (erc-button-next-function): Scoping fix (Bug#9487).

This commit is contained in:
Antoine Levitt 2011-09-23 17:22:31 -04:00 committed by Chong Yidong
parent 0a39f27eb9
commit 953ea722f4
2 changed files with 18 additions and 13 deletions

View file

@ -1,3 +1,8 @@
2011-09-23 Antoine Levitt <antoine.levitt@gmail.com>
* erc-button.el (erc-button-next-function): Scoping fix
(Bug#9487).
2011-07-04 Vivek Dasmohapatra <vivek@etla.org>
* erc.el (erc-generate-new-buffer-name): Reuse old buffer names

View file

@ -430,19 +430,19 @@ call it with the value of the `erc-data' text property."
(defun erc-button-next-function ()
"Pseudo completion function that actually jumps to the next button.
For use on `completion-at-point-functions'."
(let ((here (point)))
(when (< here (erc-beg-of-input-line))
(lambda ()
(while (and (get-text-property here 'erc-callback)
(not (= here (point-max))))
(setq here (1+ here)))
(while (and (not (get-text-property here 'erc-callback))
(not (= here (point-max))))
(setq here (1+ here)))
(if (< here (point-max))
(goto-char here)
(error "No next button"))
t))))
(when (< (point) (erc-beg-of-input-line))
`(lambda ()
(let ((here ,(point)))
(while (and (get-text-property here 'erc-callback)
(not (= here (point-max))))
(setq here (1+ here)))
(while (and (not (get-text-property here 'erc-callback))
(not (= here (point-max))))
(setq here (1+ here)))
(if (< here (point-max))
(goto-char here)
(error "No next button"))
t))))
(defun erc-button-next ()
"Go to the next button in this buffer."