fixed <tab> indenting and disabled dabbrev on comment lines, +C-j no adds comment-char if already inside comment

This commit is contained in:
Thomas von Dein
2017-06-24 12:24:23 +02:00
parent 7cab35c045
commit eb56eff162

View File

@@ -216,14 +216,20 @@ indent it and move (point) there."
"Add a new line below, indent it and move (point) there." "Add a new line below, indent it and move (point) there."
(interactive) (interactive)
(end-of-line) (end-of-line)
(newline-and-indent)) (if (eq (get-text-property (point) 'face) 'font-lock-comment-face)
(indent-new-comment-line)
(newline-and-indent)))
(defun config-general-tab-or-complete () (defun config-general-tab-or-complete ()
"Enter a <TAB> or do a dabbrev completion based on (point) position." "Enter a <TAB>, goto current indentation or do a dabbrev
completion based on (point) position."
(interactive) (interactive)
(if (looking-back "[-%$_a-zA-Z0-9]") (if (looking-back "[-%$_a-zA-Z0-9]")
(dabbrev-completion) (if (not (eq (get-text-property (point) 'face) 'font-lock-comment-face))
(indent-for-tab-command))) (dabbrev-completion))
(if (eq (point) (line-end-position))
(indent-for-tab-command)
(back-to-indentation))))
(defun config-general-toggle-flag () (defun config-general-toggle-flag ()
"Toggle a value of the list `config-general-toggle-values'." "Toggle a value of the list `config-general-toggle-values'."