all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#18139: 24.4.50; called-interactively-p and skip advice:
@ 2014-07-29  1:58 raman
  2014-07-30  0:08 ` Glenn Morris
  2014-08-01 16:12 ` raman
  0 siblings, 2 replies; 8+ messages in thread
From: raman @ 2014-07-29  1:58 UTC (permalink / raw)
  To: 18139

Hi,

I've used a check of the form 
(when (interactive-p) ...)
within advice forms in emacspeak to speak *if and only if* a
command i

is  called  by the user -- as opposed from within other lisp
functions. When we transitioned to Emacs 24, I replaced that
check with (when (called-interactively-p 'interactive) ..)
and this has again worked without any issues --- until now.

We're seeing a  problem now in ruby-mode when command
electric-newline-and-maybe-indent is invoked -- that function for
ruby-mode goes through a complex dance with smie-next-sexp.

The long and short of it is that we eventually deadlock within a
call to advice--called-interactively-skip -- the comments in
nadvice.el where that function is implemented looks pretty scary.

What emacspeak really needs is a clean way of checking whether
something is called interactively, and this is the f first time
in 20 years that the test is failing.

For now, the only fix  I  have is to avoid the electric newline
insertion in ruby-mode -- but the comments in nadvice.el make me
worry that this will fail in the case of  other around advices --
that said, there are lots of cases where it works, this is the
only failure case for now.

--Raman 


In GNU Emacs 24.4.50.2 (i686-pc-linux-gnu, GTK+ Version 2.16.1)
 of 2014-06-24 on labrador
Repository revision: %N
System Description:	Ubuntu 9.04

Configured using:
 `configure --prefix=/usr/local --without-compress-install'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF
NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE XFT ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Shell

Minor modes in effect:
  recentf-mode: t
  gpm-mouse-mode: t
  global-semantic-idle-summary-mode: t
  global-semanticdb-minor-mode: t
  semantic-mode: t
  savehist-mode: t
  ido-everywhere: t
  display-time-mode: t
  auto-insert-mode: t
  jabber-activity-mode: t
  jabber-mode-line-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  dynamic-completion-mode: t
  dired-omit-mode: t
  desktop-save-mode: t
  dirtrack-procfs-mode: t
  global-voice-lock-mode: t
  voice-lock-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Recent input:
C-p C-e e DEL DEL ) C-n C-n C-n m ESC m ESC m C-p ESC 
m C-n C-p ESC C-a C-s d e f a ESC < C-s d e f a ESC 
m ESC m ESC C-q C-x C-g C-n C-n C-n C-p C-e e ESC b 
ESC d w h e n ESC DEL w h e n SPC C-n ESC m C-d ESC 
m ESC ^ C-n C-n ESC m C-k C-p C-n C-n C-p C-p C-x C-o 
C-n C-e e ) ) ) C-x C-e C-x @ h s c d RET C-x b / t 
m RET C-g C-x @ h s c d RET c d SPC / t m TAB RET C-x 
C-f t e s t . RET ESC M ESC x d DEL a d SPC d i s TAB 
a d TAB RET b C-x @ h s ESC x a d SPC d i s TAB a d 
TAB RET b a c k w TAB s e x TAB RET a r o u TAB RET 
RET C-e m ESC [ [ C ESC < ESC m C-d ESC m C-e e C-j 
C-e m ESC m ESC < ESC x t o g g l TAB d e TAB RET q 
TAB RET ESC m C-e C-e C-j ESC < C-n C-n C-n C-n C-e 
m q ESC x ESC p RET C-x @ h s c d RET C-x C-g ESC x 
C-g C-e m C-e ; m C-x @ h s c d RET c d RET c d SPC 
s o u TAB e m a c s RET . / b u i l d RET C-e m ESC 
x r e p o r t SPC e m a TAB RET

Recent messages:
Making completion list...
Debug on Quit enabled globally
Turned t debug on quit
Entering debugger...
Back to top level.
Debug on Quit disabled globally
Turned nil debug on quit
C-x C-g is undefined
Quit  [2 times]
End of buffer 

Load-path shadows:
/home/raman/emacs/lisp/site-lisp/vm/lisp/tapestry hides /home/raman/emacs/lisp/emacspeak/lisp/tapestry
/home/raman/emacs/lisp/emacspeak/lisp/tetris hides /usr/local/share/emacs/24.4.50/lisp/play/tetris
/home/raman/.emacs.d/elpa/emms-20140630.1158/tq hides /usr/local/share/emacs/24.4.50/lisp/emacs-lisp/tq

Features:
(shadow emacsbug amixer recentf tree-widget debug emacspeak-ruby
ruby-mode smie ffap tramp-cache tramp tramp-compat tramp-loaddefs
trampver pcmpl-unix semantic/db-file data-debug cedet-files
semantic/bovine/c semantic/decorate/include
semantic/decorate/mode semantic/decorate pulse hideif
semantic/bovine/c-by semantic/lex-spp semantic/bovine/gcc
semantic/dep semantic/bovine semantic/analyze/refs
semantic/db-find semantic/db-ref semantic/analyze semantic/sort
semantic/scope semantic/analyze/fcn cc-langs emacspeak-c cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs eieio-opt emacspeak-speedbar speedbar sb-image
dframe misearch multi-isearch vm-virtual vm-delete tapestry
vm-rfaddons vm-menu vm-window vm-toolbar vm-mouse vm-page
vm-minibuf emacspeak-vm vm emacspeak-wizards emacspeak-eterm term
ehelp emacspeak-texinfo texinfo emacspeak-table-ui
emacspeak-table emacspeak-find-dired find-dired eldoc lisp-mnt
t-mouse cal-china lunar cal-bahai cal-islam cal-hebrew holidays
hol-loaddefs gcal g-app g-auth mule-util cal-move server bbdb-vm
vm-mime vm-folder vm-summary vm-motion vm-undo vm-misc bbdb-snarf
mail-extr bbdb-com emacspeak-reftex reftex reftex-vars
Save-visited-files-autoloads emacspeak-auctex tex-site
color-theme-autoloads finder-inf gopher-autoloads emacspeak-info
info memory-usage-autoloads slime-repl-autoloads slime-autoloads
ssh-config-mode-autoloads package emacs-startup semantic/idle
semantic/format ezimage semantic/tag-ls semantic/find
semantic/ctxt semantic/db-mode semantic/db eieio-base saveplace
midnight emacspeak-cedet semantic/util-modes semantic/util
semantic semantic/tag semantic/lex semantic/fw mode-local cedet
savehist emacspeak-ido ido emacspeak-m-player time autoinsert
emacspeak-twittering twittering-mode epa epg ssl emacspeak-jabber
jabber jabber-libnotify jabber-awesome jabber-osd jabber-wmii
jabber-xmessage jabber-festival jabber-sawfish jabber-ratpoison
jabber-tmux jabber-screen jabber-socks5 jabber-ft-server
jabber-si-server jabber-ft-client jabber-ft-common
jabber-si-client jabber-si-common jabber-feature-neg
jabber-truncate jabber-time jabber-autoaway jabber-vcard-avatars
jabber-chatstates jabber-events jabber-vcard jabber-avatar
jabber-activity jabber-watch jabber-modeline jabber-ahc-presence
jabber-ahc jabber-version jabber-ourversion
jabber-muc-nick-completion hippie-exp jabber-browse jabber-search
jabber-register jabber-roster jabber-presence jabber-muc
jabber-bookmarks jabber-private jabber-muc-nick-coloring hexrgb
jabber-widget jabber-disco jabber-chat jabber-history
jabber-chatbuffer jabber-alert jabber-iq jabber-core
jabber-console emacspeak-sgml-mode sgml-mode ewoc jabber-keymap
jabber-sasl sasl sasl-anonymous sasl-login sasl-plain fsm
jabber-logon jabber-conn srv dns starttls gnutls jabber-xml
jabber-menu jabber-util jabber-autoloads erc-list erc-menu
erc-join erc-ring erc-networks erc-pcomplete erc-track erc-match
erc-button erc-fill erc-stamp erc-netsplit emacspeak-erc
erc-goodies erc erc-backend erc-compat pp emacspeak-org org
org-macro org-footnote org-pcomplete org-list org-faces
org-entities emacspeak-outline foldout noutline outline
easy-mmode org-version ob-emacs-lisp ob ob-tangle org-src ob-ref
ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval
org-compat org-macs org-loaddefs emacspeak-find-func find-func
emacspeak-calendar appt diary-lib diary-loaddefs solar cal-dst
cal-menu calendar cal-loaddefs emacspeak-tcl tcl
emacspeak-folding folding w3-prepare w3 w3-menu w3-emulate
w3-auto w3-parse w3-fast-parse emacspeak-w3 emacspeak-google
html2text gmaps emacspeak-we emacspeak-xslt w3-display w3-mouse
w3-imap url-handlers w3-widget w3-vars w3-keymap w3-cus css font
disp-table devices ange-ftp w3-cfg w3-compat emacspeak-sigbegone
sigbegone emacspeak-custom cus-edit cus-start smtpmail sendmail
gnus-prepare gnus-demon nntp emacspeak-gnus gm-nnir nnir gnus-art
mm-uu mml2015 epg-config mm-view mml-smime smime dig gnus-sum
gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail
mail-source tls utf7 netrc nnoo parse-time gnus-spec gnus-int
gnus-range emacspeak-message message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win
emacspeak-hide gnus gnus-ems nnheader mail-utils
emacspeak-mspools mspools emacspeak-bbdb bbdb timezone
bbdb-autoloads vm-pine vm-macro vm-message vm-autoloads vm-vars
vm-version my-functions completion dired-aux dired-x
emacspeak-dired emacspeak-desktop desktop frameset dired
emacspeak-aumix emacspeak-forms forms-mode forms emacspeak-setup
emacspeak-dbus nm dbus xml emacspeak-webspace emacspeak-feeds
emacspeak-webutils browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
url-parse auth-source eieio eieio-core gnus-util mm-util
mail-prsvr password-cache url-vars mailcap gf gweb gfeeds g-utils
json emacspeak-alsaplayer emacspeak-amark derived
emacspeak-advice shell pcomplete comint ring emacspeak-ansi-color
ansi-color emacspeak-replace emacspeak-redefine
emacspeak-personality emacspeak emacspeak-widget warnings
wid-edit emacspeak-facemenu emacspeak-fix-interactive
emacspeak-buff-menu g-cus-load cus-load emacspeak-preamble
emacspeak-keymap emacspeak-speak time-date emacspeak-pronounce
thingatpt dtk-speak flite-voices dtk-interp voice-setup
emacspeak-sounds dectalk-voices espeak-voices mac-voices
multispeech-voices outloud-voices dtk-unicode byte-opt bytecomp
byte-compile cconv descr-text help-mode easymenu dtk-css-speech
acss-structure emacspeak-load-path advice help-fns vc-git
vc-dispatcher vc-svn cl-macs cl gv cl-loaddefs cl-lib tooltip
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer nadvice loaddefs button faces cus-face
macroexp files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)

Memory information:
((conses 8 679346 166711)
 (symbols 24 90221 0)
 (miscs 20 4938 2979)
 (strings 16 217446 40224)
 (string-bytes 1 5774236)
 (vectors 8 74336)
 (vector-slots 4 1079976 43510)
 (floats 8 1126 556)
 (intervals 28 3408 1943)
 (buffers 512 41)
 (heap 1024 56659 2138))





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

* bug#18139: 24.4.50; called-interactively-p and skip advice:
  2014-07-29  1:58 bug#18139: 24.4.50; called-interactively-p and skip advice: raman
@ 2014-07-30  0:08 ` Glenn Morris
  2014-07-30  0:40   ` raman
  2014-08-01 16:12 ` raman
  1 sibling, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2014-07-30  0:08 UTC (permalink / raw)
  To: raman; +Cc: 18139


A minimal example starting from emacs -Q would be very helpful.





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

* bug#18139: 24.4.50; called-interactively-p and skip advice:
  2014-07-30  0:08 ` Glenn Morris
@ 2014-07-30  0:40   ` raman
  2014-07-30  3:59     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: raman @ 2014-07-30  0:40 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 18139

A minimal example would be nice, but the minimal example doesn't
break. The insanely complex code that gets invoked when you call
electric newline and indent from ruby mode appears to be the only
pattern to date that triggers this. 






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

* bug#18139: 24.4.50; called-interactively-p and skip advice:
  2014-07-30  0:40   ` raman
@ 2014-07-30  3:59     ` Eli Zaretskii
  2014-07-30 13:56       ` raman
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2014-07-30  3:59 UTC (permalink / raw)
  To: raman; +Cc: 18139

> From: raman <raman@google.com>
> Date: Tue, 29 Jul 2014 17:40:37 -0700
> Cc: 18139@debbugs.gnu.org
> 
> A minimal example would be nice, but the minimal example doesn't
> break. The insanely complex code that gets invoked when you call
> electric newline and indent from ruby mode appears to be the only
> pattern to date that triggers this. 

Then include in your recipe the steps necessary to load whatever
packages you need to reproduce the problem.  But do start with
"emacs -Q", as that will help identify the necessary players that
contribute to this problem.

Thanks.





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

* bug#18139: 24.4.50; called-interactively-p and skip advice:
  2014-07-30  3:59     ` Eli Zaretskii
@ 2014-07-30 13:56       ` raman
  2017-03-25 15:55         ` npostavs
  0 siblings, 1 reply; 8+ messages in thread
From: raman @ 2014-07-30 13:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 18139

This should hopefully produce the  backtrace --  

I'll give two recipes below  -- the first is impossible  for me to try 

1. emacs -q
2. load-library ruby-mode
3. evaluate this form:

(defadvice backward-sexp (around test pre act comp)
(when (called-interactively-p 'interactive)
      (message "advice!"))
ad-do-it)
3. Open a ruby file test.rb
4. type 
puts "foo"
5. Invoke electric-newline-and-indent -- to trigger the bug.

Recipe 2:

Do the same as above with emacspeak loaded -- and without bothering with
the  additional piece of advice.

I'll attach the emacspeak generated backtrace below.
Debugger entered--Lisp error: (quit)
  advice--called-interactively-skip(3 (t ad-Advice-backward-sexp #[256 "\211\204\a\300\262\301[!\207" [1 forward-sexp] 3 2382034 "^p"] 1) (t apply ad-Advice-backward-sexp #[256 "\211\204\a\300\262\301[!\207" [1 forward-sexp] 3 2382034 "^p"] 1))
  run-hook-with-args-until-success(advice--called-interactively-skip 3 (t ad-Advice-backward-sexp #[256 "\211\204\a\300\262\301[!\207" [1 forward-sexp] 3 2382034 "^p"] 1) (t apply ad-Advice-backward-sexp #[256 "\211\204\a\300\262\301[!\207" [1 forward-sexp] 3 2382034 "^p"] 1))
  called-interactively-p(interactive)
  ad-Advice-backward-sexp(#[256 "\211\204\a\300\262\301[!\207" [1 forward-sexp] 3 2382034 "^p"] 1)
  apply(ad-Advice-backward-sexp #[256 "\211\204\a\300\262\301[!\207" [1 forward-sexp] 3 2382034 "^p"] 1)
  #[128 "\300\301\302#\207" [apply ad-Advice-backward-sexp #[256 "\211\204\a\300\262\301[!\207" [1 forward-sexp] 3 2382034 "^p"] nil] 5 nil "^p"](1)
  #[0 "\300\301!\210\302\207" [#[128 "\300\301\302#\207" [apply ad-Advice-backward-sexp #[256 "\211\204\a\300\262\301[!\207" [1 forward-sexp] 3 2382034 "^p"] nil] 5 nil "^p"] 1 nil] 2 "\n\n(fn)"]()
  funcall(#[0 "\300\301!\210\302\207" [#[128 "\300\301\302#\207" [apply ad-Advice-backward-sexp #[256 "\211\204\a\300\262\301[!\207" [1 forward-sexp] 3 2382034 "^p"] nil] 5 nil "^p"] 1 nil] 2 "\n\n(fn)"])
  #[0 "\304\242;\205\0\306\304\242\"AC\304\307\240\210`\300 \306\r\"A\211\204X\x01G\310U\203$\311\312\313\310\314\315\316\301!\317\"\320\321%D\322\312\313\323\324\315\316\v!\325\"\326\327%\311EDC\217\210`=\203$\330\331\332`D\"\210\202$\303!\247\204t\302!\247\204l\333\334\335C\"\210\211B\262\202$\x03\203\212\303!\302@!W\203\212\x03A\262\202t\x03\204\266\304\242\203\242\302!\247\203\242\211B\262\202$\330\331\302!\206\253\332`Eb\210\"\210\202$\x03\211\203\313\303!\302\x06@!U\203\313\x04A\262\x04\203\336\302!\247\203#\x01B\262\202#\302!\247\204\361\330\331\307`\x06E\"\210\202#\336!\204\377\x01B\262\202#\211\203 \336@!\203 \330\331\302!\206\x01\332`\x06E\x06b\210\"\210\202#\211\262\210\266\203\2051\304\307\240\210\202\0\207" [#[nil "`\304`[!\210\b\305 V\203\0\306 \203\0\307\310w\210\311\202\364n\203-o\204-\312`\313\"b\210\311\202\364\b`V\203An\204A\314\b!\203A\315\202\364\316 \317 \x1a	\203O\320\nP`Sf\321=\203e\322\323\n\"\203e\313u\210\324\nP\n\325\235\203x\326 \203t\n\202\363\327\202\363\n\330\232\203\224\331 \203\207\332\202\363\333 \203\220\334\202\363\n\202\363\335\n\310\336\322\x03#)\266\203\203\256\337u\210\n\337\310O\202\363\n\340\232\203\312`Sf\341=\203\312\342\343!\203\312\313u\210\344 \202\363\n\345\232\203\362\346 \204\331\n\202\363\212\337v\210\304d!\210`)\305 V\203\356\344 \202\363\311\202\363\n*)\207" [pos dot tok inhibit-changing-match-data forward-comment line-end-position ruby-smie--implicit-semi-p " 	" nil ";" scan-sexps -1 ruby-smie--args-separator-p " @ " smie-default-backward-token ruby-smie--at-dot-call "." 58 string-match "\\`\\s." ":" ("unless" "if" "while" "until") ruby-smie--bosp "iuwu-mod" "|" ruby-smie--opening-pipe-p "opening-|" ruby-smie--closing-pipe-p "closing-|" "\\`|[*&]\\'" t 1 "" 92 looking-at "\n" ruby-smie--backward-token "do" ruby-smie--redundant-do-p] 7] #[128 "\300\301\302#\207" [apply ad-Advice-backward-sexp #[256 "\211\204\a\300\262\301[!\207" [1 forward-sexp] 3 2382034 "^p"] nil] 5 nil "^p"] #<subr car> #[257 "\211A@\207" [] 2 1633439] (nil) smie-grammar assoc nil 0 err funcall make-byte-code "\300\301!\210\302\207" vconcat vector [1 nil] 2 "\n\n(fn)" scan-error 257 "\3018`X\203\0\3028\202\0\211\300b\210\303\304\305\306\211`\bW\203%\307\202&\310\\\"E\"\207" [2 3 throw return t buffer-substring-no-properties -1 1] 12 "\n\n(fn ERR)" throw return t signal cl-assertion-failed (numberp (funcall op-forw toklevels)) smie--associative-p] 14 "\n\n(fn)"]()
  funcall(#[0 "\304\242;\205\0\306\304\242\"AC\304\307\240\210`\300 \306\r\"A\211\204X\x01G\310U\203$\311\312\313\310\314\315\316\301!\317\"\320\321%D\322\312\313\323\324\315\316\v!\325\"\326\327%\311EDC\217\210`=\203$\330\331\332`D\"\210\202$\303!\247\204t\302!\247\204l\333\334\335C\"\210\211B\262\202$\x03\203\212\303!\302@!W\203\212\x03A\262\202t\x03\204\266\304\242\203\242\302!\247\203\242\211B\262\202$\330\331\302!\206\253\332`Eb\210\"\210\202$\x03\211\203\313\303!\302\x06@!U\203\313\x04A\262\x04\203\336\302!\247\203#\x01B\262\202#\302!\247\204\361\330\331\307`\x06E\"\210\202#\336!\204\377\x01B\262\202#\211\203 \336@!\203 \330\331\302!\206\x01\332`\x06E\x06b\210\"\210\202#\211\262\210\266\203\2051\304\307\240\210\202\0\207" [#[nil "`\304`[!\210\b\305 V\203\0\306 \203\0\307\310w\210\311\202\364n\203-o\204-\312`\313\"b\210\311\202\364\b`V\203An\204A\314\b!\203A\315\202\364\316 \317 \x1a	\203O\320\nP`Sf\321=\203e\322\323\n\"\203e\313u\210\324\nP\n\325\235\203x\326 \203t\n\202\363\327\202\363\n\330\232\203\224\331 \203\207\332\202\363\333 \203\220\334\202\363\n\202\363\335\n\310\336\322\x03#)\266\203\203\256\337u\210\n\337\310O\202\363\n\340\232\203\312`Sf\341=\203\312\342\343!\203\312\313u\210\344 \202\363\n\345\232\203\362\346 \204\331\n\202\363\212\337v\210\304d!\210`)\305 V\203\356\344 \202\363\311\202\363\n*)\207" [pos dot tok inhibit-changing-match-data forward-comment line-end-position ruby-smie--implicit-semi-p " 	" nil ";" scan-sexps -1 ruby-smie--args-separator-p " @ " smie-default-backward-token ruby-smie--at-dot-call "." 58 string-match "\\`\\s." ":" ("unless" "if" "while" "until") ruby-smie--bosp "iuwu-mod" "|" ruby-smie--opening-pipe-p "opening-|" ruby-smie--closing-pipe-p "closing-|" "\\`|[*&]\\'" t 1 "" 92 looking-at "\n" ruby-smie--backward-token "do" ruby-smie--redundant-do-p] 7] #[128 "\300\301\302#\207" [apply ad-Advice-backward-sexp #[256 "\211\204\a\300\262\301[!\207" [1 forward-sexp] 3 2382034 "^p"] nil] 5 nil "^p"] #<subr car> #[257 "\211A@\207" [] 2 1633439] (nil) smie-grammar assoc nil 0 err funcall make-byte-code "\300\301!\210\302\207" vconcat vector [1 nil] 2 "\n\n(fn)" scan-error 257 "\3018`X\203\0\3028\202\0\211\300b\210\303\304\305\306\211`\bW\203%\307\202&\310\\\"E\"\207" [2 3 throw return t buffer-substring-no-properties -1 1] 12 "\n\n(fn ERR)" throw return t signal cl-assertion-failed (numberp (funcall op-forw toklevels)) smie--associative-p] 14 "\n\n(fn)"])
  smie-next-sexp(#[nil "`\304`[!\210\b\305 V\203\0\306 \203\0\307\310w\210\311\202\364n\203-o\204-\312`\313\"b\210\311\202\364\b`V\203An\204A\314\b!\203A\315\202\364\316 \317 \x1a	\203O\320\nP`Sf\321=\203e\322\323\n\"\203e\313u\210\324\nP\n\325\235\203x\326 \203t\n\202\363\327\202\363\n\330\232\203\224\331 \203\207\332\202\363\333 \203\220\334\202\363\n\202\363\335\n\310\336\322\x03#)\266\203\203\256\337u\210\n\337\310O\202\363\n\340\232\203\312`Sf\341=\203\312\342\343!\203\312\313u\210\344 \202\363\n\345\232\203\362\346 \204\331\n\202\363\212\337v\210\304d!\210`)\305 V\203\356\344 \202\363\311\202\363\n*)\207" [pos dot tok inhibit-changing-match-data forward-comment line-end-position ruby-smie--implicit-semi-p " 	" nil ";" scan-sexps -1 ruby-smie--args-separator-p " @ " smie-default-backward-token ruby-smie--at-dot-call "." 58 string-match "\\`\\s." ":" ("unless" "if" "while" "until") ruby-smie--bosp "iuwu-mod" "|" ruby-smie--opening-pipe-p "opening-|" ruby-smie--closing-pipe-p "closing-|" "\\`|[*&]\\'" t 1 "" 92 looking-at "\n" ruby-smie--backward-token "do" ruby-smie--redundant-do-p] 7] #[128 "\300\301\302#\207" [apply ad-Advice-backward-sexp #[256 "\211\204\a\300\262\301[!\207" [1 forward-sexp] 3 2382034 "^p"] nil] 5 nil "^p"] #<subr car> #[257 "\211A@\207" [] 2 1633439] ";")
  smie-backward-sexp(";")
  smie-indent-keyword()
  run-hook-with-args-until-success(smie-indent-keyword)
  smie-indent-calculate()
  smie-indent-virtual()
  smie-indent-after-keyword()
  run-hook-with-args-until-success(smie-indent-after-keyword)
  smie-indent-calculate()
  #[0 "\212\301y\210\302\303w\210`\300\242Y\203\0\300\303\240\210\304 \206\0\301)\207" [(nil) 0 " 	" nil smie-indent-calculate] 2 "\n\n(fn)"]()
  funcall(#[0 "\212\301y\210\302\303w\210`\300\242Y\203\0\300\303\240\210\304 \206\0\301)\207" [(nil) 0 " 	" nil smie-indent-calculate] 2 "\n\n(fn)"])
  smie-indent-line()
  indent-according-to-mode()
  #[0 "\300\301!\210\302\303\301\"\210\304 \207" [delete-horizontal-space t newline nil indent-according-to-mode] 3 1970172 "*"]()
  ad-Advice-newline-and-indent(#[0 "\300\301!\210\302\303\301\"\210\304 \207" [delete-horizontal-space t newline nil indent-according-to-mode] 3 1970172 "*"])
  apply(ad-Advice-newline-and-indent #[0 "\300\301!\210\302\303\301\"\210\304 \207" [delete-horizontal-space t newline nil indent-according-to-mode] 3 1970172 "*"] nil)
  newline-and-indent()
  electric-newline-and-maybe-indent()
  funcall-interactively(electric-newline-and-maybe-indent)
  call-interactively(electric-newline-and-maybe-indent nil nil)
  command-execute(electric-newline-and-maybe-indent)

      





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

* Re: 24.4.50; called-interactively-p and skip advice:
  2014-07-29  1:58 bug#18139: 24.4.50; called-interactively-p and skip advice: raman
  2014-07-30  0:08 ` Glenn Morris
@ 2014-08-01 16:12 ` raman
  1 sibling, 0 replies; 8+ messages in thread
From: raman @ 2014-08-01 16:12 UTC (permalink / raw)
  To: bug-gnu-emacs; +Cc: tv.raman.tv, emacs-devel

Following up on this  bug with additional info:

I just confirmed that this bug was not present in emacs 24.3 --- where
interactive-p was implemented in C -- that function was declared
obsolete in 23.2.

In 24.4 when we transitioned to nadvice.el is when this appears to have
broken.

Looking at the code in 24.4;

the code for called-interactively-p  and its subsequent call through to 
advice--called-interactively-skip  --- one of the functions placed on
called-interactively-p-functions -- appears to introduce   large level
of complexity. advice--called-interactively-skip is defined in
nadvice.el 

Going back to the specific issue from the Emacspeak side:

What I really need is a way to tell if an interactive command was called
by the user pressing a key e.g. M-f for forward-word -- or M-x
forward-word -- those are the only situations in which the emacspeak
advice that speaks the "current word" should be invoked.  

Using (called-interactively-p 'interactive) for this use-case now that I
look at what that code does feels extremely tangled.

Could we perhaps introduce a C-level variable  -- say "interactivep"
that is exposed to elisp --  code in callint.c could set that variable
appropriately and clear it upon completing command execution. 

At the time nadvice.el was introduced, Stefane had me check through with
emacspeak to make sure that nothing broke -- and I had confirmed it --
admittedly, the current breakage in ruby-mode is caused by a large
number of complex recursive calls that are happening within that mode.

Note that there is only one emacspeak advice invoked even then -- the
one to backward-sexp -- but  the call stack is deep enough that
called-interactively-p gets very confused.

--Raman 



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

* bug#18139: 24.4.50; called-interactively-p and skip advice:
  2014-07-30 13:56       ` raman
@ 2017-03-25 15:55         ` npostavs
  2021-08-10 16:23           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: npostavs @ 2017-03-25 15:55 UTC (permalink / raw)
  To: raman; +Cc: 18139

tags 18139 unreproducible
quit

raman <raman@google.com> writes:

> This should hopefully produce the  backtrace --  
>
> I'll give two recipes below  -- the first is impossible  for me to try 
>
> 1. emacs -q
> 2. load-library ruby-mode
> 3. evaluate this form:
>
> (defadvice backward-sexp (around test pre act comp)
> (when (called-interactively-p 'interactive)
>       (message "advice!"))
> ad-do-it)
> 3. Open a ruby file test.rb
> 4. type 
> puts "foo"
> 5. Invoke electric-newline-and-indent -- to trigger the bug.

I assume this should be `electric-newline-and-maybe-indent' (C-j).

Nothing happens when I do this (except that a newline is inserted).

> Recipe 2:
>
> Do the same as above with emacspeak loaded -- and without bothering with
> the  additional piece of advice.

Nothing happens when I do this (except that a newline is inserted).
Probably because now emacspeak has a workaround by setting a
`ems-called-interactively-p' flag.  Do you know which version of
emacspeak triggers the bug?





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

* bug#18139: 24.4.50; called-interactively-p and skip advice:
  2017-03-25 15:55         ` npostavs
@ 2021-08-10 16:23           ` Lars Ingebrigtsen
  0 siblings, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-10 16:23 UTC (permalink / raw)
  To: npostavs; +Cc: rgm, raman, 18139

npostavs@users.sourceforge.net writes:

>> Do the same as above with emacspeak loaded -- and without bothering with
>> the  additional piece of advice.
>
> Nothing happens when I do this (except that a newline is inserted).
> Probably because now emacspeak has a workaround by setting a
> `ems-called-interactively-p' flag.  Do you know which version of
> emacspeak triggers the bug?

More information was requested, but no response was given within four
years, so I'm closing this bug report.  If the problem still exists,
please respond to this email and we'll reopen the bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2021-08-10 16:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-29  1:58 bug#18139: 24.4.50; called-interactively-p and skip advice: raman
2014-07-30  0:08 ` Glenn Morris
2014-07-30  0:40   ` raman
2014-07-30  3:59     ` Eli Zaretskii
2014-07-30 13:56       ` raman
2017-03-25 15:55         ` npostavs
2021-08-10 16:23           ` Lars Ingebrigtsen
2014-08-01 16:12 ` raman

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.