[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: switch-to-buffer: for interactive use only
From: |
Štěpán Němec |
Subject: |
Re: switch-to-buffer: for interactive use only |
Date: |
Thu, 07 Jul 2011 11:19:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Chong Yidong <address@hidden> writes:
> Stefan Monnier <address@hidden> writes:
>
>>> Was it really necessary to mark switch-to-buffer "for interactive use
>>> only"? It's a pretty basic command that was used in ~ 800 places in the
>>> Emacs 23.3 sources.
>>
>> Most of those calls were bugs waiting to catch you in Emacs<23 ("you"
>> being typically a user like myself who uses dedicated windows and/or
>> minibuffer-only frames).
>
> How would you change this?
>
> (defun unbury-buffer ()
> "Switch to the last buffer in the buffer list."
> (interactive)
> (switch-to-buffer (last-buffer)))
FWIW, I don't have an opinion on whether marking `switch-to-buffer'
interactive-only makes sense or not, but I don't think the above is a
valid argument either way -- the fact that a function is marked
interactive only (and a compiler warning is produced) does IMO not mean
there are no valid uses from Lisp code -- there are cases where the
interactive behaviour is precisely what you want, and the function above
is one such example. It's similar to using commands like `next-line' or
`beginning-of-buffer' from another command that e.g. functions as a
dispatcher among multiple commands or only slightly modifies the
interactive behaviour (e.g. by fixing one of the arguments, as is the
case with your function).
Štěpán
- switch-to-buffer: for interactive use only, Glenn Morris, 2011/07/05
- Re: switch-to-buffer: for interactive use only, Juanma Barranquero, 2011/07/05
- Re: switch-to-buffer: for interactive use only, Stefan Monnier, 2011/07/05
- Re: switch-to-buffer: for interactive use only, Glenn Morris, 2011/07/05
- Re: switch-to-buffer: for interactive use only, Chong Yidong, 2011/07/06
- Re: switch-to-buffer: for interactive use only,
Štěpán Němec <=
- Re: switch-to-buffer: for interactive use only, Stefan Monnier, 2011/07/07
- Re: switch-to-buffer: for interactive use only, Chong Yidong, 2011/07/07
- Re: switch-to-buffer: for interactive use only, Stefan Monnier, 2011/07/07
- Re: switch-to-buffer: for interactive use only, Chong Yidong, 2011/07/07
- Re: switch-to-buffer: for interactive use only, Juanma Barranquero, 2011/07/07
- Re: switch-to-buffer: for interactive use only, Chong Yidong, 2011/07/07
- Re: switch-to-buffer: for interactive use only, martin rudalics, 2011/07/08
- Re: switch-to-buffer: for interactive use only, martin rudalics, 2011/07/08
- Re: switch-to-buffer: for interactive use only, martin rudalics, 2011/07/08
- Re: switch-to-buffer: for interactive use only, Stefan Monnier, 2011/07/08