[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r115545: Cleanup cfengine3-mode so complete-symbol w
From: |
Teodor Zlatanov |
Subject: |
[Emacs-diffs] trunk r115545: Cleanup cfengine3-mode so complete-symbol works again. |
Date: |
Mon, 16 Dec 2013 15:48:16 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 115545
revision-id: address@hidden
parent: address@hidden
committer: Ted Zlatanov <address@hidden>
branch nick: quickfixes
timestamp: Mon 2013-12-16 10:49:25 -0500
message:
Cleanup cfengine3-mode so complete-symbol works again.
* progmodes/cfengine.el (cfengine3--current-word): Remove.
(cfengine3--current-function): Bring in the current-function
functionality from `cfengine3--current-word'.
(cfengine3-completion-function): Bring in the
bounds-of-current-word functionality from
`cfengine3--current-word'.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/progmodes/cfengine.el
cfengine.el-20091113204419-o5vbwnq5f7feedwu-2944
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-12-16 09:58:44 +0000
+++ b/lisp/ChangeLog 2013-12-16 15:49:25 +0000
@@ -1,3 +1,12 @@
+2013-12-16 Teodor Zlatanov <address@hidden>
+
+ * progmodes/cfengine.el (cfengine3--current-word): Remove.
+ (cfengine3--current-function): Bring in the current-function
+ functionality from `cfengine3--current-word'.
+ (cfengine3-completion-function): Bring in the
+ bounds-of-current-word functionality from
+ `cfengine3--current-word'.
+
2013-12-16 Martin Rudalics <address@hidden>
* window.el (display-buffer-below-selected): Bind
=== modified file 'lisp/progmodes/cfengine.el'
--- a/lisp/progmodes/cfengine.el 2013-12-13 19:49:56 +0000
+++ b/lisp/progmodes/cfengine.el 2013-12-16 15:49:25 +0000
@@ -1165,24 +1165,18 @@
;; CLASS: [.|&!()a-zA-Z0-9_\200-\377]+::
;; CATEGORY: [a-zA-Z_]+:
-(defun cfengine3--current-word (&optional bounds)
- "Propose a word around point in the current CFEngine 3 buffer."
- (save-excursion
- (skip-syntax-forward "w_")
- (when (search-backward-regexp
- cfengine-mode-syntax-functions-regex
- (point-at-bol)
- t)
- (if bounds
- (list (point) (match-end 1))
- (match-string 1)))))
-
(defun cfengine3--current-function ()
"Look up current CFEngine 3 function"
(let* ((syntax (cfengine3-make-syntax-cache))
(flist (assq 'functions syntax)))
(when flist
- (let ((w (cfengine3--current-word)))
+ (let ((w (save-excursion
+ (skip-syntax-forward "w_")
+ (when (search-backward-regexp
+ cfengine-mode-syntax-functions-regex
+ (point-at-bol)
+ t)
+ (match-string 1)))))
(and w (assq (intern w) flist))))))
;; format from "cf-promises -s json", e.g. "sort" function:
@@ -1271,7 +1265,10 @@
(defun cfengine3-completion-function ()
"Return completions for function name around or before point."
(cfengine3-make-syntax-cache)
- (let* ((bounds (cfengine3--current-word t))
+ (let* ((bounds (save-excursion
+ (let ((p (point)))
+ (skip-syntax-backward "w_" (point-at-bol))
+ (list (point) p))))
(syntax (cfengine3-make-syntax-cache))
(flist (assq 'functions syntax)))
(when bounds
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r115545: Cleanup cfengine3-mode so complete-symbol works again.,
Teodor Zlatanov <=