File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,27 @@ be processed."
7878 answers))))
7979 answers)))
8080
81+ (defun php-mode-test--buffer-face-list (buffer )
82+ " Return list of (STRING . FACE) from `BUFFER' ."
83+ (with-current-buffer buffer
84+ (save-excursion
85+ (goto-char (point-min ))
86+ (let (retval begin-pos last-face current-face str)
87+ (setq last-face (get-text-property (point ) 'face ))
88+ (setq begin-pos (point ))
89+ (forward-char 1 )
90+
91+ (while (< (point ) (point-max ))
92+ (setq current-face (get-text-property (point ) 'face ))
93+ (unless (equal current-face last-face)
94+ (setq str (buffer-substring-no-properties begin-pos (point )))
95+ (setq retval (nconc retval (list (cons str last-face))))
96+ (setq begin-pos (point ))
97+ (setq last-face current-face))
98+ (forward-char 1 ))
99+ (setq str (buffer-substring-no-properties begin-pos (point )))
100+ (nconc retval (list (cons str last-face)))))))
101+
81102(cl-defmacro with-php-mode-test ((file &key style indent magic custom) &rest body )
82103 " Set up environment for testing `php-mode' .
83104Execute BODY in a temporary buffer containing the contents of
You can’t perform that action at this time.
0 commit comments