emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* commit "328c9a1af * bad org.el: Enhance menus" caused error
@ 2020-02-05 15:12 stardiviner
  2020-02-05 15:18 ` stardiviner
  0 siblings, 1 reply; 7+ messages in thread
From: stardiviner @ 2020-02-05 15:12 UTC (permalink / raw)
  To: Org Mode


I use magit-bisect on the latest (currently latest commit is "b14a14c9e")
org-mode repo. The commit "328c9a1af * bad org.el: Enhance menus" caused
bellowing error. I confirmed with a minimal Emacs config testing.

#+begin_example
Debugger entered--Lisp error: (void-variable org-org-menu)
  org-insert-dblock-bindings()
  run-hooks(org-load-hook)
  eval-buffer(#<buffer  *load*-102662> nil "/home/stardiviner/Code/Emacs/org-mode/lisp/org.el" nil t)  ; Reading at buffer position 832102
  load-with-code-conversion("/home/stardiviner/Code/Emacs/org-mode/lisp/org.el" "/home/stardiviner/Code/Emacs/org-mode/lisp/org.el" nil t)
  require(org)
  eval-buffer(#<buffer  *load*-339419> nil "/home/stardiviner/.config/emacs/elpa/org-20190211/..." nil t)  ; Reading at buffer position 1257
  load-with-code-conversion("/home/stardiviner/.config/emacs/elpa/org-20190211/..." "/home/stardiviner/.config/emacs/elpa/org-20190211/..." t t)
  require(org-info nil t)
  (not (require 'org-info nil t))
  (if (not (require 'org-info nil t)) (display-warning 'use-package (format "Cannot load %s" 'org-info) :error))
  (prog1 (if (not (require 'org-info nil t)) (display-warning 'use-package (format "Cannot load %s" 'org-info) :error)) (let ((elapsed (float-time (time-subtract (current-time) now)))) (if (> elapsed 0.1) (message "%s...done (%.3fs)" "Loading package org-info" elapsed) (message "%s...done" "Loading package org-info"))))
  (let ((now (current-time))) (message "%s..." "Loading package org-info") (prog1 (if (not (require 'org-info nil t)) (display-warning 'use-package (format "Cannot load %s" 'org-info) :error)) (let ((elapsed (float-time (time-subtract (current-time) now)))) (if (> elapsed 0.1) (message "%s...done (%.3fs)" "Loading package org-info" elapsed) (message "%s...done" "Loading package org-info")))))
  (condition-case err (let ((now (current-time))) (message "%s..." "Loading package org-info") (prog1 (if (not (require 'org-info nil t)) (display-warning 'use-package (format "Cannot load %s" 'org-info) :error)) (let ((elapsed (float-time (time-subtract ... now)))) (if (> elapsed 0.1) (message "%s...done (%.3fs)" "Loading package org-info" elapsed) (message "%s...done" "Loading package org-info"))))) ((debug error) (funcall use-package--warning152 :catch err)))
  eval-buffer(#<buffer  *load*-285586> nil "/home/stardiviner/.config/emacs/init/org-mode/init..." nil t)  ; Reading at buffer position 6453
  load-with-code-conversion("/home/stardiviner/.config/emacs/init/org-mode/init..." "/home/stardiviner/.config/emacs/init/org-mode/init..." nil t)
  require(init-org-hyperlink)
  eval-buffer(#<buffer  *load*-708861> nil "/home/stardiviner/.config/emacs/init/org-mode/init..." nil t)  ; Reading at buffer position 518
  load-with-code-conversion("/home/stardiviner/.config/emacs/init/org-mode/init..." "/home/stardiviner/.config/emacs/init/org-mode/init..." nil t)
  require(init-org-mode)
  eval-buffer(#<buffer  *load*> nil "/home/stardiviner/.config/emacs/init.el" nil t)  ; Reading at buffer position 3704
  load-with-code-conversion("/home/stardiviner/.config/emacs/init.el" "/home/stardiviner/.config/emacs/init.el" t t)
  load("/home/stardiviner/.config/emacs/init" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0x15653397066d>) #f(compiled-function () #<bytecode 0x156533b72e61>) t)
  command-line()
  normal-top-level()
#+end_example

-- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      

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

* Re: commit "328c9a1af * bad org.el: Enhance menus" caused error
  2020-02-05 15:12 commit "328c9a1af * bad org.el: Enhance menus" caused error stardiviner
@ 2020-02-05 15:18 ` stardiviner
  2020-02-05 16:22   ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: stardiviner @ 2020-02-05 15:18 UTC (permalink / raw)
  To: Org Mode


BTW, the function ~org-insert-dblock-bindings~ is from package =orgtbl-aggregate=.

-- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      

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

* Re: commit "328c9a1af * bad org.el: Enhance menus" caused error
  2020-02-05 15:18 ` stardiviner
@ 2020-02-05 16:22   ` Bastien
  2020-02-06  3:36     ` stardiviner
  2020-02-06  7:11     ` stardiviner
  0 siblings, 2 replies; 7+ messages in thread
From: Bastien @ 2020-02-05 16:22 UTC (permalink / raw)
  To: stardiviner; +Cc: Org Mode

Hi,

stardiviner <numbchild@gmail.com> writes:

> BTW, the function ~org-insert-dblock-bindings~ is from package
> =orgtbl-aggregate=.

I don't know this function and this package.

Can you share the minimal Emacs config with which you reproduce
the problem?

-- 
 Bastien

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

* Re: commit "328c9a1af * bad org.el: Enhance menus" caused error
  2020-02-05 16:22   ` Bastien
@ 2020-02-06  3:36     ` stardiviner
  2020-02-07 19:47       ` Bastien
  2020-02-06  7:11     ` stardiviner
  1 sibling, 1 reply; 7+ messages in thread
From: stardiviner @ 2020-02-06  3:36 UTC (permalink / raw)
  To: Bastien; +Cc: Org Mode


Bastien <bzg@gnu.org> writes:

> Hi,
>
> stardiviner <numbchild@gmail.com> writes:
>
>> BTW, the function ~org-insert-dblock-bindings~ is from package
>> =orgtbl-aggregate=.
>
> I don't know this function and this package.
>
> Can you share the minimal Emacs config with which you reproduce
> the problem?

Start =emacs -q=, and load Org from source code.

Then load package =orgtbl-aggregate=.

#+begin_src emacs-lisp
(use-package orgtbl-aggregate
  :ensure t
  :commands (org-insert-dblock org-insert-dblock:aggregate)
  :config
  ;; add `orgtbl-aggregate' dynamic blocks into list.
  (org-dynamic-block-define "columnview" 'org-insert-dblock:columnview)
  (org-dynamic-block-define "aggregate" 'org-insert-dblock:aggregate)
  (org-dynamic-block-define "invoice" 'org-insert-dblock:invoice)
  (org-dynamic-block-define "join" 'org-insert-dblock:join)
  (org-dynamic-block-define "org-gantt" 'org-insert-dblock:org-gantt)
  (org-dynamic-block-define "propview" 'org-insert-dblock:propview)
  (org-dynamic-block-define "transpose" 'org-insert-dblock:transpose))
#+end_src

Actually, it is because this package contains following code cause this problem:

#+begin_src emacs-lisp
;;;###autoload
(defun org-insert-dblock-bindings ()
  (org-defkey org-mode-map "\C-c\C-xi" 'org-insert-dblock)
  (easy-menu-add-item
   org-org-menu '()
   ["Insert Dynamic Block" org-insert-dblock t] "Agenda Command..."))

;;;###autoload
(if (functionp 'org-defkey)
    (org-insert-dblock-bindings) ;; org-mode already loaded
  (setq org-load-hook            ;; org-mode will be loaded later
	(cons 'org-insert-dblock-bindings
	      (if (boundp 'org-load-hook)
		  org-load-hook))))
#+end_src

Maybe because I just use =use-package= autoload for =orgtbl-aggregate= instead of
fully required? I tested that now by removing ~:commands~ part so that use-package
will not load delayed. Still has this error.

-- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      

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

* Re: commit "328c9a1af * bad org.el: Enhance menus" caused error
  2020-02-05 16:22   ` Bastien
  2020-02-06  3:36     ` stardiviner
@ 2020-02-06  7:11     ` stardiviner
  1 sibling, 0 replies; 7+ messages in thread
From: stardiviner @ 2020-02-06  7:11 UTC (permalink / raw)
  To: Bastien; +Cc: Org Mode


Bastien <bzg@gnu.org> writes:

> Hi,
>
> stardiviner <numbchild@gmail.com> writes:
>
>> BTW, the function ~org-insert-dblock-bindings~ is from package
>> =orgtbl-aggregate=.
>
> I don't know this function and this package.
>
> Can you share the minimal Emacs config with which you reproduce
> the problem?

Besides of package =orgtbl-aggregate=, seems another package =orgtbl-ascii-plot= use
same code to define menu too. Here is its code:

#+begin_src emacs-lisp
;;;###autoload
(defun orgtbl-ascii-plot-bindings ()
  (org-defkey org-mode-map "\C-c\"a"  'orgtbl-ascii-plot)
  (org-defkey org-mode-map "\C-c\"g"  'org-plot/gnuplot)
  (easy-menu-add-item
   org-tbl-menu '("Column")
   ["Ascii plot" orgtbl-ascii-plot t]))

;;;###autoload
(if (functionp 'org-defkey)
    (orgtbl-ascii-plot-bindings) ;; org-mode already loaded
  (setq org-load-hook            ;; org-mode will be loaded later
	      (cons 'orgtbl-ascii-plot-bindings
	            (if (boundp 'org-load-hook)
		              org-load-hook))))
#+end_src

Bastien, might consider add a hook after loaded org menus? Like named
~org-menu-after-loaded-hook~ or something else? So third libraries can define menu
entries with function added on the hook. I think those packages will have to
updated with patches?

-- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      

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

* Re: commit "328c9a1af * bad org.el: Enhance menus" caused error
  2020-02-06  3:36     ` stardiviner
@ 2020-02-07 19:47       ` Bastien
  2020-02-11  5:06         ` [SOLVED] " stardiviner
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2020-02-07 19:47 UTC (permalink / raw)
  To: stardiviner; +Cc: Org Mode

Hi Stardiviner,

I fixed this in master, thanks for reporting this bug.

Best,

-- 
 Bastien

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

* [SOLVED] Re: commit "328c9a1af * bad org.el: Enhance menus" caused error
  2020-02-07 19:47       ` Bastien
@ 2020-02-11  5:06         ` stardiviner
  0 siblings, 0 replies; 7+ messages in thread
From: stardiviner @ 2020-02-11  5:06 UTC (permalink / raw)
  To: Bastien; +Cc: Org Mode


Bastien <bzg@gnu.org> writes:

> Hi Stardiviner,
>
> I fixed this in master, thanks for reporting this bug.
>
> Best,

Thanks Bastien, You're very active recently. I saw you fixed lot of issues and new patches. Thanks, really.

-- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      

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

end of thread, other threads:[~2020-02-11  5:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 15:12 commit "328c9a1af * bad org.el: Enhance menus" caused error stardiviner
2020-02-05 15:18 ` stardiviner
2020-02-05 16:22   ` Bastien
2020-02-06  3:36     ` stardiviner
2020-02-07 19:47       ` Bastien
2020-02-11  5:06         ` [SOLVED] " stardiviner
2020-02-06  7:11     ` stardiviner

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).