unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17311: M-x speedbar-get-focus fails due to a non-symbol argument to run-hooks
@ 2014-04-21 18:15 Ivan Shmakov
  2014-04-21 21:46 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan Shmakov @ 2014-04-21 18:15 UTC (permalink / raw)
  To: 17311

Package:  emacs

	As of cff4b64e835d [1], M-x speedbar-get-focus RET (as called
	from, say, erc-speedbar-browser) fails with a backtrace like:

Debugger entered--Lisp error: (wrong-type-argument symbolp #[nil … [speedbar-update-flag t speedbar-timer-fn] 1])
  run-hooks(#[nil … [speedbar-update-flag t speedbar-timer-fn] 1])
  dframe-get-focus(speedbar-frame speedbar-frame-mode #[nil … [speedbar-update-flag t speedbar-timer-fn] 1])
  speedbar-get-focus()
  call-interactively(speedbar-get-focus record nil)
  command-execute(speedbar-get-focus record)
  execute-extended-command(nil "speedbar-get-focus")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

	The likely cause is that the change made last August as part of
	02d1dcff167d [2] was in fact incomplete.  Specifically, while
	dframe-get-focus was changed to allow only a hook argument (that
	is: a hook variable, as accepted by run-hooks):

index 21b5085..6696707 100644
--- a/lisp/dframe.el
+++ b/lisp/dframe.el
@@ -616,7 +622,7 @@ (defun dframe-get-focus (frame-var activator &optional hook)
     )
   (other-frame 0)
   ;; If updates are off, then refresh the frame (they want it now...)
-  (run-hooks 'hook))
+  (run-hooks hook))
 
 
 (defun dframe-close-frame ()

	At least one of its callers – speedbar-get-focus – was /not/
	updated accordingly (as of [1]):

  1061	(defun speedbar-get-focus ()
…
  1067	  (dframe-get-focus 'speedbar-frame 'speedbar-frame-mode
  1068			    (lambda () (let ((speedbar-update-flag t))
  1069					 (speedbar-timer-fn)))))

	I guess employing in speedbar-get-focus something like the
	‘conv-hook’ wrapper currently used in dframe-frame-mode will
	resolve the issue.

[1] http://git.savannah.gnu.org/cgit/emacs.git/commit/lisp/vc/ediff-diff.el?h=trunk&id=cff4b64e835d8a198ada0dcf32e69ab03642ae60
[2] http://git.savannah.gnu.org/cgit/emacs.git/commit/lisp/vc/ediff-diff.el?h=trunk&id=02d1dcff167d8ed868df68abd7a46706f8ab5f11

-- 
FSF associate member #7257





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

* bug#17311: M-x speedbar-get-focus fails due to a non-symbol argument to run-hooks
  2014-04-21 18:15 bug#17311: M-x speedbar-get-focus fails due to a non-symbol argument to run-hooks Ivan Shmakov
@ 2014-04-21 21:46 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2014-04-21 21:46 UTC (permalink / raw)
  To: Ivan Shmakov; +Cc: 17311

> 	At least one of its callers – speedbar-get-focus – was /not/
> 	updated accordingly (as of [1]):

Good point, thank you.  I just removed that `hook' argument on the
`emacs-24' branch, since that code can just as well be run by the
caller anyway.


        Stefan





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

end of thread, other threads:[~2014-04-21 21:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-21 18:15 bug#17311: M-x speedbar-get-focus fails due to a non-symbol argument to run-hooks Ivan Shmakov
2014-04-21 21:46 ` Stefan Monnier

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