emacs-helm / helm

Emacs incremental completion and selection narrowing framework
https://emacs-helm.github.io/helm/
GNU General Public License v3.0
3.35k stars 389 forks source link

Helm recursive grep with adaptive history #986

Closed tollerm closed 9 years ago

tollerm commented 9 years ago

When performing recursive helm-grep and adaptive-history-mode is on, I got the error message "Wrong type argument: listp, ..." When looking further it turned out that the variable helm-adaptive-history is initialized to the value (("helm grep extensions" ("_" ...))) that obviously resulted in this error message. When I change the variable helm-adaptive-history to the expected value (("helm grep extensions" ("_" . 1))), everything works fine. It seems that there is a problem with initializing this variable. Best regards, Toller

thierryvolpiatto commented 9 years ago

tollerm notifications@github.com writes:

When performing recursive helm-grep and adaptive-history-mode is on, I got the error message "Wrong type argument: listp, ..." When looking further it turned out that the variable helm-adaptive-history is initialized to the value (("helm grep extensions" ("" ...))) that obviously resulted in this error message. When I change the variable helm-adaptive-history to the expected value (("helm grep extensions" ("" . 1))), everything works fine. It seems that there is a problem with initializing this variable.

For some reasons, it seems your helm-adaptative-history file is corrupted, you should quit emacs, delete the file and restart emacs.

Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997

tollerm commented 9 years ago

Dear Thierry, I've deleted my helm-adaptive-history file a few times but this error comes always back.
T.

thierryvolpiatto commented 9 years ago

tollerm notifications@github.com writes:

Dear Thierry, I've deleted my helm-adaptive-history file a few times but this error comes always back.

Are you sure you delete your file from outside emacs? Otherwise emacs is saving again your history as it is when exiting.

I can't reproduce here, and I haven't deleted my adaptative file since 2 years about.

Do you have special settings ?

What happen if you:

1) Quit emacs. 2) from a terminal: rm ~/.emacs.d/helm-adaptive-history 3) cd /your/helm/directory/ ./emacs-helm.sh 4) M-x helm-find-files => goto some directory and C-u C-s

Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997

tollerm commented 9 years ago

When I start ./emacs-helm.sh everything works fine. But when I use my own init.el file, then the variable helm-adaptive-history gets the value (("helm grep extensions" ("" ...))))), while the file helm-adaptive-history contains the following 3 lines: ;; -- mode: emacs-lisp -_- ;; History entries used for helm adaptive display. (setq helm-adaptive-history (quote (("helm grep extensions" ("_" ("" . 2)))))) Obviously, something strange happens during reading this file. May be I have something wrong in my init.el file? The helm part of the init.el file is ;; \ Helm (use-package helm :diminish helm-mode :bind (("M-x" . helm-M-x) ("C-x C-f" . helm-find-files) ("C-x b" . helm-mini) ("M-y" . helm-show-kill-ring)) :init (setq helm-quick-update t ; do not display invisible candidates helm-split-window-in-side-p t ; open helm inside current window helm-buffers-fuzzy-matching t ; fuzzy matching buffer names when non-nil helm-move-to-line-cycle-in-source t ; move to end or begin when reaching top or bottom helm-ff-search-library-in-sexp t ; search for lib in require' anddeclare-function' sexp helm-scroll-amount 8 ; scroll 8 lines other window bhelm-ff-file-name-history-use-recentf t helm-truncate-lines t) (setq helm-external-programs-associations '(("pdf" . "qpdfview") ("djvu" . "qpdfview") (("flac" "mp3" "wav") . "vlc") (("avi" "flv" "mov" "mp4" "mpeg" "mpg" "ogg" "wmv") . "vlc") (("bmp" "jpeg" "jpg" "png") . "eog") (("docx" "doc" "odt") . "libreoffice --writer") (("ods" "xls" "xlsx") . "libreoffice --calc") (("odp" "pps" "ppt" "pptx") . "libreoffice --impress")))

(add-hook 'eshell-mode-hook '(lambda () (bind-key "TAB" #'helm-esh-pcomplete eshell-mode-map) ; "TAB" = C-i (bind-key "C-c C-l" #'helm-eshell-history eshell-mode-map))) :config (when (executable-find "curl") (setq helm-google-suggest-use-curl-p t)) (use-package helm-config) (helm-mode t) (helm-adaptive-mode t) (setcdr (assoc 'info-file helm-source-info-latex) "latex2e") ; "latex2e.info" is name of info file in TeXLive

;; \ Helm bibtex (use-package helm-bibtex :init (setq helm-bibtex-library-path "~/Documents/Bib/Source" helm-bibtex-bibliography "~/Documents/Bib/MyCollection.bib") (setq helm-bibtex-pdf-open-function (lambda (fpath) (start-process "qpdfview" "qpdfview" "qpdfview" fpath))))

;; \ Helm recoll (use-package helm-recoll :bind ("C-c s" . helm-recoll-main) :config (helm-recoll-create-source "main" "~/.recoll"))

;; \ Helm descbindigs (use-package helm-descbinds :config (helm-descbinds-mode))

;; *\ Helm-swoop (use-package helm-swoop :commands (helm-swoop-from-isearch helm-multi-swoop-all-from-helm-swoop) :init (setq helm-multi-swoop-edit-save t ; Save buffer when helm-multi-swoop-edit complete helm-swoop-split-with-multiple-windows nil ; Do not split current window helm-swoop-split-direction 'split-window-horizontally ; Split direction helm-swoop-speed-or-color nil ; If nil, slightly boost speed at cost of text color helm-swoop-use-line-number-face t) ; Color for line numbers :bind (("M-i" . helm-swoop) ("M-I" . helm-swoop-back-to-last-point) ("C-c M-i" . helm-multi-swoop) ("C-x M-i" . helm-multi-swoop-all)) :config (bind-key "M-i" 'helm-swoop-from-isearch isearch-mode-map) (bind-key "M-i" 'helm-multi-swoop-all-from-helm-swoop helm-swoop-map)) )

thierryvolpiatto commented 9 years ago

tollerm notifications@github.com writes:

When I start ./emacs-helm.sh everything works fine. But when I use my own init.el file, then the variable helm-adaptive-history gets the value (("helm grep extensions " ("" ...))))), while the file helm-adaptive-history contains the following 3 lines: ;; -- mode: emacs-lisp -- ;; History entries used for helm adaptive display. (setq helm-adaptive-history (quote (("helm grep extensions" ("" ("" . 2)))))) Obviously, something strange happens during reading this file.

Are you using session.el ?

IIRC There was a similar problem with this package, I don't remember what was the workaround though.

Ah! found it:

https://github.com/emacs-helm/helm/issues/94

Not sure it is related to your problem though.

May be I have something wrong in my init.el file?

Yes, obviously something is corrupting your file.

Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997

tollerm commented 9 years ago

Yes, indeed I am using session.el. And setting (setq session-save-print-spec '(t nil 40000)) in my init.el solved the problem. Never could think that the session package should be related to the helm-adaptive-history. Thank you very much for your help, Thierry and sorry for wasting your time. T.

thierryvolpiatto commented 9 years ago

tollerm notifications@github.com writes:

Yes, indeed I am using session.el. And setting (setq session-save-print-spec '(t nil 40000)) in my init.el solved the problem. Never could think that the session package should be related to the helm-adaptive-history.

Note that as helm-adaptative-history have its own file saved by helm, probably you can just remove it from the list of variables saved by session.el, don't know if it is possible though as I don't use this package (I use my own package psession.el).

Thank you very much for your help, Thierry and sorry for wasting your time. T.

You are welcome.

Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997