Skip to content

Commit 0fab6e2

Browse files
committed
Really fix crash on Emacs 24
1 parent 898df90 commit 0fab6e2

File tree

4 files changed

+15
-21
lines changed

4 files changed

+15
-21
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
*.texi
55
.cask
66
dist
7+
8+
ede-php-autoload-autoloads.el

ede-php-autoload-composer.el

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,6 @@ information into AUTOLOADS."
190190
project-dir
191191
(ede-php-autoload--merge-composer-autoloads root-data autoloads nil))))
192192

193-
(defun ede-php-autoload-proj-root ()
194-
"Auto-detect composer project root.
195-
196-
Return the parent directory of the current buffer file that contains a composer.json file."
197-
(let ((dominating-file (locate-dominating-file (or (buffer-file-name) default-directory) ede-php-autoload-composer-file)))
198-
(when dominating-file
199-
(file-name-directory dominating-file))))
200-
201193

202194
(provide 'ede-php-autoload-composer)
203195

ede-php-autoload.el

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,16 @@ DIR is the directory to search from."
6464
(defun ede-php-autoload-project-file-for-dir (&optional dir)
6565
"Return a full file name to the project file stored in DIR."
6666
(let ((proj (ede-php-autoload-file-existing dir)))
67-
(when proj (oref proj :file))))
67+
(when proj (oref proj file))))
6868

6969
;;;###autoload
70-
(defun ede-php-autoload-project-root (&optional dir)
71-
"Get the root directory for DIR."
72-
(let ((projfile (ede-php-autoload-project-file-for-dir
73-
(or dir default-directory))))
74-
(when projfile
75-
(file-name-directory projfile))))
70+
(defun ede-php-autoload-proj-root ()
71+
"Auto-detect composer project root.
72+
73+
Return the parent directory of the current buffer file that contains a composer.json file."
74+
(let ((dominating-file (locate-dominating-file (or (buffer-file-name) default-directory) ede-php-autoload-composer-file)))
75+
(when dominating-file
76+
(file-name-directory dominating-file))))
7677

7778
;; Composer project detection
7879

@@ -99,7 +100,7 @@ intended to be a subproject, so this argument is ignored."
99100
:name "PHP AUTOLOAD"
100101
:file 'ede-php-autoload
101102
:proj-file "composer.json"
102-
:proj-root 'ede-php-autoload-project-root
103+
:proj-root 'ede-php-autoload-proj-root
103104
:load-type 'ede-php-autoload-load
104105
:class-sym 'ede-php-autoload-project
105106
:new-p nil
@@ -163,7 +164,7 @@ to the associated directories."
163164
:class-loader (ede-php-autoload-create-class-loader class-autoloads)
164165
:include-path (plist-get (car fields) :include-path)
165166
:system-include-path (plist-get (car fields) :system-include-path))))
166-
(let ((f (expand-file-name (oref this :file))))
167+
(let ((f (expand-file-name (oref this file))))
167168
;; Remove any previous entries from the main list.
168169
(let ((old (eieio-instance-tracker-find (file-name-directory f)
169170
:directory

test/test-helper.el

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
;;; Commentary:
2626
;;
2727
(require 'cl-lib)
28+
(require 'package)
2829
;;; Code:
2930

3031
(global-ede-mode 1)
@@ -40,11 +41,9 @@
4041

4142
;; Load ede-php-autoload sources
4243
(add-to-list 'load-path test-helper--project-root)
44+
(package-generate-autoloads "ede-php-autoload" test-helper--project-root)
4345

44-
(require 'ede-php-autoload)
45-
(require 'ede-php-autoload-composer)
46-
(require 'ede-php-autoload-semanticdb)
47-
(require 'ede-php-autoload-mode)
46+
(load (concat test-helper--project-root "ede-php-autoload-autoloads.el"))
4847

4948
;; Define projects
5049
;; The composer projet is auto-detected

0 commit comments

Comments
 (0)