Skip to content

Commit

Permalink
use correct newline character in longlines-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
alexott committed Sep 29, 2011
1 parent f5fbc3f commit f0bdba2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lisp/muse-mode.el
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -360,6 +360,10 @@ the line if point is on a blank line."
(call-interactively cmd)) (call-interactively cmd))
(message "Not inserting anything")))) (message "Not inserting anything"))))


(defun muse-get-new-line-character ()
"Returns newline character that is needed, dependent on mode"
(if longlines-mode hard-newline "\n"))

;;;###autoload ;;;###autoload
(defun muse-insert-list-item () (defun muse-insert-list-item ()
"Insert a list item at the current point, taking into account "Insert a list item at the current point, taking into account
Expand Down Expand Up @@ -391,7 +395,7 @@ your current list type and indentation level."
(number-to-string itemno) (number-to-string itemno)
nil nil newitem)))))) nil nil newitem))))))
;; insert the new item ;; insert the new item
(insert (concat "\n" newitem)))) (insert (concat (muse-get-new-line-character) newitem))))


(defun muse-alter-list-item-indentation (operation) (defun muse-alter-list-item-indentation (operation)
"Alter the indentation of the current list item. "Alter the indentation of the current list item.
Expand Down Expand Up @@ -902,7 +906,8 @@ function, you might want to set this manually.")
;; Insert the tag, closing if necessary ;; Insert the tag, closing if necessary
(when tag (insert (concat "<" tag options ">"))) (when tag (insert (concat "<" tag options ">")))
(when (nth 1 tag-entry) (when (nth 1 tag-entry)
(insert (concat "\n\n</" tag ">\n")) (insert (concat (muse-get-new-line-character) (muse-get-new-line-character)
"</" tag ">" (muse-get-new-line-character)))
(forward-line -2)))) (forward-line -2))))


;;; Muse list edit minor mode ;;; Muse list edit minor mode
Expand Down

0 comments on commit f0bdba2

Please sign in to comment.