From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: attach file C-c C-a m - problem with file completion Date: Mon, 03 Oct 2016 18:49:34 +0200 Message-ID: References: <87mvilqu0h.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1br6Qw-0008QM-2x for emacs-orgmode@gnu.org; Mon, 03 Oct 2016 12:49:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1br6Qr-00084P-RT for emacs-orgmode@gnu.org; Mon, 03 Oct 2016 12:49:41 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:60915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1br6Qr-00084I-HV for emacs-orgmode@gnu.org; Mon, 03 Oct 2016 12:49:37 -0400 In-Reply-To: (Rainer M. Krug's message of "Mon, 03 Oct 2016 18:39:37 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Rainer M Krug writes: > Nicolas Goaziou writes: > >> Hello, >> >> Rainer M Krug 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 possib= le. |=20=20=20=20=20 | 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: |=20=20=20=20=20 | (defadvice foo (around original-completing-read-only activate) | (let (ido-enable-replace-completing-read) ad-do-it))") |=20=20=20=20=20 | ;; Replace completing-read wherever possible, unless directed otherwi= se | (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 d= ef)) | 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, =2D-=20 Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJX8oweAAoJENvXNx4PUvmCq0QH/AoaWK8gnTbh+4R8BA9j799o LwPTXsYdOVDerVs4j1Z+qAGqh52skvmLqz0TKmfGQ4A3glQXhlSbILGBZ66Qbekr CfcfvKzV9XhJN8Y4cmz/ngUsQjOUoJ9S2693g6ro4ZKv2peFfb1Qb0UXn8jF4gsA eBNMM1TTPXBNBn8wc7ehoTjUxnd3j16+ZGf8I9P4fPkPv9WS0eIT4xaeoTh1s7Ty C8Tq6GfhIcXO6SveyHhjbm51oGONQCDq5hi4MNo1L3FYcPKBhGeqr68mfz+yna7V PfqBs8XgLYyOWufPy+91sHIPftyHxgBVNbUrW5Qq4D4ToHxlUVlGD1ZfH9eNBOI= =lHxm -----END PGP SIGNATURE----- --=-=-=--