]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/ede/speedbar.el
Update copyright year to 2016
[gnu-emacs] / lisp / cedet / ede / speedbar.el
index 306d98b4c823e1688bb4b31050f9da0301b6b265..72b50ee9b06c6b739d3f7a7678fe692bdd69a0ca 100644 (file)
@@ -1,7 +1,7 @@
 ;;; ede/speedbar.el --- Speedbar viewing of EDE projects
 
-;;; Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005, 2007, 2008, 2009, 2010, 2011, 2012
-;;; Free Software Foundation, Inc.
+;; Copyright (C) 1998-2001, 2003, 2005, 2007-2016 Free Software
+;; Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: project, make, tags
@@ -121,9 +121,9 @@ Argument DIR is the directory from which to derive the list of objects."
   (let ((obj (eieio-speedbar-find-nearest-object)))
     (if (not (eieio-object-p obj))
        nil
-      (cond ((obj-of-class-p obj ede-project)
+      (cond ((obj-of-class-p obj 'ede-project)
             (project-compile-project obj))
-           ((obj-of-class-p obj ede-target)
+           ((obj-of-class-p obj 'ede-target)
             (project-compile-target obj))
            (t (error "Error in speedbar structure"))))))
 
@@ -133,9 +133,9 @@ Argument DIR is the directory from which to derive the list of objects."
   (let ((obj (eieio-speedbar-find-nearest-object)))
     (if (not (eieio-object-p obj))
        (error "Error in speedbar or ede structure")
-      (if (obj-of-class-p obj ede-target)
+      (if (obj-of-class-p obj 'ede-target)
          (setq obj (ede-target-parent obj)))
-      (if (obj-of-class-p obj ede-project)
+      (if (obj-of-class-p obj 'ede-project)
          obj
        (error "Error in speedbar or ede structure")))))
 
@@ -176,21 +176,18 @@ Argument DIR is the directory from which to derive the list of objects."
     (beginning-of-line)
     (looking-at "^\\([0-9]+\\):")
     (let ((depth (string-to-number (match-string 1))))
-      (while (not (re-search-forward "[]] [^ ]"
-                                    (save-excursion (end-of-line)
-                                                    (point))
-                                    t))
+      (while (not (re-search-forward "[]] [^ ]" (point-at-eol) t))
        (re-search-backward (format "^%d:" (1- depth)))
        (setq depth (1- depth)))
       (speedbar-line-token))))
 
-(defmethod eieio-speedbar-derive-line-path ((obj ede-project) &optional depth)
+(cl-defmethod eieio-speedbar-derive-line-path ((obj ede-project) &optional depth)
   "Return the path to OBJ.
 Optional DEPTH is the depth we start at."
   (file-name-directory (oref obj file))
   )
 
-(defmethod eieio-speedbar-derive-line-path ((obj ede-target) &optional depth)
+(cl-defmethod eieio-speedbar-derive-line-path ((obj ede-target) &optional depth)
   "Return the path to OBJ.
 Optional DEPTH is the depth we start at."
   (let ((proj (ede-target-parent obj)))
@@ -204,42 +201,42 @@ Optional DEPTH is the depth we start at."
          (concat (eieio-speedbar-derive-line-path proj)
                  (ede-find-nearest-file-line)))))))
 
-(defmethod eieio-speedbar-description ((obj ede-project))
+(cl-defmethod eieio-speedbar-description ((obj ede-project))
   "Provide a speedbar description for OBJ."
   (ede-description obj))
 
-(defmethod eieio-speedbar-description ((obj ede-target))
+(cl-defmethod eieio-speedbar-description ((obj ede-target))
   "Provide a speedbar description for OBJ."
   (ede-description obj))
 
-(defmethod eieio-speedbar-child-description ((obj ede-target))
+(cl-defmethod eieio-speedbar-child-description ((obj ede-target))
   "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)))
 
-(defmethod eieio-speedbar-object-buttonname ((object ede-project))
+(cl-defmethod eieio-speedbar-object-buttonname ((object ede-project))
   "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))))
 
-(defmethod eieio-speedbar-object-buttonname ((object ede-target))
+(cl-defmethod eieio-speedbar-object-buttonname ((object ede-target))
   "Return a string to use as a speedbar button for OBJECT."
   (ede-name object))
 
-(defmethod eieio-speedbar-object-children ((this ede-project))
+(cl-defmethod eieio-speedbar-object-children ((this ede-project))
   "Return the list of speedbar display children for THIS."
   (condition-case nil
       (with-slots (subproj targets) this
        (append subproj targets))
     (error nil)))
 
-(defmethod eieio-speedbar-object-children ((this ede-target))
+(cl-defmethod eieio-speedbar-object-children ((this ede-target))
   "Return the list of speedbar display children for THIS."
   (oref this source))
 
-(defmethod eieio-speedbar-child-make-tag-lines ((this ede-target) depth)
+(cl-defmethod eieio-speedbar-child-make-tag-lines ((this ede-target) depth)
   "Create a speedbar tag line for a child of THIS.
 It has depth DEPTH."
   (with-slots (source) this
@@ -260,7 +257,7 @@ It has depth DEPTH."
 INDENT is the current indentation level."
   (speedbar-find-file-in-frame
    (expand-file-name token (speedbar-line-directory indent)))
-  (speedbar-maybee-jump-to-attached-frame))
+  (dframe-maybee-jump-to-attached-frame))
 
 (defun ede-create-tag-buttons (filename indent)
   "Create the tag buttons associated with FILENAME at INDENT."
@@ -300,14 +297,14 @@ INDENT is the current indentation level."
   (let ((file (ede-find-nearest-file-line)))
     (speedbar-find-file-in-frame file)
     (save-excursion (speedbar-stealthy-updates))
-    ;; Reset the timer with a new timeout when cliking a file
+    ;; Reset the timer with a new timeout when clicking a file
     ;; 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)
-    (speedbar-maybee-jump-to-attached-frame)
+    (dframe-maybee-jump-to-attached-frame)
     ))
 
 ;;; EDE and the speedbar FILE display
@@ -358,5 +355,4 @@ INDENT is the current indentation level."
 ;; generated-autoload-load-name: "ede/speedbar"
 ;; End:
 
-;; arch-tag: 56721fc9-8eb5-4115-8511-18cf8397ec87
 ;;; ede/speedbar.el ends here