* bug#11910: 24.1.50; Missing functions in new python.el
@ 2012-07-11 12:56 Ivan Andrus
2012-07-17 20:38 ` Fabián Ezequiel Gallina
0 siblings, 1 reply; 3+ messages in thread
From: Ivan Andrus @ 2012-07-11 12:56 UTC (permalink / raw)
To: 11910
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 rgm@gnu.org-20120710101729-d50lf86lytae0ts2
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)
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#11910: 24.1.50; Missing functions in new python.el
2012-07-11 12:56 bug#11910: 24.1.50; Missing functions in new python.el Ivan Andrus
@ 2012-07-17 20:38 ` Fabián Ezequiel Gallina
2012-07-17 21:35 ` Stefan Monnier
0 siblings, 1 reply; 3+ messages in thread
From: Fabián Ezequiel Gallina @ 2012-07-17 20:38 UTC (permalink / raw)
To: 11910
Here are some replacements you can use with current trunk:
* python-beginning-of-statement: python-nav-beginning-of-statement
* python-end-of-statement: python-nav-end-of-statement
* python-beginning-of-block: python-beginning-of-block
* python-end-of-block: python-nav-end-of-block
* python-comment-line-p: python-info-current-line-comment-p
In revno 109130 I included this two:
* python-open-block-statement-p: python-info-beginning-of-block-statement-p
* python-in-string/comment: python-info-ppss-comment-or-string-p
For python-beginning-of-string I don't feel it is necessary some replacement, you can achieve it with something like this:
(let ((string-starting-pos (python-info-ppss-context 'string)))
(and string-starting-pos
(goto-char string-starting-pos)))
Or a reduced version:
(goto-char (or (python-info-ppss-context 'string) (point)))
Regards,
Fabián.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#11910: 24.1.50; Missing functions in new python.el
2012-07-17 20:38 ` Fabián Ezequiel Gallina
@ 2012-07-17 21:35 ` Stefan Monnier
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2012-07-17 21:35 UTC (permalink / raw)
To: Fabián Ezequiel Gallina; +Cc: 11910
> (let ((string-starting-pos (python-info-ppss-context 'string)))
> (and string-starting-pos
> (goto-char string-starting-pos)))
Aka
(let ((ppss (syntax-ppss)))
(if (nth 3 ppss) (goto-char (nth 8 ppss))))
which should work for most major modes.
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-07-17 21:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-11 12:56 bug#11910: 24.1.50; Missing functions in new python.el Ivan Andrus
2012-07-17 20:38 ` Fabián Ezequiel Gallina
2012-07-17 21:35 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.