https://github.com/aki2o/emacs-vbasense.git
git clone 'git://github.com/aki2o/emacs-vbasense.git'
This is a extension of Emacs.
VBASense provides a environment like Visual Basic Editor for developing VBA.
VBASense do code assist on the following context.
* For detail, see Demo section.
VBASense pop-up help about the pointed element.
VBASense show signature of the pointed procedure in mini-buffer.
You can jump to definition of the pointed element.
Also, you can return from the definition by pop-tag-mark
.
In the following case, VBASense provide the optimized completion about the variable that is defined as “Object”.
Set x = ...
'If the type is detected from the context after "="
For Each x In ...
'If the type, that is detected from the context after "In", is Collection
* For detail, see Demo section.
You need to implement the definition with fulfilling the following condition about procedure of the interface that put on Implements statement.
VBASense insert the above definition automatically in the following case.
vbasense-insert-implement-definition
.* For detail, see Demo section.
http://www.youtube.com/watch?v=6QUXUz6HeTs
2014/01/09 It's available by using melpa.
2014/02/01 It's available. But, master branch only.
git clone https://github.com/aki2o/emacs-vbasense.git
Then, add the directory that has vbasense.el to load-path.
* In this case, you need to install the following dependency.
Download this archive and expand it.
Then, add the directory that has vbasense.el to load-path.
* In this case, you need to install the following dependency.
(require 'vbasense)
;; Keybinding
(setq vbasense-popup-help-key "C-:")
(setq vbasense-jump-to-definition-key "C->")
;; Make config suit for you. About the config item, eval the following sexp.
;; (customize-group "vbasense")
;; Do setting a recommemded configuration
(vbasense-config-default)
* About the item that you should be careful, see Consideration section.
This value is list of the library file that is referred in Visual Basic Editor.
As you add the reference on the above dialog,
you need to add the library file to this list for the completion about the library.
This value is the directory that the library infomation of vbasense-tli-files
is saved in.
This value is list of the major mode that VBASense is activated on.
In default, the list is only visual-basic-mode
.
* It's no need to regist a specialized mode for VBA, because VBASense has no relation to font-lock.
* You can download visual-basic-mode.el from EmacsWiki.
You need to execute M-x vbasense-setup-current-buffer
in the buffer.
The library information of vbasense-tli-files
is called “TypeLibInfo”.
You need TLBINF32.DLL for getting “TypeLibInfo”.
If the following message is shown when you open the buffer of vbasense-enable-modes
or
you execute M-x vbasense-load-library
,
it means that TLBINF32.DLL is not installed yet.
[VBASense] Not yet regist TLBINF32.DLL
In above case, you need to regist TLBINF32.DLL.
* My environment TLBINF32.DLL have been put in contrib directory.
* My environment TLBINF32.DLL is the downloaded file from here.
* TLBINF32.DLL is bundled with Visual Basic 6.0.
For detecting your component other than the library of vbasense-tli-files
,
you need to do one of the following action.
vbasense-user-library-directories
.vbasense-setup-user-library-function
.VBASense has the following function for vbasense-setup-user-library-function
.
vbasense-load-directory
… Search recursively under the directoryvbasense-load-recently
… Search in recentf-list
vbasense-load-project
… Search by using anything-project.el* The default of vbasense-setup-user-library-function
is the following.
(setq vbasense-setup-user-library-function
(lambda ()
(dolist (dir vbasense-user-library-directories)
(vbasense-load-directory dir))))
* There is a time lag to reflect your component information because search is executed on background.
This value is list of the char that VBASense start auto-complete
with insert.
Member of Enum is completed directly in Visual Basic Editor.
Public Sub main()
VbMsgBoxResult. ' <- detecting Enum like this
vb ' <- the member of Enum, vbOK, appear as candidate without it.
End Sub
If VBASense behave like that, slowness may happen.
So, VBASense complete the member of Enum directory only if the string of
vbasense-ac-implicit-enummember-prefixes
is inputed.
For the optimized completion, VBASense has to look up the latest definition of Function/Sub/Property/Type/Enum
in current buffer for each of auto-complete
.
But, the response speed of Emacs decrease with increasing size of current buffer.
So, If size of current buffer is larger than vbasense-lookup-current-buffer-threshold
,
VBASense start auto-complete
without looking up the latest definition.
* Looking up the latest definition run surely when current buffer is saved.
Enjoy!!!