From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Johann =?UTF-8?Q?Kl=C3=A4hn?= Newsgroups: gmane.emacs.bugs Subject: bug#34022: 26.1; Region highlight has lower priority than flymake overlays Date: Wed, 09 Jan 2019 21:33:37 +0100 Message-ID: <1547066017.2291240.1630221536.19E9AC39@webmail.messagingengine.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1547066229 17115 195.159.176.226 (9 Jan 2019 20:37:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 9 Jan 2019 20:37:09 +0000 (UTC) Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= To: 34022@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 09 21:37:04 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ghKb0-0004GP-NB for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Jan 2019 21:37:03 +0100 Original-Received: from localhost ([127.0.0.1]:42138 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghKd7-0006Qg-EE for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Jan 2019 15:39:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghKcx-0006QE-Vx for bug-gnu-emacs@gnu.org; Wed, 09 Jan 2019 15:39:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghKcw-0006Fm-JH for bug-gnu-emacs@gnu.org; Wed, 09 Jan 2019 15:39:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53308) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ghKcw-0006Fi-GI for bug-gnu-emacs@gnu.org; Wed, 09 Jan 2019 15:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ghKcw-0007HT-BK for bug-gnu-emacs@gnu.org; Wed, 09 Jan 2019 15:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Johann =?UTF-8?Q?Kl=C3=A4hn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Jan 2019 20:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34022 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.154706631127941 (code B ref -1); Wed, 09 Jan 2019 20:39:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Jan 2019 20:38:31 +0000 Original-Received: from localhost ([127.0.0.1]:52587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ghKcR-0007GZ-DK for submit@debbugs.gnu.org; Wed, 09 Jan 2019 15:38:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45677) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ghKXu-00078r-Gr for submit@debbugs.gnu.org; Wed, 09 Jan 2019 15:33:51 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:49820) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghKXp-0003y3-4p for submit@debbugs.gnu.org; Wed, 09 Jan 2019 15:33:45 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghKXn-0005BR-DH for bug-gnu-emacs@gnu.org; Wed, 09 Jan 2019 15:33:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghKXl-0003xB-NF for bug-gnu-emacs@gnu.org; Wed, 09 Jan 2019 15:33:43 -0500 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:57901) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghKXl-0003uy-Ed for bug-gnu-emacs@gnu.org; Wed, 09 Jan 2019 15:33:41 -0500 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 282C421908; Wed, 9 Jan 2019 15:33:39 -0500 (EST) Original-Received: from web4 ([10.202.2.214]) by compute7.internal (MEProxy); Wed, 09 Jan 2019 15:33:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jklaehn.de; h= message-id:from:to:cc:mime-version:content-transfer-encoding :content-type:subject:date; s=fm2; bh=V14HwTGMvAmYDqifsiy+VrFwpY vJhXRw9Ic5RoK5okQ=; b=SF8oGYwCEhQ9sxqWZDB+1zzjfHlPFCzRMPHF0C7Z3T 5gTlH7fwRdXYgxplAmiWfMa2fdGYzFmUiasEXnSurQ6wTf+k0Mef/yCdiN1BEAXL SFq3ltN8PQg1dCT2ER5ukw1acnWqJ6O5d9YGWySyFMefDgH/IrK3OW80Xa21Sy+A aTMV1yETZ5gt90SuO12Ab8d3E+TjQ1UQ+pWYzKCXl/Fqao+NvIIMiBhOqoeGruUi 6Bxa1sgZNlv7VzjzV0hB3QFQNSkKs3o/0VFNKyvB2gp//20/FxwghTllg3yu8SRa 23pSOJCAY1UePTC/cvRX+H95HeQm5YROBTW8dzOo3c0Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=V14HwT GMvAmYDqifsiy+VrFwpYvJhXRw9Ic5RoK5okQ=; b=p5x2+0DW4YgcHhF0+qo8dp 6wFn4MfFEWql4VgOiitfJsuHlJwoUv5WkmVkl4sWq6DNhg/B5/tlbUJ3sxFKyjYI DkJ3LTYrQwB9qv7G3Qbcu3z2tXy8Zn+jJ2+dfbvh8yVevJmu6DqhyHjRFyrjP25w hJoPC20iv23b3iLmnYarP6BS7aWcLnVAxw6LTOWDmqWaq92o3Gc65pT1wqmCJqet Sa+iilRX7wL9t5idRxpOd9MZxeDVGnjqXq6Jl9UdsReqdTd7Hv1wEw62ibY9xRYx Ai96s/unGpahCSX3gBsqyPFU8bQX2Tm4PR8foIB86COLtWjYMpFacP36dAAjbyVg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrfedugddugedtucdltddurdegtdekrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhht necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkhffvggfgtgfoufffsehtqhertdertdejnecuhfhrohhmpeflohhhrghn nhcumfhlmohhnhcuoehjohhhrghnnhesjhhklhgrvghhnhdruggvqeenucfrrghrrghmpe hmrghilhhfrhhomhepjhhohhgrnhhnsehjkhhlrggvhhhnrdguvgenucevlhhushhtvghr ufhiiigvpedt X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 99) id C4FEFBA784; Wed, 9 Jan 2019 15:33:37 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface - ajax-5ae1f753 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Wed, 09 Jan 2019 15:38:29 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:154294 Archived-At: I just noticed a bug (?) that region becomes de-facto "invisible" due to it= s highlight overlay having a lower priority than the flymake overlays. This= only happens when both region and flymake diagnostics are indicated using = the same face property (background in my case). It becomes more apparent fo= r larger flymake overlays. Steps to reproduce, starting from emacs -Q: =E2=80=A2 M-: (set-face-background flymake-note "yellow green") =E2=80=A2 M-x find-library flymake (or any file where there will be flymake= diagnostics) =E2=80=A2 M-x flymake-mode =E2=80=A2 Jump to a docstring/line/paragraph highlighted using e.g. the `fl= ymake-note' face. =E2=80=A2 With transient-mark-mode enabled select regions that overlap with= the flymake overlay. =E2=87=92 The region is not highlighted since the backgr= ound face property given by the flymake overlay takes precedence. Relevant extract from simple.el.gz, where the secondary priority for the region highlight overlay is set to 100: > (defvar redisplay-highlight-region-function > (lambda (start end window rol) > (if (not (overlayp rol)) > (let ((nrol (make-overlay start end))) > (funcall redisplay-unhighlight-region-function rol) > (overlay-put nrol 'window window) > (overlay-put nrol 'face 'region) > ;; Normal priority so that a large region doesn't hide all the > ;; overlays within it, but high secondary priority so that if it > ;; ends/starts in the middle of a small overlay, that small ove= rlay > ;; won't hide the region's boundaries. > (overlay-put nrol 'priority '(nil . 100)) > nrol) > (unless (and (eq (overlay-buffer rol) (current-buffer)) > (eq (overlay-start rol) start) > (eq (overlay-end rol) end)) > (move-overlay rol start end (current-buffer))) > rol))) Flymake uses 100 as the offset to compute the default priority for its over= lays: > (defun flymake--highlight-line (diagnostic) > "Highlight buffer with info in DIAGNOSTIC." > (when-let* ((ov (make-overlay > (flymake--diag-beg diagnostic) > (flymake--diag-end diagnostic)))) > ;; First set `category' in the overlay, then copy over every other > ;; property. > ;; > (let ((alist (assoc-default (flymake--diag-type diagnostic) > flymake-diagnostic-types-alist))) > (overlay-put ov 'category (assoc-default 'flymake-category alist)) > (cl-loop for (k . v) in alist > unless (eq k 'category) > do (overlay-put ov k v))) > ;; Now ensure some essential defaults are set > ;; > (cl-flet ((default-maybe > (prop value) > (unless (or (plist-member (overlay-properties ov) prop) > (let ((cat (overlay-get ov > 'flymake-category))) > (and cat > (plist-member (symbol-plist cat) prop)= ))) > (overlay-put ov prop value)))) > (default-maybe 'bitmap 'flymake-error-bitmap) > (default-maybe 'face 'flymake-error) > (default-maybe 'before-string > (flymake--fringe-overlay-spec > (overlay-get ov 'bitmap))) > (default-maybe 'help-echo > (lambda (window _ov pos) > (with-selected-window window > (mapconcat > #'flymake--diag-text > (flymake-diagnostics pos) > "\n")))) > (default-maybe 'severity (warning-numeric-level :error)) > (default-maybe 'priority (+ 100 (overlay-get ov 'severity)))) > ;; Some properties can't be overridden. > ;; > (overlay-put ov 'evaporate t) > (overlay-put ov 'flymake-diagnostic diagnostic))) Is it intentional that 100 is used as the offset here? This has the effect = that most priorities will be above that of the region overlay. --- 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 Recent messages: Configured using: 'configure --prefix=3D/usr --sysconfdir=3D/etc --libexecdir=3D/usr/lib --localstatedir=3D/var --with-x-toolkit=3Dgtk3 --with-xft --with-modules 'CFLAGS=3D-march=3Dx86-64 -mtune=3Dgeneric -O2 -pipe -fstack-protector-str= ong -fno-plt' CPPFLAGS=3D-D_FORTIFY_SOURCE=3D2 LDFLAGS=3D-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 $LC_ALL: en_US.UTF-8 value of $LC_MESSAGES: C value of $LANG: de_DE.utf8 locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: flymake-mode: t tooltip-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 blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-extra help-fns radix-tree cl-print byte-opt bytecomp byte-compile cconv debug face-remap misearch multi-isearch noutline outline easy-mmode lisp-mnt checkdoc cl-macs gv cl-seq flymake-proc flymake compile comint ansi-color ring warnings help-mode easymenu cl-loaddefs cl-lib jka-compr thingatpt find-func elec-pair 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 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 123857 7080) (symbols 48 22067 1) (miscs 40 144 289) (strings 32 35534 1170) (string-bytes 1 922022) (vectors 16 17358) (vector-slots 8 524383 14202) (floats 8 67 298) (intervals 56 2057 393) (buffers 992 18))