From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anders Johansson Subject: Re: Bug? org-set-tags never uses ido Date: Wed, 02 Apr 2014 19:37:42 +0200 Message-ID: <533C4AE6.3020002@gmail.com> References: <527287AB.10707@gmail.com> <53167048.1040106@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVP6u-0000EB-Ix for emacs-orgmode@gnu.org; Wed, 02 Apr 2014 13:38:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVP6n-0001eA-II for emacs-orgmode@gnu.org; Wed, 02 Apr 2014 13:38:00 -0400 Received: from mail-la0-x234.google.com ([2a00:1450:4010:c03::234]:61268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVP6n-0001dk-9t for emacs-orgmode@gnu.org; Wed, 02 Apr 2014 13:37:53 -0400 Received: by mail-la0-f52.google.com with SMTP id ec20so434258lab.39 for ; Wed, 02 Apr 2014 10:37:51 -0700 (PDT) Received: from [130.238.77.49] (pc49.kvk.uu.se. [130.238.77.49]) by mx.google.com with ESMTPSA id jh4sm1797086lbb.26.2014.04.02.10.37.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Apr 2014 10:37:50 -0700 (PDT) In-Reply-To: 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org A hack to get ido selection for multiple tags. It uses ido-completing-read-multiple (available here and included below: https://gist.github.com/mgalgs/1329188) to allow for completing one tag at a time and ending it by typing ":". I haven't tested it much and it might possibly break things (or most certainly it's implemented in an ugly way). Perhaps someone more than me will find it useful. Cheers, Anders ---- (defadvice org-icompleting-read (around org-use-ido-for-tags (prompt coll &optional pred reqm initial hist def) activate) "Advised to use ido for multiple completion of tags" (setq ad-return-value (if (string= "Tags: " prompt) (mapconcat 'identity (ido-completing-read-multiple prompt (mapcan 'copy-list org-last-tags-completion-table) pred reqm initial hist def ":") ":") ad-do-it))) (defun ido-completing-read-multiple (prompt choices &optional predicate require-match initial-input hist def sentinel) "Read multiple items with ido-completing-read. Reading stops when the user enters SENTINEL. By default, SENTINEL is \"*done*\". SENTINEL is disambiguated with clashing completions by appending _ to SENTINEL until it becomes unique. So if there are multiple values that look like SENTINEL, the one with the most _ at the end is the actual sentinel value. See documentation for `ido-completing-read' for details on the other parameters." (let ((sentinel (if sentinel sentinel "*done*")) (done-reading nil) (res ())) ;; uniquify the SENTINEL value (while (find sentinel choices) (setq sentinel (concat sentinel "_"))) (setq choices (cons sentinel choices)) ;; read some choices (while (not done-reading) (setq this-choice (ido-completing-read prompt choices predicate require-match initial-input hist def)) (if (equal this-choice sentinel) (setq done-reading t) (setq res (cons this-choice res)))) ;; return the result res )) ----