doomemacs / doomemacs

An Emacs framework for the stubborn martian hacker
MIT License
19.4k stars 3.05k forks source link

TAB should run org-cycle in org-mode files #2435

Closed ineu closed 4 years ago

ineu commented 4 years ago

What did you expect to happen? TAB key should expand headlines, drawers etc in org-mode. TAB key should be bound to org-cycle.

What actually happened?

Additional details: I believe this changed happened on the weekend of January 25-26. I'm pretty sure it worked on the previous Friday.

System information:

((emacs
  (version . "26.3")
  (features . "XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD LCMS2")
  (build . "авг 29, 2019")
  (buildopts "--prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-modules 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now")
  (windowsys . batch)
  (daemonp . server-running))
 (doom
  (version . "2.0.9")
  (build . "HEAD -> develop, origin/develop, origin/HEAD 471be76ba 2020-01-27 02:05:14 -0500")
  (dir . "~/.dotfiles/ineu/.doom.d/"))
 (system
  (type . gnu/linux)
  (config . "x86_64-pc-linux-gnu")
  (shell . "/usr/bin/zsh")
  (uname . "Linux 5.4.15-arch1-1 #1 SMP PREEMPT Sun, 26 Jan 2020 09:48:50 +0000 x86_64")
  (path "~/.bin" "~/.bin.local" "/usr/local/bin" "/usr/bin" "/bin" "/usr/local/sbin" "/usr/lib/jvm/default/bin" "/usr/bin/site_perl" "/usr/bin/vendor_perl" "/usr/bin/core_perl" "~/.antigen/bundles/robbyrussell/oh-my-zsh/lib" "~/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/git" "~/.deliver/bin" "~/.local/bin" "~/.gem/bin" "~/.node_modules/bin" "~/.emacs.d/bin" "/usr/lib/emacs/26.3/x86_64-pc-linux-gnu"))
 (config
  (envfile . envvar-file)
  (elc-files . 0)
  (modules :completion company ivy :ui doom doom-dashboard fill-column hydra modeline nav-flash ophints (popup +all +defaults) treemacs vc-gutter vi-tilde-fringe window-select workspaces :editor (evil +everywhere) file-templates fold multiple-cursors rotate-text snippets :emacs (dired +icons) electric ibuffer vc :term vterm :checkers syntax :tools (eval +overlay) (lookup +docsets) magit :lang data emacs-lisp (javascript +lsp) markdown org plantuml (ruby +lsp) sh :config literate (default +bindings +smartparens))
  (packages evil-lion org-mru-clock vimrc-mode "(org-cliplink :pin \"82402cae7e\")" org-journal haml-mode dockerfile-mode try "(rjsx-mode :pin \"014c760138\")" feature-mode jinja2-mode terraform-mode graphviz-dot-mode highlight-indent-guides counsel-jq tabbar "(typescript-mode :pin \"a0f2c3ebd4\")" "(rubocop :disable t :pin \"03bf15558a\")")
  (elpa "n/a")
  (unpin "n/a")))

ineu commented 4 years ago

Actually it's more interesting. I encounter such behavior if I open an org file from the agenda. But if I kill the buffer and open it again from recent files, it works as expected

hlissner commented 4 years ago

TAB should already be bound to org-cycle by evil-org (and has been for a couple months). I cannot reproduce any other behavior and am not aware of changes that would affect this. I'm at a loss as how to debug this atm.

EDIT: could you see if it can be reproduced in the sandbox? (In vanilla Doom via C-c C-p)

ineu commented 4 years ago

It's not reproducible in a C-c C-p sandbox, but is reproducible in C-c C-f one. I also found out that if I open an org-mode file (even blank one or the scratch buffer with M-x org-mode), then open a second org-mode file, then TAB works fine in the latter. This sounds like some kind of a race condition/lazy loading issue related to my local config. Investigating further.

ineu commented 4 years ago

So it was caused by a seemingly unrelated line in my config:

(org-clock-persistence-insinuate)       ; Resume clocking task when emacs is restarted
showgood commented 4 years ago

I encountered this issue from time to time, never figured out what's causing the problem..

hlissner commented 4 years ago

@ineu Not sure how that's possible. I can't reproduce it with (org-clock-persistence-insinuate) in my config. Side note: you don't need to use that function; Doom does it for you, manually: https://github.com/hlissner/doom-emacs/blob/develop/modules/lang/org/config.el#L803-L815

ineu commented 4 years ago

I suspect this got broken on a specific org-mode version, because it used to work the week before. Good to know I don't actually need this line. It was there for ages, through different emacs frameworks and starting kits. I'm going to close the issue, for it is specific to my config. Thanks for your help.

tdehaeze commented 4 years ago

Hi @ineu, did you manage to find to source of the problem? I have the same issue for some time now, this is quite annoying. Thanks

ineu commented 4 years ago

Not really. But what I discovered is that I can simply enter insert mode, then back to the command mode (that is: i Esc) and it works. Simple enough to not bother with searching further for now.

tdehaeze commented 4 years ago

Awesome, thanks!