]> git.eshelyaron.com Git - emacs.git/commitdiff
Add more "safe" display specs to 'visual-wrap-prefix-mode'
authorJim Porter <jporterbugs@gmail.com>
Sat, 31 May 2025 05:21:40 +0000 (22:21 -0700)
committerEshel Yaron <me@eshelyaron.com>
Sat, 7 Jun 2025 19:53:55 +0000 (21:53 +0200)
* lisp/visual-wrap.el (visual-wrap--safe-display-specs): Add
'space-width' and 'min-width'.
(visual-wrap--display-property-safe-p): Use 'member' instead of 'memq'
to more-closely match the behavior of other code that works with display
properties.

(cherry picked from commit d25e9f518082f31ab730623eea36da45cd73ac06)

lisp/visual-wrap.el

index 2deaf263ed6da42db247c616c49900cb57cf2cc6..92b9abc60e31487e626a50c3a6e005a70da78820 100644 (file)
@@ -74,7 +74,7 @@ extra indent = 2
       (face-background face nil t)))))
 
 (defvar visual-wrap--safe-display-specs
-  '(height raise)
+  '(space-width min-width height raise)
   "A list of display specs that don't interfere with wrap prefixes.
 A \"safe\" display spec is one that won't interfere with the additional
 text properties that `visual-wrap-prefix-mode' uses.
@@ -98,8 +98,8 @@ members of `visual-wrap--safe-display-specs' (which see)."
   (when (or (vectorp display) (listp display))
     (not (catch 'unsafe
            (mapc (lambda (spec)
-                   (unless (memq (car-safe spec)
-                                 visual-wrap--safe-display-specs)
+                   (unless (member (car-safe spec)
+                                   visual-wrap--safe-display-specs)
                      (throw 'unsafe t)))
                  display)))))