all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Tab completion doesn't work.
@ 2023-05-14 14:28 Hongyi Zhao
  2023-05-15  0:04 ` Michael Heerdegen
  0 siblings, 1 reply; 27+ messages in thread
From: Hongyi Zhao @ 2023-05-14 14:28 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 506 bytes --]

Hi here,

In my Emacs, I want to inspect the value of the variable
`bibtex-completion-cite-commands` defined by helm-bibtex package. But
what puzzles me is `C-h v bib RET` doesn't expand to any completions,
as shown in the attached screenshot.

Any tips for this problem?

Regards,
Zhao
-- 
Assoc. Prof. Hongsheng Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 19615 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-14 14:28 Tab completion doesn't work Hongyi Zhao
@ 2023-05-15  0:04 ` Michael Heerdegen
  2023-05-15  0:27   ` Hongyi Zhao
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Heerdegen @ 2023-05-15  0:04 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> Any tips for this problem?

Is the package correctly installed and loaded?

Michael.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-15  0:04 ` Michael Heerdegen
@ 2023-05-15  0:27   ` Hongyi Zhao
  2023-05-15  0:35     ` Michael Heerdegen
  0 siblings, 1 reply; 27+ messages in thread
From: Hongyi Zhao @ 2023-05-15  0:27 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

On Mon, May 15, 2023 at 8:05 AM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > Any tips for this problem?
>
> Is the package correctly installed and loaded?

In my case, the configuration for helm and helm-bibtex is as follows:

```elisp
(use-package helm
  :bind (:map helm-command-map
          ("C-c h" . helm-execute-persistent-action)))

(use-package helm-bibtex
  :init
  (setq
   bibtex-completion-pdf-field "File"
   ;;https://github.com/tmalsburg/helm-bibtex#insert-latex-cite-commands
   bibtex-completion-cite-prompt-for-optional-arguments nil)

  :bind-keymap
  ("<menu>" . helm-command-prefix)
  :bind
  (
   :map helm-command-map
   ("b" . helm-bibtex)
   ("B" . helm-bibtex-with-local-bibliography)
   ("n" . helm-bibtex-with-notes)
   ("<menu>" . helm-resume)
   )

  :config
  (require 'helm-config)
  ;;https://github.com/tmalsburg/helm-bibtex#application-used-for-opening-pdfs
  ;;https://github.com/tmalsburg/helm-bibtex/issues/386
  (defun bibtex-completion-open-pdf-external (keys &optional fallback-action)
    (let ((bibtex-completion-pdf-open-function
       (lambda (fpath) (start-process "evince" "*helm-bibtex-evince*"
"/usr/bin/evince" fpath))))
      (bibtex-completion-open-pdf keys fallback-action)))

  (helm-bibtex-helmify-action bibtex-completion-open-pdf-external
helm-bibtex-open-pdf-external)

  (helm-add-action-to-source
   'helm-bibtex
   '(("P" helm-bibtex-open-pdf-external "Open PDF file in external
viewer (if present)")))

  ;;https://github.com/tmalsburg/helm-bibtex#browser-used-for-opening-urls-and-dois
  (setq bibtex-completion-browser-function
    (lambda (url _) (start-process "firefox" "*firefox*" "firefox" url)))

  )
```
I confirm the above configuration alone when testing with `emacs -Q`
doesn't trigger the problem here. So, it must be caused by other
settings.

See here [1] for the related discussion.

[1] https://github.com/tmalsburg/helm-bibtex/issues/431#issuecomment-1545772936

> Michael.

Regards,
Zhao



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-15  0:27   ` Hongyi Zhao
@ 2023-05-15  0:35     ` Michael Heerdegen
  2023-05-15  0:46       ` Hongyi Zhao
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Heerdegen @ 2023-05-15  0:35 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> I confirm the above configuration alone when testing with `emacs -Q`
> doesn't trigger the problem here. So, it must be caused by other
> settings.

What does (featurep 'helm-bibtex) eval to?

Michael.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-15  0:35     ` Michael Heerdegen
@ 2023-05-15  0:46       ` Hongyi Zhao
  2023-05-15  1:22         ` Michael Heerdegen
  0 siblings, 1 reply; 27+ messages in thread
From: Hongyi Zhao @ 2023-05-15  0:46 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

On Mon, May 15, 2023 at 8:36 AM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > I confirm the above configuration alone when testing with `emacs -Q`
> > doesn't trigger the problem here. So, it must be caused by other
> > settings.
>
> What does (featurep 'helm-bibtex) eval to?

C-x b *scratch* RET

Then in scratch buffer eval (featurep 'helm-bibtex) by C-x C-e gives nil.

> Michael.

Regards,
Zhao



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-15  0:46       ` Hongyi Zhao
@ 2023-05-15  1:22         ` Michael Heerdegen
  2023-05-15  1:29           ` Hongyi Zhao
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Heerdegen @ 2023-05-15  1:22 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> Then in scratch buffer eval (featurep 'helm-bibtex) by C-x C-e gives nil.

Then the package is not loaded, your init file does not load it.  And the
variable is not known to Emacs.  Maybe there is an error on startup?




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-15  1:22         ` Michael Heerdegen
@ 2023-05-15  1:29           ` Hongyi Zhao
  2023-05-15  1:58             ` Michael Heerdegen
  0 siblings, 1 reply; 27+ messages in thread
From: Hongyi Zhao @ 2023-05-15  1:29 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

On Mon, May 15, 2023 at 9:23 AM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > Then in scratch buffer eval (featurep 'helm-bibtex) by C-x C-e gives nil.
>
> Then the package is not loaded, your init file does not load it.  And the
> variable is not known to Emacs.  Maybe there is an error on startup?

Then, I try to eval `(require 'helm-bibtex)` in scratch buffer and the
following error will be triggered:

Debugger entered--Lisp error: (file-missing "Cannot open load file"
"No such file or directory" "helm-config")
  require(helm-config)
  (progn (require 'helm-config) (defalias
'bibtex-completion-open-pdf-external #'(lambda (keys &optional
fallback-action) (let ((bibtex-completion-pdf-open-function #'...))
(bibtex-completion-open-pdf keys fallback-action))))
(helm-bibtex-helmify-action bibtex-completion-open-pdf-external
helm-bibtex-open-pdf-external) (helm-add-action-to-source 'helm-bibtex
'(("P" helm-bibtex-open-pdf-external "Open PDF file in external viewer
(if present)"))) (setq bibtex-completion-browser-function #'(lambda
(url _) (start-process "firefox" "*firefox*" "firefox" url))) t)
  (condition-case err (progn (require 'helm-config) (defalias
'bibtex-completion-open-pdf-external #'(lambda (keys &optional
fallback-action) (let ((bibtex-completion-pdf-open-function ...))
(bibtex-completion-open-pdf keys fallback-action))))
(helm-bibtex-helmify-action bibtex-completion-open-pdf-external
helm-bibtex-open-pdf-external) (helm-add-action-to-source 'helm-bibtex
'(("P" helm-bibtex-open-pdf-external "Open PDF file in external viewer
(if present)"))) (setq bibtex-completion-browser-function #'(lambda
(url _) (start-process "firefox" "*firefox*" "firefox" url))) t)
((debug error) (funcall use-package--warning56 :config err)))
  (lambda nil (condition-case err (progn (require 'helm-config)
(defalias 'bibtex-completion-open-pdf-external #'(lambda (keys
&optional fallback-action) (let (...) (bibtex-completion-open-pdf keys
fallback-action)))) (helm-bibtex-helmify-action
bibtex-completion-open-pdf-external helm-bibtex-open-pdf-external)
(helm-add-action-to-source 'helm-bibtex '(("P"
helm-bibtex-open-pdf-external "Open PDF file in external viewer (if
present)"))) (setq bibtex-completion-browser-function #'(lambda (url
_) (start-process "firefox" "*firefox*" "firefox" url))) t) ((debug
error) (funcall use-package--warning56 :config err))))()
  eval-after-load-helper("/home/werner/.emacs.d/straight/build/helm-bibtex/h...")
  run-hook-with-args(eval-after-load-helper
"/home/werner/.emacs.d/straight/build/helm-bibtex/h...")
  do-after-load-evaluation("/home/werner/.emacs.d/straight/build/helm-bibtex/h...")
  require(helm-bibtex)
  (progn (require 'helm-bibtex))
  eval((progn (require 'helm-bibtex)) t)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)


How to fix it?

Regards,
Zhao



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-15  1:29           ` Hongyi Zhao
@ 2023-05-15  1:58             ` Michael Heerdegen
  2023-05-15  3:24               ` Hongyi Zhao
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Heerdegen @ 2023-05-15  1:58 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> Debugger entered--Lisp error: (file-missing "Cannot open load file"
> "No such file or directory" "helm-config")
>   require(helm-config)

AFAICT this file is not present in all helm installations (has it been
removed? I don't recall).

You are requiring that library in the config you posted.  I don't know
the background but I think I would try to simply remove that
requirement from your config.

Michael.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-15  1:58             ` Michael Heerdegen
@ 2023-05-15  3:24               ` Hongyi Zhao
  2023-05-15  3:36                 ` Michael Heerdegen
  0 siblings, 1 reply; 27+ messages in thread
From: Hongyi Zhao @ 2023-05-15  3:24 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

On Mon, May 15, 2023 at 9:59 AM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > Debugger entered--Lisp error: (file-missing "Cannot open load file"
> > "No such file or directory" "helm-config")
> >   require(helm-config)
>
> AFAICT this file is not present in all helm installations (has it been
> removed? I don't recall).
>
> You are requiring that library in the config you posted.  I don't know
> the background but I think I would try to simply remove that
> requirement from your config.

The `(require 'helm-bibtex)` doesn't exist in my init.el, but just as
used to test the problem discussed here.

> Michael.

Regards,
Zhao



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-15  3:24               ` Hongyi Zhao
@ 2023-05-15  3:36                 ` Michael Heerdegen
  2023-05-15  3:58                   ` Hongyi Zhao
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Heerdegen @ 2023-05-15  3:36 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> On Mon, May 15, 2023 at 9:59 AM Michael Heerdegen
> <michael_heerdegen@web.de> wrote:
> >
> > Hongyi Zhao <hongyi.zhao@gmail.com> writes:
> >
> > > Debugger entered--Lisp error: (file-missing "Cannot open load file"
> > > "No such file or directory" "helm-config")
> > >   require(helm-config)

> The `(require 'helm-bibtex)` doesn't exist in my init.el, but just as
> used to test the problem discussed here.

I mean "helm-config".  Or is the error above you posted not relevant?

Michael.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-15  3:36                 ` Michael Heerdegen
@ 2023-05-15  3:58                   ` Hongyi Zhao
  2023-05-15  4:20                     ` Michael Heerdegen
  0 siblings, 1 reply; 27+ messages in thread
From: Hongyi Zhao @ 2023-05-15  3:58 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

On Mon, May 15, 2023 at 11:37 AM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > On Mon, May 15, 2023 at 9:59 AM Michael Heerdegen
> > <michael_heerdegen@web.de> wrote:
> > >
> > > Hongyi Zhao <hongyi.zhao@gmail.com> writes:
> > >
> > > > Debugger entered--Lisp error: (file-missing "Cannot open load file"
> > > > "No such file or directory" "helm-config")
> > > >   require(helm-config)
>
> > The `(require 'helm-bibtex)` doesn't exist in my init.el, but just as
> > used to test the problem discussed here.
>
> I mean "helm-config".  Or is the error above you posted not relevant?

I can't tell further, so I filed the issue here [1].

[1] https://github.com/tmalsburg/helm-bibtex/issues/432

> Michael.

Regards,
Zhao



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-15  3:58                   ` Hongyi Zhao
@ 2023-05-15  4:20                     ` Michael Heerdegen
  2023-05-15  4:48                       ` Hongyi Zhao
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Heerdegen @ 2023-05-15  4:20 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> I can't tell further, so I filed the issue here [1].

Isn't (require 'helm-config) part of your config?

Michael.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-15  4:20                     ` Michael Heerdegen
@ 2023-05-15  4:48                       ` Hongyi Zhao
  2023-05-15  5:35                         ` Michael Heerdegen
  0 siblings, 1 reply; 27+ messages in thread
From: Hongyi Zhao @ 2023-05-15  4:48 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

On Mon, May 15, 2023 at 12:21 PM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > I can't tell further, so I filed the issue here [1].
>
> Isn't (require 'helm-config) part of your config?

Thank you for pointing this out. I now have commented this line out in
my init.el, but still I cannot see the candidate
`bibtex-completion-cite-commands`, as shown in the attached
screenshot.

> Michael.

Regards,
Zhao

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 45521 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-15  4:48                       ` Hongyi Zhao
@ 2023-05-15  5:35                         ` Michael Heerdegen
  2023-05-15  6:21                           ` Hongyi Zhao
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Heerdegen @ 2023-05-15  5:35 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> Thank you for pointing this out. I now have commented this line out in
> my init.el, but still I cannot see the candidate
> `bibtex-completion-cite-commands`, as shown in the attached
> screenshot.

Then iterate: is the package loaded?  If not, do you get any other
error(s)?

Michael.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-15  5:35                         ` Michael Heerdegen
@ 2023-05-15  6:21                           ` Hongyi Zhao
  2023-05-15 22:56                             ` Michael Heerdegen
  0 siblings, 1 reply; 27+ messages in thread
From: Hongyi Zhao @ 2023-05-15  6:21 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

On Mon, May 15, 2023 at 1:36 PM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > Thank you for pointing this out. I now have commented this line out in
> > my init.el, but still I cannot see the candidate
> > `bibtex-completion-cite-commands`, as shown in the attached
> > screenshot.
>
> Then iterate: is the package loaded?

eval `(featurep 'helm-bibtex)` still gives nil.

> If not, do you get any other error(s)?

I tried to start as follows, but still did not see any error reports:

werner@X10DAi:~$ emacs --debug-init

> Michael.

Regards,
Zhao



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-15  6:21                           ` Hongyi Zhao
@ 2023-05-15 22:56                             ` Michael Heerdegen
  2023-05-16  0:14                               ` Hongyi Zhao
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Heerdegen @ 2023-05-15 22:56 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> I tried to start as follows, but still did not see any error reports:
>
> werner@X10DAi:~$ emacs --debug-init

Then

(1) Does the *Messages* buffer maybe contain something useful after
startup?

(2) Does (require 'helm-bibtex) succeed without error?


Michael.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-15 22:56                             ` Michael Heerdegen
@ 2023-05-16  0:14                               ` Hongyi Zhao
  2023-05-16  1:31                                 ` Michael Heerdegen
  0 siblings, 1 reply; 27+ messages in thread
From: Hongyi Zhao @ 2023-05-16  0:14 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

On Tue, May 16, 2023 at 6:57 AM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > I tried to start as follows, but still did not see any error reports:
> >
> > werner@X10DAi:~$ emacs --debug-init
>
> Then
>
> (1) Does the *Messages* buffer maybe contain something useful after
> startup?

See below:

;;;;;;;;;;; begin log
Loading server...done
Iedit default key binding is C-;
Loading /home/werner/.emacs.d/var/recentf-save.el (source)...done
Cleaning up the recentf list...done (0 removed)
Using default formatter emacs-lisp
For information about GNU Emacs and the GNU system, type C-h C-a.
Wrote /home/werner/.emacs.d/var/recentf-save.el
Package cl is deprecated
;;;;;;;;;;; end log

> (2) Does (require 'helm-bibtex) succeed without error?

Eval it in scratch buffer gives the following:

;;;;;;;;;;; begin log
Debugger entered--Lisp error: (wrong-number-of-arguments (3 . 4) 2)
  helm-add-action-to-source(helm-bibtex (("P"
helm-bibtex-open-pdf-external "Open PDF file in external viewer (if
present)")))
  (progn (defalias 'bibtex-completion-open-pdf-external #'(lambda
(keys &optional fallback-action) (let
((bibtex-completion-pdf-open-function #'...))
(bibtex-completion-open-pdf keys fallback-action))))
(helm-bibtex-helmify-action bibtex-completion-open-pdf-external
helm-bibtex-open-pdf-external) (helm-add-action-to-source 'helm-bibtex
'(("P" helm-bibtex-open-pdf-external "Open PDF file in external viewer
(if present)"))) (setq bibtex-completion-browser-function #'(lambda
(url _) (start-process "firefox" "*firefox*" "firefox" url))) t)
  (condition-case err (progn (defalias
'bibtex-completion-open-pdf-external #'(lambda (keys &optional
fallback-action) (let ((bibtex-completion-pdf-open-function ...))
(bibtex-completion-open-pdf keys fallback-action))))
(helm-bibtex-helmify-action bibtex-completion-open-pdf-external
helm-bibtex-open-pdf-external) (helm-add-action-to-source 'helm-bibtex
'(("P" helm-bibtex-open-pdf-external "Open PDF file in external viewer
(if present)"))) (setq bibtex-completion-browser-function #'(lambda
(url _) (start-process "firefox" "*firefox*" "firefox" url))) t)
((debug error) (funcall use-package--warning56 :config err)))
  (lambda nil (condition-case err (progn (defalias
'bibtex-completion-open-pdf-external #'(lambda (keys &optional
fallback-action) (let (...) (bibtex-completion-open-pdf keys
fallback-action)))) (helm-bibtex-helmify-action
bibtex-completion-open-pdf-external helm-bibtex-open-pdf-external)
(helm-add-action-to-source 'helm-bibtex '(("P"
helm-bibtex-open-pdf-external "Open PDF file in external viewer (if
present)"))) (setq bibtex-completion-browser-function #'(lambda (url
_) (start-process "firefox" "*firefox*" "firefox" url))) t) ((debug
error) (funcall use-package--warning56 :config err))))()
  eval-after-load-helper("/home/werner/.emacs.d/straight/build/helm-bibtex/h...")
  run-hook-with-args(eval-after-load-helper
"/home/werner/.emacs.d/straight/build/helm-bibtex/h...")
  do-after-load-evaluation("/home/werner/.emacs.d/straight/build/helm-bibtex/h...")
  require(helm-bibtex)
  (progn (require 'helm-bibtex))
  eval((progn (require 'helm-bibtex)) t)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)
;;;;;;;;;;; end log


N.B.: The `(require 'helm-config)` is really not needed now, and I've
removed it from init.el, see [1] for more details.

[1] https://github.com/tmalsburg/helm-bibtex/issues/432#issuecomment-1547348865

> Michael.

Regards,
Zhao



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-16  0:14                               ` Hongyi Zhao
@ 2023-05-16  1:31                                 ` Michael Heerdegen
  2023-05-16  1:50                                   ` Hongyi Zhao
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Heerdegen @ 2023-05-16  1:31 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> Debugger entered--Lisp error: (wrong-number-of-arguments (3 . 4) 2)
>   helm-add-action-to-source(helm-bibtex (("P"
> helm-bibtex-open-pdf-external "Open PDF file in external viewer (if
> present)")))

So here is another error in the config you posted (the source argument
is missing in that call).

Michael.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-16  1:31                                 ` Michael Heerdegen
@ 2023-05-16  1:50                                   ` Hongyi Zhao
  2023-05-16  2:11                                     ` Michael Heerdegen
  0 siblings, 1 reply; 27+ messages in thread
From: Hongyi Zhao @ 2023-05-16  1:50 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

On Tue, May 16, 2023 at 9:32 AM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > Debugger entered--Lisp error: (wrong-number-of-arguments (3 . 4) 2)
> >   helm-add-action-to-source(helm-bibtex (("P"
> > helm-bibtex-open-pdf-external "Open PDF file in external viewer (if
> > present)")))
>
> So here is another error in the config you posted (the source argument
> is missing in that call).

I've filed the issue here:
https://github.com/tmalsburg/helm-bibtex/issues/432#issuecomment-1548786182

> Michael.

Regards,
Zhao



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-16  1:50                                   ` Hongyi Zhao
@ 2023-05-16  2:11                                     ` Michael Heerdegen
  2023-05-16  2:55                                       ` Hongyi Zhao
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Heerdegen @ 2023-05-16  2:11 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> > > Debugger entered--Lisp error: (wrong-number-of-arguments (3 . 4) 2)
> > >   helm-add-action-to-source(helm-bibtex (("P"
> > > helm-bibtex-open-pdf-external "Open PDF file in external viewer (if
> > > present)")))
> >
> > So here is another error in the config you posted (the source argument
> > is missing in that call).
>
> I've filed the issue here:
> https://github.com/tmalsburg/helm-bibtex/issues/432#issuecomment-1548786182

It's not just an error in your personal config?

Michael.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-16  2:11                                     ` Michael Heerdegen
@ 2023-05-16  2:55                                       ` Hongyi Zhao
  2023-05-16  3:21                                         ` Michael Heerdegen
  0 siblings, 1 reply; 27+ messages in thread
From: Hongyi Zhao @ 2023-05-16  2:55 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs@gnu.org

On Tuesday, May 16, 2023, Michael Heerdegen <michael_heerdegen@web.de>
wrote:

> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > > > Debugger entered--Lisp error: (wrong-number-of-arguments (3 . 4) 2)
> > > >   helm-add-action-to-source(helm-bibtex (("P"
> > > > helm-bibtex-open-pdf-external "Open PDF file in external viewer (if
> > > > present)")))
> > >
> > > So here is another error in the config you posted (the source argument
> > > is missing in that call).
> >
> > I've filed the issue here:
> > https://github.com/tmalsburg/helm-bibtex/issues/432#
> issuecomment-1548786182
>
> It's not just an error in your personal config?


But I don't know how to pinpoint the culprit.

>
> Michael.


Zhao


-- 
Assoc. Prof. Hongsheng Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-16  2:55                                       ` Hongyi Zhao
@ 2023-05-16  3:21                                         ` Michael Heerdegen
  2023-05-16  3:44                                           ` Hongyi Zhao
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Heerdegen @ 2023-05-16  3:21 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> But I don't know how to pinpoint the culprit.

Unless I'm missing something, we found the problematic lines in your
config and you just have to specify the Helm source you want to add the
action to in the problematic expression I cited.

Michael.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-16  3:21                                         ` Michael Heerdegen
@ 2023-05-16  3:44                                           ` Hongyi Zhao
  2023-05-16  3:53                                             ` Hongyi Zhao
  0 siblings, 1 reply; 27+ messages in thread
From: Hongyi Zhao @ 2023-05-16  3:44 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1355 bytes --]

On Tue, May 16, 2023 at 11:21 AM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > But I don't know how to pinpoint the culprit.
>
> Unless I'm missing something, we found the problematic lines in your
> config and you just have to specify the Helm source you want to add the
> action to in the problematic expression I cited.

Yes. It solved the problem discussed here with the following configuration:

;;;;;;;;;;;;;;;;;;; begin config
;; https://github.com/emacs-helm/helm/wiki#if-installed-from-source
;; First issue the following command
/home/werner/.emacs.d/straight/repos/helm$ make
(use-package helm :config (require 'helm-autoloads))

(use-package helm-bibtex
  :init
  (setq
   bibtex-completion-pdf-field "File"
   ;;https://github.com/tmalsburg/helm-bibtex#insert-latex-cite-commands
   bibtex-completion-cite-prompt-for-optional-arguments nil)

  :bind-keymap
  ("<menu>" . helm-command-prefix)
  :bind
  (
   :map helm-command-map
   ("b" . helm-bibtex)
   ("B" . helm-bibtex-with-local-bibliography)
   ("n" . helm-bibtex-with-notes)
   ("<menu>" . helm-resume)
   )
  )
;;;;;;;;;;;;;;;;;;; end config

See the attached screenshot for the completion results, which include
`bibtex-completion-cite-commands`.

> Michael.

Regards,
Zhao

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 64348 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-16  3:44                                           ` Hongyi Zhao
@ 2023-05-16  3:53                                             ` Hongyi Zhao
  2023-05-16  4:24                                               ` Michael Heerdegen
  0 siblings, 1 reply; 27+ messages in thread
From: Hongyi Zhao @ 2023-05-16  3:53 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1678 bytes --]

On Tue, May 16, 2023 at 11:44 AM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Tue, May 16, 2023 at 11:21 AM Michael Heerdegen
> <michael_heerdegen@web.de> wrote:
> >
> > Hongyi Zhao <hongyi.zhao@gmail.com> writes:
> >
> > > But I don't know how to pinpoint the culprit.
> >
> > Unless I'm missing something, we found the problematic lines in your
> > config and you just have to specify the Helm source you want to add the
> > action to in the problematic expression I cited.
>
> Yes. It solved the problem discussed here with the following configuration:
>
> ;;;;;;;;;;;;;;;;;;; begin config
> ;; https://github.com/emacs-helm/helm/wiki#if-installed-from-source
> ;; First issue the following command
> /home/werner/.emacs.d/straight/repos/helm$ make
> (use-package helm :config (require 'helm-autoloads))
>
> (use-package helm-bibtex
>   :init
>   (setq
>    bibtex-completion-pdf-field "File"
>    ;;https://github.com/tmalsburg/helm-bibtex#insert-latex-cite-commands
>    bibtex-completion-cite-prompt-for-optional-arguments nil)
>
>   :bind-keymap
>   ("<menu>" . helm-command-prefix)
>   :bind
>   (
>    :map helm-command-map
>    ("b" . helm-bibtex)
>    ("B" . helm-bibtex-with-local-bibliography)
>    ("n" . helm-bibtex-with-notes)
>    ("<menu>" . helm-resume)
>    )
>   )
> ;;;;;;;;;;;;;;;;;;; end config
>
> See the attached screenshot for the completion results, which include
> `bibtex-completion-cite-commands`.

And this also fixed the Tab completion problem discussed in this
thread, aka, `bib <Tab>` will give the desired completion, as shown in
the screenshot.

> > Michael.
>
> Regards,
> Zhao

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 33379 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-16  3:53                                             ` Hongyi Zhao
@ 2023-05-16  4:24                                               ` Michael Heerdegen
  2023-05-16  6:18                                                 ` Hongyi Zhao
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Heerdegen @ 2023-05-16  4:24 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> > See the attached screenshot for the completion results, which include
> > `bibtex-completion-cite-commands`.
>
> And this also fixed the Tab completion problem discussed in this
> thread, aka, `bib <Tab>` will give the desired completion, as shown in
> the screenshot.

Ok - good!

I think you would benefit from enabling `debug-on-error' temporarily
when your init file is loaded, and/or, even better, start to compile
your init file regularly, since it will catch a lot of errors and
problems like this.

This will require some small changes (loading some stuff when compiling
etc.), but if you try to get rid of any warnings you will avoid most of
such surprises.

Michael.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-16  4:24                                               ` Michael Heerdegen
@ 2023-05-16  6:18                                                 ` Hongyi Zhao
  2023-05-16 20:01                                                   ` Michael Heerdegen
  0 siblings, 1 reply; 27+ messages in thread
From: Hongyi Zhao @ 2023-05-16  6:18 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

On Tue, May 16, 2023 at 12:25 PM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > > See the attached screenshot for the completion results, which include
> > > `bibtex-completion-cite-commands`.
> >
> > And this also fixed the Tab completion problem discussed in this
> > thread, aka, `bib <Tab>` will give the desired completion, as shown in
> > the screenshot.
>
> Ok - good!
>
> I think you would benefit from enabling `debug-on-error' temporarily
> when your init file is loaded, and/or, even better, start to compile
> your init file regularly, since it will catch a lot of errors and
> problems like this.
>
> This will require some small changes (loading some stuff when compiling
> etc.), but if you try to get rid of any warnings you will avoid most of
> such surprises.

But I also noticed the following description here [1]:

Byte-compiling your init file is not recommended (see Byte Compilation
in the Emacs Lisp Reference Manual). It generally does not speed up
startup very much, and often leads to problems when you forget to
recompile the file. A better solution is to use the Emacs server to
reduce the number of times you have to start Emacs (see Using Emacs as
a Server). If your init file defines many functions, consider moving
them to a separate (byte-compiled) file that you load in your init
file.

[1] https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html

> Michael.

Regards,
Zhao



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Tab completion doesn't work.
  2023-05-16  6:18                                                 ` Hongyi Zhao
@ 2023-05-16 20:01                                                   ` Michael Heerdegen
  0 siblings, 0 replies; 27+ messages in thread
From: Michael Heerdegen @ 2023-05-16 20:01 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> But I also noticed the following description here [1]:
>
> Byte-compiling your init file is not recommended (see Byte Compilation
> in the Emacs Lisp Reference Manual). It generally does not speed up
> startup very much, and often leads to problems when you forget to
> recompile the file.

Errors in your init file are worse.  Either simply remove the compiled
file afterwards or don't forget to recompile regularly.  You definitely
want some method to detect mistakes.

Michael.




^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2023-05-16 20:01 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-14 14:28 Tab completion doesn't work Hongyi Zhao
2023-05-15  0:04 ` Michael Heerdegen
2023-05-15  0:27   ` Hongyi Zhao
2023-05-15  0:35     ` Michael Heerdegen
2023-05-15  0:46       ` Hongyi Zhao
2023-05-15  1:22         ` Michael Heerdegen
2023-05-15  1:29           ` Hongyi Zhao
2023-05-15  1:58             ` Michael Heerdegen
2023-05-15  3:24               ` Hongyi Zhao
2023-05-15  3:36                 ` Michael Heerdegen
2023-05-15  3:58                   ` Hongyi Zhao
2023-05-15  4:20                     ` Michael Heerdegen
2023-05-15  4:48                       ` Hongyi Zhao
2023-05-15  5:35                         ` Michael Heerdegen
2023-05-15  6:21                           ` Hongyi Zhao
2023-05-15 22:56                             ` Michael Heerdegen
2023-05-16  0:14                               ` Hongyi Zhao
2023-05-16  1:31                                 ` Michael Heerdegen
2023-05-16  1:50                                   ` Hongyi Zhao
2023-05-16  2:11                                     ` Michael Heerdegen
2023-05-16  2:55                                       ` Hongyi Zhao
2023-05-16  3:21                                         ` Michael Heerdegen
2023-05-16  3:44                                           ` Hongyi Zhao
2023-05-16  3:53                                             ` Hongyi Zhao
2023-05-16  4:24                                               ` Michael Heerdegen
2023-05-16  6:18                                                 ` Hongyi Zhao
2023-05-16 20:01                                                   ` Michael Heerdegen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.