I've get emacs 25 build ppa taken from this ask ubuntu answer
and I have this functions and macro:
(defun remove-lambda-helper (list matcher) "function that remove lambda from a list if match the function `matcher'" (dolist (item list list) (if (and (listp item) (eq (car item) 'lambda)) (when (funcall matcher item) (setq list (delete item list)))))) (defun remove-project-specifics-lambda (name hook) "Remove lambda from a hook that have code from `project-specifics'" (set hook (remove-lambda-helper (symbol-value hook) (lambda (body) (equal (cadr (cadr (caddr body))) name))))) (defmacro project-specifics (name &rest body) (declare (indent 1)) (let ((item (gensym))) `(progn (remove-project-specifics-lambda ,name 'find-file-hook) (remove-project-specifics-lambda ,name 'dired-after-readin-hook) (add-hook 'find-file-hook (lambda () (when (string-match-p ,name (buffer-file-name)) ,@body))) (add-hook 'dired-after-readin-hook (lambda () (when (string-match-p ,name (dired-current-directory)) ,@body))))))
and I got error (the macro works fine in 24.5.1):
Debugger entered--Lisp error: (void-variable dired-after-readin-hook)
if I try C-h v dired-after-readin-hook, I got
was that hook removed or replaced with different one? I know that I can use directory specific file, but I want my macro to work, anybody know why this return error?