emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: /* */ style comments in C++ sources


From: Alan Mackenzie
Subject: Re: /* */ style comments in C++ sources
Date: Fri, 16 Jun 2017 12:40:10 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

Hello again, Eli.

On Fri, Jun 16, 2017 at 11:50:13 +0000, Alan Mackenzie wrote:
> On Fri, Jun 16, 2017 at 09:22:06 +0300, Eli Zaretskii wrote:
> > > Date: Thu, 15 Jun 2017 21:10:07 +0000
> > > Cc: address@hidden, Dani Moncayo <address@hidden>
> > > From: Alan Mackenzie <address@hidden>

> > > >   Call `c-toggle-comment-style' with a numeric argument in, e.g., a mode
> > > >   hook to do the obvious.

> > > More precisely, put

> > >     (c-toggle-comment-style 1)

> > > into your c++-mode-hook.

> > Is this supposed to work in directory-local variables loaded via
> > .dir-locals.el?  If so, could older versions of Emacs barf when they
> > see this?

> Ah.  That's a problem.  Older versions of Emacs would indeed foul up on
> seeing that in .dir-locals.el.

> > The reason I'm asking is that I'd like to add this to the
> > .dir-locals.el file in the GDB repository.

> We could really do with being able to write (if (fboundp ...) ...) in a
> .dir-locals.el.  I don't think we've any way of doing this at the moment.

How about something like:

    (c++-mode . ((eval . (when (fboundp 'c-toggle-comment-style)
                           (c-toggle-comment-style 1)))))

(not tested)?  It might not be pretty, but it should surely work without
throwing errors in Emacs <= 25.2.

> Maybe I could amend the amendment for /* */ so that it would need only to
> set a variable in .dir-locals.el rather than calling a function.  Would
> that work better?

> [ .... ]

> > Thanks.

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]