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

* Re: problems with org and pabbrev
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Eric S Fraga @ 2016-02-09 15:50 UTC (permalink / raw)
  To: orgmode; +Cc: emacs-orgmode

On Tuesday,  9 Feb 2016 at 15:43, orgmode wrote:
> 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.

In my case, <tab> seems to work although I do refer to it as [tab] in my
initialisation code:

#+begin_src emacs-lisp
  (require 'pabbrev)
  (setq pabbrev-idle-timer-verbose nil
        pabbrev-read-only-error nil)
  (define-key pabbrev-mode-map [tab] 'pabbrev-expand-maybe)
  (add-hook 'text-mode-hook (lambda () (pabbrev-mode)))
#+end_src

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.90.1, Org release_8.3.3-535-g7213aa

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

* Re: problems with org and pabbrev
  2016-02-09 15:50 ` Eric S Fraga
@ 2016-02-10 11:47   ` orgmode
  2016-02-10 16:22     ` Eric S Fraga
  0 siblings, 1 reply; 4+ messages in thread
From: orgmode @ 2016-02-10 11:47 UTC (permalink / raw)
  To: emacs-orgmode

Thanks very much.  The following line did the trick:

(define-key pabbrev-mode-map [tab] 'pabbrev-expand-maybe)

I set this after loading orgmode.  It seems pabbrev uses \tab and not 
[tab]. or orgmode somehow overrides it, and it has to be set explicitly.



On 2016-02-09 16:50, Eric S Fraga wrote:
> On Tuesday,  9 Feb 2016 at 15:43, orgmode wrote:
>> 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.
> 
> In my case, <tab> seems to work although I do refer to it as [tab] in 
> my
> initialisation code:
> 
> #+begin_src emacs-lisp
>   (require 'pabbrev)
>   (setq pabbrev-idle-timer-verbose nil
>         pabbrev-read-only-error nil)
>   (define-key pabbrev-mode-map [tab] 'pabbrev-expand-maybe)
>   (add-hook 'text-mode-hook (lambda () (pabbrev-mode)))
> #+end_src

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

* Re: problems with org and pabbrev
  2016-02-10 11:47   ` orgmode
@ 2016-02-10 16:22     ` Eric S Fraga
  0 siblings, 0 replies; 4+ messages in thread
From: Eric S Fraga @ 2016-02-10 16:22 UTC (permalink / raw)
  To: orgmode; +Cc: emacs-orgmode

On Wednesday, 10 Feb 2016 at 12:47, orgmode wrote:
> Thanks very much.  The following line did the trick:
>
> (define-key pabbrev-mode-map [tab] 'pabbrev-expand-maybe)
>
> I set this after loading orgmode.  It seems pabbrev uses \tab and not
> [tab]. or orgmode somehow overrides it, and it has to be set
> explicitly.

Excellent.  Glad I could help.  The mysteries of [tab]/<tab>/\t/TAB are
just that, a complete mystery (to me).
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.90.1, Org release_8.3.3-535-g7213aa

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