emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ypo <ypuntot@gmail.com>
To: Org-mode <emacs-orgmode@gnu.org>
Subject: Fwd: Help with my first elisp
Date: Tue, 24 May 2022 19:32:31 +0200	[thread overview]
Message-ID: <96d28d1e-38fb-5566-52e2-6fef48e9775e@gmail.com> (raw)
In-Reply-To: <9776a3ba-8adc-88a6-ee09-3da03cc0c05b@serviplast.net>

[-- Attachment #1: Type: text/plain, Size: 1456 bytes --]


> maybe use something like
>
> >/> (define-key mh-letter-mode-map/
> >/> (kbd "C-c s")/
> >/> 'ggm-mh-sentaddrs-completion)/
>
> but, using whatever the name of the logos-focus mode map, pointing at
> your functions?

Hi Greg

I think "logos" doesn't have a map, is it possible?


> On Mon, May 23, 2022 at 09:46:09AM -0700, Greg Minshall wrote:
> >/Ypo,/
> >//
> >/> (defun salto ()/
> >/> (interactive)/
> >/> (if posicion 1/
>
> You are comparing the value of posicion to 1?
>
> Then it should probably be "(if (= posicion 1) ...)" or
> "(if (equal posicion 1) ...)" or something like that.
>
> Cheers
> -- 
> t
Thanks, Tomas. It seems the "if" part works, now I can use my elisp just 
with the spacebar :-)

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

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

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

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


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

(defun focusJump ()
   (interactive)
   (if (equal posicion 1)
     (focusPointInter)
       (if (equal posicion 2)
       (focusPointEnd)
         (if  (equal posicion 3)
         (focusPointStart)))))

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


[-- Attachment #2: Type: text/html, Size: 2510 bytes --]

  reply	other threads:[~2022-05-24 17:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-24 17:30 Help with my first elisp Kepa Diez
2022-05-24 17:32 ` Ypo [this message]
2022-05-24 18:16   ` Fwd: " tomas
2022-05-25  4:55   ` Greg Minshall
2022-05-25  6:35 ` Orm Finnendahl
2022-05-25  8:24   ` tomas
2022-05-27  7:23     ` Orm Finnendahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=96d28d1e-38fb-5566-52e2-6fef48e9775e@gmail.com \
    --to=ypuntot@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).