Subject: bug#12869: 24.3.50; 'semantic-change-function' and incremental parsing broken by 'define-obsolete-variable-alias' problems

From: Nix <[email-masked]>
Date: Mon, 12 Nov 2012 14:22:17 +0000

This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgment at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

semantic-change-function is so widely used by semantic that virtually
any buffer changes in a semantic-managed buffer will rapidly lead
to problems. Here, a simple return caused this backtrace:

  defvaralias(semantic-edits-new-change-hooks semantic-edits-new-change-functions nil)
  byte-code("... elided ..." [prop --dolist-tail-- defvaralias semantic-edits-new-change-hooks semantic-edits-new-change-functions nil (saved-value saved-variable-comment) put make-obsolete-variable "24.3"] 6)
  semantic-change-function(1356 1357 0)
  self-insert-command(1)
  newline()
  c-context-line-break()
  call-interactively(c-context-line-break nil nil)

That byte-code (here elided to get rid of its various control
characters) is quite mysterious: semantic-change-function never has
anything to do with make-obsolete-variable. However, eval-buffering the
entirety of lisp/cedet/semantic/edit.el yields the same failure on this
line:

(define-obsolete-variable-alias 'semantic-edits-new-change-hooks
  'semantic-edits-new-change-functions "24.3")

with this backtrace:

Debugger entered--Lisp error: (error "Don't know how to make a localized variable an alias")
  defvaralias(semantic-edits-new-change-hooks semantic-edits-new-change-functions nil)
  (progn (defvaralias #1=(quote semantic-edits-new-change-hooks) #2=(quote semantic-edits-new-change-functions) nil) (dolist (prop (quote (saved-value saved-variable-comment))) (and (get #1# . #3=(prop)) (null (get #2# . #3#)) (put #2# prop (get #1# . #3#)))) (make-obsolete-variable #1# #2# "24.3"))
  (define-obsolete-variable-alias (quote semantic-edits-new-change-hooks) (quote semantic-edits-new-change-functions) "24.3")
  eval((define-obsolete-variable-alias (quote semantic-edits-new-change-hooks) (quote semantic-edits-new-change-functions) "24.3") nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)

This is pretty clearly a regression. This variable is not localized, and
this error is itself erroneous.

In GNU Emacs 24.3.50.2 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2012-11-12 on spindle
Bzr revision: 110872 [email-masked]
Windowing system distributor `The X.Org Foundation', version 11.0.11300000
System LSB Version:	:core-4.1-amd64:core-4.1-noarch

Configured using:
 `configure '--without-pop' '--without-kerberos' '--without-hesiod'
 '--without-mmdf' '--with-x-toolkit=lucid' '--with-wide-int'
 'NO_FAST_MATH=t''

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: C/lh

Minor modes in effect:
  semantic-minor-modes-format: ((:eval (if (or semantic-highlight-edits-mode)  S)))
  gtags-mode: t
  git-wip-mode: t
  persp-mode: t
  iswitchb-mode: t
  show-paren-mode: t
  semantic-mru-bookmark-mode: t
  global-semantic-mru-bookmark-mode: t
  global-semanticdb-minor-mode: t
  global-semantic-idle-scheduler-mode: t
  semantic-idle-local-symbol-highlight-mode: t
  global-semantic-idle-local-symbol-highlight-mode: t
  global-semantic-idle-summary-mode: t
  semantic-idle-summary-mode: t
  semantic-idle-scheduler-mode: t
  semantic-decoration-mode: t
  global-semantic-decoration-mode: t
  global-srecode-minor-mode: t
  srecode-minor-mode: t
  eldoc-mode: t
  global-auto-complete-mode: t
  auto-complete-mode: t
  global-cwarn-mode: t
  cwarn-mode: t
  semantic-highlight-func-mode: t
  global-semantic-highlight-func-mode: t
  semantic-stickyfunc-mode: t
  global-semantic-stickyfunc-mode: t
  semantic-show-unmatched-syntax-mode: t
  global-semantic-show-unmatched-syntax-mode: t
  semantic-mode: t
  compile-bookmarks-mode: t
  global-ede-mode: t
  ede-minor-mode: t
  type-break-mode-line-message-mode: t
  type-break-mode: t
  icomplete-mode: t
  recentf-mode: t
  mv-shell-mode: t
  shell-dirtrack-mode: t
  which-function-mode: t
  winner-mode: t
  desktop-save-mode: t
  display-time-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: c-do-auto-fill
  abbrev-mode: t
  hs-minor-mode: t

Recent input:
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <down> <down> <home> <right> <right> 
<right> <right> <right> C-h v <return> C-h f <return> 
<down> <down> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <up> <up> <tab> <return> <down> <down> <down> 
<down> <down> M-x f o n t - l o c <tab> f o <tab> C-g 
M-x e v a l - b u f f <tab> <return> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <home> C-x 
o <right> <right> <down> <right> <down> <down> <right> 
<up> <right> q <escape> C-g <down> <down> <down> <down> 
<down> q <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> C-x 
o <right> <right> M-x <up> <return> <down> <down> <up> 
q C-r d e f v a r a l i a s C-s C-s C-s C-a M-x <up> 
<return> <down> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <down> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <up> <home> 
C-x O C-r s e m a n t i c - e d i t o s - <backspace> 
<backspace> s <backspace> <backspace> s - n e w - c 
h a n g e - h o o k s C-s C-s C-s C-a <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> C-a C-e <down> C-x 
C-e <down-mouse-1> <mouse-1> M-x r e p o r t _ e m 
a <tab> <backspace> <backspace> <backspace> <backspace> 
- e m a <tab> <return>

Recent messages:
Quit
progn: Don't know how to make a localized variable an alias
byte-code: End of buffer
Back to top level.
Entering debugger...
Back to top level.
Mark saved where search started
Entering debugger...
Mark saved where search started
Auto-saving...done
progn: Don't know how to make a localized variable an alias

Load-path shadows:
/home/nix/lisp/emacs/site-wide/site-start hides /usr/share/emacs/site-lisp/site-start
/home/nix/lisp/emacs/site-wide/default hides /usr/share/emacs/site-lisp/default
/home/nix/lisp/emacs/site-wide/scroll-in-place hides /usr/share/emacs/site-lisp/scroll-in-place
/usr/share/emacs/site-lisp/emms/tq hides /usr/share/emacs/24.3.50/lisp/emacs-lisp/tq

Features:
(shadow mail-extr emacsbug debug semantic/symref/filter
semantic/analyze/complete semantic/ia semantic/analyze/refs misearch
multi-isearch semantic/tag-write ibuf-ext ibuffer semantic/db-typecache
jka-compr asm-mode org-wl org-w3m org-vm org-rmail org-mhe org-mew
org-irc org-jsinfo org-infojs org-html org-exp ob-exp org-exp-blocks
org-agenda org-info org-gnus org-docview org-bibtex bibtex org-bbdb org
ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys
org-pcomplete org-list org-faces org-entities noutline outline
org-version ob-emacs-lisp ob org-compat org-macs ob-eval org-loaddefs
find-func cal-menu calendar cal-loaddefs bison-mode flex-mode derived
ede/project-am ede/autoconf-edit autoconf autoconf-mode
ede/makefile-edit semantic/bovine/make semantic/bovine/make-by ede/linux
ede/make make-mode pascal sh-script smie executable ede/dired generic
ede/locate semantic/imenu semantic/sb semantic/tag-file semantic/db-file
data-debug cedet-files semantic/bovine/c semantic/decorate/include
hideif semantic/bovine/c-by semantic/lex-spp semantic/bovine/gcc
semantic/dep semantic/bovine semantic/analyze semantic/sort
semantic/scope semantic/analyze/fcn vc-git c-eldoc cc-langs site-default
dot-emacs work-activation git-wip-mode vc vc-dispatcher perspective
dot-emacs-emacs iswitchb xemacs-compat add-log misc init-music
network-stream starttls tls emms-volume emms-volume-amixer emms-history
emms-bookmarks emms-metaplaylist-mode emms-browser sort
emms-playlist-sort emms-last-played emms-playing-time emms-stream-info
emms-streams emms-mode-line emms-cache emms-info later-do
emms-playlist-limit emms-playlist-mode emms-player-mpd tq
emms-player-simple emms-source-playlist emms-source-file dired emms
emms-compat init-message-modes silly-mail sendmail boxquote rect message
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader
init-time-tracking timeclock-visualize sgml-mode url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap auto-edit-substitute init-prog-modes
init-prog-modes-emacs filecache paren inversion semantic/db-global
semantic/symref/global semantic/symref semantic/db-find semantic/db-ref
cedet-global semantic/mru-bookmark semantic/db-mode semantic/db
semantic/idle semantic/decorate/mode srecode/mode semantic/senator
semantic/format semantic/ctxt semantic/wisent semantic/wisent/wisent
semantic/decorate pulse srecode/insert srecode/filters srecode/args
srecode/find srecode/map srecode/ctxt semantic/tag-ls semantic/find
srecode/compile srecode/dictionary srecode/table ede/emacs checkdoc
thingatpt eldoc auto-complete-config auto-complete popup yasnippet cwarn
cc-mode cc-fonts cc-guess cc-menus srecode semantic/util-modes
semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local
htmlfontify cus-edit cus-start cus-load compile-bookmarks local-projects
ede/cpp-root ede/speedbar ede/files ede ede/base ede/auto ede/source
eieio-base eieio-speedbar speedbar sb-image ezimage dframe eieio-custom
cedet local-dir-classes gtags gpicker ffap url-parse url-vars font-latex
latex easy-mmode edmacro kmacro tex-style tex cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs miniedit type-break icomplete site-start-load
gawd-keys help-mode gawd-keys-emacs gawd-mode-frobs
gawd-mode-frobs-emacs windmove recentf tree-widget wid-edit mv-shell
printing ps-print ps-def lpr uptimes pp bbdb timezone browse-kill-ring+
browse-kill-ring tempbuf timeclock igrep grep compile term disp-table
ehelp electric tramp tramp-compat auth-source gnus-util mm-util
mail-prsvr password-cache tramp-loaddefs shell pcomplete comint
ansi-color format-spec hideshow filladapt gawd-faces gawd-faces-emacs
nix-dark-theme gawd-misc gawd-misc-emacs which-func imenu winner
gawd-lists bbdb-autoloads 50magit desktop generic-x uniquify time advice
help-fns advice-preload scroll-in-place site-start-emacs site-autoloads
all-autoloads auctex-autoloads tex-site info c-eldoc-autoloads
compilation-recenter-end-autoloads compile-bookmarks-autoloads
dictionary-autoloads diff-git-autoloads elk-test-autoloads
fringe-helper-autoloads full-ack-autoloads htmlize-autoloads
ioccur-autoloads iresize-autoloads jump-autoloads inflections-autoloads
findr-autoloads lua-mode-autoloads minimap-autoloads mv-shell-autoloads
perspective-autoloads vlf-autoloads yasnippet-autoloads package
emms-auto rudel-loaddefs rudel-backend warnings eieio byte-opt bytecomp
byte-compile cconv cl-macs gv w3m-load apropos-toc cl cl-lib ring
filesets easymenu flash-paren saveplace redo+ time-date tooltip
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
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 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
dynamic-setting system-font-setting font-render-setting x-toolkit x
multi-tty emacs)