Skip to content

Commit

Permalink
Merge pull request #1830 from purcell/patch-4
Browse files Browse the repository at this point in the history
Apply suggested improvement to tex indentation predicate
  • Loading branch information
purcell committed Oct 26, 2023
2 parents d16c68c + 2367f66 commit ef3fe51
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions haskell-indentation.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit ef3fe51

Please sign in to comment.