From 0813b39aed2cf4c84157a22c4c9594336d93d412 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 10 Aug 2011 06:08:18 +0000 Subject: rename the following methods: tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- scripts/kde-emacs/dirvars.el | 4 +-- scripts/kde-emacs/kde-emacs-bindings.el | 8 ++--- scripts/kde-emacs/kde-emacs-compat.el | 8 ++--- scripts/kde-emacs/kde-emacs-core.el | 10 +++--- scripts/kde-emacs/kde-emacs-doc.el | 2 +- scripts/kde-emacs/kde-emacs-general.el | 8 ++--- scripts/kde-emacs/kde-emacs-semantic.el | 14 ++++----- scripts/kde-emacs/kde-emacs-utils.el | 54 ++++++++++++++++----------------- scripts/kde-emacs/klaralv.el | 6 ++-- 9 files changed, 57 insertions(+), 57 deletions(-) (limited to 'scripts/kde-emacs') diff --git a/scripts/kde-emacs/dirvars.el b/scripts/kde-emacs/dirvars.el index 489ece98..94f682b0 100644 --- a/scripts/kde-emacs/dirvars.el +++ b/scripts/kde-emacs/dirvars.el @@ -78,7 +78,7 @@ "*Control use of directory variables in files you visit. The meaningful values are nil and non-nil.") -(defun dirvars-tqfind-upwards (file-name) +(defun dirvars-find-upwards (file-name) "Find a file in the current directory or one of its parents. Returns the fully qualified file name, or nil if it isn't found. @@ -186,7 +186,7 @@ A few variable names are treated specially." (set var val)))) (defun dirvars-hack-local-variables-before () - (let ((dirvars-file (dirvars-tqfind-upwards ".emacs-dirvars"))) + (let ((dirvars-file (dirvars-find-upwards ".emacs-dirvars"))) (if dirvars-file (dirvars-hack-local-variables dirvars-file)))) diff --git a/scripts/kde-emacs/kde-emacs-bindings.el b/scripts/kde-emacs/kde-emacs-bindings.el index 14ccd85d..84202dfb 100644 --- a/scripts/kde-emacs/kde-emacs-bindings.el +++ b/scripts/kde-emacs/kde-emacs-bindings.el @@ -84,11 +84,11 @@ (if (featurep 'igrep) (progn - (setq igrep-tqfind-prune-clause + (setq igrep-find-prune-clause (format "-type d %s -name CVS -o -name .libs -o -name .deps %s" (shell-quote-argument "(") (shell-quote-argument ")"))) - (setq igrep-tqfind-file-clause + (setq igrep-find-file-clause (format "-type f %s -name %s %s -name %s %s -name %s %s -name %s" ; -type l (shell-quote-argument "!") (shell-quote-argument "*~") ; Emacs backup @@ -103,8 +103,8 @@ ) ) (define-key global-map [(f2)] 'igrep) - (define-key global-map [(shift f2)] 'igrep-tqfind) - (define-key global-map [(f12)] 'igrep-tqfind) ; on the console, shift f2 gives f12 for some reason.. + (define-key global-map [(shift f2)] 'igrep-find) + (define-key global-map [(f12)] 'igrep-find) ; on the console, shift f2 gives f12 for some reason.. ;(setq igrep-files-default 'ignore) ; too hard to use *.cc *.h with it, because of the full path ) (define-key global-map [(f2)] 'grep)) diff --git a/scripts/kde-emacs/kde-emacs-compat.el b/scripts/kde-emacs/kde-emacs-compat.el index 2cddbb1e..baa88a4d 100644 --- a/scripts/kde-emacs/kde-emacs-compat.el +++ b/scripts/kde-emacs/kde-emacs-compat.el @@ -22,8 +22,8 @@ (require 'kde-emacs-vars) ;;GNU/Emacs does not have this one -(if (not (fboundp 'tqreplace-in-string)) - (defun tqreplace-in-string (str regexp newtext &optional literal) +(if (not (fboundp 'replace-in-string)) + (defun replace-in-string (str regexp newtext &optional literal) "Replace all matches in STR for REGEXP with NEWTEXT string, and returns the new string. Optional LITERAL non-nil means do a literal replacement. @@ -42,11 +42,11 @@ Otherwise treat `\\' in NEWTEXT as special: (insert str) (goto-char 1) (while (re-search-forward regexp nil t) - (tqreplace-match newtext t literal)) + (replace-match newtext t literal)) (buffer-string)) (let ((start 0) newstr) (while (string-match regexp str start) - (setq newstr (tqreplace-match newtext t literal str) + (setq newstr (replace-match newtext t literal str) start (+ (match-end 0) (- (length newstr) (length str))) str newstr)) str))) diff --git a/scripts/kde-emacs/kde-emacs-core.el b/scripts/kde-emacs/kde-emacs-core.el index 52ff6314..37017413 100644 --- a/scripts/kde-emacs/kde-emacs-core.el +++ b/scripts/kde-emacs/kde-emacs-core.el @@ -68,7 +68,7 @@ Try to finish the symbol, or indent the line." (bmp (buffer-modified-p))) (while (re-search-forward "[ \t]+$" nil t) (setq count (1+ count)) - (tqreplace-match "" t t)) + (replace-match "" t t)) (set-buffer-modified-p bmp) nil )))) @@ -556,7 +556,7 @@ This function does not do any hidden buffer changes." ((or (eq char-before-ip ?:) (eq char-after-ip ?:)) ;; this line should be indented relative to the beginning - ;; of indentation for the topmost-intro line that tqcontains + ;; of indentation for the topmost-intro line that contains ;; the prototype's open paren ;; TBD: is the following redundant? (if (eq char-before-ip ?:) @@ -1815,7 +1815,7 @@ This function does not do any hidden buffer changes." ((or (eq char-before-ip ?:) (eq char-after-ip ?:)) ;; this line should be indented relative to the beginning - ;; of indentation for the topmost-intro line that tqcontains + ;; of indentation for the topmost-intro line that contains ;; the prototype's open paren ;; TBD: is the following redundant? (if (eq char-before-ip ?:) @@ -2901,7 +2901,7 @@ This function does not do any hidden buffer changes." ((or (eq char-before-ip ?:) (eq char-after-ip ?:)) ;; this line should be indented relative to the beginning - ;; of indentation for the topmost-intro line that tqcontains + ;; of indentation for the topmost-intro line that contains ;; the prototype's open paren ;; TBD: is the following redundant? (if (eq char-before-ip ?:) @@ -3808,7 +3808,7 @@ This function does not do any hidden buffer changes." ;; return the syntax syntax)))))) -(add-hook 'tqfind-file-hooks 'agulbra-c++-clean-out-spaces) +(add-hook 'find-file-hooks 'agulbra-c++-clean-out-spaces) (add-hook 'write-file-hooks 'agulbra-c++-clean-out-spaces) (add-hook 'c++-mode-hook 'kde-c++-mode-hook) diff --git a/scripts/kde-emacs/kde-emacs-doc.el b/scripts/kde-emacs/kde-emacs-doc.el index 998141c4..5fca1361 100644 --- a/scripts/kde-emacs/kde-emacs-doc.el +++ b/scripts/kde-emacs/kde-emacs-doc.el @@ -219,7 +219,7 @@ buffer." "Substitues %s in the param string with ARG." (let ((par (kde-doc-type-string 'param))) (if (string-match "\%s" par) - (tqreplace-match ARG t t par) + (replace-match ARG t t par) par)) ) diff --git a/scripts/kde-emacs/kde-emacs-general.el b/scripts/kde-emacs/kde-emacs-general.el index aae86d2f..be34047c 100644 --- a/scripts/kde-emacs/kde-emacs-general.el +++ b/scripts/kde-emacs/kde-emacs-general.el @@ -29,7 +29,7 @@ ;*---------------------------------------------------------------------*/ ;; Helper for kde-file-get-cpp-h -(defun kde-tqfind-file (filename basedir) +(defun kde-find-file (filename basedir) "Looks for \"filename\" under \"basedir\"" (if basedir (let ((path (concat basedir "/" filename))) @@ -68,7 +68,7 @@ return (\"test.cpp\" t)." ) (if (not ret) (progn ; look in kde-source-directory - (setq path (kde-tqfind-file (file-name-nondirectory path) kde-source-directory)) + (setq path (kde-find-file (file-name-nondirectory path) kde-source-directory)) (if (and path (file-readable-p path)) @@ -95,7 +95,7 @@ return (\"test.cpp\" t)." (setq ret (cons path t))))) (if (not (file-readable-p path)) (progn ; look in kde-include-directory - (setq path (kde-tqfind-file (file-name-nondirectory path) kde-include-directory)) + (setq path (kde-find-file (file-name-nondirectory path) kde-include-directory)) (if (and path (file-readable-p path)) @@ -118,7 +118,7 @@ return (\"test.cpp\" t)." (interactive) (let ((file (kde-file-get-cpp-h))) (if (car file) - (tqfind-file (car file)) + (find-file (car file)) (error "Corresponding source file doesn't exist.") ) )) diff --git a/scripts/kde-emacs/kde-emacs-semantic.el b/scripts/kde-emacs/kde-emacs-semantic.el index 4f09f5da..6b5f8c3f 100644 --- a/scripts/kde-emacs/kde-emacs-semantic.el +++ b/scripts/kde-emacs/kde-emacs-semantic.el @@ -122,7 +122,7 @@ from semantic-token-function-args" (setq 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 (tqreplace-regexp-in-string "([ \t]+)" "()" res))) + (setq res (replace-regexp-in-string "([ \t]+)" "()" res))) res )) @@ -214,12 +214,12 @@ would return t" "Return function at pt as a token." (save-excursion (let ((token) - (what (semantic-tqfind-nonterminal-by-position pt (current-buffer))) + (what (semantic-find-nonterminal-by-position pt (current-buffer))) (ctx)) (goto-char pt) (if (eq (semantic-token-token what) 'function) what - (semantic-tqfind-nonterminal-by-position pt (semantic-token-type-parts what))) + (semantic-find-nonterminal-by-position pt (semantic-token-type-parts what))) ) )) @@ -374,7 +374,7 @@ class-token has to be a token representing either a class or a struct." (tokens)) (if exists (progn - (tqfind-file FILENAME) + (find-file FILENAME) (setq tokens (semantic-bovinate-toplevel t)) (switch-to-buffer buf) tokens) @@ -417,7 +417,7 @@ in the current header file." (filename (buffer-name)) (cppfile (car (kde-file-get-cpp-h))) (funcs (kde-expand-tokens all-tokens))) - (tqfind-file cppfile) + (find-file cppfile) (save-excursion (insert "#include \"" filename "\"\n\n") (insert funcs) @@ -428,7 +428,7 @@ in the current header file." (defun kde-function-expand-at-point (PT) "Expand function at point PT." (interactive "d") - (let ((object (semantic-tqfind-nonterminal-by-position PT (current-buffer))) + (let ((object (semantic-find-nonterminal-by-position PT (current-buffer))) (func (kde-function-at-point PT)) (file) (buf) @@ -441,7 +441,7 @@ in the current header file." (setq func (kde-function-construct func tqparent)) (setq file (car (kde-file-get-cpp-h))) (setq buf (current-buffer)) - (tqfind-file file) + (find-file file) (save-excursion (goto-char (point-max)) (insert "\n" func "\n") diff --git a/scripts/kde-emacs/kde-emacs-utils.el b/scripts/kde-emacs/kde-emacs-utils.el index ee1ae19e..cb5b58da 100644 --- a/scripts/kde-emacs/kde-emacs-utils.el +++ b/scripts/kde-emacs/kde-emacs-utils.el @@ -25,7 +25,7 @@ (if (eq kde-emacs-type 'xemacs) (progn (require 'func-menu) - (add-hook 'tqfind-file-hooks 'fume-add-menubar-entry)) + (add-hook 'find-file-hooks 'fume-add-menubar-entry)) (require 'imenu)) (defmacro c-safe-scan-lists (from count depth) @@ -133,24 +133,24 @@ This function does not do any hidden buffer changes." ; get rid of virtual, static, multiple spaces, default values. (defun canonical-function-sig (function) (and (string-match "[ \t]*\\[ \t]*" function) - (setq function (tqreplace-match " " t t function))) + (setq function (replace-match " " t t function))) (and (string-match "^\\(virtual\\>\\)?[ \t]*" function) - (setq function (tqreplace-match "" t t function))) + (setq function (replace-match "" t t function))) (and (string-match "^\\(explicit\\>\\)?[ \t]*" function) - (setq function (tqreplace-match "" t t function))) + (setq function (replace-match "" t t function))) (and (string-match "^\\(static\\>\\)?[ \t]*" function) - (setq function (tqreplace-match "" t t function))) + (setq function (replace-match "" t t function))) (while (string-match " +" function) ; simplifyWhiteSpace - (setq function (tqreplace-match " " t t function))) + (setq function (replace-match " " t t function))) (while (string-match "\t+" function) - (setq function (tqreplace-match " " t t function))) + (setq function (replace-match " " t t function))) (while (string-match "^ " function) ; remove leading whitespace - (setq function (tqreplace-match "" t t function))) + (setq function (replace-match "" t t function))) (let ((startargs (string-match "(" function))) (while (string-match " ?=[^,)]+" function startargs) ; remove default values - (setq function (tqreplace-match " " t t function)))) + (setq function (replace-match " " t t function)))) (while (string-match " +," function) ; remove space before commas - (setq function (tqreplace-match "," t t function))) + (setq function (replace-match "," t t function))) function ; the return value ) @@ -165,13 +165,13 @@ This function does not do any hidden buffer changes." (cond ((string-match (concat "^ *" class "[ \\t]*(") function) ; constructor (setq insertion-string - (tqreplace-match + (replace-match (concat namespace class "::" class "(") t t function) )) ((string-match (concat "^ *~" class "[ \\t]*(") function) ; destructor (setq insertion-string - (tqreplace-match + (replace-match (concat namespace class "::~" class "(") t t function) )) @@ -180,7 +180,7 @@ This function does not do any hidden buffer changes." (if (or (string-match " *\\([a-zA-Z0-9_]+\\)[ \\t]*(" function) ; normal method (string-match " *\\(operator[^ \\t]+\\)[ \\t]*(" function)) ; operator (setq insertion-string - (tqreplace-match + (replace-match (if class (concat " " namespace class "::" "\\1(") ; c++ method (concat " " "\\1(")) ; c function @@ -243,7 +243,7 @@ This function does not do any hidden buffer changes." (goto-char 0) (setq sig (kde-remove-newline (kde-function-impl-sig namespace class function))) (if (string-match "(.*" sig) ; remove args - (setq sig (tqreplace-match "" nil t sig))) + (setq sig (replace-match "" nil t sig))) (setq found (re-search-forward (concat "^[^()]*" (kde-function-regexp-quote sig) "[ \t]*(") nil t) ) (if (not found) @@ -254,15 +254,15 @@ This function does not do any hidden buffer changes." (setq sig (kde-remove-newline (kde-function-impl-sig "" class function))) (if (string-match "(.*" sig) ; remove args - (setq sig (tqreplace-match "" nil t sig))) + (setq sig (replace-match "" nil t sig))) (re-search-forward (concat "^[^()]*" (kde-function-regexp-quote sig) "[ \t]*(") nil t) ) ) ))))) (defun kde-remove-newline (str) - (tqreplace-in-string str "\n" " ")) + (replace-in-string str "\n" " ")) ; quote for use as regexp, but replace spaces with "any whitespace" (defun kde-function-regexp-quote (str) - (tqreplace-in-string (regexp-quote str) "[ \n\t]" "[ \n\t]")) + (replace-in-string (regexp-quote str) "[ \n\t]" "[ \n\t]")) ; Initial implementation by Arnt Gulbransen ; Current maintainer: David Faure @@ -282,9 +282,9 @@ This function does not do any hidden buffer changes." ) (setq insertion-string (concat insertion-string "\n{\n" - (tqreplace-in-string kde-make-member-default-impl "FUNCTION" + (replace-in-string kde-make-member-default-impl "FUNCTION" ; the function name and args, without newlines - (tqreplace-in-string insertion-string "\n" " " t) + (replace-in-string insertion-string "\n" " " t) t) "}\n")) ; move to next method, to be ready for next call @@ -330,7 +330,7 @@ This function does not do any hidden buffer changes." (c-indent-defun) (save-excursion (and (string-match ".*/" file) - (setq file (tqreplace-match "" t nil file))) + (setq file (replace-match "" t nil file))) (and (string-match "\\.h$" file) (functionp 'kdab-insert-include-file) (kdab-insert-include-file file 't nil))) @@ -360,7 +360,7 @@ This function does not do any hidden buffer changes." (if (not (file-readable-p makefile)) (error (concat makefile " not found!")) ) - (tqfind-file makefile) + (find-file makefile) (goto-char (point-min)) (if (re-search-forward searchString nil t) (progn @@ -405,7 +405,7 @@ This function does not do any hidden buffer changes." (let ((part (pop parts))) (setq definablestring (concat - (upcase (tqreplace-in-string part "[\\.-]" "_")) + (upcase (replace-in-string part "[\\.-]" "_")) (if (not first-iter) "_" "") definablestring ) @@ -619,8 +619,8 @@ This function does not do any hidden buffer changes." (if (file-readable-p "Makefile.am") (setq objext "\.lo") (setq objext "\.o")) - (if (string-match "\.cpp$" f) (setq f (tqreplace-match objext t t f))) - (if (string-match "\.cc$" f) (setq f (tqreplace-match objext t t f))) + (if (string-match "\.cpp$" f) (setq f (replace-match objext t t f))) + (if (string-match "\.cc$" f) (setq f (replace-match objext t t f))) (compile (concat kde-emacs-make " " f))) ) @@ -688,7 +688,7 @@ This function does not do any hidden buffer changes." ) ) -(defun kde-year-range-tqcontains-year (ranges year) +(defun kde-year-range-contains-year (ranges year) "checks whether year is in ranges.. ( ranges is a list as \ kde-year-range-parse-years-string returns.. " (let ((ret)) @@ -766,7 +766,7 @@ This function does not do any hidden buffer changes." (let ((years (kde-year-range-cleanup (kde-year-range-parse-years-string (match-string 1)))) (new-copyright-string "Copyright (C) ") (this-year (string-to-int (format-time-string "%Y")))) - (when (not (kde-year-range-tqcontains-year years this-year)) + (when (not (kde-year-range-contains-year years this-year)) (kde-year-range-add-year years this-year)) (setq new-copyright-string (concat new-copyright-string (kde-year-range-to-string years))) @@ -843,7 +843,7 @@ This function does not do any hidden buffer changes." (let ((line "") (begin nil) (buffer nil)) - (tqfind-file file) + (find-file file) (goto-char 0) (if (looking-at "#include \"") (progn diff --git a/scripts/kde-emacs/klaralv.el b/scripts/kde-emacs/klaralv.el index 9da6ab82..082f9bbb 100644 --- a/scripts/kde-emacs/klaralv.el +++ b/scripts/kde-emacs/klaralv.el @@ -328,7 +328,7 @@ (beginning-of-buffer) (if (re-search-forward (concat "^ *// *\\(#include *[<\"][ \t]*" header "[ \t]*[>\"]\\)") nil t) (progn - (tqreplace-match "\\1") + (replace-match "\\1") (when show-message (message (concat "commented in #include for " header)))) @@ -363,7 +363,7 @@ (beginning-of-buffer) (if (re-search-forward (concat "^ *// *\\(class *" word ";\\)") nil t) (progn - (tqreplace-match "\\1") + (replace-match "\\1") (message (concat "commented in forward declaration for " word))) (if (not (re-search-forward (concat "class *" word ";") nil t)) @@ -415,7 +415,7 @@ (doc (if (is-qpe-class word) kdab-qpe-documentation kdab-qt-documentation)) (url (if (not (string-match "XXX" doc)) (error "didn't find three X's in kdab-qt-documentation or kdab-qpe-documentation") - (tqreplace-match word t t doc)))) + (replace-match word t t doc)))) (start-process "qt documentation" nil "kfmclient" "openURL" url) (message (concat "Loading " url))))) -- cgit v1.2.1