emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/d-mode 8ccad32 136/346: Simplify cascaded call indentation


From: ELPA Syncer
Subject: [nongnu] elpa/d-mode 8ccad32 136/346: Simplify cascaded call indentation setup
Date: Sun, 29 Aug 2021 11:00:17 -0400 (EDT)

branch: elpa/d-mode
commit 8ccad322f76e28f2b49f036991cefa9ee3efa7aa
Author: Vladimir Panteleev <git@thecybershadow.net>
Commit: Vladimir Panteleev <git@thecybershadow.net>

    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

[Prev in Thread] Current Thread [Next in Thread]