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: Mon, 7 Oct 2019 15:28:06 +0300 Message-ID: <38E2A645-5581-4724-B87A-37933D1AE4A4@gmail.com> References: <83a7af66fo.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_54AA9A55-BA72-4F20-87BA-F31DCA16382E" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="29611"; 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 Mon Oct 07 14:35:41 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 1iHSEl-0007XS-Ay for ged-emacs-devel@m.gmane.org; Mon, 07 Oct 2019 14:35:39 +0200 Original-Received: from localhost ([::1]:44106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHSEj-0006MA-I4 for ged-emacs-devel@m.gmane.org; Mon, 07 Oct 2019 08:35:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50350) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHS7h-0001tk-F9 for emacs-devel@gnu.org; Mon, 07 Oct 2019 08:28:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iHS7g-0001iU-AX for emacs-devel@gnu.org; Mon, 07 Oct 2019 08:28:21 -0400 Original-Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]:34068) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iHS7X-0001dm-Lk; Mon, 07 Oct 2019 08:28:12 -0400 Original-Received: by mail-lj1-x241.google.com with SMTP id j19so13435251lja.1; Mon, 07 Oct 2019 05:28:10 -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=XhXrfFBwQ0TGrdzC2X7aMARUNNhwvqHzYsVpK48OuVc=; b=qX3nz8GnkvEzGRc1ksDnqHvxx4WH3EWP5D67a/ojQTI0Kt9gcSe1o8CZSHNlH1d33b S6Chhvo9V1Kp7oSZipo74YvYkvGpRF7Bl2Wq913UERPUDKGyY4RH+tyycFgvlZ/VD+Z0 AvuU+MtJ/Dyc6upoNBFreRU6hhlcq0tBPT8bYHTrBacRa+vcYRgdmMHcChuNHDfC8lIN cPx1O05VDA5fdaSfqBmX8/sHvU4RKYs5+Q33l/EZoXYB/uA1EEznGcVVyg/xaHa5iRC3 HCvEMw/9O1yGpyoz9a5aMeSQVCBCo3lFaP6OKn+bTg8UZNqEWXDcEcmrmQlEzrbLwLRs x3Qw== 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=XhXrfFBwQ0TGrdzC2X7aMARUNNhwvqHzYsVpK48OuVc=; b=t+KnoT7IBW6EI93ENTSLwMDkZC/C+nfTXwZMnL8K5xRypjLSXo8kEQ1mdPwaLE61+A 9Qb5QIf23VqgNh0FNpQvoCLTk4msyqqtQEKSxVdQnfmnl0hL8KSsIL8ryoZgooih7uvj lvYXQ/h65O+bxO7aUk2F5DYzbPEk2PC21TuEj/ukWIB6dfG10KYLVkUXBNUgB/3xJWUR V0moMHslJbCbBWLepmKP1u2BSMVN9BX2Qh0uFvLafI5AeXFC3wn95Dy/2njEFU8UXWAl n07ZzUkb5V6nBT/Tk8F4FAmYWj2PPtALPp6A+Znne3193Gy0Sf7bhbFGm1E1SO8vek/0 p11w== X-Gm-Message-State: APjAAAUdCKT8wBYcKinbznX4ARK5osn1iwTUfdvEwbl58pVIKcbZNsN9 Rq7N0d9BCZ90SMw1YuEhLkOE3bUM X-Google-Smtp-Source: APXvYqy/2Bub9h3aYJv4oboogQs005cyLcj8ykjqYzxS3o4+xLlUCLiNRb8Z4pDLpk+u2C0zCdXufw== X-Received: by 2002:a2e:87c8:: with SMTP id v8mr18718943ljj.24.1570451288694; Mon, 07 Oct 2019 05:28:08 -0700 (PDT) Original-Received: from [10.1.1.105] (188-42-207-82.ip.ukrtel.net. [82.207.42.188]) by smtp.gmail.com with ESMTPSA id c15sm4022388lja.99.2019.10.07.05.28.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Oct 2019 05:28:07 -0700 (PDT) In-Reply-To: <83a7af66fo.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.104.11) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::241 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:240692 Archived-At: --Apple-Mail=_54AA9A55-BA72-4F20-87BA-F31DCA16382E Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Oct 5, 2019, at 09:40, Eli Zaretskii wrote: > > Aren't users supposed to use pdb via "M-x pdb" instead? (I don't use > this, and don't debug Python programs, so maybe my question makes no > sense.) M-x pdb requires launch program in gud-mode while pdbtrack comint output filter can be used in any buffer and mode, like interactive python shell. >> Please see attached patch. I certainly sure docstrings and naming are >> not so good but they can be fine tuned later if the main idea will be >> accepted. > > Besides the question I asked above, your patch is too large to be > accepted without assigning copyright to the FSF. Would you like to > start the legal paperwork rolling, so that any contributions from you > could be accepted without limitations? Yes, please. >> +(defcustom python-pdbtrack-continue-command '("c" "cont" "continue") >> + "Pdb continue command." >> + :type 'list >> + :group 'python) > > Each new defcustom should have a :version tag. Also, if they belong > to the group of the current file, our convention is not to use :group, > as that's redundant. Would it be better to create a separate subgroup for pdbtracking related variables? >> +(defcustom python-pdbtrack-kill-buffers t >> + "Kill buffers when tracking is finished. >> +Only buffers opened during tracking will be killed." > > The first sentence should be "If non-nil, kill buffers when tracking > is finished." (And that is somewhat unclear, because it isn't clear > what it means "when tracking is finished".) Please see updated patch. --Apple-Mail=_54AA9A55-BA72-4F20-87BA-F31DCA16382E Content-Disposition: attachment; filename=pdb-track.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="pdb-track.patch" Content-Transfer-Encoding: quoted-printable diff=20--git=20a/lisp/progmodes/python.el=20b/lisp/progmodes/python.el=0A= index=20ae5aff351c..8a0f12550e=20100644=0A---=20= a/lisp/progmodes/python.el=0A+++=20b/lisp/progmodes/python.el=0A@@=20= -2795,7=20+2795,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-2804,12=20= +2803,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-3738,19=20+3736,59=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=20Used=20to=20= extract=20the=20current=20line=20and=20module=20being=20inspected."=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-3759,6=20+3797,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= -3766,8=20+3807,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= -3775,10=20+3815,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-3798,19=20+3883,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-3821,17=20+3914,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= --Apple-Mail=_54AA9A55-BA72-4F20-87BA-F31DCA16382E--