emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* attach file C-c C-a m - problem with file completion
@ 2016-10-03 15:48 Rainer M Krug
  2016-10-03 16:11 ` Rainer M Krug
  0 siblings, 1 reply; 5+ messages in thread
From: Rainer M Krug @ 2016-10-03 15:48 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi

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?

Thanks,

Rainer


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

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

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

* Re: attach file C-c C-a m - problem with file completion
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Rainer M Krug @ 2016-10-03 16:11 UTC (permalink / raw)
  To: emacs-orgmode

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

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

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

>
> Thanks,
>
> Rainer

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

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

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

* Re: attach file C-c C-a m - problem with file completion
  2016-10-03 16:11 ` Rainer M Krug
@ 2016-10-03 16:25   ` Nicolas Goaziou
  2016-10-03 16:39     ` Rainer M Krug
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2016-10-03 16:25 UTC (permalink / raw)
  To: Rainer M Krug; +Cc: emacs-orgmode

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. I do
not use Ido, tho.

Regards,

-- 
Nicolas Goaziou

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

* Re: attach file C-c C-a m - problem with file completion
  2016-10-03 16:25   ` Nicolas Goaziou
@ 2016-10-03 16:39     ` Rainer M Krug
  2016-10-03 16:49       ` Rainer M Krug
  0 siblings, 1 reply; 5+ messages in thread
From: Rainer M Krug @ 2016-10-03 16:39 UTC (permalink / raw)
  To: emacs-orgmode

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

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.

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 --]

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

* Re: attach file C-c C-a m - problem with file completion
  2016-10-03 16:39     ` Rainer M Krug
@ 2016-10-03 16:49       ` Rainer M Krug
  0 siblings, 0 replies; 5+ messages in thread
From: Rainer M Krug @ 2016-10-03 16:49 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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 --]

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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

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