emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer M Krug <Rainer@krugs.de>
To: emacs-orgmode@gnu.org
Subject: Re: attach file C-c C-a m - problem with file completion
Date: Mon, 03 Oct 2016 18:49:34 +0200	[thread overview]
Message-ID: <m2twctnzs1.fsf@krugs.de> (raw)
In-Reply-To: <m2y425o08m.fsf@krugs.de> (Rainer M. Krug's message of "Mon, 03 Oct 2016 18:39:37 +0200")

[-- Attachment #1: Type: text/plain, Size: 2682 bytes --]

Rainer M Krug <Rainer@krugs.de> writes:

> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>
>> Hello,
>>
>> Rainer M Krug <Rainer@krugs.de> 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.

Cheers,

Rainer

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

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 454 bytes --]

      reply	other threads:[~2016-10-03 16:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-03 15:48 attach file C-c C-a m - problem with file completion Rainer M Krug
2016-10-03 16:11 ` Rainer M Krug
2016-10-03 16:25   ` Nicolas Goaziou
2016-10-03 16:39     ` Rainer M Krug
2016-10-03 16:49       ` Rainer M Krug [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2twctnzs1.fsf@krugs.de \
    --to=rainer@krugs.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).