diff options
Diffstat (limited to 'scripts/kde-emacs/kde-emacs-semantic.el')
-rw-r--r-- | scripts/kde-emacs/kde-emacs-semantic.el | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/scripts/kde-emacs/kde-emacs-semantic.el b/scripts/kde-emacs/kde-emacs-semantic.el index 6cc8dd54..3e700ed3 100644 --- a/scripts/kde-emacs/kde-emacs-semantic.el +++ b/scripts/kde-emacs/kde-emacs-semantic.el @@ -87,24 +87,24 @@ follows : \"func (int arg\"." ;* Functions ... */ ;*---------------------------------------------------------------------*/ ;; FIXME : semantic doesn't handle QT access specifiers -;(setq-default global-semantic-show-unmatched-syntax-mode nil) -;(setq-default global-semantic-show-dirty-mode nil) +;(set-default global-semantic-show-unmatched-syntax-mode nil) +;(set-default global-semantic-show-dirty-mode nil) (defun kde-format-func-arg (arg) "Formats one argument (from token to string)." (let ((ret "")) (if (semantic-token-variable-extra-spec arg 'const) - (setq ret "const ")) - (setq ret (concat ret (car (semantic-token-type arg)))) + (set ret "const ")) + (set ret (concat ret (car (semantic-token-type arg)))) (if (semantic-token-variable-extra-spec arg 'pointer) (dotimes (idx (semantic-token-variable-extra-spec arg 'pointer)) - (setq ret (concat ret "*")) + (set ret (concat ret "*")) ) ) (if (semantic-token-variable-extra-spec arg 'reference) - (setq ret (concat ret "&")) + (set ret (concat ret "&")) ) - (setq ret (concat ret " " (semantic-token-name arg))) + (set ret (concat ret " " (semantic-token-name arg))) ret )) @@ -114,15 +114,15 @@ Token has to be the function variable list e.g. from semantic-token-function-args" (let ((res kde-expand-arg-start) (idx 1)) (dolist (elt token res) - (setq res (concat res (kde-format-func-arg elt))) + (set res (concat res (kde-format-func-arg elt))) (when (< idx (length token)) - (setq res (concat res kde-expand-arg-break))) - (setq idx (1+ idx)) + (set res (concat res kde-expand-arg-break))) + (set idx (1+ idx)) ) - (setq res (concat res kde-expand-arg-end)) + (set res (concat res kde-expand-arg-end)) ;; if it's something like "( )" replace it with "()" (when (string= res (concat kde-expand-arg-start kde-expand-arg-end)) - (setq res (replace-regexp-in-string "([ \t]+)" "()" res))) + (set res (replace-regexp-in-string "([ \t]+)" "()" res))) res )) @@ -131,8 +131,8 @@ from semantic-token-function-args" token and TOKENS have to be a list of functions from buffer." (let ((ret)(elt)) (while (and TOKENS (not ret)) - (setq elt (car TOKENS)) - (setq TOKENS (cdr TOKENS)) + (set elt (car TOKENS)) + (set TOKENS (cdr TOKENS)) (if (and (string= (semantic-token-name FUNC) (semantic-token-name elt)) (equal (semantic-token-type FUNC) @@ -143,7 +143,7 @@ token and TOKENS have to be a list of functions from buffer." ;; (semantic-token-function-parent FUNC2)) (string= (kde-format-args (semantic-token-function-args FUNC)) (kde-format-args (semantic-token-function-args elt)))) - (setq ret t)) + (set ret t)) ) ret )) @@ -164,8 +164,8 @@ token and TOKENS have to be a list of functions from buffer." (if (looking-at "::") (let ((start) (end)) (re-search-backward "\\b\\w+" (point-at-bol) t) - (setq start (match-beginning 0)) - (setq end (match-end 0)) + (set start (match-beginning 0)) + (set end (match-end 0)) (buffer-substring-no-properties start end) ) ) @@ -227,10 +227,10 @@ would return t" "Constructs a function string from the TOKEN, with the parent class PCLASS." (let ((fname (semantic-token-name token))) (if (semantic-token-function-destructor token) - (setq fname (concat "~" fname)) + (set fname (concat "~" fname)) ) (if pclass - (setq fname (concat pclass "::" fname)) + (set fname (concat pclass "::" fname)) ) (if (and (not (kde-is-constructor token)) @@ -238,21 +238,21 @@ would return t" (progn (cond ((stringp (semantic-token-type token)) - (setq fname (concat (semantic-token-type token) "\n" fname)) + (set fname (concat (semantic-token-type token) "\n" fname)) ) (t - (setq fname (concat (car (semantic-token-type token)) "\n" fname))) + (set fname (concat (car (semantic-token-type token)) "\n" fname))) ) (if (semantic-token-function-extra-spec token 'const) - (setq fname (concat "const " fname)) + (set fname (concat "const " fname)) ) ) ) - (setq fname (concat fname (kde-format-args (semantic-token-function-args token)))) + (set fname (concat fname (kde-format-args (semantic-token-function-args token)))) (if (kde-function-const token) - (setq fname (concat fname " const" )) + (set fname (concat fname " const" )) ) - (setq fname (concat fname "\n{" "\n}")) + (set fname (concat fname "\n{" "\n}")) fname ) ) @@ -271,8 +271,8 @@ class-token has to be a token representing either a class or a struct." (namespace) ) (dolist (elt parts ret) - (setq cur-token (semantic-token-token elt)) - (setq cur-token-name (semantic-token-name elt)) + (set cur-token (semantic-token-token elt)) + (set cur-token-name (semantic-token-name elt)) (cond ((and (eq cur-token 'type) @@ -295,14 +295,14 @@ class-token has to be a token representing either a class or a struct." ;;FUNCTION - generate a skeleton for it (if (and (kde-is-prototype elt) (not asignal)) - (setq ret (concat ret (kde-function-construct elt name) "\n\n")) + (set ret (concat ret (kde-function-construct elt name) "\n\n")) ) ;(insert (kde-function-documentation elt) "\n") ) ((and (eq cur-token 'label) (stringp cur-token-name)) - (setq aslot nil + (set aslot nil asignal nil) ;;LABEL - unsets both Q_SIGNALS and Q_SLOTS ) @@ -316,17 +316,17 @@ class-token has to be a token representing either a class or a struct." ((kde-label-Q_SIGNALS (car (semantic-token-extent elt))) ;;SIGNALS - next prototypes belong to Q_SIGNALS and we don't want to ;; expand those - (setq asignal t + (set asignal t aslot nil) ) ((kde-label-namespace (car (semantic-token-extent elt))) ;;NAMESPACE - semantic doesn't handle things like Qt::ButtonState correctly ;; so we do ;) - (setq namespace (kde-label-namespace (car (semantic-token-extent elt)))) + (set namespace (kde-label-namespace (car (semantic-token-extent elt)))) ) ((kde-label-Q_SLOTS (car (semantic-token-extent elt))) ;;SLOTS - for now just unset Q_SIGNALS - (setq aslot t + (set aslot t asignal nil) ) (t @@ -346,11 +346,11 @@ class-token has to be a token representing either a class or a struct." (dolist (elt tokens ret) (cond ((eq (semantic-token-token elt) 'type) - (setq ret (concat ret (kde-class-expand elt))) + (set ret (concat ret (kde-class-expand elt))) ) ((eq (semantic-token-token elt) 'function) (if (kde-is-prototype elt) - (setq ret (concat ret (kde-function-construct elt nil) "\n\n")) + (set ret (concat ret (kde-function-construct elt nil) "\n\n")) ) ) ((eq (semantic-token-token elt) 'variable) @@ -375,7 +375,7 @@ class-token has to be a token representing either a class or a struct." (if exists (progn (find-file FILENAME) - (setq tokens (semantic-bovinate-toplevel t)) + (set tokens (semantic-bovinate-toplevel t)) (switch-to-buffer buf) tokens) nil) @@ -434,13 +434,13 @@ in the current header file." (buf) (parent)) (if (and object (equal (semantic-token-type object) "class")) - (setq parent (semantic-token-name object))) + (set parent (semantic-token-name object))) (if (and (not (kde-function-expanded-at-point PT)) (kde-is-prototype func)) (progn - (setq func (kde-function-construct func parent)) - (setq file (car (kde-file-get-cpp-h))) - (setq buf (current-buffer)) + (set func (kde-function-construct func parent)) + (set file (car (kde-file-get-cpp-h))) + (set buf (current-buffer)) (find-file file) (save-excursion (goto-char (point-max)) |