GNU bug report logs -
#34088
26.1; OPascal mode some comment delimiters use the wrong face
Previous Next
Reported by: Tom Ient <tom <at> ient.me>
Date: Tue, 15 Jan 2019 20:59:01 UTC
Severity: minor
Tags: fixed, patch
Found in version 26.1
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 34088 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Tom Ient <tom <at> ient.me> writes:
> When in OPascal mode, the left and right curly brackets (comment
> delimiters) use different faces: the left curly bracket uses the
> 'font-lock-comment-delimiter-face', while the right curly bracket uses
> the 'font-lock-comment-face'. Both curly brackets should use the
> 'font-lock-comment-delimiter-face'. For reference, Pascal mode
> highlights both curly brackets with the correct face,
> 'font-lock-comment-delimiter-face'.
(I'm going through old bug reports that unfortunately got no response at
the time.)
There was unfortunately no test case, but I took the first example of
Objective Pascal found on the internet and put into a buffer and
switched to opascal-mode:
Type
Average = Object
NumVal: Integer;
Values: Array [1..200] of Real;
Function Mean: Real; { calculates the average value of the array }
End;
[Message part 2 (image/png, inline)]
[Message part 3 (text/plain, inline)]
The two braces uses faces that look identical, but they are indeed
different faces. The following patch fixes the test case, but I don't
really know Objective Pascal at all. For reference, this is what
pascal.el says about comments:
(setq-local comment-start "{")
(setq-local comment-start-skip "(\\*+ *\\|{ *")
(setq-local comment-end "}")
I've added Simon the the CCs; perhaps he has some insight here.
diff --git a/lisp/progmodes/opascal.el b/lisp/progmodes/opascal.el
index 662d2b4b74..686e72ce6d 100644
--- a/lisp/progmodes/opascal.el
+++ b/lisp/progmodes/opascal.el
@@ -1766,6 +1766,7 @@ opascal-mode
(setq-local syntax-propertize-function opascal--syntax-propertize)
(setq-local comment-start "// ")
+ (setq-local comment-end "}")
(setq-local comment-start-skip "\\(?://\\|(\\*\\|{\\)[ \t]*")
(setq-local comment-end-skip "[ \t]*\\(?:\n\\|\\*)\\|}\\)"))
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 4 years and 93 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.