Hi,
somehow pabbrev mode doesn't work anymore with org, since I use org from
elpa.
after loading org, pabbrev is a minor mode, as indicated in the
modeline.
However <tab> runs the command org-cycle instead of
pabbrev-expand-maybe.
So I wrote the following functions:
(defun org-cycle-or-pabbrev-expand ()
"use org-cycle in headline, otherwise use pabbrev-expand-maybe"
(interactive)
(if (looking-at org-outline-regexp)
(org-cycle)
(pabbrev-expand-maybe 'nil)))
(add-hook 'org-mode-hook
'(lambda ()
(define-key org-mode-map [tab]
'org-cycle-or-pabbrev-expand)
))
This gives an error:
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p
nil)
=(nil 4)
(cond ((= uarg 4) (if (> (length pabbrev-expansion-suggestions) 1)
(pabbrev-suggestions-goto-buffer pabbrev-expansion-suggestions)
(pabbrev-call-previous-tab-binding))) ((eq last-command (quote
pabbrev-expand-maybe)) (if (and (> (length
pabbrev-expansion-suggestions) 1) (> (length
pabbrev-last-expansion-suggestions) 1)) (pabbrev-suggestions-goto-buffer
pabbrev-last-expansion-suggestions)
(pabbrev-call-previous-tab-binding))) (pabbrev-expansion (progn (setq
pabbrev-last-expansion-suggestions pabbrev-expansion-suggestions)
(pabbrev-expand))) (t (pabbrev-call-previous-tab-binding)))
pabbrev-expand-maybe-full(nil)
(if pabbrev-minimal-expansion-p (pabbrev-expand-maybe-minimal uarg)
(pabbrev-expand-maybe-full uarg))
pabbrev-expand-maybe(nil)
(if (looking-at org-outline-regexp) (org-cycle) (pabbrev-expand-maybe
(quote nil)))
org-cycle-or-pabbrev-expand()
call-interactively(org-cycle-or-pabbrev-expand nil nil)
command-execute(org-cycle-or-pabbrev-expand)
I've no idea how to preceed further, any help appreciated.
Versions I use:
emacs version 24.1
pabbrev Version: 4.2.1