Subject: bug#11910: 24.1.50; Missing functions in new python.el

From: Ivan Andrus <[email-masked]>
Date: Wed, 11 Jul 2012 14:56:40 +0200

I'm trying to get sage-mode working with the new python.el [1].
However, the following functions are missing:

  python-beginning-of-statement
  python-beginning-of-block
  python-end-of-block
  python-open-block-statement-p
  python-comment-line-p
  python-beginning-of-string
  python-in-string/comment

There may be very good reasons why they are not included and that's
fine.  However, I would like to know which will be included or have
similar functions already.  Aliases with deprecation warnings would be
great.

I originally filed this bug on github [2] but have now closed that issue
with a note about this bug report.

FWIW, I took the code for these from the old python.el and made some
minor modifications for (temporary) inclusion in sage-mode.  I think
they are working, though I haven't tested extensively.

-Ivan

[1] https://bitbucket.org/gvol/sage-mode/issue/1/support-pythonel-by-fgallina
[2] https://github.com/fgallina/python.el/issues/89

In GNU Emacs 24.1.50.1 (i386-apple-darwin10.8.0, NS apple-appkit-1038.36)
of 2012-07-10 on oroszlan.local
Bzr revision: 108995 [email-masked]
Windowing system distributor `Apple', version 10.3.1038
Configured using:
`configure '--with-ns''

Important settings:
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: Python

Minor modes in effect:
  diff-auto-refine-mode: t
  TeX-PDF-mode: t
  highlight-symbol-mode: t
  hi-lock-mode: t
  which-function-mode: t
  show-paren-mode: t
  recentf-mode: t
  msb-mode: t
  minibuffer-depth-indicate-mode: t
  global-hl-line-mode: t
  delete-selection-mode: t
  auto-image-file-mode: t
  auto-insert-mode: t
  yas/global-mode: t
  yas/minor-mode: t
  shell-dirtrack-mode: t
  ido-everywhere: t
  global-visible-mark-mode: t
  visible-mark-mode: t
  gvol-mode: t
  desktop-save-mode: t
  drag-stuff-global-mode: t
  drag-stuff-mode: t
  command-frequency-autosave-mode: t
  command-frequency-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<tab> C-y <return> TAB C-M-SPC C-M-l C-M-l M-( C-/
C-x C-x M-e C-l C-l _ C-l C-t C-o C-o C-o C-o C-o C-M-j
C-M-k C-M-k C-o C-o C-o C-o C-e C-- C-1 M-e M-q C-x
C-s C-a C-M-k C-y TAB C-e C-j C-y SPC i n SPC t <C-backspace>
<C-backspace> C-SPC C-M-j e l e m e n t s SPC o f SPC
M-q C-c C-p C-p <tool-bar> <save-buffer> <tool-bar>
<latex> <tool-bar> <LaTeX-it> <down-mouse-1> <mouse-1>
q <ns-toggle-toolbar> <ns-toggle-toolbar> <help-echo>
M-W M-W M-w M-w M-w M-w <up> <up> <up> <tab> <down>
<down> <tab> <tab> C-x C-f l i b C-s <return> C-k M-e
M-e M-e M-e M-e M-e M-e M-e M-e M-e M-e M-e M-e M-e
M-e M-e M-e TAB C-e C-u C-u M-e M-e M-e TAB TAB M-e
M-a M-a M-a M-a M-a M-a M-a M-a M-a M-a M-a M-a M-a
M-a M-a M-a M-a M-a M-a M-a M-e M-e M-e M-e M-e M-e
M-e M-e M-e M-e M-e M-e M-e M-e M-e M-e M-e M-e M-e
M-e M-e M-e M-e M-a M-a M-a M-a M-a M-a M-a M-a M-a
M-a M-a M-a M-a M-a TAB M-a M-e M-e M-a M-a M-a M-a
M-a C-h k M-a C-e <return> M-a M-e M-e M-a M-a M-e
M-e M-a C-d M-e M-e M-a M-a M-a TAB TAB M-k M-k M-k
M-k C-y C-3 C-3 C-x b C-y M-a M-a M-a M-e M-a TAB M-a
M-e M-e M-a M-a TAB TAB M-k M-k M-k M-k C-y TAB TAB
TAB C-SPC M-a M-e M-e M-a M-a M-a M-e M-e M-a M-a M-a
M-a M-a TAB M-e M-e M-e M-a M-a C-h k M-a <C-tab> C-k
C-k C-k C-k C-k C-M-. C-M-k <C-tab> C-e <return> M-e
M-e M-a M-a M-e M-e M-a C-SPC M-a M-a M-e M-a M-a M-x
r e p o <return>

Recent messages:
Type C-x 1 to delete the help window.
Error during redisplay: (wrong-type-argument arrayp nil) [25 times]
/Users/gvol/.emacs-uptimes
Error during redisplay: (wrong-type-argument arrayp nil) [12 times]
Mark set
Error during redisplay: (wrong-type-argument arrayp nil) [7 times]
Can't guess python-indent-offset, using defaults: 4
Auto-saving...
Mark set [2 times]
Type C-x 1 to delete the help window.
byte-code: Buffer is read-only: #<buffer *Help*>

Load-path shadows:
/Users/gvol/.emacs.d/elpa/parenface-20091203/parenface hides ~/.emacs.d/local/parenface
/Users/gvol/.emacs.d/elpa/hl-sexp-1.0.0/hl-sexp hides ~/.emacs.d/local/hl-sexp
/Users/gvol/.emacs.d/elpa/python-mode-6.0.3/highlight-indentation hides ~/.emacs.d/local/highlight-indentation
/Users/gvol/.emacs.d/elpa/command-frequency-1.1/command-frequency hides ~/.emacs.d/local/command-frequency
/Users/gvol/vcs/sage-mode/emacs/.dir-locals hides /Users/gvol/vcs/emacs/local/nextstep/Emacs.app/Contents/Resources/lisp/gnus/.dir-locals
~/.emacs.d/local/lisp-mnt hides /Users/gvol/vcs/emacs/local/nextstep/Emacs.app/Contents/Resources/lisp/emacs-lisp/lisp-mnt

Features:
(latexenc texmathp calc-menu calc-ext calc calc-loaddefs calc-macs
shell-toggle two-column epa-file epa epg epg-config url-util
url-handlers vc-git vc-dir ewoc vcursor sage-compat mailalias mailclient
browse-url shadow sort mail-extr emacsbug message rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils esh-var esh-io
esh-cmd esh-ext esh-proc esh-arg esh-groups eshell esh-module esh-mode
esh-util hippie-exp lisp-mnt checkdoc elint debug pyrex multi-isearch
ffap url-parse url-vars dabbrev smerge-mode diff-mode sage-view
parse-time vc-cvs sgml-mode preview prv-emacs adaptive-wrap tex-fold
reftex-vcr reftex-dcr reftex-auc reftex reftex-vars tex-bar tex-buf
toolbar-x font-latex latex tex-style sage-auctex tex subword sage-mode
hideshow python org-colview vc-svn compile sh-script smie executable
tabify cal-iso org-mobile reveal org-habit org-wl org-w3m org-vm
org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html org-exp
ob-exp org-exp-blocks find-func org-agenda org-info org-gnus org-docview
org-bibtex bibtex org-bbdb org-archive org-id org-crypt ob-python org
ob-emacs-lisp ob-tangle ob-ref ob-lob ob-table org-footnote org-src
ob-comint ob-keys ob ob-eval org-pcomplete org-list org-faces org-compat
org-entities org-macs noutline outline gvol-light-theme elide-head
vc-bzr vc-hg eldoc highlight-parentheses greedy-delete highlight-symbol
hi-lock thingatpt time jka-compr saveplace uniquify which-func imenu
paren recentf tree-widget wid-edit msb mb-depth icomplete hl-line delsel
image-file cus-start cus-load diary-lib diary-loaddefs cal-menu calendar
cal-loaddefs warnings autoinsert yasnippet dropdown-list derived cl-macs
gv help-mode view tramp tramp-compat auth-source eieio byte-opt bytecomp
byte-compile cconv gnus-util mm-util mail-prsvr password-cache
tramp-loaddefs shell pcomplete comint ansi-color format-spec smex ido
visible-mark parenface fold cl cl-lib macroexp commit-patch-buffer
log-edit ring pcvs-util add-log vc ediff vc-dispatcher sage rx sage-load
xml desktop drag-stuff browse-kill-ring backtr command-frequency uptimes
pp server easy-mmode assoc dired+ edmacro kmacro dired-x ediff-merg
ediff-diff ediff-wind ediff-mult ediff-help ediff-init ediff-util
dired-aux dired windmove ac-slime-autoloads adaptive-wrap-autoloads
applescript-mode-autoloads auctex-autoloads tex-site info easymenu
browse-kill-ring-autoloads buffer-move-autoloads c-eldoc-autoloads
columnify-autoloads command-frequency-autoloads company-autoloads
drag-stuff-autoloads durendal-autoloads emstar-autoloads
feature-mode-autoloads goto-last-change-autoloads
graphviz-dot-mode-autoloads highlight-parentheses-autoloads
highlight-symbol-autoloads hl-sexp-autoloads keyfreq-autoloads
finder-inf markdown-mode+-autoloads markdown-mode-autoloads
paredit-autoloads parenface-autoloads python-mode-autoloads
redo+-autoloads rw-hunspell-autoloads scpaste-autoloads
htmlize-autoloads scss-mode-autoloads slime-clj-autoloads
slime-fuzzy-autoloads slime-ritz-autoloads smex-autoloads
speck-autoloads swank-clojure-autoloads advice help-fns advice-preload
clojure-mode-autoloads slime-repl-autoloads slime-autoloads
xml-rpc-autoloads package time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
make-network-process ns multi-tty emacs)