GNU bug report logs -
#69573
Eager macro-expansion failure: (wrong-type-argument integer-or-marker-p nil)
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Tue, 26 Mar 2024 03:34:46 -0400
with message-id <yp1edbxqwdl.fsf <at> fencepost.gnu.org>
and subject line Re: bug#69573: Eager macro-expansion failure: (wrong-type-argument integer-or-marker-p nil)
has caused the debbugs.gnu.org bug report #69573,
regarding Eager macro-expansion failure: (wrong-type-argument integer-or-marker-p nil)
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
69573: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69573
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
Hi,
I have this code:
|(defun make-search-sensitive-to-ifpmod-advice (orig-fun &rest args)
"Temporary advice the search functions to make them sensitive to
`isearch-filter-predicate'" (let ((POINT (point))) (catch 'filtered
(while (apply orig-fun args) (let ((B (match-beginning 0)) (E (match-end
0))) ;; 1 - If all points in the region that matches the search ;; from
the previous "search-command" meet the criteria ;; accepted by the
filter, then the loop stops (`throw') and ;; returns the position
`(point)`: (when (funcall isearch-filter-predicate B E) (throw 'filtered
(point))))) ;; 2 - If the search is unsuccessful, or does not meet ;;
the criteria accepted by the filter, then return to the ;; starting
position and return the value `nil'. (goto-char POINT) nil))) |
|(defalias 'search-forward-ifpmod (symbol-function 'search-forward)
"Copy of `search-forward' function (to be) adviced to obey to
`isearch-filter-predicate'") (advice-add 'search-forward-ifpmod :around
#'make-search-sensitive-to-ifpmod-advice) (defalias
're-search-forward-ifpmod (symbol-function 're-search-forward) "Copy of
`re-search-forward' function (to be) adviced to obey to
`isearch-filter-predicate'") (defalias 'search-forward-regexp-ifpmod
're-search-forward-ifpmod) ;; The following breaks my minor-modes
definitions (advice-add 're-search-forward-ifpmod :around
#'make-search-sensitive-to-ifpmod-advice) |
I found that this particular code snippet:
|(advice-add 're-search-forward-ifpmod :around
#'make-search-sensitive-to-ifpmod-advice) |
breaks my minor-modes definitions. E.g. if I evaluate the code above and
later on the following code (MWE):
|(defun mwe-function-1 () "MWE function 1" (interactive) (message
"function 1 executed")) (define-minor-mode mwe-mode "MWE mode"
:init-value nil :lighter (:eval (propertize " MWE " 'face '(:foreground
"RoyalBlue" :background "DarkGoldenrod1"))) :keymap `( (,(kbd
"<C-kp-1>") . mwe-function) ) (if mwe-mode (easy-menu-define mwe-menu
mwe-mode-map "MWE" '("MWE mode" ;; I want the menu on mode-line only:
:visible (not (eq (framep (selected-frame)) 'x)) ["mwe-function-1"
mwe-function-1 :help "mwe-function 1"] )) t)) |
I get this error:
internal-macroexpand-for-load: Eager macro-expansion failure:
(wrong-type-argument integer-or-marker-p nil)
Step to reproduce the error:
1. |emacs -Q|
2. Evalute the |add-advice| code
3. Evalute my minor-mode definiton
Did I make a mistake in the |add-advice| usage or is it a bug?
Best regards,
Gabriele Nicolardi
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
Andrea Corallo <acorallo <at> gnu.org> writes:
> Gabriele Nicolardi <gabriele <at> medialab.sissa.it> writes:
>
>> Il 15/03/24 14:52, Andrea Corallo ha scritto:
>>
>> kay I've installed 00553628558 into master, I believe it does what we
>> want and seems to fix the minimal reproducer I made from the original
>> example.
>>
>> Gabriele could you check it solves the issue for you?
>>
>> I confirm that the version compiled from master resolves my issue.
>>
>> Thank you!
>>
>> Gabriele
>
> Very cool. I'll keep this bug open a bit just so we remeber to
> re-evaluate the backport.
Okay backported the fix to emacs-29. I'm closing this.
Thanks
Andrea
This bug report was last modified 1 year and 119 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.