aboutsummaryrefslogtreecommitdiffstats
path: root/build-root
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2016-07-08 08:13:45 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2016-07-08 14:18:22 +0000
commit9b8ffd99fb35d37250cfb7094a0a31515f1bb577 (patch)
tree604ebcf86671a86b9e3395dda8d9fda50db2fcbc /build-root
parent0557a91ca727cee963a8179808d2d2108564ec56 (diff)
fd-io-styleify pass
Change-Id: If2d57a213fc2fec996db26df332910c3d2105f97 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'build-root')
-rwxr-xr-xbuild-root/emacs-lisp/fix-coding-style.el45
1 files changed, 45 insertions, 0 deletions
diff --git a/build-root/emacs-lisp/fix-coding-style.el b/build-root/emacs-lisp/fix-coding-style.el
new file mode 100755
index 00000000000..2371c776bf9
--- /dev/null
+++ b/build-root/emacs-lisp/fix-coding-style.el
@@ -0,0 +1,45 @@
+#!/usr/bin/emacs --script
+
+(fset 'fix-foreach
+ [?\C-u ?\C-s ?_ ?f ?o ?r ?e ?a ?c ?h ? ?* ?\( ?\C-a ?\C-o tab ?/ ?* ? ?* ?I ?N ?D ?E ?N ?T ?- ?O ?F ?F ?* ? ?* ?/ ?\C-u ?\C-s ?\C-s ?\C-b escape ?\C-f ?\C-e ?\C-j ?/ ?* ? ?* ?I ?N ?D ?E ?N ?T ?- ?O ?N ?* ? ?* ?/])
+(fset 'fix-cli-command
+ [?\C-s ?C ?L ?I ?_ ?C ?O ?M ?M ?A ?N ?D ?\C-a ?\C-o ?/ ?* ? ?* ?I ?N ?D ?E ?N ?T ?- ?O ?F ?F ?* ? ?* ?/ ?\C-s ?\} ?\C-e ?\C-j ?/ ?* ? ?I ?N ?D ?E ?N backspace backspace backspace backspace backspace ?* ?I ?N ?D ?E ?N ?T ?- ?O ?N ?* ? ?* ?/])
+(fset 'fix-node
+ [?\C-s ?R ?E ?G ?I ?S ?T ?E ?R ?_ ?N ?O ?D ?E ?\C-a ?\C-o ?/ ?* ? ?* ?I ?N ?D ?E ?N ?T ?- ?O ?F ?F ?* ? ?* ?/ ?\C-a ?\C-n ?\C-s ?\{ ?\C-b escape ?\C-f ?\C-e ?\C-j ?/ ?* ?\S- ?* ?I ?N ?D ?E ?N ?T ?- ?O ?N ?* ? ?* ?/])
+
+(fset 'fix-elog-type
+ [?\C-s ?E ?L ?O ?G ?_ ?T ?Y ?P ?E ?_ ?D ?E ?C ?L ?A ?R ?E ?\C-a ?\C-o tab ?/ ?* ? ?* ?I ?N ?D ?E ?N ?T ?- ?O ?F ?F ?* ? ?* ?/ ?\C-a ?\C-n ?\C-n tab escape ?\C-f ?\C-e ?\C-j tab ?/ ?* ? ?* ?I ?N ?D ?E ?N ?T ?- ?O ?N ?* ? ?* ?/ ?\C-a ?\C-n])
+
+;; insert style boilerplate
+(defun insert-style-boilerplate () (interactive)
+ (save-excursion (goto-char (point-max))
+ (insert "
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables:
+ * eval: (c-set-style \"gnu\")
+ * End:
+ */")))
+
+;; Driver routine which runs the set of keyboard macros
+;; defined above, as well as the bottom boilerplate lisp fn.
+
+(defun fd-io-styleify () (interactive)
+ (save-excursion (goto-char (point-min))
+ (ignore-errors (execute-kbd-macro 'fix-foreach 0)))
+ (save-excursion (goto-char (point-min))
+ (ignore-errors (execute-kbd-macro 'fix-cli-command 0)))
+ (save-excursion (goto-char (point-min))
+ (ignore-errors (execute-kbd-macro 'fix-node 0)))
+ (save-excursion (goto-char (point-min))
+ (ignore-errors (execute-kbd-macro 'fix-elog-type 0)))
+ (insert-style-boilerplate))
+
+;;(setq index 0)
+;;(while (elt argv index)
+;; (message "Processing argv %d is %s" index (elt argv index))
+;; (find-file (elt argv index))
+;; (fd-io-styleify)
+;; (setq index (1+ index)))
+;; (save-buffers-kill-emacs)