From 74b477240856f13bd91824b5fe45a607fd84878f Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Mon, 6 Oct 2008 22:14:54 +1030 Subject: [PATCH] * wesnoth-mode.el (wesnoth-complete-macro): Fix reference to unbound variables. (wesnoth-check-output): Take buffer as an argument. (wesnoth-check-wml): Supply buffer argument. --- wesnoth-mode.el | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/wesnoth-mode.el b/wesnoth-mode.el index 42d2f43..2748c84 100644 --- a/wesnoth-mode.el +++ b/wesnoth-mode.el @@ -294,8 +294,8 @@ level as their parent.") "Complete and insert the macro at point." (interactive) (wesnoth-update-project-information) - (let* ((macro-information (append wesnoth-macro-information - wesnoth-local-macro-information)) + (let* ((macro-information (append wesnoth-macro-data + wesnoth-local-macro-data)) (completions (wesnoth-emacs-completion-formats (mapcar 'car macro-information))) (macro (wesnoth-element-completion completions "Macro: ")) @@ -695,10 +695,10 @@ be performed." list)) wesnoth-tag-data :key position))))) -(defun wesnoth-check-output (format-string &rest args) +(defun wesnoth-check-output (buffer format-string &rest args) (save-excursion (let ((lnap (line-number-at-pos))) - (set-buffer outbuf) + (set-buffer buffer) (insert (apply 'format (concat "%d: " format-string "\n") lnap args))))) @@ -724,7 +724,8 @@ be performed." (cond ((looking-at "^[\t ]*\\[\\+?\\(\\(\\w\\|_\\)+\\)\\]") (unless (wesnoth-check-element-type 'second (car unmatched-tag-list)) - (wesnoth-check-output "Tag not available in this context: %s" + (wesnoth-check-output outbuf + "Tag not available in this context: %s" (match-string-no-properties 1))) (setq unmatched-tag-list (cons (match-string-no-properties 1) @@ -739,46 +740,47 @@ be performed." ("ifdef" "#endif") ("ifndef" "#endif")) :key 'car :test 'string=))) - (wesnoth-check-output + (wesnoth-check-output outbuf "Preprocessor statement does not nest correctly")) (setq unmatched-tag-list (cdr unmatched-tag-list))) ((looking-at "^[\t ]*\\(\\(\\w\\|_\\)+\\)=") (unless (wesnoth-check-element-type 'third (car unmatched-tag-list)) - (wesnoth-check-output "Attribute not available in this context: %s" + (wesnoth-check-output + outbuf "Attribute not available in this context: %s" (match-string-no-properties 1)))) ((looking-at "^[\t ]*#else") (unless (string-match "ifn?def" (car unmatched-tag-list)) (if (string= (car unmatched-tag-list) "#define") - (wesnoth-check-output "Expecting: %s" + (wesnoth-check-output outbuf "Expecting: %s" (car unmatched-tag-list)) - (wesnoth-check-output "Expecting: [/%s]" + (wesnoth-check-output outbuf "Expecting: [/%s]" (car unmatched-tag-list))))) ((looking-at "^[\t ]*{\\(\\(\\w\\|_\\)+\\).*}") (unless (find (match-string-no-properties 1) (append wesnoth-local-macro-data wesnoth-macro-data) :test 'string= :key 'car) - (wesnoth-check-output "Unknown macro definition: {%s}" + (wesnoth-check-output outbuf "Unknown macro definition: {%s}" (match-string-no-properties 1)))) ((or (looking-at "^[\t ]*\\[/\\(\\(\\w\\|_\\)+\\)\\]")) (unless (string= (match-string-no-properties 1) (car unmatched-tag-list)) (if (string= "#" (subseq (car unmatched-tag-list) 0 1)) - (wesnoth-check-output "Expecting: #%s" + (wesnoth-check-output outbuf "Expecting: #%s" (car (find (car unmatched-tag-list) '(("enddef" "#define") ("ifdef" "#endif") ("ifndef" "#endif")) :key 'second :test 'string=))) - (wesnoth-check-output "Expecting: [/%s]" + (wesnoth-check-output outbuf "Expecting: [/%s]" (car unmatched-tag-list)))) (setq unmatched-tag-list (cdr unmatched-tag-list)))) (end-of-line)) (if unmatched-tag-list (dolist (tag unmatched-tag-list) - (wesnoth-check-output "Unmatched tag: %s" + (wesnoth-check-output outbuf "Unmatched tag: %s" (car unmatched-tag-list))))) (save-excursion (display-buffer outbuf t) -- 2.11.4.GIT