branch: elpa/haskell-mode commit 2367f66681bb2e8aeea11ed53ac4ada909a380a1 Author: Steve Purcell <st...@sanityinc.com> Commit: GitHub <nore...@github.com>
Apply suggested improvement to tex indentation predicate See #1829. Thanks @smonnier! --- 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."