all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: henri-biard@francemel.fr
To: moasenwood@zoho.eu, help-gnu-emacs@gnu.org
Subject: using flyspell-region from another function
Date: Tue, 15 Jun 2021 03:32:54 +0200 (CEST)	[thread overview]
Message-ID: <ea-mime-60c80346-c37-5a43adb9@www-7.mailo.com> (raw)
In-Reply-To: <87mtrr3ow2.fsf@zoho.eu>


>> henri-biard wrote:

> > Have written a function that calls "flyspell-region".

> But that already exists...?



Because I want to use a single function for spelling, rather than having to call ispell, aspell,

flyspell directly.




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: using flyspell-region from another function
Date: 15/06/2021 03:19:57 Europe/Paris

henri-biard wrote:

> Have written a function that calls "flyspell-region".

But that already exists...?

> Naturally this needs the BEG and END of the region to be
> passed. How should I call flyspell-region, meaning, what
> should I pass to it ?

It can look like this:

(defun sort-second-field (beg end)
(interactive "r")
(sort-fields 2 beg end) )
(defalias 's2f #'sort-second-field)

You can also make it more generic, for example this which is
DWIM interactively (region if region, 0->point if not), and
from Lisp with args beg->end, and from Lisp w/o args the whole
buffer! so 4 ways to invoke!

(defun count-chars (&optional beg end)
(interactive
(if (use-region-p)
(list (region-beginning) (region-end))
(list (point-min) (point)) ))
(message "%d" (- (or end (point-max))
(or beg (point-min)) )))

http://user.it.uu.se/~embe8573/emacs-init/sort-incal.el
https://dataswamp.org/~incal/emacs-init/count.el

-- 
underground experts united
https://dataswamp.org/~incal





  reply	other threads:[~2021-06-15  1:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15  1:01 using flyspell-region from another function henri-biard
2021-06-15  1:19 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-06-15  1:32   ` henri-biard [this message]
2021-06-15  6:58     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-06-15 12:18       ` henri-biard
2021-06-15 14:42         ` Emanuel Berg via Users list for the GNU Emacs text editor

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

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

  git send-email \
    --in-reply-to=ea-mime-60c80346-c37-5a43adb9@www-7.mailo.com \
    --to=henri-biard@francemel.fr \
    --cc=help-gnu-emacs@gnu.org \
    --cc=moasenwood@zoho.eu \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.