]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/idlw-complete-structtag.el
Fix references to jit-lock properties.
[gnu-emacs] / lisp / progmodes / idlw-complete-structtag.el
index cec25fcc25eeff6d6f5bc39dbdc42f3fbfda2d69..613baed6bb10c4a2652a37e65622ceb2e4767083 100644 (file)
@@ -1,18 +1,19 @@
 ;;; idlw-complete-structtag.el --- Completion of structure tags.
-;; Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006
-;; Free Software Foundation, Inc.
 
-;; Author: Carsten Dominik <dominik@science.uva.nl>
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <dominik@astro.uva.nl>
 ;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
 ;; Version: 1.2
 ;; Keywords: languages
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,9 +21,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
 ;;
 ;; INSTALLATION
 ;; ============
-;; Put this file on the emacs load path and load it with the following
+;; Put this file on the emacs load path and load it with the following 
 ;; line in your .emacs file:
 ;;
-;;   (add-hook 'idlwave-load-hook
+;;   (add-hook 'idlwave-load-hook 
 ;;             (lambda () (require 'idlw-complete-structtag)))
 ;;
 ;; DESCRIPTION
@@ -80,7 +79,7 @@
 ;; Notes
 ;; -----
 ;;  - The structure definition assignment "state = {...}" must use the
-;;    same variable name as the the completion location "state.*".
+;;    same variable name as the completion location "state.*".
 ;;  - The structure definition must be in the same file.
 ;;  - The structure definition is searched backwards and then forward
 ;;    from the current position, until a definition with tags is found.
@@ -88,7 +87,9 @@
 ;;  - You can force an update of the tag list with the usual command
 ;;    to update routine info in IDLWAVE: C-c C-i
 
-(defvar idlwave-completion-help-info)
+(require 'idlwave)
+
+(declare-function idlwave-shell-buffer "idlw-shell")
 
 ;; Some variables to identify the previously used structure
 (defvar idlwave-current-tags-var nil)
 (defvar idlwave-sint-structtags nil)
 
 ;; Create the sintern type for structure talks
+(declare-function idlwave-sintern-structtag "idlw-complete-structtag" t t)
 (idlwave-new-sintern-type 'structtag)
 
 ;; Hook the plugin into idlwave
 (add-hook 'idlwave-update-rinfo-hook 'idlwave-structtag-reset)
 
 ;;; The main code follows below
-
+(defvar idlwave-completion-help-info)
 (defun idlwave-complete-structure-tag ()
   "Complete a structure tag.
 This works by looking in the current file for a structure assignment to a
@@ -146,9 +148,9 @@ an up-to-date completion list."
                   (not (equal start idlwave-current-tags-completion-pos)))
              (idlwave-prepare-structure-tag-completion var))
           (setq idlwave-current-tags-completion-pos start)
-         (setq idlwave-completion-help-info
+         (setq idlwave-completion-help-info 
                (list 'idlwave-complete-structure-tag-help))
-         (idlwave-complete-in-buffer 'structtag 'structtag
+         (idlwave-complete-in-buffer 'structtag 'structtag 
                                      idlwave-current-struct-tags nil
                                      "Select a structure tag" "structure tag")
          t) ; we did the completion: return t to skip other completions
@@ -167,7 +169,7 @@ an up-to-date completion list."
   (if (eq major-mode 'idlwave-shell-mode)
       ;; OK, we are in the shell, do it dynamically
       (progn
-        (message "preparing shell tags")
+        (message "preparing shell tags") 
         ;; The following call puts the tags into `idlwave-current-struct-tags'
         (idlwave-complete-structure-tag-query-shell var)
         ;; initialize
@@ -189,7 +191,7 @@ an up-to-date completion list."
             ;; Find possible definitions of the structure.
             (while (idlwave-find-structure-definition var nil 'all)
               (let ((tags (idlwave-struct-tags)))
-                (when tags
+                (when tags 
                   ;; initialize
                   (setq idlwave-sint-structtags nil
                         idlwave-current-tags-buffer (current-buffer)