Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!think!ames!sdcsvax!ucbvax!TOPAZ.RUTGERS.EDU!gaynor From: gaynor@TOPAZ.RUTGERS.EDU (Silver) Newsgroups: comp.emacs Subject: Re: emacs convenience bug fix Message-ID: <8709151530.AA29490@topaz.rutgers.edu> Date: Tue, 15-Sep-87 11:30:26 EDT Article-I.D.: topaz.8709151530.AA29490 Posted: Tue Sep 15 11:30:26 1987 Date-Received: Thu, 17-Sep-87 04:41:21 EDT References: <8709142155.AA08175@RUTGERS.EDU> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 40 > Here's an update on this bug: Are we talking about the same bug? If we are, I would like more information on it. If not, no problem. ;;;;;;;;;; The bug. This baby should have originally be enclosed in a ;;;;;;;;;; save-excursion. I didn't think it necessary, because I ;;;;;;;;;; killed the temp buffer at the end, and so thought that the ;;;;;;;;;; buffer for local-variable-affecting operations would be the ;;;;;;;;;; default. Instead, I think that they were taking place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;;;;;;;;;; in this killed buffer, or to the globals. (??) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (defun string-replace-regexp-alist (s al) "Given a string s, replace each instance of regexp (cars of elements in al) with to-string (cdrs of elements in al) as per replace-regexp." (save-excursion (let (tal ss) ;; Have to use a temporary buffer to pull this one off... (set-buffer (get-buffer-create "!@#$%^&*")) (insert s) ;; Walk down al with tal, regexp-replacing instances of ;; (car (car tal)) with (cdr (car tal)). (setq tal al) (while tal (goto-char (point-min)) (replace-regexp (car (car tal)) (cdr (car tal))) (setq tal (cdr tal))) (setq ss (buffer-string)) (kill-buffer "!@#$%^&*") ss))) Silver. Andy Gaynor 201-545-0458 81 Hassart St, New Brunswick, NJ 08901 gaynor@topaz.rutgers.edu ...!rutgers!topaz.rutgers.edu!gaynor