module-cc.el: Fix c-lineup-arglist advice

This commit is contained in:
Henrik Lissner 2015-07-16 20:37:19 +02:00
parent 10083a9952
commit 1c7a886c0c

View file

@ -65,20 +65,18 @@
(add-hook! c++-mode 'narf|init-c++-C11-highlights) (add-hook! c++-mode 'narf|init-c++-C11-highlights)
;; Fix enum and C++11 lambda indentation ;; Fix enum and C++11 lambda indentation
(advice-add 'c-lineup-arglist :around 'narf*c-lineup-arglist) (defadvice c-lineup-arglist (around c-lineup-arglist-indent-fix activate)
;; (defadvice c-lineup-arglist (around c-lineup-arglist-indent-fix activate) "Improve indentation of continued C++11 lambda function opened as argument."
;; "Improve indentation of continued C++11 lambda function opened as argument." (setq ad-return-value
;; (setq ad-return-value (if (and (equal major-mode 'c++-mode)
;; (if (and (equal major-mode 'c++-mode) (ignore-errors
;; (ignore-errors (save-excursion
;; (save-excursion (goto-char (c-langelem-pos langelem))
;; (goto-char (c-langelem-pos langelem)) ;; Detect "[...](" or "[...]{". preceded by "," or "(",
;; ;; Detect "[...](" or "[...]{". preceded by "," or "(", ;; and with unclosed brace.
;; ;; and with unclosed brace. (looking-at ".*[(,][ \t]*\\[[^]]*\\][ \t]*[({][^}]*$"))))
;; (looking-at ".*[(,][ \t]*\\[[^]]*\\][ \t]*[({][^}]*$")))) 0 ; no additional indent
;; 0 ; no additional indent ad-do-it))))
;; ad-do-it)))
)
(progn ; Obj-C (progn ; Obj-C
(add-to-list 'magic-mode-alist (add-to-list 'magic-mode-alist