GNU bug report logs - #34088
26.1; OPascal mode some comment delimiters use the wrong face

Previous Next

Package: emacs;

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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34088 in the body.
You can then email your comments to 34088 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#34088; Package emacs. (Tue, 15 Jan 2019 20:59:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tom Ient <tom <at> ient.me>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 15 Jan 2019 20:59:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tom Ient <tom <at> ient.me>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1; OPascal mode some comment delimiters use the wrong face
Date: Tue, 15 Jan 2019 20:03:47 +0000

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'.


In GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
of 2018-07-05 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: Arch Linux

Recent messages:
Wrote /home/tom/.emacs.d/config.org
Mark set [2 times]
Indenting region...done
(No changes need to be saved)
Mark set
[2 times]
Mark set
next-line: End of buffer [2 times]
You can run the command ‘opascal-mode’ with M-x op-m RET
next-line: End of buffer [2 times]
Quit
Configured using:
'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
--localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-modules
'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong
-fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2
LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 MODULES THREADS LIBSYSTEMD LCMS2

Important settings:
value of $LANG: en_GB.UTF-8
locale-coding-system: utf-8-unix

Major mode: OPascal

Minor modes in effect:
display-line-numbers-mode: t
keyfreq-autosave-mode: t
keyfreq-mode: t
ido-everywhere: t
save-place-mode: t
rainbow-delimiters-mode: t
show-paren-mode: t
override-global-mode: t
diff-auto-refine-mode: t
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug descr-text cl-print debug misearch
multi-isearch pp em-unix em-term term disp-table ehelp em-script
em-prompt em-ls em-hist em-pred em-glob em-dirs em-cmpl em-basic
em-banner em-alias esh-var esh-io esh-cmd esh-opt esh-ext esh-proc
esh-arg esh-groups eshell esh-module esh-mode esh-util compile flyspell
ispell org-indent image-file eieio-opt help-fns radix-tree opascal
server display-line-numbers mu4e-alert pcase time ht dash s alert log4e
notifications dbus xml gntp mu4e desktop frameset mu4e-speedbar speedbar
sb-image ezimage dframe mu4e-main mu4e-view browse-url mu4e-headers
mu4e-compose mu4e-context mu4e-draft mu4e-actions rfc2368 smtpmail
sendmail mu4e-mark mu4e-message flow-fill html2text mu4e-proc mu4e-utils
mu4e-lists mu4e-vars hl-line mu4e-meta keyfreq ido saveplace js2-mode
etags xref project js sgml-mode dom json map thingatpt cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
imenu htmlize cl rainbow-delimiters paren base16-tomorrow-night-theme
base16-theme use-package use-package-ensure use-package-delight
use-package-diminish use-package-bind-key bind-key use-package-core
finder-inf tex-site edmacro kmacro rx info package url-handlers
url-parse auth-source eieio eieio-core cl-macs eieio-loaddefs url-vars
elec-pair cl-extra help-mode vc-git diff-mode org-rmail org-mhe org-irc
org-info org-gnus nnir gnus-sum gnus-group gnus-undo gnus-start
gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc nnoo
parse-time gnus-spec gnus-int gnus-range message rmc puny seq byte-opt
gv bytecomp byte-compile cconv rfc822 mml mml-sec password-cache epa
derived epg epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail
rmail-loaddefs rfc2047 rfc2045 ietf-drums mail-utils mm-util mail-prsvr
wid-edit org-docview doc-view jka-compr image-mode dired dired-loaddefs
org-bibtex bibtex org-bbdb org-w3m org-element cl-seq avl-tree generator
org advice org-macro org-footnote org-pcomplete pcomplete org-list
org-faces org-entities time-date noutline outline easy-mmode org-version
ob-emacs-lisp ob ob-ref ob-lob ob-table ob-exp org-loaddefs format-spec
find-func cal-menu easymenu calendar cal-loaddefs ob-tangle org-src
ob-comint comint ansi-color ring ob-keys ob-core ob-eval org-compat
org-macs cl-loaddefs cl-lib org-install mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 438919 78278)
(symbols 48 60541 1)
(miscs 40 266 1311)
(strings 32 190669 3763)
(string-bytes 1 5204901)
(vectors 16 54063)
(vector-slots 8 1217360 38106)
(floats 8 256 924)
(intervals 56 3685 325)
(buffers 992 30))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34088; Package emacs. (Fri, 22 Jan 2021 21:24:01 GMT) Full text and rfc822 format available.

Message #8 received at 34088 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Tom Ient <tom <at> ient.me>
Cc: 34088 <at> debbugs.gnu.org, Simon South <ssouth <at> member.fsf.org>
Subject: Re: bug#34088: 26.1; OPascal mode some comment delimiters use the
 wrong face
Date: Fri, 22 Jan 2021 22:23:02 +0100
[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

Added tag(s) patch. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 22 Jan 2021 21:24:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34088; Package emacs. (Tue, 11 May 2021 13:53:02 GMT) Full text and rfc822 format available.

Message #13 received at 34088 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Tom Ient <tom <at> ient.me>
Cc: 34088 <at> debbugs.gnu.org, Simon South <ssouth <at> member.fsf.org>
Subject: Re: bug#34088: 26.1; OPascal mode some comment delimiters use the
 wrong face
Date: Tue, 11 May 2021 15:52:19 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> 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.

There was no response within a few months, but the change seems to fix
the reported problem, so I've now pushed the change to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 11 May 2021 13:53:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 34088 <at> debbugs.gnu.org and Tom Ient <tom <at> ient.me> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 11 May 2021 13:53:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 09 Jun 2021 11:24:08 GMT) Full text and rfc822 format available.

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.