emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Cask-initialize messes up org table manipulation commands
@ 2016-09-24  6:20 Heikki Lehvaslaiho
  2016-09-29  3:53 ` Adam Porter
  0 siblings, 1 reply; 4+ messages in thread
From: Heikki Lehvaslaiho @ 2016-09-24  6:20 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2552 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 3999 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Cask-initialize messes up org table manipulation commands
  2016-09-24  6:20 Cask-initialize messes up org table manipulation commands Heikki Lehvaslaiho
@ 2016-09-29  3:53 ` Adam Porter
  2016-10-01  7:08   ` Heikki Lehvaslaiho
  0 siblings, 1 reply; 4+ messages in thread
From: Adam Porter @ 2016-09-29  3:53 UTC (permalink / raw)
  To: emacs-orgmode

Heikki Lehvaslaiho <heikki.lehvaslaiho@gmail.com> writes:

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

This may not be much help, because I'm still using Org 8.2.4, but I
tried and was unable to reproduce this; the cursor remains in the table.

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

You said you bisected your init file; I assume you used the bug-hunter
package?  If by chance you did it manually instead, I would recommend
doing it again with bug-hunter; maybe you made a tiny mistake that threw
the whole thing off.  :)

Since it doesn't happen with "emacs -Q", I guess it must be someting in
your config.  (Though you might test with "emacs -q" also--there is a
difference.)

I don't use Cask, so I can't help you much there.  What follows is what
may be considered an unhelpful suggestion, but it's the best idea I
have: switch from Cask/Pallet to use-package; it may give you
finer-grained control over your init file, and bisecting may work
better.  I don't know remember how Cask works exactly, but if
cask-initialize "monolithically" loads all the packages you have
configured, I'm guessing you won't be able to bisect within it to figure
out which package is causing the problem.

Hope this helps.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Cask-initialize messes up org table manipulation commands
  2016-09-29  3:53 ` Adam Porter
@ 2016-10-01  7:08   ` Heikki Lehvaslaiho
  2016-10-01 18:47     ` Adam Porter
  0 siblings, 1 reply; 4+ messages in thread
From: Heikki Lehvaslaiho @ 2016-10-01  7:08 UTC (permalink / raw)
  To: Adam Porter; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 3134 bytes --]

Thanks for suggestions, Adam.

I had not realised that the bug-hunter package can do interactive tests. I
used it now and got the same result: the problem is caused by
the (cask-initialize) expression.

As far as I understand, cask-initialize only collects the directory
locations and dependencies of packages as a struct that is then processed
later during the emacs start-up. How that can mess up the org cursor
movement is a complete mystery to me.

I am using org mode and use-package to maintain, launch and configure my
packages. The culprit can not be the tangling process nor the launching of
the packages because they happens after cask is initialized (and bug-hunter
works on elisp file, only).

I did try emacs with the -q but did not see any difference to -Q.

The one piece of information that I did not include in my posting: My emacs
comes from homebrew git HEAD and is installed it with:

brew unlink emacs
brew uninstall emacs
brew install emacs --HEAD --use-git-head --with-cocoa --with-gnutls
--with-rsvg --with-imagemagick
brew linkapps

Maybe I should try raising an issue for cask (https://github.com/cask/cask).

Cheers,


     -Heikki

Heikki Lehväslaiho - skype:heikki_lehvaslaiho cell: +358 40 850 6640
http://about.me/heikki

On 29 September 2016 at 06:53, Adam Porter <adam@alphapapa.net> wrote:

> Heikki Lehvaslaiho <heikki.lehvaslaiho@gmail.com> writes:
>
> > 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!
>
> This may not be much help, because I'm still using Org 8.2.4, but I
> tried and was unable to reproduce this; the cursor remains in the table.
>
> > 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!
>
> You said you bisected your init file; I assume you used the bug-hunter
> package?  If by chance you did it manually instead, I would recommend
> doing it again with bug-hunter; maybe you made a tiny mistake that threw
> the whole thing off.  :)
>
> Since it doesn't happen with "emacs -Q", I guess it must be someting in
> your config.  (Though you might test with "emacs -q" also--there is a
> difference.)
>
> I don't use Cask, so I can't help you much there.  What follows is what
> may be considered an unhelpful suggestion, but it's the best idea I
> have: switch from Cask/Pallet to use-package; it may give you
> finer-grained control over your init file, and bisecting may work
> better.  I don't know remember how Cask works exactly, but if
> cask-initialize "monolithically" loads all the packages you have
> configured, I'm guessing you won't be able to bisect within it to figure
> out which package is causing the problem.
>
> Hope this helps.
>
>
>

[-- Attachment #2: Type: text/html, Size: 4289 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Cask-initialize messes up org table manipulation commands
  2016-10-01  7:08   ` Heikki Lehvaslaiho
@ 2016-10-01 18:47     ` Adam Porter
  0 siblings, 0 replies; 4+ messages in thread
From: Adam Porter @ 2016-10-01 18:47 UTC (permalink / raw)
  To: emacs-orgmode

Heikki Lehvaslaiho <heikki.lehvaslaiho@gmail.com> writes:

> Maybe I should try raising an issue for cask
> (https://github.com/cask/cask).

I guess that's your best bet now.  Hopefully the author will be able to
figure it out.  Please let us know what you find out.  :)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-01 18:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-24  6:20 Cask-initialize messes up org table manipulation commands Heikki Lehvaslaiho
2016-09-29  3:53 ` Adam Porter
2016-10-01  7:08   ` Heikki Lehvaslaiho
2016-10-01 18:47     ` Adam Porter

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).