;; idlwave.el --- IDL editing mode for GNU Emacs
-;; Copyright (C) 1999-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2014 Free Software Foundation, Inc.
;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
;; Carsten Dominik <dominik@science.uva.nl>
;;; Commentary:
;; IDLWAVE enables feature-rich development and interaction with IDL,
-;; the Interactive Data Language. It provides a compelling,
+;; the Interactive Data Language. It provides a compelling,
;; full-featured alternative to the IDLDE development environment
;; bundled with IDL.
:type '(choice
(const :tag "No buffer" nil)
(const :tag "All buffers" t)
- (const :tag "Current buffer only" 'current)))
+ (const :tag "Current buffer only" current)))
(defcustom idlwave-query-shell-for-routine-info t
"Non-nil means query the shell for info about compiled routines.
;; Configuration files
(defcustom idlwave-config-directory
- (convert-standard-filename "~/.idlwave")
+ (locate-user-emacs-file "idlwave" ".idlwave")
"Directory for configuration files and user-library catalog."
+ :version "24.4" ; added locate-user-emacs-file
:group 'idlwave-routine-info
:type 'file)
:type '(choice
(const :tag "Pad like assignments" t)
(const :tag "Remove space near `='" nil)
- (const :tag "Keep space near `='" 'keep)))
+ (other :tag "Keep space near `='" keep)))
(defcustom idlwave-show-block t
"Non-nil means point blinks to block beginning for `idlwave-show-begin'."
;; The sequence here is important because earlier definitions shadow
;; later ones. We assume that if things in the buffers are newer
;; then in the shell of the system, they are meant to be different.
- (setcdr idlwave-last-system-routine-info-cons-cell
- (append idlwave-buffer-routines
- idlwave-compiled-routines
- idlwave-library-catalog-routines
- idlwave-user-catalog-routines))
+ (let ((temp (append idlwave-buffer-routines
+ idlwave-compiled-routines
+ idlwave-library-catalog-routines
+ idlwave-user-catalog-routines)))
+ ;; Not actually used for anything?
+ (if idlwave-last-system-routine-info-cons-cell
+ (setcdr idlwave-last-system-routine-info-cons-cell temp)
+ (setq idlwave-last-system-routine-info-cons-cell (cons temp nil))))
(setq idlwave-class-alist nil)
;; Give a message with information about the number of routines we have.
(message "Creating user catalog file...")
(kill-buffer "*idlwave-scan.pro*")
(kill-buffer (get-buffer-create "*IDLWAVE Widget*"))
- (let ((font-lock-maximum-size 0)
- (auto-mode-alist nil))
- (find-file idlwave-user-catalog-file))
- (if (and (boundp 'font-lock-mode)
- font-lock-mode)
- (font-lock-mode 0))
- (erase-buffer)
- (insert ";; IDLWAVE user catalog file\n")
- (insert (format ";; Created %s\n\n" (current-time-string)))
-
- ;; Define the routine info list
- (insert "\n(setq idlwave-user-catalog-routines\n '(")
- (let ((standard-output (current-buffer)))
- (mapc (lambda (x)
- (insert "\n ")
- (prin1 x)
- (goto-char (point-max)))
- idlwave-user-catalog-routines))
- (insert (format "))\n\n;;; %s ends here\n"
- (file-name-nondirectory idlwave-user-catalog-file)))
- (goto-char (point-min))
- ;; Save the buffer
- (save-buffer 0)
- (kill-buffer (current-buffer)))
+ (with-temp-buffer
+ (insert ";; IDLWAVE user catalog file\n")
+ (insert (format ";; Created %s\n\n" (current-time-string)))
+
+ ;; Define the routine info list
+ (insert "\n(setq idlwave-user-catalog-routines\n '(")
+ (let ((standard-output (current-buffer)))
+ (mapc (lambda (x)
+ (insert "\n ")
+ (prin1 x)
+ (goto-char (point-max)))
+ idlwave-user-catalog-routines))
+ (insert (format "))\n\n;;; %s ends here\n"
+ (file-name-nondirectory idlwave-user-catalog-file)))
+ (write-region nil nil idlwave-user-catalog-file)))
(message "Creating user catalog file...done")
(message "Info for %d routines saved in %s"
(length idlwave-user-catalog-routines)
(defun idlwave-write-paths ()
(interactive)
(when (and idlwave-path-alist idlwave-system-directory)
- (let ((font-lock-maximum-size 0)
- (auto-mode-alist nil))
- (find-file idlwave-path-file))
- (if (and (boundp 'font-lock-mode)
- font-lock-mode)
- (font-lock-mode 0))
- (erase-buffer)
- (insert ";; IDLWAVE paths\n")
- (insert (format ";; Created %s\n\n" (current-time-string)))
+ (with-temp-buffer
+ (insert ";; IDLWAVE paths\n")
+ (insert (format ";; Created %s\n\n" (current-time-string)))
;; Define the variable which knows the value of "!DIR"
- (insert (format "\n(setq idlwave-system-directory \"%s\")\n"
- idlwave-system-directory))
-
- ;; Define the variable which contains a list of all scanned directories
- (insert "\n(setq idlwave-path-alist\n '(")
- (let ((standard-output (current-buffer)))
- (mapc (lambda (x)
- (insert "\n ")
- (prin1 x)
- (goto-char (point-max)))
- idlwave-path-alist))
- (insert "))\n")
- (save-buffer 0)
- (kill-buffer (current-buffer))))
-
+ (insert (format "\n(setq idlwave-system-directory \"%s\")\n"
+ idlwave-system-directory))
+
+ ;; Define the variable which contains a list of all scanned directories
+ (insert "\n(setq idlwave-path-alist\n '(")
+ (let ((standard-output (current-buffer)))
+ (mapc (lambda (x)
+ (insert "\n ")
+ (prin1 x)
+ (goto-char (point-max)))
+ idlwave-path-alist))
+ (insert "))\n")
+ (write-region nil nil idlwave-path-file))))
(defun idlwave-expand-path (path &optional default-dir)
;; Expand parts of path starting with '+' recursively into directory list.
;; Here we hack func-menu.el in order to support this new mode.
;; The latest versions of func-menu.el already have this stuff in, so
;; we hack only if it is not already there.
-(when (fboundp 'eval-after-load)
+(when (featurep 'xemacs)
(eval-after-load "func-menu"
'(progn
(or (assq 'idlwave-mode fume-function-name-regexp-alist)
(with-current-buffer "*Help*"
(setq truncate-lines t)))
+(declare-function speedbar-add-supported-extension "speedbar" (extension))
+
;; Add .pro files to speedbar for support, if it's loaded
(eval-after-load "speedbar" '(speedbar-add-supported-extension ".pro"))