emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Help with my first elisp


From: Ypo
Subject: Fwd: Help with my first elisp
Date: Tue, 24 May 2022 19:32:31 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1


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)
))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]