So I have a defun that I made that is supposed to copy every thing that is between double quotes and then make a list of everything that was copied. I don't know what the problem is, but it doesn't seem to work with every list of quoted text.
There is a change log that would be something like this format.
"Type1" changed ~such and such data. "Type2" changed ~such and such data.
And then I would like my defun to simply copy the text between the double quotes and then spit them out into a summary change log that would go something like this.
Changes were made to the following types.
The purpose of this is to write a change log. Everything that has changed is supposed to be between quotation marks. The defun is supposed to print out
Changes were made to the following types then a separate new line and then the list of everything that was quoted. It is possible that there could be dozens of "types" within hundreds of lines of text that need to be recorded in a change log. It is imperative that this change log list is accurate at the end.
I am not sure if the problem is in my
copy-region-as-kill loop, or in my "yank" loop. I made it copy the quoted text three times and then delete the duplicate lines in an attempt to get this to work. That got it to work with one specific list, but it does not work with all of them. Here is my defun.
(defun change-log() "I created this to automatically copy all \"Types\" during categorization maintenance. It will also automatically create the change log for you at the end of the text file." (interactive) (setq x 1) (while (search-forward "\"" nil t) (setq pos (point)) (set-mark-command nil) (search-forward "\"" nil t) (backward-char) (setq pos2 (point)) (kill-ring-save (region-beginning) (region-end)) (kill-ring-save pos pos2) (kill-ring-save pos pos2) (forward-char) (setq x (1+ x))) (setq x (1+ x)) (setq x (* x 3)) (setq y (1+ x)) (end-of-buffer) (insert "\n") (insert "\n") (insert "Changes were made to the following types.") (insert "\n") (insert "\n") (setq pos (point)) (yank x) (insert "\n") (while (> x 0) (yank x) (insert "\n") (setq x (1- x))) (yank y) (insert "\n") (yank x) (setq pos2 (point)) (delete-duplicate-lines pos pos2) (backward-paragraph) (while (search-forward-regexp "\\.$" nil t) (replace-match "" nil)) (auto-whitespace-remove) (forward-paragraph) (set-mark-command nil) (backward-paragraph))