branch: elpa/d-mode
commit 8ccad322f76e28f2b49f036991cefa9ee3efa7aa
Author: Vladimir Panteleev <[email protected]>
Commit: Vladimir Panteleev <[email protected]>

    Simplify cascaded call indentation setup
    
    Provide a single function that can be added to d-mode-hook directly.
---
 d-mode.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/d-mode.el b/d-mode.el
index ab1ea71..7f4f439 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -653,10 +653,12 @@ Key bindings:
 ;; StackOverflow, and then amended by Nordlöw 
(https://stackoverflow.com/users/683710/nordl%C3%B6w) it
 ;; provides a function that people can make use of in their d-mode-hook thus:
 ;;
-;; (add-hook 'd-mode-hook
-;;                  '(lambda ()
-;;                     (add-to-list 'c-offsets-alist '(arglist-cont-nonempty . 
d-lineup-cascaded-calls))
-;;                     (add-to-list 'c-offsets-alist '(statement-cont . 
d-lineup-cascaded-calls))))
+;; (add-hook 'd-mode-hook 'd-setup-cascaded-call-indentation)
+
+(defun d-setup-cascaded-call-indentation ()
+  "Set up `d-lineup-cascaded-calls'."
+  (add-to-list 'c-offsets-alist '(arglist-cont-nonempty . 
d-lineup-cascaded-calls))
+  (add-to-list 'c-offsets-alist '(statement-cont . d-lineup-cascaded-calls)))
 
 (defun d-lineup-cascaded-calls (langelem)
   "This is a modified `c-lineup-cascaded-calls' function for the

Reply via email to