aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Levitt2011-09-23 17:22:31 -0400
committerChong Yidong2011-09-23 17:22:31 -0400
commit953ea722f439a38914cdf723341ac7b41deeec5f (patch)
tree743259d63f2fb6c20eb2561ad8a8d3f12a258af5
parent0a39f27eb9b78ceacdf351eba4549efd3323c88d (diff)
downloademacs-953ea722f439a38914cdf723341ac7b41deeec5f.tar.gz
emacs-953ea722f439a38914cdf723341ac7b41deeec5f.zip
* erc-button.el (erc-button-next-function): Scoping fix (Bug#9487).
-rw-r--r--lisp/erc/ChangeLog5
-rw-r--r--lisp/erc/erc-button.el26
2 files changed, 18 insertions, 13 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 1560f2a9049..7c7f10de2c8 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,8 @@
12011-09-23 Antoine Levitt <antoine.levitt@gmail.com>
2
3 * erc-button.el (erc-button-next-function): Scoping fix
4 (Bug#9487).
5
12011-07-04 Vivek Dasmohapatra <vivek@etla.org> 62011-07-04 Vivek Dasmohapatra <vivek@etla.org>
2 7
3 * erc.el (erc-generate-new-buffer-name): Reuse old buffer names 8 * erc.el (erc-generate-new-buffer-name): Reuse old buffer names
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index 3a897347dea..7fbbbc317d0 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -430,19 +430,19 @@ call it with the value of the `erc-data' text property."
430(defun erc-button-next-function () 430(defun erc-button-next-function ()
431 "Pseudo completion function that actually jumps to the next button. 431 "Pseudo completion function that actually jumps to the next button.
432For use on `completion-at-point-functions'." 432For use on `completion-at-point-functions'."
433 (let ((here (point))) 433 (when (< (point) (erc-beg-of-input-line))
434 (when (< here (erc-beg-of-input-line)) 434 `(lambda ()
435 (lambda () 435 (let ((here ,(point)))
436 (while (and (get-text-property here 'erc-callback) 436 (while (and (get-text-property here 'erc-callback)
437 (not (= here (point-max)))) 437 (not (= here (point-max))))
438 (setq here (1+ here))) 438 (setq here (1+ here)))
439 (while (and (not (get-text-property here 'erc-callback)) 439 (while (and (not (get-text-property here 'erc-callback))
440 (not (= here (point-max)))) 440 (not (= here (point-max))))
441 (setq here (1+ here))) 441 (setq here (1+ here)))
442 (if (< here (point-max)) 442 (if (< here (point-max))
443 (goto-char here) 443 (goto-char here)
444 (error "No next button")) 444 (error "No next button"))
445 t)))) 445 t))))
446 446
447(defun erc-button-next () 447(defun erc-button-next ()
448 "Go to the next button in this buffer." 448 "Go to the next button in this buffer."