alphapapa / magit-todos

Show source files' TODOs (and FIXMEs, etc) in Magit status buffer
GNU General Public License v3.0
744 stars 48 forks source link

Cannot insert keybindings into `magit-status-jump` #192

Open mmahmoudian opened 1 month ago

mmahmoudian commented 1 month ago

Thanks for the useful and handy package and thank you for maintaining it.

I've been lately getting this error when using magit:

Cannot insert [("T" "Todos" magit-todos-jump-to-todos) ("l" "List todos" magit-todos-list)] into magit-status-jump; (0 -1) not found

I checked the existing issues on this repo and considering that no one else have reported this, it might mean that something is wrong with my config, although that is not very likely as my config is fairly minimal. The following is my magit and magit-todos config:

(use-package magit
  :ensure t
  :defer t
  :config
  (defun mm/magit-kill-buffers ()
    "Restore window configuration and kill all Magit buffers.

-------
Author: Manuel Uberti
Date of post: 2018-02-17
URL of post: https://manueluberti.eu/2018/02/17/magit-bury-buffer.html
Date of adoption: 2023-03-29T18:18:39+03:00
-------
"
    (interactive)
    (let ((buffers (magit-mode-get-buffers)))
      (magit-restore-window-configuration)
      (mapc #'kill-buffer buffers)))
  (bind-key "q" #'mm/magit-kill-buffers magit-status-mode-map)

  :hook (
         (magit-status-mode . (lambda () (setq
                                   show-trailing-whitespace nil      ; disable the highlighting of trailing whitespace
                                   indicate-empty-lines nil          ; remove the glyph for showing the end of buffer
                                   indicate-buffer-boundaries nil    ; remove the glyphs to show buffer boundaries
                                   )))
        )
  )

(use-package magit-todos
  :ensure t
  :defer t
  :config
    (setq magit-todos-depth 21
          magit-diff-refine-hunk 'all
          ;magit-todos-rg-extra-args " --max-filesize 50K "
          )
    (setq magit-todos-exclude-globs
          (append magit-todos-exclude-globs
                  (list
                   ".git/"
                   "elpy/" "venv/" "bootstrap/"                      ; library folders
                   "*.json" "*.csv" ".xml"                           ; data files
                   "*.zip" "*.tar" "*.gz" "*.xz"                     ; compressed files
                   "*.old" "*.bk"                                    ; backup files
                   "*.log"                                           ; log files
                   "*.js.map"
                   )))
  :hook (
         (magit-mode . magit-todos-mode)
         ))

I would be thankful if you kindly point me to the right direction regarding this issue. If you need further information, I'll be happy to provide them.

alphapapa commented 1 month ago

Hi,

Thanks for the useful and handy package and thank you for maintaining it.

Thanks for the kind words. I'm glad it's useful to you.

I've been lately getting this error when using magit:

Please try to reproduce the problem in a clean Emacs config with the latest versions of relevant packages. You might use this script to make that easier: https://github.com/alphapapa/with-emacs.sh