-
Notifications
You must be signed in to change notification settings - Fork 349
Bunch of minor updates to decl-scan module. #1456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
haskell-decl-scan.el
Outdated
(member char '(nil ?\t ?\n ?\ ))) | ||
(defun haskell-ds-whitespace-p () | ||
"Test if PT is at a whitespace character." | ||
(equal (string-to-syntax " ") (syntax-after (point)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You had nil
here before to handle eobp
. Is this needed or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to have eolp or'd to it.
;; is cursor at begging, inside, or end of comment | ||
(let ((fontfaces (get-text-property (or pt | ||
(point)) 'face))) | ||
(let ((fontfaces (get-text-property (point) 'face))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't add comment on a line that follows, so I'm putting it here: comments in haskell have structure and we use more faces than just font-lock-comment-face
: haskell-pragma-face
, haskell-liquid-haskell-annotation-face
, haskell-literate-comment-face
. Sometimes we also add (:weight bold)
and (:slant italic)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The weight and slant already work. I can add these other faces to the member test if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they have to be there. Otherwise declscan will not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the help.
(setq r nil)) | ||
(forward-char)) | ||
r)) | ||
"Test if all characters from `point' to `end-of-line' pass `haskell-ds-comment-p'." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is horrible. The way to find end of current comment is to use (parse-partial-sexp (point) (point-max) nil nil (syntax-ppss) 'syntax-table)
. Examples are in haskell-font-lock.el
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only usage of this function is to go back to the end of a definition. That requires going through all lines that are composed only of white space and comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use (parse-partial-sexp (point) (point-max) nil nil (syntax-ppss) 'syntax-table)
for this purpose.
Do you want me to merge as is and fix the functionality later? Or fix the functionality in place while we are at it? |
I'll fix it tonight. |
It was never used with the optional custom point, so just removed it. There was also a bug where the custom point wasn't even being used, that this fixed.
4109255
to
8103e59
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment
This new github review workflow is confusing. Anyway, since we are chanigng decl-scan we should make it better in those two places I mentioned. |
The most confusing for me is Comment option of review. I supposed that it should simply add comment to review, but instead it submits review as simple comments :D |
I'm going to close this pull, fix it up and reopen it. Thanks for the suggestions @gracjan |
You can reopen and force-push new set of commits. Github is pretty good at sorting out what has happened. |
That's the plan. |
No description provided.