Skip to content

Adds filename completion for [file: entries#4

Open
hewner wants to merge 1 commit into
aki2o:masterfrom
hewner:master
Open

Adds filename completion for [file: entries#4
hewner wants to merge 1 commit into
aki2o:masterfrom
hewner:master

Conversation

@hewner

@hewner hewner commented May 10, 2015

Copy link
Copy Markdown

Comments/changes welcome! I am by no means an expert on autocomplete.

@hewner

hewner commented May 20, 2015

Copy link
Copy Markdown
Author

Anybody there?

@aki2o

aki2o commented May 21, 2015

Copy link
Copy Markdown
Owner

Hi, @hewner
Thanks for your p-r. But, I'm busy now...
Please give me a time...

@hewner

hewner commented May 21, 2015

Copy link
Copy Markdown
Author

No problem - just keep me up to date.

@hewner

hewner commented Aug 10, 2015

Copy link
Copy Markdown
Author

Just a quick reminder this is still here

@aki2o

aki2o commented Aug 12, 2015

Copy link
Copy Markdown
Owner

I'm very sorry my checking is delayed... <(_ _)><(_ _)><(_ _)>
I'll do it in a few days.

Comment thread org-ac.el

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the following is better.

(defvar ac-source-org-ac-file
  '((init . (setq ac-filename-cache nil))
    (candidates . org-ac/file-candidate)
    (prefix . "\\[file:\\(.*\\)")
    (symbol . "f")
    (requires . 0)
    (action . ac-start)
    (limit . nil)))
  • Probably init key is wrong. see (ac-define-source filename ... in auto-complete.el
  • prefix key uses a first group in reguler-expression for ac-prefix
  • We can start completion even if ac-prefix don't exist giving 0 to requires key

@aki2o

aki2o commented Aug 14, 2015

Copy link
Copy Markdown
Owner

In addition, Could you change the definition of ac-source-org-ac-link-head?

(defvar ac-source-org-ac-link-head
  `((candidates . org-ac--get-link-head-candidates)
    (prefix . ,org-ac--regexp-link-head)
    (symbol . "l")
    (requires . 0)
    (cache)
    (action . (lambda ()
                (ac-pcmp/do-ac-action)
                (ac-start)))))

By this change, we'll be able to start completion automatically at the finish of the completion to start a link.

@aki2o

aki2o commented Aug 14, 2015

Copy link
Copy Markdown
Owner

Thank you for giving such useful function.

BTW, in present, I don't use this extension to input a link but use org-linkany.el to do that.
I'd be glad if you check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants