Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!njin!princeton!att!cbnewsh!hosmsb!msb From: msb@hosmsb.ATT.COM (Mike Balenger) Newsgroups: gnu.emacs Subject: help w/ defun return value Message-ID: Date: 17 Jan 90 16:22:25 GMT Sender: msb@cbnewsh.ATT.COM Reply-To: msb@ho5cad.ATT.COM (Mike Balenger) Distribution: gnu Organization: AT&T Bell Laboratories Lines: 42 Why does this defun return nil instead of the value of buf-string? ================================================================ (defun expand-month (month) "Expand MONTH into full name of month" (interactive "sExpand what month? ") (let ((buf-string) (case-fold-search t) (case-replace t)) (set-buffer (generate-new-buffer " *expand-month*")) (insert month) (delete-region (min 4 (point-max)) (point-max)) ;keep 3 characters at most (goto-char (point-min)) ;; plump 'em up (replace-string "jan" "january") (replace-string "feb" "february") (replace-string "mar" "march") (replace-string "apr" "april") (replace-string "may" "may") (replace-string "jun" "june") (replace-string "jul" "july") (replace-string "aug" "august") (replace-string "sep" "september") (replace-string "oct" "october") (replace-string "nov" "november") (replace-string "dec" "december") (setq buf-string (buffer-string)) ;hang onto the results (kill-buffer (buffer-name)) ;clean up buf-string)) ;return results -- ---------------------------------------------------------------------- Michael S. Balenger (201) 949-8789 AT&T Bell Labs Room 1L-405 msb@ho5cad.att.com Crawfords Corner Road att!ho5cad!msb Holmdel, NJ 07733