summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--emacs/Cask1
-rw-r--r--emacs/elisp/eldoc-php.el48
-rw-r--r--emacs/init.el5
3 files changed, 2 insertions, 52 deletions
diff --git a/emacs/Cask b/emacs/Cask
index 8d913817..8742df0f 100644
--- a/emacs/Cask
+++ b/emacs/Cask
@@ -51,6 +51,7 @@
 (depends-on "packed")
 (depends-on "pallet")
 (depends-on "paredit")
+(depends-on "php-extras")
 (depends-on "php-mode")
 (depends-on "pkg-info")
 (depends-on "project-persist")
diff --git a/emacs/elisp/eldoc-php.el b/emacs/elisp/eldoc-php.el
deleted file mode 100644
index 8101fea0..00000000
--- a/emacs/elisp/eldoc-php.el
+++ /dev/null
@@ -1,48 +0,0 @@
-(require 'xml)
-(provide 'eldoc-php)
-
-(setq my-php-function-doc-hash (make-hash-table :test 'equal))
-
-
-(defun my-php-fetch-function-doc (function)
-  (let ((doc (gethash function my-php-function-doc-hash 'nope)))
-    (when (eq doc 'nope)
-      (setq doc nil)
-
-      (let ((buf (url-retrieve-synchronously (concat "http://uk3.php.net/manual-lookup.php?pattern=" function))))
-        (with-current-buffer buf
-          (goto-char (point-min))
-          (let (desc)
-            (when (re-search-forward "<div class=\"methodsynopsis dc-description\">\\(\\(.\\|\n\\)*?\\)</div>" nil t)
-              (setq desc
-                    (replace-regexp-in-string
-                     " +" " "
-                     (replace-regexp-in-string
-                      "\n" ""
-                      (replace-regexp-in-string "<.*?>" "" (match-string-no-properties 1)))))
-              ;; Don't show the function description
-              ;; (when (re-search-forward "<p class=\"para rdfs-comment\">\\(\\(.\\|\n\\)*?\\)</p>" nil t)
-              ;;   (setq desc
-              ;;         (concat desc "\n\n"
-              ;;                 (replace-regexp-in-string
-              ;;                  " +" " "
-              ;;                  (replace-regexp-in-string
-              ;;                   "\n" ""
-              ;;                   (replace-regexp-in-string "<.*?>" "" (match-string-no-properties 1)))))))
-              )
-
-            (if desc
-                (setq doc (xml-substitute-special desc)))))
-
-        (kill-buffer buf))
-
-      (puthash function doc my-php-function-doc-hash))
-
-    doc))
-
-
-(defun my-php-eldoc-function ()
-  (let ((symbol (thing-at-point 'symbol)))
-    (if (and symbol
-             (not (eq (elt symbol 0) ?$)))
-        (my-php-fetch-function-doc symbol))))
diff --git a/emacs/init.el b/emacs/init.el
index 0ac222bd..71a64754 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1087,10 +1087,7 @@ Also returns nil if pid is nil."
             (if (eq env/location 'home)
                 (setq php-manual-url "http://docs.home/manual/en/"))
             (add-hook 'php-mode-hook #'php-enable-wordpress-coding-style)
-            (add-hook 'php-mode-hook (lambda ()
-                                       (set (make-local-variable 'eldoc-documentation-function) #'my-php-eldoc-function)))
-            (use-package eldoc-php
-              :config (turn-on-eldoc-mode))))
+            (add-hook 'php-mode-hook #'turn-on-eldoc-mode)))
 
 (use-package sgml-mode
   :config (setq sgml-basic-offset 4))