Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm-follow-mode not worked when enable left neotree buffer window. #2115

Closed
zw963 opened this issue Nov 21, 2018 · 9 comments
Closed

helm-follow-mode not worked when enable left neotree buffer window. #2115

zw963 opened this issue Nov 21, 2018 · 9 comments

Comments

@zw963
Copy link
Contributor

zw963 commented Nov 21, 2018

Expected behavior

cursor should follow candidate and switch to that buffer

Actual behavior (from emacs-helm.sh if possible, see note at the bottom)

Got error message like this:

Error running timer: (error "Cannot split side window or parent of side window")                   (1:19 top) dir:evaluations git:bugfix/NTWEB-399 minibuffer-inactive-mode [2018-11-21 14:44] [14 times]

Maybe there exist some variable can skip neotree buffer window?

Steps to reproduce (recipe)

just enable neotree window, and try follow-mode

Backtraces if any (M-x toggle-debug-on-error)

Too many debug output... if need, i will copy.

Describe versions of Helm, Emacs, operating system, etc.

v3.0, emacs 26.1

Are you using emacs-helm.sh to reproduce this bug (yes/no):

no

IMPORTANT NOTE

Helm provides a script named emacs-helm.sh which runs Helm in a neutral
environment: no other packages and only minimal settings.

When possible, use it to reproduce your Helm issue to ensure no other package is
interfering.

To run it, simply switch to the directory where Helm is installed and call ./emacs-helm.sh.
If necessary you can specify emacs executable path on command line with "-P" option.

Thanks.

@zw963 zw963 changed the title helm-follow-mode not worked when enable left neotree-window. helm-follow-mode not worked when enable left neotree buffer window. Nov 21, 2018
@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Nov 21, 2018 via email

@zw963
Copy link
Contributor Author

zw963 commented Nov 21, 2018

Sorry for confusing, not i don't want, just because start from emacs-helm.sh exist
some bash shell issue which make it not work.

I use builtin emacs for arch (i know, i should compile it myself like i does in another
laptop which use Deepin linux, emacs version is too old)

any why, follow is some highlight.

 ╰─ $ ./emacs-helm.sh 
+ test -z ''
+ TEMP=/tmp
+ CONF_FILE=/tmp/helm-cfg.el
+ EMACS=emacs
+ case $1 in
++ emacs -q -batch --eval '(prin1 load-path)'
+ LOAD_PATH='("/usr/share/emacs/26.1/site-lisp" "/usr/share/emacs/site-lisp" "/usr/share/emacs/26.1/lisp" "/usr/share/emacs/26.1/lisp/vc" "/usr/share/emacs/26.1/lisp/url" "/usr/share/emacs/26.1/lisp/textmodes" "/usr/share/emacs/26.1/lisp/progmodes" "/usr/share/emacs/26.1/lisp/play" "/usr/share/emacs/26.1/lisp/org" "/usr/share/emacs/26.1/lisp/nxml" "/usr/share/emacs/26.1/lisp/net" "/usr/share/emacs/26.1/lisp/mh-e" "/usr/share/emacs/26.1/lisp/mail" "/usr/share/emacs/26.1/lisp/leim" "/usr/share/emacs/26.1/lisp/language" "/usr/share/emacs/26.1/lisp/international" "/usr/share/emacs/26.1/lisp/image" "/usr/share/emacs/26.1/lisp/gnus" "/usr/share/emacs/26.1/lisp/eshell" "/usr/share/emacs/26.1/lisp/erc" "/usr/share/emacs/26.1/lisp/emulation" "/usr/share/emacs/26.1/lisp/emacs-lisp" "/usr/share/emacs/26.1/lisp/cedet" "/usr/share/emacs/26.1/lisp/calendar" "/usr/share/emacs/26.1/lisp/calc" "/usr/share/emacs/26.1/lisp/obsolete")'
+ cd .
++ find . -samefile ./emacs-helm.sh -printf %l
+ TRUENAME=
+ '[' '!' -z '' ']'
+ AUTO_FILE=helm-autoloads.el
+ '[' '!' -e helm-autoloads.el ']'
+ cat
+ emacs -Q -l /tmp/helm-cfg.el

emacs error message is:

version-to-list: Invalid version syntax: ‘{{VERSION}}’ (must start with a number)

@zw963
Copy link
Contributor Author

zw963 commented Nov 21, 2018

Following is generated /tmp/helm-cfg.el, i think it should be ok.

(setq initial-scratch-message (concat initial-scratch-message
";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;; This Emacs is Powered by `HELM' using\n;; emacs program \"emacs\".\n;; This is a minimal `helm' configuration to discover `helm' or debug it.\n;; You can retrieve this minimal configuration in \"/tmp/helm-cfg.el\".\n;; Some original Emacs commands are replaced by their `helm' counterparts:\n\n;; - `find-file'(C-x C-f)            =>`helm-find-files'\n;; - `occur'(M-s o)                  =>`helm-occur'\n;; - `list-buffers'(C-x C-b)         =>`helm-buffers-list'\n;; - `completion-at-point'(M-tab)    =>`helm-lisp-completion-at-point'[1]\n;; - `dabbrev-expand'(M-/)           =>`helm-dabbrev'\n;; - `execute-extended-command'(M-x) =>`helm-M-x'\n\n
;; Some other Emacs commands are \"helmized\" by `helm-mode'.\n;; [1] Coming with emacs-24.4, `completion-at-point' is \"helmized\" by `helm-mode'\n;; which provides Helm completion in many places like `shell-mode'.\n;; Find context help for most Helm commands with `C-h m'.\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n"))

(setq load-path (quote ("/usr/share/emacs/26.1/site-lisp" "/usr/share/emacs/site-lisp" "/usr/share/emacs/26.1/lisp" "/usr/share/emacs/26.1/lisp/vc" "/usr/share/emacs/26.1/lisp/url" "/usr/share/emacs/26.1/lisp/textmodes" "/usr/share/emacs/26.1/lisp/progmodes" "/usr/share/emacs/26.1/lisp/play" "/usr/share/emacs/26.1/lisp/org" "/usr/share/emacs/26.1/lisp/nxml" "/usr/share/emacs/26.1/lisp/net" "/usr/share/emacs/26.1/lisp/mh-e" "/usr/share/emacs/26.1/lisp/mail" "/usr/share/emacs/26.1/lisp/leim" "/usr/share/emacs/26.1/lisp/language" "/usr/share/emacs/26.1/lisp/international" "/usr/share/emacs/26.1/lisp/image" "/usr/share/emacs/26.1/lisp/gnus" "/usr/share/emacs/26.1/lisp/eshell" "/usr/share/emacs/26.1/lisp/erc" "/usr/share/emacs/26.1/lisp/emulation" "/usr/share/emacs/26.1/lisp/emacs-lisp" "/usr/share/emacs/26.1/lisp/cedet" "/usr/share/emacs/26.1/lisp/calendar" "/usr/share/emacs/26.1/lisp/calc" "/usr/share/emacs/26.1/lisp/obsolete")))
(require 'package)
;; User may be using a non standard `package-user-dir'.
;; Modify `package-directory-list' instead of `package-user-dir'
;; in case the user starts Helm from a non-ELPA installation.
(unless (file-equal-p package-user-dir "~/.emacs.d/elpa")
  (add-to-list 'package-directory-list (directory-file-name
                                        (file-name-directory
                                         (directory-file-name default-directory)))))

(setq package-load-list '((helm-core t) (helm t) (async t) (popup t)))
(package-initialize)
(add-to-list 'load-path (file-name-directory (file-truename "./emacs-helm.sh")))
(setq default-frame-alist '((vertical-scroll-bars . nil)
                            (tool-bar-lines . 0)
                            (menu-bar-lines . 0)
                            (fullscreen . nil)))
(blink-cursor-mode -1)
(require 'helm-config)
(helm-mode 1)
(define-key global-map [remap find-file] 'helm-find-files)
(define-key global-map [remap occur] 'helm-occur)
(define-key global-map [remap list-buffers] 'helm-buffers-list)
(define-key global-map [remap dabbrev-expand] 'helm-dabbrev)
(define-key global-map [remap execute-extended-command] 'helm-M-x)
(unless (boundp 'completion-in-region-function)
  (define-key lisp-interaction-mode-map [remap completion-at-point] 'helm-lisp-completion-at-point)
  (define-key emacs-lisp-mode-map       [remap completion-at-point] 'helm-lisp-completion-at-point))
(add-hook 'kill-emacs-hook #'(lambda () (and (file-exists-p "/tmp/helm-cfg.el") (delete-file "/tmp/helm-cfg.el"))))

@zw963
Copy link
Contributor Author

zw963 commented Nov 21, 2018

I compile my emacs 26.1 from scratch, but the same error still exist.

Finally, i found the error come from following two line code:

(setq package-load-list '((helm-core t) (helm t) (async t) (popup t)))
(package-initialize)

After I remove those two line, and copy async.el and popup.el and neotree
to helm git folder, it worked now.

Following is reproduce:

./emacs-helm.sh to start a new session.

copy neotree init code to buffer, current buffer content is:

;; This buffer is for text that is not saved, and for Lisp evaluation.
;; To create a file, visit it with C-x c C-x C-f and enter text in its buffer.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This Emacs is Powered by ‘HELM’ using
;; emacs program "emacs".
;; This is a minimal ‘helm’ configuration to discover ‘helm’ or debug it.
;; You can retrieve this minimal configuration in "/tmp/helm-cfg.el".
;; Some original Emacs commands are replaced by their ‘helm’ counterparts:

;; - ‘find-file’(C-x C-f)            =>‘helm-find-files’
;; - ‘occur’(M-s o)                  =>‘helm-occur’
;; - ‘list-buffers’(C-x C-b)         =>‘helm-buffers-list’
;; - ‘completion-at-point’(M-tab)    =>‘helm-lisp-completion-at-point’[1]
;; - ‘dabbrev-expand’(M-/)           =>‘helm-dabbrev’
;; - ‘execute-extended-command’(M-x) =>‘helm-M-x’


;; Some other Emacs commands are "helmized" by ‘helm-mode’.
;; [1] Coming with emacs-24.4, ‘completion-at-point’ is "helmized" by ‘helm-mode’
;; which provides Helm completion in many places like ‘shell-mode’.
;; Find context help for most Helm commands with ‘C-h m’.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(require 'neotree)

(setq neo-window-width 40)
(setq neo-auto-indent-point t)
(setq neo-window-fixed-size nil)
;; (setq neo-hide-cursor t)
(setq neo-smart-open t)                 ; 开启 neotree 窗口时, 尝试跳转到当前文件 node
;; (setq neo-autorefresh t)
;; (setq neo-confirm-change-root 'noop)
(global-set-key [(f8)] 'neotree-toggle)

(add-hook 'dired-mode-hook
          '(lambda ()
             (define-key dired-mode-map [(f8)] 'neotree-toggle)
             ))

(add-hook 'ibuffer-mode-hook
          '(lambda ()
             (define-key ibuffer-mode-map [(f8)] 'neotree-toggle)
             ))

eval-buffer

run neotree to open neotree left window

run helm-occur, search helm

C-c C-f to open follow-mode

it worked as expect (All right, fine)

Add following config and eval it.

 (setq-default helm-display-buffer-default-height (* (frame-height) 0.618))
 (setq helm-default-display-buffer-functions '(display-buffer-in-side-window))

repeat previous step, issue got reproduced!

Got error message like this:

Error running timer: (error "Cannot split side window or parent of side window")  

Thanks

@zw963
Copy link
Contributor Author

zw963 commented Nov 21, 2018

to make a long story short,

i setting following config which discussed by us in #2039, like following:

 (setq-default helm-display-buffer-default-height (* (frame-height) 0.618))
 (setq helm-default-display-buffer-functions '(display-buffer-in-side-window))

And, after that, if neotree window is left opened, will cause helm-follow-mode not work.

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Nov 21, 2018 via email

@zw963
Copy link
Contributor Author

zw963 commented Nov 22, 2018

It is not an issue, helm and display-buffer are working as expected: With your config you are telling display-buffer to display your buffer in a side window which is neotree buffer in your case which is not suitable because it is read-only.

Yes, so I think there maybe exist a exclude list, when helm found that buffer, will skip, and use next buffer as the display buffer, is there exist any exist code can archive this?

Thanks

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Nov 22, 2018 via email

@zw963
Copy link
Contributor Author

zw963 commented Nov 22, 2018

Thanks, using frame personal not familiar so far. i will try create a issue to neotree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants