aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorGlenn Morris2013-05-21 20:13:56 -0700
committerGlenn Morris2013-05-21 20:13:56 -0700
commit0cdffd7dd407452c8d60931736a5be52cf9ed7b6 (patch)
tree0ce2f01293b833e673dc341aa7396d2e78eb0d0e /lisp/progmodes
parentab56a6f42c21c8c074b5e50a928955a8d69768f7 (diff)
downloademacs-0cdffd7dd407452c8d60931736a5be52cf9ed7b6.tar.gz
emacs-0cdffd7dd407452c8d60931736a5be52cf9ed7b6.zip
Small speedbar-related clean-up
* lisp/dframe.el (x-sensitive-text-pointer-shape, x-pointer-shape): Remove unnecessary declarations. (dframe-message): Doc fix. * lisp/info.el (dframe-select-attached-frame, dframe-current-frame): Declare. * lisp/speedbar.el (speedbar-message): Make it an obsolete alias. Update all callers. (speedbar-with-attached-buffer) (speedbar-maybee-jump-to-attached-frame): Make these aliases obsolete. (speedbar-with-writable): Use backquote. * lisp/emacs-lisp/eieio-opt.el (eieio-describe-class-sb): * lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar-handle-click): Use dframe-with-attached-buffer, dframe-maybee-jump-to-attached-frame rather than speedbar- aliases. * lisp/mail/rmail.el: Load dframe rather than speedbar when compiling. (speedbar-make-specialized-keymap, speedbar-insert-button) (dframe-select-attached-frame, dframe-maybee-jump-to-attached-frame) (speedbar-do-function-pointer): Declare. (rmail-speedbar-button, rmail-speedbar-find-file) (rmail-speedbar-move-message): Use dframe-with-attached-buffer rather than speedbar- alias. * lisp/progmodes/gud.el: Load dframe rather than speedbar when compiling. (dframe-message, speedbar-make-specialized-keymap) (speedbar-add-expansion-list, speedbar-mode-functions-list) (speedbar-make-tag-line, speedbar-remove-localized-speedbar-support) (speedbar-insert-button, dframe-select-attached-frame) (dframe-maybee-jump-to-attached-frame) (speedbar-change-initial-expansion-list) (speedbar-previously-used-expansion-list-name): Declare. (gud-speedbar-item-info, gud-gdb-goto-stackframe): Use dframe-message, dframe-with-attached-buffer rather than speedbar- aliases. (gud-sentinel): Silence compiler. * lisp/progmodes/vhdl-mode.el (speedbar-refresh) (speedbar-do-function-pointer, speedbar-add-supported-extension) (speedbar-add-mode-functions-list, speedbar-make-specialized-keymap) (speedbar-change-initial-expansion-list, speedbar-add-expansion-list) (speedbar-extension-list-to-regex, speedbar-directory-buttons) (speedbar-file-lists, speedbar-make-tag-line) (speedbar-line-directory, speedbar-goto-this-file) (speedbar-center-buffer-smartly, speedbar-change-expand-button-char) (speedbar-delete-subblock, speedbar-position-cursor-on-line) (speedbar-make-button, speedbar-reset-scanners) (speedbar-files-item-info, speedbar-line-text) (speedbar-find-file-in-frame, speedbar-set-timer) (dframe-maybee-jump-to-attached-frame, speedbar-line-file): Declare. (speedbar-with-writable): Do not (re)define it. (vhdl-speedbar-find-file): Use dframe-maybee-jump-to-attached-frame rather than speedbar- alias. * lisp/cedet/ede/speedbar.el (ede-file-find, ede-tag-find): * lisp/cedet/semantic/sb.el (semantic-sb-token-jump): Use dframe-maybee-jump-to-attached-frame rather than speedbar- alias. * lisp/mh-e/mh-speed.el (mh-speed-view): Use dframe-with-attached-buffer rather than speedbar- alias.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/gud.el35
-rw-r--r--lisp/progmodes/vhdl-mode.el58
2 files changed, 78 insertions, 15 deletions
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 9ee4aae1da6..212d3894091 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -413,7 +413,7 @@ we're in the GUD buffer)."
413 413
414;; ====================================================================== 414;; ======================================================================
415;; speedbar support functions and variables. 415;; speedbar support functions and variables.
416(eval-when-compile (require 'speedbar)) ;For speedbar-with-attached-buffer. 416(eval-when-compile (require 'dframe)) ; for dframe-with-attached-buffer
417 417
418(defvar gud-last-speedbar-stackframe nil 418(defvar gud-last-speedbar-stackframe nil
419 "Description of the currently displayed GUD stack. 419 "Description of the currently displayed GUD stack.
@@ -422,19 +422,24 @@ The value t means that there is no stack, and we are in display-file mode.")
422(defvar gud-speedbar-key-map nil 422(defvar gud-speedbar-key-map nil
423 "Keymap used when in the buffers display mode.") 423 "Keymap used when in the buffers display mode.")
424 424
425;; At runtime, will be pulled in as a require of speedbar.
426(declare-function dframe-message "dframe" (fmt &rest args))
427
425(defun gud-speedbar-item-info () 428(defun gud-speedbar-item-info ()
426 "Display the data type of the watch expression element." 429 "Display the data type of the watch expression element."
427 (let ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list))) 430 (let ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list)))
428 (if (nth 7 var) 431 (if (nth 7 var)
429 (speedbar-message "%s: %s" (nth 7 var) (nth 3 var)) 432 (dframe-message "%s: %s" (nth 7 var) (nth 3 var))
430 (speedbar-message "%s" (nth 3 var))))) 433 (dframe-message "%s" (nth 3 var)))))
434
435(declare-function speedbar-make-specialized-keymap "speedbar" ())
436(declare-function speedbar-add-expansion-list "speedbar" (new-list))
437(defvar speedbar-mode-functions-list)
431 438
432(defun gud-install-speedbar-variables () 439(defun gud-install-speedbar-variables ()
433 "Install those variables used by speedbar to enhance gud/gdb." 440 "Install those variables used by speedbar to enhance gud/gdb."
434 (if gud-speedbar-key-map 441 (unless gud-speedbar-key-map
435 nil
436 (setq gud-speedbar-key-map (speedbar-make-specialized-keymap)) 442 (setq gud-speedbar-key-map (speedbar-make-specialized-keymap))
437
438 (define-key gud-speedbar-key-map "j" 'speedbar-edit-line) 443 (define-key gud-speedbar-key-map "j" 'speedbar-edit-line)
439 (define-key gud-speedbar-key-map "e" 'speedbar-edit-line) 444 (define-key gud-speedbar-key-map "e" 'speedbar-edit-line)
440 (define-key gud-speedbar-key-map "\C-m" 'speedbar-edit-line) 445 (define-key gud-speedbar-key-map "\C-m" 'speedbar-edit-line)
@@ -483,6 +488,13 @@ The value t means that there is no stack, and we are in display-file mode.")
483DIRECTORY and ZERO are not used, but are required by the caller." 488DIRECTORY and ZERO are not used, but are required by the caller."
484 (gud-speedbar-buttons gud-comint-buffer)) 489 (gud-speedbar-buttons gud-comint-buffer))
485 490
491(declare-function speedbar-make-tag-line "speedbar"
492 (type char func data tag tfunc tdata tface depth))
493(declare-function speedbar-remove-localized-speedbar-support "speedbar"
494 (buffer))
495(declare-function speedbar-insert-button "speedbar"
496 (text face mouse function &optional token prevline))
497
486(defun gud-speedbar-buttons (buffer) 498(defun gud-speedbar-buttons (buffer)
487 "Create a speedbar display based on the current state of GUD. 499 "Create a speedbar display based on the current state of GUD.
488If the GUD BUFFER is not running a supported debugger, then turn 500If the GUD BUFFER is not running a supported debugger, then turn
@@ -881,9 +893,14 @@ It is passed through `gud-gdb-marker-filter' before we look at it."
881 893
882;; gdb speedbar functions 894;; gdb speedbar functions
883 895
896;; Part of the macro expansion of dframe-with-attached-buffer.
897;; At runtime, will be pulled in as a require of speedbar.
898(declare-function dframe-select-attached-frame "dframe" (&optional frame))
899(declare-function dframe-maybee-jump-to-attached-frame "dframe" ())
900
884(defun gud-gdb-goto-stackframe (_text token _indent) 901(defun gud-gdb-goto-stackframe (_text token _indent)
885 "Goto the stackframe described by TEXT, TOKEN, and INDENT." 902 "Goto the stackframe described by TEXT, TOKEN, and INDENT."
886 (speedbar-with-attached-buffer 903 (dframe-with-attached-buffer
887 (gud-basic-call (concat "server frame " (nth 1 token))) 904 (gud-basic-call (concat "server frame " (nth 1 token)))
888 (sit-for 1))) 905 (sit-for 1)))
889 906
@@ -2633,6 +2650,8 @@ It is saved for when this flag is not set.")
2633(add-to-list 'overlay-arrow-variable-list 'gud-overlay-arrow-position) 2650(add-to-list 'overlay-arrow-variable-list 'gud-overlay-arrow-position)
2634 2651
2635(declare-function gdb-reset "gdb-mi" ()) 2652(declare-function gdb-reset "gdb-mi" ())
2653(declare-function speedbar-change-initial-expansion-list "speedbar" (new))
2654(defvar speedbar-previously-used-expansion-list-name)
2636 2655
2637(defun gud-sentinel (proc msg) 2656(defun gud-sentinel (proc msg)
2638 (cond ((null (buffer-name (process-buffer proc))) 2657 (cond ((null (buffer-name (process-buffer proc)))
@@ -2640,7 +2659,7 @@ It is saved for when this flag is not set.")
2640 ;; Stop displaying an arrow in a source file. 2659 ;; Stop displaying an arrow in a source file.
2641 (setq gud-overlay-arrow-position nil) 2660 (setq gud-overlay-arrow-position nil)
2642 (set-process-buffer proc nil) 2661 (set-process-buffer proc nil)
2643 (if (and (boundp 'speedbar-frame) 2662 (if (and (boundp 'speedbar-initial-expansion-list-name)
2644 (string-equal speedbar-initial-expansion-list-name "GUD")) 2663 (string-equal speedbar-initial-expansion-list-name "GUD"))
2645 (speedbar-change-initial-expansion-list 2664 (speedbar-change-initial-expansion-list
2646 speedbar-previously-used-expansion-list-name)) 2665 speedbar-previously-used-expansion-list-name))
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 4c3ae340ab8..0050a94513a 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -2135,7 +2135,7 @@ your style, only those that are different from the default.")
2135(eval-when-compile 2135(eval-when-compile
2136 (require 'font-lock) 2136 (require 'font-lock)
2137 (require 'ps-print) 2137 (require 'ps-print)
2138 (require 'speedbar))) 2138 (require 'speedbar))) ; for speedbar-with-writable
2139 2139
2140 2140
2141;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2141;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2553,6 +2553,9 @@ conversion."
2553 (setcdr list1 (cddr list1)))) 2553 (setcdr list1 (cddr list1))))
2554 (cdr list)) 2554 (cdr list))
2555 2555
2556(declare-function speedbar-refresh "speedbar" (&optional arg))
2557(declare-function speedbar-do-function-pointer "speedbar" ())
2558
2556(defun vhdl-speedbar-refresh (&optional key) 2559(defun vhdl-speedbar-refresh (&optional key)
2557 "Refresh directory or project with name KEY." 2560 "Refresh directory or project with name KEY."
2558 (when (and (boundp 'speedbar-frame) 2561 (when (and (boundp 'speedbar-frame)
@@ -14515,6 +14518,13 @@ if required."
14515(defvar vhdl-speedbar-menu-items nil 14518(defvar vhdl-speedbar-menu-items nil
14516 "Additional menu-items to add to speedbar frame.") 14519 "Additional menu-items to add to speedbar frame.")
14517 14520
14521(declare-function speedbar-add-supported-extension "speedbar" (extension))
14522(declare-function speedbar-add-mode-functions-list "speedbar" (new-list))
14523(declare-function speedbar-make-specialized-keymap "speedbar" ())
14524(declare-function speedbar-change-initial-expansion-list "speedbar"
14525 (new-default))
14526(declare-function speedbar-add-expansion-list "speedbar" (new-list))
14527
14518(defun vhdl-speedbar-initialize () 14528(defun vhdl-speedbar-initialize ()
14519 "Initialize speedbar." 14529 "Initialize speedbar."
14520 ;; general settings 14530 ;; general settings
@@ -14644,11 +14654,15 @@ if required."
14644 "Name of last selected project.") 14654 "Name of last selected project.")
14645 14655
14646;; macros must be defined in the file they are used (copied from `speedbar.el') 14656;; macros must be defined in the file they are used (copied from `speedbar.el')
14647(defmacro speedbar-with-writable (&rest forms) 14657;;; (defmacro speedbar-with-writable (&rest forms)
14648 "Allow the buffer to be writable and evaluate FORMS." 14658;;; "Allow the buffer to be writable and evaluate FORMS."
14649 (list 'let '((inhibit-read-only t)) 14659;;; (list 'let '((inhibit-read-only t))
14650 (cons 'progn forms))) 14660;;; (cons 'progn forms)))
14651(put 'speedbar-with-writable 'lisp-indent-function 0) 14661;;; (put 'speedbar-with-writable 'lisp-indent-function 0)
14662
14663(declare-function speedbar-extension-list-to-regex "speedbar" (extlist))
14664(declare-function speedbar-directory-buttons "speedbar" (directory _index))
14665(declare-function speedbar-file-lists "speedbar" (directory))
14652 14666
14653(defun vhdl-speedbar-display-directory (directory depth &optional rescan) 14667(defun vhdl-speedbar-display-directory (directory depth &optional rescan)
14654 "Display directory and hierarchy information in speedbar." 14668 "Display directory and hierarchy information in speedbar."
@@ -14684,6 +14698,9 @@ if required."
14684 (error (vhdl-warning-when-idle "ERROR: Invalid hierarchy information, unable to display correctly")))) 14698 (error (vhdl-warning-when-idle "ERROR: Invalid hierarchy information, unable to display correctly"))))
14685 (setq speedbar-full-text-cache nil)) ; prevent caching 14699 (setq speedbar-full-text-cache nil)) ; prevent caching
14686 14700
14701(declare-function speedbar-make-tag-line "speedbar"
14702 (type char func data tag tfunc tdata tface depth))
14703
14687(defun vhdl-speedbar-insert-projects () 14704(defun vhdl-speedbar-insert-projects ()
14688 "Insert all projects in speedbar." 14705 "Insert all projects in speedbar."
14689 (vhdl-speedbar-make-title-line "Projects:") 14706 (vhdl-speedbar-make-title-line "Projects:")
@@ -14787,6 +14804,8 @@ otherwise use cached data."
14787 depth) 14804 depth)
14788 (setq pack-alist (cdr pack-alist)))))) 14805 (setq pack-alist (cdr pack-alist))))))
14789 14806
14807(declare-function speedbar-line-directory "speedbar" (&optional depth))
14808
14790(defun vhdl-speedbar-rescan-hierarchy () 14809(defun vhdl-speedbar-rescan-hierarchy ()
14791 "Rescan hierarchy for the directory or project under the cursor." 14810 "Rescan hierarchy for the directory or project under the cursor."
14792 (interactive) 14811 (interactive)
@@ -14808,6 +14827,8 @@ otherwise use cached data."
14808 (abbreviate-file-name (match-string 1 path))))) 14827 (abbreviate-file-name (match-string 1 path)))))
14809 (vhdl-speedbar-refresh key))) 14828 (vhdl-speedbar-refresh key)))
14810 14829
14830(declare-function speedbar-goto-this-file "speedbar" (file))
14831
14811(defun vhdl-speedbar-expand-dirs (directory) 14832(defun vhdl-speedbar-expand-dirs (directory)
14812 "Expand subdirectories in DIRECTORY according to 14833 "Expand subdirectories in DIRECTORY according to
14813 `speedbar-shown-directories'." 14834 `speedbar-shown-directories'."
@@ -14857,6 +14878,8 @@ otherwise use cached data."
14857 (setq unit-alist (cdr unit-alist)))))) 14878 (setq unit-alist (cdr unit-alist))))))
14858 (vhdl-speedbar-update-current-unit nil t)) 14879 (vhdl-speedbar-update-current-unit nil t))
14859 14880
14881(declare-function speedbar-center-buffer-smartly "speedbar" ())
14882
14860(defun vhdl-speedbar-contract-level () 14883(defun vhdl-speedbar-contract-level ()
14861 "Contract current level in current directory/project." 14884 "Contract current level in current directory/project."
14862 (interactive) 14885 (interactive)
@@ -14912,6 +14935,9 @@ otherwise use cached data."
14912 (when (memq 'display vhdl-speedbar-save-cache) 14935 (when (memq 'display vhdl-speedbar-save-cache)
14913 (add-to-list 'vhdl-updated-project-list key)))) 14936 (add-to-list 'vhdl-updated-project-list key))))
14914 14937
14938(declare-function speedbar-change-expand-button-char "speedbar" (char))
14939(declare-function speedbar-delete-subblock "speedbar" (indent))
14940
14915(defun vhdl-speedbar-expand-project (text token indent) 14941(defun vhdl-speedbar-expand-project (text token indent)
14916 "Expand/contract the project under the cursor." 14942 "Expand/contract the project under the cursor."
14917 (cond 14943 (cond
@@ -15240,6 +15266,8 @@ otherwise use cached data."
15240 (setq vhdl-speedbar-last-selected-project vhdl-project))) 15266 (setq vhdl-speedbar-last-selected-project vhdl-project)))
15241 t) 15267 t)
15242 15268
15269(declare-function speedbar-position-cursor-on-line "speedbar" ())
15270
15243(defun vhdl-speedbar-update-current-unit (&optional no-position always) 15271(defun vhdl-speedbar-update-current-unit (&optional no-position always)
15244 "Highlight all design units that are contained in the current file. 15272 "Highlight all design units that are contained in the current file.
15245NO-POSITION non-nil means do not re-position cursor." 15273NO-POSITION non-nil means do not re-position cursor."
@@ -15329,6 +15357,9 @@ NO-POSITION non-nil means do not re-position cursor."
15329 (setq unit-list (cdr unit-list))) 15357 (setq unit-list (cdr unit-list)))
15330 pos) 15358 pos)
15331 15359
15360(declare-function speedbar-make-button "speedbar"
15361 (start end face mouse function &optional token))
15362
15332(defun vhdl-speedbar-make-inst-line (inst-name inst-file-marker 15363(defun vhdl-speedbar-make-inst-line (inst-name inst-file-marker
15333 ent-name ent-file-marker 15364 ent-name ent-file-marker
15334 arch-name arch-file-marker 15365 arch-name arch-file-marker
@@ -15515,6 +15546,8 @@ NO-POSITION non-nil means do not re-position cursor."
15515 'speedbar-directory-face level) 15546 'speedbar-directory-face level)
15516 (setq dirs (cdr dirs))))) 15547 (setq dirs (cdr dirs)))))
15517 15548
15549(declare-function speedbar-reset-scanners "speedbar" ())
15550
15518(defun vhdl-speedbar-dired (text token indent) 15551(defun vhdl-speedbar-dired (text token indent)
15519 "Speedbar click handler for directory expand button in hierarchy mode." 15552 "Speedbar click handler for directory expand button in hierarchy mode."
15520 (cond ((string-match "+" text) ; we have to expand this dir 15553 (cond ((string-match "+" text) ; we have to expand this dir
@@ -15554,6 +15587,8 @@ NO-POSITION non-nil means do not re-position cursor."
15554 (when (equal (selected-frame) speedbar-frame) 15587 (when (equal (selected-frame) speedbar-frame)
15555 (speedbar-center-buffer-smartly))) 15588 (speedbar-center-buffer-smartly)))
15556 15589
15590(declare-function speedbar-files-item-info "speedbar" ())
15591
15557(defun vhdl-speedbar-item-info () 15592(defun vhdl-speedbar-item-info ()
15558 "Derive and display information about this line item." 15593 "Derive and display information about this line item."
15559 (save-excursion 15594 (save-excursion
@@ -15602,6 +15637,8 @@ NO-POSITION non-nil means do not re-position cursor."
15602 (vhdl-default-directory))))) 15637 (vhdl-default-directory)))))
15603 (t (message ""))))) 15638 (t (message "")))))
15604 15639
15640(declare-function speedbar-line-text "speedbar" (&optional p))
15641
15605(defun vhdl-speedbar-line-text () 15642(defun vhdl-speedbar-line-text ()
15606 "Calls `speedbar-line-text' and removes text properties." 15643 "Calls `speedbar-line-text' and removes text properties."
15607 (let ((string (speedbar-line-text))) 15644 (let ((string (speedbar-line-text)))
@@ -15696,6 +15733,11 @@ NO-POSITION non-nil means do not re-position cursor."
15696 (goto-char dest) 15733 (goto-char dest)
15697 nil))) 15734 nil)))
15698 15735
15736(declare-function speedbar-find-file-in-frame "speedbar" (file))
15737(declare-function speedbar-set-timer "speedbar" (timeout))
15738;; speedbar loads dframe at runtime.
15739(declare-function dframe-maybee-jump-to-attached-frame "dframe" ())
15740
15699(defun vhdl-speedbar-find-file (text token indent) 15741(defun vhdl-speedbar-find-file (text token indent)
15700 "When user clicks on TEXT, load file with name and position in TOKEN. 15742 "When user clicks on TEXT, load file with name and position in TOKEN.
15701Jump to the design unit if `vhdl-speedbar-jump-to-unit' is t or if the file 15743Jump to the design unit if `vhdl-speedbar-jump-to-unit' is t or if the file
@@ -15709,7 +15751,7 @@ is already shown in a buffer."
15709 (recenter)) 15751 (recenter))
15710 (vhdl-speedbar-update-current-unit t t) 15752 (vhdl-speedbar-update-current-unit t t)
15711 (speedbar-set-timer dframe-update-speed) 15753 (speedbar-set-timer dframe-update-speed)
15712 (speedbar-maybee-jump-to-attached-frame)))) 15754 (dframe-maybee-jump-to-attached-frame))))
15713 15755
15714(defun vhdl-speedbar-port-copy () 15756(defun vhdl-speedbar-port-copy ()
15715 "Copy the port of the entity/component or subprogram under the cursor." 15757 "Copy the port of the entity/component or subprogram under the cursor."
@@ -15769,6 +15811,8 @@ is already shown in a buffer."
15769 (setcar (cddr (cddr ent-entry)) arch-key) ; (nth 4 ent-entry) 15811 (setcar (cddr (cddr ent-entry)) arch-key) ; (nth 4 ent-entry)
15770 (speedbar-refresh)))) 15812 (speedbar-refresh))))
15771 15813
15814(declare-function speedbar-line-file "speedbar" (&optional p))
15815
15772(defun vhdl-speedbar-make-design () 15816(defun vhdl-speedbar-make-design ()
15773 "Make (compile) design unit or directory/project under the cursor." 15817 "Make (compile) design unit or directory/project under the cursor."
15774 (interactive) 15818 (interactive)