[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 08/18: Don't activate eldoc support by default
From: |
Leo Liu |
Subject: |
[elpa] 08/18: Don't activate eldoc support by default |
Date: |
Sat, 05 Apr 2014 01:25:15 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit f97d58ece0f99b39656b75fefa59921d342460a2
Author: Leo Liu <address@hidden>
Date: Wed Apr 2 09:02:28 2014 +0800
Don't activate eldoc support by default
since it is difficult to enable it without overriding users' settings
for emacs <= 24.3.
---
README.rst | 10 +++++-----
ggtags.el | 20 +-------------------
2 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/README.rst b/README.rst
index 9ea1f97..2e25678 100644
--- a/README.rst
+++ b/README.rst
@@ -249,13 +249,13 @@ Integration with other packages
* eldoc
- If ``eldoc-mode`` is enabled it can use ``ggtags`` to show
- definition. An example configuration:
-
- ::
+ ``Eldoc`` support can be enabled by, for example, setting this in
+ the desired major mode with:
- (add-hook 'ggtags-mode-hook 'eldoc-mode)
+ ::
+ (setq-local eldoc-documentation-function #'ggtags-eldoc-function)
+
* imenu
Emacs major modes usually have excellent support for ``imenu`` so
diff --git a/ggtags.el b/ggtags.el
index dfe7a6e..39f0ff6 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -48,15 +48,6 @@
(require 'tabulated-list) ;preloaded since 24.3
(eval-when-compile
- (unless (fboundp 'add-function) ;24.4
- (defmacro add-function (_where place function)
- `(progn
- (make-local-variable ,(cadr place))
- (set ,(cadr place) ,function))))
- (unless (fboundp 'remove-function) ;24.4
- (defmacro remove-function (place _function)
- `(kill-local-variable ,(cadr place))))
-
(unless (fboundp 'setq-local)
(defmacro setq-local (var val)
(list 'set (list 'make-local-variable (list 'quote var)) val)))
@@ -1853,21 +1844,11 @@ to nil disables displaying this information.")
;; Append to serve as a fallback method.
(add-hook 'completion-at-point-functions
#'ggtags-completion-at-point t t)
- ;; `eldoc-documentation-function-default' is only good for
- ;; `emacs-lisp-mode'.
- (when (and (eq eldoc-documentation-function
- 'eldoc-documentation-function-default)
- (not (derived-mode-p 'emacs-lisp-mode)))
- (setq-local eldoc-documentation-function #'ignore))
- (add-function :after-until (local 'eldoc-documentation-function)
- #'ggtags-eldoc-function)
(unless (memq 'ggtags-mode-line-project-name
mode-line-buffer-identification)
(setq mode-line-buffer-identification
(append mode-line-buffer-identification
'(ggtags-mode-line-project-name)))))
- (remove-function (local 'eldoc-documentation-function)
- #'ggtags-eldoc-function)
(remove-hook 'after-save-hook 'ggtags-after-save-function t)
(remove-hook 'completion-at-point-functions #'ggtags-completion-at-point t)
(setq mode-line-buffer-identification
@@ -1928,6 +1909,7 @@ to nil disables displaying this information.")
(declare-function eldoc-message "eldoc")
(defun ggtags-eldoc-function ()
+ "A function suitable for `eldoc-documentation-function' (which see)."
(pcase (cons (ggtags-tag-at-point) ggtags-eldoc-cache)
(`(nil . ,_) nil)
(`(,_x ,_x) nil)
- [elpa] branch master updated (c5636ba -> 769f2f2), Leo Liu, 2014/04/04
- [elpa] 04/18: Add NEWS to README.rst for 0.8.0 and 0.8.1, Leo Liu, 2014/04/04
- [elpa] 02/18: New function ggtags-echo and use it, Leo Liu, 2014/04/04
- [elpa] 01/18: For #45: Fix popping up/down window for search with single match, Leo Liu, 2014/04/04
- [elpa] 03/18: Fix #45: Change default value of ggtags-auto-jump-to-match, Leo Liu, 2014/04/04
- [elpa] 06/18: Fix error in approximation to (line-number-at-pos (point-max)), Leo Liu, 2014/04/04
- [elpa] 05/18: New function ggtags-eldoc-function for eldoc support, Leo Liu, 2014/04/04
- [elpa] 08/18: Don't activate eldoc support by default,
Leo Liu <=
- [elpa] 09/18: Fix multiple calls of ggtags-show-definition, Leo Liu, 2014/04/04
- [elpa] 10/18: Make ggtags-eldoc-function work better when no project root, Leo Liu, 2014/04/04
- [elpa] 07/18: Refactor out ggtags-include-file from ggtags-find-tag-dwim, Leo Liu, 2014/04/04
- [elpa] 12/18: Make ggtags-use-project-gtagsconf work on remote projects, Leo Liu, 2014/04/04
- [elpa] 11/18: Revert "Fix ggtags-with-current-project to include GTAGSCONF", Leo Liu, 2014/04/04
- [elpa] 13/18: New macro ggtags-with-temp-message that reports execution time, Leo Liu, 2014/04/04
- [elpa] 14/18: Don't reply on excution order of filter and sentinel functions, Leo Liu, 2014/04/04
- [elpa] 15/18: Revert "Don't reply on excution order of filter and sentinel functions", Leo Liu, 2014/04/04
- [elpa] 16/18: Properly fix the bug by delaying compilation finish functions, Leo Liu, 2014/04/04
- [elpa] 17/18: Doc fixes and add NEWS for 0.8.2, Leo Liu, 2014/04/04