aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/cedet/ede/cpp-root.el
diff options
context:
space:
mode:
authorStefan Monnier2015-02-04 13:49:49 -0500
committerStefan Monnier2015-02-04 13:49:49 -0500
commit73b17f7c2b723a0ad4ea04cf1a5a8be5bbdf6121 (patch)
treefc2ee663521960bf1c102bb98a72f31903e5110b /lisp/cedet/ede/cpp-root.el
parent102a21d68976ab9dc85304e0bc47b7562d3cf93f (diff)
downloademacs-73b17f7c2b723a0ad4ea04cf1a5a8be5bbdf6121.tar.gz
emacs-73b17f7c2b723a0ad4ea04cf1a5a8be5bbdf6121.zip
* lisp/cedet: Use cl-generic instead of EIEIO's defgeneric/defmethod
* lisp/cedet/**/*.el: Mechanically replace all calls to defmethod/defgeneric by calls to cl-defmethod/cl-defgeneric. * lisp/cedet/srecode/table.el: * lisp/cedet/srecode/fields.el: * lisp/cedet/srecode/dictionary.el: * lisp/cedet/srecode/compile.el: * lisp/cedet/semantic/debug.el: * lisp/cedet/semantic/db-ref.el: * lisp/cedet/ede/base.el: * lisp/cedet/ede/auto.el: * lisp/cedet/ede.el: Require `cl-generic'.
Diffstat (limited to 'lisp/cedet/ede/cpp-root.el')
-rw-r--r--lisp/cedet/ede/cpp-root.el38
1 files changed, 19 insertions, 19 deletions
diff --git a/lisp/cedet/ede/cpp-root.el b/lisp/cedet/ede/cpp-root.el
index e32066af89b..81c6737531a 100644
--- a/lisp/cedet/ede/cpp-root.el
+++ b/lisp/cedet/ede/cpp-root.el
@@ -276,11 +276,11 @@ Each directory needs a project file to control it.")
276;; find previous copies of this project, and make sure that one of the 276;; find previous copies of this project, and make sure that one of the
277;; objects is deleted. 277;; objects is deleted.
278 278
279(defmethod initialize-instance ((this ede-cpp-root-project) 279(cl-defmethod initialize-instance ((this ede-cpp-root-project)
280 &rest fields) 280 &rest fields)
281 "Make sure the :file is fully expanded." 281 "Make sure the :file is fully expanded."
282 ;; Add ourselves to the master list 282 ;; Add ourselves to the master list
283 (call-next-method) 283 (cl-call-next-method)
284 (let ((f (expand-file-name (oref this :file)))) 284 (let ((f (expand-file-name (oref this :file))))
285 ;; Remove any previous entries from the main list. 285 ;; Remove any previous entries from the main list.
286 (let ((old (eieio-instance-tracker-find (file-name-directory f) 286 (let ((old (eieio-instance-tracker-find (file-name-directory f)
@@ -311,7 +311,7 @@ Each directory needs a project file to control it.")
311;; This is a way to allow a subdirectory to point back to the root 311;; This is a way to allow a subdirectory to point back to the root
312;; project, simplifying authoring new single-point projects. 312;; project, simplifying authoring new single-point projects.
313 313
314(defmethod ede-find-subproject-for-directory ((proj ede-cpp-root-project) 314(cl-defmethod ede-find-subproject-for-directory ((proj ede-cpp-root-project)
315 dir) 315 dir)
316 "Return PROJ, for handling all subdirs below DIR." 316 "Return PROJ, for handling all subdirs below DIR."
317 proj) 317 proj)
@@ -321,7 +321,7 @@ Each directory needs a project file to control it.")
321;; Creating new targets on a per directory basis is a good way to keep 321;; Creating new targets on a per directory basis is a good way to keep
322;; files organized. See ede-emacs for an example with multiple file 322;; files organized. See ede-emacs for an example with multiple file
323;; types. 323;; types.
324(defmethod ede-find-target ((proj ede-cpp-root-project) buffer) 324(cl-defmethod ede-find-target ((proj ede-cpp-root-project) buffer)
325 "Find an EDE target in PROJ for BUFFER. 325 "Find an EDE target in PROJ for BUFFER.
326If one doesn't exist, create a new one for this directory." 326If one doesn't exist, create a new one for this directory."
327 (let* ((targets (oref proj targets)) 327 (let* ((targets (oref proj targets))
@@ -347,13 +347,13 @@ If one doesn't exist, create a new one for this directory."
347;; 347;;
348;; This tools also uses the ede-locate setup for augmented file name 348;; This tools also uses the ede-locate setup for augmented file name
349;; lookup using external tools. 349;; lookup using external tools.
350(defmethod ede-expand-filename-impl ((proj ede-cpp-root-project) name) 350(cl-defmethod ede-expand-filename-impl ((proj ede-cpp-root-project) name)
351 "Within this project PROJ, find the file NAME. 351 "Within this project PROJ, find the file NAME.
352This knows details about or source tree." 352This knows details about or source tree."
353 ;; The slow part of the original is looping over subprojects. 353 ;; The slow part of the original is looping over subprojects.
354 ;; This version has no subprojects, so this will handle some 354 ;; This version has no subprojects, so this will handle some
355 ;; basic cases. 355 ;; basic cases.
356 (let ((ans (call-next-method))) 356 (let ((ans (cl-call-next-method)))
357 (unless ans 357 (unless ans
358 (let* ((lf (oref proj locate-fcn)) 358 (let* ((lf (oref proj locate-fcn))
359 (dir (file-name-directory (oref proj file)))) 359 (dir (file-name-directory (oref proj file))))
@@ -372,16 +372,16 @@ This knows details about or source tree."
372 (setq ans tmp)) 372 (setq ans tmp))
373 (setq ip (cdr ip)) )) 373 (setq ip (cdr ip)) ))
374 ;; Else, do the usual. 374 ;; Else, do the usual.
375 (setq ans (call-next-method))) 375 (setq ans (cl-call-next-method)))
376 ))) 376 )))
377 ;; TODO - does this call-next-method happen twice. Is that bad?? Why is it here? 377 ;; TODO - does this call-next-method happen twice. Is that bad?? Why is it here?
378 (or ans (call-next-method)))) 378 (or ans (cl-call-next-method))))
379 379
380(defmethod ede-project-root ((this ede-cpp-root-project)) 380(cl-defmethod ede-project-root ((this ede-cpp-root-project))
381 "Return my root." 381 "Return my root."
382 this) 382 this)
383 383
384(defmethod ede-project-root-directory ((this ede-cpp-root-project)) 384(cl-defmethod ede-project-root-directory ((this ede-cpp-root-project))
385 "Return my root." 385 "Return my root."
386 (oref this directory)) 386 (oref this directory))
387 387
@@ -390,12 +390,12 @@ This knows details about or source tree."
390;; The following code is specific to setting up header files, 390;; The following code is specific to setting up header files,
391;; include lists, and Preprocessor symbol tables. 391;; include lists, and Preprocessor symbol tables.
392 392
393(defmethod ede-cpp-root-header-file-p ((proj ede-cpp-root-project) name) 393(cl-defmethod ede-cpp-root-header-file-p ((proj ede-cpp-root-project) name)
394 "Non nil if in PROJ the filename NAME is a header." 394 "Non nil if in PROJ the filename NAME is a header."
395 (save-match-data 395 (save-match-data
396 (string-match (oref proj header-match-regexp) name))) 396 (string-match (oref proj header-match-regexp) name)))
397 397
398(defmethod ede-cpp-root-translate-file ((proj ede-cpp-root-project) filename) 398(cl-defmethod ede-cpp-root-translate-file ((proj ede-cpp-root-project) filename)
399 "For PROJ, translate a user specified FILENAME. 399 "For PROJ, translate a user specified FILENAME.
400This is for project include paths and spp source files." 400This is for project include paths and spp source files."
401 ;; Step one: Root of this project. 401 ;; Step one: Root of this project.
@@ -411,11 +411,11 @@ This is for project include paths and spp source files."
411 411
412 filename)) 412 filename))
413 413
414(defmethod ede-system-include-path ((this ede-cpp-root-project)) 414(cl-defmethod ede-system-include-path ((this ede-cpp-root-project))
415 "Get the system include path used by project THIS." 415 "Get the system include path used by project THIS."
416 (oref this system-include-path)) 416 (oref this system-include-path))
417 417
418(defmethod ede-preprocessor-map ((this ede-cpp-root-project)) 418(cl-defmethod ede-preprocessor-map ((this ede-cpp-root-project))
419 "Get the pre-processor map for project THIS." 419 "Get the pre-processor map for project THIS."
420 (require 'semantic/db) 420 (require 'semantic/db)
421 (let ((spp (oref this spp-table)) 421 (let ((spp (oref this spp-table))
@@ -445,15 +445,15 @@ This is for project include paths and spp source files."
445 (oref this spp-files)) 445 (oref this spp-files))
446 spp)) 446 spp))
447 447
448(defmethod ede-system-include-path ((this ede-cpp-root-target)) 448(cl-defmethod ede-system-include-path ((this ede-cpp-root-target))
449 "Get the system include path used by target THIS." 449 "Get the system include path used by target THIS."
450 (ede-system-include-path (ede-target-parent this))) 450 (ede-system-include-path (ede-target-parent this)))
451 451
452(defmethod ede-preprocessor-map ((this ede-cpp-root-target)) 452(cl-defmethod ede-preprocessor-map ((this ede-cpp-root-target))
453 "Get the pre-processor map for project THIS." 453 "Get the pre-processor map for project THIS."
454 (ede-preprocessor-map (ede-target-parent this))) 454 (ede-preprocessor-map (ede-target-parent this)))
455 455
456(defmethod project-compile-project ((proj ede-cpp-root-project) &optional command) 456(cl-defmethod project-compile-project ((proj ede-cpp-root-project) &optional command)
457 "Compile the entire current project PROJ. 457 "Compile the entire current project PROJ.
458Argument COMMAND is the command to use when compiling." 458Argument COMMAND is the command to use when compiling."
459 ;; we need to be in the proj root dir for this to work 459 ;; we need to be in the proj root dir for this to work
@@ -469,14 +469,14 @@ Argument COMMAND is the command to use when compiling."
469 (let ((default-directory (ede-project-root-directory proj))) 469 (let ((default-directory (ede-project-root-directory proj)))
470 (compile cmd-str))))) 470 (compile cmd-str)))))
471 471
472(defmethod project-compile-target ((obj ede-cpp-root-target) &optional command) 472(cl-defmethod project-compile-target ((obj ede-cpp-root-target) &optional command)
473 "Compile the current target OBJ. 473 "Compile the current target OBJ.
474Argument COMMAND is the command to use for compiling the target." 474Argument COMMAND is the command to use for compiling the target."
475 (when (oref obj :project) 475 (when (oref obj :project)
476 (project-compile-project (oref obj :project) command))) 476 (project-compile-project (oref obj :project) command)))
477 477
478 478
479(defmethod project-rescan ((this ede-cpp-root-project)) 479(cl-defmethod project-rescan ((this ede-cpp-root-project))
480 "Don't rescan this project from the sources." 480 "Don't rescan this project from the sources."
481 (message "cpp-root has nothing to rescan.")) 481 (message "cpp-root has nothing to rescan."))
482 482