all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Using aspell in emacs
@ 2021-06-15  3:16 henri-biard
  2021-06-15  3:39 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-06-16 18:38 ` Nick Dokos
  0 siblings, 2 replies; 21+ messages in thread
From: henri-biard @ 2021-06-15  3:16 UTC (permalink / raw)
  To: help-gnu-emacs


 Have been trying to set aspell for me to correct words instead of ispell.



But Have not found any information on how to call aspell commands in emacs.



Have installed aspell using synaptic package manager.








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

* Re: Using aspell in emacs
  2021-06-15  3:16 henri-biard
@ 2021-06-15  3:39 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-06-15  4:32   ` henri-biard
  2021-06-15  4:51   ` henri-biard
  2021-06-16 18:38 ` Nick Dokos
  1 sibling, 2 replies; 21+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-06-15  3:39 UTC (permalink / raw)
  To: help-gnu-emacs

henri-biard wrote:

> But Have not found any information on how to call aspell
> commands in emacs.

Lots of aspell stuff in MELPA...

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




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

* Using aspell in emacs
  2021-06-15  3:39 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-06-15  4:32   ` henri-biard
  2021-06-15  7:00     ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-06-15 13:48     ` Jean Louis
  2021-06-15  4:51   ` henri-biard
  1 sibling, 2 replies; 21+ messages in thread
From: henri-biard @ 2021-06-15  4:32 UTC (permalink / raw)
  To: moasenwood, help-gnu-emacs

Have been using ispell using ispell-word, ispell-region, and ispell-buffer, giving you options

on replacements.  But how abaut using aspell intead?



Have gone en https://stable.melpa.org/#/ but making a search for aspell gave me nothing.



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 aspell in emacs
Date: 15/06/2021 05:39:15 Europe/Paris

henri-biard wrote:

> But Have not found any information on how to call aspell
> commands in emacs.

Lots of aspell stuff in MELPA...

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





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

* Using aspell in emacs
  2021-06-15  3:39 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-06-15  4:32   ` henri-biard
@ 2021-06-15  4:51   ` henri-biard
  2021-06-15  7:04     ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 1 reply; 21+ messages in thread
From: henri-biard @ 2021-06-15  4:51 UTC (permalink / raw)
  To: moasenwood, help-gnu-emacs

Can I use flyspell to correst incorrect words.  What would I need to do and call?

Have been reading that flyspell uses aspell.



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 aspell in emacs
Date: 15/06/2021 05:39:15 Europe/Paris

henri-biard wrote:

> But Have not found any information on how to call aspell
> commands in emacs.

Lots of aspell stuff in MELPA...

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





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

* Re: Using aspell in emacs
  2021-06-15  4:32   ` henri-biard
@ 2021-06-15  7:00     ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-06-15 12:34       ` henri-biard
  2021-06-15 13:48     ` Jean Louis
  1 sibling, 1 reply; 21+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-06-15  7:00 UTC (permalink / raw)
  To: help-gnu-emacs

henri-biard wrote:

> Have been using ispell using ispell-word, ispell-region, and
> ispell-buffer, giving you options on replacements.

Okay, not following 100%?

> But how abaut using aspell intead?

What advantages would that have, compared to ispell?

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




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

* Re: Using aspell in emacs
  2021-06-15  4:51   ` henri-biard
@ 2021-06-15  7:04     ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-06-15 12:30       ` henri-biard
  0 siblings, 1 reply; 21+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-06-15  7:04 UTC (permalink / raw)
  To: help-gnu-emacs

henri-biard wrote:

> Can I use flyspell to correst incorrect words. What would
> I need to do and call?
>
> Have been reading that flyspell uses aspell.

It sounds like a method, to mark incorrect words on the fly
and offer an interface what to do with them.

But I personally don't like that as I don't like to get
interrupted when I type, I want to type all, then spell onee
(one and only one) time, and be done with it. So I can't help
you with flyspell but if you specify just a little bit ...
more! what your problem(s) are I'm sure many here that use it
will be able to help you...

https://www.youtube.com/watch?v=PnPUKm9ExHo&ucbcb=1

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




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

* Using aspell in emacs
  2021-06-15  7:04     ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-06-15 12:30       ` henri-biard
  0 siblings, 0 replies; 21+ messages in thread
From: henri-biard @ 2021-06-15 12:30 UTC (permalink / raw)
  To: moasenwood, help-gnu-emacs

> It sounds like a method, to mark incorrect words on the fly

> and offer an interface what to do with them.



Going more into it, it is as you say. It highlights incorrect words. It is good idea, 

but a poor implementation.  For instance, correction with flyspell has some serious

caveats.



It should have been assimilated into ispell and aspell.  aspell is supposed

to be an improved version of ispell.  I would like if emacs could implement

vertical selection in addition to icomplete, in ways similar to ivy.


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 aspell in emacs
Date: 15/06/2021 09:04:50 Europe/Paris

henri-biard wrote:

> Can I use flyspell to correst incorrect words. What would
> I need to do and call?
>
> Have been reading that flyspell uses aspell.

It sounds like a method, to mark incorrect words on the fly
and offer an interface what to do with them.

But I personally don't like that as I don't like to get
interrupted when I type, I want to type all, then spell onee
(one and only one) time, and be done with it. So I can't help
you with flyspell but if you specify just a little bit ...
more! what your problem(s) are I'm sure many here that use it
will be able to help you...

https://www.youtube.com/watch?v=PnPUKm9ExHo&ucbcb=1

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





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

* Using aspell in emacs
  2021-06-15  7:00     ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-06-15 12:34       ` henri-biard
  2021-06-15 14:48         ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 21+ messages in thread
From: henri-biard @ 2021-06-15 12:34 UTC (permalink / raw)
  To: moasenwood, help-gnu-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 aspell in emacs
>Date: 15/06/2021 09:00:42 Europe/Paris

>henri-biard wrote:

>> Have been using ispell using ispell-word, ispell-region, and
>> ispell-buffer, giving you options on replacements.

>Okay, not following 100%?



I described my experience of using ispell



>> But how abaut using aspell intead?

>What advantages would that have, compared to ispell?

aspell is supposed to be an improvement over ispell.  



On the gnu website, it is stated that Gnu Aspell is a spell checker designed to

replace Ispell. 



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

* Re: Using aspell in emacs
  2021-06-15  4:32   ` henri-biard
  2021-06-15  7:00     ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-06-15 13:48     ` Jean Louis
  1 sibling, 0 replies; 21+ messages in thread
From: Jean Louis @ 2021-06-15 13:48 UTC (permalink / raw)
  To: henri-biard; +Cc: help-gnu-emacs, moasenwood

* henri-biard@francemel.fr <henri-biard@francemel.fr> [2021-06-15 08:54]:
> Have been using ispell using ispell-word, ispell-region, and ispell-buffer, giving you options
> 
> on replacements.  But how abaut using aspell intead?

Change the variable `ispell-program-name' as it is a variable defined
in ‘ispell.el’ and you are done.

Its value is "/usr/bin/aspell"

  You can customize this variable.

Program invoked by M-$ and M-x ispell-region commands.

            |                | 
  __|  _ \  |\ \   / _ \  _` | 
\__ \ (   | | \ \ /  __/ (   | 
____/\___/ _|  \_/ \___|\__,_| 
                               

PLEASE NOTE: you are supposed to use Emacs Manual and at least search
through Emacs Manual by looking for keywords related to your
issues. Then you should say what searches you have performed and how
before asking, as it seem that you miss the solutions just because you
don't look into the manual.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



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

* Using aspell in emacs
@ 2021-06-15 14:04 henri-biard
  2021-06-15 14:18 ` Emanuel Berg
  2021-06-15 14:18 ` Jean Louis
  0 siblings, 2 replies; 21+ messages in thread
From: henri-biard @ 2021-06-15 14:04 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs, moasenwood

It is a very weird way of using ispell.



Anyway, thank you.  



Have used the Emacs Manual, but it does not say much about aspell except for a link.



What is the exact command?



(setq ispell-program-name "aspell")



or


(setq ispell-program-name "/usr/bin/aspell")


Tried to do C-h v ispell-program-name



and the command did not give me anything.





From: Jean Louis <bugs@gnu.support>
To: henri-biard@francemel.fr
Subject: Re: Using aspell in emacs
Date: 15/06/2021 15:48:14 Europe/Paris
Cc: moasenwood@zoho.eu;
   help-gnu-emacs@gnu.org

* henri-biard@francemel.fr <henri-biard@francemel.fr> [2021-06-15 08:54]:
> Have been using ispell using ispell-word, ispell-region, and ispell-buffer, giving you options
> 
> on replacements.  But how abaut using aspell intead?

Change the variable `ispell-program-name' as it is a variable defined
in ‘ispell.el’ and you are done.

Its value is "/usr/bin/aspell"

You can customize this variable.

Program invoked by M-$ and M-x ispell-region commands.

| | 
__| _ \ |\ \ / _ \ _` | 
\__ \ ( | | \ \ / __/ ( | 
____/\___/ _| \_/ \___|\__,_| 


PLEASE NOTE: you are supposed to use Emacs Manual and at least search
through Emacs Manual by looking for keywords related to your
issues. Then you should say what searches you have performed and how
before asking, as it seem that you miss the solutions just because you
don't look into the manual.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



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

* Re: Using aspell in emacs
  2021-06-15 14:04 Using aspell in emacs henri-biard
@ 2021-06-15 14:18 ` Emanuel Berg
  2021-06-15 14:22   ` Jean Louis
  2021-06-15 14:32   ` henri-biard
  2021-06-15 14:18 ` Jean Louis
  1 sibling, 2 replies; 21+ messages in thread
From: Emanuel Berg @ 2021-06-15 14:18 UTC (permalink / raw)
  To: henri-biard; +Cc: Jean Louis, help-gnu-emacs

The following message is a courtesy copy of an article
that has been posted to gmane.emacs.help as well.

henri-biard wrote:

> It is a very weird way of using ispell.

Well, there is the Emacs superstructure and the Unix binary,
as you have discovered...

Nothing is consistent when it comes to Unix and Emacs anyway,
or not everything is, I should say.

As a side note I have it

  ispell-program-name is a variable defined in ‘ispell.el’.
  Its value is "ispell" Original value was "/bin/aspell"

so if it is strange it is by default.

Jean Louis wrote:

> PLEASE NOTE: you are supposed to use Emacs Manual and at
> least search through Emacs Manual by looking for keywords
> related to your issues. Then you should say what searches
> you have performed and how before asking, as it seem that
> you miss the solutions just because you don't look into
> the manual.

I know, but curiously enough, can you give an example of such
a manual?

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




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

* Re: Using aspell in emacs
  2021-06-15 14:04 Using aspell in emacs henri-biard
  2021-06-15 14:18 ` Emanuel Berg
@ 2021-06-15 14:18 ` Jean Louis
  2021-06-15 14:37   ` henri-biard
  1 sibling, 1 reply; 21+ messages in thread
From: Jean Louis @ 2021-06-15 14:18 UTC (permalink / raw)
  To: henri-biard; +Cc: help-gnu-emacs, moasenwood

* henri-biard@francemel.fr <henri-biard@francemel.fr> [2021-06-15 17:13]:
> It is a very weird way of using ispell.
> Have used the Emacs Manual, but it does not say much about aspell except for a link.
> 
> What is the exact command?
> (setq ispell-program-name "aspell")

(info "(aspell) Using Aspell with other Applications")


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



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

* Re: Using aspell in emacs
  2021-06-15 14:18 ` Emanuel Berg
@ 2021-06-15 14:22   ` Jean Louis
  2021-06-15 14:32   ` henri-biard
  1 sibling, 0 replies; 21+ messages in thread
From: Jean Louis @ 2021-06-15 14:22 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs, henri-biard

* Emanuel Berg <moasenwood@zoho.eu> [2021-06-15 17:18]:
> Jean Louis wrote:
> 
> > PLEASE NOTE: you are supposed to use Emacs Manual and at
> > least search through Emacs Manual by looking for keywords
> > related to your issues. Then you should say what searches

> > you miss the solutions just because you don't look into
> > the manual.
> 
> I know, but curiously enough, can you give an example of such
> a manual?

It's (info "(emacs) Top") then I use C-s to search for "aspell" where
it says: These commands only work if a
spelling checker program, one of Hunspell, Aspell, Ispell or Enchant, is
installed.  These programs are not part of Emacs, but one of them is
usually installed on GNU/Linux and other free operating systems.  *Note
Aspell: (aspell)Top.

And I have never "set" the "aspell" program, that just works
automatically if you have oneof those spell checker programs.


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



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

* Using aspell in emacs
  2021-06-15 14:18 ` Emanuel Berg
  2021-06-15 14:22   ` Jean Louis
@ 2021-06-15 14:32   ` henri-biard
  1 sibling, 0 replies; 21+ messages in thread
From: henri-biard @ 2021-06-15 14:32 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs, Jean Louis




From: Emanuel Berg <moasenwood@zoho.eu>
To: henri-biard@francemel.fr
Subject: Re: Using aspell in emacs
Date: 15/06/2021 16:18:17 Europe/Paris
Cc: Jean Louis <bugs@gnu.support>;
   help-gnu-emacs@gnu.org

The following message is a courtesy copy of an article
that has been posted to gmane.emacs.help as well.

henri-biard wrote:

> It is a very weird way of using ispell.

Well, there is the Emacs superstructure and the Unix binary,
as you have discovered...

Nothing is consistent when it comes to Unix and Emacs anyway,
or not everything is, I should say.

As a side note I have it

ispell-program-name is a variable defined in ‘ispell.el’.
Its value is "ispell" Original value was "/bin/aspell"

so if it is strange it is by default.

Jean Louis wrote:

> PLEASE NOTE: you are supposed to use Emacs Manual and at
> least search through Emacs Manual by looking for keywords
> related to your issues. Then you should say what searches
> you have performed and how before asking, as it seem that
> you miss the solutions just because you don't look into
> the manual.

I know, but curiously enough, can you give an example of such
a manual?

The only mention of Aspell is in 

16.4 Checking and Correcting Spelling

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




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

* Using aspell in emacs
  2021-06-15 14:18 ` Jean Louis
@ 2021-06-15 14:37   ` henri-biard
  2021-06-15 17:42     ` Jean Louis
  0 siblings, 1 reply; 21+ messages in thread
From: henri-biard @ 2021-06-15 14:37 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs, moasenwood

>> What is the exact command?
>> (setq ispell-program-name "aspell")

>(info "(aspell) Using Aspell with other Applications")



The only mention of Aspell is in 

16.4 Checking and Correcting Spelling

Can you provide the information on how to set it up rather than winding me up.








From: Jean Louis <bugs@gnu.support>
To: henri-biard@francemel.fr
Subject: Re: Using aspell in emacs
Date: 15/06/2021 16:18:49 Europe/Paris
Cc: help-gnu-emacs@gnu.org;
   moasenwood@zoho.eu

* henri-biard@francemel.fr <henri-biard@francemel.fr> [2021-06-15 17:13]:
> It is a very weird way of using ispell.
> Have used the Emacs Manual, but it does not say much about aspell except for a link.
> 
> What is the exact command?
> (setq ispell-program-name "aspell")

(info "(aspell) Using Aspell with other Applications")


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/




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

* Re: Using aspell in emacs
  2021-06-15 12:34       ` henri-biard
@ 2021-06-15 14:48         ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 21+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-06-15 14:48 UTC (permalink / raw)
  To: help-gnu-emacs

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

henri-biard wrote:

>
>>> Have been using ispell using ispell-word, ispell-region,
>>> and ispell-buffer, giving you options on replacements.
>
>> Okay, not following 100%?
>
> I described my experience of using ispell

You did?

>>> But how abaut using aspell intead?
>>
>> What advantages would that have, compared to ispell?
>
> aspell is supposed to be an improvement over ispell.

Examples?

> On the gnu website, it is stated that Gnu Aspell is a spell
> checker designed to replace Ispell.

Right, one spell-checker (which can do different things
depending on word, region, whole buffer etc) should be enough
IMO...

$ aptitude why aspell
i   zenity               Depends  libwebkit2gtk-4.0-37 (>= 2.15.1)             
i A libwebkit2gtk-4.0-37 Depends  libenchant-2-2 (>= 2.2.3)                    
i A libenchant-2-2       Depends  hunspell-en-us | hunspell-dictionary | myspel
                                  l-dictionary | aspell-dictionary | ispell-dic
                                  tionary                                      
i A aspell-en            Provides aspell-dictionary                            
i A aspell-en            Depends  aspell (>= 0.60.3-2)                         

$ aptitude why ispell
i   iswedish Depends ispell (>= 3.3.02)

Hm, what does that mean? I installed zenity so got aspell?
What is zenity? "Zenity allows you to display GTK+ dialogs
from shell scripts" - why did I even install that?

[-- Attachment #2: Type: image/png, Size: 76 bytes --]

[-- Attachment #3: Type: text/plain, Size: 62 bytes --]



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

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

* Re: Using aspell in emacs
  2021-06-15 14:37   ` henri-biard
@ 2021-06-15 17:42     ` Jean Louis
  2021-06-15 21:25       ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 21+ messages in thread
From: Jean Louis @ 2021-06-15 17:42 UTC (permalink / raw)
  To: henri-biard; +Cc: help-gnu-emacs, moasenwood

* henri-biard@francemel.fr <henri-biard@francemel.fr> [2021-06-15 17:37]:
> >> What is the exact command?
> >> (setq ispell-program-name "aspell")
> 
> >(info "(aspell) Using Aspell with other Applications")
> 
> 
> 
> The only mention of Aspell is in 
> 
> 16.4 Checking and Correcting Spelling
> 
> Can you provide the information on how to set it up rather than winding me up.

Information is in Emacs manual: if you have some of those programs
installed it will work, there is nothing to do on your side.

I have verified it, if program `aspell' is on system, the variable
`ispell-program-name' will be set to its path. Finished there.

Most probably there is nothing to do on your side.

16.4 Checking and Correcting Spelling
=====================================

This section describes the commands to check the spelling of a single
word or of a portion of a buffer.  These commands only work if a
spelling checker program, one of Hunspell, Aspell, Ispell or Enchant, is
installed.  These programs are not part of Emacs, but one of them is
usually installed on GNU/Linux and other free operating systems.  *Note
Aspell: (aspell)Top.

What does it say?

"These commands only work if a spelling checker program, one of
Hunspell, Aspell, Ispell or Enchant, is installed."

Thus it says to me that command like M-x ispell is going to work if
you have those installed. 

Most probably you were using M-x ispell with aspell already.

Try reading manual.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



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

* Re: Using aspell in emacs
  2021-06-15 17:42     ` Jean Louis
@ 2021-06-15 21:25       ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-06-15 21:34         ` Jean Louis
  0 siblings, 1 reply; 21+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-06-15 21:25 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

> I have verified it, if program `aspell' is on system, the
> variable `ispell-program-name' will be set to its path.
> Finished there.

OK, how does that happen one might wonder?

> Try reading manual.

Check out:

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

A lot of that stuff, or all of it I think, are so basic ideas,
spell a word, spell words in different forms and with
different (common) interfaces, so that makes me think,

1) what of that is already implemented and

2) if it isn't, go ahead and use it (by my guest and improve
   it even more before you add it), since again, it is
   basic stuff.

For example this,

(defun spell-word (word)
  (with-temp-buffer
    (save-excursion
      (insert word) )
    (condition-case nil
        (not (ispell-word))
      (error nil) )))
;; (spell-word "length") ; t
;; (spell-word "lenght") ; nil

It spells the word WORD. That's right, I didn't have to take
LSD to come up with _that_ idea :) Is it in ispell already
only I failed to find it?

And if it isn't, why not? Useful not only for "us" but also
for ispell, internally, I'm sure!

Is the major mode a code mode? Interesting question, I know...

(defun is-code ()
  (member major-mode '(
                       c++-mode
                       c-mode
                       emacs-lisp-mode
                       prolog-mode
                       python-mode
                       sh-mode
                       Shell-script-mode
                       ) ; add more!
          ))

spell differently with the same command:

(defun spell (dict)
  "Spell with DICT.
\nIf a region, use `ispell-region'
\nIf editing code, `ispell-comments-and-strings'
\nIf writing a message, `ispell-message'
\nelse, `ispell-buffer'"
  (ispell-change-dictionary dict)
  (save-window-excursion
    (save-excursion
      (cond
       ((use-region-p) (ispell-region (region-beginning) (region-end)))
       ((is-message)   (ispell-message))
       ((is-code)      (ispell-comments-and-strings))
       (t              (ispell-buffer)) ))))

(PS, should the region stuff be optional beg and end
arguments, you think?)

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

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




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

* Re: Using aspell in emacs
  2021-06-15 21:25       ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-06-15 21:34         ` Jean Louis
  2021-06-16 17:03           ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 21+ messages in thread
From: Jean Louis @ 2021-06-15 21:34 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2021-06-16 00:27]:
> Jean Louis wrote:
> 
> > I have verified it, if program `aspell' is on system, the
> > variable `ispell-program-name' will be set to its path.
> > Finished there.
> 
> OK, how does that happen one might wonder?


(defcustom ispell-program-name
  (or (executable-find "aspell")
      (executable-find "ispell")
      (executable-find "hunspell")
      ;; Enchant is commonly installed as `enchant-2', so use this
      ;; name and avoid old versions of `enchant'.
      (executable-find "enchant-2")
      "ispell")
  "Program invoked by \\[ispell-word] and \\[ispell-region] commands."
  :type 'string
  :set (lambda (symbol value)
         (set-default symbol value)
         (if (featurep 'ispell)
             (ispell-set-spellchecker-params))))

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



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

* Re: Using aspell in emacs
  2021-06-15 21:34         ` Jean Louis
@ 2021-06-16 17:03           ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 21+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-06-16 17:03 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

>>> I have verified it, if program `aspell' is on system, the
>>> variable `ispell-program-name' will be set to its path.
>>> Finished there.
>> 
>> OK, how does that happen one might wonder?
>
> (or (executable-find "aspell")
>     (executable-find "ispell")
>     (executable-find "hunspell") )

Right, bravo!

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




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

* Re: Using aspell in emacs
  2021-06-15  3:16 henri-biard
  2021-06-15  3:39 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-06-16 18:38 ` Nick Dokos
  1 sibling, 0 replies; 21+ messages in thread
From: Nick Dokos @ 2021-06-16 18:38 UTC (permalink / raw)
  To: help-gnu-emacs

henri-biard@francemel.fr writes:

> Have been trying to set aspell for me to correct words instead of ispell.
> But Have not found any information on how to call aspell commands in emacs.
> Have installed aspell using synaptic package manager.

C-h v ispell-program-name. Mine says:

,----
| ispell-program-name is a variable defined in ‘ispell.el’.
| Its value is "/usr/bin/aspell"
| 
|   You can customize this variable.
| 
| Documentation:
| Program invoked by M-$ and M-x ispell-region commands.
`----

And if I check `ispell.el' I see the choices:

,----
| (defcustom ispell-program-name
|   (or (executable-find "aspell")
|       (executable-find "ispell")
|       (executable-find "hunspell")
|       "ispell")
`----

So if you have installed aspell and emacs can find it, it will use it automatically.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




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

end of thread, other threads:[~2021-06-16 18:38 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-15 14:04 Using aspell in emacs henri-biard
2021-06-15 14:18 ` Emanuel Berg
2021-06-15 14:22   ` Jean Louis
2021-06-15 14:32   ` henri-biard
2021-06-15 14:18 ` Jean Louis
2021-06-15 14:37   ` henri-biard
2021-06-15 17:42     ` Jean Louis
2021-06-15 21:25       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-06-15 21:34         ` Jean Louis
2021-06-16 17:03           ` Emanuel Berg via Users list for the GNU Emacs text editor
  -- strict thread matches above, loose matches on Subject: below --
2021-06-15  3:16 henri-biard
2021-06-15  3:39 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-06-15  4:32   ` henri-biard
2021-06-15  7:00     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-06-15 12:34       ` henri-biard
2021-06-15 14:48         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-06-15 13:48     ` Jean Louis
2021-06-15  4:51   ` henri-biard
2021-06-15  7:04     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-06-15 12:30       ` henri-biard
2021-06-16 18:38 ` Nick Dokos

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.