branch: elpa/haskell-mode commit ef3fe51f7c207db3c55b9a3a720b3af665d2e606 Merge: d16c68ccdf 2367f66681 Author: Steve Purcell <st...@sanityinc.com> Commit: GitHub <nore...@github.com>
Merge pull request #1830 from purcell/patch-4 Apply suggested improvement to tex indentation predicate --- haskell-indentation.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/haskell-indentation.el b/haskell-indentation.el index dccedaa20a..4c2525121c 100644 --- a/haskell-indentation.el +++ b/haskell-indentation.el @@ -190,11 +190,10 @@ negative ARG. Handles bird style literate Haskell too." (defun haskell-indentation-tex-outside-code-p () "Non-NIL if we are in tex literate mode, but outside of code." (and (haskell-indentation-tex-p) - (if (save-excursion - (re-search-forward "\\(\\\\end\{code\}\\|\\\\begin\{code\}\\)" nil t)) - (cond ((equal "\\end{code}" (match-string-no-properties 0)) nil) - ((equal "\\begin{code}" (match-string-no-properties 0)) t)) - (save-excursion (re-search-backward "\\\\end\{code\}" nil t))))) + (not (and (save-excursion + (re-search-backward "\\\\end{code}\\|\\\\begin{code}\\(\\)" + nil t)) + (match-end 1))))) (defun haskell-indentation-literate-outside-code-p () "Non-NIL if we are in literate mode, but outside of code."