Skip to content

Commit ef3fe51

Browse files
authored
Merge pull request #1830 from purcell/patch-4
Apply suggested improvement to tex indentation predicate
2 parents d16c68c + 2367f66 commit ef3fe51

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

haskell-indentation.el

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,10 @@ negative ARG. Handles bird style literate Haskell too."
190190
(defun haskell-indentation-tex-outside-code-p ()
191191
"Non-NIL if we are in tex literate mode, but outside of code."
192192
(and (haskell-indentation-tex-p)
193-
(if (save-excursion
194-
(re-search-forward "\\(\\\\end\{code\}\\|\\\\begin\{code\}\\)" nil t))
195-
(cond ((equal "\\end{code}" (match-string-no-properties 0)) nil)
196-
((equal "\\begin{code}" (match-string-no-properties 0)) t))
197-
(save-excursion (re-search-backward "\\\\end\{code\}" nil t)))))
193+
(not (and (save-excursion
194+
(re-search-backward "\\\\end{code}\\|\\\\begin{code}\\(\\)"
195+
nil t))
196+
(match-end 1)))))
198197

199198
(defun haskell-indentation-literate-outside-code-p ()
200199
"Non-NIL if we are in literate mode, but outside of code."

0 commit comments

Comments
 (0)