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

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

Re: flet is obsolete, but...


From: Jambunathan K
Subject: Re: flet is obsolete, but...
Date: Thu, 11 Oct 2012 13:47:34 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

"Sebastien Vauban"
<address@hidden> writes:

> Hi Jambunathan,
>
> Jambunathan K wrote:
>>> `flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'.
>>>
>>> But doing so in the following code:
>>>
>>>   (defun my/revert-buffer ()
>>>     "Unconditionally revert current buffer."
>>>     (interactive)
>>>     (flet ((yes-or-no-p (msg) t))
>>>       (revert-buffer)))
>>>
>>> does not lead to the right things:
>>> What should I do?
>>
>> Use the NOCONFIRM argument of revert-buffer.
>
> I tried another way:
>
>
>   (defun my/revert-buffer ()
>     "Unconditionally revert current buffer."
>     (interactive)
>     (let ((revert-without-query t))
>       (revert-buffer)))
>
>
> but I don't understand why it does not work:
>
> --8<---------------cut here---------------start------------->8---
> Debugger entered--Lisp error: (wrong-type-argument listp t)
>   byte-code("address@hidden   \"\203
>

listp in above Lisp error gives a clue that a list is expected.

A describe variable confirms that it is indeed a list regexes.  Regex is
a Emacs regex and NOT a shell-regex.

,----[ C-h v revert-without-query RET ]
| revert-without-query is a variable defined in `files.el'.
| Its value is nil
| 
| Documentation:
| Specify which files should be reverted without query.
| The value is a list of regular expressions.
| If the file name matches one of these regular expressions,
| then `revert-buffer' reverts the file without querying
| if the file has changed on disk and you have not edited the buffer.
| 
| You can customize this variable.
| 
| [back]
`----


-- 



reply via email to

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