I wanted to script org mode table manipulations. The most basic table
command is org-table-cut-region (C-c C-x C-w)[fn:1].
I tried this with simplest possible table:
| x |
The cell content disappears but to my surprise the cursor jumped out
of the table! Trying with different tables, it came clear that the
cursor always jumped one line down and left of the table). (Under the
left border if you have a box cursor.) That should not happen!
Can anyone reproduce this?
* Clean run
Running bare emacs did not show this problem. The cursor stayed
between the cell borders.
* Cleaning emacs config
Assuming the culprit was some package in my emacs config, I bisected
my init file to almost nothing and still had the problem!
I am using Cask and pallet to keep track of the packages installed.
I removed all depends-on statements from my Cask file including the
one for pallet before I found the source of the problem.
The Cask file looks now like this:
The init.el file was down to:
(require 'cask "/usr/local/share/emacs/site-lisp/cask/cask.el")
If I remove the (cask-initialize) line, the cursor stays inside the
org table cell.
* Order matters
The final twist to this story is that if I start emacs, create an org
buffer with a table, and run org-table-cut-region key combination
first before evaling the init.el content, the cursor behaviour does
not change even after cask has been initialized!
What is going on here?
I have recently compiled version 25.1 of emacs using homebrew
in my Mac. I regularly update emacs packages from melpa.
My current setup is:
ProductName: Mac OS X
GNU Emacs 188.8.131.52 (x86_64-apple-darwin15.6.0, NS appkit-1404.47 Version 10.11.6 (Build 15G31)) of 2016-09-18
Org-mode version 8.3.6 (8.3.6-3-gf46b92-elpaplus @ /Users/lehvasho/src/emacs-literal-config/.cask/25.1/elpa/org-plus-contrib-20160919/)
$ cask --version
Incidentally, org-plus-contrib and plain org packages behave identically.
[fn:1] The key binding actually calls org-cut-special that is a
context sensitive command. It calls org-table-cut-region only inside
table cells. (The org-cut-special document string has false
information claiming it calls org-table-copy.)