[Top][All Lists]

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

defadvice and keyboard macro

From: Roland Winkler
Subject: defadvice and keyboard macro
Date: Sun, 11 Mar 2001 12:49:22 +0100

In GNU Emacs 20.4.1 (i686-pc-linux-gnu, X toolkit)
 of Fri Oct 29 1999 on tfkp02
configured using `configure  --prefix=/nfs/common --libexecdir=/nfs/common/lib 
--bindir=/nfs/common/lib/emacs/bin/i686-Linux --with-gcc --with-pop --with-x 

Start a fresh emacs --no-init-file
Load the following piece of emacs lisp code

(defadvice other-window (after reread-file activate)
  "Check wether the corresponding file has changed on disk."

(defun reread-file ()
  "Reread file of current buffer if file has changed on disk."
  ;; Something similar to revert-buffer
  (if (and buffer-file-name
           (file-exists-p buffer-file-name)
           (not (verify-visited-file-modtime (current-buffer))))
      (find-file buffer-file-name)))

;; define kbd macro `other-window'
(fset 'foo "\C-xo")

Now open two files (the second one with find-file-other-window so
that other-window makes sense).

Now switching buffers with other-window (C-x o) works fine.
But the kbd macro foo which should be doing the same gives the error

After 0 kbd macro iterations: Wrong type argument: integerp, nil

The same problem occurs with GNU Emacs 20.6.1
(sparc-sun-solaris2.6, X toolkit).

What's wrong here?? I wasn't able to extract any helpful information
from the debugger.


reply via email to

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