2

Yesterday I found desktop mode from EmacsWiki, and then I configure it for my Emacs 24:

;; Desktop
(require 'desktop)

;; save the desktop file automatically if it already exists
(desktop-save-mode 1)

;; use only one desktop
(setq desktop-path '("~/.emacs.d/tmp/"))
(setq desktop-dirname "~/.emacs.d/tmp/")
(setq desktop-base-file-name "desktop.cache")

But I got a warning in *Compile-Log* buffer when I restart Emacs:

Warning: ad-Orig-kill-region called with 3 arguments, but accepts only 2

Anyone else encounter this warning when use desktop? Or, any add-ons else better than desktop-mode?

1 Answer 1

2

The ad-Orig- prefix is telling you that the function kill-region is advised. Possibly that advice is causing issues?

C-hf kill-region RET should tell you the name of the advice; chances are good that it's something in your own config, so I would look for it there firstly.

See if disabling the advice resolves the problem.

I do note an oddity with this function in Emacs 24; the source code for kill-region clearly takes an optional third argument, but that *Help* screen mentions only the two required args.

I checked in Emacs 23, and the help there mentions all three arguments.

Perhaps there's a bug in Emacs 24 which is responsible for both the discrepancy in the help output, and the error you're seeing?

5
  • You are right, It seems to be a bug in Emacs 24. I copy a desktop session file and then restart Emacs, Emacs24 log the warning while the Emacs23 doesn't. But I haven't find the advise to be disabling.
    – hbin
    May 1, 2012 at 6:51
  • I have the same behavior with ErgoEmacs keybinding package, which includes "before-advice slick-copy" with kill-region. May 1, 2012 at 7:03
  • 1
    Evaluate (ad-deactivate 'kill-region) (checking C-h f kill-region RET should confirm it is no longer advised), and then see if the error persists.
    – phils
    May 1, 2012 at 7:17
  • Great!! No warning any more, Thank you very much.
    – hbin
    May 2, 2012 at 5:12
  • You're welcome, but do note that deactivating the advice should only be considered a temporary workaround, and you should follow it up further. Either the library defining that advice needs to be updated to be compatible with Emacs 24, or there really is a bug in Emacs itself. You should probably start by contacting the library author. You can report Emacs bugs with M-x report-emacs-bug.
    – phils
    May 2, 2012 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.