GNU bug report logs - #10624
24.0.92; default value of `dired-do-ch*'

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Fri, 27 Jan 2012 15:37:01 UTC

Severity: minor

Found in version 24.0.92

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


Message #53 received at 10624 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: 10624 <at> debbugs.gnu.org
Subject: Re: bug#10624: Dired-marking all files in the region
Date: Thu, 22 Nov 2012 10:40:36 -0500
> is to add an `interactive' arg (there were some reasons not to use
> (called-interactively-p 'interactive) but I forgot the exact reasons).

One of the main reasons is reliability.  If you look at the code of
called-interactively-p, you'll see it's pretty hackish, so it's easy to
break it.  For example `called-interactively-p' may fail to work correctly
in the following known cases:
- when the function is advised (this was recently improved, so it will
  now fail sometimes rather than always).
- when inside a condition-case or catch in lexical-binding code.
- when inside a `pcase' branch (because pcase sometimes moves the
  branch to a lambda in order to avoid duplicating the code).

Another reason is that it makes it more flexible for non-interactive
callers, which can control whether to run the function "as if the
arguments had been provided interactively".

`called-interactively-p' is handy when you can't add an argument, but
otherwise it's much better to add an `interactive' argument.


        Stefan




This bug report was last modified 12 years and 181 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.