--- python-mode-1.0.orig/python-mode.el +++ python-mode-1.0/python-mode.el @@ -2,14 +2,14 @@ ;; Copyright (C) 1992,1993,1994 Tim Peters -;; Author: 2003-2004 http://sf.net/projects/python-mode +;; Author: 2003-2006 http://sf.net/projects/python-mode ;; 1995-2002 Barry A. Warsaw ;; 1992-1994 Tim Peters ;; Maintainer: python-mode@python.org ;; Created: Feb 1992 ;; Keywords: python languages oop -(defconst py-version "$Revision: 4.75 $" +(defconst py-version "$Revision: 4.78 $" "`python-mode' version number.") ;; This software is provided as-is, without express or implied @@ -402,6 +402,11 @@ "Face for builtins like TypeError, object, open, and exec.") (make-face 'py-builtins-face) +;; XXX, TODO, and FIXME comments and such +(defvar py-XXX-tag-face 'py-XXX-tag-face + "Face for XXX, TODO, and FIXME tags") +(make-face 'py-XXX-tag-face) + (defun py-font-lock-mode-hook () (or (face-differs-from-default-p 'py-pseudo-keyword-face) (copy-face 'font-lock-keyword-face 'py-pseudo-keyword-face)) @@ -409,6 +414,8 @@ (copy-face 'font-lock-keyword-face 'py-builtins-face)) (or (face-differs-from-default-p 'py-decorators-face) (copy-face 'py-pseudo-keyword-face 'py-decorators-face)) + (or (face-differs-from-default-p 'py-XXX-tag-face) + (copy-face 'font-lock-comment-face 'py-XXX-tag-face)) ) (add-hook 'font-lock-mode-hook 'py-font-lock-mode-hook) @@ -490,6 +497,8 @@ ;; pseudo-keywords '("\\<\\(self\\|None\\|True\\|False\\|Ellipsis\\)\\>" 1 py-pseudo-keyword-face) + ;; XXX, TODO, and FIXME tags + '("XXX\\|TODO\\|FIXME" 0 py-XXX-tag-face t) )) "Additional expressions to highlight in Python mode.") (put 'python-mode 'font-lock-defaults '(python-font-lock-keywords)) @@ -3877,32 +3886,35 @@ If point is inside a string, narrow to that string and fill. " (interactive "P") - (let* ((bod (py-point 'bod)) - (pps (parse-partial-sexp bod (point)))) - (cond - ;; are we inside a comment or on a line with only whitespace before - ;; the comment start? - ((or (nth 4 pps) - (save-excursion (beginning-of-line) (looking-at "[ \t]*#"))) - (py-fill-comment justify)) - ;; are we inside a string? - ((nth 3 pps) - (py-fill-string (nth 8 pps))) - ;; are we at the opening quote of a string, or in the indentation? - ((save-excursion - (forward-word 1) - (eq (py-in-literal) 'string)) - (save-excursion - (py-fill-string (py-point 'boi)))) - ;; are we at or after the closing quote of a string? - ((save-excursion - (backward-word 1) - (eq (py-in-literal) 'string)) - (save-excursion - (py-fill-string (py-point 'boi)))) - ;; otherwise use the default - (t - (fill-paragraph justify))))) + ;; fill-paragraph will narrow incorrectly + (save-restriction + (widen) + (let* ((bod (py-point 'bod)) + (pps (parse-partial-sexp bod (point)))) + (cond + ;; are we inside a comment or on a line with only whitespace before + ;; the comment start? + ((or (nth 4 pps) + (save-excursion (beginning-of-line) (looking-at "[ \t]*#"))) + (py-fill-comment justify)) + ;; are we inside a string? + ((nth 3 pps) + (py-fill-string (nth 8 pps))) + ;; are we at the opening quote of a string, or in the indentation? + ((save-excursion + (forward-word 1) + (eq (py-in-literal) 'string)) + (save-excursion + (py-fill-string (py-point 'boi)))) + ;; are we at or after the closing quote of a string? + ((save-excursion + (backward-word 1) + (eq (py-in-literal) 'string)) + (save-excursion + (py-fill-string (py-point 'boi)))) + ;; otherwise use the default + (t + (fill-paragraph justify)))))) --- python-mode-1.0.orig/debian/compat +++ python-mode-1.0/debian/compat @@ -0,0 +1 @@ +4 --- python-mode-1.0.orig/debian/README.Debian +++ python-mode-1.0/debian/README.Debian @@ -0,0 +1,15 @@ +The Emacs python-mode for Debian GNU/Linux +------------------------------------------ + +Barry Warsaw's python-mode for Emacs is included in the upstream Python +distribution. In Debian, we provide this mode in this separate package, +taken from the sourceforge project at http://sf.net/projects/python-mode. + +More documentation can be found at http://www.python.org/emacs/python-mode/ + +python-mode automagically installs itself for use with all supported +flavors of emacs, according to the Debian emacsen policy. The installation +includes byte-compilation for the installed emacsen flavor and an +entry for auto-load, as suggested in python-mode.el + + -- Matthias Klose , Sun, 22 Feb 2004 09:17:29 +0100 --- python-mode-1.0.orig/debian/copyright +++ python-mode-1.0/debian/copyright @@ -0,0 +1,16 @@ +This package was debianized by Matthias Klose on +Sun, 22 Feb 2004 09:17:29 +0100. + +It was downloaded from http://sf.net/projects/python-mode + +;; Author: 2003-2004 http://sf.net/projects/python-mode +;; 1995-2002 Barry A. Warsaw +;; 1992-1994 Tim Peters + +;; Copyright (C) 1992,1993,1994 Tim Peters + +;; This software is provided as-is, without express or implied +;; warranty. Permission to use, copy, modify, distribute or sell this +;; software, without fee, for any purpose and by any individual or +;; organization, is hereby granted, provided that the above copyright +;; notice and this paragraph appear in all copies. --- python-mode-1.0.orig/debian/emacsen-remove +++ python-mode-1.0/debian/emacsen-remove @@ -0,0 +1,20 @@ +#!/bin/sh -e +# /usr/lib/emacsen-common/packages/remove/python-mode + +FLAVOR=$1 +PACKAGE=python-mode + +if [ ${FLAVOR} = emacs20 ]; then + exit 0 +fi + +if [ ${FLAVOR} != emacs ]; then + if test -x /usr/sbin/install-info-altdir; then + echo remove/${PACKAGE}: removing Info links for ${FLAVOR} + install-info-altdir --quiet --remove --dirname=${FLAVOR} \ + /usr/share/info/python-mode.info.gz + fi + + echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR} + rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE} +fi --- python-mode-1.0.orig/debian/rules +++ python-mode-1.0/debian/rules @@ -0,0 +1,64 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +clean: + dh_testdir + dh_testroot + dh_clean + +build: + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs \ + usr/share/emacs/site-lisp/python-mode \ + usr/lib/site-python + + cp -p *.el \ + debian/python-mode/usr/share/emacs/site-lisp/python-mode/ + cp -p pycomplete.py \ + debian/python-mode/usr/lib/site-python/ + +# dh_installdirs \ +# usr/lib/emacsen-common/packages/install \ +# usr/lib/emacsen-common/packages/remove \ +# usr/share/emacs/site-lisp/python-mode \ +# etc/emacs/site-start.d + +# install -m755 debian/$(p_elisp).install \ +# $(d_elisp)/usr/lib/emacsen-common/packages/install/$(p_elisp) +# install -m755 debian/$(p_elisp).remove \ +# $(d_elisp)/usr/lib/emacsen-common/packages/remove/$(p_elisp) +# install -m644 Misc/python-mode.el \ +# $(d_elisp)/usr/share/emacs/site-lisp/$(p_elisp)/ +# install -m644 debian/50python-mode.el $(d_elisp)/etc/emacs/site-start.d/ + + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installemacsen -v + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture-dependent files here. +binary-arch: build install +# We have nothing to do by default. + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- python-mode-1.0.orig/debian/control +++ python-mode-1.0/debian/control @@ -0,0 +1,17 @@ +Source: python-mode +Section: python +Priority: optional +Maintainer: Matthias Klose +Build-Depends-Indep: debhelper (>= 4.0.0) +Standards-Version: 3.6.2 + +Package: python-mode +Architecture: all +Depends: emacs21 | xemacs21-bin | emacs-snapshot, pymacs (>= 0.22-6) +Conflicts: python1.5-elisp, python2.1-elisp, python2.2-elisp, python-elisp +Replaces: python1.5-elisp, python2.1-elisp, python2.2-elisp, python-elisp +Provides: python-elisp +Description: Emacs-lisp python-mode and doctest-mode for the Python language + If you install this with XEmacs 21, it will replace the included + python-mode.el, which may or may not be a more recent version + (use "C-h v py-version" to compare). --- python-mode-1.0.orig/debian/emacsen-install +++ python-mode-1.0/debian/emacsen-install @@ -0,0 +1,53 @@ +#! /bin/sh -e +# /usr/lib/emacsen-common/packages/install/python-mode + +# Written by Jim Van Zandt , borrowing heavily +# from the install scripts for gettext by Santiago Vila +# and octave by Dirk Eddelbuettel . + +FLAVOR=$1 +PACKAGE=python-mode + +if [ ${FLAVOR} = emacs ]; then exit 0; fi + +if [ ${FLAVOR} = emacs20 ]; then + echo "$PACKAGE requires ansi-color, which is not available in emacs20" + exit 0 +fi + +echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} + +FLAVORTEST=`echo $FLAVOR | cut -c-6` +if [ ${FLAVORTEST} = xemacs ] ; then + SITEFLAG="-no-site-file" +else + SITEFLAG="--no-site-file" +fi +FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile" + +ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} +ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} + +# Install-info-altdir does not actually exist. +# Maybe somebody will write it. +if test -x /usr/sbin/install-info-altdir; then + echo install/${PACKAGE}: install Info links for ${FLAVOR} + install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} \ + /usr/share/info/${PACKAGE}.info.gz +fi + +install -m 755 -d ${ELCDIR} +cd ${ELDIR} +FILES=`echo *.el` +cp ${FILES} ${ELCDIR} +cd ${ELCDIR} + +cat << EOF > path.el +(setq load-path (cons "." load-path)) +(setq load-path (cons "/usr/share/emacs/site-lisp/pymacs" load-path)) +(setq byte-compile-warnings nil) +EOF +${FLAVOR} ${FLAGS} ${FILES} +rm -f *.el path.el + +exit 0 --- python-mode-1.0.orig/debian/emacsen-startup +++ python-mode-1.0/debian/emacsen-startup @@ -0,0 +1,38 @@ +;-*-emacs-lisp-*- + +(autoload 'python-mode "python-mode" "Python editing mode." t) +(autoload 'py-shell "python-mode" "Interactive Python interpreter." t) +(autoload 'doctest-mode "doctest-mode" "Python doctest editing mode." t) + +(setq load-path + (append + (list + (concat "/usr/share/" + (symbol-name debian-emacs-flavor) + "/site-lisp/python-mode") + (concat "/usr/share/" + (symbol-name debian-emacs-flavor) + "/site-lisp/pymacs") + ) + load-path)) + +(setq auto-mode-alist + (append + (list + '("\\.py$" . python-mode) + '("SConstruct$" . python-mode) + '("SConscript$" . python-mode) + ) + auto-mode-alist)) + +(setq interpreter-mode-alist + (append + (list + '("python" . python-mode) + '("python2.1" . python-mode) + '("python2.2" . python-mode) + '("python2.3" . python-mode) + '("python2.4" . python-mode) + '("python2.5" . python-mode) + ) + interpreter-mode-alist)) --- python-mode-1.0.orig/debian/changelog +++ python-mode-1.0/debian/changelog @@ -0,0 +1,64 @@ +python-mode (1:1.0-3.1) unstable; urgency=medium + + * Non-maintainer upload. + * Update pymacs path and dependency. Closes: #378699. + + -- Matej Vela Wed, 2 Aug 2006 09:55:09 +0200 + +python-mode (1:1.0-3) unstable; urgency=low + + * Autoload py-shell on startup (Lukasz Pankowski). Closes: #378441. + + -- Matthias Klose Sun, 16 Jul 2006 18:32:30 +0000 + +python-mode (1:1.0-2) unstable; urgency=low + + * Add versioned python executables to interpreter-mode-alist. + Closes: #356414. + + -- Matthias Klose Mon, 19 Mar 2006 01:43:55 +0100 + +python-mode (1:1.0-1) unstable; urgency=low + + * First release (from the python-mode project). + * Install pycomplete.el, depend on pymacs-elisp. + * Add emacs-snapshot as an alternative dependency (closes: #331285, #337859). + * Don't install for emacs20, ansi-color is missing (closes: #296104). + * Use python-mode for 'SConstruct' and 'SConscript' files (closes: #316622). + + -- Matthias Klose Sun, 5 Mar 2006 15:23:58 +0100 + +python-mode (4.70-1) unstable; urgency=low + + * New version from CVS. + * Add doctest-mode. + + -- Matthias Klose Tue, 1 Feb 2005 12:14:23 +0100 + +python-mode (4.62-1) unstable; urgency=low + + * New version from CVS supporting decorator syntax. + + -- Matthias Klose Thu, 23 Sep 2004 21:34:30 +0200 + +python-mode (4.51-2) unstable; urgency=high + + * Provide python-elisp (closes: #237326). + + -- Matthias Klose Thu, 11 Mar 2004 22:01:19 +0100 + +python-mode (4.51-1) unstable; urgency=low + + * Fix emacs21 compatibility. + + -- Matthias Klose Sat, 6 Mar 2004 08:18:16 +0100 + +python-mode (4.50-1) unstable; urgency=low + + * Initial Release. + * Built from the python-mode project (http://python-mode.sf.net/). + Replaces python-elisp. + * Removed dependency on emacs20 (addresses: #232785). + + -- Matthias Klose Sun, 22 Feb 2004 09:17:29 +0100 + --- python-mode-1.0.orig/debian/watch +++ python-mode-1.0/debian/watch @@ -0,0 +1,2 @@ +version=2 +http://prdownloads.sourceforge.net/python-mode/python-mode-([\d\.]*).tar.gz