From 9238159c23170fec2bf9789b54cdd90e16a16d5d Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Wed, 24 Dec 2008 08:34:25 +1030 Subject: [PATCH] * wesnoth-mode.el (wesnoth-element-type): Allow matching of opening tags which have no indentation. (wesnoth-check-element-type): Fix a bug where attributes were not found when parent was `t'. --- wesnoth-mode.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/wesnoth-mode.el b/wesnoth-mode.el index a8b9eb9..e37c000 100644 --- a/wesnoth-mode.el +++ b/wesnoth-mode.el @@ -375,7 +375,8 @@ of the element." (when (looking-at (car pair)) (throw 'result (list (cdr pair) (match-beginning 0) - (match-end 0)))))))) + (min (save-excursion (forward-line 1) (point)) + (match-end 0))))))))) (defun wesnoth-estimate-element-type (point) "Return match data for a partial element at POINT." @@ -1136,7 +1137,15 @@ POSITION is the position of the element in the list." (member (match-string-no-properties 1) (nth position (gethash parent wesnoth-tag-hash-table))) (member (match-string-no-properties 1) - (mapcar 'car wesnoth-tag-data))))) + (let ((result '())) + (mapc + '(lambda (x) + (let ((value (nth position (cdr x)))) + (mapc '(lambda (y) + (setq result (cons y result))) + value))) + wesnoth-tag-data) + result))))) ;; Provide `line-number-at-pos' implementation (not available in Emacs 21). (defun wesnoth-line-number-at-pos (&optional pos) -- 2.11.4.GIT