unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 24.3.50; `called-interactively-p' over the top
@ 2012-12-05  0:25 Drew Adams
  2012-12-05  0:46 ` Drew Adams
  0 siblings, 1 reply; 2+ messages in thread
From: Drew Adams @ 2012-12-05  0:25 UTC (permalink / raw)
  To: emacs-devel

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'




^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: 24.3.50; `called-interactively-p' over the top
  2012-12-05  0:25 24.3.50; `called-interactively-p' over the top Drew Adams
@ 2012-12-05  0:46 ` Drew Adams
  0 siblings, 0 replies; 2+ messages in thread
From: Drew Adams @ 2012-12-05  0:46 UTC (permalink / raw)
  To: emacs-devel

It's worse than I thought.  It doesn't even do any good to load
the *.el of my library with the defadvice.  Advice fails with
the same backtrace.  Seems to be an Emacs bug: #13085.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-05  0:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-05  0:25 24.3.50; `called-interactively-p' over the top Drew Adams
2012-12-05  0:46 ` Drew Adams

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).