Skip to content

Commit

Permalink
py-shift-indent-left', py-shift-indent-right'
Browse files Browse the repository at this point in the history
new commands
  • Loading branch information
andreas-roehler committed Jan 4, 2016
1 parent e9a900b commit cbd4e75
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 78 deletions.
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -17,6 +17,8 @@ Edit-commands suffixed "-bol" dropped
- py-kill-indent
- py-mark-indent
- py-comment-indent
- py-shift-indent-left
- py-shift-indent-right

- Make $PYTHONPATH configurable from Emacs
Emacs doesn't read settings from .bashrc
Expand Down
31 changes: 27 additions & 4 deletions devel/python-components-create-menu.el
Expand Up @@ -33,6 +33,29 @@

;; Forms used building the menu

(setq py-menu-forms
(list
"block"
"block-or-clause"
"class"
"clause"
"comment"
"def"
"def-or-class"
"expression"
"except-block"
"if-block"
"indent"
"line"
"minor-block"
"partial-expression"
"paragraph"
"section"
"statement"
"top-level"
"try-block"
))

(setq py-menu-abbrev-form " :help \"see also `py-add-abbrev'\"
:filter (lambda (&rest junk)
(abbrev-table-menu python-mode-abbrev-table))")
Expand Down Expand Up @@ -1305,19 +1328,19 @@ Delete " (upcase ele) " at point, don't store in kill-ring. \"]
(insert (concat (make-string 12 ? )"))\n"))

(insert (concat (make-string 10 ? )"(\"Mark\""))
(py--create-menu-insert py-positions-forms "py-mark-")
(py--create-menu-insert py-menu-forms "py-mark-")
(insert (concat (make-string 11 ? )")\n"))

(insert (concat (make-string 10 ? )"(\"Copy\""))
(py--create-menu-insert py-positions-forms "py-copy-")
(py--create-menu-insert py-menu-forms "py-copy-")
(insert (concat (make-string 11 ? )")\n"))

(insert (concat (make-string 10 ? )"(\"Kill\""))
(py--create-menu-insert py-positions-forms "py-kill-")
(py--create-menu-insert py-menu-forms "py-kill-")
(insert (concat (make-string 11 ? )")\n"))

(insert (concat (make-string 10 ? )"(\"Delete\""))
(py--create-menu-insert py-positions-forms "py-delete-")
(py--create-menu-insert py-menu-forms "py-delete-")
(insert (concat (make-string 11 ? )")\n"))

(insert (concat (make-string 10 ? )"(\"Comment\""))
Expand Down
29 changes: 16 additions & 13 deletions devel/python-mode-utils.el
Expand Up @@ -316,6 +316,7 @@
"comment"
"def"
"def-or-class"
"indent"
"minor-block"
"paragraph"
"region"
Expand Down Expand Up @@ -1484,7 +1485,9 @@ Returns outmost indentation reached. \"
;;; python-components-shift-forms.el ends here\n ")

(emacs-lisp-mode)
(switch-to-buffer (current-buffer)))
(switch-to-buffer (current-buffer))
(write-file (concat py-install-directory "/python-components-shift-forms.el"))
)

(defun py-write-down-forms-bol ()
" "
Expand Down Expand Up @@ -2065,18 +2068,18 @@ Returns beginning and end positions of region, a cons. \"
(switch-to-buffer (current-buffer))
(emacs-lisp-mode))

(defun py-write-mark-bol-menu ()
(interactive)
(set-buffer (get-buffer-create "mark-bol-menu.el"))
(erase-buffer)
(dolist (ele py-navigate-forms)
(insert (concat "
[\"Mark " ele " bol\" py-mark-" ele "-bol
:help \"`py-mark-" ele "-bol'
Mark " ele " at point reaching beginning-of-line. \"]
")))
(switch-to-buffer (current-buffer))
(emacs-lisp-mode))
;; (defun py-write-mark-bol-menu ()
;; (interactive)
;; (set-buffer (get-buffer-create "mark-bol-menu.el"))
;; (erase-buffer)
;; (dolist (ele py-navigate-forms)
;; (insert (concat "
;; [\"Mark " ele " bol\" py-mark-" ele "-bol
;; :help \"`py-mark-" ele "-bol'
;; Mark " ele " at point reaching beginning-of-line. \"]
;; ")))
;; (switch-to-buffer (current-buffer))
;; (emacs-lisp-mode))

(defun py--insert-backward-forms ()
(dolist (ele py-backward-forms)
Expand Down

0 comments on commit cbd4e75

Please sign in to comment.