Content-Length: 230026 | pFad | http://github.com/DogLooksGood/parinfer-mode/commit/33b2996ed8040dd77720f9a216b152db891cbb43

44 Print error message and line number when indent mode fails · DogLooksGood/parinfer-mode@33b2996 · GitHub
Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Commit

Permalink
Print error message and line number when indent mode fails
Browse files Browse the repository at this point in the history
Fixes #56.
  • Loading branch information
Robert Irelan committed Jul 11, 2018
1 parent 5bfc915 commit 33b2996
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions parinfer.el
Original file line number Diff line number Diff line change
@@ -858,11 +858,18 @@ If There's no change, switch to Indent Mode."
(text (buffer-substring-no-properties (point-min) (point-max)))
(result (parinferlib-indent-mode text opts))
(success (plist-get result :success))
(err (plist-get result :error))
(error-message (plist-get err :message))
(error-line-no (plist-get err :line-no))
(changed-lines (plist-get result :changed-lines)))
(if (not success)
(progn
(message (concat "Parinfer: Pairs unmatched, switch to Paren mode. "
"When pair fixed, You can switch to indent mode."))
(message (concat "Parinfer: Error%s: \"%s\" - switch to Paren mode. "
"When error fixed, you can switch to indent mode.")
(if (null error-line-no)
""
(format " on line %d" error-line-no))
error-message)
nil)
(if (and changed-lines
(not (string= text (plist-get result :text))))
@@ -886,11 +893,18 @@ If there's any change, display a confirm message in minibuffer."
(text (buffer-substring-no-properties (point-min) (point-max)))
(result (parinferlib-indent-mode text opts))
(success (plist-get result :success))
(err (plist-get result :error))
(error-message (plist-get err :message))
(error-line-no (plist-get err :line-no))
(changed-lines (plist-get result :changed-lines)))
(if (not success)
(progn
(message (concat "Pairs unmatched, switch to Paren mode. "
"When pair fixed, You can switch to indent mode."))
(message (concat "Parinfer: Error%s: \"%s\" - switch to Paren mode. "
"When error fixed, you can switch to indent mode.")
(if (null error-line-no)
""
(format " on line %d" error-line-no))
error-message)
nil)
(if (and changed-lines
(not (string= text (plist-get result :text))))

0 comments on commit 33b2996

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/DogLooksGood/parinfer-mode/commit/33b2996ed8040dd77720f9a216b152db891cbb43

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy