unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Joel Reicher <joel.reicher@gmail.com>
To: Christopher Howard <christopher@librehacker.com>
Cc: Help Gnu Emacs Mailing List <help-gnu-emacs@gnu.org>
Subject: Re: switch buffer variable context after (push-button)?
Date: Wed, 01 Jan 2025 13:07:49 +1100	[thread overview]
Message-ID: <86cyh78ex6.fsf@gmail.com> (raw)
In-Reply-To: <87ed1nv4vr.fsf@librehacker.com> (Christopher Howard's message of "Tue, 31 Dec 2024 13:56:08 -0900")

Christopher Howard <christopher@librehacker.com> writes:

> Hi, I'm trying to automate some various procedures I do ― 
> private tasks, not of general interest. One was to navigate to a 
> button in a buffer, and then run (push-button) which opens a 
> link to a Web page in EWW. (The button target may vary.) After 
> that, I wanted to run (eww-readable), but it gives me an 
> error. After some debugging, I figured out the eww-readable was 
> trying to use the value of the eww-data variable from the 
> previous buffer ― which is nil ― rather than the value of it in 
> the EWW buffer.
>
> Is there a function that I have to call first, so that my elisp 
> function sees the variable values from the second buffer instead 
> of the original one?

You can use `with-current-buffer' to do it scoped/statelessly, or 
`set-buffer' to do it statefully.

Regards,

        - Joel



      reply	other threads:[~2025-01-01  2:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-31 22:56 switch buffer variable context after (push-button)? Christopher Howard
2025-01-01  2:07 ` Joel Reicher [this message]

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=86cyh78ex6.fsf@gmail.com \
    --to=joel.reicher@gmail.com \
    --cc=christopher@librehacker.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).