Source

ilisp / ilisp-src.el

Diff from to

ilisp-src.el

 ;;; -*- Mode: Emacs-Lisp -*-
 
 ;;; ilisp-src.el --
-
+;;;
 ;;; This file is part of ILISP.
-;;; Version: 5.10.1
+;;; Please refer to the file COPYING for copyrights and licensing
+;;; information.
+;;; Please refer to the file ACKNOWLEGDEMENTS for an (incomplete) list
+;;; of present and past contributors.
 ;;;
-;;; Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
-;;;               1993, 1994 Ivan Vasquez
-;;;               1994, 1995, 1996 Marco Antoniotti and Rick Busdiecker
-;;;               1996-2000 Marco Antoniotti and Rick Campbell
-;;;
-;;; Other authors' names for which this Copyright notice also holds
-;;; may appear later in this file.
-;;;
-;;; Send mail to 'majordomo@cons.org' to be included in the
-;;; ILISP mailing list. 'ilisp@cons.org' is the general ILISP
-;;; mailing list were bugs and improvements are discussed.
-;;;
-;;; ILISP is freely redistributable under the terms found in the file
-;;; COPYING.
+;;; $Id$
 
 (require 'cl)
 
     (unwind-protect
        (if (and tags-file-name (not source-ok))
 	   (progn (setq lisp-using-tags t)
-		  (if (string-match "Lucid" emacs-version)
-		      (find-tag symbol-name stay)
-		      (find-tag symbol-name nil stay))
+		  (cond 
+		   (search
+		    ;; Search through all files listed in tags table
+		    (setq tags-loop-scan (list locator
+					       (list 'quote symbol) 
+					       type t nil)
+			  tags-loop-operate nil)
+		    (tags-loop-continue t))
+		   (t
+		    ;; Use tags
+		    (if (string-match "Lucid" emacs-version)
+			(find-tag symbol-name stay)
+		      (find-tag symbol-name nil stay))))
 		  (setq tagged t)))
        (if (not tagged)
 	   (progn
 ;;; Note:
 ;;;
 ;;; 19990804 Marco Antoniotti
-;;; The new ones (method and generic-function) should be carefully checked.
+;;; The new ones (method and generic-fucntion) should be carefully checked.
 
 (defvar ilisp-cl-source-locater-patterns
   '((setf
 
 (defun lisp-locate-clisp (symbol type first back)
   "Try to find SYMBOL's TYPE definition in the current buffer.
-Return T if successful.  FIRST is T if this is the first time in a
+Return T if sucessful.  FIRST is T if this is the first time in a
 file.  BACK is T to go backwards."
 
   (let* ((name (regexp-quote (lisp-symbol-name symbol)))
      ;; Give up!
      )))
 
+;;;%% Locators for Scheme
+
+;;; Matthias Koeppe <mail.math.uni-magdeburg.de>
+;;;
+;;; The standard locators would fail on "(define (thunk) ....)"  and
+;;; report "(define (procedure ...) ....)" as a call to procedure.
+
+(defun ilisp-locate-scheme-definition (symbol type first back)
+  "Find SYMBOL's TYPE definition in the current file. Return T if successful.
+This is the Scheme counterpart of `lisp-locate-ilisp'."
+  (lisp-re back
+	   "[ \t\n]*(def[^ \t\n]*[ \t\n]+(*%s\[ \t\n()]" 
+	   (regexp-quote (lisp-symbol-name symbol))))
+
+(defun ilisp-locate-scheme-calls (symbol type first back)
+  "Locate calls to SYMBOL.
+This is the Scheme counterpart of `lisp-locate-calls'."
+  (let ((call-regexp 
+	 (format "[( \t\n]+%s[ \t\n()]+"
+		 (regexp-quote 
+		  ;; Scheme has no package prefixes, so we use
+		  ;; lisp-symbol-name instead of lisp-buffer-symbol.
+		  (lisp-symbol-name symbol))))
+	(def-regexp "[ \t\n]*(def[^ \t\n]*[ \t\n]+(*")
+	(result 'unknown))
+    (while (eq result 'unknown)
+      (cond 
+       ((if back
+	    (re-search-backward call-regexp nil t)
+	  (re-search-forward call-regexp nil t))
+	(if (not (save-excursion	; check whether definition
+		   (goto-char (match-beginning 0))
+		   (backward-sexp) (backward-char)
+		   (looking-at def-regexp)))
+	    (setq result t)))
+       (t (setq result nil))))
+    result))	    
+
+
 ;;; end of file -- ilisp-src.el --
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.