Håkon Hægland
Håkon Hægland

Reputation: 40758

Push-mark not working properly in Emacs

I am using GNU Emacs 24.3.1 on Ubuntu 12.04. I have problem with understanding the push-mark function. For instance, open an empty buffer, type some text, and executing (print mark-ring t) gives nil in the echo area. Then doing

(push-mark)

and again (print mark-ring t) gives still nil in the echo area. I thought that I would now see something in the mark-ring. Further, doing a new (push-mark) at this point, and then (print mark-ring t) shows that the previous mark is now inside the mark ring..

Upvotes: 2

Views: 399

Answers (1)

gsg
gsg

Reputation: 9377

When a buffer is new, it has no current mark and mark operations will fail or do nothing. After placing a mark, perhaps with C-SPC, the mark-ring should do as you expected.

Apparently calling (push-mark) will create the mark if it doesn't exist, probably as an unintended side-effect.

Upvotes: 4

Related Questions