From 4f58f906a49721af4b5e834db1f6ba5b4db2839a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 1 Apr 2014 21:58:28 +0100 Subject: Emacs: Replace buggy eldoc-php with php-extras --- emacs/Cask | 1 + emacs/elisp/eldoc-php.el | 48 ------------------------------------------------ emacs/init.el | 5 +---- 3 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 emacs/elisp/eldoc-php.el (limited to 'emacs') diff --git a/emacs/Cask b/emacs/Cask index 8d91381..8742df0 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 8101fea..0000000 --- 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 "
\\(\\(.\\|\n\\)*?\\)
" 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 0ac222b..71a6475 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)) -- cgit 1.4.1