From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 6El3BqkgimKiggEAbAwnHQ (envelope-from ) for ; Sun, 22 May 2022 13:38:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cHxdBqkgimKtMgAA9RJhRA (envelope-from ) for ; Sun, 22 May 2022 13:38:17 +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 95E24D795 for ; Sun, 22 May 2022 13:38:16 +0200 (CEST) Received: from localhost ([::1]:43574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nsjuZ-0006uA-FC for larch@yhetil.org; Sun, 22 May 2022 07:38:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsjtf-0006tw-Jd for emacs-orgmode@gnu.org; Sun, 22 May 2022 07:37:19 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:38588) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nsjtd-0003sp-Jh for emacs-orgmode@gnu.org; Sun, 22 May 2022 07:37:19 -0400 Received: by mail-wr1-x42d.google.com with SMTP id k30so17191194wrd.5 for ; Sun, 22 May 2022 04:37:16 -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:content-language:from:to :subject; bh=G7HffKK+by24XrZhnHrB1lhTpXkzsxWB0qx6+WeOzeA=; b=okUfLtnhuPsILlanyY68HhG46twvv5G5yWj1skxt/amNtOKKgeuZUvjP6QYDCoGOad 6dvsjBoIsGo6RYSRGg7C/l5WuCDsCb9getqA070epF/4JyHdpEN2iKSvjlixU4dHFLhk 72aYGMd5gUOaK2wC+jpyGXc2c8ovKoaMrS3sMMfLeNOKTun8Ld+oPhVper75tkt/Cq0r mdLzgCAZMrvjA99RIMr4n0qUEhLYuWDOCa5vGQNzZ8Jrj7b+oKxqSXD7VjdWbHAi/vpB /ymAvfGM/dZEOOZkmOSmXstxC2QgaXXweiv1JpJBvZ0pTm1Non6bEuf0oQL3QawSHKJr elEg== 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 :content-language:from:to:subject; bh=G7HffKK+by24XrZhnHrB1lhTpXkzsxWB0qx6+WeOzeA=; b=nmc5DJesK4s03UoeX5emppAAwITbupqQhiCUoUvD8U3brB54yiSh4XNp47mqXWi28Y hPImvYHjj7k/89c1PKMGXNxINHs/ufy7DPQw0exaH8xBlfDuMkPv4kBkWQNXlxBJpZ0I kFuRICt+BVQ3Zzg4SFHrFdW4DCwoKhyayH3t2tjbxiFfV5jVMIjmivSB5KLJfc6uww3G 3O916HjFfUj+1bZ+3jttvzfImkkEHYf4FbwvE0dLyiN47+o1wBQqfB3ELTvkTDNfExjx wvrpELRx6VMAsGwDCp2jTrlnzYRCpb1jMlkb9y+d8Haxk+dDDhCMmlKFYzfocip9QPKG /qMQ== X-Gm-Message-State: AOAM530Ak8QunpIe0Q44OfaIKykGU/RcWcZyMJGNSwcNxgTcquqoPzwA zAKzIrVpT5h9pi8qARQkmt7Fkw4aydU= X-Google-Smtp-Source: ABdhPJwppMh4TTpZfDbCci3iOHs8AmiACSLBRHVnKIfMAS21nv0sv1XYHvKSCXzREdYXO5wabsxtMg== X-Received: by 2002:a05:6000:168a:b0:20f:d6e8:a5b with SMTP id y10-20020a056000168a00b0020fd6e80a5bmr1677835wrd.41.1653219435478; Sun, 22 May 2022 04:37:15 -0700 (PDT) Received: from [192.168.0.97] ([5.225.20.86]) by smtp.gmail.com with ESMTPSA id m7-20020a7bca47000000b0039429bfebebsm7028678wml.3.2022.05.22.04.37.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 May 2022 04:37:14 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------p0xQZLe828Sa6XAvbv2lv0sy" Message-ID: <5ca03caa-bb97-664b-4c58-9ec296a1eef8@gmail.com> Date: Sun, 22 May 2022 13:37:01 +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 Content-Language: en-GB From: Ypo To: Org-mode Subject: Help with my first elisp Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=ypuntot@gmail.com; helo=mail-wr1-x42d.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, 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=1653219496; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=G7HffKK+by24XrZhnHrB1lhTpXkzsxWB0qx6+WeOzeA=; b=BKA5JEeTwixQq4VTtCmY8KwCwPSldrFuiGa2rNLLYUTwLZEzokVVmlkLL3LjKwHP/2tvCb YlC+TesC0cpZQ2qoPH9iis0P+7S30PSOuF05Qh3sV6WFMWjiHxmNGJe7w5SMX7tUb86Chk fwnx17YfiwMa1ypXKPjTYfqf83wP6nCCYAoiUkmqNA6hebkoQDU2jfDwM7/ds4mh3UHknl fAd//pXpjgKQx7ckSGH37JQKIOgzLLtLTqMiOXf5fOGlph3gYuNeCJD53Y51dJHK/qQHG5 uK18ZakLwp+e/8SIFXRSdwe97v8fXeqj/4xYKi5uwTQiGwbAszUe2Mlv44gm2A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653219496; a=rsa-sha256; cv=none; b=FW3Y5xEorvj9yEHtpHTSchgieWIpHXHjU5gehbNdj7dpLPP0cJQ72qWFe1uXiiZ0G5HBCA J3eMaiowmbI7xjVXneGIfgjUDvlT/u1saCxtIigGa8P6IunVZVA9/3AP+9e9Ia7krT2v42 hzAlzD+nu2Gd4tI+AXhpKGhq7wOkyoO/CEYBjVR+Y0twI5MwsCtCmTTt1mG9QCaNNoGq5J wLRou09YsgQxNHe19iPeOtNBiu+N/SPPsU6d1/m5Gbxf3GoS5Z4q4ppa5sBQ+1GY+TjGHc chrbJrZ7DBAzcZf6Xo81Q+YK3dePUr5hEcEVr19ZvBtOgsvIeeqQuCqq+deIOg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=okUfLtnh; 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: -2.55 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=okUfLtnh; 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: 95E24D795 X-Spam-Score: -2.55 X-Migadu-Scanner: scn1.migadu.com X-TUID: iwjG3jIFzGLX This is a multi-part message in MIME format. --------------p0xQZLe828Sa6XAvbv2lv0sy Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi After thinking about learning elisp for years, today I've tried my first script. First I made some macros that worked as I intended, and then using this tutorial of Protesilaos I was able to transform those macros into elisp code. https://protesilaos.com/codelog/2022-01-31-learning-emacs/ (thanks a lot) My situation: I am using Protesilaos' package logos, and I would like to add to it something (a hook?): to mark the position where my eyesight must go. Example: https://www.tiktok.com/@yporg/video/7100510074342280454?is_from_webapp=1&sender_device=pc&web_id=7100507416085399046 My problems: * I don't know how to make my code work always and only when in logos-mode. * I get those jumps pressing 1, 2 and 3. I would like to use just 1 key (for example SPACEBAR) not 3 keys to run the function. My code: (defun posicion1 ()   (interactive)   (next-line 1)   (beginning-of-visual-line)   (forward-char 6) ) (defun posicion2 ()   (interactive)   (forward-char 23) ) (defun posicion3 ()   (interactive)   (end-of-visual-line) ;;C-e   (backward-char 7) ) (define-key global-map (kbd "1") #'posicion1) (define-key global-map (kbd "2") #'posicion2) (define-key global-map (kbd "3") #'posicion3) 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 I think it could be interesting to use just SPC, instead of 1, 2 and 3. Maybe it could be done using conditionals, like in this not-working example: (defvar posicion   "Position where it is the cursor.") (defun posicion1 ()   (interactive)   (next-line 1)   (beginning-of-visual-line)   (forward-char 6)   (setq posicion 1) ) (defun posicion2 ()   (interactive)   (forward-char 23)   (setq posicion 2) ) (defun posicion3 ()   (interactive)   (end-of-visual-line) ;;C-e   (backward-char 7)   (setq posicion 3) ) (defun salto ()   (interactive)   (if posicion 1     (posicion2))   (if posicion 2     (posicion3))   (if posicion 3     (posicion1)) ) (define-key global-map (kbd "SPC") #'salto) Any help, advice, warning, or menace are welcome. Best regards :-) --------------p0xQZLe828Sa6XAvbv2lv0sy Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Help with my first elisp

Hi


After thinking about learning elisp for years, today I've tried my first script. First I made some macros that worked as I intended, and then using this tutorial of Protesilaos I was able to transform those macros into elisp code.

https://protesilaos.com/codelog/2022-01-31-learning-emacs/
(thanks a lot)


My situation: I am using Protesilaos' package logos, and I would like to add to it something (a hook?): to mark the position where my eyesight must go. Example:

https://www.tiktok.com/@yporg/video/7100510074342280454?is_from_webapp=1&sender_device=pc&web_id=7100507416085399046


My problems:

  • I don't know how to make my code work always and only when in logos-mode.
  • I get those jumps pressing 1, 2 and 3. I would like to use just 1 key (for example SPACEBAR) not 3 keys to run the function.


My code:


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


(defun posicion2 ()
  (interactive)
  (forward-char 23)
)


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

(define-key global-map (kbd "1") #'posicion1)
(define-key global-map (kbd "2") #'posicion2)
(define-key global-map (kbd "3") #'posicion3)


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


I think it could be interesting to use just SPC, instead of 1, 2 and 3. Maybe it could be done using conditionals, like in this not-working example:

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


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


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


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




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

(define-key global-map (kbd "SPC") #'salto)



Any help, advice, warning, or menace are welcome.

Best regards :-)

--------------p0xQZLe828Sa6XAvbv2lv0sy--