Skip to content

Commit 28f8430

Browse files
committed
Fix php-build-table-from-path
Instead of fixed length vectors, just construct a list. There should be no particular problem with modern computers.
1 parent f5521b3 commit 28f8430

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

php-mode.el

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,19 +1394,11 @@ current `tags-file-name'."
13941394
table))
13951395

13961396
(defun php-build-table-from-path (path)
1397-
(let ((table (make-vector 1022 0))
1398-
(files (directory-files
1399-
path
1400-
nil
1401-
"^function\\..+\\.html$")))
1402-
(mapc (lambda (file)
1403-
(string-match "\\.\\([-a-zA-Z_0-9]+\\)\\.html$" file)
1404-
(intern
1405-
(replace-regexp-in-string
1406-
"-" "_" (substring file (match-beginning 1) (match-end 1)) t)
1407-
table))
1408-
files)
1409-
table))
1397+
"Return list of PHP function name from `PATH' directory."
1398+
(cl-loop for file in (directory-files path nil "^function\\..+\\.html$")
1399+
if (string-match "\\.\\([-a-zA-Z_0-9]+\\)\\.html$" file)
1400+
collect (replace-regexp-in-string
1401+
"-" "_" (substring file (match-beginning 1) (match-end 1)) t)))
14101402

14111403
;; Find the pattern we want to complete
14121404
;; find-tag-default from GNU Emacs etags.el

0 commit comments

Comments
 (0)