all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 62675@debbugs.gnu.org
Subject: bug#62675: 29.0.60; emoji-zoom-increase interacts badly with faces
Date: Wed, 05 Apr 2023 11:12:31 +0200	[thread overview]
Message-ID: <87ttxuhev4.fsf@gmail.com> (raw)
In-Reply-To: <83v8iasonk.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 05 Apr 2023 11:45:35 +0300")

>>>>> On Wed, 05 Apr 2023 11:45:35 +0300, Eli Zaretskii <eliz@gnu.org> said:

    >> Thatʼs not a valid 'face property, unless Iʼm misreading (info
    >> "(elisp) Special Properties"), plus the ':height 1.331' bit is wrong,
    >> thatʼs (expt 1.1 3), not (expt 1.1 4). Yet it works, the height has
    >> been increased.

    Eli> The first "+" doesn't increase the height, though.

Hmm, youʼre right. Although if I then move to a different place in the
buffer, and do 'C-x 8 e +' it does increase the height first time. Is
this an interaction with font-lock?

Oh, and it doesnʼt work at eob. And increase followed by decrease
doesnʼt get you back to :height 1.0. And thereʼs no reset. I think
Iʼll only fix the first one on emacs-29 :-)

    >> Is this a bug in our interpretation of 'face properties?

    Eli> Face properties can be specified in many strange ways, and the fact
    Eli> that some invalid specifications seem to "work" doesn't mean we have a
    Eli> bug, it just means some invalid faces fall through the cracks.

OK. Iʼll make the code match the documented behaviour, and not worry
about it too much 😀

    >> I can fix the code in `emoji-zoom-increase' to produce something like
    >> 
    >> ((:height 1.4641000000000004) font-lock-comment-delimiter-face)
    >> 
    >> instead

    Eli> Please do, and thanks.  We don't need to understand why some bug seems
    Eli> to work, it is enough to fix the bug.

This seems to work:

diff --git a/lisp/international/emoji.el b/lisp/international/emoji.el
index bcd4aac4f29..a9ed6e79cc9 100644
--- a/lisp/international/emoji.el
+++ b/lisp/international/emoji.el
@@ -708,22 +708,24 @@ emoji-zoom-increase
 FACTOR is the multiplication factor for the size."
   (interactive)
   (set-transient-map emoji-zoom-map t nil "Zoom with %k")
-  (let* ((factor (or factor 1.1))
-         (old (get-text-property (point) 'face))
-         (height (or (and (consp old)
-                          (plist-get old :height))
-                     1.0))
-         (inhibit-read-only t))
-    (with-silent-modifications
-      (if (consp old)
-          (add-text-properties
-           (point) (1+ (point))
-           (list 'face (plist-put (copy-sequence old) :height (* height factor))
-                 'rear-nonsticky t))
-        (add-face-text-property (point) (1+ (point))
-                                (list :height (* height factor)))
-        (put-text-property (point) (1+ (point))
-                           'rear-nonsticky t)))))
+  (unless (eobp)
+    (let* ((factor (or factor 1.1))
+           (old (get-text-property (point) 'face))
+           (height (or (and (consp old)
+                            (plist-get (car old) :height))
+                       1.0))
+           (inhibit-read-only t))
+      (with-silent-modifications
+        (if (consp old)
+            (add-text-properties
+             (point) (1+ (point))
+             (list 'face (cons (plist-put (car old) :height (* height factor))
+                               (cdr old))
+                   'rear-nonsticky t))
+          (add-face-text-property (point) (1+ (point))
+                                  (list :height (* height factor)))
+          (put-text-property (point) (1+ (point))
+                             'rear-nonsticky t))))))
 
 ;;;###autoload
 (defun emoji-zoom-decrease ()

Robert
-- 





  reply	other threads:[~2023-04-05  9:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05  7:38 bug#62675: 29.0.60; emoji-zoom-increase interacts badly with faces Robert Pluim
2023-04-05  8:45 ` Eli Zaretskii
2023-04-05  9:12   ` Robert Pluim [this message]
2023-04-05  9:54     ` Eli Zaretskii
2023-04-05 11:55       ` Robert Pluim
2023-04-05 12:08         ` Eli Zaretskii
2023-04-05 13:53           ` Robert Pluim
2023-04-06 11:38             ` Robert Pluim

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

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

  git send-email \
    --in-reply-to=87ttxuhev4.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=62675@debbugs.gnu.org \
    --cc=eliz@gnu.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.