Skip to content

Commit 40b8abe

Browse files
committed
Use save-match-data in php-local-manual.el
1 parent 38d8adb commit 40b8abe

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lisp/php-local-manual.el

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ current `tags-file-name'."
194194
(setq php-local-manual--completion-table php-table))))
195195

196196
(defun php-local-manual-build-table-from-file (filename)
197+
"Build a table of PHP function names from FILENAME."
197198
(let ((table (make-vector 1022 0))
198199
(buf (find-file-noselect filename)))
199200
(with-current-buffer buf
@@ -208,10 +209,11 @@ current `tags-file-name'."
208209

209210
(defun php-local-manual-build-table-from-path (path)
210211
"Return list of PHP function name from `PATH' directory."
211-
(cl-loop for file in (directory-files path nil "^function\\..+\\.html$")
212-
if (string-match "\\.\\([-a-zA-Z_0-9]+\\)\\.html$" file)
213-
collect (replace-regexp-in-string
214-
"-" "_" (substring file (match-beginning 1) (match-end 1)) t)))
212+
(save-match-data
213+
(cl-loop for file in (directory-files path nil "^function\\..+\\.html$")
214+
if (string-match "\\.\\([-a-zA-Z_0-9]+\\)\\.html$" file)
215+
collect (replace-regexp-in-string
216+
"-" "_" (substring file (match-beginning 1) (match-end 1)) t))))
215217

216218
(provide 'php-local-manual)
217219
;;; php-local-manual.el ends here

0 commit comments

Comments
 (0)