From 953ea722f439a38914cdf723341ac7b41deeec5f Mon Sep 17 00:00:00 2001 From: Antoine Levitt Date: Fri, 23 Sep 2011 17:22:31 -0400 Subject: [PATCH] * erc-button.el (erc-button-next-function): Scoping fix (Bug#9487). --- lisp/erc/ChangeLog | 5 +++++ lisp/erc/erc-button.el | 26 +++++++++++++------------- 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 @@ +2011-09-23 Antoine Levitt + + * erc-button.el (erc-button-next-function): Scoping fix + (Bug#9487). + 2011-07-04 Vivek Dasmohapatra * 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." (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." -- 2.11.4.GIT