X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/11fdef7d0cf3ef1ce30d1cd09ca9ca9a2b099d20..118a31a3b1eb08cba14887c3134054e9b4383688:/lisp/cedet/srecode/map.el diff --git a/lisp/cedet/srecode/map.el b/lisp/cedet/srecode/map.el index 126f41eb7f..71ed835e4f 100644 --- a/lisp/cedet/srecode/map.el +++ b/lisp/cedet/srecode/map.el @@ -1,6 +1,6 @@ ;;; srecode/map.el --- Manage a template file map -;; Copyright (C) 2008-2011 Free Software Foundation, Inc. +;; Copyright (C) 2008-2015 Free Software Foundation, Inc. ;; Author: Eric M. Ludlam @@ -67,11 +67,11 @@ Each app keys to an alist of files and modes (as above.)") ) "A map of srecode templates.") -(defmethod srecode-map-entry-for-file ((map srecode-map) file) +(cl-defmethod srecode-map-entry-for-file ((map srecode-map) file) "Return the entry in MAP for FILE." (assoc file (oref map files))) -(defmethod srecode-map-entries-for-mode ((map srecode-map) mode) +(cl-defmethod srecode-map-entries-for-mode ((map srecode-map) mode) "Return the entries in MAP for major MODE." (let ((ans nil)) (dolist (f (oref map files)) @@ -79,12 +79,12 @@ Each app keys to an alist of files and modes (as above.)") (setq ans (cons f ans)))) ans)) -(defmethod srecode-map-entry-for-app ((map srecode-map) app) - "Return the entry in MAP for APP'lication." +(cl-defmethod srecode-map-entry-for-app ((map srecode-map) app) + "Return the entry in MAP for APP." (assoc app (oref map apps)) ) -(defmethod srecode-map-entries-for-app-and-mode ((map srecode-map) app mode) +(cl-defmethod srecode-map-entries-for-app-and-mode ((map srecode-map) app mode) "Return the entries in MAP for major MODE." (let ((ans nil) (appentry (srecode-map-entry-for-app map app))) @@ -93,7 +93,7 @@ Each app keys to an alist of files and modes (as above.)") (setq ans (cons f ans)))) ans)) -(defmethod srecode-map-entry-for-file-anywhere ((map srecode-map) file) +(cl-defmethod srecode-map-entry-for-file-anywhere ((map srecode-map) file) "Search in all entry points in MAP for FILE. Return a list ( APP . FILE-ASSOC ) where APP is nil in the global map." @@ -112,13 +112,13 @@ in the global map." ;; Other? )) -(defmethod srecode-map-delete-file-entry ((map srecode-map) file) +(cl-defmethod srecode-map-delete-file-entry ((map srecode-map) file) "Update MAP to exclude FILE from the file list." (let ((entry (srecode-map-entry-for-file map file))) (when entry (object-remove-from-list map 'files entry)))) -(defmethod srecode-map-update-file-entry ((map srecode-map) file mode) +(cl-defmethod srecode-map-update-file-entry ((map srecode-map) file mode) "Update a MAP entry for FILE to be used with MODE. Return non-nil if the MAP was changed." (let ((entry (srecode-map-entry-for-file map file)) @@ -136,14 +136,14 @@ Return non-nil if the MAP was changed." )) dirty)) -(defmethod srecode-map-delete-file-entry-from-app ((map srecode-map) file app) - "Delete from MAP the FILE entry within the APP'lication." +(cl-defmethod srecode-map-delete-file-entry-from-app ((map srecode-map) file app) + "Delete from MAP the FILE entry within the APP." (let* ((appe (srecode-map-entry-for-app map app)) (fentry (assoc file (cdr appe)))) (setcdr appe (delete fentry (cdr appe)))) ) -(defmethod srecode-map-update-app-file-entry ((map srecode-map) file mode app) +(cl-defmethod srecode-map-update-app-file-entry ((map srecode-map) file mode app) "Update the MAP entry for FILE to be used with MODE within APP. Return non-nil if the map was changed." (let* ((appentry (srecode-map-entry-for-app map app)) @@ -215,7 +215,8 @@ Optional argument RESET forces a reset of the current map." ;; Eventually, I want to return many maps to search through. (list srecode-current-map))) -(eval-when-compile (require 'data-debug)) +(declare-function data-debug-new-buffer "data-debug") +(declare-function data-debug-insert-stuff-list "data-debug") (defun srecode-adebug-maps () "Run ADEBUG on the output of `srecode-get-maps'." @@ -297,7 +298,7 @@ if that file is NEW, otherwise assume the mode has not changed." (when (not srecode-current-map) (condition-case nil (setq srecode-current-map - (eieio-persistent-read srecode-map-save-file)) + (eieio-persistent-read srecode-map-save-file 'srecode-map)) (error ;; There was an error loading the old map. Create a new one. (setq srecode-current-map @@ -362,6 +363,9 @@ Return non-nil if the map changed." (let ((semantic-init-hook nil)) (semantic-new-buffer-fcn)) ) + ;; Force semantic to be enabled in this buffer. + (unless (semantic-active-p) + (semantic-new-buffer-fcn)) (semantic-fetch-tags) (let* ((mode-tag