2
votes

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..

1
Which mode? I'm getting proper behavior in fundamental-mode. Also, I'm using eval-expression instead of print.abo-abo
@abo-abo M-x describe-mode gives text-mode with enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption Auto-Fill Blink-Cursor File-Name-Shadow Font-Lock Global-Eclim Global-Font-Lock Iswitchb Line-Number Menu-Bar Mouse-Wheel Savehist Tool-Bar Tooltip Transient-MarkHåkon Hægland
See if you can reproduce with emacs -q and fundamental. It's likely that one of the minor modes does this.abo-abo
@abo-abo I get the same behavior in fundamental mode.. When I open Emacs with -q option it still opens in text-mode, so I have to change manually to fundamental-modeHåkon Hægland
@abo-abo Still, in fundamental-mode I have the follwing enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption Blink-Cursor File-Name-Shadow Font-Lock Global-Font-Lock Line-Number Menu-Bar Mouse-Wheel Tool-Bar Tooltip Transient-MarkHåkon Hægland

1 Answers

4
votes

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.