Merge pull request #5 from lvh/packaging

More packaging
This commit is contained in:
Glyph 2015-05-14 14:27:42 -07:00
commit 48c419e052

View file

@ -1,4 +1,4 @@
;;; python-docstring-mode.el --- Smart Python docstring formatting
;;; python-docstring.el --- Smart Python docstring formatting
;; Copyright (c) 2014-2015 The Authors
;;
@ -73,7 +73,7 @@
string-start string-end
(format
"python %s --offset %s --indent %s --width %s"
python-docstring-script
(shell-quote-argument python-docstring-script)
orig-offset
indent-count
fill-column
@ -90,22 +90,22 @@
(if fill-it-anyway
(call-interactively 'fill-paragraph))))
(defvar docstring-field-with-arg-re
(defvar python-docstring-field-with-arg-re
"^\\s-*[@:]\\(param\\|parameter\\|arg\\|argument\\|type\\|keyword\\|kwarg\\|kwparam\\|raise\\|raises\\|except\\|exception\\|ivar\\|ivariable\\|cvar\\|cvariable\\|var\\|variable\\|type\\|group\\|todo\\|newfield\\)\\s-+\\([a-zA-Z_][a-zA-Z0-9_. ]*?\\):")
(defvar docstring-field-no-arg-re
(defvar python-docstring-field-no-arg-re
"^\\s-*[@:]\\(raise\\|raises\\|return\\|returns\\|rtype\\|returntype\\|type\\|sort\\|see\\|seealso\\|note\\|attention\\|bug\\|warning\\|warn\\|version\\|todo\\|deprecated\\|since\\|status\\|change\\|changed\\|permission\\|requires\\|require\\|requirement\\|precondition\\|precond\\|postcondition\\|postcod\\|invariant\\|author\\|organization\\|org\\|copyright\\|(c)\\|license\\|contact\\|summary\\|params\\|param\\):")
(defvar docstring-epytext-markup-link "[UL]{\\([^}]*?\\)\\(<.*?>\\|\\)?}")
(defvar docstring-epytext-markup-style-code "C{\\(.*?\\)}")
(defvar docstring-epytext-markup-style-italic "I{\\(.*?\\)}")
(defvar docstring-epytext-markup-style-bold "B{\\(.*?\\)}")
(defvar python-docstring-epytext-markup-link "[UL]{\\([^}]*?\\)\\(<.*?>\\|\\)?}")
(defvar python-docstring-epytext-markup-style-code "C{\\(.*?\\)}")
(defvar python-docstring-epytext-markup-style-italic "I{\\(.*?\\)}")
(defvar python-docstring-epytext-markup-style-bold "B{\\(.*?\\)}")
;; hack for sphinx
(defvar docstring-sphinx-markup-link "\\(:[^:]+?:\\)\\(`.+?`\\)")
(defvar docstring-sphinx-markup-code "``\\(.+?\\)``")
(defvar python-docstring-sphinx-markup-link "\\(:[^:]+?:\\)\\(`.+?`\\)")
(defvar python-docstring-sphinx-markup-code "``\\(.+?\\)``")
(defvar docstring-keywords
(defvar python-docstring-keywords
`((,docstring-field-with-arg-re 1 font-lock-type-face t)
(,docstring-field-with-arg-re 2 font-lock-function-name-face t)
(,docstring-field-no-arg-re 1 font-lock-type-face t)
@ -151,8 +151,8 @@ Null prefix argument turns off the mode."
`(([(meta q)] . python-docstring-fill))
;; &rest BODY
(if python-docstring-mode
(font-lock-add-keywords nil docstring-keywords)
(font-lock-remove-keywords nil docstring-keywords)))
(font-lock-add-keywords nil python-docstring-keywords)
(font-lock-remove-keywords nil python-docstring-keywords)))
(defun python-docstring-install ()
"Add python-docstring-mode as a hook to python.mode."