unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Linus Källberg" <linus.kallberg@outlook.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: "36550@debbugs.gnu.org" <36550@debbugs.gnu.org>
Subject: bug#36550: Small bug fix in recentf.el
Date: Thu, 11 Jul 2019 16:34:29 +0000	[thread overview]
Message-ID: <AM0PR09MB2867803F96B1A7F4A5B4C81687F30@AM0PR09MB2867.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <m3bly3xsto.fsf@gnus.org>

[-- Attachment #1: Type: text/plain, Size: 1166 bytes --]

Den 2019-07-09 kl. 15:04, skrev Lars Ingebrigtsen:
> Linus Källberg <linus.kallberg@outlook.com> writes:
> 
>> Okay, makes sense. I just thought it looked a bit weird that the first
>> character on the next line is highlighted as well. At first I thought
>> something more serious was broken in Emacs, that's why I looked into it.
> 
> Oh, I didn't catch that the first character on the next line is
> highlighted.  That does indeed seem like a bug.
> 
>> A middle ground would be to move the newline but put a single space
>> before "%]" (or set :button-suffix " "), to keep the behavior described
>> in the commit message. But it's no big deal in any event :-)
> 
> Could you propose a patch that avoids the highlight on the next line?

On second thought, I don't think the real problem is in recentf.el, but 
rather in the implementation of widgets and/or faces. It makes sense to 
keep recentf.el as it is.

I'm probably not qualified to fix the bug, at least in a timely manner, 
but I did some experimenting and came up with an MWE, which is attached 
to this e-mail. Hopefully it can be of some help.

Best regards,
Linus Källberg

[-- Attachment #2: widgets-mwe.el --]
[-- Type: text/plain, Size: 1568 bytes --]

(require 'widget)

(eval-when-compile
  (require 'wid-edit))

(defun widget-example ()
  "Create the widgets from the Widget manual."
  (interactive)
  (switch-to-buffer "*Widget Example*")
  (kill-all-local-variables)
  (let ((inhibit-read-only t))
    (erase-buffer))
  (remove-overlays)

  (widget-insert "Move the mouse over the links below to trigger the highlighting.\n\n")

  (widget-insert "This one looks normal:\n\n")
  (widget-create 'link "with brackets, w/o newline")

  (widget-insert "\n\nThis one looks okay, except that preferably, the whole first line\n"
                 "shouldn't be highlighted, only the text:\n\n")
  (widget-create 'link "with brackets, with newline\n")

  (widget-insert "\n\nThis one, which uses roughly the same parameters as are used in the\n"
                 "recentf dialog, looks really strange because the first character on the\n"
                 "next line is highlighted as well:\n\n")
  (widget-create 'link :button-suffix "" :button-prefix "" "w/o brackets, with newline\n")
  (widget-insert "A <- this character shouldn't be highlighted.")

  (widget-insert "\n\nThis one looks normal:\n\n")
  (widget-create 'link :button-suffix "" :button-prefix "" "w/o brackets, w/o newline")

  (widget-insert "\n\nThis one should look the same as the previous one, but it doesn't\n"
                 "because it is followed by EOF instead of a newline:\n\n")
  (widget-create 'link :button-suffix "" :button-prefix "" "w/o brackets, w/o newline")

  (widget-setup))

(widget-example)

  reply	other threads:[~2019-07-11 16:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08 12:54 bug#36550: Small bug fix in recentf.el Linus Källberg
2019-07-08 19:58 ` Lars Ingebrigtsen
     [not found]   ` <AM0PR09MB2867529A5BCE4551365F142C87F60@AM0PR09MB2867.eurprd09.prod.outlook.com>
2019-07-09 13:04     ` Lars Ingebrigtsen
2019-07-11 16:34       ` Linus Källberg [this message]
2019-07-12 15:07         ` Lars Ingebrigtsen
2019-07-13  0:31         ` bug#36550: mouse-face overlay calculation error Lars Ingebrigtsen
2019-07-13  6:15           ` Eli Zaretskii
2019-07-13 13:10             ` Lars Ingebrigtsen
2019-07-13 13:23               ` Eli Zaretskii
2019-07-13 13:50                 ` Lars Ingebrigtsen
2019-07-13 14:17                   ` Eli Zaretskii
2019-07-13 14:25                     ` Lars Ingebrigtsen
2019-07-13 14:50                       ` Eli Zaretskii
2019-07-13 15:05                         ` Lars Ingebrigtsen
2019-07-13 15:08                           ` Lars Ingebrigtsen
2019-07-13 15:38                             ` Linus Källberg
2019-07-13 15:49                               ` Eli Zaretskii
2019-07-13 19:49                                 ` Linus Källberg
2019-07-14  5:30                                   ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=AM0PR09MB2867803F96B1A7F4A5B4C81687F30@AM0PR09MB2867.eurprd09.prod.outlook.com \
    --to=linus.kallberg@outlook.com \
    --cc=36550@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /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 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).