From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heikki Lehvaslaiho Subject: Cask-initialize messes up org table manipulation commands Date: Sat, 24 Sep 2016 09:20:08 +0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1142bdb2302018053d3ae421 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bngLA-0001yi-Jq for emacs-orgmode@gnu.org; Sat, 24 Sep 2016 02:21:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bngL5-00041w-Eh for emacs-orgmode@gnu.org; Sat, 24 Sep 2016 02:21:35 -0400 Received: from mail-lf0-f48.google.com ([209.85.215.48]:35885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bngL5-00041X-2A for emacs-orgmode@gnu.org; Sat, 24 Sep 2016 02:21:31 -0400 Received: by mail-lf0-f48.google.com with SMTP id g62so106785521lfe.3 for ; Fri, 23 Sep 2016 23:21:30 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --001a1142bdb2302018053d3ae421 Content-Type: text/plain; charset=UTF-8 * Problem 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. #+BEGIN_SRC sh /usr/local/bin/emacs -Q #+END_SRC * 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: #+BEGIN_EXAMPLE (source gnu) (source melpa) (source org) (depends-on "cask") #+END_EXAMPLE The init.el file was down to: #+BEGIN_EXAMPLE (package-initialize) (require 'cask "/usr/local/share/emacs/site-lisp/cask/cask.el") (cask-initialize) #+END_EXAMPLE 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? * Setup 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: #+BEGIN_EXAMPLE $ sw_vers ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G31 M-x emacs-version GNU Emacs 25.1.50.1 (x86_64-apple-darwin15.6.0, NS appkit-1404.47 Version 10.11.6 (Build 15G31)) of 2016-09-18 M-x org-version 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 0.8.0 #+END_EXAMPLE Incidentally, org-plus-contrib and plain org packages behave identically. * Footnotes [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.) --001a1142bdb2302018053d3ae421 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

* Problem

I wanted to script org mode table manipulations. The most basic tabl= e
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 m= y surprise the cursor jumped out
of the table! Trying with differ= ent 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 r= eproduce this?

* Clean run

Running bare emacs did not show this problem. The cursor stayed
between the cell borders.

#+BEGIN_SRC sh
/usr/local/bin/emacs -Q
#+END_SRC

* Cl= eaning emacs config

Assuming the culprit was some = package in my emacs config, I bisected
my init file to almost not= hing and still had the problem!

I am using Cask an= d 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.

<= /div>
The Cask file looks now like this:

#+BEG= IN_EXAMPLE
(source gnu)
(source melpa)
(sourc= e org)

(depends-on "cask")
#+E= ND_EXAMPLE

The init.el file was down to:

#+BEGIN_EXAMPLE
(package-initialize)
(r= equire 'cask "/usr/local/share/emacs/site-lisp/cask/cask.el")=
(cask-initialize)
#+END_EXAMPLE

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 com= bination
first before evaling the init.el content, the cursor beh= aviour does
not change even after cask has been initialized!

What is going on here?

* Setu= p

I have recently compiled version 25.1 of emacs u= sing homebrew
in my Mac. I regularly update emacs packages from m= elpa.
My current setup is:

#+BEGIN_EXAMP= LE
$ sw_vers
ProductName: Mac OS X
ProductVersion:= 10.1= 1.6
BuildVersion: 15G31

M-x emacs-version
GNU Emacs 25.1.50.1 (x86_64-apple-darwin15.6.0, NS appkit-1404.47 Ve= rsion 10.11.6 (Build 15G31)) of 2016-09-18

M-x org= -version
Org-mode version 8.3.6 (8.3.6-3-gf46b92-elpaplus @ /User= s/lehvasho/src/emacs-literal-config/.cask/25.1/elpa/org-plus-contrib-201609= 19/)

$ cask --version
0.8.0
#+= END_EXAMPLE

Incidentally, org-plus-contrib and pla= in org packages behave identically.

* Footnotes

[fn:1] The key binding actually calls org-cut-specia= l that is a
context sensitive command. It calls org-table-cut-reg= ion only inside
table cells. (The org-cut-special document string= has false
information claiming it calls org-table-copy.)

--001a1142bdb2302018053d3ae421--