help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hijack C function, use it transparently with in-between layer


From: Barry Margolin
Subject: Re: hijack C function, use it transparently with in-between layer
Date: Mon, 06 Jun 2016 03:32:42 -0400
User-agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)

In article <868tyjnghn.fsf@student.uu.se>,
 Emanuel Berg <embe8573@student.uu.se> wrote:

> The truth is down there!
> 
> (defvar old-message)
> (fset 'old-message (symbol-function #'message))
> 
> (defun message (format-string &rest args)
>   (unless (member format-string
>                   '(
>                     "It was just another system of control."
>                     "Mark set"
>                     ))
>       (apply `(old-message ,format-string ,@args) )))
> 
> ;; test:
> ;;
> ;;  (message "%s - %s" "1" "2")
> ;;  (message "Break on thru to the other side.")
> ;;  (message "It was just another system of control.")
> ;;  (message "Mark set")

Shouldn't you do this using advice?

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


reply via email to

[Prev in Thread] Current Thread [Next in Thread]