Kungsgeten / yankpad

Paste snippets from an org-mode file
MIT License
216 stars 18 forks source link

[BUG] yankpad-snippet-heading-level 3 kills org-capture #9

Closed zeltak closed 8 years ago

zeltak commented 8 years ago

Hi again

so i noticed something today thats been driving me nutters past week and i can confrim 100% its casued by yankpad.

when i use this settings in my init (setq yankpad-snippet-heading-level 3) org-capture will fails and output this error

byte-code: Capture abort: (wrong-type-argument stringp nil)

when i switch back to level 2: (setq yankpad-snippet-heading-level 2)

org capture works fine

any idea?

best

Z

Kungsgeten commented 8 years ago

I've tried to replicate this without success, sorry. Can you replicate it if using emacs -Q (a fresh emacs)? That would help a lot.

zeltak commented 8 years ago

Hi again

sorry for the late reply..real life bogged me down this week :)

ok so i started emacs with -Q with this uber minimal init

;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.

(require 'package)

;since we are using use-package-don't autoload anythings
(setq package-enable-at-startup nil)

;sources for package.el 
;; (dolist (source '(("marmalade" . "http://marmalade-repo.org/packages/")
;;                   ("elpa" . "http://tromey.com/elpa/")
;;        ("gnu" . "http://elpa.gnu.org/packages/")
;;                   ;; TODO: Maybe, use this after emacs24 is released
;;                   ;; (development versions of packages)
;;                   ("melpa" . "http://melpa.milkbox.net/packages/")
;;  ;;    ("SC"   . "http://joseito.republika.pl/sunrise-commander/")
;;        ("org" . "http://orgmode.org/elpa/")
;;                   ))
;;   (add-to-list 'package-archives source t))

(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("marmalade" . "https://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
;; org maybe suspect of hanging melpa, if you have hangs disable this first
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))

;; Initialize installed package
(package-initialize)  

;; Bootstrap `use-package'
;(unless (package-installed-p 'use-package)
;  (package-refresh-contents)
;  (package-install 'use-package))

(require 'use-package)

(use-package yankpad
 :ensure t
 :config
  (require 'yankpad)
  (setq yankpad-file "/home/zeltak/org/files/help/yankpad.org")
;; to make lv3 snippets (and use lv2 as sub category)
  (setq yankpad-snippet-heading-level 2) 
 )

(setq org-directory "~/org/files/")
(setq org-default-notes-file "~/org/files/refile.org")

when i try then to call yankpad-insert now i get the following error:

org-element-table-interpreter: Symbol's function definition is void: org-table-align

i tried adding this to my config (setq org-startup-align-all-tables t) with no success. any other things i need to eval to further debug this?

best

Z

Kungsgeten commented 8 years ago

Thank you, I'll look into it. Could you post the content of your yankpad file too, just in case there's something in there?

On Sat, Jun 4, 2016, 08:00 zeltak notifications@github.com wrote:

Hi again

sorry for the late reply..real life bogged me down this week :)

ok so i started emacs with -Q with this uber minimal init

;; This buffer is for notes you don't want to save, and for Lisp evaluation. ;; If you want to create a file, visit that file with C-x C-f, ;; then enter the text in that file's own buffer.

(require 'package)

;since we are using use-package-don't autoload anythings (setq package-enable-at-startup nil)

;sources for package.el ;; (dolist (source '(("marmalade" . "http://marmalade-repo.org/packages/") ;; ("elpa" . "http://tromey.com/elpa/") ;; ("gnu" . "http://elpa.gnu.org/packages/") ;; ;; TODO: Maybe, use this after emacs24 is released ;; ;; (development versions of packages) ;; ("melpa" . "http://melpa.milkbox.net/packages/") ;; ;; ("SC" . "http://joseito.republika.pl/sunrise-commander/") ;; ("org" . "http://orgmode.org/elpa/") ;; )) ;; (add-to-list 'package-archives source t))

(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")) (add-to-list 'package-archives '("marmalade" . "https://marmalade-repo.org/packages/")) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) ;; org maybe suspect of hanging melpa, if you have hangs disable this first (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))

;; Initialize installed package (package-initialize)

;; Bootstrap `use-package' ;(unless (package-installed-p 'use-package) ; (package-refresh-contents) ; (package-install 'use-package))

(require 'use-package)

(use-package yankpad :ensure t :config (require 'yankpad) (setq yankpad-file "/home/zeltak/org/files/help/yankpad.org") ;; to make lv3 snippets (and use lv2 as sub category) (setq yankpad-snippet-heading-level 2) )

(setq org-directory "~/org/files/") (setq org-default-notes-file "~/org/files/refile.org")

when i try then to call yankpad-insert now i get the following error:

org-element-table-interpreter: Symbol's function definition is void: org-table-align

i tried adding this to my config (setq org-startup-align-all-tables t) with no success. any other things i need to eval to further debug this?

best

Z

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Kungsgeten/yankpad/issues/9#issuecomment-223738746, or mute the thread https://github.com/notifications/unsubscribe/ADysua8qjRNrZFjoW39_Co6qcQZu1lsSks5qIRRvgaJpZM4IkP8H .

zeltak commented 8 years ago

Sure here is a link to the file: https://paste.xinu.at/OxBm/

once the last bugs will get ironed out it will get much much bigger ;-)

Kungsgeten commented 8 years ago

I found the error. org-capture starts an org-mode buffer, and now yankpad tries to switch category, since you have a yankpad category called org-mode. When it switches category it goes through all the snippets, in case there's one with keybindings. You had an empty snippet (research project, since it only contained subheadings and they aren't parsed), which caused an error. This error was catched by the org-capture function, and thus it exited.

I've now fixed so that empty snippets will not cause an error. I did not get your org-table error message however...

As a side note: You have /* at the beginning of some lines, but I think you want \* (backslash instead of slash).