Emacs & D wiki update

Bill Baxter dnewsgroup at billbaxter.com
Fri Mar 2 14:03:04 PST 2007


Sean Kelly wrote:
> Bill Baxter wrote:
>>
>> The bizarre thing is that I actually like the way it highlights D code 
>> *better* than Ben Hinkle's d-mode.  That's really bizarre.  I think 
>> it's just that's because it's based on emacs 22's cc-mode, so really 
>> all I'm seeing is the upgraded cc-mode at work.
>>
>> So realizing this, I decided to try to update Ben Hinkle's mode.  It 
>> now works for me at least in both Emacs 21 and 22.    You can get it 
>> here:
>>    http://www.prowiki.org/wiki4d/wiki.cgi?EditorSupport/EmacsDMode
>>
>> Hopefully that will work for you.   If not, maybe tell me what version 
>> of emacs you have (M-x version) and what version of cc-mode you have 
>> (M-x c-version).  But honestly I'm not really much of an elisp hacker. 
>> I know just enough to be dangerous.  :-)
> 
> I'll give it a try.  The problem I ran into with the old d-mode was that 
> it didn't auto-indent some things properly, and Emacs tends to be pretty 
> heavy-handed in how it does auto-indenting.  With any luck this one will 
> work better.

My changes to the new D mode don't make any difference on emacs 21.  For 
instance methods inside a class template get formatted strangely still. 
   But those issues seem to be fixed by emacs 22's cc-mode support. 
So...if you're using emacs 21, I guess you could try upgrading your 
entire cc-mode.

What my changes enabled was for d-mode to work at all in emacs 22's 
cc-mode.  But the changes are kinda hacky.  In particular I check for 
the version by checking (boundp 'some-particular-new-function) three 
times in a row.

Cleanups and improvements would definitely be welcome if you have some 
time to work on it.  I posted an email to the cc-mode mailing list 
asking for advice/assistance but no response yet.  Seems to be more spam 
than signal on that list.

--bb

--bb



More information about the Digitalmars-d-announce mailing list