From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id AO1RIFtGimI2EgAAbAwnHQ (envelope-from ) for ; Sun, 22 May 2022 16:19:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id WOpcH1tGimIyWwEAG6o9tA (envelope-from ) for ; Sun, 22 May 2022 16:19:07 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E7AB735A7D for ; Sun, 22 May 2022 16:19:06 +0200 (CEST) Received: from localhost ([::1]:55592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nsmQE-000378-6O for larch@yhetil.org; Sun, 22 May 2022 10:19:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsmPi-00036u-MT for emacs-orgmode@gnu.org; Sun, 22 May 2022 10:18:34 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:41569) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nsmPg-00048g-Os for emacs-orgmode@gnu.org; Sun, 22 May 2022 10:18:34 -0400 Received: by mail-wr1-x433.google.com with SMTP id u27so16701261wru.8 for ; Sun, 22 May 2022 07:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to; bh=ctHqKMwMBtclqh9uWutwHEJpTL6fr3ysapfAQXJmRrk=; b=Yx1IggE02dFKkTBbr/L8ze/gl5R/GZECB/QaGfQ0n2bdFeWMSYRhFpMozxT+Z6eVx3 MU50ps2msoO2tB990XNKSNon9JPD+D1nolLhz6+FdF1EMYW8JSt6n7e/ygd/Er2LIePW VMp4KeVejgDfeW6LlBtAB6CTmiUfUqQZG2IQG4X9VUfoB8AQWpFYq/sWvj+DMZEg97qc T6XQf9usbVcB2eI8sWaAM21gULc3PK0HK+HOYdMFUD2QzF9Jyi7nkipq38WtNT29mvDS 5ykUOR4jFeq2aYxNrfwv06nt/CdVCBNduspVkpmECQ9lSzbfr/ombJTKYdpg2tlm654n 0UxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to; bh=ctHqKMwMBtclqh9uWutwHEJpTL6fr3ysapfAQXJmRrk=; b=WaQ6VDZmjjQ51dCOacPX7fi2S9EjlJ0s6lYgSkjC/wb+yjLRL20oDopbGHCdHarv04 NmCroKZSNZlkneOIIaHYdXJj11ixHZhuzfJPEfpRCZIgd/fR5mldBwZOCpmSfdzRA8gH V4i/dri1VcWdc5/beFSFJ0s2Ml5P2W7mu6PFtVfYyt9N9hfMcHnQTiu5BTAchWyioOnt r2w4PJ0sS/5k6iXLlK87aWQuEfOHLbMSXtZLkoefxoamwsjkjrtDzlJBRdD6WEp6DYA6 Di8+Xqsp3VLz+oqiplRQDfDuZJ1pnMFdos67TdX17R4NjIs8a7/RUQ0YYWf0U5qjj8nC HoCg== X-Gm-Message-State: AOAM532y/HX5otNKp/Sm9wO2OuKPdb8bf/6CY+FElp4PP85yVIN9SJIj t227rZRdo2vgOFlA7iQlnMI= X-Google-Smtp-Source: ABdhPJwea4uEgp12UgAv1cg0gQl+a7KgXtWVNcyCUmjquv/5lZX+UgMgzvrG/03s5wCNwEO3xnyceA== X-Received: by 2002:adf:ea11:0:b0:20d:768:da9f with SMTP id q17-20020adfea11000000b0020d0768da9fmr15187640wrm.625.1653229110768; Sun, 22 May 2022 07:18:30 -0700 (PDT) Received: from [192.168.0.97] ([5.225.20.86]) by smtp.gmail.com with ESMTPSA id e12-20020adfef0c000000b0020d0435c97bsm7302422wro.92.2022.05.22.07.18.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 May 2022 07:18:30 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------sf5knoDTDVCFcefBoTyZxFjn" Message-ID: <40815376-d7db-4199-a6d8-6b362af44209@gmail.com> Date: Sun, 22 May 2022 16:18:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: Help with my first elisp Content-Language: en-GB To: Greg Minshall Cc: Org-mode References: <5ca03caa-bb97-664b-4c58-9ec296a1eef8@gmail.com> <2346292.1653226030@apollo2.minshall.org> From: Ypo In-Reply-To: <2346292.1653226030@apollo2.minshall.org> Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=ypuntot@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653229147; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ctHqKMwMBtclqh9uWutwHEJpTL6fr3ysapfAQXJmRrk=; b=ZdDMywAhMfj1/ElrdqWxmJIoM1wIGYO/qWsxIx/jWOWhmjSxtWaqNiID/caYaCjlKkrd/K cXP4IcG2mGwrA2G7e45hQZs7FH0ZO9Vpul+dX+MzBj2FTz7uHomS225gPoFU2jrVn8nZHL 13z14ZUn7kpQpLlfTu+XwJ5lfGwWq0bTtIiXidO/NG6yML7dPtMOjngT4lC55JYyrdUQ3y n1zx5eX/vSGVVV2V63k8eEcXELNkO5TlHPrTzkTBHI6sDKWf3OBmxx1t6GWd4IJWWg5Ib9 xTskLoUisJHJFoEgbEB+yYzcis6PuRIFHFB8+DF1M5Bf6S/BLxsXxdT0MqXyZQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653229147; a=rsa-sha256; cv=none; b=hRFGD1/FJONAvpBdUlGZS8qCDguuy4CbN8lQ6+ubA9NPYp1/cTn0/UGNIHQ9TY5ez2cii5 JMHfjNMx/ETdVthOaCev1w7TvZx41jgLDL7xqk+E7TbwQH4ZBl1Aeh0ur4U0zxaGrPIGDs XID6N9cg92joNPE8n7AxgcURPtts9Ko76axbL56qOwkfUcgztP6OlhhKhPDJpcQ+4JU9nV r7UqkJkNQTh844hF8LZIr07wCJzpSlA3yRaN9hVKL8kxGtErkcalg33M/EETSJffvVFQaU V2LrXZ88+Z1dsMXvYaqMPQShmYU+TiQJnBdxl3ULOzuTgZ1dmmjzNFn1BfNoMA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Yx1IggE0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.35 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Yx1IggE0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: E7AB735A7D X-Spam-Score: -4.35 X-Migadu-Scanner: scn0.migadu.com X-TUID: y5Z+IJYoZ+yT This is a multi-part message in MIME format. --------------sf5knoDTDVCFcefBoTyZxFjn Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Thanks, Greg * Now I am able to run my script every time I am in logos-focus mode :D * But my keys don't get to be "normal" after I get out of logos-focus mode. This is how my code is evolving (the "conditional part" is not working yet): (add-hook 'logos-focus-mode-hook #'(lambda () (defvar posicion   "Position where is the cursor.") (defun posicion3 ()   (interactive)   (end-of-visual-line) ;;C-e   (backward-char 7)   (setq posicion 3) ) (defun posicion2 ()   (interactive)   (forward-char 23)   (setq posicion 2) ) (defun posicion1 ()   (interactive)   (next-line 1)   (beginning-of-visual-line)   (forward-char 6)   (setq posicion 1) ) (defun salto ()   (interactive)   (if posicion 1     (posicion2)       (if posicion 2       (posicion3)         (if posicion 3         (posicion1))))) ;; (define-key global-map (kbd "SPC") #'salto) (local-set-key "j" 'posicion1) (local-set-key "k" 'posicion2) (local-set-key "l" 'posicion3) )) El 22/05/2022 a las 15:27, Greg Minshall escribió: > Ypo, > >> Additional problem: I don't know how to recover keys 1, 2 and 3 to >> their normal functioning, right now I can't type 1, 2 or 3 on my >> Emacs. xD > you have, e.g., > >> (define-key global-map (kbd "1") #'posicion1) >> (define-key global-map (kbd "2") #'posicion2) >> (define-key global-map (kbd "3") #'posicion3) > but, that is in the global map. for a given mode, i sometimes do > something like that: > >> (add-hook 'mh-show-mode-hook #'(lambda () >> (local-set-key "q" 'mh-show-execute-commands))) > or, closer to what you have, sometimes like > >> (define-key mh-letter-mode-map >> (kbd "C-c s") >> 'ggm-mh-sentaddrs-completion) > i am no elisp expert, and so those are just random things i've found > that work. but, hopefully this may give you a hint of a direction to > follow. > > cheers, Greg --------------sf5knoDTDVCFcefBoTyZxFjn Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Thanks, Greg

  • Now I am able to run my script every time I am in logos-focus mode :D
  • But my keys don't get to be "normal" after I get out of logos-focus mode.

This is how my code is evolving (the "conditional part" is not working yet):

(add-hook 'logos-focus-mode-hook #'(lambda ()

(defvar posicion
  "Position where is the cursor.")

(defun posicion3 ()
  (interactive)
  (end-of-visual-line) ;;C-e
  (backward-char 7)
  (setq posicion 3)
)

(defun posicion2 ()
  (interactive)
  (forward-char 23)
  (setq posicion 2)
)

(defun posicion1 ()
  (interactive)
  (next-line 1)
  (beginning-of-visual-line)
  (forward-char 6)
  (setq posicion 1)
)

(defun salto ()
  (interactive)
  (if posicion 1
    (posicion2)
      (if posicion 2
      (posicion3)
        (if posicion 3
        (posicion1)))))

;; (define-key global-map (kbd "SPC") #'salto)
(local-set-key "j" 'posicion1)
(local-set-key "k" 'posicion2)
(local-set-key "l" 'posicion3)
))


El 22/05/2022 a las 15:27, Greg Minshall escribió:
Ypo,

Additional problem: I don't know how to recover keys 1, 2 and 3 to
their normal functioning, right now I can't type 1, 2 or 3 on my
Emacs. xD
you have, e.g.,

(define-key global-map (kbd "1") #'posicion1)
(define-key global-map (kbd "2") #'posicion2)
(define-key global-map (kbd "3") #'posicion3)
but, that is in the global map.  for a given mode, i sometimes do
something like that:

(add-hook 'mh-show-mode-hook #'(lambda ()
         (local-set-key "q" 'mh-show-execute-commands)))
or, closer to what you have, sometimes like

            (define-key mh-letter-mode-map
             (kbd "C-c s")
             'ggm-mh-sentaddrs-completion)
i am no elisp expert, and so those are just random things i've found
that work.  but, hopefully this may give you a hint of a direction to
follow.

cheers, Greg
--------------sf5knoDTDVCFcefBoTyZxFjn--