aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2013-05-28 23:44:19 -0700
committerGlenn Morris2013-05-28 23:44:19 -0700
commitbc74a74a5d0efb5d89c06aee1d9135be4f7e73c8 (patch)
tree7a620ec7bafadec442239c2c9cd8e54238b8d52a
parent8b3942003d0435747e6a5f10a403d185883698c4 (diff)
downloademacs-bc74a74a5d0efb5d89c06aee1d9135be4f7e73c8.tar.gz
emacs-bc74a74a5d0efb5d89c06aee1d9135be4f7e73c8.zip
* idlwave.el (idlwave-scan-user-lib-files, idlwave-write-paths): Simplify
via with-temp-buffer.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/progmodes/idlwave.el79
2 files changed, 34 insertions, 48 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index eed02c441f2..c3c2cc829cb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12013-05-29 Glenn Morris <rgm@gnu.org> 12013-05-29 Glenn Morris <rgm@gnu.org>
2 2
3 * progmodes/idlwave.el (idlwave-scan-user-lib-files)
4 (idlwave-write-paths): Simplify via with-temp-buffer.
5
3 * emulation/cua-gmrk.el: Also load cua-base, cua-rect at run time. 6 * emulation/cua-gmrk.el: Also load cua-base, cua-rect at run time.
4 * emulation/cua-rect.el: Also load cua-base at run time. 7 * emulation/cua-rect.el: Also load cua-base at run time.
5 8
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index aeaf1acb2ac..cbcd2f9d10e 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -5481,30 +5481,21 @@ directories and save the routine info.
5481 (message "Creating user catalog file...") 5481 (message "Creating user catalog file...")
5482 (kill-buffer "*idlwave-scan.pro*") 5482 (kill-buffer "*idlwave-scan.pro*")
5483 (kill-buffer (get-buffer-create "*IDLWAVE Widget*")) 5483 (kill-buffer (get-buffer-create "*IDLWAVE Widget*"))
5484 (let ((font-lock-maximum-size 0) 5484 (with-temp-buffer
5485 (auto-mode-alist nil)) 5485 (insert ";; IDLWAVE user catalog file\n")
5486 (find-file idlwave-user-catalog-file)) 5486 (insert (format ";; Created %s\n\n" (current-time-string)))
5487 (if (and (boundp 'font-lock-mode) 5487
5488 font-lock-mode) 5488 ;; Define the routine info list
5489 (font-lock-mode 0)) 5489 (insert "\n(setq idlwave-user-catalog-routines\n '(")
5490 (erase-buffer) 5490 (let ((standard-output (current-buffer)))
5491 (insert ";; IDLWAVE user catalog file\n") 5491 (mapc (lambda (x)
5492 (insert (format ";; Created %s\n\n" (current-time-string))) 5492 (insert "\n ")
5493 5493 (prin1 x)
5494 ;; Define the routine info list 5494 (goto-char (point-max)))
5495 (insert "\n(setq idlwave-user-catalog-routines\n '(") 5495 idlwave-user-catalog-routines))
5496 (let ((standard-output (current-buffer))) 5496 (insert (format "))\n\n;;; %s ends here\n"
5497 (mapc (lambda (x) 5497 (file-name-nondirectory idlwave-user-catalog-file)))
5498 (insert "\n ") 5498 (write-region nil nil idlwave-user-catalog-file)))
5499 (prin1 x)
5500 (goto-char (point-max)))
5501 idlwave-user-catalog-routines))
5502 (insert (format "))\n\n;;; %s ends here\n"
5503 (file-name-nondirectory idlwave-user-catalog-file)))
5504 (goto-char (point-min))
5505 ;; Save the buffer
5506 (save-buffer 0)
5507 (kill-buffer (current-buffer)))
5508 (message "Creating user catalog file...done") 5499 (message "Creating user catalog file...done")
5509 (message "Info for %d routines saved in %s" 5500 (message "Info for %d routines saved in %s"
5510 (length idlwave-user-catalog-routines) 5501 (length idlwave-user-catalog-routines)
@@ -5522,31 +5513,23 @@ directories and save the routine info.
5522(defun idlwave-write-paths () 5513(defun idlwave-write-paths ()
5523 (interactive) 5514 (interactive)
5524 (when (and idlwave-path-alist idlwave-system-directory) 5515 (when (and idlwave-path-alist idlwave-system-directory)
5525 (let ((font-lock-maximum-size 0) 5516 (with-temp-buffer
5526 (auto-mode-alist nil)) 5517 (insert ";; IDLWAVE paths\n")
5527 (find-file idlwave-path-file)) 5518 (insert (format ";; Created %s\n\n" (current-time-string)))
5528 (if (and (boundp 'font-lock-mode)
5529 font-lock-mode)
5530 (font-lock-mode 0))
5531 (erase-buffer)
5532 (insert ";; IDLWAVE paths\n")
5533 (insert (format ";; Created %s\n\n" (current-time-string)))
5534 ;; Define the variable which knows the value of "!DIR" 5519 ;; Define the variable which knows the value of "!DIR"
5535 (insert (format "\n(setq idlwave-system-directory \"%s\")\n" 5520 (insert (format "\n(setq idlwave-system-directory \"%s\")\n"
5536 idlwave-system-directory)) 5521 idlwave-system-directory))
5537 5522
5538 ;; Define the variable which contains a list of all scanned directories 5523 ;; Define the variable which contains a list of all scanned directories
5539 (insert "\n(setq idlwave-path-alist\n '(") 5524 (insert "\n(setq idlwave-path-alist\n '(")
5540 (let ((standard-output (current-buffer))) 5525 (let ((standard-output (current-buffer)))
5541 (mapc (lambda (x) 5526 (mapc (lambda (x)
5542 (insert "\n ") 5527 (insert "\n ")
5543 (prin1 x) 5528 (prin1 x)
5544 (goto-char (point-max))) 5529 (goto-char (point-max)))
5545 idlwave-path-alist)) 5530 idlwave-path-alist))
5546 (insert "))\n") 5531 (insert "))\n")
5547 (save-buffer 0) 5532 (write-region nil nil idlwave-path-file))))
5548 (kill-buffer (current-buffer))))
5549
5550 5533
5551(defun idlwave-expand-path (path &optional default-dir) 5534(defun idlwave-expand-path (path &optional default-dir)
5552 ;; Expand parts of path starting with '+' recursively into directory list. 5535 ;; Expand parts of path starting with '+' recursively into directory list.