diff options
Diffstat (limited to 'lisp/progmodes/idlwave.el')
-rw-r--r-- | lisp/progmodes/idlwave.el | 112 |
1 files changed, 54 insertions, 58 deletions
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 77e5c2c285b..8de8c8a3f08 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -172,15 +172,12 @@ (require 'timer) (error nil))) -(eval-and-compile - ;; Kludge to allow `defcustom' for Emacs 19. - (condition-case () (require 'custom) (error nil)) - (if (and (featurep 'custom) (fboundp 'custom-declare-variable)) - nil ;; We've got what we needed - ;; We have the old or no custom-library, hack around it! - (defmacro defgroup (&rest args) nil) - (defmacro defcustom (var value doc &rest args) - `(defvar ,var ,value ,doc)))) +(declare-function idlwave-shell-get-path-info "idlw-shell") +(declare-function idlwave-shell-temp-file "idlw-shell") +(declare-function idlwave-shell-is-running "idlw-shell") +(declare-function widget-value "wid-edit" (widget)) +(declare-function comint-dynamic-complete-filename "comint" ()) +(declare-function Info-goto-node "info" (nodename &optional fork)) (defgroup idlwave nil "Major mode for editing IDL .pro files." @@ -2115,15 +2112,11 @@ Returns point if comment found and nil otherwise." (backward-char 1) (point))))) -(defvar transient-mark-mode) -(defvar zmacs-regions) -(defvar mark-active) (defun idlwave-region-active-p () - "Is transient-mark-mode on and the region active? -Works on both Emacs and XEmacs." - (if (featurep 'xemacs) - (and zmacs-regions (region-active-p)) - (and transient-mark-mode mark-active))) + "Should we operate on an active region?" + (if (fboundp 'use-region-p) + (use-region-p) + (region-active-p))) (defun idlwave-show-matching-quote () "Insert quote and show matching quote if this is end of a string." @@ -2827,10 +2820,10 @@ If the optional argument EXPAND is non-nil then the actions in ;; Before indenting, run action routines. ;; (if (and expand idlwave-do-actions) - (mapcar 'idlwave-do-action idlwave-indent-expand-table)) + (mapc 'idlwave-do-action idlwave-indent-expand-table)) ;; (if idlwave-do-actions - (mapcar 'idlwave-do-action idlwave-indent-action-table)) + (mapc 'idlwave-do-action idlwave-indent-action-table)) ;; ;; No longer expand abbrevs on the line. The user can do this ;; manually using expand-region-abbrevs. @@ -3792,7 +3785,7 @@ unless the optional second argument NOINDENT is non-nil." (if (not noindent) (indent-region beg end nil)) (if (stringp prompt) - (message prompt))))) + (message "%s" prompt))))) (defun idlwave-rw-case (string) "Make STRING have the case required by `idlwave-reserved-word-upcase'." @@ -4242,9 +4235,9 @@ blank lines." (defun idlwave-sintern-keyword-list (kwd-list &optional set) "Sintern a set of keywords (file (key . link) (key2 . link2) ...)" - (mapcar (lambda(x) - (setcar x (idlwave-sintern-keyword (car x) set))) - (cdr kwd-list)) + (mapc (lambda(x) + (setcar x (idlwave-sintern-keyword (car x) set))) + (cdr kwd-list)) kwd-list) (defun idlwave-sintern-rinfo-list (list &optional set default-dir) @@ -5560,11 +5553,11 @@ directories and save the routine info. ;; Define the routine info list (insert "\n(setq idlwave-user-catalog-routines\n '(") (let ((standard-output (current-buffer))) - (mapcar (lambda (x) - (insert "\n ") - (prin1 x) - (goto-char (point-max))) - idlwave-user-catalog-routines)) + (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)) @@ -5604,11 +5597,11 @@ directories and save the routine info. ;; Define the variable which contains a list of all scanned directories (insert "\n(setq idlwave-path-alist\n '(") (let ((standard-output (current-buffer))) - (mapcar (lambda (x) - (insert "\n ") - (prin1 x) - (goto-char (point-max))) - idlwave-path-alist)) + (mapc (lambda (x) + (insert "\n ") + (prin1 x) + (goto-char (point-max))) + idlwave-path-alist)) (insert "))\n") (save-buffer 0) (kill-buffer (current-buffer)))) @@ -6319,12 +6312,12 @@ When TYPE is not specified, both procedures and functions will be considered." (if (null method) (mapcar 'car (idlwave-class-alist)) (let (rtn) - (mapcar (lambda (x) - (and (nth 2 x) - (or (not type) - (eq type (nth 1 x))) - (push (nth 2 x) rtn))) - (idlwave-all-assq method (idlwave-routines))) + (mapc (lambda (x) + (and (nth 2 x) + (or (not type) + (eq type (nth 1 x))) + (push (nth 2 x) rtn))) + (idlwave-all-assq method (idlwave-routines))) (idlwave-uniquify rtn)))) (defun idlwave-all-method-keyword-classes (method keyword &optional type) @@ -6335,13 +6328,13 @@ When TYPE is not specified, both procedures and functions will be considered." (null keyword)) nil (let (rtn) - (mapcar (lambda (x) - (and (nth 2 x) ; non-nil class - (or (not type) ; correct or unspecified type - (eq type (nth 1 x))) - (assoc keyword (idlwave-entry-keywords x)) - (push (nth 2 x) rtn))) - (idlwave-all-assq method (idlwave-routines))) + (mapc (lambda (x) + (and (nth 2 x) ; non-nil class + (or (not type) ; correct or unspecified type + (eq type (nth 1 x))) + (assoc keyword (idlwave-entry-keywords x)) + (push (nth 2 x) rtn))) + (idlwave-all-assq method (idlwave-routines))) (idlwave-uniquify rtn)))) (defun idlwave-members-only (list club) @@ -6785,12 +6778,12 @@ accumulate information on matching completions." (message "Making completion list...") (unless idlwave-completion-help-links ; already set somewhere? - (mapcar (lambda (x) ; Pass link prop through to highlight-linked - (let ((link (get-text-property 0 'link (car x)))) - (if link - (push (cons (car x) link) - idlwave-completion-help-links)))) - list)) + (mapc (lambda (x) ; Pass link prop through to highlight-linked + (let ((link (get-text-property 0 'link (car x)))) + (if link + (push (cons (car x) link) + idlwave-completion-help-links)))) + list)) (let* ((list all-completions) ;; "complete" means, this is already a valid completion (complete (memq spart all-completions)) @@ -7031,7 +7024,7 @@ sort the list before displaying" (select-window win) (eval idlwave-complete-after-success-form)) (set-window-start cwin (point-min))))) - (and message (message message))) + (and message (message "%s" message))) (select-window win)))) (defun idlwave-display-completion-list (list &optional message beg complete) @@ -7062,7 +7055,7 @@ sort the list before displaying" (run-hooks 'idlwave-completion-setup-hook) ;; Display the message - (message (or message "Making completion list...done"))) + (message "%s" (or message "Making completion list...done"))) (defun idlwave-choose (function &rest args) "Call FUNCTION as a completion chooser and pass ARGS to it." @@ -7551,7 +7544,7 @@ The list is cached in `idlwave-class-info' for faster access." If RECORD-LINK is non-nil, the keyword text is copied and a text property indicating the link is added." (let (kwds) - (mapcar + (mapc (lambda (key-list) (let ((file (car key-list))) (mapcar (lambda (key-cons) @@ -7599,6 +7592,7 @@ property indicating the link is added." (defvar idlwave-current-class-tags nil) (defvar idlwave-current-native-class-tags nil) (defvar idlwave-sint-class-tags nil) +(declare-function idlwave-sintern-class-tag "idlwave" t t) (idlwave-new-sintern-type 'class-tag) (add-to-list 'idlwave-complete-special 'idlwave-complete-class-structure-tag) (add-hook 'idlwave-update-rinfo-hook 'idlwave-class-tag-reset) @@ -7657,6 +7651,8 @@ property indicating the link is added." (defvar idlwave-sint-sysvars nil) (defvar idlwave-sint-sysvartags nil) +(declare-function idlwave-sintern-sysvar "idlwave" t t) +(declare-function idlwave-sintern-sysvartag "idlwave" t t) (idlwave-new-sintern-type 'sysvar) (idlwave-new-sintern-type 'sysvartag) (add-to-list 'idlwave-complete-special 'idlwave-complete-sysvar-or-tag) @@ -8277,8 +8273,8 @@ demand _EXTRA in the keyword list." (memq (nth 2 entry) super-classes) ; an inherited class (eq (nth 1 entry) type) ; correct type (eq (car entry) name) ; correct name - (mapcar (lambda (k) (add-to-list 'keywords k)) - (idlwave-entry-keywords entry 'do-link)))) + (mapc (lambda (k) (add-to-list 'keywords k)) + (idlwave-entry-keywords entry 'do-link)))) (setq keywords (idlwave-uniquify keywords))) ;; Return the final list @@ -8437,7 +8433,7 @@ If we do not know about MODULE, just return KEYWORD literally." (if (null keywords) (insert " No keywords accepted.") (setq col 9) - (mapcar + (mapc (lambda (x) (if (>= (+ col 1 (length (car x))) (window-width)) |