]> git.eshelyaron.com Git - emacs.git/commit
Use 'with-work-macro' in 'string-pixel-width'
authorDavid Ponce <da_vid@orange.fr>
Thu, 22 Aug 2024 14:56:11 +0000 (16:56 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 4 Sep 2024 07:51:51 +0000 (09:51 +0200)
commit0477207e2edbafa1830c53608877007d7c7a5f40
tree159cbb987f26009bce90f2e33c0a86f2c5efe160
parente005637c815db584b3d557c7577aba25e016c619
Use 'with-work-macro' in 'string-pixel-width'

Tweak the implementation of 'string-pixel-width' to run
faster and use less memory.  Also cater for the case where
this function is called in parallel (bug#72689).
* lisp/emacs-lisp/subr-x.el (string-pixel-width): Use
`with-work-macro'.  Prefer `remove-text-properties' to
`propertize' to avoid creating a new string on each call.

(cherry picked from commit dffdbc1f1fd6569c518e2e3b5e771a54e9e9483f)
lisp/emacs-lisp/subr-x.el