[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] attach file C-c C-a m - problem with file completion

From: Rainer M Krug
Subject: Re: [O] attach file C-c C-a m - problem with file completion
Date: Mon, 03 Oct 2016 18:49:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (darwin)

Rainer M Krug <address@hidden> writes:

> Nicolas Goaziou <address@hidden> writes:
>> Hello,
>> Rainer M Krug <address@hidden> writes:
>>>> I started using attachments and really like them. But I have a problem
>>>> with the completion of file names. I use ido usually and it works fine -
>>>> but not here. How can I register ido completion for org-attach?
>>> Forgot to mention - it always points to the .org file in which I want to
>>> attach the file and I can't change the directory.
>> I'm not sure to understand. What doesn't work? If a use "C-c C-a m" on
>> a headline, I get a completion window where I can change directory.
> OK - I'll try to explain.
> I am in a file called attach.org.
> I press C-c C-a m in a headline and I get the completion window in the
> mini buffer - so far so good.
> But I can't change the directory.
> I disabled ido, and it is working now. So this is a problem in IDO. I
> will see if I can figure out what it is.

OK - the culprit is the following code from
https://www.emacswiki.org/emacs/InteractivelyDoThings#toc15 :

|     (defvar ido-enable-replace-completing-read t
|       "If t, use ido-completing-read instead of completing-read if possible.
|     Set it to nil using let in around-advice for functions where the
|     original completing-read is required.  For example, if a function
|     foo absolutely must use the original completing-read, define some
|     advice like this:
|     (defadvice foo (around original-completing-read-only activate)
|       (let (ido-enable-replace-completing-read) ad-do-it))")
|     ;; Replace completing-read wherever possible, unless directed otherwise
|     (defadvice completing-read
|       (around use-ido-when-possible activate)
|       (if (or (not ido-enable-replace-completing-read) ; Manual override 
disable ido
|               (and (boundp 'ido-cur-list)
|                    ido-cur-list)) ; Avoid infinite loop from ido calling this
|           ad-do-it
|         (let ((allcomp (all-completions "" collection predicate)))
|           (if allcomp
|               (setq ad-return-value
|                     (ido-completing-read prompt
|                                    allcomp
|                                    nil require-match initial-input hist def))
|             ad-do-it))))

Any suggestion why this is happening? For the moment, I just disabled
this code completely.



> Thanks,
> Rainer
>> I do not use Ido, tho.
>> Regards,

Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]