From test at bas.bg Fri Sep 5 19:47:45 2003 From: test at bas.bg (MailScanner) Date: Fri Sep 5 11:47:58 2003 Subject: [Python-mode] Warning: E-mail viruses detected Message-ID: <200309051547.h85Flj1J017680@argo.bas.bg> Our virus detector has just been triggered by a message you sent:- To: Subject: Re: Re: My details Date: Fri Sep 5 18:47:45 2003 Any infected parts of the message have not been delivered. This message is simply to warn you that your computer system may have a virus present and should be checked. The virus detector said this about the message: Report: /mnt/disk2/mailscanner/incoming/h85FlZfM017675/application.pif Infection: W32/Sobig.F@mm Shortcuts to MS-Dos programs are very dangerous in email (application.pif) -- MailScanner Email Virus Scanner www.mailscanner.info From nick at nick.uklinux.net Sun Sep 21 19:13:38 2003 From: nick at nick.uklinux.net (Nick Roberts) Date: Sun Sep 21 19:19:52 2003 Subject: [Python-mode] Re: Enhancement to pdb in gud.el In-Reply-To: <1064172242.4618.7.camel@anthem> References: <16233.62352.331254.344092@nick.uklinux.net> <1064172242.4618.7.camel@anthem> Message-ID: <16238.12450.400388.359764@nick.uklinux.net> > Yes, but you might want to post to python-mode@python.org which is now a > full-fledged mailing list > and is where all > the python-moders tend to hang out. I was unaware of the python-mode mailing list, so I'll try this. I do notice, however, that python-dev has had about 300 posts this month whereas python-mode has had ...er, one, about ...er, a virus, so it does feel a bit like being re-directed to /dev/null. I used to think that python-mode.el was a mode for editing python code. Now see that it has something called pdbtrack which appears to act as a debugger when pdb.py is invoked from the shell buffer. Can you say why this is needed when both Emacs and XEmacs have their own pdb support? Nick From barry at python.org Sun Sep 21 20:15:36 2003 From: barry at python.org (Barry Warsaw) Date: Sun Sep 21 20:15:39 2003 Subject: [Python-mode] Re: Enhancement to pdb in gud.el In-Reply-To: <16238.12450.400388.359764@nick.uklinux.net> References: <16233.62352.331254.344092@nick.uklinux.net> <1064172242.4618.7.camel@anthem> <16238.12450.400388.359764@nick.uklinux.net> Message-ID: <1064189736.949.2.camel@anthem> On Sun, 2003-09-21 at 19:13, Nick Roberts wrote: > I was unaware of the python-mode mailing list, so I'll try this. I do notice, > however, that python-dev has had about 300 posts this month whereas > python-mode has had ...er, one, about ...er, a virus, so it does feel a bit > like being re-directed to /dev/null. Well, it's a fairly new list, and not very well advertised. > I used to think that python-mode.el was a mode for editing python code. Now > see that it has something called pdbtrack which appears to act as a debugger > when pdb.py is invoked from the shell buffer. Can you say why this is needed > when both Emacs and XEmacs have their own pdb support? Ken Manheimer wrote pdbtrack and it rocks. pdb is fine but it's not always appropriate to run the application under gud. I find it actually much more convenient to just run the program in a shell buffer, and get debug tracking when/if the trace code is hit. -Barry From 2tiapuzxx at msn.com Mon Sep 22 10:18:56 2003 From: 2tiapuzxx at msn.com (Phil Travis) Date: Mon Sep 22 00:17:46 2003 Subject: [Python-mode] Pheromone sex attractant f qnzncjejaj nji Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-mode/attachments/20030922/7c413099/attachment.html From nick at nick.uklinux.net Mon Sep 22 17:59:35 2003 From: nick at nick.uklinux.net (Nick Roberts) Date: Mon Sep 22 18:05:14 2003 Subject: [Python-mode] Re: [Python-Dev] Enhancement to pdb in gud.el In-Reply-To: <3F6C7B09.5060608@sabaydi.com> References: <3F6B11BA.6000008@sabaydi.com> <16235.18128.422738.929390@nick.uklinux.net> <3F6B533E.5000403@sabaydi.com> <16236.28754.105629.565153@nick.uklinux.net> <3F6C7B09.5060608@sabaydi.com> Message-ID: <16239.28871.85825.160489@nick.uklinux.net> Kevin J. Butler writes: > Nick Roberts wrote: > > I've just noticed that you can enable/disable breakpoints in python. In my > > mode for gdb, the breakpoints are greyed out when the breakpoints become > > disabled. I could do this for python too if these commands were changed to > > emit a message. > > Two additional lines will add that - see below. Below is the lisp file that incorporates these changes. Note for the mailing list: This file is for use with patch 809887. http://sourceforge.net/tracker/index.php?func=detail&aid=809887&group_id=5470&atid=305470 The user needs to know what the breakpoint number is. Does pdb have the gdb equivalent of 'info breakpoints`? Nick ----------------------------------------------------- (require 'gud) (defun gud-sentinel (proc msg) (cond ((null (buffer-name (process-buffer proc))) ;; buffer killed ;; Stop displaying an arrow in a source file. (setq overlay-arrow-position nil) (set-process-buffer proc nil) (if (memq gud-minor-mode-type '(gdba pdb)) (gdb-reset) (gud-reset))) ((memq (process-status proc) '(signal exit)) ;; Stop displaying an arrow in a source file. (setq overlay-arrow-position nil) (with-current-buffer gud-comint-buffer (if (memq gud-minor-mode '(gdba pdb)) (gdb-reset) (gud-reset))) (let* ((obuf (current-buffer))) ;; save-excursion isn't the right thing if ;; process-buffer is current-buffer (unwind-protect (progn ;; Write something in *compilation* and hack its mode line, (set-buffer (process-buffer proc)) ;; Fix the mode line. (setq mode-line-process (concat ":" (symbol-name (process-status proc)))) (force-mode-line-update) (if (eobp) (insert ?\n mode-name " " msg) (save-excursion (goto-char (point-max)) (insert ?\n mode-name " " msg))) ;; If buffer and mode line will show that the process ;; is dead, we can delete it now. Otherwise it ;; will stay around until M-x list-processes. (delete-process proc)) ;; Restore old buffer, but don't restore old point ;; if obuf is the gud buffer. (set-buffer obuf)))))) (defun gdb-reset () "Exit a debugging session cleanly by killing the gdb buffers and resetting the source buffers." (dolist (buffer (buffer-list)) (if (not (eq buffer gud-comint-buffer)) (with-current-buffer buffer (if (memq gud-minor-mode '(gdba pdb)) (if (string-match "^\*.+*$" (buffer-name)) (kill-buffer nil) (if (display-images-p) (remove-images (point-min) (point-max)) (gdb-remove-strings (point-min) (point-max))) (setq left-margin-width 0) (setq gud-minor-mode nil) (kill-local-variable 'tool-bar-map) (setq gud-running nil) (if (get-buffer-window (current-buffer)) (set-window-margins (get-buffer-window (current-buffer)) left-margin-width right-margin-width)))))))) (defun gdb-put-string (putstring pos) "Put string PUTSTRING in front of POS in the current buffer. PUTSTRING is displayed by putting an overlay into the current buffer with a `before-string' STRING that has a `display' property whose value is PUTSTRING." (let ((gdb-string "x") (buffer (current-buffer))) (let ((overlay (make-overlay pos pos buffer)) (prop (list (list 'margin 'left-margin) putstring))) (put-text-property 0 (length gdb-string) 'display prop gdb-string) (overlay-put overlay 'put-break t) (overlay-put overlay 'before-string gdb-string)))) (defun gdb-remove-strings (start end &optional buffer) "Remove strings between START and END in BUFFER. Remove only strings that were put in BUFFER with calls to `put-string'. BUFFER nil or omitted means use the current buffer." (unless buffer (setq buffer (current-buffer))) (let ((overlays (overlays-in start end))) (while overlays (let ((overlay (car overlays))) (when (overlay-get overlay 'put-break) (delete-overlay overlay))) (setq overlays (cdr overlays))))) (defconst breakpoint-xpm-data "/* XPM */ static char *magick[] = { /* columns rows colors chars-per-pixel */ \"12 12 2 1\", \" c red\", \"+ c None\", /* pixels */ \"++++++++++++\", \"+++ +++\", \"++ ++\", \"+ +\", \"+ +\", \"+ +\", \"+ +\", \"+ +\", \"+ +\", \"++ ++\", \"+++ +++\", \"++++++++++++\" };" "XPM data used for breakpoint icon.") (defconst breakpoint-enabled-pbm-data "P1 12 12\", 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" "PBM data used for enabled breakpoint icon.") (defconst breakpoint-disabled-pbm-data "P1 12 12\", 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" "PBM data used for disabled breakpoint icon.") (defvar breakpoint-enabled-icon (find-image `((:type xpm :data ,breakpoint-xpm-data) (:type pbm :data ,breakpoint-enabled-pbm-data))) "Icon for enabled breakpoint in display margin") (defvar breakpoint-disabled-icon (find-image `((:type xpm :data ,breakpoint-xpm-data :conversion disabled) (:type pbm :data ,breakpoint-disabled-pbm-data))) "Icon for disabled breakpoint in display margin") ;; ====================================================================== ;; pdb (Python debugger) functions ;; History of argument lists passed to pdb. (defvar gud-pdb-history nil) ;; Last group is for return value, e.g. "> test.py(2)foo()->None" ;; Either file or function name may be omitted: "> (0)?()" (defvar gud-pdb-marker-regexp "^> \\([-a-zA-Z0-9_/.:\\]*\\|\\)(\\([0-9]+\\))\\([a-zA-Z0-9_]*\\|\\?\\)()\\(->[^\n]*\\)?\n") (defvar gud-pdb-marker-regexp-file-group 1) (defvar gud-pdb-marker-regexp-line-group 2) (defvar gud-pdb-marker-regexp-fnname-group 3) (defvar gud-pdb-marker-regexp-start "^> ") (defvar gud-pdb-marker-regexp-breakpoint "reakpoint [0-9]+ at \\(\\([a-zA-Z]:\\)?[^:\n]*\\):\\([0-9]*\\)\n") ;; There's no guarantee that Emacs will hand the filter the entire ;; marker at once; it could be broken up across several strings. We ;; might even receive a big chunk with several markers in it. If we ;; receive a chunk of text which looks like it might contain the ;; beginning of a marker, we save it here between calls to the ;; filter. (defun gud-pdb-marker-filter (string) (setq gud-marker-acc (concat gud-marker-acc string)) (let ((output "")) ;; Process all the complete markers in this chunk. (while (string-match gud-pdb-marker-regexp gud-marker-acc) (setq ;; Extract the frame position from the marker. gud-last-frame (let ((file (match-string gud-pdb-marker-regexp-file-group gud-marker-acc)) (line (string-to-int (match-string gud-pdb-marker-regexp-line-group gud-marker-acc)))) (if (string-equal file "") gud-last-frame (cons file line))) ;; Output everything instead of the below output (concat output (substring gud-marker-acc 0 (match-end 0))) ;; ;; Append any text before the marker to the output we're going ;; ;; to return - we don't include the marker in this text. ;; output (concat output ;; (substring gud-marker-acc 0 (match-beginning 0))) ;; Set the accumulator to the remaining text. gud-marker-acc (substring gud-marker-acc (match-end 0)))) (if (string-match gud-pdb-marker-regexp-breakpoint gud-marker-acc) (let ((file (match-string 1 gud-marker-acc)) (line (match-string 3 gud-marker-acc)) case-fold-search) (cond ((or (string-match (concat "B" gud-pdb-marker-regexp-breakpoint) gud-marker-acc) (string-match (concat "Enabled b" gud-pdb-marker-regexp-breakpoint) gud-marker-acc)) (gud-pdb-toggle-breakpoint file line t)) ((string-match (concat "Deleted b" gud-pdb-marker-regexp-breakpoint) gud-marker-acc) (gud-pdb-remove-breakpoint file line)) ((string-match (concat "Disabled b" gud-pdb-marker-regexp-breakpoint) gud-marker-acc) (gud-pdb-toggle-breakpoint file line nil))))) ;; Does the remaining text look like it might end with the ;; beginning of another marker? If it does, then keep it in ;; gud-marker-acc until we receive the rest of it. Since we ;; know the full marker regexp above failed, it's pretty simple to ;; test for marker starts. (if (string-match gud-pdb-marker-regexp-start gud-marker-acc) (progn ;; Everything before the potential marker start can be output. (setq output (concat output (substring gud-marker-acc 0 (match-beginning 0)))) ;; Everything after, we save, to combine with later input. (setq gud-marker-acc (substring gud-marker-acc (match-beginning 0)))) (setq output (concat output gud-marker-acc) gud-marker-acc "")) output)) (defun gud-pdb-toggle-breakpoint (file line flag) (with-current-buffer (find-file-noselect file) (save-current-buffer (set (make-local-variable 'gud-minor-mode) 'pdb) (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) (setq left-margin-width 2) (if (get-buffer-window (current-buffer)) (set-window-margins (get-buffer-window (current-buffer)) left-margin-width right-margin-width))) (save-excursion (goto-line (string-to-number line)) (let ((start (progn (beginning-of-line) (- (point) 1))) (end (progn (end-of-line) (+ (point) 1)))) (if (display-images-p) (progn (remove-images start end) (if flag (put-image breakpoint-enabled-icon (+ start 1) "breakpoint icon enabled" 'left-margin) (put-image breakpoint-disabled-icon (+ start 1) "breakpoint icon disabled" 'left-margin))) (gdb-remove-strings start end) (if flag (gdb-put-string "B" (+ start 1)) (gdb-put-string "b" (+ start 1)))))))) (defun gud-pdb-remove-breakpoint (file line) (with-current-buffer (find-file-noselect file) (save-excursion (goto-line (string-to-number line)) (let ((start (progn (beginning-of-line) (- (point) 1))) (end (progn (end-of-line) (+ (point) 1)))) (if (display-images-p) (remove-images start end) (gdb-remove-strings start end)))))) (defcustom gud-pdb-command-name "pdb" "File name for executing the Python debugger. This should be an executable on your path, or an absolute file name." :type 'string :group 'gud) ;;;###autoload (defun pdb (command-line) "Run pdb on program FILE in buffer `*gud-FILE*'. The directory containing FILE becomes the initial working directory and source-file directory for your debugger." (interactive (list (gud-query-cmdline 'pdb))) (gud-common-init command-line nil 'gud-pdb-marker-filter) (set (make-local-variable 'gud-minor-mode) 'pdb) (gud-def gud-break "break %l" "\C-b" "Set breakpoint at current line.") (gud-def gud-remove "clear %f:%l" "\C-d" "Remove breakpoint at current line") (gud-def gud-step "step" "\C-s" "Step one source line with display.") (gud-def gud-next "next" "\C-n" "Step one line (skip functions).") (gud-def gud-cont "continue" "\C-r" "Continue with display.") (gud-def gud-finish "return" "\C-f" "Finish executing current function.") (gud-def gud-up "up" "<" "Up one stack frame.") (gud-def gud-down "down" ">" "Down one stack frame.") (gud-def gud-print "p %e" "\C-p" "Evaluate Python expression at point.") ;; Is this right? (gud-def gud-statement "! %e" "\C-e" "Execute Python statement at point.") ;; (setq comint-prompt-regexp "^(.*pdb[+]?) *") (setq comint-prompt-regexp "^(Pdb) *") (setq paragraph-start comint-prompt-regexp) (run-hooks 'pdb-mode-hook)) From noreply at sourceforge.net Fri Sep 26 16:37:46 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Sep 26 17:08:14 2003 Subject: [Python-mode] [ python-mode-Bugs-813266 ] better indentation for lambda bodies Message-ID: Bugs item #813266, was opened at 2003-09-26 20:37 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581349&aid=813266&group_id=86916 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Matthias Klose (doko) Assigned to: Nobody/Anonymous (nobody) Summary: better indentation for lambda bodies Initial Comment: [forwarded from http://bugs.debian.org/208303] Currently, if you place the body of a lambda on the next line (to curb rightward drift), the Emacs Python mode indents it like this: ... lambda x: body_of_lambda() ... In keeping with Lisp traditions, and to improve readability, I suggest a small amount of indentation for the lambda body, eg: lambda x: body_of_lambda() or lambda x: body_of_lambda() ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581349&aid=813266&group_id=86916 From noreply at sourceforge.net Fri Sep 26 17:16:42 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Sep 28 09:54:18 2003 Subject: [Python-mode] [ python-mode-Bugs-813296 ] py-pychecker-run uses xemacs function Message-ID: Bugs item #813296, was opened at 2003-09-26 21:16 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581349&aid=813296&group_id=86916 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Matthias Klose (doko) Assigned to: Nobody/Anonymous (nobody) Summary: py-pychecker-run uses xemacs function Initial Comment: [forwarded from http://bugs.debian.org/209723] py-pychecker-run does not work with emacs21 complaining: Symbol's function definition is void: read-shell-command This is discussed in the thread http://groups.google.com/groups?th=10014eaf8722c8cc in which Skip recommends replacing read-shell-command with read-string. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581349&aid=813296&group_id=86916 From froh at SuSE.de Tue Sep 30 12:11:22 2003 From: froh at SuSE.de (Susanne Oberhauser) Date: Tue Sep 30 12:12:17 2003 Subject: [Python-mode] python-mode $Revision: 4.6.18.2 $; overloading C-c C-h :(( Message-ID: Dear Barry, Python-mode is overloading C-h in the py-mode-map: (define-key py-mode-map "\C-c\C-hm" 'py-describe-mode) I consider this a bug, since usually C-h within _any_ key sequence will just show the key bindings starting with the key sequence so far. You may just try C-x C-h to get an example, or C-x r C-h. thus I think, the C-c ? is completely sufficient within python-mode to display the long documentation, and I ask you to just drop the above binding. Susanne Emacs : GNU Emacs 21.2.1 (i586-suse-linux, X toolkit, Xaw3d scroll bars) of 2003-06-25 on chip Package: python-mode $Revision: 4.6.18.2 $ current state: ============== (setq py-python-command "python" py-indent-offset 4 py-block-comment-prefix "##" py-temp-directory "/usr/tmp" py-beep-if-tab-change t ) -- Susanne Oberhauser simply SUSE LINUX AG +49-911-74053-574 change: Deutschherrnstr. 15-19 www.suse.de 90429 N?rnberg