unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <emacs-devel@gnu.org>
Subject: 24.3.50; `called-interactively-p' over the top
Date: Tue, 4 Dec 2012 16:25:38 -0800	[thread overview]
Message-ID: <67D3B89782484E29BBCC4E39F15B8065@us.oracle.com> (raw)

Debugger entered--Lisp error: (invalid-function
internal--called-interactively-p--get-frame)
  internal--called-interactively-p--get-frame(8)
  #[771 "..." [internal--called-interactively-p--get-frame] 6 "\n\n(fn FRAME1
FRAME2 I)"](((t apply ad-Advice-narrow-to-region #<subr narrow-to-region> (3980
6800))) ((t apply ad-Advice-narrow-to-region #<subr narrow-to-region> (3980
6800))) (8))
  advice--called-interactively-skip(8 (t ad-Advice-narrow-to-region #<subr
narrow-to-region> 3980 6800) (t apply ad-Advice-narrow-to-region #<subr
narrow-to-region> (3980 6800)))
  run-hook-with-args-until-success(advice--called-interactively-skip 8 (t
ad-Advice-narrow-to-region #<subr narrow-to-region> 3980 6800) (t apply
ad-Advice-narrow-to-region #<subr narrow-to-region> (3980 6800)))
  called-interactively-p(interactive)
  interactive-p()
  (or (interactive-p) wide-n-push-anyway-p)
  (if (or (interactive-p) wide-n-push-anyway-p) (progn (wide-n-push start end)))
  (when (or (interactive-p) wide-n-push-anyway-p) (wide-n-push start end))
  (let (ad-return-value) (when (or (interactive-p) wide-n-push-anyway-p)
(wide-n-push start end)) (setq ad-return-value (with-no-warnings (funcall
ad--addoit-function start end))) ad-return-value)
  ad-Advice-narrow-to-region(#<subr narrow-to-region> 3980 6800)
  apply(ad-Advice-narrow-to-region #<subr narrow-to-region> (3980 6800))
  narrow-to-region(3980 6800)
  call-interactively(narrow-to-region nil nil)

The code that led to this is the following, from my library `wide-n.el':

(defadvice narrow-to-region
  (before push-wide-n-restrictions activate)
  "Push the region limits to `wide-n-restrictions'.
You can use `C-x n x' to widen to a previous buffer restriction."
  (when (or (interactive-p)  wide-n-push-anyway-p)
    (wide-n-push (ad-get-arg 0) (ad-get-arg 1))))

I byte-compiled this code in Emacs 21 and executed it in Emacs 24.  I
want to be able to use the same *.elc in 21, 22, 23, and 24.  I
typically byte-compile a library in the lowest Emacs version that the
library itself supports.  (In the case of Emacs 22/23 I sometimes
compile it in 23 - that has proven good for compatibility.)

It is really a shame that Emacs Dev seems to be plugging more and more
new macros into basic functions like this.

I haven't looked closely at the code, but I cannot imagine why
`called-interactively-p' (latter-day replacement for `interactive-p')
needs to generate code that adds a defvar for `base-index' with a
different default value each time.  Are you sure you are not
overengineering this?

It has for a long time been possible to get a fair amount of forward
compatibility among Emacs versions.  Up through Emacs 24.2, I would say.

Generally, unless one tried to take advantage of new features not
available in an older release, there was little or no problem.  No more,
it seems.  Emacs Dev seems to add new macros and use them willy nilly at
all levels.  The last one I ran into was not used in such a basic
function, at least.

Doing this for something used as often as `called-interactively-p'
effectively ensures that there will be no compatibility forward to Emacs
24 from any prior version.

Poor Emacs (users).

Trying to work around this would in effect mean either adding such macro
definitions to one's own Lisp code, even when not needed for older
supported Emacs versions, or maintaining multiple directories of one's
Emacs Lisp code for different Emacs versions and loading different *.elc
for the different Emacs versions.  Or not byte-compiling it...

I doubt that Emacs Dev would tolerate jumping through such hoops
themselves, if they too maintained code that supports multiple versions.

Seems sometimes like your idea of Emacs users does not include the
notion that they might also use Emacs Lisp - a not too emacsy point of
view, IMHO.  (I say that it _seems_ like that sometimes.)

In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2012-12-03 on MS-W7-DANI
Bzr revision: 111077
agustin.martin@hispalinux.es-20121203172342-ifsebjmhksk28qa9
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -Ic:/emacs/libs/libXpm-3.5.10/include -Ic:/emacs/libs/libXpm-3.5.10/src
 -Ic:/emacs/libs/libpng-1.2.37-lib/include -Ic:/emacs/libs/zlib-1.2.5
 -Ic:/emacs/libs/giflib-4.1.4-1-lib/include
 -Ic:/emacs/libs/jpeg-6b-4-lib/include
 -Ic:/emacs/libs/tiff-3.8.2-1-lib/include
 -Ic:/emacs/libs/libxml2-2.7.8-w32-bin/include/libxml2
 -Ic:/emacs/libs/gnutls-3.0.9-w32-bin/include
 -Ic:/emacs/libs/libiconv-1.9.2-1-lib/include'




             reply	other threads:[~2012-12-05  0:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-05  0:25 Drew Adams [this message]
2012-12-05  0:46 ` 24.3.50; `called-interactively-p' over the top 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=67D3B89782484E29BBCC4E39F15B8065@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).