Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun my-process-file (fPath searchFunc)
- "Process the file at FPATH β¦"
- (let (myBuffer p1 p2 (ii 0) searchStr)
- (when (not (string-match "/xx" fPath)) ; exclude some dir
- (let ((fileChanged-p nil))
- (with-current-buffer
- (get-buffer-create "symvisfix buff")
- ;; insert code from file into temp buffer
- (insert-file-contents fPath nil nil nil t)
- ;; need to get all search keys in here and iterate through each
- (setq searchStr searchFunc) ; search string here
- ;; start from first point in buffer
- (goto-char 1)
- (while (search-forward searchStr nil t)
- ;; go to beginning of function def line
- (forward-word -3)
- (if (not (string-equal (thing-at-point 'word) "IUP_EXPORTI"))
- (forward-word 1)
- (insert "IUP_EXPORTI "))
- ;; go back to cursor start
- (forward-word 3)
- (setq fileChanged-p t)
- ;; (setq ii (1+ ii))
- ))
- (when fileChanged-p (write-region 1 (point-max) fPath))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement