[FFmpeg-devel] [PATCH 5/7] doc/developer.texi: move editor configuration under formatting
Anton Khirnov
anton at khirnov.net
Thu Nov 17 12:09:40 EET 2022
It logically belongs there.
---
doc/developer.texi | 67 +++++++++++++++++++++++-----------------------
1 file changed, 34 insertions(+), 33 deletions(-)
diff --git a/doc/developer.texi b/doc/developer.texi
index 44da6e41af..d0e2e04a2d 100644
--- a/doc/developer.texi
+++ b/doc/developer.texi
@@ -119,6 +119,40 @@ The presentation is one inspired by 'indent -i4 -kr -nut'.
The main priority in FFmpeg is simplicity and small code size in order to
minimize the bug count.
+ at subsection Vim configuration
+In order to configure Vim to follow FFmpeg formatting conventions, paste
+the following snippet into your @file{.vimrc}:
+ at example
+" indentation rules for FFmpeg: 4 spaces, no tabs
+set expandtab
+set shiftwidth=4
+set softtabstop=4
+set cindent
+set cinoptions=(0
+" Allow tabs in Makefiles.
+autocmd FileType make,automake set noexpandtab shiftwidth=8 softtabstop=8
+" Trailing whitespace and tabs are forbidden, so highlight them.
+highlight ForbiddenWhitespace ctermbg=red guibg=red
+match ForbiddenWhitespace /\s\+$\|\t/
+" Do not highlight spaces at the end of line while typing on that line.
+autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@@<!$/
+ at end example
+
+ at subsection Emacs configuration
+For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
+ at lisp
+(c-add-style "ffmpeg"
+ '("k&r"
+ (c-basic-offset . 4)
+ (indent-tabs-mode . nil)
+ (show-trailing-whitespace . t)
+ (c-offsets-alist
+ (statement-cont . (c-lineup-assignments +)))
+ )
+ )
+(setq c-default-style "ffmpeg")
+ at end lisp
+
@section Comments
Use the JavaDoc/Doxygen format (see examples below) so that code documentation
can be generated automatically. All nontrivial functions should have a comment
@@ -215,39 +249,6 @@ Casts should be used only when necessary. Unneeded parentheses
should also be avoided if they don't make the code easier to understand.
@end itemize
- at section Editor configuration
-In order to configure Vim to follow FFmpeg formatting conventions, paste
-the following snippet into your @file{.vimrc}:
- at example
-" indentation rules for FFmpeg: 4 spaces, no tabs
-set expandtab
-set shiftwidth=4
-set softtabstop=4
-set cindent
-set cinoptions=(0
-" Allow tabs in Makefiles.
-autocmd FileType make,automake set noexpandtab shiftwidth=8 softtabstop=8
-" Trailing whitespace and tabs are forbidden, so highlight them.
-highlight ForbiddenWhitespace ctermbg=red guibg=red
-match ForbiddenWhitespace /\s\+$\|\t/
-" Do not highlight spaces at the end of line while typing on that line.
-autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@@<!$/
- at end example
-
-For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
- at lisp
-(c-add-style "ffmpeg"
- '("k&r"
- (c-basic-offset . 4)
- (indent-tabs-mode . nil)
- (show-trailing-whitespace . t)
- (c-offsets-alist
- (statement-cont . (c-lineup-assignments +)))
- )
- )
-(setq c-default-style "ffmpeg")
- at end lisp
-
@anchor{Development Policy}
@chapter Development Policy
--
2.35.1
More information about the ffmpeg-devel
mailing list