Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
otb-devutils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main Repositories
otb-devutils
Commits
38146f62
Commit
38146f62
authored
13 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add emacs style for otb/ossim
parent
6bb9898e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Style/otb.el
+86
-0
86 additions, 0 deletions
Style/otb.el
with
86 additions
and
0 deletions
Style/otb.el
0 → 100644
+
86
−
0
View file @
38146f62
(
add-to-list
'load-path
"~/.emacs.d/"
)
;; c++ modes for some files: txx, h
(
add-to-list
'auto-mode-alist
'
(
"\\.txx\\'"
.
c++-mode
))
(
add-to-list
'auto-mode-alist
'
(
"\\.h\\'"
.
c++-mode
))
;; cuda files in c mode
(
add-to-list
'auto-mode-alist
'
(
"\\.cu\\'"
.
c-mode
))
;; Comments 80 col wide
(
setq-default
fill-column
80
)
;; OTB style
(
c-add-style
"otb"
'
(
"stroustrup"
(
c-basic-offset
.
2
)
(
c-offsets-alist
(
c
.
c-lineup-dont-change
)
(
innamespace
.
0
)
(
inline-open
.
0
)
(
substatement-open
.
+
)
(
statement-block-intro
.
0
)
(
arglist-intro
.
+
)
(
arglist-close
.
0
)
)
)
)
(
defun
maybe-otb-style
()
(
when
(
and
buffer-file-name
(
not
(
string-match
"ossim"
buffer-file-name
)))
(
c-set-style
"otb"
)))
(
add-hook
'c++-mode-hook
'maybe-otb-style
)
(
add-hook
'c++-mode-hook
(
lambda
()
(
setq
tab-width
2
)
(
turn-on-auto-fill
)))
;;default compilation command
(
setq
compile-command
"cd ~/OTB/OTB-Binary; make"
)
;; Always insert spaces, never tabs.
(
setq-default
indent-tabs-mode
nil
)
;; Remove trailing whitespace when saving
(
add-hook
'c++-mode-hook
(
lambda
()
(
add-to-list
'write-file-functions
'delete-trailing-whitespace
)))
;; cmake config
(
autoload
'cmake-mode
"cmake-mode"
t
)
(
add-to-list
'auto-mode-alist
'
(
"CMakeLists\\.txt\\'"
.
cmake-mode
))
(
add-to-list
'auto-mode-alist
'
(
"\\.cmake\\'"
.
cmake-mode
))
;; Ossim style
(
c-add-style
"ossim"
'
(
"bsd"
(
c-tab-always-indent
.
t
)
(
c-comment-only-line-offset
.
0
)
(
c-block-comments-indent-p
.
nil
)
(
c-basic-offset
.
3
)
(
c-hanging-braces-alist
.
((
substatement-open
after
)
(
inline-open
)
(
inline-close
)
(
brace-list-open
)))
(
c-hanging-colons-alist
.
((
member-init-intro
before
)
(
inher-intro
)
(
case-label
after
)
(
label
after
)
(
access-label
after
)))
(
c-cleanup-list
.
(
scope-operator
empty-defun-braces
defun-close-semi
))
(
c-offsets-alist
.
((
arglist-close
.
c-lineup-arglist
)
(
substatement-open
.
0
)
(
case-label
.
+
)
(
label
.
0
)
(
block-open
.
0
)
(
block-close
.
0
)
(
knr-argdecl-intro
.
0
)))
(
c-echo-syntactic-information-p
.
t
)
)
)
(
defun
maybe-ossim-style
()
(
when
(
and
buffer-file-name
(
string-match
"ossim"
buffer-file-name
))
(
c-set-style
"ossim"
)))
(
add-hook
'c++-mode-hook
'maybe-ossim-style
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment