[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Further CC-mode changes
From: |
Ivan Andrus |
Subject: |
Re: Further CC-mode changes |
Date: |
Fri, 12 Sep 2014 19:09:18 -0600 |
On Sep 12, 2014, at 5:59 PM, Alan Mackenzie <address@hidden> wrote:
> Hello, Stefan.
>
> On Thu, Sep 11, 2014 at 09:55:29AM -0400, Stefan Monnier wrote:
>> While waiting for your guidance as to which parts of my patches need to
>> be reverted and why, here's some candidate patch which (contrary to the
>> one you reverted) actually changes the code's behavior.
>
>> It's to be applied on top of the ones you removed (tho since the ones
>> you remove are mostly cosmetic, it shouldn't make much of a difference).
>
>> Questions:
>> - should C-c C-n and friends be moved to c-derivative-mode-map
>> (AFAIK neither Java nor IDL nor Pike have CPP conditionals)?
>
> No. Less disruptive is either to remove these bindings from
> c-mode-base-map and put them in c-mode-map etc., or to splat them out
> from java-mode-map, etc., as is done in awk-mode-map. This is a bug, I
> suppose, but a tiny one - attempting C-c C-n in Java Mode throws an error
> immediately.
>
>> - I notice that all cc-mode enable abbrev-mode except for idl-mode.
>> Was that on purpose or is it just accidental?
>
> Probably deliberate. IDL Mode doesn't have keywords like "else", as far
> as I'm aware. I'm also not aware of anyone using IDL Mode, there having
> been no bug reports for it for many years, if ever.
FWIW I created slice-mode (for the ZeroC Slice language [1]) derived from IDL
mode. It’s only in my .emacs right now since it’s so trivial. It’s not
perfect, but good enough for the few times I actually have to edit the files
(they define interfaces and are therefore quite stable).
-Ivan
[1] http://doc.zeroc.com/display/Ice/The+Slice+Language
(define-derived-mode slice-mode idl-mode "Slice"
"This is a mode for editing slice (Ice definition) files.
It is based on idl-mode because of the comment at
http://www.zeroc.com/forums/help-center/818-any-editor-slice-syntax-highlight.html
I haven't been able to determine the differences between slice
and idl, so I don't know how good it is."
(font-lock-add-keywords
'slice-mode
`(
(,(concat "\\<\\("
(regexp-opt
'("Object" "LocalObject" "exception" "interface" "idempotent"))
"\\)\\> ")
1 font-lock-keyword-face t)
("^! .*" 0 font-lock-warning-face t)
;; Reserved names
("\\(Ice\\w*\\)" 1 font-lock-builtin-face)
,(concat "\\<\\(\\w*"
(regexp-opt
'("Helper" "Holder" "Prx" "Ptr"))
"\\)\\> ")
;; Built-in types
,(concat "\\<\\(\\w*"
(regexp-opt
'("bool" "byte" "short" "int" "long" "float" "double" "string"))
"\\)\\> ")
)))
- Re: POC: customizable cc-mode keywords, Stefan Monnier, 2014/09/08
- Further CC-mode changes, Stefan Monnier, 2014/09/11
- Re: Further CC-mode changes, Alan Mackenzie, 2014/09/12
- Re: Further CC-mode changes, Stefan Monnier, 2014/09/12
- Re: Further CC-mode changes, Alan Mackenzie, 2014/09/13
- Re: Further CC-mode changes, Stefan Monnier, 2014/09/13
- Syntax-propertize and CC-mode [Was: Further CC-mode changes], Alan Mackenzie, 2014/09/13
- Re: Syntax-propertize and CC-mode [Was: Further CC-mode changes], Stefan Monnier, 2014/09/14
- Sync'ing cc-mode, Stefan Monnier, 2014/09/16
- Re: Sync'ing cc-mode, Stefan Monnier, 2014/09/26
- Re: Further CC-mode changes, Glenn Morris, 2014/09/15
- Re: Further CC-mode changes, Stephen J. Turnbull, 2014/09/15