unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Tom Ient <tom@ient.me>
Cc: 34088@debbugs.gnu.org, Simon South <ssouth@member.fsf.org>
Subject: bug#34088: 26.1; OPascal mode some comment delimiters use the wrong face
Date: Fri, 22 Jan 2021 22:23:02 +0100	[thread overview]
Message-ID: <8735yswts9.fsf@gnus.org> (raw)
In-Reply-To: <3b488fc5-6ff1-8b6a-75ee-77803840c52c@fastmail.com> (Tom Ient's message of "Tue, 15 Jan 2019 20:03:47 +0000")

[-- Attachment #1: Type: text/plain, Size: 874 bytes --]

Tom Ient <tom@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;



[-- Attachment #2: Type: image/png, Size: 44530 bytes --]

[-- Attachment #3: Type: text/plain, Size: 994 bytes --]


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

  reply	other threads:[~2021-01-22 21:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15 20:03 bug#34088: 26.1; OPascal mode some comment delimiters use the wrong face Tom Ient
2021-01-22 21:23 ` Lars Ingebrigtsen [this message]
2021-05-11 13:52   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735yswts9.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=34088@debbugs.gnu.org \
    --cc=ssouth@member.fsf.org \
    --cc=tom@ient.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).