Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

mode for editing ldif files?

263 views
Skip to first unread message

Jistan Idiot

unread,
Mar 29, 2012, 7:19:06 PM3/29/12
to
I recently started having to edit ldif files. I was wondering if
there's a mode that gets the syntax highlighting right?

I found one at http://www.loveshack.ukfsn.org/emacs/ldap-mode.el but I
keep getting an error:

Symbol's function definition is void: rx-to-string.

If I can get that one working that'd be great or if there's one that
already works with xemacs that'd be great too.

I'm using xemacs 21.4.22 on Kubuntu 11.10.

Thanks in advance.

Jistan Idiot

unread,
Apr 4, 2012, 10:09:50 PM4/4/12
to
I'm still struggling with this one. I found the rx.el from emacs and tried using it. However xemacs doesn't like it at all saying:

rx `any' requires string, character, char pair or char class args

I finally found this discussion http://permalink.gmane.org/gmane.emacs.orgmode/31864 with a link to someone's attempt to port rx to xemacs.

That port http://www.broadinstitute.org/~ilya/rx.el also doesn't work. It dies with:

Symbol's function definition is void: modify-coding-system-alist

Now I can't seem to find anything that provides the modify-coding-system-alist function. Nor can I find anything that can fix the rx.el from emacs. So both of them are broken and therefore I still can't use the ldap/ldiff modes.

So my original question remains is there something I can use to get the syntax highlighting right for ldif files? If what I've found before is the only available thing, then can anyone help me get these rx things working?

Thanks in advance.

Mike Kupfer

unread,
Apr 7, 2012, 7:51:23 PM4/7/12
to
Jistan Idiot <jista...@gmail.com> writes:

> That port http://www.broadinstitute.org/~ilya/rx.el also doesn't
> work. It dies with:
>
> Symbol's function definition is void: modify-coding-system-alist

I think this was added in XEmacs 21.5 (i.e., the current beta). So
you could try downloading and building the latest; it's pretty
stable.

mike

Jistan Idiot

unread,
Apr 12, 2012, 9:19:20 AM4/12/12
to
Ok so I am trying the beta

It still complains about ldap-mode.el and rx.el saying:

rx `any' requires string, character, char pair or char class args

With this failure I'm guessing there isn't a version of rx that works with any version of xemacs.

I'm start to think I might need to change strategies. I tried the aforementioned ldap-mode.el in emacs and it only seems to highlight a set of hard coded attributes (we have 100s of attributes and there's no way I'm going to hard code that). So maybe I need to throw that stuff out and attempt to create the mode from scratch.

Somehow vim gets it right. "dn: foo" is highlighted in one color and then all the attribute names are in another and finally the values are in a third color. Of course comments are done correctly too. It would seem you only need to figure out 4 regular expressions and tell xemacs to use a specific color for each one.

So it should be doable in xemacs right? So I guess I need to be pointed in the direction of a tutorial on creating a new mode in xemacs.

Thanks in advance.

Mike Kupfer

unread,
Apr 14, 2012, 8:45:10 PM4/14/12
to
Jistan Idiot <jista...@gmail.com> writes:

> It would seem you only need to figure out 4 regular
> expressions and tell xemacs to use a specific color for each one.
>
> So it should be doable in xemacs right?

I would think so.

> So I guess I need to be pointed in the direction of a tutorial on
> creating a new mode in xemacs.

Do you need a new mode, or do you just need to configure font-lock?
(I don't know much about font-lock.)

A few years ago someone asked about information on creating a new
mode, and in response there was a recommendation for "Writing GNU
Emacs Extensions". The exact quote is

"Writing GNU Emacs Extensions" by Bob Glickstein includes creating
new major and minor modes. The material is (on the whole)
applicable to Xemacs. The ISBN number is 1-56592-261-1.

I have successfully used this to create simple major and minor
modes. However this is not a trivial task. Especially if you are
not familiar with emacs-lisp.

And of course there's documentation in Info, though I don't see a
tutorial. The documentation for major and minor modes is in the
Lispref section. I don't see anything in Info for font-lock, which
surprises me.

mike

Julian Bradfield

unread,
Apr 15, 2012, 6:19:44 AM4/15/12
to
On 2012-04-05, Jistan Idiot <jista...@gmail.com> wrote:
>> I found one at http://www.loveshack.ukfsn.org/emacs/ldap-mode.el but I
>> keep getting an error:
..
>> I'm using xemacs 21.4.22 on Kubuntu 11.10.
..
> That port http://www.broadinstitute.org/~ilya/rx.el also doesn't work. It dies with:
>
> Symbol's function definition is void: modify-coding-system-alist

What do you do to get this?
On my XEmacs (which is a Unicode-native variant of 21.4.22), these two
files appear to work - at least, I get an .ldif file with some
highlighting. Whether it's the correct highlighting, I don't know.
It also appears to work in 21.5.29.
0 new messages