* [ELPA] New package: Auto Capitalize Mode
@ 2017-08-27 16:02 Ian Dunn
2017-08-27 16:36 ` Stefan Monnier
2017-08-29 12:31 ` Uwe Brauer
0 siblings, 2 replies; 13+ messages in thread
From: Ian Dunn @ 2017-08-27 16:02 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 300 bytes --]
I'd like to submit auto-capitalize-mode.el to ELPA as a single-package file. It's a small package that creates a minor-mode for automatic sentence capitalization, complete with buffer-local enable predicate and sentence bound finding.
If there are no issues, I'll push it to the git repo myself.
[-- Attachment #2: auto-capitalize-mode.el --]
[-- Type: application/emacs-lisp, Size: 4663 bytes --]
[-- Attachment #3: Type: text/plain, Size: 14 bytes --]
--
Ian Dunn
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ELPA] New package: Auto Capitalize Mode
2017-08-27 16:02 [ELPA] New package: Auto Capitalize Mode Ian Dunn
@ 2017-08-27 16:36 ` Stefan Monnier
2017-08-28 0:49 ` Ian Dunn
2017-08-29 12:31 ` Uwe Brauer
1 sibling, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2017-08-27 16:36 UTC (permalink / raw)
To: emacs-devel
> If there are no issues, I'll push it to the git repo myself.
No objection on my side. Thanks you.
Just one comment:
> (defvar-local auto-capitalize-sentence-bounds-function
> #'auto-capitalize--default-sentence-bounds
> "Function to determine the bounds of the current sentence.
>
> Should return the bounds just as `bounds-of-thing-at-point'.")
You only use the `car` part of the return value AFAICT, so requiring the
cdr part just imposes an extra burden.
IOW, I'd remove the `car` you have (twice) in auto-capitalize--run and
put it inside auto-capitalize--default-sentence-bounds instead
(and rename since it doesn't return "bounds" any more).
> (defun turn-on-auto-capitalize-mode ()
> (auto-capitalize-mode 1))
AKA
(defun turn-on-auto-capitalize-mode ()
(auto-capitalize-mode))
hence, it's unnecessary, you can just do:
;;;###autoload
(define-globalized-minor-mode global-auto-capitalize-mode
auto-capitalize-mode auto-capitalize-mode)
Stefan
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ELPA] New package: Auto Capitalize Mode
2017-08-27 16:36 ` Stefan Monnier
@ 2017-08-28 0:49 ` Ian Dunn
0 siblings, 0 replies; 13+ messages in thread
From: Ian Dunn @ 2017-08-28 0:49 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1305 bytes --]
>>>>> "Stefan" == Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> If there are no issues, I'll push it to the git repo myself.
Stefan> No objection on my side. Thanks you. Just one comment:
>> (defvar-local auto-capitalize-sentence-bounds-function
>> #'auto-capitalize--default-sentence-bounds "Function to determine
>> the bounds of the current sentence.
>>
>> Should return the bounds just as `bounds-of-thing-at-point'.")
Stefan> You only use the `car` part of the return value AFAICT, so
Stefan> requiring the cdr part just imposes an extra burden.
Stefan> IOW, I'd remove the `car` you have (twice) in
Stefan> auto-capitalize--run and put it inside
Stefan> auto-capitalize--default-sentence-bounds instead (and rename
Stefan> since it doesn't return "bounds" any more).
>> (defun turn-on-auto-capitalize-mode () (auto-capitalize-mode 1))
Stefan> AKA
Stefan> (defun turn-on-auto-capitalize-mode ()
Stefan> (auto-capitalize-mode))
Stefan> hence, it's unnecessary, you can just do:
Stefan> ;;;###autoload (define-globalized-minor-mode
Stefan> global-auto-capitalize-mode auto-capitalize-mode
Stefan> auto-capitalize-mode)
I agree on both counts. I've attached a file with the fixes applied.
[-- Attachment #2: auto-capitalize-mode.el --]
[-- Type: application/emacs-lisp, Size: 4732 bytes --]
[-- Attachment #3: Type: text/plain, Size: 14 bytes --]
--
Ian Dunn
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ELPA] New package: Auto Capitalize Mode
2017-08-27 16:02 [ELPA] New package: Auto Capitalize Mode Ian Dunn
2017-08-27 16:36 ` Stefan Monnier
@ 2017-08-29 12:31 ` Uwe Brauer
2017-08-30 0:35 ` Ian Dunn
1 sibling, 1 reply; 13+ messages in thread
From: Uwe Brauer @ 2017-08-29 12:31 UTC (permalink / raw)
To: emacs-devel
>>> "Ian" == Ian Dunn <dunni@gnu.org> writes:
> I'd like to submit auto-capitalize-mode.el to ELPA as a single-package
> file. It's a small package that creates a minor-mode for automatic
> sentence capitalization, complete with buffer-local enable predicate
> and sentence bound finding.
> If there are no issues, I'll push it to the git repo myself.
Are you aware of auto-capitalize-mode by Kevin Rodgers, it is more than
10 years old and very sophisticated. Maybe you have a look, since you
might reinvent the wheel.
Uwe Brauer
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ELPA] New package: Auto Capitalize Mode
2017-08-29 12:31 ` Uwe Brauer
@ 2017-08-30 0:35 ` Ian Dunn
2017-08-30 7:29 ` Uwe Brauer
0 siblings, 1 reply; 13+ messages in thread
From: Ian Dunn @ 2017-08-30 0:35 UTC (permalink / raw)
To: Uwe Brauer; +Cc: emacs-devel
>>>>> "Uwe" == Uwe Brauer <oub@mat.ucm.es> writes:
Uwe> Are you aware of auto-capitalize-mode by Kevin Rodgers, it is
Uwe> more than 10 years old and very sophisticated. Maybe you have a
Uwe> look, since you might reinvent the wheel.
I am aware of it. I tried it before writing my version, but I can't remember what issues I encountered with it that made me not like it. After a brief trial, the big difference I see is it not handling *This* or /This/ in Org mode sentences, which is a big deal to me. I use the same formatting in my custom writing mode, so when writing internal dialogue (for which I use italics), I want the dialogue to be capitalized.
One feature of mine that's absent in that one is the ability for a user to specify a sentence start function. I've found this exceedingly helpful in every mode. I can specify a function to check for a comment in programming modes, the start of a list or heading in Org mode, and the start of the input line in chat modes. The way Rodgers's version is implemented, such a feature isn't possible.
--
Ian Dunn
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ELPA] New package: Auto Capitalize Mode
2017-08-30 0:35 ` Ian Dunn
@ 2017-08-30 7:29 ` Uwe Brauer
2017-09-01 2:19 ` Ian Dunn
0 siblings, 1 reply; 13+ messages in thread
From: Uwe Brauer @ 2017-08-30 7:29 UTC (permalink / raw)
To: emacs-devel
Uwe> Are you aware of auto-capitalize-mode by Kevin Rodgers, it is
Uwe> more than 10 years old and very sophisticated. Maybe you have a
Uwe> look, since you might reinvent the wheel.
> I am aware of it. I tried it before writing my version, but I can't
> remember what issues I encountered with it that made me not like it.
> After a brief trial, the big difference I see is it not handling
> *This* or /This/ in Org mode sentences, which is a big deal to me. I
> use the same formatting in my custom writing mode, so when writing
> internal dialogue (for which I use italics), I want the dialogue to be
> capitalized.
Ok, I put quite some time ago auto-capitalize-mode, with the permission
to MELPA. Maybe it would be good to chose a slightly different name,
although I admit right now, nothing really neat pops up in my mind. But
Kevin's auto-capitalize-mode is 20 years, so people might be confused if
a very different implementation with the same name pops up.
> One feature of mine that's absent in that one is the ability for a
> user to specify a sentence start function. I've found this exceedingly
> helpful in every mode. I can specify a function to check for a comment
> in programming modes, the start of a list or heading in Org mode, and
> the start of the input line in chat modes. The way Rodgers's version
> is implemented, such a feature isn't possible.
One thing which was a considerable headache, but could be solved in
Kevin's version concerned letters in math formula in latex (auctex) mode.
For example
\[
\sum_{i=1}^n A_i
\]
Should not give
\[
\sum_{I=1}^n A_I
\]
Did you check this for your code?
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ELPA] New package: Auto Capitalize Mode
2017-08-30 7:29 ` Uwe Brauer
@ 2017-09-01 2:19 ` Ian Dunn
2017-09-01 2:29 ` Stefan Monnier
2017-09-02 7:54 ` [ELPA] New package: Auto Capitalize Mode Uwe Brauer
0 siblings, 2 replies; 13+ messages in thread
From: Ian Dunn @ 2017-09-01 2:19 UTC (permalink / raw)
To: Uwe Brauer; +Cc: emacs-devel
>>>>> "Uwe" == Uwe Brauer <oub@mat.ucm.es> writes:
Uwe> One thing which was a considerable headache, but could be
Uwe> solved in Kevin's version concerned letters in math formula in
Uwe> latex (auctex) mode. For example
Uwe> \[ \sum_{i=1}^n A_i \]
Uwe> Should not give
Uwe> \[ \sum_{I=1}^n A_I \]
Uwe> Did you check this for your code?
Confirmed, that doesn't happen with my version.
Uwe> Ok, I put quite some time ago auto-capitalize-mode, with the
Uwe> permission to MELPA. Maybe it would be good to chose a slightly
Uwe> different name, although I admit right now, nothing really neat
Uwe> pops up in my mind. But Kevin's auto-capitalize-mode is 20
Uwe> years, so people might be confused if a very different
Uwe> implementation with the same name pops up.
I agree that having two packages that provide "auto-capitalize-mode" will be confusing to users. What about "cisa" (Capitalization IS Automatic) or "capp-e" (Capitalization is an Automatic and Pleasant Process in Emacs)?
--
Ian Dunn
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ELPA] New package: Auto Capitalize Mode
2017-09-01 2:19 ` Ian Dunn
@ 2017-09-01 2:29 ` Stefan Monnier
2017-09-02 19:23 ` [ELPA] New package: Captain (was [ELPA] New package: Auto Capitalize Mode) Ian Dunn
2017-09-02 7:54 ` [ELPA] New package: Auto Capitalize Mode Uwe Brauer
1 sibling, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2017-09-01 2:29 UTC (permalink / raw)
To: emacs-devel
> I agree that having two packages that provide "auto-capitalize-mode" will be
> confusing to users.
Unless one of them is abandoned and the other can be considered as
a newer version (no idea if it's the case, here).
Stefan
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ELPA] New package: Auto Capitalize Mode
2017-09-01 2:19 ` Ian Dunn
2017-09-01 2:29 ` Stefan Monnier
@ 2017-09-02 7:54 ` Uwe Brauer
2017-09-03 14:08 ` Timur Aydin
1 sibling, 1 reply; 13+ messages in thread
From: Uwe Brauer @ 2017-09-02 7:54 UTC (permalink / raw)
To: emacs-devel
> I agree that having two packages that provide "auto-capitalize-mode"
> will be confusing to users. What about "cisa" (Capitalization IS
> Automatic) or "capp-e" (Capitalization is an Automatic and Pleasant
> Process in Emacs)?
I am not a native speaker, so self-capitalize-mode does not sound too
good, doesn't it?
automatic-cap-mode?
Uwe
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ELPA] New package: Captain (was [ELPA] New package: Auto Capitalize Mode)
2017-09-01 2:29 ` Stefan Monnier
@ 2017-09-02 19:23 ` Ian Dunn
2017-09-02 19:43 ` Stefan Monnier
0 siblings, 1 reply; 13+ messages in thread
From: Ian Dunn @ 2017-09-02 19:23 UTC (permalink / raw)
To: emacs-devel; +Cc: Uwe Brauer, Stefan Monnier
[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]
>>>>> "Stefan" == Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> I agree that having two packages that provide
>> "auto-capitalize-mode" will be confusing to users.
Stefan> Unless one of them is abandoned and the other can be
Stefan> considered as a newer version (no idea if it's the case,
Stefan> here).
I don't know for sure that the old one's abandoned, although it looks
like little has been done on it in the past few years. That could be
because it was determined to be in a stable state, or it could be
because it's been abandoned.
In any case, I've chosen to rename the package and add two new features
to it to mostly match what the old package did.
Specifically, I added the ability to capitalize a word once and have it
automatically capitalized in the future, and the ability to capitalize
the current sentence using the function it was already using to find the
start of the sentence. The latter is implemented to open the
possibility of capitalizing yanked text in the future, a feature of the
old package, although I see no need for it right now.
I also mention the old package in the commentary, in case other users
may want to try it instead.
[-- Attachment #2: captain.el --]
[-- Type: application/emacs-lisp, Size: 7631 bytes --]
[-- Attachment #3: Type: text/plain, Size: 14 bytes --]
--
Ian Dunn
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ELPA] New package: Captain (was [ELPA] New package: Auto Capitalize Mode)
2017-09-02 19:23 ` [ELPA] New package: Captain (was [ELPA] New package: Auto Capitalize Mode) Ian Dunn
@ 2017-09-02 19:43 ` Stefan Monnier
2017-09-02 21:16 ` Ian Dunn
0 siblings, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2017-09-02 19:43 UTC (permalink / raw)
To: emacs-devel
> I don't know for sure that the old one's abandoned, although it looks
> like little has been done on it in the past few years.
It doesn't need to be some fact that we need to figure out: it can be
a fact we create by discussing with the other author.
Stefan
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ELPA] New package: Captain (was [ELPA] New package: Auto Capitalize Mode)
2017-09-02 19:43 ` Stefan Monnier
@ 2017-09-02 21:16 ` Ian Dunn
0 siblings, 0 replies; 13+ messages in thread
From: Ian Dunn @ 2017-09-02 21:16 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
>>>>> "Stefan" == Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> I don't know for sure that the old one's abandoned, although it
>> looks like little has been done on it in the past few years.
Stefan> It doesn't need to be some fact that we need to figure out:
Stefan> it can be a fact we create by discussing with the other
Stefan> author.
Of course. I reached out to him a few minutes ago about it.
--
Ian Dunn
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [ELPA] New package: Auto Capitalize Mode
2017-09-02 7:54 ` [ELPA] New package: Auto Capitalize Mode Uwe Brauer
@ 2017-09-03 14:08 ` Timur Aydin
0 siblings, 0 replies; 13+ messages in thread
From: Timur Aydin @ 2017-09-03 14:08 UTC (permalink / raw)
To: emacs-devel
On 9/2/2017 10:54 AM, Uwe Brauer wrote:
>
>
>
> I am not a native speaker, so self-capitalize-mode does not sound too
> good, doesn't it?
>
Perhaps a suffix after "auto-capitalize-mode" would be more suitable,
like auto-capitalize-mode-dunn. That way, if somebody else comes up
with an alternative implementation, it can be accomodated as well,
without needing to invent yet another name for the same task.
--
Timur
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2017-09-03 14:08 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-27 16:02 [ELPA] New package: Auto Capitalize Mode Ian Dunn
2017-08-27 16:36 ` Stefan Monnier
2017-08-28 0:49 ` Ian Dunn
2017-08-29 12:31 ` Uwe Brauer
2017-08-30 0:35 ` Ian Dunn
2017-08-30 7:29 ` Uwe Brauer
2017-09-01 2:19 ` Ian Dunn
2017-09-01 2:29 ` Stefan Monnier
2017-09-02 19:23 ` [ELPA] New package: Captain (was [ELPA] New package: Auto Capitalize Mode) Ian Dunn
2017-09-02 19:43 ` Stefan Monnier
2017-09-02 21:16 ` Ian Dunn
2017-09-02 7:54 ` [ELPA] New package: Auto Capitalize Mode Uwe Brauer
2017-09-03 14:08 ` Timur Aydin
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.