Thread View: gnu.emacs.sources
1 messages
1 total messages
Started by Avishai Yacobi
Wed, 27 Jan 1993 07:54
TAGS stack implementation
Author: Avishai Yacobi
Date: Wed, 27 Jan 1993 07:54
Date: Wed, 27 Jan 1993 07:54
77 lines
2994 bytes
2994 bytes
Hi everybody,
Well, I'm a new member of this news group and I hope that no one
thought about this simple idea before.
Here is a package that provides a program tracing facility based
on regular TAGS mechanism.
--
----------------------
__ _ _ _ __ ____ __ _
| | | | | | | \/
|/_/ ___|_ | \
........................... cut along dotted line ...........................
;;;
;;; TAGS-STACK.EL -- TAGS interface that allows easy tracing of program flow
;;;
;;; Copyright (C) 1990 Avishai Yacoby
;;
;; This file is not part of the GNU Emacs distribution (yet).
;;
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY. No author or distributor
;; accepts responsibility to anyone for the consequences of using it
;; or for whether it serves any particular purpose or works at all,
;; unless he says so in writing. Refer to the GNU Emacs General Public
;; License for full details.
;; Everyone is granted permission to copy, modify and redistribute
;; this file, but only under the conditions described in the
;; GNU Emacs General Public License. A copy of this license is
;; supposed to have been given to you along with GNU Emacs so you
;; can know your rights and responsibilities. It should be in a
;; file named COPYING. Among other things, the copyright notice
;; and this notice must be preserved on all copies.
; to use this package, load it and bind the functions push-to-tag and my-win-pop
; to some keys. From now, you can use push-to-tag to trace into a function, and my-win-pop
; to return from it. When you come to think about it, it works like a "dry" debugging.
(defvar tags-stack nil
"stack for window configurations. Set by push-to-tag and used
by pop-from-tag")
(defun my-win-push ()
(interactive)
(setq tags-stack
(cons (cons (current-window-configuration) (point)) tags-stack)))
(defun push-to-tag ()
"save window config. and jump to pointed routine or constant"
(interactive)
(my-win-push)
(find-tag (pointed-object)))
(defun my-win-pop ()
"return to previous window setting"
(interactive)
(let ((win-con (car tags-stack)))
(cond
(win-con
(set-window-configuration (car win-con))
(goto-char (cdr win-con))
(setq tags-stack (cdr tags-stack)))
(t
(message "Bottom of windows stack")))))
(defun pointed-object ()
(forward-char 1)
(backward-sexp 1)
(let ((beg (point)))
(forward-sexp 1)
(buffer-substring beg (point))))
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads