all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Thierry Volpiatto <thierry.volpiatto@gmail.com>, 17446@debbugs.gnu.org
Subject: bug#17446: 24.4.50; What is the situation around `called-interactively-p'?
Date: Fri, 9 May 2014 06:39:06 -0700 (PDT)	[thread overview]
Message-ID: <f4be7ec5-4918-4e67-9569-13912b09296a@default> (raw)
In-Reply-To: <87tx8z6sp2.fsf@gmail.com>

> I recently had to use `called-interactively-p-functions' to fix a
> command similar to `repeat-complex-command'.
> I used similar hack than the one found in `repeat-complex-command',
> but as mentionned in `called-interactively-p' this is not working with
> code compiled (I use lexical-binding), thus `dont-compile' have been
> made obsolete.
> 
> So what to do actually to fix such issues ?
> 
> Do you plan to make something better around the terrible
> `called-interactively-p' ?
> 
> What about a special var to force `called-interactively-p' to return
> true when it find this var (Actually this is crashing emacs) ?
> 
> It seems the only reason `dont-compile' have been made obsolete is
> to force people fixing their code to make it working compiled;
> That's ok, but what to do when nothing else is possible ?
> IOW why is this obsolete ?
> 
> Ref: https://github.com/emacs-helm/helm/issues/489

FWIW (I think this is related; apologies if not), this is what
I did:

;; Same as `repeat-complex-command--called-interactively-skip'
;; in `simple.el', but tests for `icicle-repeat-complex-command',
;; not `repeat-complex-command'.
(when (> emacs-major-version 23)

  (defun icicle-repeat-complex-command--called-interactively-skip
         (i _frame1 frame2)
    "If currently `icicle-repeat-complex-command', return 1 to skip over it."
    (and (eq 'eval (cadr frame2))
         (eq 'icicle-repeat-complex-command
             (cadr (backtrace-frame i #'called-interactively-p)))
         1))

  (byte-compile 'icicle-repeat-complex-command))

The reason for the `byte-compile' is that I found that it does
not work when interpreted.  (That seems opposite to what you are
saying (?).  I do not have non-nil `lexical-binding', however.)

I agree that this all seems complicated & fragile.  Dunno what
the solution is.





  reply	other threads:[~2014-05-09 13:39 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09 12:29 bug#17446: 24.4.50; What is the situation around `called-interactively-p'? Thierry Volpiatto
2014-05-09 13:39 ` Drew Adams [this message]
2014-05-09 14:11   ` Michael Heerdegen
2014-05-09 14:47     ` Drew Adams
2014-05-09 14:17   ` Drew Adams
2014-05-09 14:15 ` Stefan Monnier
2014-05-09 14:28   ` Drew Adams
2014-05-09 14:50     ` Stefan Monnier
2014-05-09 14:55       ` Drew Adams
2014-05-09 15:15         ` Michael Heerdegen
2014-05-09 17:53           ` Stefan Monnier
2014-05-09 18:47             ` Thierry Volpiatto
2014-05-09 19:50               ` Stefan Monnier
2014-05-09 21:02                 ` Stefan Monnier
2014-05-09 22:39                   ` Stefan Monnier
2014-05-09 23:34                     ` Drew Adams
2014-05-10  2:13                       ` Stefan Monnier
2014-05-10  9:10                       ` Thierry Volpiatto
2014-05-10  6:12                     ` Thierry Volpiatto
2014-05-10  7:40                     ` Michael Heerdegen
2014-05-10  8:41                       ` Thierry Volpiatto
2014-05-10  5:51                   ` Thierry Volpiatto
2014-05-10  6:45                     ` Stefan Monnier
2014-05-10  8:06                       ` Thierry Volpiatto
2014-05-10 20:15                         ` Stefan Monnier
2014-05-11  4:24                           ` Michael Heerdegen
2014-05-11  5:58                             ` Michael Heerdegen
2014-05-17 18:01                               ` Michael Heerdegen
2014-05-18  1:56                                 ` Stefan Monnier
2014-05-11  6:02                             ` Stefan Monnier
2014-05-11  4:31                           ` Thierry Volpiatto
2014-05-10 10:22                       ` Andreas Röhler
2014-05-10 20:19                         ` Stefan Monnier
2014-05-11  7:47                           ` Andreas Röhler
2014-05-10  3:43                 ` Thierry Volpiatto
2017-03-25  6:23                 ` npostavs
2014-05-09 19:16             ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f4be7ec5-4918-4e67-9569-13912b09296a@default \
    --to=drew.adams@oracle.com \
    --cc=17446@debbugs.gnu.org \
    --cc=thierry.volpiatto@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.