From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron Newsgroups: gmane.emacs.devel Subject: Re: master a876c4d7a17: Improve SHR/EWW support for 'visual-wrap-prefix-mode' Date: Wed, 21 Aug 2024 13:33:25 +0200 Message-ID: References: <172402253530.16373.1641341718329436871@vcs2.savannah.gnu.org> <20240818230855.B0A94C2BC6D@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30105"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Jim Porter To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 21 13:34:16 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sgjbT-0007jt-Lu for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Aug 2024 13:34:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgjam-0006Ud-Ow; Wed, 21 Aug 2024 07:33:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgjak-0006UM-FF for emacs-devel@gnu.org; Wed, 21 Aug 2024 07:33:30 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgjai-0008OT-Ld for emacs-devel@gnu.org; Wed, 21 Aug 2024 07:33:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1724240007; bh=Sun0AFlWgLcqy/uU1rfGWPiTg1RCm789Yybmc8yHPdk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=dyVgLVKqCTAOHMK4DGhVeyRWREOwhEcWkwMBr+NKlpPVQQZBpTlxTYXJjptpKixwO CGHXIZ3M8YdZtaLqedC6SHcT6uMI0PwNt/bhL2WFwoafoeBnMmq2DydegvZ0OM21LB PCR44J+5SE2R17+DqBGvWIZjVi964E0QwZM10OnqrR97LG/XEh0GwZqPIgaM6LRwB9 JC+ijD/tc8w5xWKZh9CpNkrxWcIW4MxV8UDAF2wqSEBkwvuh2D316up6tMck/D0igt sWF+K67X6vQOJL9bjvKwQQra5TQayU69waDZ7bCzWZ6o1YnxF/pbHPWXzDMFRUooLX KtHAPzTfRXDaA== In-Reply-To: <20240818230855.B0A94C2BC6D@vcs2.savannah.gnu.org> (Jim Porter's message of "Sun, 18 Aug 2024 19:08:55 -0400 (EDT)") Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:322998 Archived-At: Hello Jim, Jim Porter writes: > branch: master > commit a876c4d7a17df152e3e78800c76ddf158f632ee5 > Author: Jim Porter > Commit: Jim Porter > > Improve SHR/EWW support for 'visual-wrap-prefix-mode' > [...] Thanks for this! It seems like this change breaks Elfeed though, namely: > (defun shr-indent () > (when (> shr-indentation 0) > - (if (not shr-use-fonts) > - (insert-char ?\s shr-indentation) > - (insert ?\s) > - (put-text-property (1- (point)) (point) > - 'display `(space :width (,shr-indentation)))))) > + (let ((start (point)) > + (prefix (or (get-text-property (point) 'shr-prefix-length) 0))) > + (if (not shr-use-fonts) > + (insert-char ?\s shr-indentation) > + (insert ?\s) > + (put-text-property > + (1- (point)) (point) 'display > + ;; Set the specified space width in terms of the default width > + ;; of the current face, like (N . width). That way, the > + ;; indentation is calculated correctly when using > + ;; `text-scale-adjust'. > + `(space :width (,(if-let ((font (font-at (1- (point)))) > + (info (query-font font))) > + (/ (float shr-indentation) (aref info 7)) > + shr-indentation) > + . width)))) > + (put-text-property start (+ (point) prefix) > + 'shr-prefix-length (+ prefix (- (point) start)))))) This call to font-at throws an error unless the current buffer happens to be displayed in the selected window. This affects elfeed-show-entry, for example. Cheers, Eshel