From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: daniela-spit@gmx.it Newsgroups: gmane.emacs.help Subject: Keybinding Cycle for various Capture and Agenda Setups Date: Sun, 29 Nov 2020 21:13:21 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19456"; mail-complaints-to="usenet@ciao.gmane.io" To: Help Gnu Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 29 21:14:05 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjT5A-0004zG-Pi for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 29 Nov 2020 21:14:04 +0100 Original-Received: from localhost ([::1]:49582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjT59-0005hA-Ro for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 29 Nov 2020 15:14:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjT4X-0005go-8Y for help-gnu-emacs@gnu.org; Sun, 29 Nov 2020 15:13:25 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:37631) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjT4V-0001Es-BC for help-gnu-emacs@gnu.org; Sun, 29 Nov 2020 15:13:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606680801; bh=eq3ZVFUQkNngectDpaFt7pCiGWbiZCK0W37ma7xCvgs=; h=X-UI-Sender-Class:From:To:Subject:Date; b=SLo4lNoS8aBy61cQ7j5jGP5P7B1fcw4p6B9VMKWw2mrcFe7WvHg5dNHQ4eOqt52Un fftGJO22SxX625yPrDX1ntiVhurFC/S8uSQS3gf1QVTvmQ0Pj3cHn+kWoe/Mdm1qDF 65eE+nBbT0Bkc4wHFfRgEvtvfC0En+uFfDKgmyZ0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs12.server.lan [172.19.170.180]) (via HTTP); Sun, 29 Nov 2020 21:13:21 +0100 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:ygUik3VEtLZU6aXXJRF3v8QVIaYW98AePwEuoG2wXOjFzFksfOAusPtT6x4oGngM2p18z Eb9p04vjHEwKHMgCVU0QYaLyVNuohTxHILXKEo/abyKb00PxXIhnZrAlqCIUdgksPwbfZBEAYv56 yxLCULZXlmmZLM5QgbJDyDTbWcE0PF3eHHUzHXQDvO+0km8oPnjOjGtfXCndT3lXOpHS6NuNK3iv 67MGhE2Paid0oAfiysJM6U80TjmazU+v03KMsfa4Hw3kOQurkDFI3tIumvKxsMHHy3BPPkbCNE+u 14= X-UI-Out-Filterresults: notjunk:1;V03:K0:htO8bcTLGw8=:iDpJqYEs5JZKb2oCzTSiV9 7TrdUxNtO5ZD3ZidtTz1DQh0Khw5/Z7dm55jyIFPjZ71njttMeEZ1QFFtpEmHTGvBPlyW/ew1 lANt/EYVExZQ3cjwZWD2p7SFN5DfYhxngCKLmr/BReoZf2yzg4/eDEZrFqgkStVgSb4Wzl6Lx 4lYm/h61i4R7nmveI5BTAFyGRDpUz8DXJetlz4Ev+hk7o8cKbjWKjNrD7QclKijRzKC1BsotU toyXFWuDA5fMW8d2D7Ao/wUIWEB3AehNT8jBxEEfqtSVS97CPhYqFoECAoKsVcqpBbN5phA66 9eC3ndXmdTt+ZigjduPZZz+aXbAbEaiNvOCib4OJp3iv+l92nqw2av5+jKYoGur6r6zl43dUi lSInSOVsSUHaVL/515wRtNFP48Gt9JNuNKrdXOjBDtuU47b6BvUZs1ad24joRcwdxIW/j2EM3 2pFJWwHJBRRmEoFXMK2IOTVjHRNWWoomTNN9BfmFspQx86wNNWuCKlMrtWdRmpWc/MicdIfe4 uk6UBwasNKWSjiexWeC9JySVj0abM8HzfuOOzeR8foJls31jQzHmBl9OUF0Y8au1WwA1o7rme GiMxdjfqQAaH0= Received-SPF: pass client-ip=212.227.15.19; envelope-from=daniela-spit@gmx.it; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:125751 Archived-At: I have made a few different templates for Org Capture and different setups for Org Agenda. One basically uses typh-capture-set-instance and typh-agenda-set-instance to perform the switch. The approach works. Now I am trying to make a keybinding that can switch between typh-capture-set-instance and typh-agenda-set-instance, then have emacs ask me what selection I want. Have encountered a problem on an appropriate way to set a keybinding for what I want to do - mainly get a rapid way to change the instance of Capture and of Agenda according to my instance setup. ;; ---------------------------------------------------------------------- (defun typh-capture-set-instance (n) "Sets an instance for Note Capture.\n Options: [1. cap-inst-earth] [2. cap-inst-atmosphere] [3. cap-inst-energ= y]" (interactive "n Select [1. earth] [2. atmosphere] [3. energy]: ") (pcase n (1 (cap-inst-earth)) (2 (cap-inst-atmosphere)) (3 (cap-inst-energy)) (_ (progn (message "Org Capture value N not assigned.") (message "See file.el"))) )) ;; ---------------------------------------------------------------------- (defun typh-agenda-set-instance (n) "Sets an instance for Org Agenda.\n Options: [1. agn-inst-earth] [2. agn-inst-atmosphere] [3. agn-inst-energy]= " (interactive "n Agenda Select [1. earth] [2. atmosphere] [3. energy]: ") (pcase n (1 (agn-inst-earth)) (2 (agn-inst-atmosphere)) (3 (agn-inst-energy)) (_ (progn (message "Org Capture value N not assigned.") (message "See file.el"))) )) ;; By default use Capture anh Agenda for Shiva (cap-earth) (agn-earth) (defun typh-cycle-cap-agn () "Cycles setup for Note Capture and Org Agenda." (interactive) (when (not (eq last-command this-command)) (put this-command 'state 0)) (cond ((equal 0 (get this-command 'state)) (typh-capture-set-instance) (put this-command 'state 1)) ((equal 1 (get this-command 'state)) (typh-agenda-set-instance) (put this-command 'state 0)) )) (global-set-key (kbd "H-a") #'typh-cycle-cap-agn)