Replace (oref OBJECT :SLOT) with (slot-value OBJECT 'SLOT).
TODO: ChangeLog
The other slot will be used to calculate values.
PROJECT-FILE-NAME is a name of project file (short name, like `pom.xml', etc."
(when (and (or (not (slot-boundp this :file))
- (not (oref this :file)))
+ (not (slot-value this 'file)))
(slot-boundp this :directory)
- (oref this :directory))
- (oset this :file (expand-file-name project-file-name (oref this :directory))))
+ (slot-value this 'directory))
+ (oset this :file (expand-file-name project-file-name (slot-value this 'directory))))
(when (and (or (not (slot-boundp this :directory))
- (not (oref this :directory)))
+ (not (slot-value this 'directory)))
(slot-boundp this :file)
- (oref this :file))
- (oset this :directory (file-name-directory (oref this :file))))
+ (slot-value this 'file))
+ (oset this :directory (file-name-directory (slot-value this 'file))))
)
(setq config nil))
(when (not config)
- (let* ((top (oref proj :directory))
+ (let* ((top (slot-value proj 'directory))
(fname (expand-file-name (oref proj config-file-basename) top))
(class (oref proj config-class))
(ignore-type nil))
"Run the current project derived from TARGET in a debugger."
(let* ((proj (ede-target-parent target))
(config (ede-config-get-configuration proj t))
- (debug (oref config :debug-command))
+ (debug (slot-value config 'debug-command))
(cmd (read-from-minibuffer
"Debug Command: "
debug))
"Run the current project derived from TARGET."
(let* ((proj (ede-target-parent target))
(config (ede-config-get-configuration proj t))
- (run (concat "./" (oref config :run-command)))
+ (run (concat "./" (slot-value config 'run-command)))
(cmd (read-from-minibuffer "Run (like this): " run)))
(ede-shell-run-something target cmd)))
"Compile the entire current project PROJ.
Argument COMMAND is the command to use when compiling."
(let* ((config (ede-config-get-configuration proj t))
- (comp (oref config :build-command)))
+ (comp (slot-value config 'build-command)))
(compile comp)))
(cl-defmethod project-compile-target ((obj ede-target-with-config-build) &optional command)
filemap
)
;; Preprocessor files
- (dolist (G (oref config :c-preprocessor-files))
+ (dolist (G (slot-value config 'c-preprocessor-files))
(let ((table (semanticdb-file-table-object
(ede-expand-filename root G))))
(when table
(setq filemap (append filemap (oref table lexical-table)))
)))
;; The core table
- (setq filemap (append filemap (oref config :c-preprocessor-table)))
+ (setq filemap (append filemap (slot-value config 'c-preprocessor-table)))
filemap
))
(cl-defmethod ede-java-classpath ((proj ede-project-with-config-java))
"Return the classpath for this project."
- (oref (ede-config-get-configuration proj) :classpath))
+ (slot-value (ede-config-get-configuration proj) 'classpath))
;; Local variables:
;; generated-autoload-file: "loaddefs.el"
"Make sure the :file is fully expanded."
;; Add ourselves to the master list
(cl-call-next-method)
- (let ((f (expand-file-name (oref this :file))))
+ (let ((f (expand-file-name (slot-value this 'file))))
;; Remove any previous entries from the main list.
(let ((old (eieio-instance-tracker-find (file-name-directory f)
:directory 'ede-cpp-root-project-list)))
"Compile the entire current project PROJ.
Argument COMMAND is the command to use when compiling."
;; we need to be in the proj root dir for this to work
- (let* ((cmd (oref proj :compile-command))
- (ov (oref proj :local-variables))
+ (let* ((cmd (slot-value proj 'compile-command))
+ (ov (slot-value proj 'local-variables))
(lcmd (when ov (cdr (assoc 'compile-command ov))))
(cmd-str (cond
((stringp cmd) cmd)
(cl-defmethod project-compile-target ((obj ede-cpp-root-target) &optional command)
"Compile the current target OBJ.
Argument COMMAND is the command to use for compiling the target."
- (when (oref obj :project)
- (project-compile-project (oref obj :project) command)))
+ (when (slot-value obj 'project)
+ (project-compile-project (slot-value obj 'project) command)))
(cl-defmethod project-rescan ((this ede-cpp-root-project))
(interactive)
(let ((scanned nil))
(dolist (P ede-projects)
- (if (member (oref P :directory) scanned)
- (error "Duplicate project (by dir) found in %s!" (oref P :directory))
- (push (oref P :directory) scanned)))
+ (if (member (slot-value P 'directory) scanned)
+ (error "Duplicate project (by dir) found in %s!" (slot-value P 'directory))
+ (push (slot-value P 'directory) scanned)))
(unless ede--disable-inode
(setq scanned nil)
(dolist (P ede-projects)
"Get the inode of the directory project PROJ is in."
(if (slot-boundp proj 'dirinode)
(oref proj dirinode)
- (oset proj dirinode (ede--inode-for-dir (oref proj :directory)))))
+ (oset proj dirinode (ede--inode-for-dir (slot-value proj 'directory)))))
(defun ede--inode-get-toplevel-open-project (inode)
"Return an already open toplevel project that is managing INODE.
(when rootreturn (set rootreturn proj))
;; Find subprojects.
(when (and proj (if ede--disable-inode
- (not (string= ft (expand-file-name (oref proj :directory))))
+ (not (string= ft (expand-file-name (slot-value proj 'directory))))
(not (equal inode (ede--project-inode proj)))))
(setq ans (ede-find-subproject-for-directory proj ft)))
ans))
(shortans nil))
(while (and all (not ans))
;; Do the check.
- (let ((pd (expand-file-name (oref (car all) :directory)))
+ (let ((pd (expand-file-name (slot-value (car all) 'directory)))
)
(cond
;; Exact text match.
(setq shortans (car all))
;; We already have a short answer, so see if pd (the match we found)
;; is longer. If it is longer, then it is more precise.
- (when (< (length (oref shortans :directory))
+ (when (< (length (slot-value shortans 'directory))
(length pd))
(setq shortans (car all))))
)
(setq shortans (car all))
;; We already have a short answer, so see if pd (the match we found)
;; is longer. If it is longer, then it is more precise.
- (when (< (length (expand-file-name (oref shortans :directory)))
+ (when (< (length (expand-file-name (slot-value shortans 'directory)))
(length pd))
(setq shortans (car all))))
)))
proj
(lambda (SP)
(when (not ans)
- (if (string= fulldir (file-truename (oref SP :directory)))
+ (if (string= fulldir (file-truename (slot-value SP 'directory)))
(setq ans SP)
(ede-find-subproject-for-directory SP dir)))))
ans)
((and (string= dir default-directory)
ede-object-root-project)
;; Try the local buffer cache first.
- (oref ede-object-root-project :directory))
+ (slot-value ede-object-root-project 'directory))
;; See if there is an existing project in DIR.
((setq ans (ede-directory-get-toplevel-open-project dir))
- (oref ans :directory))
+ (slot-value ans 'directory))
;; Detect using our file system detector.
((setq ans (ede-detect-directory-for-project dir))
(mapc (lambda (sp)
(let* ((subdir (file-name-as-directory
(expand-file-name
- sp (file-name-directory (oref this :file)))))
+ sp (file-name-directory (slot-value this 'file)))))
(submake (expand-file-name
"Makefile.am"
subdir)))
- (if (string= submake (oref this :file))
+ (if (string= submake (slot-value this 'file))
nil ;; don't recurse.. please!
;; For each project id found, see if we need to recycle,
;; and if we do not, then make a new one. Check the deep
(cl-defmethod project-rescan ((this project-am-program))
"Rescan object THIS."
(oset this :source (makefile-macro-file-list (project-am-macro this)))
- (unless (oref this :source)
- (oset this :source (list (concat (oref this :name) ".c"))))
+ (unless (slot-value this 'source)
+ (oset this :source (list (concat (slot-value this 'name) ".c"))))
(oset this :ldadd (makefile-macro-file-list
- (concat (oref this :name) "_LDADD"))))
+ (concat (slot-value this 'name) "_LDADD"))))
(cl-defmethod project-rescan ((this project-am-lib))
"Rescan object THIS."
(oset this :source (makefile-macro-file-list (project-am-macro this)))
- (unless (oref this :source)
- (oset this :source (list (concat (file-name-sans-extension (oref this :name)) ".c")))))
+ (unless (slot-value this 'source)
+ (oset this :source (list (concat (file-name-sans-extension (slot-value this 'name)) ".c")))))
(cl-defmethod project-rescan ((this project-am-texinfo))
"Rescan object THIS."
(cl-defmethod project-am-macro ((this project-am-objectcode))
"Return the default macro to `edit' for this object type."
- (concat (subst-char-in-string ?- ?_ (oref this :name)) "_SOURCES"))
+ (concat (subst-char-in-string ?- ?_ (slot-value this 'name)) "_SOURCES"))
(cl-defmethod project-am-macro ((this project-am-header-noinst))
"Return the default macro to `edit' for this object."
(cl-defmethod project-am-macro ((this project-am-texinfo))
"Return the default macro to `edit' for this object type."
- (concat (file-name-sans-extension (oref this :name)) "_TEXINFOS"))
+ (concat (file-name-sans-extension (slot-value this 'name)) "_TEXINFOS"))
(cl-defmethod project-am-macro ((this project-am-man))
"Return the default macro to `edit' for this object type."
- (oref this :name))
+ (slot-value this 'name))
(cl-defmethod project-am-macro ((this project-am-lisp))
"Return the default macro to `edit' for this object."
(cl-defmethod ede-buffer-mine ((this project-am-makefile) buffer)
"Return t if object THIS lays claim to the file in BUFFER."
(let ((efn (expand-file-name (buffer-file-name buffer))))
- (or (string= (oref this :file) efn)
+ (or (string= (slot-value this 'file) efn)
(string-match "/configure\\.ac$" efn)
(string-match "/configure\\.in$" efn)
(string-match "/configure$" efn)
(cl-defmethod ede-buffer-mine ((this project-am-objectcode) buffer)
"Return t if object THIS lays claim to the file in BUFFER."
- (member (file-relative-name (buffer-file-name buffer) (oref this :path))
- (oref this :source)))
+ (member (file-relative-name (buffer-file-name buffer) (slot-value this 'path))
+ (slot-value this 'source)))
(cl-defmethod ede-buffer-mine ((this project-am-texinfo) buffer)
"Return t if object THIS lays claim to the file in BUFFER."
(let ((bfn (file-relative-name (buffer-file-name buffer)
- (oref this :path))))
- (or (string= (oref this :name) bfn)
- (member bfn (oref this :include)))))
+ (slot-value this 'path))))
+ (or (string= (slot-value this 'name) bfn)
+ (member bfn (slot-value this 'include)))))
(cl-defmethod ede-buffer-mine ((this project-am-man) buffer)
"Return t if object THIS lays claim to the file in BUFFER."
- (string= (oref this :name)
- (file-relative-name (buffer-file-name buffer) (oref this :path))))
+ (string= (slot-value this 'name)
+ (file-relative-name (buffer-file-name buffer) (slot-value this 'path))))
(cl-defmethod ede-buffer-mine ((this project-am-lisp) buffer)
"Return t if object THIS lays claim to the file in BUFFER."
- (member (file-relative-name (buffer-file-name buffer) (oref this :path))
- (oref this :source)))
+ (member (file-relative-name (buffer-file-name buffer) (slot-value this 'path))
+ (slot-value this 'source)))
(cl-defmethod project-am-subtree ((ampf project-am-makefile) subdir)
"Return the sub project in AMPF specified by SUBDIR."
(cl-defmethod project-compile-target-command ((this project-am-objectcode))
"Default target to use when compiling an object code target."
- (oref this :name))
+ (slot-value this 'name))
(cl-defmethod project-compile-target-command ((this project-am-texinfo))
"Default target t- use when compiling a texinfo file."
- (let ((n (oref this :name)))
+ (let ((n (slot-value this 'name)))
(if (string-match "\\.texi?\\(nfo\\)?" n)
(setq n (replace-match ".info" t t n)))
n))
"Get the package information for directory topmost project dir over DIR.
Calculates the info with `project-am-extract-package-info'."
(let ((top (ede-toplevel)))
- (when top (setq dir (oref top :directory)))
+ (when top (setq dir (slot-value top 'directory)))
(project-am-extract-package-info dir)))
;; for simple per project include path extension
COMMAND is a text string representing the thing to be run."
(let* ((buff (ede-shell-buffer target))
(cp (ede-target-parent target))
- (dd (oref cp :directory)))
+ (dd (slot-value cp 'directory)))
;; Show the new buffer.
(when (not (get-buffer-window buff))
(switch-to-buffer-other-window buff t))
v nil v))))
(let ((ede-object (ede-toplevel)))
;; Don't update anything if there was no change.
- (unless (string= (oref ede-object :version) newversion)
+ (unless (string= (slot-value ede-object 'version) newversion)
(oset ede-object :version newversion)
(project-update-version ede-object)
(ede-update-version-in-source ede-object newversion))))
(cl-defmethod semantic-analyze-interesting-tag
((context semantic-analyze-context))
"Return a tag from CONTEXT that would be most interesting to a user."
- (let ((prefix (reverse (oref context :prefix))))
+ (let ((prefix (reverse (slot-value context 'prefix))))
;; Go back through the prefix until we find a tag we can return.
(while (and prefix (not (semantic-tag-p (car prefix))))
(setq prefix (cdr prefix)))
(cl-defmethod semantic-analyze-interesting-tag
((context semantic-analyze-context-functionarg))
"Try the base, and if that fails, return what we are assigning into."
- (or (cl-call-next-method) (car-safe (oref context :function))))
+ (or (cl-call-next-method) (car-safe (slot-value context 'function))))
(cl-defmethod semantic-analyze-interesting-tag
((context semantic-analyze-context-assignment))
"Try the base, and if that fails, return what we are assigning into."
- (or (cl-call-next-method) (car-safe (oref context :assignee))))
+ (or (cl-call-next-method) (car-safe (slot-value context 'assignee))))
;;; TYPE MEMBERS
;;
(cl-defmethod semantic-analyze-pulse ((context semantic-analyze-context))
"Pulse the region that CONTEXT affects."
(require 'pulse)
- (with-current-buffer (oref context :buffer)
- (let ((bounds (oref context :bounds)))
+ (with-current-buffer (slot-value context 'buffer)
+ (let ((bounds (slot-value context 'bounds)))
(when bounds
(pulse-momentary-highlight-region (car bounds) (cdr bounds))))))
(defun semantic-analyzer-debug-describe-scope (ctxt &optional classconstraint)
"Describe the scope in CTXT for finding a global symbol.
Optional argument CLASSCONSTRAINT says to output to tags of that class."
- (let* ((scope (oref ctxt :scope))
+ (let* ((scope (slot-value ctxt 'scope))
(parents (oref scope parents))
(cc (or classconstraint (oref ctxt prefixclass)))
)
"Return the implementations derived in the reference analyzer REFS.
Optional argument IN-BUFFER indicates that the returned tag should be in an active buffer."
(let ((allhits (oref refs rawsearchdata))
- (tag (oref refs :tag))
+ (tag (slot-value refs 'tag))
(impl nil)
)
(semanticdb-find-result-mapc
"Return the prototypes derived in the reference analyzer REFS.
Optional argument IN-BUFFER indicates that the returned tag should be in an active buffer."
(let ((allhits (oref refs rawsearchdata))
- (tag (oref refs :tag))
+ (tag (slot-value refs 'tag))
(proto nil))
(semanticdb-find-result-mapc
(lambda (T DB)
(require 'semantic/analyze/complete)
(with-current-buffer (oref context buffer)
(let* ((normal (semantic-analyze-possible-completions-default context))
- (classes (oref context :prefixclass))
+ (classes (slot-value context 'prefixclass))
(filetags nil))
(when (memq 'filename classes)
- (let* ((prefix (car (oref context :prefix)))
+ (let* ((prefix (car (slot-value context 'prefix)))
(completetext (cond ((semantic-tag-p prefix)
(semantic-tag-name prefix))
((stringp prefix)
(localstuff (oref scope scope)))
(list
(cons
- (oref scope :table)
+ (slot-value scope 'table)
(semantic-find-tags-for-completion prefix localstuff)))))
;(semanticdb-brute-deep-find-tags-for-completion prefix (oref obj path))))
(faketags nil)
)
(when result
- (dolist (T (oref result :hit-text))
+ (dolist (T (slot-value result 'hit-text))
;; We should look up each tag one at a time, but I'm lazy!
;; Doing this may be good enough.
(setq faketags (cons
(stream nil)
)
(dolist (table (semanticdb-get-database-tables db))
- (when (eq lmode (oref table :major-mode))
+ (when (eq lmode (slot-value table 'major-mode))
(setq stream
(semanticdb-typecache-merge-streams
stream
(cl-defmethod semantic-debug-highlight-lexical-token ((iface semantic-debug-interface) token)
"For IFACE, highlight TOKEN in the source buffer .
TOKEN is a lexical token."
- (set-buffer (oref iface :source-buffer))
+ (set-buffer (slot-value iface 'source-buffer))
(object-add-to-list iface 'overlays
(semantic-lex-highlight-token token))
NONTERM is the name of the rule currently being processed that shows up
as a nonterminal (or tag) in the source buffer.
If RULE and MATCH indices are specified, highlight those also."
- (set-buffer (oref iface :parser-buffer))
+ (set-buffer (slot-value iface 'parser-buffer))
(let* ((rules (semantic-find-tags-by-class 'nonterminal (current-buffer)))
(nt (semantic-find-first-tag-by-name nonterm rules))
;; Get the semanticdb statement, and display it's contents.
(princ "\nDetails for header file...\n")
(princ "\nMajor Mode: ")
- (princ (oref table :major-mode))
+ (princ (slot-value table 'major-mode))
(princ "\nTags: ")
- (princ (format "%s entries" (length (oref table :tags))))
+ (princ (format "%s entries" (length (slot-value table 'tags))))
(princ "\nFile Size: ")
- (princ (format "%s chars" (oref table :pointmax)))
+ (princ (format "%s chars" (slot-value table 'pointmax)))
(princ "\nSave State: ")
(cond ((oref table dirty)
(princ "Table needs to be saved."))
(with-mode-local emacs-lisp-mode
(semantic-analyze-possible-completions context))
(with-current-buffer (oref context buffer)
- (let* ((prefix (car (reverse (oref context :prefix))))
+ (let* ((prefix (car (reverse (slot-value context 'prefix))))
(completetext (cond ((semantic-tag-p prefix)
(semantic-tag-name prefix))
((stringp prefix)
(al nil))
(while (< idx len)
(let ((r (ring-ref ring idx)))
- (setq al (cons (cons (oref r :object-name) r)
+ (setq al (cons (cons (slot-value r 'object-name) r)
al)))
(setq idx (1+ idx)))
(nreverse al)))
default-directory))
;; CScope has to be run from the project root where
;; cscope.out is.
- (b (cedet-cscope-search (oref tool :searchfor)
- (oref tool :searchtype)
- (oref tool :resulttype)
- (oref tool :searchscope)
+ (b (cedet-cscope-search (slot-value tool 'searchfor)
+ (slot-value tool 'searchtype)
+ (slot-value tool 'resulttype)
+ (slot-value tool 'searchscope)
))
)
(semantic-symref-parse-tool-output tool b)
(cl-defmethod semantic-symref-parse-tool-output-one-line ((tool semantic-symref-tool-cscope))
"Parse one line of grep output, and return it as a match list.
Moves cursor to end of the match."
- (cond ((eq (oref tool :resulttype) 'file)
+ (cond ((eq (slot-value tool 'resulttype) 'file)
;; Search for files
(when (re-search-forward "^\\([^\n]+\\)$" nil t)
(match-string 1)))
- ((eq (oref tool :searchtype) 'tagcompletions)
+ ((eq (slot-value tool 'searchtype) 'tagcompletions)
;; Search for files
(when (re-search-forward "^[^ ]+ [^ ]+ [^ ]+ \\(.*\\)$" nil t)
(let ((subtxt (match-string 1))
- (searchtxt (oref tool :searchfor)))
+ (searchtxt (slot-value tool 'searchfor)))
(if (string-match (concat "\\<" searchtxt "\\(\\w\\|\\s_\\)*\\>")
subtxt)
(match-string 0 subtxt)
;; We have to return something at this point.
subtxt)))
)
- ((eq (oref tool :resulttype) 'line-and-text)
+ ((eq (slot-value tool 'resulttype) 'line-and-text)
(when (re-search-forward semantic-symref-cscope--line-re nil t)
(list (string-to-number (match-string 2))
(expand-file-name (match-string 1))
(cl-defmethod semantic-symref-perform-search ((tool semantic-symref-tool-global))
"Perform a search with GNU Global."
- (let ((b (cedet-gnu-global-search (oref tool :searchfor)
- (oref tool :searchtype)
- (oref tool :resulttype)
- (oref tool :searchscope)
+ (let ((b (cedet-gnu-global-search (slot-value tool 'searchfor)
+ (slot-value tool 'searchtype)
+ (slot-value tool 'resulttype)
+ (slot-value tool 'searchscope)
))
)
(semantic-symref-parse-tool-output tool b)
(cl-defmethod semantic-symref-parse-tool-output-one-line ((tool semantic-symref-tool-global))
"Parse one line of grep output, and return it as a match list.
Moves cursor to end of the match."
- (cond ((or (eq (oref tool :resulttype) 'file)
- (eq (oref tool :searchtype) 'tagcompletions))
+ (cond ((or (eq (slot-value tool 'resulttype) 'file)
+ (eq (slot-value tool 'searchtype) 'tagcompletions))
;; Search for files
(when (re-search-forward "^\\([^\n]+\\)$" nil t)
(match-string 1)))
- ((eq (oref tool :resulttype) 'line-and-text)
+ ((eq (slot-value tool 'resulttype) 'line-and-text)
(when (re-search-forward semantic-symref-global--line-re nil t)
(list (string-to-number (match-string 2))
(match-string 3)
(cl-defmethod semantic-symref-perform-search ((tool semantic-symref-tool-grep))
"Perform a search with Grep."
;; Grep doesn't support some types of searches.
- (let ((st (oref tool :searchtype)))
+ (let ((st (slot-value tool 'searchtype)))
(when (not (memq st '(symbol regexp)))
(error "Symref impl GREP does not support searchtype of %s" st))
)
(filepatterns (semantic-symref-derive-find-filepatterns))
(filepattern (mapconcat #'shell-quote-argument filepatterns " "))
;; Grep based flags.
- (grepflags (cond ((eq (oref tool :resulttype) 'file)
+ (grepflags (cond ((eq (slot-value tool 'resulttype) 'file)
"-l ")
- ((eq (oref tool :searchtype) 'regexp)
+ ((eq (slot-value tool 'searchtype) 'regexp)
"-nE ")
(t "-n ")))
(greppat (shell-quote-argument
- (cond ((eq (oref tool :searchtype) 'regexp)
+ (cond ((eq (slot-value tool 'searchtype) 'regexp)
(oref tool searchfor))
(t
;; Can't use the word boundaries: Grep
(cl-defmethod semantic-symref-parse-tool-output-one-line ((tool semantic-symref-tool-grep))
"Parse one line of grep output, and return it as a match list.
Moves cursor to end of the match."
- (cond ((eq (oref tool :resulttype) 'file)
+ (cond ((eq (slot-value tool 'resulttype) 'file)
;; Search for files
(when (re-search-forward "^\\([^\n]+\\)$" nil t)
(match-string 1)))
- ((eq (oref tool :resulttype) 'line-and-text)
+ ((eq (slot-value tool 'resulttype) 'line-and-text)
(when (re-search-forward semantic-symref-grep--line-re nil t)
(list (string-to-number (match-string 2))
(match-string 1)
(cl-defmethod semantic-symref-perform-search ((tool semantic-symref-tool-idutils))
"Perform a search with IDUtils."
- (let ((b (cedet-idutils-search (oref tool :searchfor)
- (oref tool :searchtype)
- (oref tool :resulttype)
- (oref tool :searchscope)
+ (let ((b (cedet-idutils-search (slot-value tool 'searchfor)
+ (slot-value tool 'searchtype)
+ (slot-value tool 'resulttype)
+ (slot-value tool 'searchscope)
))
)
(semantic-symref-parse-tool-output tool b)
(cl-defmethod semantic-symref-parse-tool-output-one-line ((tool semantic-symref-tool-idutils))
"Parse one line of grep output, and return it as a match list.
Moves cursor to end of the match."
- (cond ((eq (oref tool :resulttype) 'file)
+ (cond ((eq (slot-value tool 'resulttype) 'file)
;; Search for files
(when (re-search-forward "^\\([^\n]+\\)$" nil t)
(match-string 1)))
- ((eq (oref tool :searchtype) 'tagcompletions)
+ ((eq (slot-value tool 'searchtype) 'tagcompletions)
(when (re-search-forward "^\\([^ ]+\\) " nil t)
(match-string 1)))
- ((eq (oref tool :resulttype) 'line-and-text)
+ ((eq (slot-value tool 'resulttype) 'line-and-text)
(when (re-search-forward semantic-symref-idutils--line-re nil t)
(list (string-to-number (match-string 2))
(expand-file-name (match-string 1) default-directory)
(erase-buffer)
;; Insert the contents.
(let ((lastfile nil))
- (dolist (T (oref results :hit-tags))
+ (dolist (T (slot-value results 'hit-tags))
(unless (equal lastfile (semantic-tag-file-name T))
(setq lastfile (semantic-tag-file-name T))
(insert-button lastfile
do primitive texinfo built ins. If not, use ispell to lookup words
that start with that symbol.
Any extra FLAGS are currently ignored."
- (let ((prefix (car (oref context :prefix)))
+ (let ((prefix (car (slot-value context 'prefix)))
)
- (cond ((member 'function (oref context :prefixclass))
+ (cond ((member 'function (slot-value context 'prefixclass))
;; Do completion for texinfo commands
(let* ((cmd (substring prefix 1))
(lst (all-completions
(mapcar (lambda (f) (semantic-tag (concat "@" f) 'function))
lst))
)
- ((member 'word (oref context :prefixclass))
+ ((member 'word (slot-value context 'prefixclass))
;; Do completion for words via ispell.
(require 'ispell)
(let ((word-list (ispell-lookup-words prefix)))
(srecode-dictionary-set-value dict "PROJECT_FILENAME" relfname)
(srecode-dictionary-set-value dict "PROJECT_DIRECTORY" reldir)
(srecode-dictionary-set-value dict "PROJECT_NAME" (ede-name (ede-toplevel)))
- (srecode-dictionary-set-value dict "PROJECT_VERSION" (oref (ede-toplevel) :version))
+ (srecode-dictionary-set-value dict "PROJECT_VERSION" (slot-value (ede-toplevel) 'version))
)
;; If there is no EDE project, then put in some base values.
(srecode-dictionary-set-value dict "PROJECT_FILENAME" bfn)
(while lp
- (let* ((objname (oref (car lp) :object-name))
- (context (oref (car lp) :context))
+ (let* ((objname (slot-value (car lp) 'object-name))
+ (context (slot-value (car lp) 'context))
(globalname (concat context ":" objname))
)
"Dump the state of the SRecode template inserter INS."
(princ "INS: \"")
(princ (eieio-object-name-string ins))
- (when (oref ins :secondname)
+ (when (slot-value ins 'secondname)
(princ "\" : \"")
- (princ (oref ins :secondname)))
+ (princ (slot-value ins 'secondname)))
(princ "\" type \"")
(let* ((oc (symbol-name (eieio-object-class ins)))
(junk (string-match "srecode-template-inserter-" oc))
(srecode-semantic-apply-tag-to-dict-default tag-wrapper dict)
;; Pull out the tag for the individual pieces.
- (let* ((tag (oref tag-wrapper :prime))
+ (let* ((tag (slot-value tag-wrapper 'prime))
(class (semantic-tag-class tag)))
;; Add additional information based on the class of the tag.
(cl-call-next-method this (nreverse newfields))
(when (not (slot-boundp this 'compiled))
- (let ((val (oref this :value))
+ (let ((val (slot-value this 'value))
(comp nil))
(while val
(let ((nval (car val))
;; Tables are sorted with highest priority first, useful for looking
;; up templates, but this means we need to install the variables in
;; reverse order so higher priority variables override lower ones.
- (let ((tabs (reverse (oref tpl :tables))))
+ (let ((tabs (reverse (slot-value tpl 'tables))))
(require 'srecode/find) ; For srecode-template-table-in-project-p
(while tabs
(when (srecode-template-table-in-project-p (car tabs))
(let* ((dv (oref cp defaultvalue))
(sti (oref cp firstinserter))
(start (point))
- (name (oref sti :object-name)))
+ (name (slot-value sti 'object-name)))
(cond
;; No default value.
(srecode-semantic-apply-tag-to-dict-default tagobj dict)
;; Pull out the tag for the individual pieces.
- (let* ((tag (oref tagobj :prime))
+ (let* ((tag (slot-value tagobj 'prime))
(doc (semantic-tag-docstring tag)))
;; It is much more common to have doc on ELisp.
Return t if something was extracted.
Return nil if this inserter doesn't need to extract anything."
(srecode-dictionary-set-value vdict
- (oref ins :object-name)
+ (slot-value ins 'object-name)
(buffer-substring-no-properties
start end)
)
"Extract text from START/END and store in INDICT.
Return the starting location of the first plain-text match.
Return nil if nothing was extracted."
- (let ((name (oref ins :object-name))
+ (let ((name (slot-value ins 'object-name))
(subdict (srecode-create-dictionary indict))
(allsubdict nil)
)
;; There are two modes for includes. One is with no dict,
;; so it is inserted straight. If the dict has a name, then
;; we need to run once per dictionary occurrence.
- (if (not (string= (oref ins :object-name) ""))
+ (if (not (string= (slot-value ins 'object-name) ""))
;; With a name, do the insertion.
(let ((subdict (srecode-dictionary-add-section-dictionary
- dict (oref ins :object-name))))
+ dict (slot-value ins 'object-name))))
(error "Need to implement include w/ name extractor")
;; Recurse into the new template while no errors.
(while (condition-case nil
"Return non-nil if the table TAB can be used in the current project.
If TAB has a :project set, check that the directories match.
If TAB is nil, then always return t."
- (let ((proj (oref tab :project)))
+ (let ((proj (slot-value tab 'project)))
;; Return t if the project wasn't set.
(if (not proj) t
;; If the project directory was set, let's check it.
belonging to a specific application. If APPLICATION is nil, then only
tables that do not belong to an application will be searched."
(let* ((mt tab)
- (tabs (oref mt :tables))
+ (tabs (slot-value mt 'tables))
(ans nil))
(while (and (not ans) tabs)
- (let ((app (oref (car tabs) :application)))
+ (let ((app (slot-value (car tabs) 'application)))
(when (or (and (not application) (null app))
(and application (eq app application)))
(setq ans (srecode-template-get-table (car tabs) template-name
(setq tabs (cdr tabs))))
(or ans
;; Recurse to the default.
- (when (not (equal (oref tab :major-mode) 'default))
+ (when (not (equal (slot-value tab 'major-mode) 'default))
(srecode-template-get-table (srecode-get-mode-table 'default)
template-name context application)))))
belonging to a specific application. If APPLICATION is nil, then only
tables that do not belong to an application will be searched."
(let* ((mt tab)
- (tabs (oref mt :tables))
+ (tabs (slot-value mt 'tables))
(ans nil))
(while (and (not ans) tabs)
- (let ((app (oref (car tabs) :application)))
+ (let ((app (slot-value (car tabs) 'application)))
(when (or (and (not application) (null app))
(and application (eq app application)))
(setq ans (srecode-template-get-table-for-binding
(setq tabs (cdr tabs))))
(or ans
;; Recurse to the default.
- (when (not (equal (oref tab :major-mode) 'default))
+ (when (not (equal (slot-value tab 'major-mode) 'default))
(srecode-template-get-table-for-binding
(srecode-get-mode-table 'default) binding context)))))
;;; Interactive
;; Load up the hash table for our current mode.
(let* ((mt (srecode-get-mode-table mmode))
- (tabs (when mt (oref mt :tables))))
+ (tabs (when mt (slot-value mt 'tables))))
(dolist (tab tabs)
;; Exclude templates for a particular application.
- (when (and (not (oref tab :application))
+ (when (and (not (slot-value tab 'application))
(srecode-template-table-in-project-p tab))
(maphash (lambda (key temp)
(when (or (not predicate)
dictionary)
"Insert the STI inserter."
;; Convert the name into a name/fcn pair
- (let* ((name (oref sti :object-name))
- (fcnpart (oref sti :secondname))
+ (let* ((name (slot-value sti 'object-name))
+ (fcnpart (slot-value sti 'secondname))
(val (srecode-dictionary-lookup-name
dictionary name))
(do-princ t)
)
(while prompts
(when (string= (semantic-tag-name (car prompts))
- (oref ins :object-name))
+ (slot-value ins 'object-name))
(oset ins :prompt
(semantic-tag-get-attribute (car prompts) :text))
(oset ins :defaultfcn
dictionary)
"Insert the STI inserter."
(let ((val (srecode-dictionary-lookup-name
- dictionary (oref sti :object-name))))
+ dictionary (slot-value sti 'object-name))))
(if val
;; Does some extra work. Oh well.
(cl-call-next-method)
;; the user can use the same name again later.
(srecode-dictionary-set-value
(srecode-root-dictionary dictionary)
- (oref sti :object-name) val)
+ (slot-value sti 'object-name) val)
;; Now that this value is safely stowed in the dictionary,
;; we can do what regular inserters do.
dictionary)
"Derive the default value for an askable inserter STI.
DICTIONARY is used to derive some values."
- (let ((defaultfcn (oref sti :defaultfcn)))
+ (let ((defaultfcn (slot-value sti 'defaultfcn)))
(cond
((stringp defaultfcn)
defaultfcn)
Use DICTIONARY to resolve values."
(let* ((prompt (oref sti prompt))
(default (srecode-insert-ask-default sti dictionary))
- (reader (oref sti :read-fcn))
+ (reader (slot-value sti 'read-fcn))
(val nil)
)
(cond ((eq reader 'y-or-n-p)
(if (y-or-n-p (or prompt
(format "%s? "
- (oref sti :object-name))))
+ (slot-value sti 'object-name))))
(setq val default)
(setq val "")))
((eq reader 'read-char)
"%c"
(read-char (or prompt
(format "Char for %s: "
- (oref sti :object-name))))))
+ (slot-value sti 'object-name))))))
)
(t
(save-excursion
(setq val (funcall reader
(or prompt
(format "Specify %s: "
- (oref sti :object-name)))
+ (slot-value sti 'object-name)))
default
)))))
;; Return our derived value.
Use DICTIONARY to resolve values."
(let* ((default (srecode-insert-ask-default sti dictionary))
(compound-value
- (srecode-field-value (oref sti :object-name)
+ (srecode-field-value (slot-value sti 'object-name)
:firstinserter sti
:defaultvalue default))
)
Loops over the embedded CODE which was saved here during compilation.
The template to insert is stored in SLOT."
(let ((dicts (srecode-dictionary-lookup-name
- dictionary (oref sti :object-name))))
+ dictionary (slot-value sti 'object-name))))
(when (not (listp dicts))
(srecode-insert-report-error
dictionary
"Cannot insert section %S from non-section variable."
- (oref sti :object-name)))
+ (slot-value sti 'object-name)))
;; If there is no section dictionary, then don't output anything
;; from this section.
(while dicts
(srecode-insert-report-error
dictionary
"Cannot insert section %S from non-section variable."
- (oref sti :object-name)))
+ (slot-value sti 'object-name)))
(srecode-insert-subtemplate sti (car dicts) slot)
(setq dicts (cdr dicts)))))
Shorten input until the END token is found.
Return the remains of INPUT."
(let* ((out (srecode-compile-split-code tag input STATE
- (oref ins :object-name))))
+ (slot-value ins 'object-name))))
(oset ins template (srecode-template
(eieio-object-name-string ins)
:context nil
(cl-defmethod srecode-match-end ((ins srecode-template-inserter-section-end) name)
"For the template inserter INS, do I end a section called NAME?"
- (string= name (oref ins :object-name)))
+ (string= name (slot-value ins 'object-name)))
(defclass srecode-template-inserter-include (srecode-template-inserter-subtemplate)
((key :initform ?>
"For the template inserter STI, lookup the template to include.
Finds the template with this macro function part and stores it in
this template instance."
- (let ((templatenamepart (oref sti :secondname)))
+ (let ((templatenamepart (slot-value sti 'secondname)))
;; If there was no template name, throw an error.
(unless templatenamepart
(srecode-insert-report-error
dictionary
"Include macro `%s' needs a template name"
- (oref sti :object-name)))
+ (slot-value sti 'object-name)))
;; NOTE: We used to cache the template and not look it up a second time,
;; but changes in the template tables can change which template is
(srecode-insert-report-error
dictionary
"No template \"%s\" found for include macro `%s'"
- templatenamepart (oref sti :object-name)))))
+ templatenamepart (slot-value sti 'object-name)))))
(cl-defmethod srecode-insert-method ((sti srecode-template-inserter-include)
dictionary)
(srecode-insert-include-lookup sti dictionary)
;; Insert the template.
;; Our baseclass has a simple way to do this.
- (if (srecode-dictionary-lookup-name dictionary (oref sti :object-name))
+ (if (srecode-dictionary-lookup-name dictionary (slot-value sti 'object-name))
;; If we have a value, then call the next method
(srecode-insert-method-helper sti dictionary 'includedtemplate)
;; If we don't have a special dictionary, then just insert with the
(lambda (dict)
(let ((srecode-template-inserter-point-override nil))
(if (srecode-dictionary-lookup-name
- dict (oref inserter1 :object-name))
+ dict (slot-value inserter1 'object-name))
;; Insert our sectional part with looping.
(srecode-insert-method-helper
inserter1 dict 'template)
;;(srecode-load-tables-for-mode major-mode)
(let* ((modetable (srecode-get-mode-table major-mode))
- (subtab (when modetable (oref modetable :tables)))
+ (subtab (when modetable (slot-value modetable 'tables)))
(context nil)
(active nil)
(ltab nil)
(if (not temp)
(error "No Template named %s" template-name))
;; We need a template specific table, since tables chain.
- (let ((tab (oref temp :table))
+ (let ((tab (slot-value temp 'table))
(names nil)
)
- (find-file (oref tab :file))
- (setq names (semantic-find-tags-by-name (oref temp :object-name)
+ (find-file (slot-value tab 'file))
+ (setq names (semantic-find-tags-by-name (slot-value temp 'object-name)
(current-buffer)))
(cond ((= (length names) 1)
(semantic-go-to-tag (car names))
(semantic-momentary-highlight-tag (car names)))
((> (length names) 1)
- (let* ((ctxt (semantic-find-tags-by-name (oref temp :context)
+ (let* ((ctxt (semantic-find-tags-by-name (slot-value temp 'context)
(current-buffer)))
(cls (semantic-find-tags-by-class 'context ctxt))
)
aspect of the compound value."
(if (not function)
;; Just format it in some handy dandy way.
- (semantic-format-tag-prototype (oref cp :prime))
+ (semantic-format-tag-prototype (slot-value cp 'prime))
;; Otherwise, apply the function to the tag itself.
- (funcall function (oref cp :prime))
+ (funcall function (slot-value cp 'prime))
))
\f
(srecode-dictionary-set-value dict "TAG" tagobj)
;; Pull out the tag for the individual pieces.
- (let ((tag (oref tagobj :prime)))
+ (let ((tag (slot-value tagobj 'prime)))
(srecode-dictionary-set-value dict "NAME" (semantic-tag-name tag))
(srecode-dictionary-set-value dict "TYPE" (semantic-format-tag-type tag nil))
)
(when inserter
(let ((base
- (cons (oref inserter :object-name)
+ (cons (slot-value inserter 'object-name)
(if (and (slot-boundp inserter :secondname)
- (oref inserter :secondname))
- (split-string (oref inserter :secondname)
+ (slot-value inserter 'secondname))
+ (split-string (slot-value inserter 'secondname)
":")
nil)))
(key (oref inserter key)))
"Return a list of possible completions based on NONTEXT.
Any extra FLAGS are ignored."
(with-current-buffer (oref context buffer)
- (let* ((prefix (car (last (oref context :prefix))))
+ (let* ((prefix (car (last (slot-value context 'prefix))))
(prefixstr (cond ((stringp prefix)
prefix)
((semantic-tag-p prefix)
; prefix)
; ((stringp (car prefix))
; (car prefix))))
- (argtype (car (oref context :argument)))
+ (argtype (car (slot-value context 'argument)))
(matches nil))
;; Depending on what the analyzer is, we have different ways
;; into the search table first, allowing lower priority items
;; to be the items found in the search table.
(object-sort-list mt 'modetables (lambda (a b)
- (> (oref a :priority)
- (oref b :priority))))
+ (> (slot-value a 'priority)
+ (slot-value b 'priority))))
;; Return it.
new))
(cl-defmethod srecode-dump ((tab srecode-mode-table))
"Dump the contents of the SRecode mode table TAB."
(princ "MODE TABLE FOR ")
- (princ (oref tab :major-mode))
+ (princ (slot-value tab 'major-mode))
(princ "\n--------------------------------------------\n\nNumber of tables: ")
- (let ((subtab (oref tab :tables)))
+ (let ((subtab (slot-value tab 'tables)))
(princ (length subtab))
(princ "\n\n")
(while subtab
(princ "Template Table for ")
(princ (eieio-object-name-string tab))
(princ "\nPriority: ")
- (prin1 (oref tab :priority))
- (when (oref tab :application)
+ (prin1 (slot-value tab 'priority))
+ (when (slot-value tab 'application)
(princ "\nApplication: ")
- (princ (oref tab :application)))
- (when (oref tab :framework)
+ (princ (slot-value tab 'application)))
+ (when (slot-value tab 'framework)
(princ "\nFramework: ")
- (princ (oref tab :framework)))
- (when (oref tab :project)
+ (princ (slot-value tab 'framework)))
+ (when (slot-value tab 'project)
(require 'srecode/find) ; For srecode-template-table-in-project-p
(princ "\nProject Directory: ")
- (princ (oref tab :project))
+ (princ (slot-value tab 'project))
(when (not (srecode-template-table-in-project-p tab))
(princ "\n ** Not Usable in this file. **")))
(princ "\n\nVariables:\n")
(error "No tag to insert for :texitag template argument"))
;; Extract the tag out of the compound object.
- (setq tag (oref tag :prime))
+ (setq tag (slot-value tag 'prime))
;; Extract the doc string
(setq doc (semantic-documentation-for-tag tag))