;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Emacs utilities for writting BRAT classes ;; ;; Paste contents into .emacs file, or load from .emacs file with ;; ;; (load-file "brat.el") ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun brat-header-skel () "Inserts a skeleton for a BRAT class into a declaration file" (interactive) (setq brat-header-name (file-name-sans-extension (buffer-name))) (if (string= "" (symbol-value 'brat-header-name)) (setq brat-header-name (read-string "Class name: ")) ()) (goto-char (point-min)) (insert "// -*- mode: c++ -*- // // $Id$ // #ifndef BRAT_" (symbol-value 'brat-header-name) " #define BRAT_" (symbol-value 'brat-header-name) " class " (symbol-value 'brat-header-name) " { private: public: " (symbol-value 'brat-header-name) "(); ClassDef(" (symbol-value 'brat-header-name) ",0) // }; #endif // // $Log$ // ") (goto-char (point-min))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun brat-source-skel () "Inserts a skeleton for a BRAT class into a implmentation file" (interactive) (setq brat-header-name (file-name-sans-extension (buffer-name))) (if (string= "" (symbol-value 'brat-header-name)) (setq brat-header-name (read-string "Class name: ")) ()) (goto-char (point-min)) (insert "//____________________________________________________________________ // // // //____________________________________________________________________ // $Id$ // $Author$ // $Date$ // $Copyright: " (format-time-string "%Y") " BRAHMS Collaboration // #ifndef BRAT_" (symbol-value 'brat-header-name) " #include \"" (symbol-value 'brat-header-name) ".h\" #endif //____________________________________________________________________ ClassDef(" (symbol-value 'brat-header-name) "); //____________________________________________________________________ " (symbol-value 'brat-header-name) "::" (symbol-value 'brat-header-name) "() { // Default constructor } //____________________________________________________________________ // // $Log$ // ") (goto-char (point-min))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun brat-include-header () "Insert an #include for a BRAT class" (interactive) (setq brat-header-name (read-string "Class name: ")) (insert "#ifndef BRAT_" (symbol-value 'brat-header-name) " #include \"" (symbol-value 'brat-header-name) ".h\" #endif ")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun root-include-header () "Insert an #include for a ROOT class" (interactive) (setq root-header-name (read-string "Class name: ")) (insert "#ifndef ROOT_" (symbol-value 'root-header-name) " #include \"" (symbol-value 'root-header-name) ".h\" #endif "))