(defun my/substitute-line (arg)
"Kill the current line and leave point at correct indentation level. With ARG kill that many lines first."
- (interactive "*p")
+ (interactive "*P")
(beginning-of-line)
- (kill-line arg)
- (indent-for-tab-command))
+ (if (not (and (null arg) (equal (line-beginning-position) (line-end-position))))
+ (kill-line arg))
+ (if (not (string-equal major-mode "fundamental-mode"))
+ (indent-for-tab-command)))
(defun my/yank (arg)
"If the text to be yanked has a newline then move to beginning of line before yanking. Otherwise same as normal `yank'."