diff options
Diffstat (limited to 'emacs/emacs19')
-rw-r--r-- | emacs/emacs19 | 312 |
1 files changed, 312 insertions, 0 deletions
diff --git a/emacs/emacs19 b/emacs/emacs19 new file mode 100644 index 0000000000..c3bb070a64 --- /dev/null +++ b/emacs/emacs19 @@ -0,0 +1,312 @@ +Article 15041 of comp.lang.perl: +Path: netlabs!news.cerf.net!usc!sol.ctr.columbia.edu!news.kei.com!bloom-beacon.mit.edu!paperboy.osf.org!meissner +From: meissner@osf.org (Michael Meissner) +Newsgroups: comp.lang.perl +Subject: Re: question on using perldb.el with emacs +Date: 17 Oct 1993 21:10:21 GMT +Organization: Open Software Foundation +Lines: 297 +Message-ID: <MEISSNER.93Oct17171021@pasta.osf.org> +References: <BSHAW.93Oct17143524@bobasun.spdc.ti.com> +NNTP-Posting-Host: pasta.osf.org +In-reply-to: bshaw@bobasun.spdc.ti.com's message of Sun, 17 Oct 1993 19:35:24 GMT + +In article <BSHAW.93Oct17143524@bobasun.spdc.ti.com> bshaw@bobasun.spdc.ti.com +(Bob Shaw) writes: + +| Hi folks +| +| Say, I'm trying to use perldb with emacs. I can invoke perldb +| within emacs ok and get the window *perldb-foo* but when it asks +| for "additional command line arguments" , no matter what I give it +| I get the error message Symbol's function definition is void: make- +| shell. +| +| The debugger , by itself, works fine but wanted to try out perldb in +| emacs. + +This is a symptom of using Emacs 19.xx with perldb.el which was originally made +for emacs version 18.xx. You can either install the emacs19 replacement for +perldb that hooks it in with GUD (grand unified debugger), or apply the patches +that I picked off of the net (I use the perldb replacement that uses GUD +myself): + +#!/bin/sh +# This is a shell archive (produced by shar 3.49) +# To extract the files from this archive, save it to a file, remove +# everything above the "!/bin/sh" line above, and type "sh file_name". +# +# made 10/17/1993 21:07 UTC by meissner@pasta.osf.org +# Source directory /usr/users/meissner/elisp +# +# existing files will NOT be overwritten unless -c is specified +# +# This shar contains: +# length mode name +# ------ ---------- ------------------------------------------ +# 4761 -rw-r--r-- emacs19-perldb.el +# 3845 -rw-rw-r-- emacs19-perldb.patches +# +# ============= emacs19-perldb.el ============== +if test -f 'emacs19-perldb.el' -a X"$1" != X"-c"; then + echo 'x - skipping emacs19-perldb.el (File already exists)' +else +echo 'x - extracting emacs19-perldb.el (Text)' +sed 's/^X//' << 'SHAR_EOF' > 'emacs19-perldb.el' && +X;; Author : Stephane Boucher +X;; Note : This is an add on for gud (Part of GNU Emacs 19). It is +X;; derived from the gdb section that is part of gud. +X +X;; Copyright (C) 1993 Stephane Boucher. +X +X;; Perldb is free software; you can redistribute it and/or modify +X;; it under the terms of the GNU General Public License as published by +X;; the Free Software Foundation; either version 2, or (at your option) +X;; any later version. +X +X;; Perldb Emacs is distributed in the hope that it will be useful, +X;; but WITHOUT ANY WARRANTY; without even the implied warranty of +X;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +X;; GNU General Public License for more details. +X +X;; You should have received a copy of the GNU General Public License +X;; along with GNU Emacs; see the file COPYING. If not, write to +X;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +X +X(require 'gud) +X +X;; ====================================================================== +X;; perldb functions +X +X;;; History of argument lists passed to perldb. +X(defvar gud-perldb-history nil) +X +X(defun gud-perldb-massage-args (file args) +X (cons "-d" (cons file (cons "-emacs" args)))) +X +X;; There's no guarantee that Emacs will hand the filter the entire +X;; marker at once; it could be broken up across several strings. We +X;; might even receive a big chunk with several markers in it. If we +X;; receive a chunk of text which looks like it might contain the +X;; beginning of a marker, we save it here between calls to the +X;; filter. +X(defvar gud-perldb-marker-acc "") +X +X(defun gud-perldb-marker-filter (string) +X (save-match-data +X (setq gud-perldb-marker-acc (concat gud-perldb-marker-acc string)) +X (let ((output "")) +X +X ;; Process all the complete markers in this chunk. +X (while (string-match "^\032\032\\([^:\n]*\\):\\([0-9]*\\):.*\n" +X gud-perldb-marker-acc) +X (setq +X +X ;; Extract the frame position from the marker. +X gud-last-frame +X (cons (substring gud-perldb-marker-acc (match-beginning 1) (match-end 1)) +X (string-to-int (substring gud-perldb-marker-acc +X (match-beginning 2) +X (match-end 2)))) +X +X ;; Append any text before the marker to the output we're going +X ;; to return - we don't include the marker in this text. +X output (concat output +X (substring gud-perldb-marker-acc 0 (match-beginning 0))) +X +X ;; Set the accumulator to the remaining text. +X gud-perldb-marker-acc (substring gud-perldb-marker-acc (match-end 0)))) +X +X ;; Does the remaining text look like it might end with the +X ;; beginning of another marker? If it does, then keep it in +X ;; gud-perldb-marker-acc until we receive the rest of it. Since we +X ;; know the full marker regexp above failed, it's pretty simple to +X ;; test for marker starts. +X (if (string-match "^\032.*\\'" gud-perldb-marker-acc) +X (progn +X ;; Everything before the potential marker start can be output. +X (setq output (concat output (substring gud-perldb-marker-acc +X 0 (match-beginning 0)))) +X +X ;; Everything after, we save, to combine with later input. +X (setq gud-perldb-marker-acc +X (substring gud-perldb-marker-acc (match-beginning 0)))) +X +X (setq output (concat output gud-perldb-marker-acc) +X gud-perldb-marker-acc "")) +X +X output))) +X +X(defun gud-perldb-find-file (f) +X (find-file-noselect f)) +X +X;;;###autoload +X(defun perldb (command-line) +X "Run perldb on program FILE in buffer *gud-FILE*. +XThe directory containing FILE becomes the initial working directory +Xand source-file directory for your debugger." +X (interactive +X (list (read-from-minibuffer "Run perldb (like this): " +X (if (consp gud-perldb-history) +X (car gud-perldb-history) +X "perl ") +X nil nil +X '(gud-perldb-history . 1)))) +X (gud-overload-functions '((gud-massage-args . gud-perldb-massage-args) +X (gud-marker-filter . gud-perldb-marker-filter) +X (gud-find-file . gud-perldb-find-file) +X )) +X +X (gud-common-init command-line) +X +X (gud-def gud-break "b %l" "\C-b" "Set breakpoint at current line.") +X (gud-def gud-remove "d %l" "\C-d" "Remove breakpoint at current line") +X (gud-def gud-step "s" "\C-s" "Step one source line with display.") +X (gud-def gud-next "n" "\C-n" "Step one line (skip functions).") +X (gud-def gud-cont "c" "\C-r" "Continue with display.") +X; (gud-def gud-finish "finish" "\C-f" "Finish executing current function.") +X; (gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).") +X; (gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).") +X (gud-def gud-print "%e" "\C-p" "Evaluate perl expression at point.") +X +X (setq comint-prompt-regexp "^ DB<[0-9]+> ") +X (run-hooks 'perldb-mode-hook) +X ) +SHAR_EOF +chmod 0644 emacs19-perldb.el || +echo 'restore of emacs19-perldb.el failed' +Wc_c="`wc -c < 'emacs19-perldb.el'`" +test 4761 -eq "$Wc_c" || + echo 'emacs19-perldb.el: original size 4761, current size' "$Wc_c" +fi +# ============= emacs19-perldb.patches ============== +if test -f 'emacs19-perldb.patches' -a X"$1" != X"-c"; then + echo 'x - skipping emacs19-perldb.patches (File already exists)' +else +echo 'x - extracting emacs19-perldb.patches (Text)' +sed 's/^X//' << 'SHAR_EOF' > 'emacs19-perldb.patches' && +XFrom dmm0t@rincewind.mech.virginia.edu Fri Jul 16 23:17:10 1993 +XPath: paperboy.osf.org!bloom-beacon.mit.edu!biosci!uwm.edu!ux1.cso.uiuc.edu!howland.reston.ans.net!darwin.sura.net!news-feed-2.peachnet.edu!concert!uvaarpa!murdoch!rincewind.mech.virginia.edu!dmm0t +XFrom: dmm0t@rincewind.mech.virginia.edu (David Meyer) +XNewsgroups: gnu.emacs.sources +XSubject: patches to perldb.el for emacs-19 +XMessage-ID: <CA7uq9.30J@murdoch.acc.Virginia.EDU> +XDate: 15 Jul 93 17:18:07 GMT +XSender: usenet@murdoch.acc.Virginia.EDU +XOrganization: University of Virginia +XLines: 97 +X +X +XHere are my patches to perldb.el (the perl debugger mode that comes +Xwith perl 4.0xx). Basically, all I've done is to hack perldb.el to +Xuse comint.el stuff rather than the old shell.el stuff (i.e. change +Xshell-mode-map to comint-mode-map). +X +XI've been using my patched version without problem, but if anyone sees +Xsomething I've missed, please post or send e-mail. +X +X Thanks, +X Dave +X +X +X*** /Users/dmm0t/perldb.el Thu Jul 15 13:06:59 1993 +X--- perldb.el Tue Jul 6 22:24:41 1993 +X*************** +X*** 65,71 **** +X +X (if perldb-mode-map +X nil +X! (setq perldb-mode-map (copy-keymap shell-mode-map)) +X (define-key perldb-mode-map "\C-l" 'perldb-refresh)) +X +X (define-key ctl-x-map " " 'perldb-break) +X--- 65,71 ---- +X +X (if perldb-mode-map +X nil +X! (setq perldb-mode-map (copy-keymap comint-mode-map)) +X (define-key perldb-mode-map "\C-l" 'perldb-refresh)) +X +X (define-key ctl-x-map " " 'perldb-break) +X*************** +X*** 122,131 **** +X (setq mode-name "Inferior Perl") +X (setq mode-line-process '(": %s")) +X (use-local-map perldb-mode-map) +X! (make-local-variable 'last-input-start) +X! (setq last-input-start (make-marker)) +X! (make-local-variable 'last-input-end) +X! (setq last-input-end (make-marker)) +X (make-local-variable 'perldb-last-frame) +X (setq perldb-last-frame nil) +X (make-local-variable 'perldb-last-frame-displayed-p) +X--- 122,131 ---- +X (setq mode-name "Inferior Perl") +X (setq mode-line-process '(": %s")) +X (use-local-map perldb-mode-map) +X! (make-local-variable 'comint-last-input-start) +X! (setq comint-last-input-start (make-marker)) +X! (make-local-variable 'comint-last-input-end) +X! (setq comint-last-input-end (make-marker)) +X (make-local-variable 'perldb-last-frame) +X (setq perldb-last-frame nil) +X (make-local-variable 'perldb-last-frame-displayed-p) +X*************** +X*** 134,142 **** +X (setq perldb-delete-prompt-marker nil) +X (make-local-variable 'perldb-filter-accumulator) +X (setq perldb-filter-accumulator nil) +X! (make-local-variable 'shell-prompt-pattern) +X! (setq shell-prompt-pattern perldb-prompt-pattern) +X! (run-hooks 'shell-mode-hook 'perldb-mode-hook)) +X +X (defvar current-perldb-buffer nil) +X +X--- 134,142 ---- +X (setq perldb-delete-prompt-marker nil) +X (make-local-variable 'perldb-filter-accumulator) +X (setq perldb-filter-accumulator nil) +X! (make-local-variable 'comint-prompt-regexp) +X! (setq comint-prompt-regexp perldb-prompt-pattern) +X! (run-hooks 'comint-mode-hook 'perldb-mode-hook)) +X +X (defvar current-perldb-buffer nil) +X +X*************** +X*** 189,195 **** +X (setq default-directory dir) +X (or (bolp) (newline)) +X (insert "Current directory is " default-directory "\n") +X! (apply 'make-shell +X (concat "perldb-" file) perldb-command-name nil "-d" path "-emacs" +X (parse-args args)) +X (perldb-mode) +X--- 189,195 ---- +X (setq default-directory dir) +X (or (bolp) (newline)) +X (insert "Current directory is " default-directory "\n") +X! (apply 'make-comint +X (concat "perldb-" file) perldb-command-name nil "-d" path "-emacs" +X (parse-args args)) +X (perldb-mode) +X-- +XDavid M. Meyer Mechanical & Aerospace Engineering +Xdmm0t@rincewind.mech.virginia.edu University of Virginia +XNeXTmail ok +X +SHAR_EOF +chmod 0664 emacs19-perldb.patches || +echo 'restore of emacs19-perldb.patches failed' +Wc_c="`wc -c < 'emacs19-perldb.patches'`" +test 3845 -eq "$Wc_c" || + echo 'emacs19-perldb.patches: original size 3845, current size' "$Wc_c" +fi +exit 0 + +-- +Michael Meissner email: meissner@osf.org phone: 617-621-8861 +Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142 + +Old hackers never die, their bugs just increase. + + |