unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Will Monroe <wtmonroe.ls@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Advice on troubleshooting function to "unscroll"
Date: Sun, 25 Jan 2015 15:43:52 -0600	[thread overview]
Message-ID: <54C56398.1050404@gmail.com> (raw)
In-Reply-To: <874mreh7c5.fsf@wmi.amu.edu.pl>

Marcin,

Thanks for your quick and friendly response!

On 01/25/2015 03:35 PM, Marcin Borkowski wrote:
>
> On 2015-01-25, at 21:52, Will Monroe <wtmonroe.ls@gmail.com> wrote:
>
>> Hello,
>>
>> I'm studying Emacs Lisp so that I can become more proficient at
>> customizing GNU Emacs for purposes, mainly using org-mode.  I'm studying
>> alone using Bob Glickstein's *Writing GNU Emacs Extensions*.  So far,
>> the book has been a terrific guide to basic concepts.  But I've run into
>> a problem that I can't seem to troubleshoot any further and I'd
>> appreciate advice on: 1) the best way to troubleshoot this problem
>> (e.g., other forums, listservs, or IRC channels that might be more
>> appropriate) and 2) troubleshooting the problem itself.  I apologize in
>> advance if this query has failed to take into account any basics or if
>> it would be better posed elsewhere.  I welcome your on the best way to
>> proceed.
>
> Welcome to the land of Elisp.  (I'm also a relative newcomer here.)
>
> BTW, I looked at the free sample of Glickstein's book in the Amazon
> Kindle store (not that I recommend it -- in fact, it is seemingly
> prohibited to recommend things like that here), and got the impression
> that it is a nice book -- something to read right after the "Emacs Lisp
> Intro" by Robert J. Chassell -- but it might be a bit outdated.

Thanks for this suggestion!

   (For
> instance, the early part about problems with C-h and backspace seem to
> be irrelevant nowadays.)

You know, I wondered about the backspace and C-h too.  But then I heard 
an interview RMS did on some podcast recently and he mentioned some 
early design differences between Emacs developers on this point. 
Perhaps intended as a humorous anecdote? ; )

A question to more knowledgeable people: is
> that impression correct?
>
>> So, following Glickstein's advice in Chapter 3, I'm trying to create a
>> function that will allow me to create an "unscroll" function that will
>> allow me to return to a prior buffer position after (inadvertently)
>> pressing C-v a few times.  The code to do this defines three new
>> variables, defines advice for an extant Emacs function, scroll-up, and
>> then defines a new function, unscroll.  The code is below.
>
> Please note that there is new syntax for advising functions in Emacs
> 24.4 (or 25, I'm not sure).  The old one should work, but the new one is
> much simpler.

Thanks for this tip.  In the first three chapters, I recall seeing a few 
references that were a bit dated but I just worked around them.  But 
your mentioning this brings to mind the possibility that code provided 
in the book is so dated that it might explain why it fails to work as I 
expect.  But knowing so little about lisp, It's hard to say.
"DePaul Online Teaching Series: Facilitating effective online learning
>
>> The test was just opening a lengthy file, usually an info page or an
>> existing org-mode file, pressing C-v a few times, and then using M-x
>> unscroll.  In all cases, I found that M-x unscroll would return to the
>> position just before the last C-v but not to the original position.  In
>> other words, if I pressed C-v two times and then pressed M-x unscroll,
>> in would only go back one C-v.  My intent, and that of the example in
>> the book, is to return the point the position before any C-v key
>> sequences were pressed.
>>
>> I could move one but I suspect that the mistake I've made will come up
>> again.  I'd really welcome your (gentle) feedback!
>
> I would strongly advise (no pun intended) to read the Emacs Lisp
> reference, section about Edebug.

Thanks for the advice about Edebug.  It's definitely something that is 
on my mind.  But over the last day or so, 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.  Wasn't sure Edebug would 
help in a case like that...but your point is well taken.  Thank you!

>
>> All the best,
>>
>> Will
>
> The same to you,
>



  reply	other threads:[~2015-01-25 21:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-25 20:52 Advice on troubleshooting function to "unscroll" Will Monroe
2015-01-25 21:35 ` Marcin Borkowski
2015-01-25 21:43   ` Will Monroe [this message]
2015-01-25 21:55     ` Marcin Borkowski
2015-01-25 22:01       ` Will Monroe
2015-01-25 21:45 ` Marcin Borkowski
2015-01-25 22:03   ` Will Monroe
2015-01-25 22:09     ` Marcin Borkowski
2015-01-25 22:45     ` Drew Adams
2015-01-25 22:56       ` Will Monroe
2015-01-25 23:15         ` Marcin Borkowski
2015-01-26  0:03         ` Drew Adams
2015-01-26  0:16           ` Marcin Borkowski
2015-01-26  1:06             ` Drew Adams
2015-01-26  1:17             ` Will Monroe
2015-01-26  1:21               ` Marcin Borkowski
2015-01-26  1:33               ` Drew Adams
     [not found] <mailman.18583.1422219396.1147.help-gnu-emacs@gnu.org>
2015-01-25 21:35 ` Joost Kremers
2015-01-25 21:57   ` Will Monroe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54C56398.1050404@gmail.com \
    --to=wtmonroe.ls@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).