;;; vhdl-mode.el --- major mode for editing VHDL code
-;; Copyright (C) 1992-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1992-2014 Free Software Foundation, Inc.
;; Authors: Reto Zimmermann <reto@gnu.org>
;; Rodney J. Whitby <software.vhdl-mode@rwhitby.net>
(eval-when-compile
(require 'font-lock)
(require 'ps-print)
- (require 'speedbar)))
+ (require 'speedbar))) ; for speedbar-with-writable
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setcdr list1 (cddr list1))))
(cdr list))
+(declare-function speedbar-refresh "speedbar" (&optional arg))
+(declare-function speedbar-do-function-pointer "speedbar" ())
+
(defun vhdl-speedbar-refresh (&optional key)
"Refresh directory or project with name KEY."
(when (and (boundp 'speedbar-frame)
(defvar vhdl-speedbar-menu-items nil
"Additional menu-items to add to speedbar frame.")
+(declare-function speedbar-add-supported-extension "speedbar" (extension))
+(declare-function speedbar-add-mode-functions-list "speedbar" (new-list))
+(declare-function speedbar-make-specialized-keymap "speedbar" ())
+(declare-function speedbar-change-initial-expansion-list "speedbar"
+ (new-default))
+(declare-function speedbar-add-expansion-list "speedbar" (new-list))
+
(defun vhdl-speedbar-initialize ()
"Initialize speedbar."
;; general settings
"Name of last selected project.")
;; macros must be defined in the file they are used (copied from `speedbar.el')
-(defmacro speedbar-with-writable (&rest forms)
- "Allow the buffer to be writable and evaluate FORMS."
- (list 'let '((inhibit-read-only t))
- (cons 'progn forms)))
-(put 'speedbar-with-writable 'lisp-indent-function 0)
+;;; (defmacro speedbar-with-writable (&rest forms)
+;;; "Allow the buffer to be writable and evaluate FORMS."
+;;; (list 'let '((inhibit-read-only t))
+;;; (cons 'progn forms)))
+;;; (put 'speedbar-with-writable 'lisp-indent-function 0)
+
+(declare-function speedbar-extension-list-to-regex "speedbar" (extlist))
+(declare-function speedbar-directory-buttons "speedbar" (directory _index))
+(declare-function speedbar-file-lists "speedbar" (directory))
(defun vhdl-speedbar-display-directory (directory depth &optional rescan)
"Display directory and hierarchy information in speedbar."
(error (vhdl-warning-when-idle "ERROR: Invalid hierarchy information, unable to display correctly"))))
(setq speedbar-full-text-cache nil)) ; prevent caching
+(declare-function speedbar-make-tag-line "speedbar"
+ (type char func data tag tfunc tdata tface depth))
+
(defun vhdl-speedbar-insert-projects ()
"Insert all projects in speedbar."
(vhdl-speedbar-make-title-line "Projects:")
depth)
(setq pack-alist (cdr pack-alist))))))
+(declare-function speedbar-line-directory "speedbar" (&optional depth))
+
(defun vhdl-speedbar-rescan-hierarchy ()
"Rescan hierarchy for the directory or project under the cursor."
(interactive)
(abbreviate-file-name (match-string 1 path)))))
(vhdl-speedbar-refresh key)))
+(declare-function speedbar-goto-this-file "speedbar" (file))
+
(defun vhdl-speedbar-expand-dirs (directory)
"Expand subdirectories in DIRECTORY according to
`speedbar-shown-directories'."
(setq unit-alist (cdr unit-alist))))))
(vhdl-speedbar-update-current-unit nil t))
+(declare-function speedbar-center-buffer-smartly "speedbar" ())
+
(defun vhdl-speedbar-contract-level ()
"Contract current level in current directory/project."
(interactive)
(when (memq 'display vhdl-speedbar-save-cache)
(add-to-list 'vhdl-updated-project-list key))))
+(declare-function speedbar-change-expand-button-char "speedbar" (char))
+(declare-function speedbar-delete-subblock "speedbar" (indent))
+
(defun vhdl-speedbar-expand-project (text token indent)
"Expand/contract the project under the cursor."
(cond
(setq vhdl-speedbar-last-selected-project vhdl-project)))
t)
+(declare-function speedbar-position-cursor-on-line "speedbar" ())
+
(defun vhdl-speedbar-update-current-unit (&optional no-position always)
"Highlight all design units that are contained in the current file.
NO-POSITION non-nil means do not re-position cursor."
(setq unit-list (cdr unit-list)))
pos)
+(declare-function speedbar-make-button "speedbar"
+ (start end face mouse function &optional token))
+
(defun vhdl-speedbar-make-inst-line (inst-name inst-file-marker
ent-name ent-file-marker
arch-name arch-file-marker
'speedbar-directory-face level)
(setq dirs (cdr dirs)))))
+(declare-function speedbar-reset-scanners "speedbar" ())
+
(defun vhdl-speedbar-dired (text token indent)
"Speedbar click handler for directory expand button in hierarchy mode."
(cond ((string-match "+" text) ; we have to expand this dir
(when (equal (selected-frame) speedbar-frame)
(speedbar-center-buffer-smartly)))
+(declare-function speedbar-files-item-info "speedbar" ())
+
(defun vhdl-speedbar-item-info ()
"Derive and display information about this line item."
(save-excursion
(vhdl-default-directory)))))
(t (message "")))))
+(declare-function speedbar-line-text "speedbar" (&optional p))
+
(defun vhdl-speedbar-line-text ()
"Calls `speedbar-line-text' and removes text properties."
(let ((string (speedbar-line-text)))
(goto-char dest)
nil)))
+(declare-function speedbar-find-file-in-frame "speedbar" (file))
+(declare-function speedbar-set-timer "speedbar" (timeout))
+;; speedbar loads dframe at runtime.
+(declare-function dframe-maybee-jump-to-attached-frame "dframe" ())
+
(defun vhdl-speedbar-find-file (text token indent)
"When user clicks on TEXT, load file with name and position in TOKEN.
Jump to the design unit if `vhdl-speedbar-jump-to-unit' is t or if the file
(recenter))
(vhdl-speedbar-update-current-unit t t)
(speedbar-set-timer dframe-update-speed)
- (speedbar-maybee-jump-to-attached-frame))))
+ (dframe-maybee-jump-to-attached-frame))))
(defun vhdl-speedbar-port-copy ()
"Copy the port of the entity/component or subprogram under the cursor."
(setcar (cddr (cddr ent-entry)) arch-key) ; (nth 4 ent-entry)
(speedbar-refresh))))
+(declare-function speedbar-line-file "speedbar" (&optional p))
+
(defun vhdl-speedbar-make-design ()
"Make (compile) design unit or directory/project under the cursor."
(interactive)