Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9214345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:57:19+00:00 2026-06-18T01:57:19+00:00

I use GNU emacs-24. I make button like this: (defun go-click (button) (print (button-get

  • 0

I use GNU emacs-24.
I make button like this:

(defun go-click (button)
  (print (button-get button 'point))
  (let ((win (get-buffer-window (button-get button 'buffer))))
    (if win
        (progn
          (select-window win)
          (goto-char (button-get button 'point)))
      (message "open a window with the location"))))

(let ((p (point)) (buf (current-buffer)))
  (with-current-buffer (get-buffer "yyy")
    (insert-button "go" 'action #'go-click
                   'follow-link t
                   'point p
                   'buffer buf)))

I have this code in *scratch* buffer in onw window and another window with bufffer yyy. I eval-current-buffer while the point is, say on #’go-click position. And the button go in yyy appears.

If I now click on the button, it prints the number, as expected, makes *scratch* active, as supposed, but doesn’t move the point on #’go-click position.

But if I position point on the go button by cursor keys, and hit enter, it works as expected (moves point to #’go-click positoin, no matter, where I left it in *scratch* previously) .

How to make it work for both keyboard-enter and mouse-click scenario?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:57:20+00:00Added an answer on June 18, 2026 at 1:57 am

    Here is the little patch:

    (defun go-click (button)
      (print (button-get button 'point))
      (let ((win (get-buffer-window (button-get button 'buffer)))
            (cur-win (get-buffer-window (current-buffer))))
        (select-window cur-win)
        (if win
            (progn
              (select-window win)
              (goto-char (button-get button 'point)))
          (message "open a window with the location"))))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I usually use gnu screen like this: 1. start a screen session for all
This is a follow up on this question: Can I use GNU make's SHELL
During the compilation of sources, I would like GNU Make to call an emacs
I've been trying to make GNU gdb 6.5-14 to use the source code embedded
When I use find-tags, I get the following error: File: /Applications/Emacs.app/Contents/Contents/Resources/lisp/simple.el not found simple.el.gz
I'm using GNU Emacs 22.2.1. I usually use a different editor, but am learning
As some of you who use GNU/Emacs to develop for Android, you are surely
I use GNU Readline in the select fashion, by registering a callback function like
Much of the time when I use the mouse to click on an emacs
Is it possible to use GNU make in Xcode 4? It's said that Xcode

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.