emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* problems with org and pabbrev
@ 2016-02-09 14:43 orgmode
  2016-02-09 15:50 ` Eric S Fraga
  0 siblings, 1 reply; 4+ messages in thread
From: orgmode @ 2016-02-09 14:43 UTC (permalink / raw)
  To: emacs-orgmode

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

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

end of thread, other threads:[~2016-02-10 17:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-09 14:43 problems with org and pabbrev orgmode
2016-02-09 15:50 ` Eric S Fraga
2016-02-10 11:47   ` orgmode
2016-02-10 16:22     ` Eric S Fraga

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).