[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gnuplot c4d464a 125/184: Use `gnuplot-completion-at-point-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gnuplot c4d464a 125/184: Use `gnuplot-completion-at-point-function' instead of advice hackery |
Date: |
Sun, 29 Aug 2021 11:03:29 -0400 (EDT) |
branch: elpa/gnuplot
commit c4d464a73de1ef0e5c8b57252457af2738da5720
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>
Use `gnuplot-completion-at-point-function' instead of advice hackery
---
gnuplot-context.el | 15 ++-------------
gnuplot.el | 6 ++++++
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/gnuplot-context.el b/gnuplot-context.el
index dfac86b..5b60096 100644
--- a/gnuplot-context.el
+++ b/gnuplot-context.el
@@ -248,7 +248,6 @@
;; Library dependencies
(eval-when-compile
(require 'cl)
- (require 'advice)
;; Prevent compiler warnings about undefined functions
(require 'gnuplot))
@@ -338,9 +337,7 @@ off. With no argument, toggle context-sensitive mode."
,@forms)))))
(defun gnuplot--turn-on-context-sensitive-mode ()
- (ad-enable-advice 'gnuplot-completion-at-point
- 'around 'gnuplot-context)
- (ad-activate 'gnuplot-completion-at-point)
+ (setq gnuplot-completion-at-point-function
#'gnuplot-context-completion-at-point)
(dolist (keymap (list gnuplot-mode-map gnuplot-comint-mode-map))
(define-key keymap (kbd "C-c M-h") 'gnuplot-help-function)
@@ -357,9 +354,7 @@ off. With no argument, toggle context-sensitive mode."
(define-key keymap (kbd "C-c M-h") 'undefined)
(define-key keymap (kbd "C-c C-/") 'undefined)
(define-key keymap (kbd "C-c C-d") 'gnuplot-info-lookup-symbol))
- (ad-disable-advice 'gnuplot-completion-at-point
- 'around 'gnuplot-context)
- (ad-activate 'gnuplot-completion-at-point)
+ (setq gnuplot-completion-at-point-function
#'gnuplot-completion-at-point-info-look)
(remove-hook 'gnuplot-mode-hook 'gnuplot-setup-eldoc)
(remove-hook 'gnuplot-comint-mode-hook 'gnuplot-setup-eldoc)
@@ -367,12 +362,6 @@ off. With no argument, toggle context-sensitive mode."
(setq eldoc-documentation-function nil)
(eldoc-mode 0)))
-;; Has to be defined here. Grumble.
-(defadvice gnuplot-completion-at-point (around gnuplot-context disable)
- ;; This around-advice gets activated/deactivated when turning
- ;; context-sensitivity on and off
- (setq ad-return-value (gnuplot-context-completion-at-point)))
-
(defun gnuplot-setup-eldoc ()
(set (make-local-variable 'eldoc-documentation-function)
'gnuplot-eldoc-function)
diff --git a/gnuplot.el b/gnuplot.el
index 6e25b15..7c6929a 100644
--- a/gnuplot.el
+++ b/gnuplot.el
@@ -2893,7 +2893,13 @@ Return a list of keywords."
(delete "nil" store)
store ))
+(defvar gnuplot-completion-at-point-function
#'gnuplot-completion-at-point-info-look
+ "Function to call to perform completion in Gnuplot buffers.")
+
(defun gnuplot-completion-at-point ()
+ (funcall gnuplot-completion-at-point-function))
+
+(defun gnuplot-completion-at-point-info-look ()
"Return completions of keyword preceding point.
Uses the cache of keywords generated by info-lookup. See
- [nongnu] elpa/gnuplot c2aedf8 111/184: Add ERT tests to check comment and string syntax., (continued)
- [nongnu] elpa/gnuplot c2aedf8 111/184: Add ERT tests to check comment and string syntax., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 5efb8a9 112/184: Add Makefile targets to run all tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot ed930f3 116/184: Fix compile errors when testing from command line, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 2f36b36 118/184: Update Makefile.in, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot a50ac2b 119/184: Add autoloaded `run-gnuplot` command, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot d0828c0 126/184: Make gnuplot-context-sensitive-mode a normal minor mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 71e3174 129/184: Remove un-needed run-after-load hackery, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot d899379 123/184: Clarify comments, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 536f2c3 122/184: Put alias for missing syntax-ppss with the other workarounds, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot b6eea0b 133/184: Add :set function for customizing context-sensitive mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot c4d464a 125/184: Use `gnuplot-completion-at-point-function' instead of advice hackery,
ELPA Syncer <=
- [nongnu] elpa/gnuplot da11bfa 128/184: New customize option `gnuplot-use-context-sensitive-completion', ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot f274ad7 138/184: Recommend to use GitHub bug tracker instead of E-mail, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 54fd3eb 141/184: do toolbar-make-button-list after check the function exists, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 14584a0 143/184: clean Elisp format, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot a080f79 149/184: Merge pull request #45 from conao3/fix-trivial, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot b96c5d8 144/184: Merge pull request #43 from conao3/fix-format, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 3f0e094 154/184: Merge pull request #48 from conao3/feature, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 706e810 161/184: Merge pull request #54 from vxid/delete-xemacs, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot c1e6018 158/184: Add GitHub Actions CI configure files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 8d5b7f5 157/184: Merge pull request #51 from vxid/master, ELPA Syncer, 2021/08/29