Skip to content

Commit

Permalink
Add an option to preserve delimiter whitespace.
Browse files Browse the repository at this point in the history
For a language, such as Haskell, whose comment syntax includes
significant trailing whitespace, offer a customization to /not/ trim
whitespace from the ends of `comment-start`.
  • Loading branch information
acowley committed Dec 16, 2014
1 parent 83a7170 commit ad07880
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions outshine.el
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,16 @@ section are given (with section title in submatch 1)."
:type '(alist :key-type string
:value-type alist))


(defcustom outshine-preserve-delimiter-whitespace nil
"Non-nil means that whitespace present at the start or end of
`comment-start' is preserved when matching headline syntax. By
default, such space is removed to support language modes which
erroneously include it in `comment-start', but for other
languages, such as Haskell, the trailing whitespace is
significant."
:group 'outshine
:type 'boolean)

;;; Defuns
;;;; Advices

Expand Down Expand Up @@ -1021,7 +1030,9 @@ recover it by stripping off \"-map\" from KEYMAP name."
"Chomp leading and trailing whitespace from outline regexps."
(and comment-start
(setq outshine-normalized-comment-start
(outshine-chomp comment-start)))
(if outshine-preserve-delimiter-whitespace
comment-start
(outshine-chomp comment-start))))
(and comment-end
(setq outshine-normalized-comment-end
(outshine-chomp comment-end)))
Expand Down

0 comments on commit ad07880

Please sign in to comment.