;; string delimiters. Fixme: Is there a better way?
;; First avoid a sequence preceded by an odd number of backslashes.
(syntax-propertize-rules
- (;; (rx (not (any ?\\))
- ;; ?\\ (* (and ?\\ ?\\))
- ;; (group (syntax string-quote))
- ;; (backref 1)
- ;; (group (backref 1)))
- ;; ¡Backrefs don't work in syntax-propertize-rules!
- "[^\\]\\\\\\(\\\\\\\\\\)*\\(?:''\\('\\)\\|\"\"\\(?2:\"\\)\\)"
- (2 "\"")) ; dummy
- (;; (rx (optional (group (any "uUrR"))) ; prefix gets syntax property
- ;; (optional (any "rR")) ; possible second prefix
- ;; (group (syntax string-quote)) ; maybe gets property
- ;; (backref 2) ; per first quote
- ;; (group (backref 2))) ; maybe gets property
- ;; ¡Backrefs don't work in syntax-propertize-rules!
- "\\([RUru]\\)?[Rr]?\\(?:\\('\\)'\\('\\)\\|\\(?2:\"\\)\"\\(?3:\"\\)\\)"
+ (;; ¡Backrefs don't work in syntax-propertize-rules!
+ (concat "\\(?:\\([RUru]\\)[Rr]?\\|^\\|[^\\]\\(?:\\\\.\\)*\\)" ;Prefix.
+ "\\(?:\\('\\)'\\('\\)\\|\\(?2:\"\\)\"\\(?3:\"\\)\\)")
(3 (ignore (python-quote-syntax))))
;; This doesn't really help.
;;((rx (and ?\\ (group ?\n))) (1 " "))
(with-current-buffer
(let* ((cmdlist
(append (python-args-to-list cmd)
+ ;; It's easy for the user to cause the process to be
+ ;; started without realizing it (e.g. to perform
+ ;; completion); for this reason loading files from the
+ ;; current directory is a security risk. See
+ ;; http://article.gmane.org/gmane.emacs.devel/103569
'("-i" "-c" "import sys; sys.path.remove('')")))
(path (getenv "PYTHONPATH"))
(process-environment ; to import emacs.py
overlay-arrow-string "=>"
python-pdbtrack-is-tracking-p t)
(set-marker overlay-arrow-position
- (save-excursion (beginning-of-line) (point))
+ (line-beginning-position)
(current-buffer)))
(setq overlay-arrow-position nil
python-pdbtrack-is-tracking-p nil)))
process is started. If you use this, you will probably want to ensure
that the current arguments are retained (they will be included in the
prompt). This argument is ignored when this function is called
-programmatically, or when running in Emacs 19.34 or older.
+programmatically.
Note: You can toggle between using the CPython interpreter and the
JPython interpreter by hitting \\[python-toggle-shells]. This toggles
(provide 'python)
(provide 'python-21)
-;; arch-tag: 6fce1d99-a704-4de9-ba19-c6e4912b0554
;;; python.el ends here