GNU bug report logs -
#66752
30.0.50; [PATCH] Add support for 'thing-at-point' to 'bug-reference-mode'
Previous Next
Reported by: Jim Porter <jporterbugs <at> gmail.com>
Date: Wed, 25 Oct 2023 22:35:01 UTC
Severity: normal
Tags: patch
Found in version 30.0.50
Done: Jim Porter <jporterbugs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 66752 <at> debbugs.gnu.org (full text, mbox):
Jim Porter <jporterbugs <at> gmail.com> writes:
Hi Jim & Eli,
> Currently, "(thing-at-point 'url)" returns nil when point is over a
> bug reference. It would be nice to return the URL here.
Yes, why not.
> Attached is a patch plus a regression test for this.
The patch and test look good. One minor nit below.
> +(defun bug-reference--url-at-point ()
> + (get-char-property (point) 'bug-reference-url))
> +
> +(defun bug-reference--init (enable)
> + (if enable
> + (progn
> + (jit-lock-register #'bug-reference-fontify)
> + (require 'thingatpt)
> + (setq-local thing-at-point-provider-alist
> + (append thing-at-point-provider-alist
> + '((url . bug-reference--url-at-point)))))
Quoting this way would be better:
`((url . ,#'bug-reference--url-at-point))
> (jit-lock-unregister #'bug-reference-fontify)
> + (setq thing-at-point-provider-alist
> + (delete '((url . bug-reference--url-at-point))
> + thing-at-point-provider-alist))
> + (when (equal thing-at-point-provider-alist
> + (default-value 'thing-at-point-provider-alist))
> + (kill-local-variable 'thing-at-point-provider-alist))
Is that conventional, nuking a buffer-local value once it's back to its
default value. Just asking out of curiosity.
Bye,
Tassilo
This bug report was last modified 1 year and 288 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.