File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -1124,19 +1124,17 @@ Indentation offset set with file variable; not adjusted")
1124
1124
; ;-----------------------------------------------------------------
1125
1125
; ; Installation
1126
1126
1127
- (defadvice hack-one-local-variable
1128
- (before dtrt-indent-advise-hack-one-local-variable activate)
1129
- " Adviced by dtrt-indent.
1130
-
1131
- Disable dtrt-indent if offset explicitly set."
1127
+ (defun dtrt-indent-advise-hack-one-local-variable (var _val &rest _ )
1128
+ " Advice for `hack-one-local-variable' to disable dtrt-indent when necessary.
1129
+ VAR corresponds to the first argument of `hack-one-local-variable' ."
1132
1130
(cond
1133
- ((eql (nth 2 (dtrt-indent--search-hook-mapping major-mode))
1134
- (ad-get-arg 0 ))
1131
+ ((eql (nth 2 (dtrt-indent--search-hook-mapping major-mode)) var)
1135
1132
(setq dtrt-indent-explicit-offset t ))
1136
- ((eql 'indent-tabs-mode
1137
- (ad-get-arg 0 ))
1133
+ ((eql 'indent-tabs-mode var)
1138
1134
(setq dtrt-indent-explicit-tab-mode t ))))
1139
1135
1136
+ (advice-add 'hack-one-local-variable :before #'dtrt-indent-advise-hack-one-local-variable )
1137
+
1140
1138
(autoload 'dtrt-indent-diagnosis " dtrt-indent-diag"
1141
1139
" Guess indentation for the current buffer and output diagnostics."
1142
1140
t )
You can’t perform that action at this time.
0 commit comments