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

Builtin support for always opens helm window in bottom position? #2039

Closed
zw963 opened this issue May 13, 2018 · 18 comments
Closed

Builtin support for always opens helm window in bottom position? #2039

zw963 opened this issue May 13, 2018 · 18 comments

Comments

@zw963
Copy link
Contributor

zw963 commented May 13, 2018

Recent update broken following code:

(defvar spacemacs-helm-display-help-buffer-regexp '("\\*.*Helm.*Help.*\\*"))
(defvar spacemacs-helm-display-buffer-regexp `("\\*.*helm.*\\*"
                                               (display-buffer-in-side-window)
                                               (inhibit-same-window . nil)
                                               (side . bottom)
                                               (window-width . 0.6)
                                               (window-height . 0.4)))

(defun display-helm-at-bottom (buffer)
  (let ((display-buffer-alist (list spacemacs-helm-display-help-buffer-regexp
                                    spacemacs-helm-display-buffer-regexp)))
    (display-buffer buffer)))
(setq helm-display-function 'display-helm-at-bottom)

I have fix this with following change:

-(defun display-helm-at-bottom (buffer)
+(defun display-helm-at-bottom (buffer &optional _resume)

What I wonder is: is there exist a builtin helm-display-function for this?

discuss about this feature please see here

Thanks.

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented May 13, 2018 via email

@thierryvolpiatto
Copy link
Member

There is a bunch of options in helm to display helm window where you want, please use them.

@thierryvolpiatto
Copy link
Member

Now you have two more options:
helm-default-display-buffer-functions and helm-default-display-buffer-alist, what you want I think is:
(setq helm-default-display-buffer-functions '(display-buffer-in-side-window))

@zw963
Copy link
Contributor Author

zw963 commented May 18, 2018

Now you have two more options:
helm-default-display-buffer-functions and helm-default-display-buffer-alist, what you want I think is:
(setq helm-default-display-buffer-functions '(display-buffer-in-side-window))

No, it not work.

Following is requirement which i need:

i have two window, one left, one right in one emacs frame

-----------------------------|-----------------------------|
 |                           |                             |
 |                           |                             |
 |                           |                             |
 |                           |                             |
 |                           |                             |
 |                           |
 |                           |                             |
 |                           |                             |
 |                           |                             |
 |                           |                             |
 |                           |                             |
 |                           |                             |
 |----------------------------------------------------------

when i in right window, after i run helm-mini

-----------------------------|-----------------------------|
 |                           |                             |
 |                           |                             |
 |                           |                             |
 |                           |                             |
 |                           |                             |
 |                           |-----------------------------
 |                           |                             |
 |                           |                             |
 |                           |        helm-mini buffer     |
 |                           |                             |
 |                           |                             |
 |                           |                             |
 |----------------------------------------------------------

But, what i want is: whatever open many buffer, i always open helm-mini in frame-buttom

-----------------------------|-----------------------------|
 |                           |                             |
 |                           |                             |
 |                           |                             |
 |                           |                             |
 |                           |                             |
 |---------------------------|-----------------------------
 |                                                         |
 |                                                         |
 |              helm-mini buffer
 |                                                         |
 |                                                         |
 |                                                         |
 |----------------------------------------------------------

@zw963
Copy link
Contributor Author

zw963 commented May 18, 2018

Following code is worked as expect.

(defvar spacemacs-helm-display-help-buffer-regexp '("\\*.*Helm.*Help.*\\*"))
(defvar spacemacs-helm-display-buffer-regexp `("\\*.*helm.*\\*"
                                               (display-buffer-in-side-window)
                                               (inhibit-same-window . nil)
                                               (side . bottom)
                                               (window-width . 0.6)
                                               (window-height . 0.4)))

(defun display-helm-at-bottom (buffer &optional _resume)
  (let ((display-buffer-alist (list spacemacs-helm-display-help-buffer-regexp
                                    spacemacs-helm-display-buffer-regexp)))
    (display-buffer buffer)))
(setq helm-display-function 'display-helm-at-bottom)

recent changed, broken above code, we have to change to make it worked again.
so, I just want to know, is there exist a builtin solution for this ...

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented May 18, 2018 via email

@thierryvolpiatto
Copy link
Member

capture d ecran_2018-05-18_06-59-28

@zw963
Copy link
Contributor Author

zw963 commented May 18, 2018

be sure you have disabled helm-always-two-windows.

helm-always-two-windows is nil, I am ensure about again, but it is still not worked.

@thierryvolpiatto
Copy link
Member

So you have some other settings that make it fail, be sure to start from a minimal config, i.e. emacs-helm.sh

@thierryvolpiatto
Copy link
Member

Here from emacs-helm.sh:

capture d ecran_2018-05-18_07-07-49

@zw963
Copy link
Contributor Author

zw963 commented May 18, 2018

i try with bare mini config, just following:

(require 'helm-config)

And reboot emacs daemon, run helm-mini, i got following

------------------------|------------------------|
|                       |                        |
|                       |                        |
|                       |                        |
|                       |                        |
|                       |                        |
|                       |    helm mini buffer    |
|                       |                        |
|                       |                        |
|                       |                        |
|                       |                        |
|                       |                        |
|                       |                        |
|                       |                        |
|-------------------------------------------------

all window in the right is full with helm-mini.

i think this config is controller is by:

# in my config, i change this, but, with mini config, no this.
(setq helm-split-window-inside-p t)

@zw963
Copy link
Contributor Author

zw963 commented May 18, 2018

I always start emacs with --daemon, i try to start with emacs-helm.sh, but it not work.

╰─ $ 1  ./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)'
Loading 00debian-vars...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
+ LOAD_PATH='("/etc/emacs25" "/etc/emacs" "/usr/local/share/emacs/25.2/site-lisp" "/usr/local/share/emacs/site-lisp" "/usr/share/emacs25/site-lisp/dictionaries-common" "/usr/share/emacs/site-lisp/autoconf" "/usr/share/emacs/25.2/site-lisp" "/usr/share/emacs/25.2/site-lisp/dictionaries-common" "/usr/share/emacs/site-lisp" "/usr/share/emacs/25.2/lisp" "/usr/share/emacs/25.2/lisp/vc" "/usr/share/emacs/25.2/lisp/url" "/usr/share/emacs/25.2/lisp/textmodes" "/usr/share/emacs/25.2/lisp/progmodes" "/usr/share/emacs/25.2/lisp/play" "/usr/share/emacs/25.2/lisp/org" "/usr/share/emacs/25.2/lisp/nxml" "/usr/share/emacs/25.2/lisp/net" "/usr/share/emacs/25.2/lisp/mh-e" "/usr/share/emacs/25.2/lisp/mail" "/usr/share/emacs/25.2/lisp/leim" "/usr/share/emacs/25.2/lisp/language" "/usr/share/emacs/25.2/lisp/international" "/usr/share/emacs/25.2/lisp/gnus" "/usr/share/emacs/25.2/lisp/eshell" "/usr/share/emacs/25.2/lisp/erc" "/usr/share/emacs/25.2/lisp/emulation" "/usr/share/emacs/25.2/lisp/emacs-lisp" "/usr/share/emacs/25.2/lisp/cedet" "/usr/share/emacs/25.2/lisp/calendar" "/usr/share/emacs/25.2/lisp/calc" "/usr/share/emacs/25.2/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:19567): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files

I got following error message from mini buffer

version-to-list: Invalid version syntax: ‘{{VERSION}}’ (must start with a number)
Mark set [3 times]

@zw963
Copy link
Contributor Author

zw963 commented May 18, 2018

Following is my /tmp/helm-cfg.el

(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 ("/etc/emacs25" "/etc/emacs" "/usr/local/share/emacs/25.2/site-lisp" "/usr/local/share/emacs/site-lisp" "/usr/share/emacs25/site-lisp/dictionaries-common" "/usr/share/emacs/site-lisp/autoconf" "/usr/share/emacs/25.2/site-lisp" "/usr/share/emacs/25.2/site-lisp/dictionaries-common" "/usr/share/emacs/site-lisp" "/usr/share/emacs/25.2/lisp" "/usr/share/emacs/25.2/lisp/vc" "/usr/share/emacs/25.2/lisp/url" "/usr/share/emacs/25.2/lisp/textmodes" "/usr/share/emacs/25.2/lisp/progmodes" "/usr/share/emacs/25.2/lisp/play" "/usr/share/emacs/25.2/lisp/org" "/usr/share/emacs/25.2/lisp/nxml" "/usr/share/emacs/25.2/lisp/net" "/usr/share/emacs/25.2/lisp/mh-e" "/usr/share/emacs/25.2/lisp/mail" "/usr/share/emacs/25.2/lisp/leim" "/usr/share/emacs/25.2/lisp/language" "/usr/share/emacs/25.2/lisp/international" "/usr/share/emacs/25.2/lisp/gnus" "/usr/share/emacs/25.2/lisp/eshell" "/usr/share/emacs/25.2/lisp/erc" "/usr/share/emacs/25.2/lisp/emulation" "/usr/share/emacs/25.2/lisp/emacs-lisp" "/usr/share/emacs/25.2/lisp/cedet" "/usr/share/emacs/25.2/lisp/calendar" "/usr/share/emacs/25.2/lisp/calc" "/usr/share/emacs/25.2/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"))))

I understood almost all config what means, and i add those config to my personal init script maually as need, but not work like you.

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented May 18, 2018 via email

@zw963
Copy link
Contributor Author

zw963 commented May 18, 2018

cd helm git directory

$:  gitl
1  * f2b5d9f8 - (HEAD -> master, tag: v2.9.4, origin/master, origin/HEAD) Update *pkg.el files(6 days ago,Thierry Volpiatto)
$: git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean

run emacs-helm.sh

$:  ./emacs-helm.sh

Got following error. (maybe caused by my linux distro? (Deepin 15.5)

 ╰─ $ ./emacs-helm.sh
Loading 00debian-vars...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...

** (emacs:8495): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files

Following is emacs *Messages* buffer:

For information about GNU Emacs and the GNU system, type C-h C-a.
version-to-list: Invalid version syntax: ‘{{VERSION}}’ (must start with a number)

when i M-x helm-mini, no matched is found.

I have rename my ~/.emacs.d and ~/.emacs to other name, but emacs-helm.sh not work.

Thanks

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented May 18, 2018 via email

@zw963
Copy link
Contributor Author

zw963 commented May 18, 2018

An advice: Always install emacs from sources and compile it yourself (it is easy), the emacs packages bundled with distributions have always problems (be sure to uninstall emacs debian package before installing yourself your new emacs).

Yes, i always do this, but for current deepin, i forget it ...

Probably, anyway it is not caused by helm itself, I guess you should have same error with emacs -Q or emacs -q.

emacs -q or emacs -Q worked with no error.

@zw963
Copy link
Contributor Author

zw963 commented May 18, 2018

This helm version doesn't have helm-default-display-buffer-functions variable, use the last.

It worked, Thank you!

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