unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* using flyspell-region from another function
@ 2021-06-15  1:01 henri-biard
  2021-06-15  1:19 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 6+ messages in thread
From: henri-biard @ 2021-06-15  1:01 UTC (permalink / raw)
  To: help-gnu-emacs



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



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 ?



(defun myspell ()

    (interactive)

    (flyspell-region beg end))



Want to select the region then call  "M-x myspell".



Do you know how I can use the superior aspell ? 





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: using flyspell-region from another function
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-06-15  1:19 UTC (permalink / raw)
  To: help-gnu-emacs

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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* using flyspell-region from another function
  2021-06-15  1:19 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-06-15  1:32   ` henri-biard
  2021-06-15  6:58     ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 6+ messages in thread
From: henri-biard @ 2021-06-15  1:32 UTC (permalink / raw)
  To: moasenwood, help-gnu-emacs


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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: using flyspell-region from another function
  2021-06-15  1:32   ` henri-biard
@ 2021-06-15  6:58     ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-06-15 12:18       ` henri-biard
  0 siblings, 1 reply; 6+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-06-15  6:58 UTC (permalink / raw)
  To: help-gnu-emacs

henri-biard wrote:

>> But that already exists...?
>
> Because I want to use a single function for spelling, rather
> than having to call ispell, aspell,
> flyspell directly.

That's another thing, I also want that only I only use ispell
(I think flyspell is disruptive; aspell rings a very distant
bell... must have been unaware of it existence for 10+ years!)

  https://dataswamp.org/~incal/emacs-init/spell.el

No, what I mean to say, if you write you own functions, don't
call them the same as existing functions, unless you have very
good reasons to do that. Even so, it is like asking for
trouble, like a fist fight outside a pizzeria at 03:13 Friday
night, the punches were coming from other planets...

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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* using flyspell-region from another function
  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
  0 siblings, 1 reply; 6+ messages in thread
From: henri-biard @ 2021-06-15 12:18 UTC (permalink / raw)
  To: moasenwood, help-gnu-emacs

>No, what I mean to say, if you write you own functions, don't
>call them the same as existing functions, unless you have very
>good reasons to do that. Even so, it is like asking for
>trouble, like a fist fight outside a pizzeria at 03:13 Friday
>night, the punches were coming from other planets...



I will use just one name, but the functionality can be from either ispell, aspell, ar

flyspell.



I agree there are some problems with flyspell,  And aspell, I have no clue how to use in emacs.


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 08:58:44 Europe/Paris

henri-biard wrote:

>> But that already exists...?
>
> Because I want to use a single function for spelling, rather
> than having to call ispell, aspell,
> flyspell directly.

That's another thing, I also want that only I only use ispell
(I think flyspell is disruptive; aspell rings a very distant
bell... must have been unaware of it existence for 10+ years!)

https://dataswamp.org/~incal/emacs-init/spell.el

No, what I mean to say, if you write you own functions, don't
call them the same as existing functions, unless you have very
good reasons to do that. Even so, it is like asking for
trouble, like a fist fight outside a pizzeria at 03:13 Friday
night, the punches were coming from other planets...

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: using flyspell-region from another function
  2021-06-15 12:18       ` henri-biard
@ 2021-06-15 14:42         ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 6+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-06-15 14:42 UTC (permalink / raw)
  To: help-gnu-emacs

henri-biard wrote:

> And aspell, I have no clue how to use in emacs.

If it is the dictionary set by default just invoke the
spelling and it will be used for that purpose.

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




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-15 14:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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