Emacs WML-mode

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
WildPenguin
Posts: 161
Joined: September 6th, 2005, 10:41 pm
Location: Australia

Re: Emacs WML-mode

Post by WildPenguin »

Anonymissimus wrote:#ifdef etc is indented like a tag but doesn't cause indentation itsself

Code: Select all

	[event]
		#ifdef HARD
		name=turn 2
		#else
		name=turn 3
		#endif
	[/event]
The behaviour is intentional for consistency with the wmlindent tool, although I also find this style of indentation unusual. I'll look into changing this behaviour when wesnoth-indent-preprocessor-bol is nil.

Update: This has been added in 1.3.4a.
fabi
Inactive Developer
Posts: 1260
Joined: March 21st, 2004, 2:42 pm
Location: Germany

Re: Emacs WML-mode

Post by fabi »

commited
WildPenguin
Posts: 161
Joined: September 6th, 2005, 10:41 pm
Location: Australia

Re: Emacs WML-mode

Post by WildPenguin »

Wesnoth Mode 1.3.5 is now available.

As usual, several bugs have been fixed and some new features added.

New to this release is the ability to navigate via WML structure. C-M-n and C-M-p will move forward and back (respectively) one block at the current depth. C-M-d move one level deeper, whereas C-M-u will move up one level. Prefix arguments can be added to any of these to repeat the command 'n' times.

It's now also possible to kill a block using C-M-k, and mark can be placed at the end of the current block using C-M-SPC.
fabi
Inactive Developer
Posts: 1260
Joined: March 21st, 2004, 2:42 pm
Location: Germany

Re: Emacs WML-mode

Post by fabi »

Commited 1.3.5 to trunk.
Kernigh
Posts: 107
Joined: February 13th, 2007, 10:21 pm
Location: United States
Contact:

Re: Emacs WML-mode

Post by Kernigh »

I found a copy of Emacs WML-mode in wesnoth/data/tools/emacs_mode, and started using it with Emacs 23.4. I have a problem when indenting IF_VAR calls.

Emacs indents like this:

Code: Select all

{IF_VAR a equals $b (
[then]
    {ERROR "yes"}
[/then]
[else]
    {ERROR "no"}
[/else]
)}
But wmlindent does indent, and I want to indent, like this:

Code: Select all

{IF_VAR a equals $b (
    [then]
        {ERROR "yes"}
    [/then]
    [else]
        {ERROR "no"}
    [/else]
)}
Does anyone know how to configure Emacs WML-mode to indent IF_VAR as wmlindent does?
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Emacs WML-mode

Post by Anonymissimus »

It does that with all similar macro constructs. Most likely it's not possible; and this mode in unmaintained since WildPenguin's disappearance.
He last logged in 03 Dec 2011, 08:06 though, so perhaps he can be motivated to continue his work. :)
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Post Reply