emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/idlw-help.el


From: John-David T . Smith
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/idlw-help.el
Date: Sun, 03 Jul 2005 21:51:27 -0400

Index: emacs/lisp/progmodes/idlw-help.el
diff -c emacs/lisp/progmodes/idlw-help.el:1.6 
emacs/lisp/progmodes/idlw-help.el:1.7
*** emacs/lisp/progmodes/idlw-help.el:1.6       Tue Jun 14 23:20:55 2005
--- emacs/lisp/progmodes/idlw-help.el   Mon Jul  4 01:51:23 2005
***************
*** 4,12 ****
  ;; Copyright (c) 2003,2004,2005 Free Software Foundation
  ;;
  ;; Authors: J.D. Smith <address@hidden>
! ;;          Carsten Dominik <address@hidden>
  ;; Maintainer: J.D. Smith <address@hidden>
! ;; Version: 5.5
  
  ;; This file is part of GNU Emacs.
  
--- 4,12 ----
  ;; Copyright (c) 2003,2004,2005 Free Software Foundation
  ;;
  ;; Authors: J.D. Smith <address@hidden>
! ;;          Carsten Dominik <address@hidden>
  ;; Maintainer: J.D. Smith <address@hidden>
! ;; Version: 5.7_22
  
  ;; This file is part of GNU Emacs.
  
***************
*** 36,47 ****
  ;; information, at:
  ;;
  ;;           http://idlwave.org
! ;;
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
  
  ;;; Code:
! (require 'browse-url)
  
  (defgroup idlwave-online-help nil
    "Online Help options for IDLWAVE mode."
--- 36,53 ----
  ;; information, at:
  ;;
  ;;           http://idlwave.org
! ;; 
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
  
  ;;; Code:
! (defvar idlwave-help-browse-url-available nil
!   "Whether browse-url is available")
! 
! (setq idlwave-help-browse-url-available
!       (condition-case nil
!         (require 'browse-url)
!       (error nil)))
  
  (defgroup idlwave-online-help nil
    "Online Help options for IDLWAVE mode."
***************
*** 52,61 ****
    :group 'idlwave-online-help
    :type 'boolean)
  
! (defvar idlwave-html-link-sep
    (if idlwave-html-help-pre-v6 "#" "#wp"))
  
! (defcustom idlwave-html-help-location
    (if (memq system-type '(ms-dos windows-nt))
        nil
      "/usr/local/etc/")
--- 58,67 ----
    :group 'idlwave-online-help
    :type 'boolean)
  
! (defvar idlwave-html-link-sep 
    (if idlwave-html-help-pre-v6 "#" "#wp"))
  
! (defcustom idlwave-html-help-location 
    (if (memq system-type '(ms-dos windows-nt))
        nil
      "/usr/local/etc/")
***************
*** 83,89 ****
    :group 'idlwave-online-help
    :type 'string)
  
! (defcustom idlwave-help-browser-generic-args
    (if (boundp 'browse-url-generic-args)
        browse-url-generic-args "")
    "Program args to use if using browse-url-generic-program."
--- 89,95 ----
    :group 'idlwave-online-help
    :type 'string)
  
! (defcustom idlwave-help-browser-generic-args 
    (if (boundp 'browse-url-generic-args)
        browse-url-generic-args "")
    "Program args to use if using browse-url-generic-program."
***************
*** 183,190 ****
    :type 'string)
  
  (defface idlwave-help-link
!   '((((min-colors 88) (class color)) (:foreground "Blue1"))
!     (((class color)) (:foreground "Blue"))
      (t (:weight bold)))
    "Face for highlighting links into IDLWAVE online help."
    :group 'idlwave-online-help)
--- 189,195 ----
    :type 'string)
  
  (defface idlwave-help-link
!   '((((class color)) (:foreground "Blue"))
      (t (:weight bold)))
    "Face for highlighting links into IDLWAVE online help."
    :group 'idlwave-online-help)
***************
*** 193,199 ****
  
  (defvar idlwave-help-activate-links-aggressively nil
    "Obsolete variable.")
! 
  (defvar idlwave-completion-help-info)
  
  (defvar idlwave-help-frame nil
--- 198,204 ----
  
  (defvar idlwave-help-activate-links-aggressively nil
    "Obsolete variable.")
!   
  (defvar idlwave-completion-help-info)
  
  (defvar idlwave-help-frame nil
***************
*** 242,247 ****
--- 247,256 ----
      "--"
      ["Quit" idlwave-help-quit t]))
  
+ (defvar idlwave-help-def-pos)
+ (defvar idlwave-help-args)
+ (defvar idlwave-help-in-header)
+ 
  (defun idlwave-help-mode ()
    "Major mode for displaying IDL Help.
  
***************
*** 282,287 ****
--- 291,297 ----
    (set (make-local-variable 'idlwave-help-in-header) nil)
    (run-mode-hooks 'idlwave-help-mode-hook))
  
+ (defvar idlwave-system-directory)
  (defun idlwave-html-help-location ()
    "Return the help directory where HTML files are, or nil if that is unknown."
    (or (and (stringp idlwave-html-help-location)
***************
*** 316,331 ****
        (setq idlwave-last-context-help-pos marker)
        (idlwave-do-context-help1 arg)
        (if idlwave-help-diagnostics
!         (message "%s" (mapconcat 'identity
                                   (nreverse idlwave-help-diagnostics)
                                   "; "))))))
  
  (defvar idlwave-help-do-class-struct-tag nil)
  (defvar idlwave-help-do-struct-tag nil)
  (defun idlwave-do-context-help1 (&optional arg)
    "The work-horse version of `idlwave-context-help', which see."
    (save-excursion
!     (if (equal (char-after) ?/)
        (forward-char 1)
        (if (equal (char-before) ?=)
          (backward-char 1)))
--- 326,345 ----
        (setq idlwave-last-context-help-pos marker)
        (idlwave-do-context-help1 arg)
        (if idlwave-help-diagnostics
!         (message "%s" (mapconcat 'identity 
                                   (nreverse idlwave-help-diagnostics)
                                   "; "))))))
  
  (defvar idlwave-help-do-class-struct-tag nil)
+ (defvar idlwave-structtag-struct-location)
  (defvar idlwave-help-do-struct-tag nil)
+ (defvar idlwave-system-variables-alist)
+ (defvar idlwave-executive-commands-alist)
+ (defvar idlwave-system-class-info)
  (defun idlwave-do-context-help1 (&optional arg)
    "The work-horse version of `idlwave-context-help', which see."
    (save-excursion
!     (if (equal (char-after) ?/) 
        (forward-char 1)
        (if (equal (char-before) ?=)
          (backward-char 1)))
***************
*** 335,341 ****
           (beg (save-excursion (skip-chars-backward chars) (point)))
           (end (save-excursion (skip-chars-forward chars) (point)))
           (this-word (buffer-substring-no-properties beg end))
!          (st-ass (assoc (downcase this-word)
                          idlwave-help-special-topic-words))
           (classtag (and (string-match "self\\." this-word)
                          (< beg (- end 4))))
--- 349,355 ----
           (beg (save-excursion (skip-chars-backward chars) (point)))
           (end (save-excursion (skip-chars-forward chars) (point)))
           (this-word (buffer-substring-no-properties beg end))
!          (st-ass (assoc (downcase this-word) 
                          idlwave-help-special-topic-words))
           (classtag (and (string-match "self\\." this-word)
                          (< beg (- end 4))))
***************
*** 343,349 ****
                           (string-match "\\`\\([^.]+\\)\\." this-word)
                           (< beg (- end 4))))
           module keyword cw mod1 mod2 mod3)
!       (if (or arg
              (and (not st-ass)
                   (not classtag)
                   (not structtag)
--- 357,363 ----
                           (string-match "\\`\\([^.]+\\)\\." this-word)
                           (< beg (- end 4))))
           module keyword cw mod1 mod2 mod3)
!       (if (or arg 
              (and (not st-ass)
                   (not classtag)
                   (not structtag)
***************
*** 362,376 ****
                      (setq module (list "init" 'fun (match-string 1 str))
                            idlwave-current-obj_new-class (match-string 1 str))
                    )))))
!       (cond
         (arg (setq mod1 module))
! 
         ;; A special topic -- only system help
         (st-ass (setq mod1 (list (cdr st-ass))))
! 
         ;; A system variable -- only system help
!        ((string-match
!        "\\`!\\([a-zA-Z0-9_]+\\)\\(\.\\([A-Za-z0-9_]+\\)\\)?"
         this-word)
        (let* ((word  (match-string-no-properties 1 this-word))
               (entry (assq (idlwave-sintern-sysvar word)
--- 376,390 ----
                      (setq module (list "init" 'fun (match-string 1 str))
                            idlwave-current-obj_new-class (match-string 1 str))
                    )))))
!       (cond 
         (arg (setq mod1 module))
!        
         ;; A special topic -- only system help
         (st-ass (setq mod1 (list (cdr st-ass))))
!        
         ;; A system variable -- only system help
!        ((string-match 
!        "\\`!\\([a-zA-Z0-9_]+\\)\\(\.\\([A-Za-z0-9_]+\\)\\)?" 
         this-word)
        (let* ((word  (match-string-no-properties 1 this-word))
               (entry (assq (idlwave-sintern-sysvar word)
***************
*** 382,400 ****
                                      (cdr (assq 'tags entry))))))
               (link (nth 1 (assq 'link entry))))
          (if tag-target
!             (setq link (idlwave-substitute-link-target link
                                                         tag-target)))
          (setq mod1 (list link))))
! 
         ;; An executive command -- only system help
         ((string-match "^\\.\\([A-Z_]+\\)" this-word)
        (let* ((word  (match-string 1 this-word))
               (link  (cdr (assoc-string
                            word
!                           idlwave-executive-commands-alist
!                             t))))
          (setq mod1 (list link))))
! 
         ;; A class -- system OR in-text help (via class__define).
         ((and (eq cw 'class)
             (or (idlwave-in-quote)  ; e.g. obj_new
--- 396,413 ----
                                      (cdr (assq 'tags entry))))))
               (link (nth 1 (assq 'link entry))))
          (if tag-target
!             (setq link (idlwave-substitute-link-target link 
                                                         tag-target)))
          (setq mod1 (list link))))
!                         
         ;; An executive command -- only system help
         ((string-match "^\\.\\([A-Z_]+\\)" this-word)
        (let* ((word  (match-string 1 this-word))
               (link  (cdr (assoc-string
                            word
!                           idlwave-executive-commands-alist t))))
          (setq mod1 (list link))))
!        
         ;; A class -- system OR in-text help (via class__define).
         ((and (eq cw 'class)
             (or (idlwave-in-quote)  ; e.g. obj_new
***************
*** 408,435 ****
               (name   (concat (downcase this-word) "__define"))
               (link   (nth 1 (assq 'link entry))))
          (setq mod1 (list link name 'pro))))
! 
         ;; A class structure tag (self.BLAH) -- only in-text help available
         (classtag
        (let ((tag (substring this-word (match-end 0)))
              class-with found-in)
!         (when (setq class-with
                      (idlwave-class-or-superclass-with-tag
                       (nth 2 (idlwave-current-routine))
                       tag))
            (setq found-in (idlwave-class-found-in class-with))
!           (if (assq (idlwave-sintern-class class-with)
                      idlwave-system-class-info)
                (error "No help available for system class tags"))
            (setq idlwave-help-do-class-struct-tag t)
!           (setq mod1 (list nil
                             (if found-in
                                 (cons (concat found-in "__define") class-with)
                               (concat class-with "__define"))
                             'pro
                             nil ; no class.... it's a procedure!
                             tag)))))
! 
         ;; A regular structure tag -- only in text, and if
         ;; optional `complete-structtag' loaded.
         (structtag
--- 421,448 ----
               (name   (concat (downcase this-word) "__define"))
               (link   (nth 1 (assq 'link entry))))
          (setq mod1 (list link name 'pro))))
!        
         ;; A class structure tag (self.BLAH) -- only in-text help available
         (classtag
        (let ((tag (substring this-word (match-end 0)))
              class-with found-in)
!         (when (setq class-with 
                      (idlwave-class-or-superclass-with-tag
                       (nth 2 (idlwave-current-routine))
                       tag))
            (setq found-in (idlwave-class-found-in class-with))
!           (if (assq (idlwave-sintern-class class-with) 
                      idlwave-system-class-info)
                (error "No help available for system class tags"))
            (setq idlwave-help-do-class-struct-tag t)
!           (setq mod1 (list nil 
                             (if found-in
                                 (cons (concat found-in "__define") class-with)
                               (concat class-with "__define"))
                             'pro
                             nil ; no class.... it's a procedure!
                             tag)))))
!        
         ;; A regular structure tag -- only in text, and if
         ;; optional `complete-structtag' loaded.
         (structtag
***************
*** 440,446 ****
          (setq idlwave-help-do-struct-tag
                idlwave-structtag-struct-location
                mod1 (list nil nil nil nil tag))))
! 
         ;; A routine keyword -- in text or system help
         ((and (memq cw '(function-keyword procedure-keyword))
             (stringp this-word)
--- 453,459 ----
          (setq idlwave-help-do-struct-tag
                idlwave-structtag-struct-location
                mod1 (list nil nil nil nil tag))))
!        
         ;; A routine keyword -- in text or system help
         ((and (memq cw '(function-keyword procedure-keyword))
             (stringp this-word)
***************
*** 482,488 ****
               (setq mod1 (append (list t) module (list keyword))
                     mod2 (list t this-word 'fun nil)
                     mod3 (append (list t) module)))))
! 
         ;; Everything else
         (t
        (setq mod1 (append (list t) module))))
--- 495,501 ----
               (setq mod1 (append (list t) module (list keyword))
                     mod2 (list t this-word 'fun nil)
                     mod3 (append (list t) module)))))
!        
         ;; Everything else
         (t
        (setq mod1 (append (list t) module))))
***************
*** 515,528 ****
         word link)
      (mouse-set-point ev)
  
! 
      ;; See if we can also find help somewhere, e.g. for multiple classes
      (setq word (idlwave-this-word))
      (if (string= word "")
        (error "No help item selected"))
      (setq link (get-text-property 0 'link word))
      (select-window cw)
!     (cond
       ;; Routine name
       ((memq what '(procedure function routine))
        (setq name word)
--- 528,541 ----
         word link)
      (mouse-set-point ev)
  
!         
      ;; See if we can also find help somewhere, e.g. for multiple classes
      (setq word (idlwave-this-word))
      (if (string= word "")
        (error "No help item selected"))
      (setq link (get-text-property 0 'link word))
      (select-window cw)
!     (cond 
       ;; Routine name
       ((memq what '(procedure function routine))
        (setq name word)
***************
*** 533,541 ****
                           type)))
            (setq link t)               ; No specific link valid yet
            (if sclasses
!               (setq classes (idlwave-members-only
                               classes (cons class sclasses))))
!           (setq class (idlwave-popup-select ev classes
                                              "Select Class" 'sort))))
  
        ;; XXX is this necessary, given all-method-classes?
--- 546,554 ----
                           type)))
            (setq link t)               ; No specific link valid yet
            (if sclasses
!               (setq classes (idlwave-members-only 
                               classes (cons class sclasses))))
!           (setq class (idlwave-popup-select ev classes 
                                              "Select Class" 'sort))))
  
        ;; XXX is this necessary, given all-method-classes?
***************
*** 555,561 ****
                           type)))
            (setq link t) ; Link can't be correct yet
            (if sclasses
!               (setq classes (idlwave-members-only
                               classes (cons class sclasses))))
            (setq class (idlwave-popup-select ev classes
                                              "Select Class" 'sort))
--- 568,574 ----
                           type)))
            (setq link t) ; Link can't be correct yet
            (if sclasses
!               (setq classes (idlwave-members-only 
                               classes (cons class sclasses))))
            (setq class (idlwave-popup-select ev classes
                                              "Select Class" 'sort))
***************
*** 567,580 ****
        (if (string= (downcase name) "obj_new")
            (setq class idlwave-current-obj_new-class
                  name "Init"))))
! 
       ;; Class name
       ((eq what 'class)
        (setq class word
            word nil))
! 
       ;; A special named function to call which sets some of our variables
!      ((and (symbolp what)
           (fboundp what))
        (funcall what 'set word))
  
--- 580,593 ----
        (if (string= (downcase name) "obj_new")
            (setq class idlwave-current-obj_new-class
                  name "Init"))))
!         
       ;; Class name
       ((eq what 'class)
        (setq class word
            word nil))
!      
       ;; A special named function to call which sets some of our variables
!      ((and (symbolp what) 
           (fboundp what))
        (funcall what 'set word))
  
***************
*** 589,595 ****
    "Highlight all completions for which help is available and attach link.
  Those words in `idlwave-completion-help-links' have links.  The
  `idlwave-help-link' face is used for this."
!   (if idlwave-highlight-help-links-in-completion
        (with-current-buffer (get-buffer "*Completions*")
        (save-excursion
          (let* ((case-fold-search t)
--- 602,608 ----
    "Highlight all completions for which help is available and attach link.
  Those words in `idlwave-completion-help-links' have links.  The
  `idlwave-help-link' face is used for this."
!   (if idlwave-highlight-help-links-in-completion      
        (with-current-buffer (get-buffer "*Completions*")
        (save-excursion
          (let* ((case-fold-search t)
***************
*** 605,611 ****
              (setq beg (match-beginning 1) end (match-end 1)
                    word (match-string 1) doit nil)
              ;; Call special completion function test
!             (if (and (symbolp what)
                       (fboundp what))
                  (setq doit (funcall what 'test word))
                ;; Look for special link property passed in help-links
--- 618,624 ----
              (setq beg (match-beginning 1) end (match-end 1)
                    word (match-string 1) doit nil)
              ;; Call special completion function test
!             (if (and (symbolp what) 
                       (fboundp what))
                  (setq doit (funcall what 'test word))
                ;; Look for special link property passed in help-links
***************
*** 636,648 ****
             ;; Try to select the return frame.
             ;; This can crash on slow network connections, obviously when
             ;; we kill the help frame before the return-frame is selected.
!            ;; To protect the workings, we wait for up to one second
             ;; and check if the return-frame *is* now selected.
             ;; This is marked "eperimental" since we are not sure when its OK.
             (let ((maxtime 1.0) (time 0.) (step 0.1))
               (select-frame idlwave-help-return-frame)
               (while (and (sit-for step)
!                          (not (eq (selected-frame)
                                    idlwave-help-return-frame))
                           (< (setq time (+ time step)) maxtime)))))
         (delete-frame idlwave-help-frame))
--- 649,661 ----
             ;; Try to select the return frame.
             ;; This can crash on slow network connections, obviously when
             ;; we kill the help frame before the return-frame is selected.
!            ;; To protect the workings, we wait for up to one second 
             ;; and check if the return-frame *is* now selected.
             ;; This is marked "eperimental" since we are not sure when its OK.
             (let ((maxtime 1.0) (time 0.) (step 0.1))
               (select-frame idlwave-help-return-frame)
               (while (and (sit-for step)
!                          (not (eq (selected-frame) 
                                    idlwave-help-return-frame))
                           (< (setq time (+ time step)) maxtime)))))
         (delete-frame idlwave-help-frame))
***************
*** 655,661 ****
  (defvar default-toolbar-visible-p)
  
  (defun idlwave-help-display-help-window (&optional pos-or-func)
!   "Display the help window.
  Move window start to POS-OR-FUNC, if passed as a position, or call it
  if passed as a function.  See `idlwave-help-use-dedicated-frame'."
    (let ((cw (selected-window))
--- 668,674 ----
  (defvar default-toolbar-visible-p)
  
  (defun idlwave-help-display-help-window (&optional pos-or-func)
!   "Display the help window.  
  Move window start to POS-OR-FUNC, if passed as a position, or call it
  if passed as a function.  See `idlwave-help-use-dedicated-frame'."
    (let ((cw (selected-window))
***************
*** 666,678 ****
          (switch-to-buffer buf))
        ;; Do it in this frame and save the window configuration
        (if (not (get-buffer-window buf nil))
!         (setq idlwave-help-window-configuration
                (current-window-configuration)))
        (display-buffer buf nil (selected-frame))
        (select-window (get-buffer-window buf)))
      (raise-frame)
!     (if pos-or-func
!       (if (functionp pos-or-func)
            (funcall pos-or-func)
          (goto-char pos-or-func)
          (recenter 0)))
--- 679,691 ----
          (switch-to-buffer buf))
        ;; Do it in this frame and save the window configuration
        (if (not (get-buffer-window buf nil))
!         (setq idlwave-help-window-configuration 
                (current-window-configuration)))
        (display-buffer buf nil (selected-frame))
        (select-window (get-buffer-window buf)))
      (raise-frame)
!     (if pos-or-func 
!       (if (functionp pos-or-func) 
            (funcall pos-or-func)
          (goto-char pos-or-func)
          (recenter 0)))
***************
*** 694,724 ****
        (select-frame idlwave-help-return-frame)))
  
  (defun idlwave-online-help (link &optional name type class keyword)
!   "Display HTML or other special help on a certain topic.
  Either loads an HTML link, if LINK is non-nil, or gets special-help on
  the optional arguments, if any special help is defined.  If LINK is
  `t', first look up the optional arguments in the routine info list to
  see if a link is set for it.  Try extra help functions if necessary."
    ;; Lookup link
!   (if (eq link t)
!       (let ((entry (idlwave-best-rinfo-assoc name type class
                                             (idlwave-routines) nil t)))
        (cond
         ;; Try keyword link
!        ((and keyword
               (setq link (cdr (idlwave-entry-find-keyword entry keyword)))))
         ;; Default, regular entry link
         (t (setq link (idlwave-entry-has-help entry))))))
  
    (cond
     ;; An explicit link
!    ((stringp link)
      (idlwave-help-html-link link))
! 
     ;; Any extra help
     (idlwave-extra-help-function
      (idlwave-help-get-special-help name type class keyword))
! 
     ;; Nothing worked
     (t (idlwave-help-error name type class keyword))))
  
--- 707,737 ----
        (select-frame idlwave-help-return-frame)))
  
  (defun idlwave-online-help (link &optional name type class keyword)
!   "Display HTML or other special help on a certain topic.  
  Either loads an HTML link, if LINK is non-nil, or gets special-help on
  the optional arguments, if any special help is defined.  If LINK is
  `t', first look up the optional arguments in the routine info list to
  see if a link is set for it.  Try extra help functions if necessary."
    ;; Lookup link
!   (if (eq link t) 
!       (let ((entry (idlwave-best-rinfo-assoc name type class 
                                             (idlwave-routines) nil t)))
        (cond
         ;; Try keyword link
!        ((and keyword 
               (setq link (cdr (idlwave-entry-find-keyword entry keyword)))))
         ;; Default, regular entry link
         (t (setq link (idlwave-entry-has-help entry))))))
  
    (cond
     ;; An explicit link
!    ((stringp link) 
      (idlwave-help-html-link link))
!    
     ;; Any extra help
     (idlwave-extra-help-function
      (idlwave-help-get-special-help name type class keyword))
!    
     ;; Nothing worked
     (t (idlwave-help-error name type class keyword))))
  
***************
*** 729,735 ****
         (help-pos (save-excursion
                     (set-buffer (idlwave-help-get-help-buffer))
                     (let ((buffer-read-only nil))
!                      (funcall idlwave-extra-help-function
                                name type class keyword)))))
      (if help-pos
        (idlwave-help-display-help-window help-pos)
--- 742,748 ----
         (help-pos (save-excursion
                     (set-buffer (idlwave-help-get-help-buffer))
                     (let ((buffer-read-only nil))
!                      (funcall idlwave-extra-help-function 
                                name type class keyword)))))
      (if help-pos
        (idlwave-help-display-help-window help-pos)
***************
*** 743,748 ****
--- 756,764 ----
        (browse-url-generic-program idlwave-help-browser-generic-program)
        ;(browse-url-generic-args idlwave-help-browser-generic-args)
        full-link)
+     
+     (unless idlwave-help-browse-url-available
+       (error "browse-url is not available -- install it to use HTML help."))
  
      (if (and (memq system-type '(ms-dos windows-nt))
             idlwave-help-use-hh)
***************
*** 758,769 ****
        ;; Just a regular file name (+ anchor name)
        (unless (and (stringp help-loc)
                   (file-directory-p help-loc))
!       (error
         "Invalid help location; customize `idlwave-html-help-location'."))
!       (setq full-link (concat
                       "file://"
!                      (expand-file-name
!                       link
                        (expand-file-name "idl_html_help" help-loc)))))
  
      ;; Check for a local browser
--- 774,785 ----
        ;; Just a regular file name (+ anchor name)
        (unless (and (stringp help-loc)
                   (file-directory-p help-loc))
!       (error 
         "Invalid help location; customize `idlwave-html-help-location'."))
!       (setq full-link (concat 
                       "file://"
!                      (expand-file-name 
!                       link 
                        (expand-file-name "idl_html_help" help-loc)))))
  
      ;; Check for a local browser
***************
*** 773,783 ****
        (browse-url full-link))))
  
  ;; A special help routine for source-level syntax help in files.
- (defvar idlwave-help-def-pos)
- (defvar idlwave-help-args)
- (defvar idlwave-help-in-header)
  (defvar idlwave-help-fontify-source-code)
  (defvar idlwave-help-source-try-header)
  (defun idlwave-help-with-source (name type class keyword)
    "Provide help for routines not documented in the IDL manuals.  Works
  by loading the routine source file into the help buffer.  Depending on
--- 789,798 ----
        (browse-url full-link))))
  
  ;; A special help routine for source-level syntax help in files.
  (defvar idlwave-help-fontify-source-code)
  (defvar idlwave-help-source-try-header)
+ (defvar idlwave-current-tags-buffer)
+ (defvar idlwave-current-tags-class)
  (defun idlwave-help-with-source (name type class keyword)
    "Provide help for routines not documented in the IDL manuals.  Works
  by loading the routine source file into the help buffer.  Depending on
***************
*** 799,805 ****
      (if class-only   ;Help with class?  Using "Init" as source.
        (setq name "Init"
              type 'fun))
!     (if (not struct-tag)
        (setq file
              (idlwave-routine-source-file
               (nth 3 (idlwave-best-rinfo-assoc
--- 814,820 ----
      (if class-only   ;Help with class?  Using "Init" as source.
        (setq name "Init"
              type 'fun))
!     (if (not struct-tag) 
        (setq file
              (idlwave-routine-source-file
               (nth 3 (idlwave-best-rinfo-assoc
***************
*** 812,818 ****
      (if (or struct-tag (stringp file))
        (progn
          (setq in-buf ; structure-tag completion is always in current buffer
!               (if struct-tag
                    idlwave-current-tags-buffer
                  (idlwave-get-buffer-visiting file)))
          ;; see if file is in a visited buffer, insert those contents
--- 827,833 ----
      (if (or struct-tag (stringp file))
        (progn
          (setq in-buf ; structure-tag completion is always in current buffer
!               (if struct-tag 
                    idlwave-current-tags-buffer
                  (idlwave-get-buffer-visiting file)))
          ;; see if file is in a visited buffer, insert those contents
***************
*** 834,852 ****
      ;; Try to find a good place to display
      (setq def-pos
          ;; Find the class structure tag if that's what we're after
!         (cond
           ;; Class structure tags: find the class or named structure
           ;; definition
           (class-struct-tag
!           (save-excursion
              (setq class
!                   (if (string-match "[a-zA-Z0-9]\\(__\\)" name)
                        (substring name 0 (match-beginning 1))
                      idlwave-current-tags-class))
              (and
               (idlwave-find-class-definition class nil real-class)
               (idlwave-find-struct-tag keyword))))
! 
           ;; Generic structure tags: the structure definition
           ;; location within the file has been recorded in
           ;; `struct-tag'
--- 849,867 ----
      ;; Try to find a good place to display
      (setq def-pos
          ;; Find the class structure tag if that's what we're after
!         (cond 
           ;; Class structure tags: find the class or named structure
           ;; definition
           (class-struct-tag
!           (save-excursion 
              (setq class
!                   (if (string-match "[a-zA-Z0-9]\\(__\\)" name) 
                        (substring name 0 (match-beginning 1))
                      idlwave-current-tags-class))
              (and
               (idlwave-find-class-definition class nil real-class)
               (idlwave-find-struct-tag keyword))))
!          
           ;; Generic structure tags: the structure definition
           ;; location within the file has been recorded in
           ;; `struct-tag'
***************
*** 856,869 ****
               (integerp struct-tag)
               (goto-char struct-tag)
               (idlwave-find-struct-tag keyword))))
! 
           ;; Just find the routine definition
           (t
            (if class-only (point-min)
              (idlwave-help-find-routine-definition name type class keyword))))
          idlwave-help-def-pos def-pos)
  
!     (if (and idlwave-help-source-try-header
             (not (or struct-tag class-struct-tag)))
        ;; Check if we can find the header
        (save-excursion
--- 871,884 ----
               (integerp struct-tag)
               (goto-char struct-tag)
               (idlwave-find-struct-tag keyword))))
!          
           ;; Just find the routine definition
           (t
            (if class-only (point-min)
              (idlwave-help-find-routine-definition name type class keyword))))
          idlwave-help-def-pos def-pos)
  
!     (if (and idlwave-help-source-try-header 
             (not (or struct-tag class-struct-tag)))
        ;; Check if we can find the header
        (save-excursion
***************
*** 873,879 ****
                idlwave-help-in-header header-pos)))
  
      (if (or header-pos def-pos)
!       (progn
          (if (boundp 'idlwave-help-min-frame-width)
              (setq idlwave-help-min-frame-width 80))
          (goto-char (or header-pos def-pos)))
--- 888,894 ----
                idlwave-help-in-header header-pos)))
  
      (if (or header-pos def-pos)
!       (progn 
          (if (boundp 'idlwave-help-min-frame-width)
              (setq idlwave-help-min-frame-width 80))
          (goto-char (or header-pos def-pos)))
***************
*** 887,893 ****
  KEYWORD is ignored. Returns the point of match if successful, nil otherwise."
    (save-excursion
      (goto-char (point-max))
!     (if (re-search-backward
         (concat "^[ \t]*"
                 (if (eq type 'pro) "pro"
                   (if (eq type 'fun) "function"
--- 902,908 ----
  KEYWORD is ignored. Returns the point of match if successful, nil otherwise."
    (save-excursion
      (goto-char (point-max))
!     (if (re-search-backward 
         (concat "^[ \t]*"
                 (if (eq type 'pro) "pro"
                   (if (eq type 'fun) "function"
***************
*** 933,954 ****
  If there is a match, we assume it is the keyword description."
    (let* ((case-fold-search t)
         (rname (if (stringp class)
!                   (concat
                     "\\("
                     ;; Traditional name or class::name
                     "\\("
                     "\\(" (regexp-quote (downcase class)) "::\\)?"
                     (regexp-quote (downcase name))
                     "\\>\\)"
!                    (concat
                      "\\|"
                      ;; class__define or just class
                      (regexp-quote (downcase class)) "\\(__define\\)?")
                     "\\)")
                  (regexp-quote (downcase name))))
! 
         ;; NAME tag plus the routine name.  The new version is from JD.
!        (name-re (concat
                   "\\(^;+\\*?[ \t]*"
                   idlwave-help-doclib-name
                   "\\([ \t]*:\\|[ \t]*$\\)[ \t]*\\(\n;+[ \t]*\\)*"
--- 948,969 ----
  If there is a match, we assume it is the keyword description."
    (let* ((case-fold-search t)
         (rname (if (stringp class)
!                   (concat 
                     "\\("
                     ;; Traditional name or class::name
                     "\\("
                     "\\(" (regexp-quote (downcase class)) "::\\)?"
                     (regexp-quote (downcase name))
                     "\\>\\)"
!                    (concat 
                      "\\|"
                      ;; class__define or just class
                      (regexp-quote (downcase class)) "\\(__define\\)?")
                     "\\)")
                  (regexp-quote (downcase name))))
!        
         ;; NAME tag plus the routine name.  The new version is from JD.
!        (name-re (concat 
                   "\\(^;+\\*?[ \t]*"
                   idlwave-help-doclib-name
                   "\\([ \t]*:\\|[ \t]*$\\)[ \t]*\\(\n;+[ \t]*\\)*"
***************
*** 983,989 ****
                       (regexp-quote (upcase keyword))
                      "\\>")))
         dstart dend name-pos kwds-pos kwd-pos)
!     (catch 'exit
        (save-excursion
        (goto-char (point-min))
        (while (and (setq dstart (re-search-forward idlwave-doclib-start nil t))
--- 998,1004 ----
                       (regexp-quote (upcase keyword))
                      "\\>")))
         dstart dend name-pos kwds-pos kwd-pos)
!     (catch 'exit 
        (save-excursion
        (goto-char (point-min))
        (while (and (setq dstart (re-search-forward idlwave-doclib-start nil t))
***************
*** 991,997 ****
          ;; found a routine header
          (goto-char dstart)
          (if (setq name-pos (re-search-forward name-re dend t))
!             (progn
                (if keyword
                    ;; We do need a keyword
                    (progn
--- 1006,1012 ----
          ;; found a routine header
          (goto-char dstart)
          (if (setq name-pos (re-search-forward name-re dend t))
!             (progn 
                (if keyword
                    ;; We do need a keyword
                    (progn
***************
*** 1073,1079 ****
        (idlwave-help-find-first-header nil)
      (setq idlwave-help-in-header nil)
      (idlwave-help-toggle-header-match-and-def arg 'top)))
! 
  (defun idlwave-help-toggle-header-match-and-def (arg &optional top)
    (interactive "P")
    (let ((args idlwave-help-args)
--- 1088,1094 ----
        (idlwave-help-find-first-header nil)
      (setq idlwave-help-in-header nil)
      (idlwave-help-toggle-header-match-and-def arg 'top)))
!   
  (defun idlwave-help-toggle-header-match-and-def (arg &optional top)
    (interactive "P")
    (let ((args idlwave-help-args)
***************
*** 1085,1091 ****
          (setq pos idlwave-help-def-pos))
        ;; Try to display header
        (setq pos (apply 'idlwave-help-find-in-doc-header
!                      (if top
                           (list (car args) (nth 1 args) (nth 2 args) nil)
                         args)))
        (if pos
--- 1100,1106 ----
          (setq pos idlwave-help-def-pos))
        ;; Try to display header
        (setq pos (apply 'idlwave-help-find-in-doc-header
!                      (if top 
                           (list (car args) (nth 1 args) (nth 2 args) nil)
                         args)))
        (if pos
***************
*** 1119,1125 ****
              (font-lock-fontify-buffer))
          (set-syntax-table syntax-table)))))
  
! 
  (defun idlwave-help-error (name type class keyword)
    (error "Can't find help on %s%s %s"
         (or (and (or class name) (idlwave-make-full-name class name))
--- 1134,1140 ----
              (font-lock-fontify-buffer))
          (set-syntax-table syntax-table)))))
  
!       
  (defun idlwave-help-error (name type class keyword)
    (error "Can't find help on %s%s %s"
         (or (and (or class name) (idlwave-make-full-name class name))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]