From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: Re: assign tags via helm/avy? Date: Tue, 31 May 2016 06:17:40 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1148b440c8dcfb05341ad06d Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7aBb-0004fx-Eq for emacs-orgmode@gnu.org; Mon, 30 May 2016 23:17:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7aBY-0002CD-VX for emacs-orgmode@gnu.org; Mon, 30 May 2016 23:17:42 -0400 Received: from mail-yw0-x233.google.com ([2607:f8b0:4002:c05::233]:36004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7aBY-0002C9-Q2 for emacs-orgmode@gnu.org; Mon, 30 May 2016 23:17:40 -0400 Received: by mail-yw0-x233.google.com with SMTP id x189so176568699ywe.3 for ; Mon, 30 May 2016 20:17:40 -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" To: John Kitchin Cc: org mode --001a1148b440c8dcfb05341ad06d Content-Type: text/plain; charset=UTF-8 thx so much john! is there a way where the function can auto read all the tags from "org-tag-persistent-alist " instead of manfully adding to the function each time a new tag is added? best Z On Tue, May 31, 2016 at 3:42 AM, John Kitchin wrote: > Here is a helm approach that seems like what you want. > > #+BEGIN_SRC emacs-lisp > (defun tag-lister () > "Function that gets and returns possible tags." > (list "tag1" "tag2" "tag3")) > > (defun helm-tagger () > (interactive) > (helm > :sources > `((name . "HELM tag setter") > (candidates . ,(tag-lister)) > (action . (lambda (candidate) > (org-set-tags-to (helm-marked-candidates))))))) > > > #+END_SRC > Xebar Saram writes: > > > Hi guys > > > > i have a bunch of tags i define via > > > > (:startgroup) > > ("Where?") > > (:grouptags) > > ("@home" . ?h) > > ("@work" . ?w) > > ("@pc" . ?p) > > ("@family" . ?f) > > ("@shop" . ?s) > > (:endgroup) > > > > (:startgrouptag) > > ("people") > > (:grouptags) > > ("allan" . ?a) > > ("bob" . ?o) > > ("joel" . ?j) > > ("david" . ?d) > > ("boris" . ?b) > > ("massimo" . ?s) > > (:endgrouptag) > > > > anyone know of a way to quick add tags via a helm/avy interface? > > > > right now its quite cumbersome to press C-c then C-c to see a list of all > > tags. also some tags have the same key (?a) and then its impossible to > > select the 2nd one > > > > thx alot in advance > > > > Z > > > -- > Professor John Kitchin > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu > --001a1148b440c8dcfb05341ad06d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
thx so much john!

is there a way where = the function can auto read all the tags from "org-tag-persistent-alist= " instead of manfully adding to the function each time a new tag is a= dded?

best

Z
<= div class=3D"gmail_extra">
On Tue, May 31, 20= 16 at 3:42 AM, John Kitchin <jkitchin@andrew.cmu.edu> = wrote:
Here is a helm approach that seems= like what you want.

#+BEGIN_SRC emacs-lisp
(defun tag-lister ()
=C2=A0 "Function that gets and returns possible tags."
=C2=A0 (list "tag1" "tag2" "tag3"))

(defun helm-tagger ()
=C2=A0 (interactive)
=C2=A0 (helm
=C2=A0 =C2=A0:sources
=C2=A0 =C2=A0`((name . "HELM tag setter")
=C2=A0 =C2=A0 =C2=A0(candidates . ,(tag-lister))
=C2=A0 =C2=A0 =C2=A0(action . (lambda (candidate)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-set-tags= -to (helm-marked-candidates)))))))


#+END_SRC
Xebar Saram writes:

> Hi guys
>
> i have a bunch of tags i define via
>
> (:startgroup)
>=C2=A0 =C2=A0 =C2=A0("Where?")
>=C2=A0 =C2=A0 =C2=A0(:grouptags)
>=C2=A0 =C2=A0 =C2=A0 ("@home" . ?h)
>=C2=A0 =C2=A0 =C2=A0 ("@work" . ?w)
>=C2=A0 =C2=A0 =C2=A0 ("@pc" . ?p)
>=C2=A0 =C2=A0 =C2=A0 ("@family" . ?f)
>=C2=A0 =C2=A0 =C2=A0 ("@shop" . ?s)
>=C2=A0 =C2=A0 =C2=A0 (:endgroup)
>
> (:startgrouptag)
>=C2=A0 =C2=A0 =C2=A0("people")
>=C2=A0 =C2=A0 =C2=A0(:grouptags)
>=C2=A0 =C2=A0 =C2=A0("allan" . ?a)
>=C2=A0 =C2=A0 =C2=A0("bob" . ?o)
>=C2=A0 =C2=A0 =C2=A0("joel" . ?j)
>=C2=A0 =C2=A0 =C2=A0("david" . ?d)
>=C2=A0 =C2=A0 =C2=A0("boris" . ?b)
>=C2=A0 =C2=A0 =C2=A0("massimo" . ?s)
>=C2=A0 =C2=A0 =C2=A0 (:endgrouptag)
>
> anyone know of a way to quick add tags via a helm/avy interface?
>
> right now its quite cumbersome to press C-c then C-c to see a list of = all
> tags. also some tags have the same key (?a) and then its impossible to=
> select the 2nd one
>
> thx alot in advance
>
> Z


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

--001a1148b440c8dcfb05341ad06d--