From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andrii Kolomoiets Newsgroups: gmane.emacs.devel Subject: Re: python: Let pdb tracking not kill buffers Date: Sat, 2 Nov 2019 20:51:13 +0200 Message-ID: References: <83a7af66fo.fsf@gnu.org> <38E2A645-5581-4724-B87A-37933D1AE4A4@gmail.com> <34E1410D-90ED-412B-96BD-B6934F34C9FA@gmail.com> <83ftj8lz23.fsf@gnu.org> <6F09449A-0EDF-4D7C-86DC-EE466CE032C8@gmail.com> <83v9s2i3ve.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3594.4.19\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_235ED328-1CB7-4C1F-93FD-A715A37E00F1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="100158"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 02 19:52:42 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iQyVu-000PwH-1L for ged-emacs-devel@m.gmane.org; Sat, 02 Nov 2019 19:52:42 +0100 Original-Received: from localhost ([::1]:49964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQyVr-0006wC-QT for ged-emacs-devel@m.gmane.org; Sat, 02 Nov 2019 14:52:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56845) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQyUb-0006po-Is for emacs-devel@gnu.org; Sat, 02 Nov 2019 14:51:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iQyUa-0001IK-KB for emacs-devel@gnu.org; Sat, 02 Nov 2019 14:51:21 -0400 Original-Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]:47034) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iQyUX-0001C1-CQ; Sat, 02 Nov 2019 14:51:17 -0400 Original-Received: by mail-lf1-x141.google.com with SMTP id 19so4275731lft.13; Sat, 02 Nov 2019 11:51:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=j617KeJ/kvv6zZb9H6RtsJYz5ZEC6z1ilqMBdoB/YuA=; b=TE+SUg9YOaUEqSt98bCVmvvLDkowOlc0rCdqf1JF7TBPHGNclWN4o5ED/iqGOcVQty 8x1MHKBfyGSmb+7dVmlwMlgu3fZb8Up718rT3PQC2jO1Z/wDcE7LC+4u7+rMFHV2/7/k 1Zg+Pc7cVYzbqyWdxZcuPcdBSur3MaxhiHqfbci5WVohor6iTDcDS7tK9BrUacEy53MY 564r9bO9+xwTToJXIO8fPIAnodoCuEVIVMv/arTMVxveUaV0T1f/qhJ+T2jdwclLXme6 E+CPiIrzaRvi01MtdFRnWZVIk+hCCt+CVVrMxLASj2DFDPcnhBqB5eDQgir5mDmw3hd+ 72Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=j617KeJ/kvv6zZb9H6RtsJYz5ZEC6z1ilqMBdoB/YuA=; b=RM2DAK0oWDcBFibN+CItjn9Exk0H1J0Wyfxp3xuwgiZGKmGCMhfuvHa4zjLGkPeg1r XL8Ak3PhAIzgcJkscIqmgobXx9PGT/FbuXDqx1J3c9Ur7Si2GvN4vYnou8t/+/KVaz0w iijpIUzisgXfGAYop+bL9CDpfMUbG+yYMxonXMeZdoL+HbWCSD11caLlvqrPZe+oWK48 pH2MJcC2/xZENh70mapmS7jdlXs0Jn6I+QoRTu3nLpdTLIHhWnwuzuIX+eK3Lawkr134 Cfw8ptRhXLih9+ewgigYjOtsw0FpNA2jaEEJVQon4YEmHh7pClmombKh5lvGi8+ceoKL jqDg== X-Gm-Message-State: APjAAAV9YuHIRW6VeV9u6ff7sg3+UIwNjT+mSfD/2IlRFgh7FXANKF4f dWN2Cwf74ZXH6t6kGMx8N0P1abhSIeQ= X-Google-Smtp-Source: APXvYqxj8vlFd4moGNlGwDQAYTUzchFfV+uvn1RQZHZBI7iiFYqVO5ezI673g4rZ8vKv+KdA3EAenA== X-Received: by 2002:a19:c204:: with SMTP id l4mr11358468lfc.163.1572720675593; Sat, 02 Nov 2019 11:51:15 -0700 (PDT) Original-Received: from [192.168.0.104] ([91.206.110.132]) by smtp.gmail.com with ESMTPSA id o26sm3921222lfi.57.2019.11.02.11.51.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Nov 2019 11:51:14 -0700 (PDT) In-Reply-To: <83v9s2i3ve.fsf@gnu.org> X-Mailer: Apple Mail (2.3594.4.19) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::141 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:241739 Archived-At: --Apple-Mail=_235ED328-1CB7-4C1F-93FD-A715A37E00F1 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 2 Nov 2019, at 19:29, Eli Zaretskii wrote: > >> Current python-pdbtrack-stacktrace-info-regexp match only lines with real >> filenames, like: >>> /Users/mad/test.py(3)()->None >> >> Pdb command "next" can bring us to upper stack frame, like: >>> (1)()->None > > OK, but the change in that variable should be called out in the log > entry, so please add that, together with the explanation above. Maybe > also add a comment before the variable to explain what it needs to > match. Explanation is added to python-pdbtrack-stacktrace-info-regexp docstring. >> +*** New user option 'python-pdbtrack-kill-buffers'. >> +If nil, buffers opened during pdbtracking session is not killed when > ^^ > "are", plural. Fixed. Thanks. --Apple-Mail=_235ED328-1CB7-4C1F-93FD-A715A37E00F1 Content-Disposition: attachment; filename=0001-python.el-Pdbtracking-improvements.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-python.el-Pdbtracking-improvements.patch" Content-Transfer-Encoding: quoted-printable =46rom=206a8b5db07acd7c1b61c98d71edb299d2f4f2e6ed=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Andrii=20Kolomoiets=20=0A= Date:=20Sat,=202=20Nov=202019=2018:08:13=20+0200=0ASubject:=20[PATCH]=20= python.el:=20Pdbtracking=20improvements=0A=0AAllow=20to=20not=20kill=20= buffers=20when=20pdbtracking=20session=20is=20finished.=0APdbtracking=20= session=20consider=20finished=20judging=20from=20the=20user=20input.=0A=0A= *=20lisp/progmodes/python.el=20(python-pdbtrack-kill-buffers):=20New=0A= customizable=20variable.=0A(python-pdbtrack-set-tracked-buffer):=20Use=20= it.=0A(python-pdbtrack-unset-tracked-buffer,=20= python-pdbtrack-tracking-finish):=20New=0Afunctions.=0A= (python-pdbtrack-continue-command,=20python-pdbtrack-exit-command):=20= New=0Acustomizable=20variables.=0A(python-pdbtrack-process-sentinel):=20= New=20function.=20=20Finish=20pdbtracking=20session=0Awhen=20process=20= is=20killed.=0A(python-pdbtrack-prev-command-continue):=20New=20= variable.=0A(python-pdbtrack-comint-input-filter-function):=20New=20= function.=20=20Finish=0Apdbtracking=20session=20based=20on=20commands=20= sent=20to=20pdb.=0A(python-pdbtrack-comint-output-filter-function):=20= Unset/set=20tracking=20buffer=20if=0Alooking=20at=20pdb=20prompt;=20= finish=20pdbtracking=20session=20if=20filename=20of=20current=0Astack=20= frame=20starts=20with=20"<"=20e.g.=20"".=0A= (python-pdbtrack-comint-output-filter-function):=20Don't=20override=0A= overlay-arrow-string.=0A(python-pdbtrack-setup-tracking):=20New=20= function.=0A(inferior-python-mode):=20Use=20it.=0A= (python-pdbtrack-stacktrace-info-regexp):=20Default=20value=20is=20= changed.=20=20Must=20also=0Amatch=20lines=20with=20filename=20like=20= ""=20and=20"".=0A;=20*=20etc/NEWS:=20Mention=20= python-pdbtrack-kill-buffers=0A=0Adiff=20--git=20a/etc/NEWS=20b/etc/NEWS=0A= index=207a76d90ed5..eae666eff6=20100644=0A---=20a/etc/NEWS=0A+++=20= b/etc/NEWS=0A@@=20-1389,6=20+1389,11=20@@=20unescaping=20text.=0A=20The=20= maximum=20level=20is=20used=20by=20default;=20customize=0A=20= 'font-lock-maximum-decoration'=20to=20tone=20down=20the=20decoration.=0A=20= =0A+---=0A+***=20New=20user=20option=20'python-pdbtrack-kill-buffers'.=0A= +If=20nil,=20buffers=20opened=20during=20pdbtracking=20session=20are=20= not=20killed=20when=0A+pdbtracking=20session=20is=20finished.=0A+=0A=20= **=20Help=0A=20=0A=20---=0Adiff=20--git=20a/lisp/progmodes/python.el=20= b/lisp/progmodes/python.el=0Aindex=20bdc0f1cd96..e672645c73=20100644=0A= ---=20a/lisp/progmodes/python.el=0A+++=20b/lisp/progmodes/python.el=0A@@=20= -2785,7=20+2785,6=20@@=20inferior-python-mode=0A=20=20=20(set=20= (make-local-variable=20'comint-output-filter-functions)=0A=20=20=20=20=20= =20=20=20'(ansi-color-process-output=0A=20=20=20=20=20=20=20=20=20=20= python-shell-comint-watch-for-first-prompt-output-filter=0A-=20=20=20=20=20= =20=20=20=20python-pdbtrack-comint-output-filter-function=0A=20=20=20=20=20= =20=20=20=20=20python-comint-postoutput-scroll-to-bottom=0A=20=20=20=20=20= =20=20=20=20=20comint-watch-for-password-prompt))=0A=20=20=20(set=20= (make-local-variable=20'compilation-error-regexp-alist)=0A@@=20-2794,12=20= +2793,11=20@@=20inferior-python-mode=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20#'python-shell-completion-at-point=20nil=20'local)=0A=20=20=20= (define-key=20inferior-python-mode-map=20"\t"=0A=20=20=20=20=20= 'python-shell-completion-complete-or-indent)=0A-=20=20= (make-local-variable=20'python-pdbtrack-buffers-to-kill)=0A-=20=20= (make-local-variable=20'python-pdbtrack-tracked-buffer)=0A=20=20=20= (make-local-variable=20'python-shell-internal-last-output)=0A=20=20=20= (when=20python-shell-font-lock-enable=0A=20=20=20=20=20= (python-shell-font-lock-turn-on))=0A-=20=20(compilation-shell-minor-mode=20= 1))=0A+=20=20(compilation-shell-minor-mode=201)=0A+=20=20= (python-pdbtrack-setup-tracking))=0A=20=0A=20(defun=20= python-shell-make-comint=20(cmd=20proc-name=20&optional=20show=20= internal)=0A=20=20=20"Create=20a=20Python=20shell=20comint=20buffer.=0A= @@=20-3728,19=20+3726,72=20@@=20= python-shell-completion-complete-or-indent=0A=20;;;=20PDB=20Track=20= integration=0A=20=0A=20(defcustom=20python-pdbtrack-activate=20t=0A-=20=20= "Non-nil=20makes=20Python=20shell=20enable=20pdbtracking."=0A+=20=20= "Non-nil=20makes=20Python=20shell=20enable=20pdbtracking.=0A+Pdbtracking=20= would=20open=20the=20file=20for=20current=20stack=20frame=20found=20in=20= pdb=20output=20by=0A+`python-pdbtrack-stacktrace-info-regexp'=20and=20= add=20overlay=20arrow=20in=20currently=0A+inspected=20line=20in=20that=20= file.=0A+=0A+After=20command=20listed=20in=20= `python-pdbtrack-continue-command'=20or=0A= +`python-pdbtrack-exit-command'=20is=20sent=20to=20pdb,=20pdbtracking=20= session=20is=0A+considered=20over.=20=20Overlay=20arrow=20will=20be=20= removed=20from=20currentry=20tracked=0A+buffer.=20=20Additionally,=20if=20= `python-pdbtrack-kill-buffers'=20is=20non-nil,=20all=0A+files=20opened=20= by=20pdbtracking=20will=20be=20killed."=0A=20=20=20:type=20'boolean=0A=20= =20=20:group=20'python=0A=20=20=20:safe=20'booleanp)=0A=20=0A=20= (defcustom=20python-pdbtrack-stacktrace-info-regexp=0A-=20=20">=20= \\([^\"(<]+\\)(\\([0-9]+\\))\\([?a-zA-Z0-9_<>]+\\)()"=0A+=20=20">=20= \\([^\"(]+\\)(\\([0-9]+\\))\\([?a-zA-Z0-9_<>]+\\)()"=0A=20=20=20"Regular=20= expression=20matching=20stacktrace=20information.=0A-Used=20to=20extract=20= the=20current=20line=20and=20module=20being=20inspected."=0A+Used=20to=20= extract=20the=20current=20line=20and=20module=20being=20inspected.=0A+=0A= +Must=20match=20lines=20with=20real=20filename,=20like=0A+=20>=20= /path/to/file.py(42)()->None=0A+and=20lines=20in=20which=20= filename=20starts=20with=20'<',=20e.g.=0A+=20>=20= (1)()->None=0A+=0A+In=20the=20first=20case=20= /path/to/file.py=20file=20will=20be=20visited=20and=20overlay=20icon=0A= +will=20be=20placed=20in=20line=2042.=0A+In=20the=20second=20case=20= pdbtracking=20session=20will=20be=20considered=20over=20because=0A+the=20= top=20stack=20frame=20has=20been=20reached.=0A+=0A+Filename=20is=20= expected=20in=20the=20first=20parenthesized=20expression.=0A+Line=20= number=20is=20expected=20in=20the=20second=20parenthesized=20= expression."=0A=20=20=20:type=20'string=0A-=20=20:group=20'python=0A+=20=20= :version=20"27.1"=0A=20=20=20:safe=20'stringp)=0A=20=0A+(defcustom=20= python-pdbtrack-continue-command=20'("c"=20"cont"=20"continue")=0A+=20=20= "Pdb=20'continue'=20command=20aliases.=0A+After=20one=20of=20this=20= commands=20is=20sent=20to=20pdb,=20pdbtracking=20session=20is=0A= +considered=20over.=0A+=0A+This=20command=20is=20remembered=20by=20= pdbtracking.=20=20If=20next=20command=20sent=20to=20pdb=0A+is=20empty=20= string,=20it=20considered=20'continue'=20command=20if=20previous=20= command=0A+was=20'continue'.=20=20This=20behavior=20slightly=20= differentiate=20'continue'=20command=0A+from=20'exit'=20commands=20= listed=20in=20`python-pdbtrack-exit-command'.=0A+=0A+See=20= `python-pdbtrack-activate'=20for=20pdbtracking=20session=20overview."=0A= +=20=20:type=20'list=0A+=20=20:version=20"27.1")=0A+=0A+(defcustom=20= python-pdbtrack-exit-command=20'("q"=20"quit"=20"exit")=0A+=20=20"Pdb=20= 'exit'=20command=20aliases.=0A+After=20one=20of=20this=20commands=20is=20= sent=20to=20pdb,=20pdbtracking=20session=20is=0A+considered=20over.=0A+=0A= +See=20`python-pdbtrack-activate'=20for=20pdbtracking=20session=20= overview."=0A+=20=20:type=20'list=0A+=20=20:version=20"27.1")=0A+=0A= +(defcustom=20python-pdbtrack-kill-buffers=20t=0A+=20=20"If=20non-nil,=20= kill=20buffers=20when=20pdbtracking=20session=20is=20over.=0A+Only=20= buffers=20opened=20by=20pdbtracking=20will=20be=20killed.=0A+=0A+See=20= `python-pdbtrack-activate'=20for=20pdbtracking=20session=20overview."=0A= +=20=20:type=20'boolean=0A+=20=20:version=20"27.1")=0A+=0A=20(defvar=20= python-pdbtrack-tracked-buffer=20nil=0A=20=20=20"Variable=20containing=20= the=20value=20of=20the=20current=20tracked=20buffer.=0A=20Never=20set=20= this=20variable=20directly,=20use=0A@@=20-3749,6=20+3800,9=20@@=20= python-pdbtrack-tracked-buffer=0A=20(defvar=20= python-pdbtrack-buffers-to-kill=20nil=0A=20=20=20"List=20of=20buffers=20= to=20be=20deleted=20after=20tracking=20finishes.")=0A=20=0A+(defvar=20= python-pdbtrack-prev-command-continue=20nil=0A+=20=20"Is=20t=20if=20= previous=20pdb=20command=20was=20'continue'.")=0A+=0A=20(defun=20= python-pdbtrack-set-tracked-buffer=20(file-name)=0A=20=20=20"Set=20the=20= buffer=20for=20FILE-NAME=20as=20the=20tracked=20buffer.=0A=20Internally=20= it=20uses=20the=20`python-pdbtrack-tracked-buffer'=20variable.=0A@@=20= -3756,8=20+3810,7=20@@=20python-pdbtrack-set-tracked-buffer=0A=20=20=20= (let*=20((file-name-prospect=20(concat=20(file-remote-p=20= default-directory)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20file-name))=0A=20=20=20=20=20=20=20= =20=20=20(file-buffer=20(get-file-buffer=20file-name-prospect)))=0A-=20=20= =20=20(if=20file-buffer=0A-=20=20=20=20=20=20=20=20(setq=20= python-pdbtrack-tracked-buffer=20file-buffer)=0A+=20=20=20=20(unless=20= file-buffer=0A=20=20=20=20=20=20=20(cond=0A=20=20=20=20=20=20=20=20= ((file-exists-p=20file-name-prospect)=0A=20=20=20=20=20=20=20=20=20(setq=20= file-buffer=20(find-file-noselect=20file-name-prospect)))=0A@@=20= -3765,10=20+3818,55=20@@=20python-pdbtrack-set-tracked-buffer=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(file-exists-p=20file-name))=0A=20=20=20= =20=20=20=20=20=20;;=20Fallback=20to=20a=20locally=20available=20copy=20= of=20the=20file.=0A=20=20=20=20=20=20=20=20=20(setq=20file-buffer=20= (find-file-noselect=20file-name-prospect))))=0A-=20=20=20=20=20=20(when=20= (not=20(member=20file-buffer=20python-pdbtrack-buffers-to-kill))=0A+=20=20= =20=20=20=20(when=20(and=20python-pdbtrack-kill-buffers=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(not=20(member=20file-buffer=20= python-pdbtrack-buffers-to-kill)))=0A=20=20=20=20=20=20=20=20=20= (add-to-list=20'python-pdbtrack-buffers-to-kill=20file-buffer)))=0A+=20=20= =20=20(setq=20python-pdbtrack-tracked-buffer=20file-buffer)=0A=20=20=20=20= =20file-buffer))=0A=20=0A+(defun=20python-pdbtrack-unset-tracked-buffer=20= ()=0A+=20=20"Untrack=20currently=20tracked=20buffer."=0A+=20=20(when=20= python-pdbtrack-tracked-buffer=0A+=20=20=20=20(with-current-buffer=20= python-pdbtrack-tracked-buffer=0A+=20=20=20=20=20=20(set-marker=20= overlay-arrow-position=20nil))=0A+=20=20=20=20(setq=20= python-pdbtrack-tracked-buffer=20nil)))=0A+=0A+(defun=20= python-pdbtrack-tracking-finish=20()=0A+=20=20"Finish=20tracking."=0A+=20= =20(python-pdbtrack-unset-tracked-buffer)=0A+=20=20(when=20= python-pdbtrack-kill-buffers=0A+=20=20=20=20=20=20(mapc=20#'(lambda=20= (buffer)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (ignore-errors=20(kill-buffer=20buffer)))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20python-pdbtrack-buffers-to-kill))=0A+=20=20(setq=20= python-pdbtrack-buffers-to-kill=20nil))=0A+=0A+(defun=20= python-pdbtrack-process-sentinel=20(process=20_event)=0A+=20=20"Untrack=20= buffers=20when=20PROCESS=20is=20killed."=0A+=20=20(unless=20= (process-live-p=20process)=0A+=20=20=20=20(let=20((buffer=20= (process-buffer=20process)))=0A+=20=20=20=20=20=20(when=20(buffer-live-p=20= buffer)=0A+=20=20=20=20=20=20=20=20(with-current-buffer=20buffer=0A+=20=20= =20=20=20=20=20=20=20=20(python-pdbtrack-tracking-finish))))))=0A+=0A= +(defun=20python-pdbtrack-comint-input-filter-function=20(input)=0A+=20=20= "Finish=20tracking=20session=20depending=20on=20command=20in=20INPUT.=0A= +Commands=20that=20must=20finish=20tracking=20session=20is=20listed=20in=0A= +`python-pdbtrack-untracking-commands'."=0A+=20=20(when=20(and=20= python-pdbtrack-tracked-buffer=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20Empty=20input=20is=20sent=20by=20C-d=20or=20`comint-send-eof'=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20(or=20(string-empty-p=20input)=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20"n=20some=20text"=20= is=20"n"=20command=20for=20pdb.=20Split=20input=20and=20get=20firs=20= part=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(let*=20= ((command=20(car=20(split-string=20(string-trim=20input)=20"=20"))))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20= python-pdbtrack-prev-command-continue=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(or=20(member=20command=20= python-pdbtrack-continue-command)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20if=20command=20= is=20empty=20and=20previous=20command=20was=20'continue'=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20then=20current=20command=20is=20'continue'=20too.=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (and=20(string-empty-p=20command)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= python-pdbtrack-prev-command-continue)))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(or=20python-pdbtrack-prev-command-continue=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (member=20command=20python-pdbtrack-exit-command)))))=0A+=20=20=20=20= (python-pdbtrack-tracking-finish)))=0A+=0A=20(defun=20= python-pdbtrack-comint-output-filter-function=20(output)=0A=20=20=20= "Move=20overlay=20arrow=20to=20current=20pdb=20line=20in=20tracked=20= buffer.=0A=20Argument=20OUTPUT=20is=20a=20string=20with=20the=20output=20= from=20the=20comint=20process."=0A@@=20-3788,19=20+3886,27=20@@=20= python-pdbtrack-comint-output-filter-function=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20;;=20the=20_last_=20stack=20frame=20printed=20in=20the=20= most=20recent=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20batch=20= of=20output,=20then=20jump=20to=20the=20corresponding=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20file/line=20number.=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20;;=20Parse=20output=20only=20if=20at=20pdb=20= prompt=20to=20avoid=20double=20code=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20;;=20run=20in=20situation=20when=20output=20and=20pdb=20prompt=20= received=20in=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= different=20hunks=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (goto-char=20(point-max))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (when=20(re-search-backward=20python-pdbtrack-stacktrace-info-regexp=20= nil=20t)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20(goto-char=20= (line-beginning-position))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (when=20(and=20(looking-at=20python-shell-prompt-pdb-regexp)=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (re-search-backward=20python-pdbtrack-stacktrace-info-regexp=20nil=20t))=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20line-number=20= (string-to-number=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (match-string-no-properties=202)))=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(match-string-no-properties=201)))))=0A-=20=20=20=20=20=20= (if=20(and=20file-name=20line-number)=0A-=20=20=20=20=20=20=20=20=20=20= (let*=20((tracked-buffer=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(python-pdbtrack-set-tracked-buffer=20file-name))=0A+=20=20=20=20= =20=20(when=20(and=20file-name=20line-number)=0A+=20=20=20=20=20=20=20=20= (if=20(string-prefix-p=20"<"=20file-name)=0A+=20=20=20=20=20=20=20=20=20=20= =20=20;;=20Finish=20tracking=20session=20if=20stacktrace=20info=20is=20= like=0A+=20=20=20=20=20=20=20=20=20=20=20=20;;=20">=20= (1)()->None"=0A+=20=20=20=20=20=20=20=20=20=20=20=20= (python-pdbtrack-tracking-finish)=0A+=20=20=20=20=20=20=20=20=20=20= (python-pdbtrack-unset-tracked-buffer)=0A+=20=20=20=20=20=20=20=20=20=20= (let*=20((tracked-buffer=20(python-pdbtrack-set-tracked-buffer=20= file-name))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (shell-buffer=20(current-buffer))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(tracked-buffer-window=20(get-buffer-window=20= tracked-buffer))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (tracked-buffer-line-pos))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= (with-current-buffer=20tracked-buffer=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(set=20(make-local-variable=20'overlay-arrow-string)=20"=3D>")=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(set=20(make-local-variable=20= 'overlay-arrow-position)=20(make-marker))=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(setq=20tracked-buffer-line-pos=20(progn=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(goto-char=20= (point-min))=0A@@=20-3811,17=20+3917,21=20@@=20= python-pdbtrack-comint-output-filter-function=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20tracked-buffer-window=20= tracked-buffer-line-pos))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (set-marker=20overlay-arrow-position=20tracked-buffer-line-pos))=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20(pop-to-buffer=20tracked-buffer)=0A-=20=20= =20=20=20=20=20=20=20=20=20=20(switch-to-buffer-other-window=20= shell-buffer))=0A-=20=20=20=20=20=20=20=20(when=20= python-pdbtrack-tracked-buffer=0A-=20=20=20=20=20=20=20=20=20=20= (with-current-buffer=20python-pdbtrack-tracked-buffer=0A-=20=20=20=20=20=20= =20=20=20=20=20=20(set-marker=20overlay-arrow-position=20nil))=0A-=20=20=20= =20=20=20=20=20=20=20(mapc=20#'(lambda=20(buffer)=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(ignore-errors=20(kill-buffer=20= buffer)))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= python-pdbtrack-buffers-to-kill)=0A-=20=20=20=20=20=20=20=20=20=20(setq=20= python-pdbtrack-tracked-buffer=20nil=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20python-pdbtrack-buffers-to-kill=20nil)))))=0A+=20=20=20=20= =20=20=20=20=20=20=20=20(switch-to-buffer-other-window=20= shell-buffer))))))=0A=20=20=20output)=0A=20=0A+(defun=20= python-pdbtrack-setup-tracking=20()=0A+=20=20"Setup=20pdb=20tracking=20= in=20current=20buffer."=0A+=20=20(make-local-variable=20= 'python-pdbtrack-buffers-to-kill)=0A+=20=20(make-local-variable=20= 'python-pdbtrack-tracked-buffer)=0A+=20=20(add-to-list=20= (make-local-variable=20'comint-input-filter-functions)=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20= #'python-pdbtrack-comint-input-filter-function)=0A+=20=20(add-to-list=20= (make-local-variable=20'comint-output-filter-functions)=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20= #'python-pdbtrack-comint-output-filter-function)=0A+=20=20(add-function=20= :before=20(process-sentinel=20(get-buffer-process=20(current-buffer)))=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= #'python-pdbtrack-process-sentinel)=0A+=20=20(add-hook=20= 'kill-buffer-hook=20#'python-pdbtrack-tracking-finish=20nil=20t))=0A+=0A=20= =0C=0A=20;;;=20Symbol=20completion=0A=20=0A--=20=0A2.15.1=0A=0A= --Apple-Mail=_235ED328-1CB7-4C1F-93FD-A715A37E00F1--