GNU bug report logs - #40814
26.3; show-paren-mode hightlights parentheses at eol

Previous Next

Package: emacs;

Reported by: Abdo Haji-Ali <abdo.haji.ali <at> gmail.com>

Date: Fri, 24 Apr 2020 10:18:01 UTC

Severity: normal

Tags: notabug

Found in version 26.3

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 40814 in the body.
You can then email your comments to 40814 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#40814; Package emacs. (Fri, 24 Apr 2020 10:18:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Abdo Haji-Ali <abdo.haji.ali <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 24 Apr 2020 10:18:01 GMT) Full text and rfc822 format available.

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

From: Abdo Haji-Ali <abdo.haji.ali <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; show-paren-mode hightlights parentheses at eol
Date: Fri, 24 Apr 2020 11:16:52 +0100
In the following text:

```
   Some text (other text)
```

If `show-paren-mode` is on, `show-paren-when-point-in-periphery` is true and the point is anywhere before 'S', the parenthesis at the *end* of the line is highlighted. Is this intentional?

If not, the offending line seems to be paren.el:162 here

```
158:     ;; Point is in the whitespace before the code.
159:    ((and show-paren-when-point-in-periphery
160:	   (<= (point) ind-pos))
161:      (or (show-paren--categorize-paren ind-pos)
162:	      (show-paren--categorize-paren (1- eol-pos))))
```

For some reason if the point "is in the whitespace before the code" the parenthesis in `(1- eol-pos)` is categorized.



---------------------------------------------------------------------------
In GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2019-09-16 built on lcy01-amd64-030
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description:	Ubuntu 18.04.4 LTS

Configured using:
 'configure --build=x86_64-linux-gnu --prefix=/usr
 '--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
 '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var
 --disable-silent-rules '--libdir=${prefix}/lib/x86_64-linux-gnu'
 '--libexecdir=${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode
 --disable-dependency-tracking --prefix=/usr --sharedstatedir=/var/lib
 --program-suffix=26 --with-modules --with-file-notification=inotify
 --with-mailutils --with-x=yes --with-x-toolkit=gtk3 --with-xwidgets
 --with-lcms2 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs26-TP6iDo/emacs26-26.3~1.git96dd019=.
 -fstack-protector-strong -Wformat -Werror=format-security -no-pie'
 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'
 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -no-pie''

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

Important settings:
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8

Major mode: Elisp

Minor modes in effect:
  TeX-PDF-mode: t
  TeX-source-correlate-mode: t
  diff-hl-margin-mode: t
  eros-mode: t
  highlight-quoted-mode: t
  rainbow-delimiters-mode: t
  highlight-numbers-mode: t
  git-gutter-mode: t
  show-paren-mode: t
  save-place-mode: t
  global-so-long-mode: t
  ws-butler-global-mode: t
  ws-butler-mode: t
  flycheck-popup-tip-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  recentf-mode: t
  gcmh-mode: t
  which-key-mode: t
  better-jumper-mode: t
  better-jumper-local-mode: t
  company-prescient-mode: t
  prescient-persist-mode: t
  global-company-mode: t
  company-mode: t
  volatile-highlights-mode: t
  winner-mode: t
  savehist-mode: t
  solaire-global-mode: t
  solaire-mode: t
  display-time-mode: t
  doom-modeline-mode: t
  flyspell-mode: t
  vi-tilde-fringe-mode: t
  goto-address-prog-mode: t
  hl-line-mode: t
  display-line-numbers-mode: t
  yas-minor-mode: t
  org-clock-today-mode: t
  org-super-agenda-mode: t
  hl-todo-mode: t
  global-magit-file-mode: t
  magit-file-mode: t
  diff-auto-refine-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  outline-minor-mode: t
  whitespace-mode: t
  smartparens-global-mode: t
  smartparens-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  shell-dirtrack-mode: t
  ivy-rich-mode: t
  ivy-mode: t
  global-hungry-delete-mode: t
  hungry-delete-mode: t
  persp-mode: t
  delete-selection-mode: t
  projectile-mode: t
  general-override-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  window-divider-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-save-visited-mode: t

Load-path shadows:
/home/abdo/Work/Apps/doom-emacs/.local/straight/build/cmake-mode/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode
/usr/share/emacs/site-lisp/rst hides /usr/share/emacs/26.3/lisp/textmodes/rst
/usr/share/emacs/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/26.3/lisp/textmodes/flyspell
/usr/share/emacs/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/26.3/lisp/textmodes/ispell
/home/abdo/Work/Apps/doom-emacs/.local/straight/build/let-alist/let-alist hides /usr/share/emacs/26.3/lisp/emacs-lisp/let-alist

Features:
(shadow emacsbug format-all language-id autoload finder-inf try
cus-start cus-load reftex-parse mparen company-auctex company-math
math-symbol-lists company-reftex reftex-cite texmathp
multiple-cursors-core rect eieio-opt speedbar sb-image ezimage dframe
multi-paren two-column amx misearch multi-isearch anzu preview prv-emacs
adaptive-wrap hideshow tex-fold reftex-dcr reftex-auc reftex
reftex-loaddefs reftex-vars tex-bar toolbar-x font-latex auctex-latexmk
tex-buf latex latex-flymake flymake-proc flymake warnings tex-ispell
tex-style tex smartparens-latex tex-mode latexenc lisp-mnt
irony-cdb-libclang irony-cdb-json irony-cdb-clang-complete irony-cdb
irony-eldoc company-irony-c-headers company-irony company-template
irony-completion irony-snippet flycheck-irony irony-diagnostics irony
irony-iotask rtags repeat asm-mode modern-cpp-font-lock company-anaconda
url-cache anaconda-mode pythonic pipenv smartparens-python pyvenv python
tabify elisp-demos helpful trace edebug info-look info dash-functional
help-fns radix-tree elisp-refs loop cl-print debug mhtml-mode css-mode
smie smartparens-javascript js cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs smartparens-html
sgml-mode view hide-mode-line xterm-color em-term term ehelp em-script
em-prompt em-ls em-hist em-pred em-glob em-cmpl em-basic em-banner
em-alias diff-hl-margin diff-hl-dired diff-hl vc-dir ewoc vc
vc-dispatcher magit-extras magit-gitflow forge-list forge-commands
forge-semi forge-bitbucket buck forge-gogs gogs forge-gitea gtea
forge-gitlab glab forge-github forge-notify forge-revnote forge-pullreq
forge-issue forge-topic bug-reference forge-post smartparens-markdown
markdown-mode edit-indirect forge-repo forge forge-core forge-db closql
emacsql-sqlite emacsql emacsql-compiler diary-lib diary-loaddefs cal-iso
origami origami-parsers flycheck-cask ffap array ace-window avy
company-ispell company-yasnippet epa-file network-stream starttls
mailalias company-dabbrev dtrt-indent timezone shr-color shr svg dom
sort smiley gnus-cite mm-archive mail-extr qp gnus-art mm-uu mml2015
mm-view mml-smime smime dig gnus-sum gnus-group gnus-undo gnus-start
gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int
gnus-range gnus-win gnus nnheader mu4e-alert alert log4e notifications
dbus xml gntp org-mu4e mu4e desktop frameset mu4e-org mu4e-main
mu4e-view browse-url mu4e-headers mu4e-compose mu4e-context mu4e-draft
mu4e-actions ido rfc2368 smtpmail sendmail mu4e-mark mu4e-message
flow-fill mu4e-proc mu4e-utils doc-view jka-compr image-mode mu4e-lists
mu4e-vars mu4e-meta eros highlight-quoted rainbow-delimiters
highlight-numbers parent-mode elisp-mode git-gutter-fringe fringe-helper
git-gutter disp-table cursor-sensor tramp-sh vc-git auto-minor-mode
paren saveplace so-long ws-butler flycheck-popup-tip popup flycheck
magit-bookmark bookmark org-capture lv recentf tree-widget wid-edit gcmh
which-key better-jumper company-prescient prescient company-capf company
etags volatile-highlights face-remap winner nav-flash pulse savehist
solaire-mode doom-themes-ext-org doom-one-theme doom-themes
doom-themes-base time doom-modeline doom-modeline-segments
doom-modeline-env doom-modeline-core shrink-path rotate smartrep
iso-transl org-eldoc flyspell-lazy flyspell ispell toc-org org-bullets
vi-tilde-fringe goto-addr hl-line display-line-numbers doom-snippets
doom-snippets-lib yasnippet-snippets yasnippet elec-pair org-indent
ol-bibtex bibtex smartparens-org org-checklist org-clock-today org-clock
org-super-agenda ts ht org-habit org-agenda org-refile org-tempo tempo
orgit magit-todos pcre2el rxt re-builder hl-todo f github-review s
ghub-graphql treepy gsexp ghub url-http tls url-gw nsm url-auth url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap let-alist json map gnutls magit-autoloads
magit-submodule magit-obsolete magit-popup magit-blame magit-stash
magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone
magit-remote magit-commit magit-sequence magit-notes magit-worktree
magit-tag magit-merge magit-branch magit-reset magit-files magit-refs
magit-status magit core-packages package url-handlers url-parse url-vars
magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff
smerge-mode diff-mode magit-core magit-autorevert autorevert filenotify
magit-margin magit-transient magit-process magit-mode git-commit
transient magit-git magit-section magit-utils crm log-edit message rmc
puny rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader pcvs-util
add-log with-editor async-bytecomp async server org-yt org-element
avl-tree generator org ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-macro org-footnote org-src ob-comint org-pcomplete org-list
org-faces org-entities noutline outline org-version ob-emacs-lisp
ob-core ob-eval org-table ol org-keys org-compat org-macs org-loaddefs
find-func cal-menu calendar cal-loaddefs whitespace smartparens-config
smartparens-text smartparens goto-chg undo-tree diff better-eshell
esh-var esh-io esh-groups esh-help man em-unix eshell-z em-dirs esh-cmd
esh-proc esh-arg esh-ext esh-opt eshell esh-module esh-mode esh-util
tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
parse-time format-spec auth-source password-cache perspex
all-the-icons-ivy all-the-icons all-the-icons-faces data-material
data-weathericons data-octicons data-fileicons data-faicons
data-alltheicons memoize ivy-rich counsel xdg ivy-xref xref project
eieio eieio-core eieio-loaddefs swiper ivy colir color ivy-overlay
mm-util mail-prsvr openwith dired-subtree dired-hacks-utils dash
dired-single dired dired-loaddefs advice hungry-delete persp-mode delsel
projectile grep compile comint ansi-color ring ibuffer-vc ibuf-ext
ibuffer ibuffer-loaddefs seq byte-opt thingatpt html2text easy-mmode
ibuf-macs core-editor core-projects core-ui edmacro kmacro core-keybinds
pp general cl-extra help-mode easymenu cl-seq use-package-core bytecomp
byte-compile cconv cl tex-site rx core-modules core core-lib pcase
cl-macs gv subr-x cl-loaddefs cl-lib time-date 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 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 threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
xwidget-internal move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 1978238 359320)
 (symbols 48 119048 194)
 (miscs 40 5299 4416)
 (strings 32 368931 38626)
 (string-bytes 1 10050756)
 (vectors 16 151320)
 (vector-slots 8 3170627 262476)
 (floats 8 2197 1366)
 (intervals 56 39103 8274)
 (buffers 992 438))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40814; Package emacs. (Fri, 24 Apr 2020 10:38:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Abdo Haji-Ali <abdo.haji.ali <at> gmail.com>
Cc: 40814 <at> debbugs.gnu.org
Subject: Re: bug#40814: 26.3; show-paren-mode hightlights parentheses at eol
Date: Fri, 24 Apr 2020 13:37:06 +0300
> From: Abdo Haji-Ali <abdo.haji.ali <at> gmail.com>
> Date: Fri, 24 Apr 2020 11:16:52 +0100
> 
> In the following text:
> 
> ```
>    Some text (other text)
> ```
> 
> If `show-paren-mode` is on, `show-paren-when-point-in-periphery` is true and the point is anywhere before 'S', the parenthesis at the *end* of the line is highlighted. Is this intentional?

Looks like it is.  From the option's doc string:

  If non-nil, show parens when point is in the line’s periphery.
  The periphery is at the beginning or end of a line or in any
  whitespace there.

What you describe seems to fit the "any whitespace there" part.

maybe this text is confusing in some way?  What did you expect to see
as the effect of this option?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40814; Package emacs. (Fri, 24 Apr 2020 10:57:01 GMT) Full text and rfc822 format available.

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

From: Al Haji-Ali <abdo.haji.ali <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 40814 <at> debbugs.gnu.org
Subject: Re: bug#40814: 26.3; show-paren-mode hightlights parentheses at eol
Date: Fri, 24 Apr 2020 11:55:24 +0100
I see. I think the documentation is unclear as to which parenthesis is
meant. After all, `(paren)` in the following text

    Some text (paren) some other text.

would not be highlighted if the point is in beginning (or end) of the
line even though this location meets the definition of the "line's
periphery" as defined in the documentation.
Based on this case, I would expect the consistent behaviour (to my
mind) that the text

   some other text (paren)

would highlight `(paren)` only if the point is at the end of the line,
not the beginning. This would also be consistent with the following
case

   (paren1) some other text (paren2)

where, correctly, (paren1) is highlighted if the point is in the
beginning of the line and (paren2) is highlighted if the point is in
the end of the line.

On Fri, Apr 24, 2020 at 11:37 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > From: Abdo Haji-Ali <abdo.haji.ali <at> gmail.com>
> > Date: Fri, 24 Apr 2020 11:16:52 +0100
> >
> > In the following text:
> >
> > ```
> >    Some text (other text)
> > ```
> >
> > If `show-paren-mode` is on, `show-paren-when-point-in-periphery` is true and the point is anywhere before 'S', the parenthesis at the *end* of the line is highlighted. Is this intentional?
>
> Looks like it is.  From the option's doc string:
>
>   If non-nil, show parens when point is in the line’s periphery.
>   The periphery is at the beginning or end of a line or in any
>   whitespace there.
>
> What you describe seems to fit the "any whitespace there" part.
>
> maybe this text is confusing in some way?  What did you expect to see
> as the effect of this option?
>
> Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40814; Package emacs. (Sun, 13 Jun 2021 12:31:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Al Haji-Ali <abdo.haji.ali <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 40814 <at> debbugs.gnu.org
Subject: Re: bug#40814: 26.3; show-paren-mode hightlights parentheses at eol
Date: Sun, 13 Jun 2021 14:29:51 +0200
Al Haji-Ali <abdo.haji.ali <at> gmail.com> writes:

> would highlight `(paren)` only if the point is at the end of the line,
> not the beginning. This would also be consistent with the following
> case
>
>    (paren1) some other text (paren2)
>
> where, correctly, (paren1) is highlighted if the point is in the
> beginning of the line and (paren2) is highlighted if the point is in
> the end of the line.

Looking at the code and the documentation, as far as I can tell, this is
working as designed (even if it's slightly eccentric).  With this
setting, when point is in the "periphery" of a line, it'll highlight the
closest parens -- if those parens are also in the "periphery".  Which is
what the manual says:

@vindex show-paren-when-point-in-periphery
@code{show-paren-when-point-in-periphery}, when non-@code{nil}, causes
highlighting also when point is in whitespace at the beginning or end
of a line, and there is a paren at, respectively, the first or last,
or the last, non-whitespace position on the line.

So I'm closing this bug report.

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




Added tag(s) notabug. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 13 Jun 2021 12:31:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 40814 <at> debbugs.gnu.org and Abdo Haji-Ali <abdo.haji.ali <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 13 Jun 2021 12:31: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. (Mon, 12 Jul 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 289 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.