unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34088: 26.1; OPascal mode some comment delimiters use the wrong face
@ 2019-01-15 20:03 Tom Ient
  2021-01-22 21:23 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Ient @ 2019-01-15 20:03 UTC (permalink / raw)
  To: 34088



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






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#34088: 26.1; OPascal mode some comment delimiters use the wrong face
  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
  2021-05-11 13:52   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-22 21:23 UTC (permalink / raw)
  To: Tom Ient; +Cc: 34088, Simon South

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#34088: 26.1; OPascal mode some comment delimiters use the wrong face
  2021-01-22 21:23 ` Lars Ingebrigtsen
@ 2021-05-11 13:52   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-05-11 13:52 UTC (permalink / raw)
  To: Tom Ient; +Cc: 34088, Simon South

Lars Ingebrigtsen <larsi@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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-11 13:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-05-11 13:52   ` Lars Ingebrigtsen

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