I am going through emacs inbuilt Elisp tutorial. By default emacs fontifies( changes color ) visited links color like this

enter image description here

This fontification lasts only for current session. If i restart emacs, all fontification will be lost.

How can i make emacs to remember visited links even after restarting emacs so that it will be much easier for me to resume where i have stopped?


The history of visited nodes is stored in the variable Info-history-list. You will need to persist this variable across sessions. One way to do so it to use desktop-mode. Desktop mode automatically persists the variables that are declared in desktop-globals-to-save. So if you use desktop-mode something like the following should doe the trick

(add-to-list 'desktop-globals-to-save 'Info-history-list)

If you do not use desktop mode, you might have to write your own mechanism to persist the variable. Simplest would be write a function which runs on emacs exit (you can use the hook kill-emacs-hook to run the function at exit) that serializes the variable to a file using something like prin1-to-string.

You will then require another function which runs on emacs startup (you can use after-init-hook to run functions at startup) which reads the files and uses the function read to deserialize the the stored variable back. Of course this a lot of work to save a variable so I guess you can just use desktop-mode


@Iqbal gives a great answer to your question.

You might also consider using bookmarks to record Info locations of interest, including a bookmark for where you left off (which you update at the next left-off place, by just setting it again).

This is simple to do, and is exactly what you would do with a book or multiple books that you are reading.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.