branch: elpa/gnuplot
commit e9447f01ab8b0c36d1856b6baf67943b5c96c9d8
Author: Jonathan Oddie <[email protected]>
Commit: Jonathan Oddie <[email protected]>
More consistent keys between gnuplot.el and gnuplot-context.el
C-c C-d (instead of C-c C-h or C-c C-/) for the info-lookup function
(gnuplot-info-lookup-symbol if context is not loaded,
gnuplot-info-at-point when context is loaded)
gnuplot-info-at-point now prompts for a symbol to look up if called
with a prefix arg or if parsing fails.
C-c C-s (instead of C-c h) for "extended eldoc" in context
mode (gnuplot-help-function)
TAB for completion in comint buffer. (Is this a problem?)
Setup eldoc thru a named defun rather than a lambda in
gnuplot-mode-hook.
---
.gitignore | 1 +
gnuplot-context.el | 31 ++++++++++++++++++++++---------
gnuplot.el | 9 +++++----
3 files changed, 28 insertions(+), 13 deletions(-)
diff --git a/.gitignore b/.gitignore
index c4d293f..ed79435 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@
/#*#
*/#*#
/hacks.el
+.#*
diff --git a/gnuplot-context.el b/gnuplot-context.el
index 9e5a5e8..f3255a7 100644
--- a/gnuplot-context.el
+++ b/gnuplot-context.el
@@ -2034,22 +2034,35 @@ there."
(cadr (gethash gnuplot-info-at-point gnuplot-eldoc-hash))))
(if eldoc (message eldoc)))))
-(define-key gnuplot-mode-map (kbd "C-c h") 'gnuplot-help-function)
+(defun gnuplot-setup-eldoc ()
+ (set (make-local-variable 'eldoc-documentation-function)
+ 'gnuplot-eldoc-function)
+ ;; Check for ElDoc after doing completion
+ (eldoc-add-command 'completion-at-point))
-(defun gnuplot-info-at-point ()
+(define-key gnuplot-mode-map (kbd "C-c C-s") 'gnuplot-help-function)
+(add-hook 'gnuplot-mode-hook 'gnuplot-setup-eldoc)
+
+;; Info lookup
+(defun gnuplot-info-at-point (&optional query)
"Open the relevant gnuplot info page for the construction at point."
- (interactive)
+ (interactive "P")
(gnuplot-parse-at-point nil)
+ (if (or query (not gnuplot-info-at-point))
+ (let ((info
+ (info-lookup-interactive-arguments 'symbol)))
+ (setq gnuplot-info-at-point (car info))))
(and gnuplot-info-at-point
(info-other-window (format "(gnuplot)%s" gnuplot-info-at-point))))
-(define-key gnuplot-mode-map (kbd "C-c C-/") 'gnuplot-info-at-point)
+(defun gnuplot-info-look-guess ()
+ (gnuplot-parse-at-point nil)
+ gnuplot-info-at-point)
+
+(define-key gnuplot-mode-map (kbd "C-c C-d") 'gnuplot-info-at-point)
+(define-key gnuplot-comint-mode-map (kbd "C-c C-d") 'gnuplot-info-at-point)
+(define-key gnuplot-comint-mode-map (kbd "TAB") 'comint-dynamic-complete)
-(add-hook
- 'gnuplot-mode-hook
- (lambda ()
- (set (make-local-variable 'eldoc-documentation-function)
- 'gnuplot-eldoc-function)))
;;; Some context-sensitive hacks
diff --git a/gnuplot.el b/gnuplot.el
index a6f457a..0a5837f 100644
--- a/gnuplot.el
+++ b/gnuplot.el
@@ -56,7 +56,7 @@
;; C-c C-c comment region
;; C-c C-o set arguments for command at point
;; S-mouse-2 set arguments for command under mouse cursor
-;; C-c C-h read the gnuplot info file
+;; C-c C-d read the gnuplot info file
;; C-c C-e show-gnuplot-buffer
;; C-c C-k kill gnuplot process
;; C-c C-u submit a bug report about gnuplot-mode
@@ -635,10 +635,10 @@ you're not using that musty old thing, are you..."
(define-key gnuplot-mode-map "\C-c\C-b" 'gnuplot-send-buffer-to-gnuplot)
(define-key gnuplot-mode-map "\C-c\C-c" 'comment-region) ; <RF>
(define-key gnuplot-mode-map "\C-c\C-o" 'gnuplot-gui-set-options-and-insert)
- (define-key gnuplot-mode-map "\C-c\C-d" 'gnuplot-show-version)
+ (define-key gnuplot-mode-map "\C-c\C-w" 'gnuplot-show-version)
(define-key gnuplot-mode-map "\C-c\C-e" 'gnuplot-show-gnuplot-buffer)
(define-key gnuplot-mode-map "\C-c\C-f" 'gnuplot-send-file-to-gnuplot)
- (define-key gnuplot-mode-map "\C-c\C-h" 'gnuplot-info-lookup-symbol)
+ (define-key gnuplot-mode-map "\C-c\C-d" 'gnuplot-info-lookup-symbol)
(define-key gnuplot-mode-map "\C-c\C-i" 'gnuplot-insert-filename)
(define-key gnuplot-mode-map "\C-c\C-j" 'gnuplot-forward-script-line)
(define-key gnuplot-mode-map "\C-c\C-k" 'gnuplot-kill-gnuplot-buffer)
@@ -2067,7 +2067,8 @@ buffer."
(define-key gnuplot-comint-mode-map "\C-d" 'gnuplot-delchar-or-maybe-eof)
(define-key gnuplot-comint-mode-map "\M-\r" 'comint-dynamic-complete)
(define-key gnuplot-comint-mode-map "\M-\t" 'comint-dynamic-complete)
-(define-key gnuplot-comint-mode-map "\C-c\C-d" 'gnuplot-show-version)
+(define-key gnuplot-comint-mode-map "\C-c\C-d" 'gnuplot-info-lookup-symbol)
+(define-key gnuplot-comint-mode-map "\C-c\C-w" 'gnuplot-show-version)
(define-key gnuplot-comint-mode-map "\C-c\C-h" 'gnuplot-info-lookup-symbol)
(define-key gnuplot-comint-mode-map "\C-c\C-i" 'gnuplot-insert-filename)
(define-key gnuplot-comint-mode-map "\C-c\C-n" 'gnuplot-negate-option)