2009-09-20 21:06:41 +00:00
|
|
|
;;; srecode/compile --- Compilation of srecode template files.
|
|
|
|
|
2017-01-01 03:14:01 +00:00
|
|
|
;; Copyright (C) 2005, 2007-2017 Free Software Foundation, Inc.
|
2009-09-20 21:06:41 +00:00
|
|
|
|
|
|
|
;; Author: Eric M. Ludlam <zappo@gnu.org>
|
|
|
|
;; Keywords: codegeneration
|
|
|
|
|
|
|
|
;; 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
|
|
|
|
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
;;
|
|
|
|
;; Compile a Semantic Recoder template file.
|
|
|
|
;;
|
|
|
|
;; Template files are parsed using a Semantic/Wisent parser into
|
2009-10-01 03:08:03 +00:00
|
|
|
;; a tag table. The code therein is then further parsed down using
|
2009-09-20 21:06:41 +00:00
|
|
|
;; a regular expression parser.
|
|
|
|
;;
|
|
|
|
;; The output are a series of EIEIO objects which represent the
|
|
|
|
;; templates in a way that could be inserted later.
|
|
|
|
|
2009-10-17 04:18:31 +00:00
|
|
|
(eval-when-compile (require 'cl))
|
2009-09-20 21:06:41 +00:00
|
|
|
(require 'semantic)
|
|
|
|
(require 'eieio)
|
2015-02-04 13:49:49 -05:00
|
|
|
(require 'cl-generic)
|
2009-09-20 21:06:41 +00:00
|
|
|
(require 'eieio-base)
|
|
|
|
(require 'srecode/table)
|
2010-09-21 18:11:23 -04:00
|
|
|
(require 'srecode/dictionary)
|
2009-09-20 21:06:41 +00:00
|
|
|
|
2009-09-29 04:09:19 +00:00
|
|
|
(declare-function srecode-template-inserter-newline-child-p "srecode/insert"
|
|
|
|
t t)
|
2009-09-20 21:06:41 +00:00
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
;;; Template Class
|
|
|
|
;;
|
2010-09-21 18:11:23 -04:00
|
|
|
;; Templates describe a pattern of text that can be inserted into a
|
2009-09-20 21:06:41 +00:00
|
|
|
;; buffer.
|
|
|
|
;;
|
|
|
|
(defclass srecode-template (eieio-named)
|
|
|
|
((context :initarg :context
|
|
|
|
:initform nil
|
|
|
|
:documentation
|
|
|
|
"Context this template belongs to.")
|
|
|
|
(args :initarg :args
|
|
|
|
:documentation
|
|
|
|
"List of arguments that this template requires.")
|
|
|
|
(code :initarg :code
|
|
|
|
:documentation
|
|
|
|
"Compiled text from the template.")
|
|
|
|
(dictionary :initarg :dictionary
|
|
|
|
:type (or null srecode-dictionary)
|
|
|
|
:documentation
|
2011-11-17 01:09:20 -08:00
|
|
|
"List of section dictionaries.
|
2009-09-20 21:06:41 +00:00
|
|
|
The compiled template can contain lists of section dictionaries,
|
|
|
|
or values that are expected to be passed down into different
|
|
|
|
section macros. The template section dictionaries are merged in with
|
2011-11-14 23:55:13 -08:00
|
|
|
any incoming dictionaries values.")
|
2009-09-20 21:06:41 +00:00
|
|
|
(binding :initarg :binding
|
|
|
|
:documentation
|
|
|
|
"Preferred keybinding for this template in `srecode-minor-mode-map'.")
|
|
|
|
(active :allocation :class
|
|
|
|
:initform nil
|
|
|
|
:documentation
|
|
|
|
"During template insertion, this is the stack of active templates.
|
Prefer directed to neutral quotes
Prefer directed to neutral quotes in docstings and diagnostics.
In docstrings, escape apostrophes that would otherwise be translated
to curved quotes using the newer, simpler rules.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-lang.el (math-read-giac-subscr)
(math-read-math-subscr):
* lisp/calc/calc-misc.el (report-calc-bug):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/dabbrev.el (dabbrev-expand):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/emacs-lisp/elint.el (elint-get-top-forms):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emulation/viper-cmd.el (viper-toggle-search-style):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-arg.el (eshell-parse-arguments):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/files-x.el (modify-file-local-variable):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer)
(filesets-update-pre010505):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/gnus/auth-source.el (auth-source-netrc-parse-entries):
* lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer)
(gnus-agent-fetch-headers):
* lisp/gnus/gnus-int.el (gnus-start-news-server):
* lisp/gnus/gnus-registry.el:
(gnus-registry--split-fancy-with-parent-internal):
* lisp/gnus/gnus-score.el (gnus-summary-increase-score):
* lisp/gnus/gnus-start.el (gnus-convert-old-newsrc):
* lisp/gnus/gnus-topic.el (gnus-topic-rename):
* lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/gnus/spam.el (spam-check-blackholes):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/tramp-cache.el:
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-bibtex.el (org-bibtex-fields):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question)
(dun-rooms, dun-endgame-questions):
* lisp/progmodes/ada-mode.el (ada-goto-matching-start):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/antlr-mode.el (antlr-options-alists):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/server.el (server-get-auth-key):
* lisp/subr.el (version-to-list):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/vc/ediff-diff.el (ediff-same-contents):
* lisp/vc/vc-cvs.el (vc-cvs-mode-line-string):
* test/automated/tramp-tests.el (tramp-test33-asynchronous-requests):
Use directed rather than neutral quotes in diagnostics.
2015-08-24 23:39:33 -07:00
|
|
|
The top-most template is the `active' template. Use the accessor methods
|
2009-09-20 21:06:41 +00:00
|
|
|
for push, pop, and peek for the active template.")
|
|
|
|
(table :initarg :table
|
|
|
|
:documentation
|
|
|
|
"The table this template lives in.")
|
|
|
|
)
|
|
|
|
"Class defines storage for semantic recoder templates.")
|
|
|
|
|
|
|
|
(defun srecode-flush-active-templates ()
|
|
|
|
"Flush the active template storage.
|
2009-10-01 03:08:03 +00:00
|
|
|
Useful if something goes wrong in SRecode, and the active template
|
2009-09-20 21:06:41 +00:00
|
|
|
stack is broken."
|
|
|
|
(interactive)
|
2015-01-07 23:11:58 -05:00
|
|
|
(if (oref-default 'srecode-template active)
|
2009-09-20 21:06:41 +00:00
|
|
|
(when (y-or-n-p (format "%d active templates. Flush? "
|
2015-01-07 23:11:58 -05:00
|
|
|
(length (oref-default 'srecode-template active))))
|
|
|
|
(oset-default 'srecode-template active nil))
|
2009-09-20 21:06:41 +00:00
|
|
|
(message "No active templates to flush."))
|
|
|
|
)
|
|
|
|
|
|
|
|
;;; Inserters
|
|
|
|
;;
|
|
|
|
;; Each inserter object manages a different thing that
|
|
|
|
;; might be inserted into a template output stream.
|
|
|
|
;;
|
|
|
|
;; The 'srecode-insert-method' on each inserter does the actual
|
|
|
|
;; work, and the smaller, simple inserter object is saved in
|
|
|
|
;; the compiled templates.
|
|
|
|
;;
|
2011-11-03 21:03:45 +01:00
|
|
|
;; See srecode/insert.el for the specialized classes.
|
2009-09-20 21:06:41 +00:00
|
|
|
;;
|
|
|
|
(defclass srecode-template-inserter (eieio-named)
|
|
|
|
((secondname :initarg :secondname
|
|
|
|
:type (or null string)
|
|
|
|
:documentation
|
|
|
|
"If there is a colon in the inserter's name, it represents
|
|
|
|
additional static argument data."))
|
|
|
|
"This represents an item to be inserted via a template macro.
|
|
|
|
Plain text strings are not handled via this baseclass."
|
|
|
|
:abstract t)
|
|
|
|
|
2015-05-06 09:12:40 -04:00
|
|
|
(cl-defmethod srecode-parse-input ((_ins srecode-template-inserter)
|
|
|
|
_tag input _STATE)
|
2009-09-20 21:06:41 +00:00
|
|
|
"For the template inserter INS, parse INPUT.
|
|
|
|
Shorten input only by the amount needed.
|
|
|
|
Return the remains of INPUT.
|
|
|
|
STATE is the current compilation state."
|
|
|
|
input)
|
|
|
|
|
2015-05-06 09:12:40 -04:00
|
|
|
(cl-defmethod srecode-match-end ((_ins srecode-template-inserter) _name)
|
2009-09-20 21:06:41 +00:00
|
|
|
"For the template inserter INS, do I end a section called NAME?"
|
|
|
|
nil)
|
|
|
|
|
2015-05-06 09:12:40 -04:00
|
|
|
(cl-defmethod srecode-inserter-apply-state ((_ins srecode-template-inserter) _STATE)
|
2009-09-20 21:06:41 +00:00
|
|
|
"For the template inserter INS, apply information from STATE."
|
|
|
|
nil)
|
|
|
|
|
2015-02-04 13:49:49 -05:00
|
|
|
(cl-defmethod srecode-inserter-prin-example ((ins (subclass srecode-template-inserter))
|
2009-09-20 21:06:41 +00:00
|
|
|
escape-start escape-end)
|
|
|
|
"Insert an example using inserter INS.
|
|
|
|
Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
|
|
|
|
(princ " ")
|
|
|
|
(princ escape-start)
|
|
|
|
(when (and (slot-exists-p ins 'key) (oref ins key))
|
|
|
|
(princ (format "%c" (oref ins key))))
|
|
|
|
(princ "VARNAME")
|
|
|
|
(princ escape-end)
|
|
|
|
(terpri)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
;;; Compile State
|
|
|
|
(defclass srecode-compile-state ()
|
|
|
|
((context :initform "declaration"
|
|
|
|
:documentation "The active context.")
|
|
|
|
(prompts :initform nil
|
|
|
|
:documentation "The active prompts.")
|
|
|
|
(escape_start :initform "{{"
|
|
|
|
:documentation "The starting escape sequence.")
|
|
|
|
(escape_end :initform "}}"
|
|
|
|
:documentation "The ending escape sequence.")
|
|
|
|
)
|
|
|
|
"Current state of the compile.")
|
|
|
|
|
2015-02-04 13:49:49 -05:00
|
|
|
(cl-defmethod srecode-compile-add-prompt ((state srecode-compile-state)
|
2009-09-20 21:06:41 +00:00
|
|
|
prompttag)
|
|
|
|
"Add PROMPTTAG to the current list of prompts."
|
|
|
|
(with-slots (prompts) state
|
|
|
|
(let ((match (assoc (semantic-tag-name prompttag) prompts))
|
|
|
|
(newprompts prompts))
|
|
|
|
(when match
|
|
|
|
(let ((tmp prompts))
|
|
|
|
(setq newprompts nil)
|
|
|
|
(while tmp
|
|
|
|
(when (not (string= (car (car tmp))
|
|
|
|
(car prompttag)))
|
|
|
|
(setq newprompts (cons (car tmp)
|
|
|
|
newprompts)))
|
|
|
|
(setq tmp (cdr tmp)))))
|
|
|
|
(setq prompts (cons prompttag newprompts)))
|
|
|
|
))
|
|
|
|
|
|
|
|
;;; TEMPLATE COMPILER
|
|
|
|
;;
|
|
|
|
(defun srecode-compile-file (fname)
|
|
|
|
"Compile the templates from the file FNAME."
|
|
|
|
(let ((peb (get-file-buffer fname)))
|
|
|
|
(save-excursion
|
|
|
|
;; Make whatever it is local.
|
|
|
|
(if (not peb)
|
|
|
|
(set-buffer (semantic-find-file-noselect fname))
|
|
|
|
(set-buffer peb))
|
|
|
|
;; Do the compile.
|
2009-10-04 19:22:09 +00:00
|
|
|
(unless (semantic-active-p)
|
|
|
|
(semantic-new-buffer-fcn))
|
2009-09-20 21:06:41 +00:00
|
|
|
(srecode-compile-templates)
|
|
|
|
;; Trash the buffer if we had to read it in.
|
|
|
|
(if (not peb)
|
|
|
|
(kill-buffer (current-buffer)))
|
|
|
|
)))
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun srecode-compile-templates ()
|
|
|
|
"Compile a semantic recode template file into a mode-local variable."
|
|
|
|
(interactive)
|
2012-10-25 22:13:16 +02:00
|
|
|
(unless (semantic-active-p)
|
Merge from CEDET upstream (8564).
* lisp/emacs-lisp:
* emacs-lisp/eieio.el (eieio--defalias, eieio-hook)
(eieio-error-unsupported-class-tags, eieio-skip-typecheck)
(eieio-optimize-primary-methods-flag, eieio-initializing-object)
(eieio-unbound, eieio-default-superclass)
(eieio--define-field-accessors, method-static, method-before)
(method-primary, method-after, method-num-lists)
(method-generic-before, method-generic-primary)
(method-generic-after, method-num-slots)
(eieio-specialized-key-to-generic-key)
(eieio--check-type, class-v, class-p)
(eieio-class-name, define-obsolete-function-alias)
(eieio-class-parents-fast, eieio-class-children-fast)
(same-class-fast-p, class-constructor, generic-p)
(generic-primary-only-p, generic-primary-only-one-p)
(class-option-assoc, class-option, eieio-object-p)
(class-abstract-p, class-method-invocation-order)
(eieio-defclass-autoload-map, eieio-defclass-autoload)
(eieio-class-un-autoload, eieio-defclass)
(eieio-eval-default-p, eieio-perform-slot-validation-for-default)
(eieio-add-new-slot, eieio-copy-parents-into-subclass)
(eieio--defgeneric-init-form, eieio-defgeneric-form)
(eieio-defgeneric-reset-generic-form)
(eieio-defgeneric-form-primary-only)
(eieio-defgeneric-reset-generic-form-primary-only)
(eieio-defgeneric-form-primary-only-one)
(eieio-defgeneric-reset-generic-form-primary-only-one)
(eieio-unbind-method-implementations)
(eieio--defmethod, eieio--typep)
(eieio-perform-slot-validation, eieio-validate-slot-value)
(eieio-validate-class-slot-value, eieio-barf-if-slot-unbound)
(eieio-oref, eieio-oref-default, eieio-default-eval-maybe)
(eieio-oset, eieio-oset-default, eieio-slot-originating-class-p)
(eieio-slot-name-index, eieio-class-slot-name-index)
(eieio-set-defaults, eieio-initarg-to-attribute)
(eieio-attribute-to-initarg, eieio-c3-candidate)
(eieio-c3-merge-lists, eieio-class-precedence-c3)
(eieio-class-precedence-dfs, eieio-class-precedence-bfs)
(eieio-class-precedence-list, eieio-generic-call-methodname)
(eieio-generic-call-arglst, eieio-generic-call-key)
(eieio-generic-call-next-method-list)
(eieio-pre-method-execution-functions, eieio-generic-call)
(eieio-generic-call-primary-only, eieiomt-method-list)
(eieiomt-optimizing-obarray, eieiomt-install)
(eieiomt-add, eieiomt-next, eieiomt-sym-optimize)
(eieio-generic-form, eieio-defmethod, make-obsolete)
(eieio-defgeneric, make-obsolete): Moved to eieio-core.el
(defclass): Remove `eval-and-compile' from macro.
(call-next-method, shared-initialize): Instead of using
`scoped-class' variable, use new eieio--scoped-class, and
eieio--with-scoped-class.
(initialize-instance): Rename local variable 'scoped-class' to
'this-class' to remove ambiguitity from old global.
* emacs-lisp/eieio-core.el: New file. Derived from key parts of
eieio.el.
(eieio--scoped-class-stack): New variable
(eieio--scoped-class): New fcn
(eieio--with-scoped-class): New scoping macro.
(eieio-defclass): Use pushnew instead of add-to-list.
(eieio-defgeneric-form-primary-only-one, eieio-oset-default)
(eieio-slot-name-index, eieio-set-defaults, eieio-generic-call)
(eieio-generic-call-primary-only, eieiomt-add): Instead of using
`scoped-class' variable, use new eieio--scoped-class, and
eieio--with-scoped-class.
* emacs-lisp/eieio-base.el (cl-lib): Require during compile.
* admin/grammars:
* grammars/srecode-template.wy (variable): Accept a single number
as a variable value. Allows the 'priority' to be set to a number.
(wisent-srecode-template-lexer): Move number up so it can be
created.
* etc/srecode:
* srecode/c.srt (header_guard): Add :c parameter so it works
standalone
* lisp/cedet:
* semantic/edit.el (semantic-change-function): Use
`save-match-data' around running hooks.
* semantic/decorate/mode.el
(semantic-decorate-style-predicate-default)
(semantic-decorate-style-highlighter-default): New.
(semantic-decoration-mode): Do not require
`semantic/decorate/include' anymore.
(semantic-toggle-decoration-style): Error if an unknown decoration
style is toggled.
(define-semantic-decoration-style): Add new :load option. When
:load is specified, add autoload tokens for the definition
functions so that code is loaded when the mode is used.
(semantic-decoration-on-includes): New autoload definition for
highlighting includes.
* semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc
characters to appear after the tested variable.
* semantic/ede-grammar.el (project-compile-target): Calculate full
src name via ede-expand-filename instead of the crutch of the
current buffer. Enables this target to compile in batch mode.
* semantic/idle.el
(semantic-idle-symbol-maybe-highlight): Wrap highlighting of
remote symbol with `save-excursion'.
(semantic-idle-scheduler-work-parse-neighboring-files): Instead of
using directory-files on each found mode pattern, collect all the
patterns for the current mode, and then for each file, see if it
matches any of them. If it does, parse the file. (Patch
inspiration from Tomasz Gajewski.)
* semantic/ctxt.el (semantic-ctxt-end-of-symbol): New.
(semantic-ctxt-current-symbol-default): New.
* semantic/bovine/el.el (semantic-default-elisp-setup): Add
autoload cookie. Explain existence.
(footer): Add local variable for loaddefs.
* semantic/db.el (semanticdb-file-table-object): Add new filter,
only checking for regular files too.
* semantic/wisent/python.el
(semantic-format-tag-abbreviate): New override. Cuts back on size
of code tags.
* srecode/compile.el (srecode-compile-templates): Fix warning
punctuation. Remove status messages to clean up testing output
* ede/base.el (ede-project-placeholder-cache-file): Update doc to
mention 'nil' value.
(ede-save-cache): Disable cache save if file is nil.
* ede.el (ede-initialize-state-current-buffer): Flush deleted
projects.
(global-ede-mode): Always append our find-file-hook to the end.
(ede-flush-deleted-projects): New command.
* ede/cpp-root.el (ede-preprocessor-map): Protect against init
problems.
* ede/proj.el (ede-proj-target): Added a new "custom" option for
custom symbols representing a compiler or linker instead of
restricting things to only the predefined compilers and linkers.
* semantic.el (semantic-mode-map): To avoid showing showing
Development menu twice, only disable menu item if menu-bar is
actually enabled, otherwise the popup 'global menu' might display
a disabled Development menu.
* semantic/complete.el
(semantic-displayor-show-request): Fix which slot in obj is set to
the max tags.
2013-06-02 15:33:09 +02:00
|
|
|
(error "You have to activate semantic-mode to compile SRecode templates"))
|
2009-09-21 02:14:58 +00:00
|
|
|
(require 'srecode/insert)
|
Merge from CEDET upstream (8564).
* lisp/emacs-lisp:
* emacs-lisp/eieio.el (eieio--defalias, eieio-hook)
(eieio-error-unsupported-class-tags, eieio-skip-typecheck)
(eieio-optimize-primary-methods-flag, eieio-initializing-object)
(eieio-unbound, eieio-default-superclass)
(eieio--define-field-accessors, method-static, method-before)
(method-primary, method-after, method-num-lists)
(method-generic-before, method-generic-primary)
(method-generic-after, method-num-slots)
(eieio-specialized-key-to-generic-key)
(eieio--check-type, class-v, class-p)
(eieio-class-name, define-obsolete-function-alias)
(eieio-class-parents-fast, eieio-class-children-fast)
(same-class-fast-p, class-constructor, generic-p)
(generic-primary-only-p, generic-primary-only-one-p)
(class-option-assoc, class-option, eieio-object-p)
(class-abstract-p, class-method-invocation-order)
(eieio-defclass-autoload-map, eieio-defclass-autoload)
(eieio-class-un-autoload, eieio-defclass)
(eieio-eval-default-p, eieio-perform-slot-validation-for-default)
(eieio-add-new-slot, eieio-copy-parents-into-subclass)
(eieio--defgeneric-init-form, eieio-defgeneric-form)
(eieio-defgeneric-reset-generic-form)
(eieio-defgeneric-form-primary-only)
(eieio-defgeneric-reset-generic-form-primary-only)
(eieio-defgeneric-form-primary-only-one)
(eieio-defgeneric-reset-generic-form-primary-only-one)
(eieio-unbind-method-implementations)
(eieio--defmethod, eieio--typep)
(eieio-perform-slot-validation, eieio-validate-slot-value)
(eieio-validate-class-slot-value, eieio-barf-if-slot-unbound)
(eieio-oref, eieio-oref-default, eieio-default-eval-maybe)
(eieio-oset, eieio-oset-default, eieio-slot-originating-class-p)
(eieio-slot-name-index, eieio-class-slot-name-index)
(eieio-set-defaults, eieio-initarg-to-attribute)
(eieio-attribute-to-initarg, eieio-c3-candidate)
(eieio-c3-merge-lists, eieio-class-precedence-c3)
(eieio-class-precedence-dfs, eieio-class-precedence-bfs)
(eieio-class-precedence-list, eieio-generic-call-methodname)
(eieio-generic-call-arglst, eieio-generic-call-key)
(eieio-generic-call-next-method-list)
(eieio-pre-method-execution-functions, eieio-generic-call)
(eieio-generic-call-primary-only, eieiomt-method-list)
(eieiomt-optimizing-obarray, eieiomt-install)
(eieiomt-add, eieiomt-next, eieiomt-sym-optimize)
(eieio-generic-form, eieio-defmethod, make-obsolete)
(eieio-defgeneric, make-obsolete): Moved to eieio-core.el
(defclass): Remove `eval-and-compile' from macro.
(call-next-method, shared-initialize): Instead of using
`scoped-class' variable, use new eieio--scoped-class, and
eieio--with-scoped-class.
(initialize-instance): Rename local variable 'scoped-class' to
'this-class' to remove ambiguitity from old global.
* emacs-lisp/eieio-core.el: New file. Derived from key parts of
eieio.el.
(eieio--scoped-class-stack): New variable
(eieio--scoped-class): New fcn
(eieio--with-scoped-class): New scoping macro.
(eieio-defclass): Use pushnew instead of add-to-list.
(eieio-defgeneric-form-primary-only-one, eieio-oset-default)
(eieio-slot-name-index, eieio-set-defaults, eieio-generic-call)
(eieio-generic-call-primary-only, eieiomt-add): Instead of using
`scoped-class' variable, use new eieio--scoped-class, and
eieio--with-scoped-class.
* emacs-lisp/eieio-base.el (cl-lib): Require during compile.
* admin/grammars:
* grammars/srecode-template.wy (variable): Accept a single number
as a variable value. Allows the 'priority' to be set to a number.
(wisent-srecode-template-lexer): Move number up so it can be
created.
* etc/srecode:
* srecode/c.srt (header_guard): Add :c parameter so it works
standalone
* lisp/cedet:
* semantic/edit.el (semantic-change-function): Use
`save-match-data' around running hooks.
* semantic/decorate/mode.el
(semantic-decorate-style-predicate-default)
(semantic-decorate-style-highlighter-default): New.
(semantic-decoration-mode): Do not require
`semantic/decorate/include' anymore.
(semantic-toggle-decoration-style): Error if an unknown decoration
style is toggled.
(define-semantic-decoration-style): Add new :load option. When
:load is specified, add autoload tokens for the definition
functions so that code is loaded when the mode is used.
(semantic-decoration-on-includes): New autoload definition for
highlighting includes.
* semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc
characters to appear after the tested variable.
* semantic/ede-grammar.el (project-compile-target): Calculate full
src name via ede-expand-filename instead of the crutch of the
current buffer. Enables this target to compile in batch mode.
* semantic/idle.el
(semantic-idle-symbol-maybe-highlight): Wrap highlighting of
remote symbol with `save-excursion'.
(semantic-idle-scheduler-work-parse-neighboring-files): Instead of
using directory-files on each found mode pattern, collect all the
patterns for the current mode, and then for each file, see if it
matches any of them. If it does, parse the file. (Patch
inspiration from Tomasz Gajewski.)
* semantic/ctxt.el (semantic-ctxt-end-of-symbol): New.
(semantic-ctxt-current-symbol-default): New.
* semantic/bovine/el.el (semantic-default-elisp-setup): Add
autoload cookie. Explain existence.
(footer): Add local variable for loaddefs.
* semantic/db.el (semanticdb-file-table-object): Add new filter,
only checking for regular files too.
* semantic/wisent/python.el
(semantic-format-tag-abbreviate): New override. Cuts back on size
of code tags.
* srecode/compile.el (srecode-compile-templates): Fix warning
punctuation. Remove status messages to clean up testing output
* ede/base.el (ede-project-placeholder-cache-file): Update doc to
mention 'nil' value.
(ede-save-cache): Disable cache save if file is nil.
* ede.el (ede-initialize-state-current-buffer): Flush deleted
projects.
(global-ede-mode): Always append our find-file-hook to the end.
(ede-flush-deleted-projects): New command.
* ede/cpp-root.el (ede-preprocessor-map): Protect against init
problems.
* ede/proj.el (ede-proj-target): Added a new "custom" option for
custom symbols representing a compiler or linker instead of
restricting things to only the predefined compilers and linkers.
* semantic.el (semantic-mode-map): To avoid showing showing
Development menu twice, only disable menu item if menu-bar is
actually enabled, otherwise the popup 'global menu' might display
a disabled Development menu.
* semantic/complete.el
(semantic-displayor-show-request): Fix which slot in obj is set to
the max tags.
2013-06-02 15:33:09 +02:00
|
|
|
(when (called-interactively-p 'interactive)
|
|
|
|
(message "Compiling template %s..."
|
|
|
|
(file-name-nondirectory (buffer-file-name))))
|
2009-09-20 21:06:41 +00:00
|
|
|
(let ((tags (semantic-fetch-tags))
|
|
|
|
(tag nil)
|
|
|
|
(class nil)
|
|
|
|
(table nil)
|
|
|
|
(STATE (srecode-compile-state (file-name-nondirectory
|
|
|
|
(buffer-file-name))))
|
|
|
|
(mode nil)
|
|
|
|
(application nil)
|
2012-10-02 02:10:29 +08:00
|
|
|
(framework nil)
|
2009-09-20 21:06:41 +00:00
|
|
|
(priority nil)
|
2010-09-21 18:11:23 -04:00
|
|
|
(project nil)
|
2009-09-20 21:06:41 +00:00
|
|
|
(vars nil)
|
|
|
|
)
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; COMPILE
|
|
|
|
;;
|
|
|
|
(while tags
|
|
|
|
(setq tag (car tags)
|
|
|
|
class (semantic-tag-class tag))
|
|
|
|
;; What type of item is it?
|
|
|
|
(cond
|
|
|
|
;; CONTEXT tags specify the context all future tags
|
|
|
|
;; belong to.
|
|
|
|
((eq class 'context)
|
|
|
|
(oset STATE context (semantic-tag-name tag))
|
|
|
|
)
|
|
|
|
|
|
|
|
;; PROMPT tags specify prompts for dictionary ? inserters
|
|
|
|
;; which appear in the following templates
|
|
|
|
((eq class 'prompt)
|
|
|
|
(srecode-compile-add-prompt STATE tag)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; VARIABLE tags can specify operational control
|
|
|
|
((eq class 'variable)
|
|
|
|
(let* ((name (semantic-tag-name tag))
|
|
|
|
(value (semantic-tag-variable-default tag))
|
|
|
|
(firstvalue (car value)))
|
|
|
|
;; If it is a single string, and one value, then
|
|
|
|
;; look to see if it is one of our special variables.
|
|
|
|
(if (and (= (length value) 1) (stringp firstvalue))
|
|
|
|
(cond ((string= name "mode")
|
|
|
|
(setq mode (intern firstvalue)))
|
|
|
|
((string= name "escape_start")
|
|
|
|
(oset STATE escape_start firstvalue)
|
|
|
|
)
|
|
|
|
((string= name "escape_end")
|
|
|
|
(oset STATE escape_end firstvalue)
|
|
|
|
)
|
|
|
|
((string= name "application")
|
|
|
|
(setq application (read firstvalue)))
|
2012-10-02 02:10:29 +08:00
|
|
|
((string= name "framework")
|
|
|
|
(setq framework (read firstvalue)))
|
2009-09-20 21:06:41 +00:00
|
|
|
((string= name "priority")
|
|
|
|
(setq priority (read firstvalue)))
|
2010-09-21 18:11:23 -04:00
|
|
|
((string= name "project")
|
|
|
|
(setq project firstvalue))
|
2009-09-20 21:06:41 +00:00
|
|
|
(t
|
|
|
|
;; Assign this into some table of variables.
|
|
|
|
(setq vars (cons (cons name firstvalue) vars))
|
|
|
|
))
|
|
|
|
;; If it isn't a single string, then the value of the
|
|
|
|
;; variable belongs to a compound dictionary value.
|
|
|
|
;;
|
|
|
|
;; Create a compound dictionary value from "value".
|
|
|
|
(require 'srecode/dictionary)
|
|
|
|
(let ((cv (srecode-dictionary-compound-variable
|
|
|
|
name :value value)))
|
|
|
|
(setq vars (cons (cons name cv) vars)))
|
|
|
|
))
|
|
|
|
)
|
|
|
|
|
|
|
|
;; FUNCTION tags are really templates.
|
|
|
|
((eq class 'function)
|
|
|
|
(setq table (cons (srecode-compile-one-template-tag tag STATE)
|
|
|
|
table))
|
|
|
|
)
|
|
|
|
|
|
|
|
;; Ooops
|
|
|
|
(t (error "Unknown TAG class %s" class))
|
|
|
|
)
|
|
|
|
;; Continue
|
|
|
|
(setq tags (cdr tags)))
|
Prefer directed to neutral quotes
Prefer directed to neutral quotes in docstings and diagnostics.
In docstrings, escape apostrophes that would otherwise be translated
to curved quotes using the newer, simpler rules.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-lang.el (math-read-giac-subscr)
(math-read-math-subscr):
* lisp/calc/calc-misc.el (report-calc-bug):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/dabbrev.el (dabbrev-expand):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/emacs-lisp/elint.el (elint-get-top-forms):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emulation/viper-cmd.el (viper-toggle-search-style):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-arg.el (eshell-parse-arguments):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/files-x.el (modify-file-local-variable):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer)
(filesets-update-pre010505):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/gnus/auth-source.el (auth-source-netrc-parse-entries):
* lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer)
(gnus-agent-fetch-headers):
* lisp/gnus/gnus-int.el (gnus-start-news-server):
* lisp/gnus/gnus-registry.el:
(gnus-registry--split-fancy-with-parent-internal):
* lisp/gnus/gnus-score.el (gnus-summary-increase-score):
* lisp/gnus/gnus-start.el (gnus-convert-old-newsrc):
* lisp/gnus/gnus-topic.el (gnus-topic-rename):
* lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/gnus/spam.el (spam-check-blackholes):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/tramp-cache.el:
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-bibtex.el (org-bibtex-fields):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question)
(dun-rooms, dun-endgame-questions):
* lisp/progmodes/ada-mode.el (ada-goto-matching-start):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/antlr-mode.el (antlr-options-alists):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/server.el (server-get-auth-key):
* lisp/subr.el (version-to-list):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/vc/ediff-diff.el (ediff-same-contents):
* lisp/vc/vc-cvs.el (vc-cvs-mode-line-string):
* test/automated/tramp-tests.el (tramp-test33-asynchronous-requests):
Use directed rather than neutral quotes in diagnostics.
2015-08-24 23:39:33 -07:00
|
|
|
|
2009-09-20 21:06:41 +00:00
|
|
|
;; MSG - Before install since nreverse whacks our list.
|
Merge from CEDET upstream (8564).
* lisp/emacs-lisp:
* emacs-lisp/eieio.el (eieio--defalias, eieio-hook)
(eieio-error-unsupported-class-tags, eieio-skip-typecheck)
(eieio-optimize-primary-methods-flag, eieio-initializing-object)
(eieio-unbound, eieio-default-superclass)
(eieio--define-field-accessors, method-static, method-before)
(method-primary, method-after, method-num-lists)
(method-generic-before, method-generic-primary)
(method-generic-after, method-num-slots)
(eieio-specialized-key-to-generic-key)
(eieio--check-type, class-v, class-p)
(eieio-class-name, define-obsolete-function-alias)
(eieio-class-parents-fast, eieio-class-children-fast)
(same-class-fast-p, class-constructor, generic-p)
(generic-primary-only-p, generic-primary-only-one-p)
(class-option-assoc, class-option, eieio-object-p)
(class-abstract-p, class-method-invocation-order)
(eieio-defclass-autoload-map, eieio-defclass-autoload)
(eieio-class-un-autoload, eieio-defclass)
(eieio-eval-default-p, eieio-perform-slot-validation-for-default)
(eieio-add-new-slot, eieio-copy-parents-into-subclass)
(eieio--defgeneric-init-form, eieio-defgeneric-form)
(eieio-defgeneric-reset-generic-form)
(eieio-defgeneric-form-primary-only)
(eieio-defgeneric-reset-generic-form-primary-only)
(eieio-defgeneric-form-primary-only-one)
(eieio-defgeneric-reset-generic-form-primary-only-one)
(eieio-unbind-method-implementations)
(eieio--defmethod, eieio--typep)
(eieio-perform-slot-validation, eieio-validate-slot-value)
(eieio-validate-class-slot-value, eieio-barf-if-slot-unbound)
(eieio-oref, eieio-oref-default, eieio-default-eval-maybe)
(eieio-oset, eieio-oset-default, eieio-slot-originating-class-p)
(eieio-slot-name-index, eieio-class-slot-name-index)
(eieio-set-defaults, eieio-initarg-to-attribute)
(eieio-attribute-to-initarg, eieio-c3-candidate)
(eieio-c3-merge-lists, eieio-class-precedence-c3)
(eieio-class-precedence-dfs, eieio-class-precedence-bfs)
(eieio-class-precedence-list, eieio-generic-call-methodname)
(eieio-generic-call-arglst, eieio-generic-call-key)
(eieio-generic-call-next-method-list)
(eieio-pre-method-execution-functions, eieio-generic-call)
(eieio-generic-call-primary-only, eieiomt-method-list)
(eieiomt-optimizing-obarray, eieiomt-install)
(eieiomt-add, eieiomt-next, eieiomt-sym-optimize)
(eieio-generic-form, eieio-defmethod, make-obsolete)
(eieio-defgeneric, make-obsolete): Moved to eieio-core.el
(defclass): Remove `eval-and-compile' from macro.
(call-next-method, shared-initialize): Instead of using
`scoped-class' variable, use new eieio--scoped-class, and
eieio--with-scoped-class.
(initialize-instance): Rename local variable 'scoped-class' to
'this-class' to remove ambiguitity from old global.
* emacs-lisp/eieio-core.el: New file. Derived from key parts of
eieio.el.
(eieio--scoped-class-stack): New variable
(eieio--scoped-class): New fcn
(eieio--with-scoped-class): New scoping macro.
(eieio-defclass): Use pushnew instead of add-to-list.
(eieio-defgeneric-form-primary-only-one, eieio-oset-default)
(eieio-slot-name-index, eieio-set-defaults, eieio-generic-call)
(eieio-generic-call-primary-only, eieiomt-add): Instead of using
`scoped-class' variable, use new eieio--scoped-class, and
eieio--with-scoped-class.
* emacs-lisp/eieio-base.el (cl-lib): Require during compile.
* admin/grammars:
* grammars/srecode-template.wy (variable): Accept a single number
as a variable value. Allows the 'priority' to be set to a number.
(wisent-srecode-template-lexer): Move number up so it can be
created.
* etc/srecode:
* srecode/c.srt (header_guard): Add :c parameter so it works
standalone
* lisp/cedet:
* semantic/edit.el (semantic-change-function): Use
`save-match-data' around running hooks.
* semantic/decorate/mode.el
(semantic-decorate-style-predicate-default)
(semantic-decorate-style-highlighter-default): New.
(semantic-decoration-mode): Do not require
`semantic/decorate/include' anymore.
(semantic-toggle-decoration-style): Error if an unknown decoration
style is toggled.
(define-semantic-decoration-style): Add new :load option. When
:load is specified, add autoload tokens for the definition
functions so that code is loaded when the mode is used.
(semantic-decoration-on-includes): New autoload definition for
highlighting includes.
* semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc
characters to appear after the tested variable.
* semantic/ede-grammar.el (project-compile-target): Calculate full
src name via ede-expand-filename instead of the crutch of the
current buffer. Enables this target to compile in batch mode.
* semantic/idle.el
(semantic-idle-symbol-maybe-highlight): Wrap highlighting of
remote symbol with `save-excursion'.
(semantic-idle-scheduler-work-parse-neighboring-files): Instead of
using directory-files on each found mode pattern, collect all the
patterns for the current mode, and then for each file, see if it
matches any of them. If it does, parse the file. (Patch
inspiration from Tomasz Gajewski.)
* semantic/ctxt.el (semantic-ctxt-end-of-symbol): New.
(semantic-ctxt-current-symbol-default): New.
* semantic/bovine/el.el (semantic-default-elisp-setup): Add
autoload cookie. Explain existence.
(footer): Add local variable for loaddefs.
* semantic/db.el (semanticdb-file-table-object): Add new filter,
only checking for regular files too.
* semantic/wisent/python.el
(semantic-format-tag-abbreviate): New override. Cuts back on size
of code tags.
* srecode/compile.el (srecode-compile-templates): Fix warning
punctuation. Remove status messages to clean up testing output
* ede/base.el (ede-project-placeholder-cache-file): Update doc to
mention 'nil' value.
(ede-save-cache): Disable cache save if file is nil.
* ede.el (ede-initialize-state-current-buffer): Flush deleted
projects.
(global-ede-mode): Always append our find-file-hook to the end.
(ede-flush-deleted-projects): New command.
* ede/cpp-root.el (ede-preprocessor-map): Protect against init
problems.
* ede/proj.el (ede-proj-target): Added a new "custom" option for
custom symbols representing a compiler or linker instead of
restricting things to only the predefined compilers and linkers.
* semantic.el (semantic-mode-map): To avoid showing showing
Development menu twice, only disable menu item if menu-bar is
actually enabled, otherwise the popup 'global menu' might display
a disabled Development menu.
* semantic/complete.el
(semantic-displayor-show-request): Fix which slot in obj is set to
the max tags.
2013-06-02 15:33:09 +02:00
|
|
|
(when (called-interactively-p 'interactive)
|
|
|
|
(message "%d templates compiled for %s"
|
|
|
|
(length table) mode))
|
2009-09-20 21:06:41 +00:00
|
|
|
|
|
|
|
;;
|
|
|
|
;; APPLY TO MODE
|
|
|
|
;;
|
|
|
|
(if (not mode)
|
|
|
|
(error "You must specify a MODE for your templates"))
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; Calculate priority
|
|
|
|
;;
|
|
|
|
(if (not priority)
|
2010-09-21 18:11:23 -04:00
|
|
|
(let ((d (expand-file-name (file-name-directory (buffer-file-name))))
|
|
|
|
(sd (expand-file-name (file-name-directory (locate-library "srecode"))))
|
|
|
|
(defaultdelta (if (eq mode 'default) 0 10)))
|
|
|
|
;; @TODO : WHEN INTEGRATING INTO EMACS
|
|
|
|
;; The location of Emacs default templates needs to be specified
|
|
|
|
;; here to also have a lower priority.
|
|
|
|
(if (string-match (concat "^" sd) d)
|
|
|
|
(setq priority (+ 30 defaultdelta))
|
|
|
|
;; If the user created template is for a project, then
|
|
|
|
;; don't add as much as if it is unique to just some user.
|
|
|
|
(if (stringp project)
|
|
|
|
(setq priority (+ 50 defaultdelta))
|
|
|
|
(setq priority (+ 80 defaultdelta))))
|
Merge from CEDET upstream (8564).
* lisp/emacs-lisp:
* emacs-lisp/eieio.el (eieio--defalias, eieio-hook)
(eieio-error-unsupported-class-tags, eieio-skip-typecheck)
(eieio-optimize-primary-methods-flag, eieio-initializing-object)
(eieio-unbound, eieio-default-superclass)
(eieio--define-field-accessors, method-static, method-before)
(method-primary, method-after, method-num-lists)
(method-generic-before, method-generic-primary)
(method-generic-after, method-num-slots)
(eieio-specialized-key-to-generic-key)
(eieio--check-type, class-v, class-p)
(eieio-class-name, define-obsolete-function-alias)
(eieio-class-parents-fast, eieio-class-children-fast)
(same-class-fast-p, class-constructor, generic-p)
(generic-primary-only-p, generic-primary-only-one-p)
(class-option-assoc, class-option, eieio-object-p)
(class-abstract-p, class-method-invocation-order)
(eieio-defclass-autoload-map, eieio-defclass-autoload)
(eieio-class-un-autoload, eieio-defclass)
(eieio-eval-default-p, eieio-perform-slot-validation-for-default)
(eieio-add-new-slot, eieio-copy-parents-into-subclass)
(eieio--defgeneric-init-form, eieio-defgeneric-form)
(eieio-defgeneric-reset-generic-form)
(eieio-defgeneric-form-primary-only)
(eieio-defgeneric-reset-generic-form-primary-only)
(eieio-defgeneric-form-primary-only-one)
(eieio-defgeneric-reset-generic-form-primary-only-one)
(eieio-unbind-method-implementations)
(eieio--defmethod, eieio--typep)
(eieio-perform-slot-validation, eieio-validate-slot-value)
(eieio-validate-class-slot-value, eieio-barf-if-slot-unbound)
(eieio-oref, eieio-oref-default, eieio-default-eval-maybe)
(eieio-oset, eieio-oset-default, eieio-slot-originating-class-p)
(eieio-slot-name-index, eieio-class-slot-name-index)
(eieio-set-defaults, eieio-initarg-to-attribute)
(eieio-attribute-to-initarg, eieio-c3-candidate)
(eieio-c3-merge-lists, eieio-class-precedence-c3)
(eieio-class-precedence-dfs, eieio-class-precedence-bfs)
(eieio-class-precedence-list, eieio-generic-call-methodname)
(eieio-generic-call-arglst, eieio-generic-call-key)
(eieio-generic-call-next-method-list)
(eieio-pre-method-execution-functions, eieio-generic-call)
(eieio-generic-call-primary-only, eieiomt-method-list)
(eieiomt-optimizing-obarray, eieiomt-install)
(eieiomt-add, eieiomt-next, eieiomt-sym-optimize)
(eieio-generic-form, eieio-defmethod, make-obsolete)
(eieio-defgeneric, make-obsolete): Moved to eieio-core.el
(defclass): Remove `eval-and-compile' from macro.
(call-next-method, shared-initialize): Instead of using
`scoped-class' variable, use new eieio--scoped-class, and
eieio--with-scoped-class.
(initialize-instance): Rename local variable 'scoped-class' to
'this-class' to remove ambiguitity from old global.
* emacs-lisp/eieio-core.el: New file. Derived from key parts of
eieio.el.
(eieio--scoped-class-stack): New variable
(eieio--scoped-class): New fcn
(eieio--with-scoped-class): New scoping macro.
(eieio-defclass): Use pushnew instead of add-to-list.
(eieio-defgeneric-form-primary-only-one, eieio-oset-default)
(eieio-slot-name-index, eieio-set-defaults, eieio-generic-call)
(eieio-generic-call-primary-only, eieiomt-add): Instead of using
`scoped-class' variable, use new eieio--scoped-class, and
eieio--with-scoped-class.
* emacs-lisp/eieio-base.el (cl-lib): Require during compile.
* admin/grammars:
* grammars/srecode-template.wy (variable): Accept a single number
as a variable value. Allows the 'priority' to be set to a number.
(wisent-srecode-template-lexer): Move number up so it can be
created.
* etc/srecode:
* srecode/c.srt (header_guard): Add :c parameter so it works
standalone
* lisp/cedet:
* semantic/edit.el (semantic-change-function): Use
`save-match-data' around running hooks.
* semantic/decorate/mode.el
(semantic-decorate-style-predicate-default)
(semantic-decorate-style-highlighter-default): New.
(semantic-decoration-mode): Do not require
`semantic/decorate/include' anymore.
(semantic-toggle-decoration-style): Error if an unknown decoration
style is toggled.
(define-semantic-decoration-style): Add new :load option. When
:load is specified, add autoload tokens for the definition
functions so that code is loaded when the mode is used.
(semantic-decoration-on-includes): New autoload definition for
highlighting includes.
* semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc
characters to appear after the tested variable.
* semantic/ede-grammar.el (project-compile-target): Calculate full
src name via ede-expand-filename instead of the crutch of the
current buffer. Enables this target to compile in batch mode.
* semantic/idle.el
(semantic-idle-symbol-maybe-highlight): Wrap highlighting of
remote symbol with `save-excursion'.
(semantic-idle-scheduler-work-parse-neighboring-files): Instead of
using directory-files on each found mode pattern, collect all the
patterns for the current mode, and then for each file, see if it
matches any of them. If it does, parse the file. (Patch
inspiration from Tomasz Gajewski.)
* semantic/ctxt.el (semantic-ctxt-end-of-symbol): New.
(semantic-ctxt-current-symbol-default): New.
* semantic/bovine/el.el (semantic-default-elisp-setup): Add
autoload cookie. Explain existence.
(footer): Add local variable for loaddefs.
* semantic/db.el (semanticdb-file-table-object): Add new filter,
only checking for regular files too.
* semantic/wisent/python.el
(semantic-format-tag-abbreviate): New override. Cuts back on size
of code tags.
* srecode/compile.el (srecode-compile-templates): Fix warning
punctuation. Remove status messages to clean up testing output
* ede/base.el (ede-project-placeholder-cache-file): Update doc to
mention 'nil' value.
(ede-save-cache): Disable cache save if file is nil.
* ede.el (ede-initialize-state-current-buffer): Flush deleted
projects.
(global-ede-mode): Always append our find-file-hook to the end.
(ede-flush-deleted-projects): New command.
* ede/cpp-root.el (ede-preprocessor-map): Protect against init
problems.
* ede/proj.el (ede-proj-target): Added a new "custom" option for
custom symbols representing a compiler or linker instead of
restricting things to only the predefined compilers and linkers.
* semantic.el (semantic-mode-map): To avoid showing showing
Development menu twice, only disable menu item if menu-bar is
actually enabled, otherwise the popup 'global menu' might display
a disabled Development menu.
* semantic/complete.el
(semantic-displayor-show-request): Fix which slot in obj is set to
the max tags.
2013-06-02 15:33:09 +02:00
|
|
|
(when (called-interactively-p 'interactive)
|
|
|
|
(message "Templates %s has estimated priority of %d"
|
|
|
|
(file-name-nondirectory (buffer-file-name))
|
|
|
|
priority)))
|
|
|
|
(when (called-interactively-p 'interactive)
|
|
|
|
(message "Compiling templates %s priority %d... done!"
|
|
|
|
(file-name-nondirectory (buffer-file-name))
|
|
|
|
priority)))
|
2009-09-20 21:06:41 +00:00
|
|
|
|
|
|
|
;; Save it up!
|
2012-10-02 02:10:29 +08:00
|
|
|
(srecode-compile-template-table table mode priority application framework project vars)
|
2009-09-20 21:06:41 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2010-09-21 18:11:23 -04:00
|
|
|
(defun srecode-compile-one-template-tag (tag state)
|
|
|
|
"Compile a template tag TAG into a srecode template object.
|
|
|
|
STATE is the current compile state as an object of class
|
|
|
|
`srecode-compile-state'."
|
|
|
|
(let* ((context (oref state context))
|
|
|
|
(code (cdr (srecode-compile-split-code
|
|
|
|
tag (semantic-tag-get-attribute tag :code)
|
|
|
|
state)))
|
|
|
|
(args (semantic-tag-function-arguments tag))
|
|
|
|
(binding (semantic-tag-get-attribute tag :binding))
|
|
|
|
(dict-tags (semantic-tag-get-attribute tag :dictionaries))
|
|
|
|
(root-dict (when dict-tags
|
|
|
|
(srecode-create-dictionaries-from-tags
|
|
|
|
dict-tags state)))
|
|
|
|
(addargs))
|
|
|
|
;; Examine arguments.
|
|
|
|
(dolist (arg args)
|
|
|
|
(let ((symbol (intern arg)))
|
|
|
|
(push symbol addargs)
|
|
|
|
|
|
|
|
;; If we have a wrap, then put wrap inserters on both ends of
|
|
|
|
;; the code.
|
|
|
|
(when (eq symbol :blank)
|
|
|
|
(setq code (append
|
|
|
|
(list (srecode-compile-inserter
|
|
|
|
"BLANK"
|
|
|
|
"\r"
|
|
|
|
state
|
|
|
|
:secondname nil
|
|
|
|
:where 'begin))
|
|
|
|
code
|
|
|
|
(list (srecode-compile-inserter
|
|
|
|
"BLANK"
|
|
|
|
"\r"
|
|
|
|
state
|
|
|
|
:secondname nil
|
|
|
|
:where 'end)))))))
|
|
|
|
|
|
|
|
;; Construct and return the template object.
|
2009-09-20 21:06:41 +00:00
|
|
|
(srecode-template (semantic-tag-name tag)
|
2010-09-21 18:11:23 -04:00
|
|
|
:context context
|
|
|
|
:args (nreverse addargs)
|
|
|
|
:dictionary root-dict
|
|
|
|
:binding binding
|
|
|
|
:code code))
|
|
|
|
)
|
2009-09-20 21:06:41 +00:00
|
|
|
|
|
|
|
(defun srecode-compile-do-hard-newline-p (comp)
|
|
|
|
"Examine COMP to decide if the upcoming newline should be hard.
|
|
|
|
It is hard if the previous inserter is a newline object."
|
|
|
|
(while (and comp (stringp (car comp)))
|
|
|
|
(setq comp (cdr comp)))
|
|
|
|
(or (not comp)
|
2012-10-02 02:10:29 +08:00
|
|
|
(progn (require 'srecode/insert)
|
|
|
|
(srecode-template-inserter-newline-child-p (car comp)))))
|
2009-09-20 21:06:41 +00:00
|
|
|
|
|
|
|
(defun srecode-compile-split-code (tag str STATE
|
|
|
|
&optional end-name)
|
|
|
|
"Split the code for TAG into something templatable.
|
|
|
|
STR is the string of code from TAG to split.
|
|
|
|
STATE is the current compile state.
|
|
|
|
ESCAPE_START and ESCAPE_END are regexps that indicate the beginning
|
|
|
|
escape character, and end escape character pattern for expandable
|
|
|
|
macro names.
|
|
|
|
Optional argument END-NAME specifies the name of a token upon which
|
|
|
|
parsing should stop.
|
|
|
|
If END-NAME is specified, and the input string"
|
|
|
|
(let* ((what str)
|
|
|
|
(end-token nil)
|
|
|
|
(comp nil)
|
|
|
|
(regex (concat "\n\\|" (regexp-quote (oref STATE escape_start))))
|
|
|
|
(regexend (regexp-quote (oref STATE escape_end)))
|
|
|
|
)
|
|
|
|
(while (and what (not end-token))
|
|
|
|
(cond
|
|
|
|
((string-match regex what)
|
|
|
|
(let* ((prefix (substring what 0 (match-beginning 0)))
|
|
|
|
(match (substring what
|
|
|
|
(match-beginning 0)
|
|
|
|
(match-end 0)))
|
|
|
|
(namestart (match-end 0))
|
|
|
|
(junk (string-match regexend what namestart))
|
2015-05-06 09:12:40 -04:00
|
|
|
end tail name)
|
2009-09-20 21:06:41 +00:00
|
|
|
;; Add string to compiled output
|
|
|
|
(when (> (length prefix) 0)
|
|
|
|
(setq comp (cons prefix comp)))
|
|
|
|
(if (string= match "\n")
|
|
|
|
;; Do newline thingy.
|
|
|
|
(let ((new-inserter
|
|
|
|
(srecode-compile-inserter
|
|
|
|
"INDENT"
|
|
|
|
"\n"
|
|
|
|
STATE
|
|
|
|
:secondname nil
|
|
|
|
;; This newline is "hard" meaning ALWAYS do it
|
|
|
|
;; if the previous entry is also a newline.
|
|
|
|
;; Without it, user entered blank lines will be
|
|
|
|
;; ignored.
|
|
|
|
:hard (srecode-compile-do-hard-newline-p comp)
|
|
|
|
)))
|
|
|
|
;; Trim WHAT back.
|
|
|
|
(setq what (substring what namestart))
|
|
|
|
(when (> (length what) 0)
|
|
|
|
;; make the new inserter, but only if we aren't last.
|
|
|
|
(setq comp (cons new-inserter comp))
|
|
|
|
))
|
|
|
|
;; Regular inserter thingy.
|
|
|
|
(setq end (if junk
|
|
|
|
(match-beginning 0)
|
|
|
|
(error "Could not find end escape for %s"
|
|
|
|
(semantic-tag-name tag)))
|
|
|
|
tail (match-end 0))
|
|
|
|
(cond ((not end)
|
|
|
|
(error "No matching escape end for %s"
|
|
|
|
(semantic-tag-name tag)))
|
|
|
|
((<= end namestart)
|
|
|
|
(error "Stray end escape for %s"
|
|
|
|
(semantic-tag-name tag)))
|
|
|
|
)
|
|
|
|
;; Add string to compiled output
|
2015-05-06 09:12:40 -04:00
|
|
|
(setq name (substring what namestart end))
|
2009-09-20 21:06:41 +00:00
|
|
|
;; Trim WHAT back.
|
|
|
|
(setq what (substring what tail))
|
|
|
|
;; Get the inserter
|
|
|
|
(let ((new-inserter
|
|
|
|
(srecode-compile-parse-inserter name STATE))
|
|
|
|
)
|
|
|
|
;; If this is an end inserter, then assign into
|
|
|
|
;; the end-token.
|
|
|
|
(if (srecode-match-end new-inserter end-name)
|
|
|
|
(setq end-token new-inserter))
|
|
|
|
;; Add the inserter to our compilation stream.
|
|
|
|
(setq comp (cons new-inserter comp))
|
|
|
|
;; Allow the inserter an opportunity to modify
|
|
|
|
;; the input stream.
|
|
|
|
(setq what (srecode-parse-input new-inserter tag what
|
|
|
|
STATE))
|
|
|
|
)
|
|
|
|
)))
|
|
|
|
(t
|
|
|
|
(if end-name
|
|
|
|
(error "Unmatched section end %s" end-name))
|
|
|
|
(setq comp (cons what comp)
|
|
|
|
what nil))))
|
|
|
|
(cons what (nreverse comp))))
|
|
|
|
|
|
|
|
(defun srecode-compile-parse-inserter (txt STATE)
|
|
|
|
"Parse the inserter TXT with the current STATE.
|
|
|
|
Return an inserter object."
|
|
|
|
(let ((key (aref txt 0))
|
2009-09-20 21:48:30 +00:00
|
|
|
name
|
2009-09-20 21:06:41 +00:00
|
|
|
)
|
|
|
|
(if (and (or (< key ?A) (> key ?Z))
|
|
|
|
(or (< key ?a) (> key ?z)) )
|
|
|
|
(setq name (substring txt 1))
|
|
|
|
(setq name txt
|
|
|
|
key nil))
|
|
|
|
(let* ((junk (string-match ":" name))
|
|
|
|
(namepart (if junk
|
|
|
|
(substring name 0 (match-beginning 0))
|
|
|
|
name))
|
|
|
|
(secondname (if junk
|
|
|
|
(substring name (match-end 0))
|
|
|
|
nil))
|
|
|
|
(new-inserter (srecode-compile-inserter
|
|
|
|
namepart key STATE
|
|
|
|
:secondname secondname
|
|
|
|
)))
|
|
|
|
;; Return the new inserter
|
|
|
|
new-inserter)))
|
|
|
|
|
|
|
|
(defun srecode-compile-inserter (name key STATE &rest props)
|
|
|
|
"Create an srecode inserter object for some macro NAME.
|
|
|
|
KEY indicates a single character key representing a type
|
|
|
|
of inserter to create.
|
|
|
|
STATE is the current compile state.
|
|
|
|
PROPS are additional properties that might need to be passed
|
|
|
|
to the inserter constructor."
|
|
|
|
;;(message "Compile: %s %S" name props)
|
|
|
|
(if (not key)
|
|
|
|
(apply 'srecode-template-inserter-variable name props)
|
2015-01-07 23:11:58 -05:00
|
|
|
(let ((classes (eieio-class-children 'srecode-template-inserter))
|
2009-09-20 21:06:41 +00:00
|
|
|
(new nil))
|
|
|
|
;; Loop over the various subclasses and
|
|
|
|
;; create the correct inserter.
|
|
|
|
(while (and (not new) classes)
|
Merge with CEDET upstream (rev. 8499).
lisp/
* eieio/eieio-datadebug.el (data-debug/eieio-insert-slots):
Inhibit read only while inserting objects.
lisp/cedet/
* semantic.el (navigate-menu): Yank Tag :enable. Make sure
`senator-tag-ring' is bound.
(semantic-parse-region-default): Stop reversing the output of
parse-whole-stream.
(semantic-repeat-parse-whole-stream): Append returned tags
differently, so they come out in the right order.
* semantic/sb.el (semantic-sb-filter-tags-of-class): New option.
(semantic-sb-fetch-tag-table): Filter tags being bucketed to exclude
tags belonging to above filtered classes.
* semantic/find.el (semantic-filter-tags-by-class): New function.
* semantic/tag-ls.el (semantic-tag-similar-p-default): Add
short-circuit in case tag1 and 2 are identical.
* semantic/analyze/fcn.el
(semantic-analyze-dereference-metatype-stack): Use
`semantic-tag-similar-p' instead of 'eq' when comparing two tags
during metatype evaluation in case they are the same, but not the same
node. (Tweaked patch from Tomasz Gajewski) (Tiny change)
* semantic/db-find.el (semanticdb-partial-synchronize): Fix require to
semantic/db-typecache to be correct.
(semanticdb-find-tags-external-children-of-type): Make this a brutish
search by default.
* semantic/sort.el (semantic-tag-external-member-children-default):
When calling `semanticdb-find-tags-external-children-of-type', pass in
the input tag as the place to start searching for externally defined
methods.
* semantic/db-file.el (semanticdb-default-save-directory): Doc
fix: Add ref to default value.
* semantic/complete.el (semantic-complete-post-command-hook): When
detecting if cursor is outside completion area, do so if cursor moves
before start of overlay, or the original starting location of the
overlay (i.e., if user deletes past beginning of the overlay region).
(semantic-complete-inline-tag-engine): Initialize original start of
`semantic-complete-inline-overlay'.
* semantic/bovine/c.el (semantic-c-describe-environment): Update some
section titles. Test semanticdb table before printing it.
(semantic-c-reset-preprocessor-symbol-map): Update
`semantic-lex-spp-macro-symbol-obarray' outside the loop over all the
files contributing to its value.
(semantic-c-describe-environment): If there is an EDE project but no
spp symbols from it, say so.
* srecode/args.el (srecode-semantic-handle-:project): New argument
handler. Provide variable values if not in an EDE project.
* srecode/srt-mode.el (srecode-template-mode): Fix typo on srecode
name.
* srecode/cpp.el (srecode-semantic-handle-:c): Replace all characters
in FILENAME_SYMBOL that aren't valid CPP symbol chars.
* srecode/map.el (srecode-map-validate-file-for-mode): Force semantic
to load if it is not active in the template being added to the map.
* srecode/srt.el: Add local variables for setting the autoload file
name.
(srecode-semantic-handle-:srt): New autoload cookie
* ede.el (ede-apply-preprocessor-map): Apply map to
`semantic-lex-spp-project-macro-symbol-obarray' instead of the system
one. Add require for semantic.
* ede/proj-elisp.el (ede-update-version-in-source): In case a file has
both a version variable and a Version: comment, always use
`call-next-method'.
* ede/cpp-root.el (ede-set-project-variables): Deleted.
`ede-preprocessor-map' does the job this function was attempting to do
with :spp-table.
(ede-preprocessor-map): Update file tests to provide better messages.
Do not try to get symbols from a file that is the file in the current
buffer.
* ede/base.el (ede-project-placeholder): Add more documentation to
:file slot.
(ede-load-cache): Use `insert-file-contents' instead of
`find-file-noselect' in order to avoid activating other tools.
* semantic/bovine/c.el (semantic-get-local-variables): Also add a new
variable 'this' if we are in an inline member function. For detecting
this, we check overlays at point if there is a class spanning the
current function. Also, the variable 'this' has to be a pointer.
* semantic/bovine/gcc.el (semantic-gcc-setup): Fail gracefully when
querying g++ for defines returns an error.
* srecode/srt-mode.el:
* srecode/compile.el:
* semantic/elp.el:
* semantic/db-el.el:
* semantic/complete.el:
* ede.el:
* cogre.el:
* srecode/table.el:
* srecode/mode.el:
* srecode/insert.el:
* srecode/compile.el:
* semantic/decorate/include.el:
* semantic/db.el:
* semantic/adebug.el:
* ede/auto.el:
* srecode/dictionary.el:
* semantic/ede-grammar.el:
* semantic/db.el:
* semantic/db-find.el:
* semantic/db-file.el:
* semantic/complete.el:
* semantic/bovine/c.el:
* semantic/analyze.el:
* ede/util.el:
* ede/proj.el:
* ede/proj-elisp.el:
* ede/pconf.el:
* ede/locate.el:
* ede.el: Adapt to EIEIO namespace cleanup: Rename `object-name' to
`eieio-object-name', `object-set-name-string' to
`eieio-object-set-name-string', `object-class' to
`eieio-object-class', `class-parent' to `eieio-class-parent',
`class-parents' to `eieio-class-parents', `class-children' to
`eieio-class-children', `object-name-string' to
`eieio-object-name-string', `object-class-fast' to
`eieio--object-class'. Also replace direct access with new accessor
functions.
* ede/cpp-root.el (ede-project-autoload, initialize-instance): Fix EDE
file symbol to match rename. Fix ede-cpp-root symbol to include
-project in name.
* cedet-files.el (cedet-files-list-recursively): New function.
Recursively find files whose names are matching to given regex
* ede.el (ede-current-project): Rewrite to avoid imperative style.
* ede/files.el (ede-find-file): Simplify code.
* ede/base.el (ede-normalize-file/directory): Add function to
normalize :file or :directory slots if they are missing.
* ede/cpp-root.el (ede-cpp-root-project): Add compile-command slot.
(project-compile-project): Compiles project using value specified in
:compule-command slot or in compile-command local variable. Value of
slot or local variable could be string or function that receives
project and should return string that will be invoked as command.
(project-compile-target): Invokes compilation of whole project
* ede/files.el (ede-find-project-root): New function to find root of
project that contains specific file.
(ede-files-find-existing): New function which checks presence of given
directory in the list of registered projects.
etc/
* srecode/ede-autoconf.srt: Change Copyright to FSF.
(ede-empty): Change AC_INIT to use PROJECT_NAME, and PROJECT_VERSION.
* srecode/ede-make.srt (ede-empty): Add a dependency on :project. Add
header comment specifying the project's relative path.
* srecode/c.srt (header_guard): Upcase the filename symbol.
* srecode/java.srt (empty-main): New.
(class-tag): Decapitalize class.
2013-03-21 23:11:03 +01:00
|
|
|
(setq classes (append classes (eieio-class-children (car classes))))
|
2009-09-20 21:06:41 +00:00
|
|
|
;; Do we have a match?
|
|
|
|
(when (and (not (class-abstract-p (car classes)))
|
2015-05-06 09:12:40 -04:00
|
|
|
(equal (oref-default (car classes) key) key))
|
2009-09-20 21:06:41 +00:00
|
|
|
;; Create the new class, and apply state.
|
|
|
|
(setq new (apply (car classes) name props))
|
|
|
|
(srecode-inserter-apply-state new STATE)
|
|
|
|
)
|
|
|
|
(setq classes (cdr classes)))
|
|
|
|
(if (not new) (error "SRECODE: Unknown macro code %S" key))
|
|
|
|
new)))
|
|
|
|
|
2012-10-02 02:10:29 +08:00
|
|
|
(defun srecode-compile-template-table (templates mode priority application framework project vars)
|
2009-09-20 21:06:41 +00:00
|
|
|
"Compile a list of TEMPLATES into an semantic recode table.
|
|
|
|
The table being compiled is for MODE, or the string \"default\".
|
|
|
|
PRIORITY is a numerical value that indicates this tables location
|
|
|
|
in an ordered search.
|
|
|
|
APPLICATION is the name of the application these templates belong to.
|
2012-10-02 02:10:29 +08:00
|
|
|
FRAMEWORK is the name of the framework these templates belong to.
|
2010-09-21 18:11:23 -04:00
|
|
|
PROJECT is a directory name which these templates scope to.
|
2009-09-20 21:06:41 +00:00
|
|
|
A list of defined variables VARS provides a variable table."
|
|
|
|
(let ((namehash (make-hash-table :test 'equal
|
|
|
|
:size (length templates)))
|
|
|
|
(contexthash (make-hash-table :test 'equal :size 10))
|
|
|
|
(lp templates)
|
|
|
|
)
|
|
|
|
|
|
|
|
(while lp
|
|
|
|
|
|
|
|
(let* ((objname (oref (car lp) :object-name))
|
|
|
|
(context (oref (car lp) :context))
|
|
|
|
(globalname (concat context ":" objname))
|
|
|
|
)
|
|
|
|
|
|
|
|
;; Place this template object into the global name hash.
|
|
|
|
(puthash globalname (car lp) namehash)
|
|
|
|
|
|
|
|
;; Place this template into the specific context name hash.
|
|
|
|
(let ((hs (gethash context contexthash)))
|
|
|
|
;; Make a new context if none was available.
|
|
|
|
(when (not hs)
|
|
|
|
(setq hs (make-hash-table :test 'equal :size 20))
|
|
|
|
(puthash context hs contexthash))
|
2011-11-14 23:55:13 -08:00
|
|
|
;; Put into that context's hash.
|
2009-09-20 21:06:41 +00:00
|
|
|
(puthash objname (car lp) hs)
|
|
|
|
)
|
|
|
|
|
|
|
|
(setq lp (cdr lp))))
|
|
|
|
|
2010-09-21 18:11:23 -04:00
|
|
|
(when (stringp project)
|
|
|
|
(setq project (expand-file-name project)))
|
|
|
|
|
2009-09-20 21:06:41 +00:00
|
|
|
(let* ((table (srecode-mode-table-new mode (buffer-file-name)
|
|
|
|
:templates (nreverse templates)
|
|
|
|
:namehash namehash
|
|
|
|
:contexthash contexthash
|
|
|
|
:variables vars
|
|
|
|
:major-mode mode
|
|
|
|
:priority priority
|
2010-09-21 18:11:23 -04:00
|
|
|
:application application
|
2012-10-02 02:10:29 +08:00
|
|
|
:framework framework
|
2010-09-21 18:11:23 -04:00
|
|
|
:project project))
|
2009-09-20 21:06:41 +00:00
|
|
|
(tmpl (oref table templates)))
|
|
|
|
;; Loop over all the templates, and xref.
|
|
|
|
(while tmpl
|
|
|
|
(oset (car tmpl) :table table)
|
|
|
|
(setq tmpl (cdr tmpl))))
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; DEBUG
|
|
|
|
;;
|
|
|
|
;; Dump out information about the current srecoder compiled templates.
|
|
|
|
;;
|
|
|
|
|
2015-02-04 13:49:49 -05:00
|
|
|
(cl-defmethod srecode-dump ((tmp srecode-template))
|
2009-09-20 21:06:41 +00:00
|
|
|
"Dump the contents of the SRecode template tmp."
|
|
|
|
(princ "== Template \"")
|
Merge with CEDET upstream (rev. 8499).
lisp/
* eieio/eieio-datadebug.el (data-debug/eieio-insert-slots):
Inhibit read only while inserting objects.
lisp/cedet/
* semantic.el (navigate-menu): Yank Tag :enable. Make sure
`senator-tag-ring' is bound.
(semantic-parse-region-default): Stop reversing the output of
parse-whole-stream.
(semantic-repeat-parse-whole-stream): Append returned tags
differently, so they come out in the right order.
* semantic/sb.el (semantic-sb-filter-tags-of-class): New option.
(semantic-sb-fetch-tag-table): Filter tags being bucketed to exclude
tags belonging to above filtered classes.
* semantic/find.el (semantic-filter-tags-by-class): New function.
* semantic/tag-ls.el (semantic-tag-similar-p-default): Add
short-circuit in case tag1 and 2 are identical.
* semantic/analyze/fcn.el
(semantic-analyze-dereference-metatype-stack): Use
`semantic-tag-similar-p' instead of 'eq' when comparing two tags
during metatype evaluation in case they are the same, but not the same
node. (Tweaked patch from Tomasz Gajewski) (Tiny change)
* semantic/db-find.el (semanticdb-partial-synchronize): Fix require to
semantic/db-typecache to be correct.
(semanticdb-find-tags-external-children-of-type): Make this a brutish
search by default.
* semantic/sort.el (semantic-tag-external-member-children-default):
When calling `semanticdb-find-tags-external-children-of-type', pass in
the input tag as the place to start searching for externally defined
methods.
* semantic/db-file.el (semanticdb-default-save-directory): Doc
fix: Add ref to default value.
* semantic/complete.el (semantic-complete-post-command-hook): When
detecting if cursor is outside completion area, do so if cursor moves
before start of overlay, or the original starting location of the
overlay (i.e., if user deletes past beginning of the overlay region).
(semantic-complete-inline-tag-engine): Initialize original start of
`semantic-complete-inline-overlay'.
* semantic/bovine/c.el (semantic-c-describe-environment): Update some
section titles. Test semanticdb table before printing it.
(semantic-c-reset-preprocessor-symbol-map): Update
`semantic-lex-spp-macro-symbol-obarray' outside the loop over all the
files contributing to its value.
(semantic-c-describe-environment): If there is an EDE project but no
spp symbols from it, say so.
* srecode/args.el (srecode-semantic-handle-:project): New argument
handler. Provide variable values if not in an EDE project.
* srecode/srt-mode.el (srecode-template-mode): Fix typo on srecode
name.
* srecode/cpp.el (srecode-semantic-handle-:c): Replace all characters
in FILENAME_SYMBOL that aren't valid CPP symbol chars.
* srecode/map.el (srecode-map-validate-file-for-mode): Force semantic
to load if it is not active in the template being added to the map.
* srecode/srt.el: Add local variables for setting the autoload file
name.
(srecode-semantic-handle-:srt): New autoload cookie
* ede.el (ede-apply-preprocessor-map): Apply map to
`semantic-lex-spp-project-macro-symbol-obarray' instead of the system
one. Add require for semantic.
* ede/proj-elisp.el (ede-update-version-in-source): In case a file has
both a version variable and a Version: comment, always use
`call-next-method'.
* ede/cpp-root.el (ede-set-project-variables): Deleted.
`ede-preprocessor-map' does the job this function was attempting to do
with :spp-table.
(ede-preprocessor-map): Update file tests to provide better messages.
Do not try to get symbols from a file that is the file in the current
buffer.
* ede/base.el (ede-project-placeholder): Add more documentation to
:file slot.
(ede-load-cache): Use `insert-file-contents' instead of
`find-file-noselect' in order to avoid activating other tools.
* semantic/bovine/c.el (semantic-get-local-variables): Also add a new
variable 'this' if we are in an inline member function. For detecting
this, we check overlays at point if there is a class spanning the
current function. Also, the variable 'this' has to be a pointer.
* semantic/bovine/gcc.el (semantic-gcc-setup): Fail gracefully when
querying g++ for defines returns an error.
* srecode/srt-mode.el:
* srecode/compile.el:
* semantic/elp.el:
* semantic/db-el.el:
* semantic/complete.el:
* ede.el:
* cogre.el:
* srecode/table.el:
* srecode/mode.el:
* srecode/insert.el:
* srecode/compile.el:
* semantic/decorate/include.el:
* semantic/db.el:
* semantic/adebug.el:
* ede/auto.el:
* srecode/dictionary.el:
* semantic/ede-grammar.el:
* semantic/db.el:
* semantic/db-find.el:
* semantic/db-file.el:
* semantic/complete.el:
* semantic/bovine/c.el:
* semantic/analyze.el:
* ede/util.el:
* ede/proj.el:
* ede/proj-elisp.el:
* ede/pconf.el:
* ede/locate.el:
* ede.el: Adapt to EIEIO namespace cleanup: Rename `object-name' to
`eieio-object-name', `object-set-name-string' to
`eieio-object-set-name-string', `object-class' to
`eieio-object-class', `class-parent' to `eieio-class-parent',
`class-parents' to `eieio-class-parents', `class-children' to
`eieio-class-children', `object-name-string' to
`eieio-object-name-string', `object-class-fast' to
`eieio--object-class'. Also replace direct access with new accessor
functions.
* ede/cpp-root.el (ede-project-autoload, initialize-instance): Fix EDE
file symbol to match rename. Fix ede-cpp-root symbol to include
-project in name.
* cedet-files.el (cedet-files-list-recursively): New function.
Recursively find files whose names are matching to given regex
* ede.el (ede-current-project): Rewrite to avoid imperative style.
* ede/files.el (ede-find-file): Simplify code.
* ede/base.el (ede-normalize-file/directory): Add function to
normalize :file or :directory slots if they are missing.
* ede/cpp-root.el (ede-cpp-root-project): Add compile-command slot.
(project-compile-project): Compiles project using value specified in
:compule-command slot or in compile-command local variable. Value of
slot or local variable could be string or function that receives
project and should return string that will be invoked as command.
(project-compile-target): Invokes compilation of whole project
* ede/files.el (ede-find-project-root): New function to find root of
project that contains specific file.
(ede-files-find-existing): New function which checks presence of given
directory in the list of registered projects.
etc/
* srecode/ede-autoconf.srt: Change Copyright to FSF.
(ede-empty): Change AC_INIT to use PROJECT_NAME, and PROJECT_VERSION.
* srecode/ede-make.srt (ede-empty): Add a dependency on :project. Add
header comment specifying the project's relative path.
* srecode/c.srt (header_guard): Upcase the filename symbol.
* srecode/java.srt (empty-main): New.
(class-tag): Decapitalize class.
2013-03-21 23:11:03 +01:00
|
|
|
(princ (eieio-object-name-string tmp))
|
2009-09-20 21:06:41 +00:00
|
|
|
(princ "\" in context ")
|
|
|
|
(princ (oref tmp context))
|
|
|
|
(princ "\n")
|
|
|
|
(when (oref tmp args)
|
|
|
|
(princ " Arguments: ")
|
|
|
|
(prin1 (oref tmp args))
|
|
|
|
(princ "\n"))
|
|
|
|
(when (oref tmp dictionary)
|
|
|
|
(princ " Section Dictionaries:\n")
|
|
|
|
(srecode-dump (oref tmp dictionary) 4)
|
|
|
|
;(princ "\n")
|
|
|
|
)
|
|
|
|
(when (and (slot-boundp tmp 'binding) (oref tmp binding))
|
|
|
|
(princ " Binding: ")
|
|
|
|
(prin1 (oref tmp binding))
|
|
|
|
(princ "\n"))
|
|
|
|
(princ " Compiled Codes:\n")
|
|
|
|
(srecode-dump-code-list (oref tmp code) " ")
|
|
|
|
(princ "\n\n")
|
|
|
|
)
|
|
|
|
|
|
|
|
(defun srecode-dump-code-list (code indent)
|
|
|
|
"Dump the CODE from a template code list to standard output.
|
|
|
|
Argument INDENT specifies the indentation level for the list."
|
|
|
|
(let ((i 1))
|
|
|
|
(while code
|
|
|
|
(princ indent)
|
|
|
|
(prin1 i)
|
|
|
|
(princ ") ")
|
|
|
|
(cond ((stringp (car code))
|
|
|
|
(prin1 (car code)))
|
|
|
|
((srecode-template-inserter-child-p (car code))
|
|
|
|
(srecode-dump (car code) indent))
|
|
|
|
(t
|
|
|
|
(princ "Unknown Code: ")
|
|
|
|
(prin1 (car code))))
|
|
|
|
(setq code (cdr code)
|
|
|
|
i (1+ i))
|
|
|
|
(when code
|
|
|
|
(princ "\n"))))
|
|
|
|
)
|
|
|
|
|
2015-05-06 09:12:40 -04:00
|
|
|
(cl-defmethod srecode-dump ((ins srecode-template-inserter) _indent)
|
2009-09-20 21:06:41 +00:00
|
|
|
"Dump the state of the SRecode template inserter INS."
|
|
|
|
(princ "INS: \"")
|
Merge with CEDET upstream (rev. 8499).
lisp/
* eieio/eieio-datadebug.el (data-debug/eieio-insert-slots):
Inhibit read only while inserting objects.
lisp/cedet/
* semantic.el (navigate-menu): Yank Tag :enable. Make sure
`senator-tag-ring' is bound.
(semantic-parse-region-default): Stop reversing the output of
parse-whole-stream.
(semantic-repeat-parse-whole-stream): Append returned tags
differently, so they come out in the right order.
* semantic/sb.el (semantic-sb-filter-tags-of-class): New option.
(semantic-sb-fetch-tag-table): Filter tags being bucketed to exclude
tags belonging to above filtered classes.
* semantic/find.el (semantic-filter-tags-by-class): New function.
* semantic/tag-ls.el (semantic-tag-similar-p-default): Add
short-circuit in case tag1 and 2 are identical.
* semantic/analyze/fcn.el
(semantic-analyze-dereference-metatype-stack): Use
`semantic-tag-similar-p' instead of 'eq' when comparing two tags
during metatype evaluation in case they are the same, but not the same
node. (Tweaked patch from Tomasz Gajewski) (Tiny change)
* semantic/db-find.el (semanticdb-partial-synchronize): Fix require to
semantic/db-typecache to be correct.
(semanticdb-find-tags-external-children-of-type): Make this a brutish
search by default.
* semantic/sort.el (semantic-tag-external-member-children-default):
When calling `semanticdb-find-tags-external-children-of-type', pass in
the input tag as the place to start searching for externally defined
methods.
* semantic/db-file.el (semanticdb-default-save-directory): Doc
fix: Add ref to default value.
* semantic/complete.el (semantic-complete-post-command-hook): When
detecting if cursor is outside completion area, do so if cursor moves
before start of overlay, or the original starting location of the
overlay (i.e., if user deletes past beginning of the overlay region).
(semantic-complete-inline-tag-engine): Initialize original start of
`semantic-complete-inline-overlay'.
* semantic/bovine/c.el (semantic-c-describe-environment): Update some
section titles. Test semanticdb table before printing it.
(semantic-c-reset-preprocessor-symbol-map): Update
`semantic-lex-spp-macro-symbol-obarray' outside the loop over all the
files contributing to its value.
(semantic-c-describe-environment): If there is an EDE project but no
spp symbols from it, say so.
* srecode/args.el (srecode-semantic-handle-:project): New argument
handler. Provide variable values if not in an EDE project.
* srecode/srt-mode.el (srecode-template-mode): Fix typo on srecode
name.
* srecode/cpp.el (srecode-semantic-handle-:c): Replace all characters
in FILENAME_SYMBOL that aren't valid CPP symbol chars.
* srecode/map.el (srecode-map-validate-file-for-mode): Force semantic
to load if it is not active in the template being added to the map.
* srecode/srt.el: Add local variables for setting the autoload file
name.
(srecode-semantic-handle-:srt): New autoload cookie
* ede.el (ede-apply-preprocessor-map): Apply map to
`semantic-lex-spp-project-macro-symbol-obarray' instead of the system
one. Add require for semantic.
* ede/proj-elisp.el (ede-update-version-in-source): In case a file has
both a version variable and a Version: comment, always use
`call-next-method'.
* ede/cpp-root.el (ede-set-project-variables): Deleted.
`ede-preprocessor-map' does the job this function was attempting to do
with :spp-table.
(ede-preprocessor-map): Update file tests to provide better messages.
Do not try to get symbols from a file that is the file in the current
buffer.
* ede/base.el (ede-project-placeholder): Add more documentation to
:file slot.
(ede-load-cache): Use `insert-file-contents' instead of
`find-file-noselect' in order to avoid activating other tools.
* semantic/bovine/c.el (semantic-get-local-variables): Also add a new
variable 'this' if we are in an inline member function. For detecting
this, we check overlays at point if there is a class spanning the
current function. Also, the variable 'this' has to be a pointer.
* semantic/bovine/gcc.el (semantic-gcc-setup): Fail gracefully when
querying g++ for defines returns an error.
* srecode/srt-mode.el:
* srecode/compile.el:
* semantic/elp.el:
* semantic/db-el.el:
* semantic/complete.el:
* ede.el:
* cogre.el:
* srecode/table.el:
* srecode/mode.el:
* srecode/insert.el:
* srecode/compile.el:
* semantic/decorate/include.el:
* semantic/db.el:
* semantic/adebug.el:
* ede/auto.el:
* srecode/dictionary.el:
* semantic/ede-grammar.el:
* semantic/db.el:
* semantic/db-find.el:
* semantic/db-file.el:
* semantic/complete.el:
* semantic/bovine/c.el:
* semantic/analyze.el:
* ede/util.el:
* ede/proj.el:
* ede/proj-elisp.el:
* ede/pconf.el:
* ede/locate.el:
* ede.el: Adapt to EIEIO namespace cleanup: Rename `object-name' to
`eieio-object-name', `object-set-name-string' to
`eieio-object-set-name-string', `object-class' to
`eieio-object-class', `class-parent' to `eieio-class-parent',
`class-parents' to `eieio-class-parents', `class-children' to
`eieio-class-children', `object-name-string' to
`eieio-object-name-string', `object-class-fast' to
`eieio--object-class'. Also replace direct access with new accessor
functions.
* ede/cpp-root.el (ede-project-autoload, initialize-instance): Fix EDE
file symbol to match rename. Fix ede-cpp-root symbol to include
-project in name.
* cedet-files.el (cedet-files-list-recursively): New function.
Recursively find files whose names are matching to given regex
* ede.el (ede-current-project): Rewrite to avoid imperative style.
* ede/files.el (ede-find-file): Simplify code.
* ede/base.el (ede-normalize-file/directory): Add function to
normalize :file or :directory slots if they are missing.
* ede/cpp-root.el (ede-cpp-root-project): Add compile-command slot.
(project-compile-project): Compiles project using value specified in
:compule-command slot or in compile-command local variable. Value of
slot or local variable could be string or function that receives
project and should return string that will be invoked as command.
(project-compile-target): Invokes compilation of whole project
* ede/files.el (ede-find-project-root): New function to find root of
project that contains specific file.
(ede-files-find-existing): New function which checks presence of given
directory in the list of registered projects.
etc/
* srecode/ede-autoconf.srt: Change Copyright to FSF.
(ede-empty): Change AC_INIT to use PROJECT_NAME, and PROJECT_VERSION.
* srecode/ede-make.srt (ede-empty): Add a dependency on :project. Add
header comment specifying the project's relative path.
* srecode/c.srt (header_guard): Upcase the filename symbol.
* srecode/java.srt (empty-main): New.
(class-tag): Decapitalize class.
2013-03-21 23:11:03 +01:00
|
|
|
(princ (eieio-object-name-string ins))
|
2009-09-20 21:06:41 +00:00
|
|
|
(when (oref ins :secondname)
|
|
|
|
(princ "\" : \"")
|
|
|
|
(princ (oref ins :secondname)))
|
|
|
|
(princ "\" type \"")
|
Merge with CEDET upstream (rev. 8499).
lisp/
* eieio/eieio-datadebug.el (data-debug/eieio-insert-slots):
Inhibit read only while inserting objects.
lisp/cedet/
* semantic.el (navigate-menu): Yank Tag :enable. Make sure
`senator-tag-ring' is bound.
(semantic-parse-region-default): Stop reversing the output of
parse-whole-stream.
(semantic-repeat-parse-whole-stream): Append returned tags
differently, so they come out in the right order.
* semantic/sb.el (semantic-sb-filter-tags-of-class): New option.
(semantic-sb-fetch-tag-table): Filter tags being bucketed to exclude
tags belonging to above filtered classes.
* semantic/find.el (semantic-filter-tags-by-class): New function.
* semantic/tag-ls.el (semantic-tag-similar-p-default): Add
short-circuit in case tag1 and 2 are identical.
* semantic/analyze/fcn.el
(semantic-analyze-dereference-metatype-stack): Use
`semantic-tag-similar-p' instead of 'eq' when comparing two tags
during metatype evaluation in case they are the same, but not the same
node. (Tweaked patch from Tomasz Gajewski) (Tiny change)
* semantic/db-find.el (semanticdb-partial-synchronize): Fix require to
semantic/db-typecache to be correct.
(semanticdb-find-tags-external-children-of-type): Make this a brutish
search by default.
* semantic/sort.el (semantic-tag-external-member-children-default):
When calling `semanticdb-find-tags-external-children-of-type', pass in
the input tag as the place to start searching for externally defined
methods.
* semantic/db-file.el (semanticdb-default-save-directory): Doc
fix: Add ref to default value.
* semantic/complete.el (semantic-complete-post-command-hook): When
detecting if cursor is outside completion area, do so if cursor moves
before start of overlay, or the original starting location of the
overlay (i.e., if user deletes past beginning of the overlay region).
(semantic-complete-inline-tag-engine): Initialize original start of
`semantic-complete-inline-overlay'.
* semantic/bovine/c.el (semantic-c-describe-environment): Update some
section titles. Test semanticdb table before printing it.
(semantic-c-reset-preprocessor-symbol-map): Update
`semantic-lex-spp-macro-symbol-obarray' outside the loop over all the
files contributing to its value.
(semantic-c-describe-environment): If there is an EDE project but no
spp symbols from it, say so.
* srecode/args.el (srecode-semantic-handle-:project): New argument
handler. Provide variable values if not in an EDE project.
* srecode/srt-mode.el (srecode-template-mode): Fix typo on srecode
name.
* srecode/cpp.el (srecode-semantic-handle-:c): Replace all characters
in FILENAME_SYMBOL that aren't valid CPP symbol chars.
* srecode/map.el (srecode-map-validate-file-for-mode): Force semantic
to load if it is not active in the template being added to the map.
* srecode/srt.el: Add local variables for setting the autoload file
name.
(srecode-semantic-handle-:srt): New autoload cookie
* ede.el (ede-apply-preprocessor-map): Apply map to
`semantic-lex-spp-project-macro-symbol-obarray' instead of the system
one. Add require for semantic.
* ede/proj-elisp.el (ede-update-version-in-source): In case a file has
both a version variable and a Version: comment, always use
`call-next-method'.
* ede/cpp-root.el (ede-set-project-variables): Deleted.
`ede-preprocessor-map' does the job this function was attempting to do
with :spp-table.
(ede-preprocessor-map): Update file tests to provide better messages.
Do not try to get symbols from a file that is the file in the current
buffer.
* ede/base.el (ede-project-placeholder): Add more documentation to
:file slot.
(ede-load-cache): Use `insert-file-contents' instead of
`find-file-noselect' in order to avoid activating other tools.
* semantic/bovine/c.el (semantic-get-local-variables): Also add a new
variable 'this' if we are in an inline member function. For detecting
this, we check overlays at point if there is a class spanning the
current function. Also, the variable 'this' has to be a pointer.
* semantic/bovine/gcc.el (semantic-gcc-setup): Fail gracefully when
querying g++ for defines returns an error.
* srecode/srt-mode.el:
* srecode/compile.el:
* semantic/elp.el:
* semantic/db-el.el:
* semantic/complete.el:
* ede.el:
* cogre.el:
* srecode/table.el:
* srecode/mode.el:
* srecode/insert.el:
* srecode/compile.el:
* semantic/decorate/include.el:
* semantic/db.el:
* semantic/adebug.el:
* ede/auto.el:
* srecode/dictionary.el:
* semantic/ede-grammar.el:
* semantic/db.el:
* semantic/db-find.el:
* semantic/db-file.el:
* semantic/complete.el:
* semantic/bovine/c.el:
* semantic/analyze.el:
* ede/util.el:
* ede/proj.el:
* ede/proj-elisp.el:
* ede/pconf.el:
* ede/locate.el:
* ede.el: Adapt to EIEIO namespace cleanup: Rename `object-name' to
`eieio-object-name', `object-set-name-string' to
`eieio-object-set-name-string', `object-class' to
`eieio-object-class', `class-parent' to `eieio-class-parent',
`class-parents' to `eieio-class-parents', `class-children' to
`eieio-class-children', `object-name-string' to
`eieio-object-name-string', `object-class-fast' to
`eieio--object-class'. Also replace direct access with new accessor
functions.
* ede/cpp-root.el (ede-project-autoload, initialize-instance): Fix EDE
file symbol to match rename. Fix ede-cpp-root symbol to include
-project in name.
* cedet-files.el (cedet-files-list-recursively): New function.
Recursively find files whose names are matching to given regex
* ede.el (ede-current-project): Rewrite to avoid imperative style.
* ede/files.el (ede-find-file): Simplify code.
* ede/base.el (ede-normalize-file/directory): Add function to
normalize :file or :directory slots if they are missing.
* ede/cpp-root.el (ede-cpp-root-project): Add compile-command slot.
(project-compile-project): Compiles project using value specified in
:compule-command slot or in compile-command local variable. Value of
slot or local variable could be string or function that receives
project and should return string that will be invoked as command.
(project-compile-target): Invokes compilation of whole project
* ede/files.el (ede-find-project-root): New function to find root of
project that contains specific file.
(ede-files-find-existing): New function which checks presence of given
directory in the list of registered projects.
etc/
* srecode/ede-autoconf.srt: Change Copyright to FSF.
(ede-empty): Change AC_INIT to use PROJECT_NAME, and PROJECT_VERSION.
* srecode/ede-make.srt (ede-empty): Add a dependency on :project. Add
header comment specifying the project's relative path.
* srecode/c.srt (header_guard): Upcase the filename symbol.
* srecode/java.srt (empty-main): New.
(class-tag): Decapitalize class.
2013-03-21 23:11:03 +01:00
|
|
|
(let* ((oc (symbol-name (eieio-object-class ins)))
|
2009-09-20 21:06:41 +00:00
|
|
|
(junk (string-match "srecode-template-inserter-" oc))
|
|
|
|
(on (if junk
|
|
|
|
(substring oc (match-end 0))
|
|
|
|
oc)))
|
|
|
|
(princ on))
|
|
|
|
(princ "\"")
|
|
|
|
)
|
|
|
|
|
|
|
|
(provide 'srecode/compile)
|
|
|
|
|
|
|
|
;; Local variables:
|
|
|
|
;; generated-autoload-file: "loaddefs.el"
|
|
|
|
;; generated-autoload-load-name: "srecode/compile"
|
|
|
|
;; End:
|
|
|
|
|
|
|
|
;;; srecode/compile.el ends here
|