2009-09-20 15:06:05 +00:00
|
|
|
;;; ede/speedbar.el --- Speedbar viewing of EDE projects
|
|
|
|
|
2019-01-01 00:59:58 +00:00
|
|
|
;; Copyright (C) 1998-2001, 2003, 2005, 2007-2019 Free Software
|
2013-01-01 09:11:05 +00:00
|
|
|
;; Foundation, Inc.
|
2009-09-20 15:06:05 +00:00
|
|
|
|
|
|
|
;; Author: Eric M. Ludlam <zappo@gnu.org>
|
|
|
|
;; Keywords: project, make, tags
|
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 15:52:52 -07:00
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2009-09-20 15:06:05 +00:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
;;
|
|
|
|
;; Display a project's hierarchy in speedbar.
|
|
|
|
;;
|
|
|
|
|
|
|
|
;;; Code:
|
2009-10-17 04:18:31 +00:00
|
|
|
|
2009-09-20 15:06:05 +00:00
|
|
|
(require 'speedbar)
|
|
|
|
(require 'eieio-speedbar)
|
|
|
|
(require 'ede)
|
|
|
|
|
|
|
|
;;; Speedbar support mode
|
|
|
|
;;
|
|
|
|
(defvar ede-speedbar-key-map nil
|
|
|
|
"A Generic object based speedbar display keymap.")
|
|
|
|
|
|
|
|
(defun ede-speedbar-make-map ()
|
|
|
|
"Make the generic object based speedbar keymap."
|
|
|
|
(setq ede-speedbar-key-map (speedbar-make-specialized-keymap))
|
|
|
|
|
|
|
|
;; General viewing things
|
|
|
|
(define-key ede-speedbar-key-map "\C-m" 'speedbar-edit-line)
|
|
|
|
(define-key ede-speedbar-key-map "+" 'speedbar-expand-line)
|
|
|
|
(define-key ede-speedbar-key-map "=" 'speedbar-expand-line)
|
|
|
|
(define-key ede-speedbar-key-map "-" 'speedbar-contract-line)
|
|
|
|
(define-key ede-speedbar-key-map " " 'speedbar-toggle-line-expansion)
|
|
|
|
|
|
|
|
;; Some object based things
|
|
|
|
(define-key ede-speedbar-key-map "C" 'eieio-speedbar-customize-line)
|
|
|
|
|
|
|
|
;; Some project based things
|
|
|
|
(define-key ede-speedbar-key-map "R" 'ede-speedbar-remove-file-from-target)
|
|
|
|
(define-key ede-speedbar-key-map "b" 'ede-speedbar-compile-line)
|
|
|
|
(define-key ede-speedbar-key-map "B" 'ede-speedbar-compile-project)
|
|
|
|
(define-key ede-speedbar-key-map "D" 'ede-speedbar-make-distribution)
|
|
|
|
(define-key ede-speedbar-key-map "E" 'ede-speedbar-edit-projectfile)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defvar ede-speedbar-menu
|
|
|
|
'([ "Compile" ede-speedbar-compile-line t]
|
|
|
|
[ "Compile Project" ede-speedbar-compile-project
|
|
|
|
(ede-project-child-p (speedbar-line-token)) ]
|
|
|
|
"---"
|
|
|
|
[ "Edit File/Tag" speedbar-edit-line
|
|
|
|
(not (eieio-object-p (speedbar-line-token)))]
|
|
|
|
[ "Expand" speedbar-expand-line
|
|
|
|
(save-excursion (beginning-of-line)
|
|
|
|
(looking-at "[0-9]+: *.\\+. "))]
|
|
|
|
[ "Contract" speedbar-contract-line
|
|
|
|
(save-excursion (beginning-of-line)
|
|
|
|
(looking-at "[0-9]+: *.-. "))]
|
|
|
|
"---"
|
|
|
|
[ "Remove File from Target" ede-speedbar-remove-file-from-target
|
|
|
|
(stringp (speedbar-line-token)) ]
|
|
|
|
[ "Customize Project/Target" eieio-speedbar-customize-line
|
|
|
|
(eieio-object-p (speedbar-line-token)) ]
|
|
|
|
[ "Edit Project File" ede-speedbar-edit-projectfile t]
|
|
|
|
[ "Make Distribution" ede-speedbar-make-distribution
|
|
|
|
(ede-project-child-p (speedbar-line-token)) ]
|
|
|
|
)
|
|
|
|
"Menu part in easymenu format used in speedbar while browsing objects.")
|
|
|
|
|
|
|
|
(eieio-speedbar-create 'ede-speedbar-make-map
|
|
|
|
'ede-speedbar-key-map
|
|
|
|
'ede-speedbar-menu
|
|
|
|
"Project"
|
|
|
|
'ede-speedbar-toplevel-buttons)
|
|
|
|
|
|
|
|
|
|
|
|
(defun ede-speedbar ()
|
|
|
|
"EDE development environment project browser for speedbar."
|
|
|
|
(interactive)
|
|
|
|
(speedbar-frame-mode 1)
|
|
|
|
(speedbar-change-initial-expansion-list "Project")
|
|
|
|
(speedbar-get-focus)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defun ede-speedbar-toplevel-buttons (dir)
|
|
|
|
"Return a list of objects to display in speedbar.
|
|
|
|
Argument DIR is the directory from which to derive the list of objects."
|
|
|
|
ede-projects
|
|
|
|
)
|
|
|
|
|
|
|
|
;;; Some special commands useful in EDE
|
|
|
|
;;
|
|
|
|
(defun ede-speedbar-remove-file-from-target ()
|
Synch EDE to CEDET 1.0.
* cedet-idutils.el (cedet-idutils-make-command): New option.
(cedet-idutils-mkid-call):
(cedet-idutils-create/update-database): New functions.
* cedet-cscope.el (cedet-cscope-create):
(cedet-cscope-create/update-database): New functions.
(cedet-cscope-support-for-directory): Make interactive.
* cedet-global.el (cedet-global-gtags-command): New option.
(cedet-gnu-global-gtags-call)
(cedet-gnu-global-create/update-database): New functions.
* ede.el (ede-save-cache): Fix recentf-exclude expression.
(ede-make-dist): Always use toplevel project.
(ede-buffer-object): If we fail to find an object in the current
project, loop upward looking for a match. If no target is found,
use most local project.
(ede-buffer-belongs-to-target-p)
(ede-buffer-belongs-to-project-p): New functions.
(ede-initialize-state-current-buffer): New function.
(ede-target-forms-menu, ede-project-buffers): Use them.
(ede-minor-mode, ede-reset-all-buffers): Use it.
(project-interactive-select-target, project-add-file): Don't use
ede-project-force-load.
(ede-buffer-object): New arg PROJSYM.
(ede-minor-mode): Remove ede-directory-project-p test.
(ede-initialize-state-current-buffer): Don't test for
ede-directory-project-p if there is a matching open project.
(ede-customize-forms-menu): Prevent error if there is no project.
(ede-load-project-file): Set ede-constructing to the thing being
constructed, instead of t.
(ede-project-force-load): Deleted.
* ede/base.el:
* ede/auto.el:
* ede/custom.el: New files.
* ede/autoconf-edit.el (autoconf-find-last-macro)
(autoconf-parameters-for-macro): Parse multiline parameters of
macros. Optionally ignore case and at bol for macro.
(autoconf-parameter-strip): Use greedy match for newlines.
(autoconf-new-automake-string): Deleted.
(autoconf-new-program): Use SRecode to fill an empty file.
* ede/cpp-root.el (ede-create-lots-of-projects-under-dir): New
function.
* ede/files.el (ede-flush-project-hash): New command.
(ede-convert-path): Add optional PROJECT arg.
(ede-directory-project-p): Obey ".ede-ignore".
(ede-expand-filename-local)
(ede-expand-filename-impl-via-subproj): New methods.
(ede-expand-filename-impl): Use them.
(ede-project-root, ede-project-root-directory): Move to
ede/auto.el.
* ede/locate.el (ede-locate-flush-hash):
(ede-locate-create/update-root-database): New methods.
(initialize-instance): Use ede-locate-flush-hash.
* ede/pmake.el (ede-proj-makefile-insert-variables): If this is
the top project and not a metasubproject, set TOP to CURDIR.
(ede-proj-makefile-insert-variables): Output a target's object
list whether or not the vars are already in the Makefile.
(ede-pmake-insert-variable-once): New macro.
* ede/project-am.el (project-am-with-makefile-current): Add
recentf-exclude.
(project-am-load-makefile): Obey an optional suggested name.
(project-am-expand-subdirlist): New function.
(project-am-makefile::project-rescan): Use it. Combine SUBDIRS
and DIST_SUBDIRS.
(project-am-meta-type-alist): A list to scan better Makefile.am
(project-am-scan-for-targets): Scan also over
project-am-meta-type-alist.
(ede-system-include-path): Simple implementation.
(ede-find-target): Deleted. EDE core takes care of this.
(ede-buffer-mine): Create the searched filename as relative.
(project-am-load): Simplify, using autoconf-edit.
(project-am-extract-package-info): Fix separators.
* ede/proj.el (project-run-target): New method.
(project-make-dist, project-compile-project): Use
ede-proj-automake-p to determine which kind of compile to use.
(project-rescan): Call ede-load-project-file.
(ede-buffer-mine): Add more file names that belong to the project.
(ede-proj-compilers): Improve error message.
* ede/proj-obj.el (ede-ld-linker): Use the LDDEPS variable.
(ede-source-c++): Add more C++ extensions.
(ede-proj-target-makefile-objectcode): Quote initforms. Support
lex and yacc.
* ede/proj-prog.el (ede-proj-makefile-insert-rules): Removed.
(ede-proj-makefile-insert-variables): New, add LDDEPS.
(ede-proj-makefile-insert-automake-post-variables): Add LDADD
variable. Use ldlibs-local slot. Add a -l to ldlibs strings.
(ede-proj-target-makefile-program): Swap order of two slots so
they show up in the same order as in the command line.
(ede-proj-target-makefile-program): Add ldlibs-local slot.
* ede/proj-shared.el (ede-g++-libtool-shared-compiler): Fix
inference rule to use cpp files.
(ede-proj-target-makefile-shared-object): Quote initforms.
* ede/proj-misc.el (ede-proj-target-makefile-miscelaneous):
* ede/proj-info.el (ede-proj-target-makefile-info):
* ede/proj-aux.el (ede-proj-target-aux):
* ede/proj-archive.el (ede-proj-target-makefile-archive):
* ede/proj-elisp.el (ede-proj-target-elisp)
(ede-proj-target-elisp-autoloads): Quote initforms.
* ede/srecode.el (ede-srecode-setup): Load autoconf templates.
* ede/shell.el (ede-shell-buffer): Fix buffer name.
* ede/pconf.el (ede-proj-configure-synchronize): If user events
occur while waiting for the compile process to finish, pull them
in and discard those events.
2010-09-20 22:42:53 -04:00
|
|
|
"Remove the file at point from its target."
|
2009-09-20 15:06:05 +00:00
|
|
|
(interactive)
|
|
|
|
(if (stringp (speedbar-line-token))
|
|
|
|
(progn
|
|
|
|
(speedbar-edit-line)
|
|
|
|
(ede-remove-file))))
|
|
|
|
|
|
|
|
(defun ede-speedbar-compile-line ()
|
|
|
|
"Compile/Build the project or target on this line."
|
|
|
|
(interactive)
|
|
|
|
(let ((obj (eieio-speedbar-find-nearest-object)))
|
|
|
|
(if (not (eieio-object-p obj))
|
|
|
|
nil
|
2015-01-07 23:11:58 -05:00
|
|
|
(cond ((obj-of-class-p obj 'ede-project)
|
2009-09-20 15:06:05 +00:00
|
|
|
(project-compile-project obj))
|
2015-01-07 23:11:58 -05:00
|
|
|
((obj-of-class-p obj 'ede-target)
|
2009-09-20 15:06:05 +00:00
|
|
|
(project-compile-target obj))
|
|
|
|
(t (error "Error in speedbar structure"))))))
|
|
|
|
|
|
|
|
(defun ede-speedbar-get-top-project-for-line ()
|
|
|
|
"Return a project object for this line."
|
|
|
|
(interactive)
|
|
|
|
(let ((obj (eieio-speedbar-find-nearest-object)))
|
|
|
|
(if (not (eieio-object-p obj))
|
|
|
|
(error "Error in speedbar or ede structure")
|
2015-01-07 23:11:58 -05:00
|
|
|
(if (obj-of-class-p obj 'ede-target)
|
2009-09-20 15:06:05 +00:00
|
|
|
(setq obj (ede-target-parent obj)))
|
2015-01-07 23:11:58 -05:00
|
|
|
(if (obj-of-class-p obj 'ede-project)
|
2009-09-20 15:06:05 +00:00
|
|
|
obj
|
|
|
|
(error "Error in speedbar or ede structure")))))
|
|
|
|
|
|
|
|
(defun ede-speedbar-compile-project ()
|
|
|
|
"Compile/Build the project which owns this line."
|
|
|
|
(interactive)
|
|
|
|
(project-compile-project (ede-speedbar-get-top-project-for-line)))
|
|
|
|
|
|
|
|
(defun ede-speedbar-compile-file-project ()
|
|
|
|
"Compile/Build the target which the current file belongs to."
|
|
|
|
(interactive)
|
|
|
|
(let* ((file (speedbar-line-file))
|
|
|
|
(buf (find-file-noselect file))
|
|
|
|
(bwin (get-buffer-window buf 0)))
|
|
|
|
(if bwin
|
|
|
|
(progn
|
|
|
|
(select-window bwin)
|
|
|
|
(raise-frame (window-frame bwin)))
|
|
|
|
(dframe-select-attached-frame speedbar-frame)
|
|
|
|
(set-buffer buf)
|
|
|
|
(ede-compile-target))))
|
|
|
|
|
|
|
|
(defun ede-speedbar-make-distribution ()
|
|
|
|
"Edit the project file based on this line."
|
|
|
|
(interactive)
|
|
|
|
(project-make-dist (ede-speedbar-get-top-project-for-line)))
|
|
|
|
|
|
|
|
(defun ede-speedbar-edit-projectfile ()
|
|
|
|
"Edit the project file based on this line."
|
|
|
|
(interactive)
|
|
|
|
(project-edit-file-target (ede-speedbar-get-top-project-for-line)))
|
|
|
|
|
|
|
|
;;; Speedbar Project Methods
|
|
|
|
;;
|
|
|
|
(defun ede-find-nearest-file-line ()
|
|
|
|
"Go backwards until we find a file."
|
|
|
|
(save-excursion
|
|
|
|
(beginning-of-line)
|
|
|
|
(looking-at "^\\([0-9]+\\):")
|
|
|
|
(let ((depth (string-to-number (match-string 1))))
|
Replace still more end-of-line etc with line-end-position, etc.
* lisp/gnus/nnbabyl.el (nnbabyl-request-move-article, nnbabyl-delete-mail)
(nnbabyl-check-mbox): Use point-at-bol.
* lisp/cedet/semantic/lex.el (semantic-lex-ignore-comments, semantic-flex):
* lisp/cedet/semantic/grammar.el (semantic-grammar-epilogue):
* lisp/cedet/ede/speedbar.el (ede-find-nearest-file-line):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/ede/autoconf-edit.el (autoconf-delete-parameter):
Use point-at-bol and point-at-eol.
* lisp/vc/emerge.el (emerge-line-number-in-buf):
* lisp/textmodes/ispell.el (ispell-region):
* lisp/textmodes/fill.el (current-fill-column):
* lisp/progmodes/xscheme.el (xscheme-send-current-line):
* lisp/progmodes/vhdl-mode.el (vhdl-current-line, vhdl-line-copy):
* lisp/progmodes/tcl.el (tcl-hairy-scan-for-comment):
* lisp/progmodes/sh-script.el (sh-handle-prev-do):
* lisp/progmodes/meta-mode.el (meta-indent-line):
* lisp/progmodes/idlwave.el (idlwave-goto-comment, idlwave-fill-paragraph)
(idlwave-in-quote):
* lisp/progmodes/idlw-shell.el (idlwave-shell-current-frame)
(idlwave-shell-update-bp-overlays, idlwave-shell-sources-filter):
* lisp/progmodes/fortran.el (fortran-looking-at-if-then):
* lisp/progmodes/etags.el (find-tag-in-order, etags-snarf-tag):
* lisp/progmodes/cperl-mode.el (cperl-sniff-for-indent)
(cperl-find-pods-heres):
* lisp/progmodes/ada-mode.el (ada-get-current-indent, ada-narrow-to-defun):
* lisp/net/quickurl.el (quickurl-list-insert):
* lisp/net/ldap.el (ldap-search-internal):
* lisp/net/eudc.el (eudc-expand-inline):
* lisp/mail/sendmail.el (sendmail-send-it):
* lisp/mail/mspools.el (mspools-visit-spool, mspools-get-spool-name):
* lisp/emulation/viper-cmd.el (viper-paren-match, viper-backward-indent)
(viper-brac-function):
* lisp/calc/calc-yank.el (calc-do-grab-region):
* lisp/calc/calc-keypd.el (calc-keypad-press):
* lisp/term.el (term-move-columns, term-insert-spaces):
* lisp/speedbar.el (speedbar-highlight-one-tag-line):
* lisp/simple.el (current-word):
* lisp/mouse-drag.el (mouse-drag-should-do-col-scrolling):
* lisp/info.el (Info-find-node-in-buffer-1, Info-follow-reference)
(Info-scroll-down):
* lisp/hippie-exp.el (he-line-beg):
* lisp/epa.el (epa--marked-keys):
* lisp/dired-aux.el (dired-kill-line, dired-do-kill-lines)
(dired-update-file-line, dired-add-entry, dired-remove-entry)
(dired-relist-entry):
* lisp/buff-menu.el (Buffer-menu-buffer):
* lisp/array.el (current-line):
* lisp/allout.el (allout-resolve-xref)
(allout-latex-verbatim-quote-curr-line):
Replace yet more uses of end-of-line etc with line-end-position.
2010-11-08 21:33:07 -08:00
|
|
|
(while (not (re-search-forward "[]] [^ ]" (point-at-eol) t))
|
2009-09-20 15:06:05 +00:00
|
|
|
(re-search-backward (format "^%d:" (1- depth)))
|
|
|
|
(setq depth (1- depth)))
|
|
|
|
(speedbar-line-token))))
|
|
|
|
|
2015-02-04 13:49:49 -05:00
|
|
|
(cl-defmethod eieio-speedbar-derive-line-path ((obj ede-project) &optional depth)
|
2009-09-20 15:06:05 +00:00
|
|
|
"Return the path to OBJ.
|
|
|
|
Optional DEPTH is the depth we start at."
|
|
|
|
(file-name-directory (oref obj file))
|
|
|
|
)
|
|
|
|
|
2015-02-04 13:49:49 -05:00
|
|
|
(cl-defmethod eieio-speedbar-derive-line-path ((obj ede-target) &optional depth)
|
2009-09-20 15:06:05 +00:00
|
|
|
"Return the path to OBJ.
|
|
|
|
Optional DEPTH is the depth we start at."
|
|
|
|
(let ((proj (ede-target-parent obj)))
|
|
|
|
;; Check the type of line we are currently on.
|
|
|
|
;; If we are on a child, we need a file name too.
|
|
|
|
(save-excursion
|
|
|
|
(let ((lt (speedbar-line-token)))
|
|
|
|
(if (or (eieio-object-p lt) (stringp lt))
|
|
|
|
(eieio-speedbar-derive-line-path proj)
|
|
|
|
;; a child element is a token. Do some work to get a filename too.
|
|
|
|
(concat (eieio-speedbar-derive-line-path proj)
|
|
|
|
(ede-find-nearest-file-line)))))))
|
|
|
|
|
2015-02-04 13:49:49 -05:00
|
|
|
(cl-defmethod eieio-speedbar-description ((obj ede-project))
|
2009-09-20 15:06:05 +00:00
|
|
|
"Provide a speedbar description for OBJ."
|
|
|
|
(ede-description obj))
|
|
|
|
|
2015-02-04 13:49:49 -05:00
|
|
|
(cl-defmethod eieio-speedbar-description ((obj ede-target))
|
2009-09-20 15:06:05 +00:00
|
|
|
"Provide a speedbar description for OBJ."
|
|
|
|
(ede-description obj))
|
|
|
|
|
2015-02-04 13:49:49 -05:00
|
|
|
(cl-defmethod eieio-speedbar-child-description ((obj ede-target))
|
2009-09-20 15:06:05 +00:00
|
|
|
"Provide a speedbar description for a plain-child of OBJ.
|
|
|
|
A plain child is a child element which is not an EIEIO object."
|
|
|
|
(or (speedbar-item-info-file-helper)
|
|
|
|
(speedbar-item-info-tag-helper)))
|
|
|
|
|
2015-02-04 13:49:49 -05:00
|
|
|
(cl-defmethod eieio-speedbar-object-buttonname ((object ede-project))
|
2009-09-20 15:06:05 +00:00
|
|
|
"Return a string to use as a speedbar button for OBJECT."
|
|
|
|
(if (ede-parent-project object)
|
|
|
|
(ede-name object)
|
|
|
|
(concat (ede-name object) " " (oref object version))))
|
|
|
|
|
2015-02-04 13:49:49 -05:00
|
|
|
(cl-defmethod eieio-speedbar-object-buttonname ((object ede-target))
|
2009-09-20 15:06:05 +00:00
|
|
|
"Return a string to use as a speedbar button for OBJECT."
|
|
|
|
(ede-name object))
|
|
|
|
|
2015-02-04 13:49:49 -05:00
|
|
|
(cl-defmethod eieio-speedbar-object-children ((this ede-project))
|
2009-09-20 15:06:05 +00:00
|
|
|
"Return the list of speedbar display children for THIS."
|
|
|
|
(condition-case nil
|
|
|
|
(with-slots (subproj targets) this
|
|
|
|
(append subproj targets))
|
|
|
|
(error nil)))
|
|
|
|
|
2015-02-04 13:49:49 -05:00
|
|
|
(cl-defmethod eieio-speedbar-object-children ((this ede-target))
|
2009-09-20 15:06:05 +00:00
|
|
|
"Return the list of speedbar display children for THIS."
|
|
|
|
(oref this source))
|
|
|
|
|
2015-02-04 13:49:49 -05:00
|
|
|
(cl-defmethod eieio-speedbar-child-make-tag-lines ((this ede-target) depth)
|
2009-09-20 15:06:05 +00:00
|
|
|
"Create a speedbar tag line for a child of THIS.
|
|
|
|
It has depth DEPTH."
|
|
|
|
(with-slots (source) this
|
|
|
|
(mapcar (lambda (car)
|
|
|
|
(speedbar-make-tag-line 'bracket ?+
|
|
|
|
'speedbar-tag-file
|
|
|
|
car
|
|
|
|
car
|
|
|
|
'ede-file-find
|
|
|
|
car
|
|
|
|
'speedbar-file-face depth))
|
|
|
|
source)))
|
|
|
|
|
|
|
|
;;; Generic file management for TARGETS
|
|
|
|
;;
|
|
|
|
(defun ede-file-find (text token indent)
|
|
|
|
"Find the file TEXT at path TOKEN.
|
|
|
|
INDENT is the current indentation level."
|
|
|
|
(speedbar-find-file-in-frame
|
|
|
|
(expand-file-name token (speedbar-line-directory indent)))
|
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.
2013-05-21 20:13:56 -07:00
|
|
|
(dframe-maybee-jump-to-attached-frame))
|
2009-09-20 15:06:05 +00:00
|
|
|
|
|
|
|
(defun ede-create-tag-buttons (filename indent)
|
|
|
|
"Create the tag buttons associated with FILENAME at INDENT."
|
|
|
|
(let* ((lst (speedbar-fetch-dynamic-tags filename)))
|
|
|
|
;; if no list, then remove expando button
|
|
|
|
(if (not lst)
|
|
|
|
(speedbar-change-expand-button-char ??)
|
|
|
|
(speedbar-with-writable
|
|
|
|
;; We must do 1- because indent was already incremented.
|
|
|
|
(speedbar-insert-generic-list (1- indent)
|
|
|
|
lst
|
|
|
|
'ede-tag-expand
|
|
|
|
'ede-tag-find)))))
|
|
|
|
|
|
|
|
(defun ede-tag-expand (text token indent)
|
|
|
|
"Expand a tag sublist. Imenu will return sub-lists of specialized tag types.
|
|
|
|
Etags does not support this feature. TEXT will be the button
|
|
|
|
string. TOKEN will be the list, and INDENT is the current indentation
|
|
|
|
level."
|
Fix regular-expression glitches and typos
Problems reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-03/msg00085.html
* admin/admin.el (set-version):
* lisp/allout.el (allout-latexify-one-item):
* lisp/arc-mode.el (archive-arc-rename-entry)
(archive-rar-summarize):
* lisp/calc/calc-graph.el (calc-graph-set-styles)
(calc-graph-hide):
* lisp/calc/calc-help.el (calc-describe-key):
* lisp/calc/calc-lang.el (math-compose-tex-func, eqn):
* lisp/calc/calc.el (calcDigit-key):
* lisp/cedet/ede/makefile-edit.el (makefile-macro-file-list):
* lisp/cedet/ede/speedbar.el (ede-tag-expand):
* lisp/cedet/semantic/sb.el (semantic-sb-show-extra)
(semantic-sb-expand-group):
* lisp/comint.el (comint-substitute-in-file-name):
* lisp/dired.el (dired-actual-switches):
* lisp/emacs-lisp/chart.el (chart-rmail-from):
* lisp/emacs-lisp/eieio-opt.el (eieio-sb-expand):
* lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar-object-expand):
* lisp/emacs-lisp/rx.el (rx-not, rx-atomic-p):
* lisp/emulation/viper-ex.el (viper-get-ex-token)
(viper-get-ex-pat, ex-set-read-variable):
* lisp/epg.el (epg--status-SIG_CREATED):
* lisp/erc/erc-speedbar.el (erc-speedbar-expand-user):
(erc-speedbar-expand-channel, erc-speedbar-expand-server)
* lisp/erc/erc.el (erc-is-message-ctcp-and-not-action-p)
(erc-banlist-update):
* lisp/eshell/em-dirs.el (eshell-parse-drive-letter, eshell/pwd):
* lisp/find-dired.el (find-dired):
* lisp/frame.el (frame-set-background-mode):
* lisp/generic-x.el (apache-log-generic-mode):
* lisp/gnus/gnus-art.el (gnus-button-valid-localpart-regexp):
* lisp/gnus/gnus.el (gnus-short-group-name):
* lisp/gnus/message.el (message-mailer-swallows-blank-line):
* lisp/ibuffer.el (ibuffer-fontification-alist):
* lisp/ido.el (ido-set-matches-1):
* lisp/info-xref.el (info-xref-lock-file-p):
* lisp/info.el (Info-dir-remove-duplicates)
(Info-unescape-quotes, Info-split-parameter-string)
(Info-speedbar-expand-node):
* lisp/international/mule.el (sgml-html-meta-auto-coding-function):
* lisp/isearch.el (isearch-pre-command-hook):
* lisp/language/ethio-util.el (ethio-fidel-to-tex-buffer):
* lisp/mail/rmail.el (rmail-collect-deleted):
* lisp/mh-e/mh-alias.el (mh-alias-suggest-alias):
* lisp/mh-e/mh-comp.el (mh-forward):
* lisp/mh-e/mh-search.el (mh-index-next-folder)
(mh-index-create-imenu-index):
* lisp/mh-e/mh-xface.el (mh-picon-get-image):
* lisp/minibuffer.el (completion--embedded-envvar-re):
* lisp/net/ange-ftp.el (ange-ftp-ls-parser):
* lisp/net/goto-addr.el (goto-address-mail-regexp)
(goto-address-find-address-at-point):
* lisp/net/pop3.el (pop3-read-response, pop3-user)
(pop3-pass, pop3-apop):
* lisp/net/tramp.el (tramp-ipv6-regexp)
(tramp-replace-environment-variables):
* lisp/nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* lisp/nxml/rng-uri.el (rng-uri-escape-multibyte):
* lisp/nxml/rng-xsd.el (rng-xsd-convert-any-uri):
* lisp/obsolete/pgg.el (pgg-fetch-key):
* lisp/obsolete/vip.el (vip-get-ex-token):
* lisp/org/ob-core.el (org-babel-string-read):
* lisp/org/org-agenda.el:
(org-agenda-add-entry-to-org-agenda-diary-file):
* lisp/org/org-element.el (org-element-keyword-parser):
* lisp/org/org-list.el (org-list-indent-item-generic):
* lisp/org/org-mhe.el (org-mhe-get-message-folder-from-index):
* lisp/org/org-mobile.el (org-mobile-apply):
* lisp/org/org-mouse.el (org-mouse-context-menu):
* lisp/org/org-plot.el (org-plot/gnuplot):
* lisp/org/org-protocol.el (org-protocol-flatten-greedy):
* lisp/org/org-table.el (org-table-copy-down)
(org-table-formula-make-cmp-string)
(org-table-get-stored-formulas, org-table-recalculate)
(org-table-edit-formulas):
* lisp/org/org.el (org-translate-link-from-planner)
(org-fill-line-break-nobreak-p):
* lisp/org/ox-ascii.el (org-ascii-item):
* lisp/org/ox-latex.el (org-latex-clean-invalid-line-breaks):
* lisp/org/ox.el (org-export-expand-include-keyword):
* lisp/progmodes/ada-xref.el (ada-treat-cmd-string):
* lisp/progmodes/cfengine.el (cfengine2-font-lock-keywords):
* lisp/progmodes/cperl-mode.el (cperl-to-comment-or-eol)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-have-help-regexp, cperl-word-at-point-hard)
(cperl-make-regexp-x):
* lisp/progmodes/dcl-mode.el (dcl-option-value-offset):
* lisp/progmodes/etags.el (tag-implicit-name-match-p):
* lisp/progmodes/fortran.el (fortran-fill):
* lisp/progmodes/gdb-mi.el (gdb-speedbar-expand-node)
(gdb-locals-handler-custom):
* lisp/progmodes/grep.el (grep-mode-font-lock-keywords):
* lisp/progmodes/gud.el (gud-jdb-find-source-using-classpath):
* lisp/progmodes/js.el (js--continued-expression-p):
* lisp/progmodes/m4-mode.el (m4-font-lock-keywords):
* lisp/progmodes/meta-mode.el (meta-indent-level-count):
* lisp/progmodes/mixal-mode.el (mixal-font-lock-keywords):
* lisp/progmodes/opascal.el (opascal-find-unit-in-directory):
* lisp/progmodes/pascal.el (pascal-progbeg-re):
* lisp/progmodes/ruby-mode.el (ruby-expression-expansion-re)
(ruby-expr-beg, ruby-parse-partial)
(ruby-toggle-string-quotes, ruby-font-lock-keywords):
* lisp/progmodes/sql.el (sql--make-help-docstring):
* lisp/progmodes/verilog-mode.el (verilog-coverpoint-re)
(verilog-skip-forward-comment-p)
(verilog-read-sub-decls-gate)
(verilog-read-auto-template-middle):
* lisp/progmodes/vhdl-mode.el (vhdl-resolve-env-variable)
(vhdl-speedbar-expand-project, vhdl-speedbar-expand-entity)
(vhdl-speedbar-expand-architecture)
(vhdl-speedbar-expand-config, vhdl-speedbar-expand-package)
(vhdl-speedbar-dired):
* lisp/speedbar.el (speedbar-dired, speedbar-tag-file)
(speedbar-tag-expand):
* lisp/textmodes/dns-mode.el (dns-mode-font-lock-keywords):
* lisp/textmodes/flyspell.el (flyspell-debug-signal-word-checked):
* lisp/textmodes/ispell.el (ispell-process-line):
* lisp/textmodes/reftex-cite.el (reftex-end-of-bib-entry):
* lisp/textmodes/reftex-ref.el (reftex-replace-prefix-escapes):
* lisp/url/url-parse.el (url-generic-parse-url):
* lisp/url/url-util.el (url-truncate-url-for-viewing):
* lisp/vc/diff-mode.el (diff-unified->context):
* lisp/vc/vc-bzr.el (vc-bzr-error-regexp-alist):
* lisp/vc/vc-cvs.el (vc-cvs-parse-status):
* lisp/woman.el (woman0-el, woman-if-ignore)
(woman-change-fonts):
* lisp/xdg.el (xdg--substitute-home-env):
Fix regular-expression infelicities and typos.
Fix regular expression typos
Fix typos reported by Mattias Engdegård in:
that occurred in preloaded modules.
* lisp/frame.el (frame-set-background-mode):
* lisp/international/mule.el (sgml-html-meta-auto-coding-function):
* lisp/isearch.el (isearch-pre-command-hook):
* lisp/minibuffer.el (completion--embedded-envvar-re):
2019-03-04 18:00:00 -08:00
|
|
|
(cond ((string-match "\\+" text) ;we have to expand this file
|
2009-09-20 15:06:05 +00:00
|
|
|
(speedbar-change-expand-button-char ?-)
|
|
|
|
(speedbar-with-writable
|
|
|
|
(save-excursion
|
|
|
|
(end-of-line) (forward-char 1)
|
|
|
|
(speedbar-insert-generic-list indent token
|
|
|
|
'ede-tag-expand
|
|
|
|
'ede-tag-find))))
|
|
|
|
((string-match "-" text) ;we have to contract this node
|
|
|
|
(speedbar-change-expand-button-char ?+)
|
|
|
|
(speedbar-delete-subblock indent))
|
|
|
|
(t (error "Ooops... not sure what to do")))
|
|
|
|
(speedbar-center-buffer-smartly))
|
|
|
|
|
|
|
|
(defun ede-tag-find (text token indent)
|
|
|
|
"For the tag TEXT in a file TOKEN, goto that position.
|
|
|
|
INDENT is the current indentation level."
|
|
|
|
(let ((file (ede-find-nearest-file-line)))
|
|
|
|
(speedbar-find-file-in-frame file)
|
|
|
|
(save-excursion (speedbar-stealthy-updates))
|
2011-11-14 23:55:13 -08:00
|
|
|
;; Reset the timer with a new timeout when clicking a file
|
2009-09-20 15:06:05 +00:00
|
|
|
;; in case the user was navigating directories, we can cancel
|
|
|
|
;; that other timer.
|
|
|
|
; (speedbar-set-timer speedbar-update-speed)
|
|
|
|
(goto-char token)
|
|
|
|
(run-hooks 'speedbar-visiting-tag-hook)
|
|
|
|
;;(recenter)
|
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.
2013-05-21 20:13:56 -07:00
|
|
|
(dframe-maybee-jump-to-attached-frame)
|
2009-09-20 15:06:05 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
;;; EDE and the speedbar FILE display
|
|
|
|
;;
|
|
|
|
;; This will add a couple keybindings and menu items into the
|
|
|
|
;; FILE display for speedbar.
|
|
|
|
|
|
|
|
(defvar ede-speedbar-file-menu-additions
|
|
|
|
'("----"
|
|
|
|
["Create EDE Target" ede-new-target (ede-current-project) ]
|
|
|
|
["Add to project" ede-speedbar-file-add-to-project (ede-current-project) ]
|
|
|
|
["Compile project" ede-speedbar-compile-project (ede-current-project) ]
|
|
|
|
["Compile file target" ede-speedbar-compile-file-target (ede-current-project) ]
|
|
|
|
["Make distribution" ede-make-dist (ede-current-project) ]
|
|
|
|
)
|
|
|
|
"Set of menu items to splice into the speedbar menu.")
|
|
|
|
|
|
|
|
(defvar ede-speedbar-file-keymap
|
|
|
|
(let ((km (make-sparse-keymap)))
|
|
|
|
(define-key km "a" 'ede-speedbar-file-add-to-project)
|
|
|
|
(define-key km "t" 'ede-new-target)
|
|
|
|
(define-key km "s" 'ede-speedbar)
|
|
|
|
(define-key km "C" 'ede-speedbar-compile-project)
|
|
|
|
(define-key km "c" 'ede-speedbar-compile-file-target)
|
|
|
|
(define-key km "d" 'ede-make-dist)
|
|
|
|
km)
|
|
|
|
"Keymap spliced into the speedbar keymap.")
|
|
|
|
|
2009-09-20 15:43:17 +00:00
|
|
|
;;;###autoload
|
2009-09-20 15:06:05 +00:00
|
|
|
(defun ede-speedbar-file-setup ()
|
|
|
|
"Setup some keybindings in the Speedbar File display."
|
|
|
|
(setq speedbar-easymenu-definition-special
|
|
|
|
(append speedbar-easymenu-definition-special
|
|
|
|
ede-speedbar-file-menu-additions
|
|
|
|
))
|
|
|
|
(define-key speedbar-file-key-map "." ede-speedbar-file-keymap)
|
|
|
|
;; Finally, if the FILES mode is loaded, force a refresh
|
|
|
|
;; of the menus and such.
|
|
|
|
(when (and (string= speedbar-initial-expansion-list-name "files")
|
|
|
|
(buffer-live-p speedbar-buffer)
|
|
|
|
)
|
|
|
|
(speedbar-change-initial-expansion-list "files")))
|
|
|
|
|
|
|
|
(provide 'ede/speedbar)
|
|
|
|
|
2009-09-20 15:43:17 +00:00
|
|
|
;; Local variables:
|
|
|
|
;; generated-autoload-file: "loaddefs.el"
|
|
|
|
;; generated-autoload-load-name: "ede/speedbar"
|
|
|
|
;; End:
|
|
|
|
|
2009-09-20 15:06:05 +00:00
|
|
|
;;; ede/speedbar.el ends here
|