File tree 1 file changed +7
-11
lines changed
1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -1204,6 +1204,7 @@ After setting the stylevars run hooks according to STYLENAME
1204
1204
(when (fboundp 'c-looking-at-or-maybe-in-bracelist )
1205
1205
(advice-add #'c-looking-at-or-maybe-in-bracelist
1206
1206
:override 'php-c-looking-at-or-maybe-in-bracelist ))
1207
+ (advice-add #'fixup-whitespace :after #'php-mode--fixup-whitespace-after '(local))
1207
1208
1208
1209
(when (>= emacs-major-version 25 )
1209
1210
(with-silent-modifications
@@ -1493,18 +1494,13 @@ The output will appear in the buffer *PHP*."
1493
1494
1494
1495
; ;; Correct the behavior of `delete-indentation' by modifying the
1495
1496
; ;; logic of `fixup-whitespace' .
1496
- (defadvice fixup-whitespace (after php-mode-fixup-whitespace)
1497
+ (defun php-mode-- fixup-whitespace-after ( )
1497
1498
" Remove whitespace before certain characters in PHP Mode."
1498
- (let* ((no-behind-space " ;\\ |,\\ |->\\ |::" )
1499
- (no-front-space " ->\\ |::" ))
1500
- (when (and (eq major-mode 'php-mode )
1501
- (or (looking-at-p (concat " \\ (" no-behind-space " \\ )" ))
1502
- (save-excursion
1503
- (forward-char -2 )
1504
- (looking-at-p no-front-space))))
1505
- (delete-char 1 ))))
1506
-
1507
- (ad-activate 'fixup-whitespace )
1499
+ (when (or (looking-at-p " \\ (?:;\\ |,\\ |->\\ |::\\ )" )
1500
+ (save-excursion
1501
+ (forward-char -2 )
1502
+ (looking-at-p " ->\\ |::" )))
1503
+ (delete-char 1 )))
1508
1504
1509
1505
;;;### autoload
1510
1506
(progn
You can’t perform that action at this time.
0 commit comments