Emacs bookmark-jump: how to switch to bmark, and only one of the changes in split windows changes?

I start with the file visible in one window; then I am doing a split window, so now both windows show the same content (at the same buffer point).

Now I want to go to another place in the file through the bookmark in only one of the two windows, but when I scan the bookmarks, both windows end at the bookmark point.

Leave another point of the window yourself!

How can I customize this?

thanks

(works on linux, GNU Emacs 23.2.1, xemacs does not behave like this)


post note:

What I would like to do is show the same file in both windows, and although one window (w1) shows the file section, in the other window (w2) I jump to different sections using different bookmarks, while position w1 does not change.

+4
source share
6 answers

Answering your own question (in a couple of years):

started using emacs 24 (24.3.1), which "fixed" this unwanted behavior.

0
source

There may be a direct answer, but on the whole I found that all kinds of things become inconvenient when displaying the same buffer in multiple windows. I recommend using indirect buffers . Run Mx clone-indirect-buffer to create another buffer, or Cx 4 c ( clone-indirect-buffer-other-window ) to also display the new buffer in another window. The indirect buffer has the same contents as the original, and the save is stored in the same files, but the buffers have

  • independent points, marks, markers;
  • independent modes (and more general independent local variables);
  • independent representations (narrowing, hidden text, faces, ...).
+1
source

This does not directly answer your question, but provides an alternative solution to your problem. I use bm.el for visible bookmarks. If the same file is displayed in two windows, then switching using visible bookmarks only changes the point in the current buffer.

I configured the package with the following:

 (require 'bm) (setq bm-highlight-style 'bm-highlight-only-fringe) (global-set-key (kbd "<C-f2>") 'bm-toggle) (global-set-key (kbd "<f2>") 'bm-next) (global-set-key (kbd "<S-f2>") 'bm-previous) 
+1
source

If you use the clone-indirect-buffer-another-window with the + tab and autostart entries (Cx p RET / Cx pn / Cx pp), it will work the way you want. Without a clone, bookmark + seems to have the same problem for me.

+1
source

I use this function (I swear, copied from the Internet) to do the splitting. using this, I think you can get what you do, but the order is to do the opposite.

1) open another file using the bookmark.
2) split the window.

 ;;---------------------------------------------------------------------------- ;; When splitting window, show (other-buffer) in the new window ;;---------------------------------------------------------------------------- (defun split-window-func-with-other-buffer (split-function) "dont just dumb split window, change buffer as well" (lexical-let ((sf split-function)) (lambda () (interactive) (funcall sf) (set-window-buffer (next-window) (other-buffer))))) (global-set-key "\C-x2" (split-window-func-with-other-buffer 'split-window-vertically)) (global-set-key "\C-x3" (split-window-func-with-other-buffer 'split-window-horizontally)) 
0
source

Try Bookmark + . It does not change the window point in other windows as you describe.

0
source

All Articles