doomemacs / doomemacs

An Emacs framework for the stubborn martian hacker
MIT License
19.13k stars 3.03k forks source link

Buffer shows 6 errors, but ]e and [e say "Moved past last error" or "Moved before first error" #2497

Open ocharles opened 4 years ago

ocharles commented 4 years ago

What did you expect to happen?

My point to move between the errors in the buffer.

What actually happened?

The point did not move, and I observed the error messages in the title in the minibuffer.

Additional details:

image

Steps to reproduce:

  1. Open a buffer with errors
  2. Observe red underlines from flycheck
  3. ]e and [e don't navigate to the errors.

System information:

``` emacs version 26.3 features XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS GLIB NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD build Feb 06, 2020 buildopts (--prefix=/nix/store/527r011zvqrrq2vha95wd5gcz5zqffcy-emacs-26.3 --disable-build-details --with-modules --with-x-toolkit=gtk3 --with-xft CFLAGS=-DMAC_OS_X_VERSION_MAX_ALLOWED=101200) windowsys x daemonp server-running doom version 2.0.9 build HEAD -> develop 75e7466ad 2020-02-04 21:02:26 -0500 dir ~/sync/dotfiles/doom-emacs/ system type gnu/linux config x86_64-pc-linux-gnu shell /nix/store/3h2dwk7n59q6i0m7l6rl9b04fjzb75mk-fish-3.0.2/bin/fish uname Linux 4.19.87 #1-NixOS SMP Sun Dec 1 08:17:47 UTC 2019 x86_64 path (/nix/store/2xwxj5qrrc71asdk1wyq19nz9k845pzs-patchelf-0.9/bin/ /nix/store/291ldi6fqsbmkbvbs8is4mcg3jb64ld4-gcc-wrapper-8.3.0/bin/ /nix/store/62x7m20m7lm8y8s17cbgha0sf3cmma19-gcc-8.3.0/bin/ /nix/store/hblpx8x5w88igmwa4ydnsnb65s363lji-glibc-2.27-bin/bin/ /nix/store/9v78r3afqy9xn9zwdj9wfys6sk3vc01d-coreutils-8.31/bin/ /nix/store/gwwycf3w6cbj0gd2mpgblrdjc24f3cys-binutils-wrapper-2.31.1/bin/ /nix/store/ajrrkivdfvp8dp4vdg5hp1h5hblmanc9-binutils-2.31.1/bin/ /nix/store/hblpx8x5w88igmwa4ydnsnb65s363lji-glibc-2.27-bin/bin/ /nix/store/9v78r3afqy9xn9zwdj9wfys6sk3vc01d-coreutils-8.31/bin/ /nix/store/shcx8rm32bqmssl5qrdgmjksnrmczb6w-ghc-8.8.1-with-packages/bin/ /nix/store/ilhixh2xz875r5lrml8dmxfqa2w7bnq9-autossh-1.4g/bin/ /nix/store/f0230h60qhxaf40mwvx0rwzqk4pa15az-awscli-1.16.215/bin/ /nix/store/q20xz6iq493vha5425cbr4l6q190b39i-python-2.7.17/bin/ /nix/store/gwwycf3w6cbj0gd2mpgblrdjc24f3cys-binutils-wrapper-2.31.1/bin/ /nix/store/ajrrkivdfvp8dp4vdg5hp1h5hblmanc9-binutils-2.31.1/bin/ /nix/store/hblpx8x5w88igmwa4ydnsnb65s363lji-glibc-2.27-bin/bin/ /nix/store/9v78r3afqy9xn9zwdj9wfys6sk3vc01d-coreutils-8.31/bin/ /nix/store/4xfdibhli9sbg4ak8hck670cqd5nj0xb-cabal-install-3.0.0.0/bin/ /nix/store/7ks8i5ipbvgi0wpd6nqpnzicdbg4dbzq-cabal2nix-2.15.0/bin/ /nix/store/xj9qhpp1mgrrvijkr4va27dvb05p4rnx-install-ch/bin/ /nix/store/jl1vs3hikhc5vbhsav8mqf4qfsgl0adx-cloc-1.82/bin/ /nix/store/x1l6primhlgb2rywphwijmvbsjsd3h1q-node__at_elm-tooling_slash_elm-language-server-1.4.6/bin/ /nix/store/493lbsa19l1ya3dlgjhgsk25f081czh5-fast-downward/bin/ /nix/store/97jr1za9zf9rh1791nvd07raa5c4nd0j-dbmigrations-postgresql-2.0.0/bin/ /nix/store/5mi9w49wmr3h21nrvidp73ciypm6q22m-ghcide-0.1.0/bin/ /nix/store/6bn95g97780i4dfza5drydv28wcsm7ad-ghc-8.8.1/bin/ /nix/store/291ldi6fqsbmkbvbs8is4mcg3jb64ld4-gcc-wrapper-8.3.0/bin/ /nix/store/62x7m20m7lm8y8s17cbgha0sf3cmma19-gcc-8.3.0/bin/ /nix/store/hblpx8x5w88igmwa4ydnsnb65s363lji-glibc-2.27-bin/bin/ /nix/store/9v78r3afqy9xn9zwdj9wfys6sk3vc01d-coreutils-8.31/bin/ /nix/store/8bgh18kv3y6k7qfs0irx33mcmxi5dh4z-shake-0.18.5/bin/ /nix/store/dv8hxpj4zm5kxdzdnlkxb4gqiyw6bv83-hie-bios-0.4.0/bin/ /nix/store/iy3zkjn5hdzdlb42bshqvwmnv8w4qr9r-ghcid-0.7.5-bin/bin/ /nix/store/n81jr2f6cid1xjpr0p88zj59vmgsfpzz-ch-hs-imports-0.1.0.0/bin/ /nix/store/hsqf4nynwr3xyk9xn54gwrfaqzbkd6hc-ch-hs-format-1.0.0/bin/ /nix/store/ayw3dxgplkzn64947pygk8q1k6yci9an-hlint-2.2.7/bin/ /nix/store/xwczg80fqqys3c4jms64d13mzjmwsm2r-cpphs-1.20.8/bin/ /nix/store/517pr6rckpzvk9msywdbsi8b7rxvh8ij-hscolour-1.24.4/bin/ /nix/store/ajsjsd5vj6hfhzx5wcr3ihbw7w9z6qv1-node-heroku-cli-6.14.36/bin/ /nix/store/an2x98z0lnaplabrar8cdrncpbi8lfch-nix-prefetch-scripts/bin/ /nix/store/bxc37f2jxlz6cbvdgrvmvm2k4gr3x75k-nixops-1.7/bin/ /nix/store/39cdzh05fzi13f06pa0rly3d5l53vsfk-pkg-config-0.29.2/bin/ /nix/store/iss8khq13fmbv0whswz2c1hvzcg2m5jy-postgresql-11.5/bin/ /nix/store/lm9hlj9263bqhx6j5jk15p2qiwrf7vrc-pylon-5.0.1-bin/bin/ /nix/store/rxqycwljxhj3xa29m0ywzi323ibif1wq-rlwrap-0.43/bin/ /nix/store/kphrpmxh8kfm52xb22fqp838f2drbzp2-sshpass-1.06/bin/ /nix/store/73spb8hm85q3b5g56aim8ipmzsl0bsw2-vault-1.2.3-bin/bin/ /nix/store/f47jgdzxacxswf3aryp85ykd3hb5lfaf-which-2.21/bin/ /nix/store/r6ni7j5s3gxn1wlj4d7ddygq2pm3pnky-qtdeclarative-5.12.3-bin/bin/ /nix/store/r6ni7j5s3gxn1wlj4d7ddygq2pm3pnky-qtdeclarative-5.12.3-bin/bin/ /nix/store/q14xzd39xbnyzb3aa87qpls1miyqqyw6-qtwayland-5.12.3-bin/bin/ /nix/store/q14xzd39xbnyzb3aa87qpls1miyqqyw6-qtwayland-5.12.3-bin/bin/ /nix/store/nb9hvnx08qs1xph4irfq37lh87w8pvrk-zbar-0.23/bin/ /nix/store/bbfwxj0v763kmmzl20gh4ga0j8pszdp6-perl5.30.0-ack-3.0.2/bin/ /nix/store/818wjih1iblsigh869m1cv7dc4jxg313-ghci-bios/bin/ /nix/store/w2sf040dwkapns8nxzkqlcy3rjxvbm3j-format-branch/bin/ /nix/store/crrp2cpvxdh36q7vzzs811z68jhc8v13-format-files/bin/ /nix/store/ga2p0g6ix3vbhhz9i35qi00ivar2xxan-format-changes/bin/ /nix/store/r82wjc2dj1m8w5s48xbmrq8sl64zqlpn-nixpkgs-fmt-0.6.1/bin/ /nix/store/fsvvwg0cxadsm3f90x0za73y08pq7f8v-inotify-tools-3.20.1/bin/ /nix/store/6rgmbzwjj8v51kxzlg3lz6pgxcv9a7m8-ratelimit-0.0.1/bin/ /nix/store/g546036iy55s05a8bmkww3y8mydh2ckc-elm-0.19.1/bin/ /nix/store/hc99r8c15bh60nnwnaybzsjkk463jpji-elm-format-0.8.2/bin/ /nix/store/3nny9ibbir2840z5kgj7n0dd7jjywz91-node_elm-test-0.19.1/bin/ /nix/store/hcraxhrd04g7gq3yl0sxh19id1fig1f6-elm2nix-0.1.1/bin/ /nix/store/d267am6309s9k479wg1rwr4w7igls2zp-yarn-1.19.0/bin/ /nix/store/ndfwl6yhwawvlriynw1ka4c7grzhnlq3-node-gulp-cli-2.2.0/bin/ /nix/store/2swdk69qyb28dm2gflwqrld9aacihmvs-node-elm-live-3.4.0/bin/ /nix/store/q5ic2gjmn25sf3azh1s2vx3b0bkl1jqq-node-coffee-script-1.12.7/bin/ /nix/store/iali4yvc2y9vpbs8an9ba8ylyjisvzbs-node-node2nix-1.7.0/bin/ /nix/store/4lb3zkl5h23a0qvbdlfny95qz5rqhnsi-python2.7-setuptools-41.2.0/bin/ /nix/store/vdgs2j875xhkjwncwwhh2q85xdwqdv2a-z3-4.8.5/bin/ /nix/store/8y3q0h0s3c1bzha7md2svcjnyjb617b7-kicadHead/bin/ /nix/store/wf14w6ay6sk3j6ibn0nf5c58r3z38hd8-python2.7-wxPython-3.0.2.0/bin/ /nix/store/knb6qx7zmsgxjgxp4hfb23pkncfcpqng-kicadPython-2.7.17/bin/ /nix/store/99dl7h6bm405rk1q3wy9yv1m47ipj2lc-eagle-9.4.2/bin/ /nix/store/my5v4x1n5568vgziyc63vmc97nk8ril9-ncurses-6.1-20190112/bin/ /nix/store/my5v4x1n5568vgziyc63vmc97nk8ril9-ncurses-6.1-20190112/bin/ /nix/store/9v78r3afqy9xn9zwdj9wfys6sk3vc01d-coreutils-8.31/bin/ /nix/store/0zdsw4qdrwi41mfdwqpxknsvk9fz3gkb-findutils-4.7.0/bin/ /nix/store/dys98skw6ifw5qsqrhjxjjiydyfbg3nq-diffutils-3.7/bin/ /nix/store/g2h4491kab7l06v9rf1lnyjvzdwy5ak0-gnused-4.7/bin/ /nix/store/71y5ddyz8vmsw9wgi3gzifcls53r60i9-gnugrep-3.3/bin/ /nix/store/84yafwjc6sga23vwsbahhymikjhfbnw4-gawk-5.0.1/bin/ /nix/store/aawf0q16ql39w2gwv52qyjfzgbg5f22r-gnutar-1.32/bin/ /nix/store/afyqk8219zfv5and3pqahzvn6bpmx3dq-gzip-1.10/bin/ /nix/store/iws7dm1jij4lv09mbpwf9i8lc1d4b798-bzip2-1.0.6.0.1-bin/bin/ /nix/store/j8fq1ksp37w88rx80blzazldi17f3x7s-gnumake-4.2.1/bin/ /nix/store/rm1hz1lybxangc8sdl7xvzs5dcvigvf7-bash-4.4-p23/bin/ /nix/store/lmi2nqb1cfzr3ps2zkq97q88zzkhp4mj-patch-2.7.6/bin/ /nix/store/y04xj2mbc66zs53fackn1wwlrv31bv3y-xz-5.2.4-bin/bin/ ~/bin/ /run/wrappers/bin/ ~/.nix-profile/bin/ /etc/profiles/per-user/ollie/bin/ /nix/var/nix/profiles/default/bin/ /run/current-system/sw/bin/ /nix/store/527r011zvqrrq2vha95wd5gcz5zqffcy-emacs-26.3/libexec/emacs/26.3/x86_64-pc-linux-gnu/) config envfile nil elc-files 130 modules (:completion (company +childframe) (ivy +icons +prescient) :ui doom doom-dashboard doom-quit hl-todo modeline nav-flash ophints (popup +all +defaults) vc-gutter (window-select +switch-window) workspaces :editor (evil +everywhere) file-templates fold rotate-text :emacs dired electric ibuffer vc :term vterm :checkers (syntax +childframe) :tools direnv (lookup +docsets) lsp magit :lang data (elm +lsp) emacs-lisp (haskell +lsp) javascript markdown nix (org +attach +babel +capture +export +present) rst sh :config (default +bindings +smartparens)) packages ((magit-todos :disable t)) elpa (posframe pkg-info flycheck-posframe flycheck epl dash) unpin (n/a) ```

My Config

;;; init.el -*- lexical-binding: t; -*-

(doom! :input

       :completion
       (company +childframe)
       (ivy +icons +prescient)

       :ui
       doom              ; what makes DOOM look the way it does
       doom-dashboard    ; a nifty splash screen for Emacs
       doom-quit         ; DOOM quit-message prompts when you quit Emacs
       hl-todo           ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
       modeline          ; snazzy, Atom-inspired modeline, plus API
       nav-flash         ; blink the current line after jumping
       ophints           ; highlight the region an operation acts on
       (popup            ; tame sudden yet inevitable temporary windows
        +all             ; catch all popups that start with an asterix
        +defaults)       ; default popup rules
       vc-gutter         ; vcs diff in the fringe
       (window-select +switch-window)     ; visually switch windows
       workspaces        ; tab emulation, persistence & separate workspaces

       :editor
       (evil +everywhere); come to the dark side, we have cookies
       file-templates    ; auto-snippets for empty files
       fold              ; (nigh) universal code folding
       rotate-text       ; cycle region at point between text candidates

       :emacs
       dired             ; making dired pretty [functional]
       electric          ; smarter, keyword-based electric-indent
       ibuffer           ; interactive buffer management
       vc                ; version-control and Emacs, sitting in a tree

       :term
       vterm

       :checkers
       (syntax +childframe)

       :tools
       direnv
       (lookup           ; helps you navigate your code and documentation
        +docsets)        ; ...or in Dash docsets locally
       lsp
       magit

       :lang
       data              ; config/data formats
       (elm +lsp)               ; care for a cup of TEA?
       emacs-lisp        ; drown in parentheses
       (haskell +lsp)           ; a language that's lazier than I am
       javascript        ; all(hope(abandon(ye(who(enter(here))))))
       markdown          ; writing docs for people to ignore
       nix               ; I hereby declare "nix geht mehr!"
       (org              ; organize your plain life in plain text
        +attach          ; custom attachment system
        +babel           ; running code in org
        +capture         ; org-capture in and outside of Emacs
        +export          ; Exporting org to whatever you want
        +present)        ; Emacs for presentations
       rst
       sh                ; she sells (ba|z)sh shells on the C xor

       :email
       :app

       :config
       (default +bindings +smartparens))

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(ansi-color-names-vector
   ["#21242b" "#e45649" "#50a14f" "#986801" "#4078f2" "#a626a4" "#0184bc" "#383a42"])
 '(custom-safe-themes
   (quote
    ("728eda145ad16686d4bbb8e50d540563573592013b10c3e2defc493f390f7d83" "2d1fe7c9007a5b76cea4395b0fc664d0c1cfd34bb4f1860300347cdad67fb2f9" "2d392972cbe692ee4ac61dc79907af65051450caf690a8c4d36eb40c1857ba7d" "34c99997eaa73d64b1aaa95caca9f0d64229871c200c5254526d0062f8074693" "ab9456aaeab81ba46a815c00930345ada223e1e7c7ab839659b382b52437b9ea" default)))
 '(fci-rule-color "#383a42")
 '(jdee-db-active-breakpoint-face-colors (cons "#f0f0f0" "#4078f2"))
 '(jdee-db-requested-breakpoint-face-colors (cons "#f0f0f0" "#50a14f"))
 '(jdee-db-spec-breakpoint-face-colors (cons "#f0f0f0" "#9ca0a4"))
 '(objed-cursor-color "#e45649")
 '(vc-annotate-background "#fafafa")
 '(vc-annotate-color-map
   (list
    (cons 20 "#50a14f")
    (cons 40 "#688e35")
    (cons 60 "#807b1b")
    (cons 80 "#986801")
    (cons 100 "#ae7118")
    (cons 120 "#c37b30")
    (cons 140 "#da8548")
    (cons 160 "#c86566")
    (cons 180 "#b74585")
    (cons 200 "#a626a4")
    (cons 220 "#ba3685")
    (cons 240 "#cf4667")
    (cons 260 "#e45649")
    (cons 280 "#d2685f")
    (cons 300 "#c07b76")
    (cons 320 "#ae8d8d")
    (cons 340 "#383a42")
    (cons 360 "#383a42")))
 '(vc-annotate-very-old-color nil))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
hlissner commented 4 years ago

Have you changed the value of lsp-prefer-flymake (Doom sets it to nil by default). Flycheck shouldn't miss errors like this unless you're actually using flymake.

Could you also report the value of next-error-function?

ocharles commented 4 years ago

lsp-prefer-flymake is nil, next-error-function is 'flycheck-next-error-function

ocharles commented 4 years ago

Strangely I just had this and it's suddenly snapped back to working, so for some reason it gets "lost" and something restores it...

ocharles commented 4 years ago

Just wanted to check in and say I'm still frequently running into this. lsp-diagnostic-package is "Pick flycheck if present and fallback to flymake". ]e is bound to next-error. Interestingly C-c ! n does work, and that's flycheck-next-error.

yglukhov commented 4 years ago

Having this issue too. Interestingly if I go to compilation buffer and do SPC : compilation-mode it starts working, but only until the next compilation.

EDIT: Turned out my issue was a bad regexp that didn't match against ANSI color escape sequences which my build tool produced.

lucafanselau commented 2 years ago

Is there any solution, I am experiencing the same issue.

d-miketa commented 2 years ago

I experience the same error in Python buffers, sometimes it works and sometimes it doesn't. flycheck-next-error always works.

bo-tato commented 1 year ago

I had the same problem as everyone else here where C-c ! n or flycheck-next-error does work as expected, but ]e or next-error sometimes works sometimes doesn't and I think I somewhat understand the cause. next-error will run next-error-find-buffer to get what buffer it should look at, which isn't necessarily the currently visible buffer as you might expect. I think the reasoning for that is if you're going through errors in a file, you navigate away to view definition or something, and then do next-error and you go again to the next error in the file you were working through, not in the file you navigated away to. When I think the behaviour is just downright confusing though, is in the case where I have errors in a buffer, I fix them, no more errors in it, then I'm working in another buffer and it has flycheck errors, but next-error says "no more flycheck errors found" because next-error-find-buffer is actually returning the now error-free buffer I was previously working in, not the buffer I'm currently working in with underlined flycheck errors. There's a big discussion on this on the emacs mailing list here. I still don't understand exactly the next-buffer behaviour or the reasoning behind it, but I set:

(setq next-error-find-buffer-function 'next-error-buffer-unnavigated-current)

and now it mostly works as I expect it to, and in the rare case where it doesn't I can do M-x next-error-select-buffer to manually select what buffer next-error should use