all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* A plea for sanity from a frustrated hacker.
@ 2007-06-09 17:41 Alan Mackenzie
  2007-06-09 16:29 ` Thien-Thi Nguyen
  2007-06-09 17:59 ` Johan Bockgård
  0 siblings, 2 replies; 7+ messages in thread
From: Alan Mackenzie @ 2007-06-09 17:41 UTC (permalink / raw)
  To: emacs-devel

Hi, Emacs!

I'm trying to debug a bug in the help system, specifically what happens
when you hit <CR> to open the pertinent file after doing C-h f (or C-h
v).

Putting point over the file name and doing a quick C-h c <CR> revealed
that the function I wanted was `push-button'.  Fair enough.  A tedious
eternity of edbugging later, I've now found that .....

push-button calls
  button-activate which calls
    (let ((action (button-get button))) .... which returns 'help-button-action
      and then calls
    (funcall action ....), i.e.,
    (funcall 'help-button-action #<marker at 58 in *Help*>).

    help-button-action then proceeds to dredge three further lisp objects
      out of the button then with them calls ....
      (help-do-xref <p1> <p2> <p3>) ... which ignores <p1> then does
         (apply <p2> <p2>)

So, at this stage, what is the function <p2>?  It's a byte-compiled
lambda.  :-(  At this point, tedium and frustration have caused me to
postpone further debugging and write this rant.

Hey, Guys, this JUST ISN'T FUN.  We've got six levels of calls here, none
of which do anything other than delegate actions to the next in the
nest and hoik out random lisp objects from exotic places.  We've even
come through two nested `funcall'/`apply's and _still_ not got to the
real action, the function which visits the file.el and displays it in the
other window from *Help*.  Would somebody help me find this function,
please?

This is reminiscent of the objectionable orientation in so many
industrial C++ programs.  Can we _please_ hack with less impliciticity?
No matter how well written something is, it will need to be debugged and
changed at some point, and writing in a way so opaque it almost looks
deliberately obfuscated doesn't help.  At the very least, SURELY the
final function <p2> could have been inserted as a symbol into wherever it
was rather than as a byte-compiled lambda?

This is madness.  Don't worry, I'll get over it.

-- 
Alan Mackenzie (Ittersbach, Germany).

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

end of thread, other threads:[~2007-06-10 14:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-09 17:41 A plea for sanity from a frustrated hacker Alan Mackenzie
2007-06-09 16:29 ` Thien-Thi Nguyen
2007-06-09 17:59 ` Johan Bockgård
2007-06-09 20:20   ` Alan Mackenzie
2007-06-09 22:45     ` Juri Linkov
2007-06-10  3:29       ` Stefan Monnier
2007-06-10 14:28         ` Juri Linkov

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.