[PATCH emacs-team] gnu: emacs: Only verify integrity of bound symbols.

  • Open
  • quality assurance status badge
Details
2 participants
  • Andrew Tropin
  • Liliana Marie Prikler
Owner
unassigned
Submitted by
Liliana Marie Prikler
Severity
normal
L
L
Liliana Marie Prikler wrote on 22 Mar 22:45 +0100
(address . guix-patches@gnu.org)
9e22ef64adefbc226d0e4ceb99b5823d9df99a3f.1711144224.git.liliana.prikler@gmail.com
Some variants, like emacs-no-x, come with a reduced set of preloaded symbols,
so don't expect them to always be native.

* gnu/packages/aux-files/emacs/comp-integrity.el (expect-native-if-bound): New
function.
(x-setup-function-keys, dynamic-setting-handle-config-changed-event)
(fontset-plain-name, fringe-mode, image-type, regexp-opt, scroll-bar-scale):
Use ‘expect-native-if-bound’.
(x-handle-no-bitmap-icon): Likewise, was already conditional.
---
.../aux-files/emacs/comp-integrity.el | 22 ++++++++++---------
1 file changed, 12 insertions(+), 10 deletions(-)

Toggle diff (83 lines)
diff --git a/gnu/packages/aux-files/emacs/comp-integrity.el b/gnu/packages/aux-files/emacs/comp-integrity.el
index 191e2ddb98..abe7e7c0c9 100644
--- a/gnu/packages/aux-files/emacs/comp-integrity.el
+++ b/gnu/packages/aux-files/emacs/comp-integrity.el
@@ -24,6 +24,9 @@
(defmacro expect-native (fun &optional feature)
`(progn (expect-help ,fun native ,feature)))
+ (defmacro expect-native-if-bound (fun)
+ `(and (boundp ',fun) (expect-help ,fun native)))
+
(defmacro expect-builtin (fun &optional feature)
`(progn (expect-help ,fun built-in ,feature))))
@@ -38,7 +41,7 @@
(expect-native use-default-char-width-table)
(expect-native cl-generic-p)
(expect-native cl-struct-define)
-(expect-native x-setup-function-keys)
+(expect-native-if-bound x-setup-function-keys)
(expect-native encode-composition-rule)
(expect-native custom-declare-face)
(expect-native minibuffer-prompt-properties--setter)
@@ -48,7 +51,7 @@
(expect-native dnd-open-file)
(expect-native dos-mode25 dos-fns)
(expect-native find-file-text dos-w32)
-(expect-native dynamic-setting-handle-config-changed-event)
+(expect-native-if-bound dynamic-setting-handle-config-changed-event)
(expect-native easy-menu-item-present-p)
(expect-native eldoc-mode)
(expect-native electric-indent-mode)
@@ -60,12 +63,12 @@
(expect-native fill-region)
(expect-native font-lock-change-mode)
(expect-native font-lock-add-keywords)
-(expect-native fontset-plain-name)
+(expect-native-if-bound fontset-plain-name)
(expect-native format-read)
(expect-native frame-edges)
-(expect-native fringe-mode)
+(expect-native-if-bound fringe-mode)
(expect-native help-quick)
-(expect-native image-type)
+(expect-native-if-bound image-type)
(expect-native indent-region)
(expect-native indian-compose-regexp)
(expect-native msdos-setup-keyboard term/internal)
@@ -86,7 +89,7 @@
(expect-native convert-define-charset-argument)
(expect-native coding-system-change-eol-conversion)
(expect-native store-substring mule-util)
-(expect-native mouse-wheel-change-button)
+(expect-native-if-bound mouse-wheel-change-button)
(expect-native advice-function-mapc)
(expect-native comment-string-strip)
(if (>= emacs-major-version 30)
@@ -99,12 +102,12 @@
(expect-native show-paren-function)
(expect-native pgtk-dnd-init-frame pgtk-dnd)
(expect-native prog-context-menu)
-(expect-native regexp-opt)
+(expect-native-if-bound regexp-opt)
(expect-native get-register)
(expect-native query-replace-descr)
(expect-native rfn-eshadow-setup-minibuffer)
(expect-native read-multiple-choice)
-(expect-native scroll-bar-scale)
+(expect-native-if-bound scroll-bar-scale)
(expect-native gui-select-text)
(expect-native seq-first)
(expect-native hack-read-symbol-shorthands)
@@ -126,5 +129,4 @@
(expect-native define-widget)
(expect-native window-right)
(expect-native x-dnd-init-frame x-dnd)
-(and (boundp 'x-handle-no-bitmap-icon)
- (expect-native x-handle-no-bitmap-icon))
+(expect-native-if-bound x-handle-no-bitmap-icon)

base-commit: 058532bdd8953feefbd84fd7514822886c7f1a7e
--
2.41.0
A
A
Andrew Tropin wrote on 11 Apr 16:45 +0200
87wmp4yn2y.fsf@trop.in
On 2024-03-22 22:45, Liliana Marie Prikler wrote:

Toggle quote (95 lines)
> Some variants, like emacs-no-x, come with a reduced set of preloaded symbols,
> so don't expect them to always be native.
>
> * gnu/packages/aux-files/emacs/comp-integrity.el (expect-native-if-bound): New
> function.
> (x-setup-function-keys, dynamic-setting-handle-config-changed-event)
> (fontset-plain-name, fringe-mode, image-type, regexp-opt, scroll-bar-scale):
> Use ‘expect-native-if-bound’.
> (x-handle-no-bitmap-icon): Likewise, was already conditional.
> ---
> .../aux-files/emacs/comp-integrity.el | 22 ++++++++++---------
> 1 file changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/gnu/packages/aux-files/emacs/comp-integrity.el b/gnu/packages/aux-files/emacs/comp-integrity.el
> index 191e2ddb98..abe7e7c0c9 100644
> --- a/gnu/packages/aux-files/emacs/comp-integrity.el
> +++ b/gnu/packages/aux-files/emacs/comp-integrity.el
> @@ -24,6 +24,9 @@
> (defmacro expect-native (fun &optional feature)
> `(progn (expect-help ,fun native ,feature)))
>
> + (defmacro expect-native-if-bound (fun)
> + `(and (boundp ',fun) (expect-help ,fun native)))
> +
> (defmacro expect-builtin (fun &optional feature)
> `(progn (expect-help ,fun built-in ,feature))))
>
> @@ -38,7 +41,7 @@
> (expect-native use-default-char-width-table)
> (expect-native cl-generic-p)
> (expect-native cl-struct-define)
> -(expect-native x-setup-function-keys)
> +(expect-native-if-bound x-setup-function-keys)
> (expect-native encode-composition-rule)
> (expect-native custom-declare-face)
> (expect-native minibuffer-prompt-properties--setter)
> @@ -48,7 +51,7 @@
> (expect-native dnd-open-file)
> (expect-native dos-mode25 dos-fns)
> (expect-native find-file-text dos-w32)
> -(expect-native dynamic-setting-handle-config-changed-event)
> +(expect-native-if-bound dynamic-setting-handle-config-changed-event)
> (expect-native easy-menu-item-present-p)
> (expect-native eldoc-mode)
> (expect-native electric-indent-mode)
> @@ -60,12 +63,12 @@
> (expect-native fill-region)
> (expect-native font-lock-change-mode)
> (expect-native font-lock-add-keywords)
> -(expect-native fontset-plain-name)
> +(expect-native-if-bound fontset-plain-name)
> (expect-native format-read)
> (expect-native frame-edges)
> -(expect-native fringe-mode)
> +(expect-native-if-bound fringe-mode)
> (expect-native help-quick)
> -(expect-native image-type)
> +(expect-native-if-bound image-type)
> (expect-native indent-region)
> (expect-native indian-compose-regexp)
> (expect-native msdos-setup-keyboard term/internal)
> @@ -86,7 +89,7 @@
> (expect-native convert-define-charset-argument)
> (expect-native coding-system-change-eol-conversion)
> (expect-native store-substring mule-util)
> -(expect-native mouse-wheel-change-button)
> +(expect-native-if-bound mouse-wheel-change-button)
> (expect-native advice-function-mapc)
> (expect-native comment-string-strip)
> (if (>= emacs-major-version 30)
> @@ -99,12 +102,12 @@
> (expect-native show-paren-function)
> (expect-native pgtk-dnd-init-frame pgtk-dnd)
> (expect-native prog-context-menu)
> -(expect-native regexp-opt)
> +(expect-native-if-bound regexp-opt)
> (expect-native get-register)
> (expect-native query-replace-descr)
> (expect-native rfn-eshadow-setup-minibuffer)
> (expect-native read-multiple-choice)
> -(expect-native scroll-bar-scale)
> +(expect-native-if-bound scroll-bar-scale)
> (expect-native gui-select-text)
> (expect-native seq-first)
> (expect-native hack-read-symbol-shorthands)
> @@ -126,5 +129,4 @@
> (expect-native define-widget)
> (expect-native window-right)
> (expect-native x-dnd-init-frame x-dnd)
> -(and (boundp 'x-handle-no-bitmap-icon)
> - (expect-native x-handle-no-bitmap-icon))
> +(expect-native-if-bound x-handle-no-bitmap-icon)
>
> base-commit: 058532bdd8953feefbd84fd7514822886c7f1a7e

Hi Liliana,

Looks good!

--
Best regards,
Andrew Tropin
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmYX96UACgkQIgjSCVjB
3rBIzQ//eNQ588FvbEDXwP4cfapguimU0OnJg+S7eVhrTzklg990pW7E7SD53WYq
SUwxRTVbPfh/aifmPKjclIYATYrr396r0GC6CTjlMdXbA1cDxc+5M+fxrTQXw0WL
bszDod9tMQTzA+U6mBPF+R9AXpetC5SkRl5v55fwwqfJ16Ass3MXdG2WgMptHnFh
y9DbKT80ONffL9vBktMJwnNSgaQHX1Xjhw7LTO/pq9yvuLpGcsJe6bbISpgb88Bl
e99z+i/BNxo0F9GyvrxEk8ouTdct+EYMH3adbgDCIm6y6oKf5tIgfENvXhrG6i8i
+TBzbf1/CCyraif5CxeK1g1hrttah9P1OW/l3+CEeSolKfOUAKPGrkdiXPeVGlsq
p7MWbpZAlI3sMcBWupd40G47VXg7cM1RLPsgcDHDu8S8bs0u5SbMM9hpJlys+sTX
m0S25uPbDmGI9sEgdA3FR1xMTMgWP7Ps9/mR45a93bHSsRZMuyrwpBkTQBBIXY10
FjKIZCyJlwCTGugJhBcmBH0iV13CQuP/V35xL5aXrc+KHzy6zV7mIu9l9V0+//kZ
RRFtCchcmYqiSL1U5rtp7mB5JrlvCnhU82x3k4+ALiLX4pE3vnQtGd6kSEtNLy3e
y7uc2xPUtmV0zzas6/d4g1EssEuLJifjXCGcQPABy2ypxYHq0H4=
=5OEr
-----END PGP SIGNATURE-----

?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 69950@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 69950
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch