jgh2@unix.cis.pitt.edu (John G. Hardie) (09/14/89)
Hi, I'm working on an ELISP program to do some file manipulations. I have a section of code that is supposed to 1) get a buffer with a given name, and create it if it doesn't exist 2) change the current buffer to the one obtained in (1). 3) set the visited file name for that buffer to something. I wrote the following section of code to do this. It acts funny. (progn (setq blooper (get-buffer-create "OOPS")) (set-buffer blooper) (set-visited-file-name "OOP")) Before executing this code the first time, the buffer list is: MR Buffer Size Mode File -- ------ ---- ---- ---- .* *scratch* 110 Lisp Interaction *Buffer List* 0 Buffer Menu After executing it the first time, the list is:. The New buffer has the wrong name. The buffer is named the same as the visited file. MR Buffer Size Mode File -- ------ ---- ---- ---- .* *scratch* 114 Lisp Interaction * *Buffer List* 0 Buffer Menu * OOP 0 Fundamental /class1/1034/jgh2/OOP The second time I run the code the buffer list is as follows. The correct buffer showed up. Each time subsequent to the second, the correct buffer is addressed, as long as the visited file name stays the same. MR Buffer Size Mode File -- ------ ---- ---- ---- .* *scratch* 117 Lisp Interaction * *Buffer List* 0 Buffer Menu * OOP 0 Fundamental /class1/1034/jgh2/OOP * OOPS 0 Fundamental /class1/1034/jgh2/OOP If the visited file name changes to, say (set-visited-file-name "GLORP") then the following happens: MR Buffer Size Mode File -- ------ ---- ---- ---- .* *scratch* 122 Lisp Interaction * *Buffer List* 0 Buffer Menu * OOP 0 Fundamental /class1/1034/jgh2/OOP * GLORP 0 Fundamental /class1/1034/jgh2/GLORP And executing the code again creates another buffer. MR Buffer Size Mode File -- ------ ---- ---- ---- .* *scratch* 126 Lisp Interaction * *Buffer List* 0 Buffer Menu * OOP 0 Fundamental /class1/1034/jgh2/OOP * GLORP 0 Fundamental /class1/1034/jgh2/GLORP * OOPS 0 Fundamental /class1/1034/jgh2/GLORP The process continues this way. This is not what I expected. I'm trying to extract specific sections from several files and accumulate them in another file. The buffer ("OOPS") above is the one that I use to edit the component files. I do not want buffers multiplying on me, especially since I've got about 100 files to process. The same bug makes accumulating the text a pain since the first entry goes in a separate buffer from all the rest. Is there any known workaround? Is this a known bug? Thanks, John P.S. This bug shows up in 18.52 on VMS as well as 18.49.3 on ULTRIX -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= John G. Hardie jgh2@unix.cis.pittsburgh.edu Dept. of Physics, Univ of Pittsburgh jgh2@vms.cis.pittsburgh.edu Of all the things I've lost, I miss my mind the most.