help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Advice on troubleshooting function to "unscroll"


From: Will Monroe
Subject: Re: Advice on troubleshooting function to "unscroll"
Date: Sun, 25 Jan 2015 16:56:14 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Drew,

Thank you for this detailed response.

On 01/25/2015 04:45 PM, Drew Adams wrote:
the "problem" was that C-v was bound to another (older?) function.

The command `scroll-up' is indeed older, and it is still usable.
It is, in fact, the core of the `scroll-up-command' implementation.

(In Emacs, it is often the case that you can use a command
non-interactively, though this is sometimes explicitly not
recommended for certain commands.)

`scroll-up-command' was added in Emacs 24.1, to (a) retain the
`scroll-up' behavior as a separate function, and yet (b) provide
additional behavior when you scroll interactively, in particular
the handling of the new (in 24.1) option `scroll-error-top-bottom'.

Interesting. Given what the author's assumptions of how 'scroll-up' should work and how the newer 'scroll-up-command' seems to share some, but not all, of that functionality, it would probably be interesting to see where they differ. I may not be expressing this clearly, but you've helped to clarify the question I want to answer to be: "why did scroll-up-command work where the still useful but not appropriate scroll-up did not?"


I've hesitated from diving into Edebug because there was no
"error" as such.  That is, the code "worked" it just didn't do
what I intended.

Using the debugger (and debugging generally) is not necessarily
about finding why Emacs raises a particular error.  (That is the
particular use of variable `debug-on-error': enter the debugger
to show a backtrace when an error is raised.)

In addition to Edebug, there is the regular Emacs debugger, aka
`debug'.  Some of us prefer to use that.  Others prefer to use
it in some cases but `edebug' in other cases.

Keep in mind too that any debugger does not necessarily tell you
everything that goes on, and its representation of what happens
with debugging turned off is not flawless.  In particular, this
is because using the debugger itself changes what Emacs does.
(Think of the debugger's buffer display and its handling of
input events, for example.)

The regular debugger is what you get with `debug-on-entry' and
by inserting calls to `(debug)' in code to serve more or less as
breakpoints.  See `C-h f debug' for information about evaluating
and displaying the results of sexps (cdr ARGS) upon entry into
the debugger.


This is very helpful stuff to consider as I begin to think about what I want to accomplish when using Edebug or debugger.

And if I'm being honest about why I did not go to Edebug it's because I was anticipating great difficulty reading the backtrace statements. I thought my problem might be compounded by a more general illiteracy in that regard...

Thanks again, Drew.  A really helpful answer!

Will



reply via email to

[Prev in Thread] Current Thread [Next in Thread]