all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#69573: Eager macro-expansion failure: (wrong-type-argument integer-or-marker-p nil)
@ 2024-03-05 23:53 Gabriele Nicolardi
  2024-03-06  0:31 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 25+ messages in thread
From: Gabriele Nicolardi @ 2024-03-05 23:53 UTC (permalink / raw)
  To: 69573

[-- Attachment #1: Type: text/plain, Size: 2554 bytes --]

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

​

[-- Attachment #2: Type: text/html, Size: 12408 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2024-03-26  7:34 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-05 23:53 bug#69573: Eager macro-expansion failure: (wrong-type-argument integer-or-marker-p nil) Gabriele Nicolardi
2024-03-06  0:31 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-06  5:16   ` Gabriele Nicolardi
2024-03-07  2:52     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-07  5:55       ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-07 16:26         ` Gabriele Nicolardi
2024-03-09  4:30           ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-09 14:47             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-09 21:41               ` Andrea Corallo
2024-03-09 21:48                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-15 13:52                   ` Andrea Corallo
2024-03-15 14:36                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-15 16:22                     ` Gabriele Nicolardi
2024-03-15 16:58                       ` Andrea Corallo
2024-03-17  9:30                         ` Gabriele Nicolardi
2024-03-15 17:24                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-17  9:33                         ` Gabriele Nicolardi
2024-03-18  9:35                           ` Andrea Corallo
2024-03-18 17:28                     ` Gabriele Nicolardi
2024-03-18 19:42                       ` Andrea Corallo
2024-03-26  7:34                         ` Andrea Corallo
2024-03-09  4:33           ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-09  7:14             ` Gabriele Nicolardi
2024-03-06  5:42   ` Gabriele Nicolardi
2024-03-07  3:15     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors

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.