[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Keybinding that loops through Major Modes
From: |
Christopher Dimech |
Subject: |
Re: Keybinding that loops through Major Modes |
Date: |
Tue, 3 Nov 2020 01:16:50 +0100 |
Works very nicely.
Many thanks.
> Sent: Tuesday, November 03, 2020 at 12:29 AM
> From: "Emanuel Berg via Users list for the GNU Emacs text editor"
> <help-gnu-emacs@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: Keybinding that loops through Major Modes
>
> > (defun iterate-major-mode ()
> > (interactive)
> > (let*((modes (list #'emacs-lisp-mode #'perl-mode #'text-mode))
> > (new-mode (or (cadr (member major-mode modes)) (car modes))) )
> > (apply `(,new-mode)) ))
> > ;; (iterate-major-mode)
>
> Maybe this looks better:
>
> (defun iterate-major-mode ()
> (interactive)
> (let*((modes (list #'emacs-lisp-mode #'perl-mode #'text-mode))
> (new-mode (or (cadr (member major-mode modes)) (car modes))) )
> (apply (list new-mode))) )
> ;; (iterate-major-mode)
>
> --
> underground experts united
> http://user.it.uu.se/~embe8573
> https://dataswamp.org/~incal
>
>
>
- Re: Keybinding that loops through Major Modes, (continued)
- Re: Keybinding that loops through Major Modes, Michael Heerdegen, 2020/11/03
- Re: Keybinding that loops through Major Modes, Christopher Dimech, 2020/11/03
- Re: Keybinding that loops through Major Modes, Joost Kremers, 2020/11/03
- Re: Keybinding that loops through Major Modes, Michael Heerdegen, 2020/11/03
- Re: Keybinding that loops through Major Modes, Stefan Monnier, 2020/11/03
- Re: Keybinding that loops through Major Modes, Joost Kremers, 2020/11/03
- RE: Keybinding that loops through Major Modes, Drew Adams, 2020/11/03
Re: Keybinding that loops through Major Modes, Christopher Dimech, 2020/11/02
Re: Keybinding that loops through Major Modes, Stefan Monnier, 2020/11/02