From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Wales Subject: Re: Custom function: Detect agenda mode Date: Tue, 20 Aug 2019 15:02:23 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:33313) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0CCw-00080c-Qa for emacs-orgmode@gnu.org; Tue, 20 Aug 2019 18:02:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0CCv-0006jO-LI for emacs-orgmode@gnu.org; Tue, 20 Aug 2019 18:02:26 -0400 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]:44357) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0CCv-0006jA-EJ for emacs-orgmode@gnu.org; Tue, 20 Aug 2019 18:02:25 -0400 Received: by mail-lj1-x241.google.com with SMTP id e24so194637ljg.11 for ; Tue, 20 Aug 2019 15:02:25 -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: Nathan Neff Cc: emacs-orgmode i do (eq major-mode 'org-agenda-mode) On 8/20/19, Nathan Neff wrote: > Hello all, > > I would like to map the same key to different functions in evil mode. > > For example, ",s" should be a shortcut to the schedule command. > > I'd like to have one function that I would map the command to, which > would call either org-schedule or org-agenda-schedule, depending on whether > the cursor is in an Agenda view or an org file. > > What is the "correct" way to do this? Is there some handy functional > programming > fu that I should know? For example, I wouldn't be surprised to find a > function > in org-mode already that would do the detection and take the proper action. > > Thanks, > --Nate > -- The Kafka Pandemic What is misopathy? https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html The disease DOES progress. MANY people have died from it. And ANYBODY can get it at any time.