all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Stephen Berman <stephen.berman@gmx.net>
Cc: 4854@debbugs.gnu.org
Subject: bug#4854: 23.1.50; before-string overlay and show-paren-mode
Date: Fri, 01 Jul 2016 14:42:30 -0400	[thread overview]
Message-ID: <87k2h5gpyh.fsf@users.sourceforge.net> (raw)
In-Reply-To: <877hu5zy5r.fsf@escher.local.home> (Stephen Berman's message of "Thu, 05 Nov 2009 00:08:00 +0100")

severity 4854 minor
tags 4854 notabug
quit

A simpler test is

1. emacs -Q

2. eval

(defun show-overlays ()
  (interactive)
  (message "ovlist %S"
           (mapcar (lambda (o)
                     (cons o (overlay-properties o)))
                   (overlays-in (1- (point)) (1+ (point))))))

(global-set-key "\C-cs" 'show-overlays)

3. M-x show-paren-mode

4. with point on a parenthesis

C-c s gives

ovlist ((#<overlay from 730 to 731 in *scratch*> face show-paren-match priority 1000))

M-x show-overlays gives

ovlist nil

Stephen Berman <stephen.berman@gmx.net> writes:
> These two things seem very strange: (i) enabling show-paren-mode and
> getting the show-paren overlay somehow nullifies the unless test; (ii)
> this effect only happens when the command is invoked via a key
> sequence.

It's because show-paren-mode uses a single (pair of) overlay(s) for all
buffers and moves it to right place during idle time.  When you invoke a
command with M-x the overlay pair gets moved to the minibuffer.  With a
direct keybinding the overlay pair stays in the current buffer.  This
can be demonstrated by adding this advice (additional to the code
evaluated above):

(defun debug-show-paren-mode (&rest _args)
  (message "show-paren-function in buffer %S" (current-buffer)))
(advice-add 'show-paren-function :before #'debug-show-paren-mode)

When using C-c s:

show-paren-function in buffer #<buffer *scratch*> [4 times]
ovlist ((#<overlay from 506 to 507 in *scratch*> face show-paren-match priority 1000))

When using M-x show-overlays:

show-paren-function in buffer #<buffer  *Minibuf-1*> [5 times]
ovlist nil
You can run the command ‘show-overlays’ with C-c s

So I think this is not a bug, it's just how show-paren-mode works.





  reply	other threads:[~2016-07-01 18:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02 14:49 bug#4854: 23.1.50; before-string overlay and show-paren-mode Stephen Berman
2009-11-04 23:08 ` Stephen Berman
2016-07-01 18:42   ` npostavs [this message]
2016-07-03 14:33     ` Stephen Berman
2016-07-03 15:36       ` npostavs
2016-07-03 15:42         ` Eli Zaretskii
2016-07-03 15:58           ` npostavs
2016-07-03 22:23             ` Stephen Berman

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

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

  git send-email \
    --in-reply-to=87k2h5gpyh.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=4854@debbugs.gnu.org \
    --cc=stephen.berman@gmx.net \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.