GNU bug report logs -
#69516
30.0.50; fontify newline and end of headlines in shr
Previous Next
To reply to this bug, email your comments to 69516 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69516
; Package
emacs
.
(Sat, 02 Mar 2024 23:32:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
StrawberryTea <look <at> strawberrytea.xyz>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 02 Mar 2024 23:32:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hello Emacs developers,
As you know, I love extending my headline backgrounds to the end of the
window. However, shr.el does not do this, understandably because shr.el
was written before the :extend keyword was added.
The following patch hacks around this:
modified lisp/net/shr.el
@@ -990,16 +990,21 @@ shr-fontize-dom
;; Add face to the region, but avoid putting the font properties on
;; blank text at the start of the line, and the newline at the end, to
;; avoid ugliness.
(defun shr-add-font (start end type)
+ (when (memq type '(shr-h1 shr-h2 shr-h3 shr-h4 shr-h5 shr-h6))
+ (insert "\n")
+ (setq end (1+ end)))
(save-excursion
(goto-char start)
(while (< (point) end)
(when (bolp)
(skip-chars-forward " "))
- (add-face-text-property (point) (min (line-end-position) end) type t)
+ (add-face-text-property (point) end type t)
(if (< (line-end-position) end)
(forward-line 1)
(goto-char end)))))
But this is a hack, and I would like to see a proper fix in Emacs.
StrawberryTea
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69516
; Package
emacs
.
(Sun, 03 Mar 2024 04:03:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 69516 <at> debbugs.gnu.org (full text, mbox):
As a follow-up to my previous message, this is the correct code to
reproduce the issue:
;; Bootstrap straight
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package 'org)
(require 'org)
(load-theme 'leuven t)
(dolist (face '(org-level-1 org-level-2 org-level-3 org-level-4 org-level-5
org-level-6 org-level-7 org-level-8))
(set-face-attribute face nil :extend t))
(setq org-fontify-whole-heading-line t)
(scratch-buffer)
(org-mode)
(insert "* Headline 1\n Hello
* Headline 1\nHello\n")
(run-at-time 1 0 #'org-cycle-global)
(run-at-time 2 0 #'org-cycle-global)
(run-at-time 3 0 #'org-cycle-global)
help-debbugs <at> gnu.org (GNU bug Tracking System) writes:
> Thank you for filing a new bug report with debbugs.gnu.org.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
> bug-gnu-emacs <at> gnu.org
>
> If you wish to submit further information on this problem, please
> send it to 69516 <at> debbugs.gnu.org.
>
> Please do not send mail to help-debbugs <at> gnu.org unless you wish
> to report a problem with the Bug-tracking system.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69516
; Package
emacs
.
(Sun, 03 Mar 2024 06:57:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 69516 <at> debbugs.gnu.org (full text, mbox):
severity 69516 wishlist
thanks
> From: StrawberryTea <look <at> strawberrytea.xyz>
> Date: Sat, 02 Mar 2024 17:31:07 -0600
>
> Hello Emacs developers,
>
> As you know, I love extending my headline backgrounds to the end of the
> window. However, shr.el does not do this, understandably because shr.el
> was written before the :extend keyword was added.
>
> The following patch hacks around this:
>
> modified lisp/net/shr.el
> @@ -990,16 +990,21 @@ shr-fontize-dom
> ;; Add face to the region, but avoid putting the font properties on
> ;; blank text at the start of the line, and the newline at the end, to
> ;; avoid ugliness.
> (defun shr-add-font (start end type)
> + (when (memq type '(shr-h1 shr-h2 shr-h3 shr-h4 shr-h5 shr-h6))
> + (insert "\n")
> + (setq end (1+ end)))
> (save-excursion
> (goto-char start)
> (while (< (point) end)
> (when (bolp)
> (skip-chars-forward " "))
> - (add-face-text-property (point) (min (line-end-position) end) type t)
> + (add-face-text-property (point) end type t)
> (if (< (line-end-position) end)
> (forward-line 1)
> (goto-char end)))))
>
> But this is a hack, and I would like to see a proper fix in Emacs.
Thanks. Patches for this are welcome, but I think this should be an
optional feature, given that we have lived without it for such a long
time.
Severity set to 'wishlist' from 'normal'
Request was from
Eli Zaretskii <eliz <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 03 Mar 2024 06:57:02 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 191 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.