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

  • SEARCH
  • Home
  • 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 8817067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:45:42+00:00 2026-06-14T04:45:42+00:00

Possible Duplicate: In emacs, can I set up the *Messages* buffer so that it

  • 0

Possible Duplicate:
In emacs, can I set up the *Messages* buffer so that it tails?

I am playing with Elisp, and I find convenient to have the *Messages* buffer always open in a window in my frame.

I discovered recently that sometimes the buffer stops following the last line in the file. If I want to see the last appended lines in this buffer, I need to go in the buffer and jump to the end manually, with M->. Which quite annoying and disruptive.

I am trying to reproduce the “tail -f” command line, in a buffer. Of course 'auto-revert-tail-mode complains that the *Messages* is not a visited file… As a consequence, this mode does not want to work. But it gave me the idea to add a function hook when the buffer is modified. That function would jump to (point-max) each time that buffer is modified.

Here is my own attempt, invoked from *Messages* buffer, with M-::
(add-hook 'after-change-functions (lambda (s e l) (goto-char (point-max)) nil) nil t)

But it does not work. The (point) remains in the same place while I see the buffer is growing… The lambda function does not produce any error, otherwise it would have been removed from the 'after-change-functions hook and C-h k 'after-change-functions shows it is present.

Any better suggestions?

  • 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-14T04:45:43+00:00Added an answer on June 14, 2026 at 4:45 am

    Modifying the point position from after-change-functions is very dangerous anyway because it can break some types of edit to the buffer (for example, Emacs compresses multiple consecutive messages with the same content). However, for your purposes the post-command-hook is more than sufficient and much safer, so you can just use this:

    (add-hook 'post-command-hook
              (lambda ()
                (let ((messages (get-buffer "*Messages*")))
                  (unless (eq (current-buffer) messages)
                    (with-current-buffer messages
                      (goto-char (point-max)))))))
    

    The hook will make sure the point in *Messages* is at the end of buffer after every command, unless you’re currently editing the *Messages buffer itself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Can’t create handler inside thread that has not called Looper.prepare() inside AsyncTask
Possible Duplicate: emacs lisp, how to get buffer major mode? Is there a way
Possible Duplicate: Emacs code to automatically set indent-tabs-mode according to existing code When I'm
Possible Duplicate: Emacs: same buffer, two windows, one narrowed, one not I'd like to
Possible Duplicate: How to make org syntax links in any emacs buffer look like
Possible Duplicate: Using Emacs to recursively find and replace in text files not already
Possible Duplicate: How can I more easily switch between buffers in Emacs? While working
Possible Duplicate: How can I convert a list<> to a multi-dimensional array? I want
Possible Duplicate: How can I understand nested ?: operators in PHP? Why does this:
Possible Duplicate: Can main function call itself in C++? I found this problem very

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.