all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] dictonary.el documentation
@ 2024-01-23 15:31 No Wayman
  2024-01-23 17:14 ` Philip Kaludercic
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: No Wayman @ 2024-01-23 15:31 UTC (permalink / raw)
  To: emacs-devel

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


I've attached a patch for what I think are a few improvements to 
dictionary.el's documentation.

There are still a handful of undocumented functions/commands.
The commentary section also redirects to an external source, which 
is not very helpful:

;; You can find more information in the README file of the GitHub
;; repository https://github.com/myrkr/dictionary-el

I bumped into all this when trying out dictionary-tooltip-mode.
I thought "oh, cool", enabled the mode, then...nothing happened.
That's due to the dictionary-tooltip-dictionary defaulting to nil. 
Perhaps this user option could default to 
dictionary-default-dictionary instead. 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: dictionary.el docs --]
[-- Type: text/x-patch, Size: 3022 bytes --]

From 02c4f83176ab9fb1afdb3962f9b90023961ebaaa Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer <iarchivedmywholelife@gmail.com>
Date: Tue, 23 Jan 2024 09:39:02 -0500
Subject: [PATCH] * lisp/net/dictionary.el: satisfy checkdoc

(dictionary-tool-bar-map): add missing period
(dictionary-process-popup-replies),
(dictionary-read-definition),
(dictionary-display-tooltip): rename ignored parameters
(dictionary-tooltip-track-mouse): describe what function does, not just when
(dictionary-switch-tooltip-mode): reword docstring in terms of ON parameter
---
 lisp/net/dictionary.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 1981b757017..4f4710a2920 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -461,7 +461,7 @@ dictionary-tool-bar-map
                                    :vert-only t
                                    :help "Go backwards in history.")
     map)
-  "Like the default `tool-bar-map', but with additions for Dictionary mode")
+  "Like the default `tool-bar-map', but with additions for Dictionary mode.")
 
 ;;;###autoload
 (define-derived-mode dictionary-mode special-mode "Dictionary"
@@ -1316,7 +1316,7 @@ dictionary-popup-matching-words
 			  dictionary-default-popup-strategy
 			  'dictionary-process-popup-replies))
 
-(defun dictionary-process-popup-replies (&ignore)
+(defun dictionary-process-popup-replies (_)
   (let ((list (dictionary-simple-split-string (dictionary-read-answer) "\n+")))
 
     (let ((result (mapcar (lambda (item)
@@ -1360,7 +1360,7 @@ dictionary-definition
 	(dictionary-do-search word dictionary 'dictionary-read-definition t))
     nil))
 
-(defun dictionary-read-definition (&ignore)
+(defun dictionary-read-definition (_)
   (let ((list (dictionary-simple-split-string (dictionary-read-answer) "\n+")))
     (mapconcat #'identity (cdr list) "\n")))
 
@@ -1381,7 +1381,7 @@ dictionary-word-at-mouse-event
 (defvar dictionary-tooltip-mouse-event nil
   "Event that triggered the tooltip mode.")
 
-(defun dictionary-display-tooltip (&ignore)
+(defun dictionary-display-tooltip (_)
   "Search the current word in the `dictionary-tooltip-dictionary'."
   (interactive "e")
   (if (and dictionary-tooltip-mode dictionary-tooltip-dictionary)
@@ -1396,7 +1396,7 @@ dictionary-display-tooltip
     nil))
 
 (defun dictionary-tooltip-track-mouse (event)
-  "Called whenever a dictionary tooltip display is about to be triggered."
+  "Hide current tooltip and setup next tooltip in response to mouse movement EVENT."
   (interactive "e")
   (tooltip-hide)
   (when dictionary-tooltip-mode
@@ -1404,7 +1404,7 @@ dictionary-tooltip-track-mouse
     (tooltip-start-delayed-tip)))
 
 (defun dictionary-switch-tooltip-mode (on)
-  "Turn off or on support for the dictionary tooltip mode.
+  "Turn dictionary tooltip mode off or ON.
 
 It is normally internally called with 1 to enable support for the
 tooltip mode.  The hook function will check the value of the
-- 
2.43.0


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

* Re: [PATCH] dictonary.el documentation
  2024-01-23 15:31 [PATCH] dictonary.el documentation No Wayman
@ 2024-01-23 17:14 ` Philip Kaludercic
  2024-01-24  4:33   ` Emanuel Berg
  2024-01-25 23:33   ` Stefan Kangas
  2024-01-24 10:15 ` bug#68684: " Stefan Kangas
  2024-01-24 10:15 ` Stefan Kangas
  2 siblings, 2 replies; 10+ messages in thread
From: Philip Kaludercic @ 2024-01-23 17:14 UTC (permalink / raw)
  To: No Wayman; +Cc: emacs-devel

No Wayman <iarchivedmywholelife@gmail.com> writes:


[...]

> -(defun dictionary-read-definition (&ignore)
> +(defun dictionary-read-definition (_)

[...]

Is there any advantage to the one or the other approach?



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

* Re: [PATCH] dictonary.el documentation
  2024-01-23 17:14 ` Philip Kaludercic
@ 2024-01-24  4:33   ` Emanuel Berg
  2024-01-25 23:33   ` Stefan Kangas
  1 sibling, 0 replies; 10+ messages in thread
From: Emanuel Berg @ 2024-01-24  4:33 UTC (permalink / raw)
  To: emacs-devel

Philip Kaludercic wrote:

>> -(defun dictionary-read-definition (&ignore)
>> +(defun dictionary-read-definition (_)
>
> Is there any advantage to the one or the other approach?

Shorter to type (shorter lines), less to read, and you can
repeat it with no names attached?

(defun test-ignore (&ignore1 &ignore2 &ignore3)
  1)

(defun test-ignore-2 (_ _ _)
  2)

(defun test-ignore-3 (_a _b _c)
  3)

;; (test-ignore   1 1 1)
;; (test-ignore-2 2 2 2)
;; (test-ignore-3 3 3 3)

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




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

* bug#68684: [PATCH] dictonary.el documentation
  2024-01-23 15:31 [PATCH] dictonary.el documentation No Wayman
  2024-01-23 17:14 ` Philip Kaludercic
@ 2024-01-24 10:15 ` Stefan Kangas
  2024-01-24 12:04   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-01-24 10:15 ` Stefan Kangas
  2 siblings, 1 reply; 10+ messages in thread
From: Stefan Kangas @ 2024-01-24 10:15 UTC (permalink / raw)
  To: 68684; +Cc: iarchivedmywholelife, torsten.hilbrich

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

Severity: wishlist

-------------------- Start of forwarded message --------------------
From: No Wayman <iarchivedmywholelife@gmail.com>
To: emacs-devel@gnu.org
Subject: [PATCH] dictonary.el documentation
Date: Tue, 23 Jan 2024 10:31:47 -0500

[-- Attachment #2: Type: text/plain, Size: 652 bytes --]


I've attached a patch for what I think are a few improvements to 
dictionary.el's documentation.

There are still a handful of undocumented functions/commands.
The commentary section also redirects to an external source, which 
is not very helpful:

;; You can find more information in the README file of the GitHub
;; repository https://github.com/myrkr/dictionary-el

I bumped into all this when trying out dictionary-tooltip-mode.
I thought "oh, cool", enabled the mode, then...nothing happened.
That's due to the dictionary-tooltip-dictionary defaulting to nil. 
Perhaps this user option could default to 
dictionary-default-dictionary instead. 


[-- Attachment #3: 0001-lisp-net-dictionary.el-satisfy-checkdoc.patch --]
[-- Type: text/x-patch, Size: 3022 bytes --]

From 02c4f83176ab9fb1afdb3962f9b90023961ebaaa Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer <iarchivedmywholelife@gmail.com>
Date: Tue, 23 Jan 2024 09:39:02 -0500
Subject: [PATCH] * lisp/net/dictionary.el: satisfy checkdoc

(dictionary-tool-bar-map): add missing period
(dictionary-process-popup-replies),
(dictionary-read-definition),
(dictionary-display-tooltip): rename ignored parameters
(dictionary-tooltip-track-mouse): describe what function does, not just when
(dictionary-switch-tooltip-mode): reword docstring in terms of ON parameter
---
 lisp/net/dictionary.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 1981b757017..4f4710a2920 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -461,7 +461,7 @@ dictionary-tool-bar-map
                                    :vert-only t
                                    :help "Go backwards in history.")
     map)
-  "Like the default `tool-bar-map', but with additions for Dictionary mode")
+  "Like the default `tool-bar-map', but with additions for Dictionary mode.")
 
 ;;;###autoload
 (define-derived-mode dictionary-mode special-mode "Dictionary"
@@ -1316,7 +1316,7 @@ dictionary-popup-matching-words
 			  dictionary-default-popup-strategy
 			  'dictionary-process-popup-replies))
 
-(defun dictionary-process-popup-replies (&ignore)
+(defun dictionary-process-popup-replies (_)
   (let ((list (dictionary-simple-split-string (dictionary-read-answer) "\n+")))
 
     (let ((result (mapcar (lambda (item)
@@ -1360,7 +1360,7 @@ dictionary-definition
 	(dictionary-do-search word dictionary 'dictionary-read-definition t))
     nil))
 
-(defun dictionary-read-definition (&ignore)
+(defun dictionary-read-definition (_)
   (let ((list (dictionary-simple-split-string (dictionary-read-answer) "\n+")))
     (mapconcat #'identity (cdr list) "\n")))
 
@@ -1381,7 +1381,7 @@ dictionary-word-at-mouse-event
 (defvar dictionary-tooltip-mouse-event nil
   "Event that triggered the tooltip mode.")
 
-(defun dictionary-display-tooltip (&ignore)
+(defun dictionary-display-tooltip (_)
   "Search the current word in the `dictionary-tooltip-dictionary'."
   (interactive "e")
   (if (and dictionary-tooltip-mode dictionary-tooltip-dictionary)
@@ -1396,7 +1396,7 @@ dictionary-display-tooltip
     nil))
 
 (defun dictionary-tooltip-track-mouse (event)
-  "Called whenever a dictionary tooltip display is about to be triggered."
+  "Hide current tooltip and setup next tooltip in response to mouse movement EVENT."
   (interactive "e")
   (tooltip-hide)
   (when dictionary-tooltip-mode
@@ -1404,7 +1404,7 @@ dictionary-tooltip-track-mouse
     (tooltip-start-delayed-tip)))
 
 (defun dictionary-switch-tooltip-mode (on)
-  "Turn off or on support for the dictionary tooltip mode.
+  "Turn dictionary tooltip mode off or ON.
 
 It is normally internally called with 1 to enable support for the
 tooltip mode.  The hook function will check the value of the
-- 
2.43.0


[-- Attachment #4: Type: text/plain, Size: 67 bytes --]

-------------------- End of forwarded message --------------------

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

* Re: [PATCH] dictonary.el documentation
  2024-01-23 15:31 [PATCH] dictonary.el documentation No Wayman
  2024-01-23 17:14 ` Philip Kaludercic
  2024-01-24 10:15 ` bug#68684: " Stefan Kangas
@ 2024-01-24 10:15 ` Stefan Kangas
  2 siblings, 0 replies; 10+ messages in thread
From: Stefan Kangas @ 2024-01-24 10:15 UTC (permalink / raw)
  To: No Wayman, emacs-devel

No Wayman <iarchivedmywholelife@gmail.com> writes:

> I've attached a patch for what I think are a few improvements to
> dictionary.el's documentation.

Thanks, I have forwarded your patch to the bug tracker, since we tend to
lose track of patches sent to emacs-devel.

Let's continue the discussion there.



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

* bug#68684: [PATCH] dictonary.el documentation
  2024-01-24 10:15 ` bug#68684: " Stefan Kangas
@ 2024-01-24 12:04   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-01-24 12:20     ` Emanuel Berg
                       ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-01-24 12:04 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: torsten.hilbrich, 68684, iarchivedmywholelife

Stefan Kangas <stefankangas@gmail.com> writes:

> Subject: [PATCH] * lisp/net/dictionary.el: satisfy checkdoc
>
> (dictionary-tool-bar-map): add missing period
> (dictionary-process-popup-replies),
> (dictionary-read-definition),
> (dictionary-display-tooltip): rename ignored parameters
> (dictionary-tooltip-track-mouse): describe what function does, not just when
> (dictionary-switch-tooltip-mode): reword docstring in terms of ON parameter

Thanks.  Nowayman, we cannot install this as-is, since the formatting of
the commit message does not meet our standards.  Please capitalize the
first character in each sentence, punctuate sentences with periods
followed by two spaces, and either omit commas after the identifiers in
entries sharing a description or move such identifiers into a single
line and pair of parentheses, provided that such line totals fewer than
64 columns.

I find that a surprising number of individuals cannot produce correctly
formatted entries on the first attempt.  Is the layout of our
documentation part of the problem?  We should consider why the 124-odd
lines' worth of advice in CONTRIBUTE are being overlooked by most new
hands whose patches turn up in this list, and even some old ones,
because correcting improperly formatted patches individually gets old
fast.





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

* bug#68684: [PATCH] dictonary.el documentation
  2024-01-24 12:04   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-01-24 12:20     ` Emanuel Berg
  2024-01-24 17:07     ` No Wayman
  2024-01-25 23:29     ` Stefan Kangas
  2 siblings, 0 replies; 10+ messages in thread
From: Emanuel Berg @ 2024-01-24 12:20 UTC (permalink / raw)
  To: 68684

Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

> I find that a surprising number of individuals cannot
> produce correctly formatted entries on the first attempt.
> Is the layout of our documentation part of the problem?

Reason one, that format isn't the cleanest one.

Compare to a really clean format, Bibtex, you see how really
clean it can be.

@book{operating-system-concepts,
  author    = {Abraham Silberschatz and Peter B Galvin},
  edition   = {4th},
  isbn      = {0-201-59292-4},
  pages     = {780},
  publisher = {Addison-Wesley},
  title     = {Operating System Concepts},
  year      = {1994}
}

Reason two is with 'git commit -a' you get a new Emacs
instance which is stressful and annoying and you don't have
everything you had one second ago which is even more annoying
as that is exactly what you need right now in the new
instance, so you often type it all manually which is even more
annoying if you have already typed it or something similar
many times under the same miserable regime.

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






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

* bug#68684: [PATCH] dictonary.el documentation
  2024-01-24 12:04   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-01-24 12:20     ` Emanuel Berg
@ 2024-01-24 17:07     ` No Wayman
  2024-01-25 23:29     ` Stefan Kangas
  2 siblings, 0 replies; 10+ messages in thread
From: No Wayman @ 2024-01-24 17:07 UTC (permalink / raw)
  To: 68684; +Cc: luangruo, torsten.hilbrich, stefankangas

Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@gnu.org> writes:

> Stefan Kangas <stefankangas@gmail.com> writes:
>
>> Subject: [PATCH] * lisp/net/dictionary.el: satisfy checkdoc
>>
>> (dictionary-tool-bar-map): add missing period
>> (dictionary-process-popup-replies),
>> (dictionary-read-definition),
>> (dictionary-display-tooltip): rename ignored parameters
>> (dictionary-tooltip-track-mouse): describe what function does, not just when
>> (dictionary-switch-tooltip-mode): reword docstring in terms of ON parameter
 
> Thanks.  Nowayman, we cannot install this as-is, since the formatting of
> the commit message does not meet our standards.  Please capitalize the
> first character in each sentence, punctuate sentences with periods
> followed by two spaces, and either omit commas after the identifiers in
> entries sharing a description or move such identifiers into a single
> line and pair of parentheses, provided that such line totals fewer than
> 64 columns.

Patch offered as-is. Feel free to alter or discard.





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

* bug#68684: [PATCH] dictonary.el documentation
  2024-01-24 12:04   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-01-24 12:20     ` Emanuel Berg
  2024-01-24 17:07     ` No Wayman
@ 2024-01-25 23:29     ` Stefan Kangas
  2 siblings, 0 replies; 10+ messages in thread
From: Stefan Kangas @ 2024-01-25 23:29 UTC (permalink / raw)
  To: Po Lu; +Cc: torsten.hilbrich, 68684, iarchivedmywholelife

Po Lu <luangruo@yahoo.com> writes:

> Thanks.  Nowayman, we cannot install this as-is, since the formatting
> of the commit message does not meet our standards.

Well, I'm happy to fix it up and install it.  I assume you reviewed it,
so do you see any other problems with the patch?

Skimming it very quickly, it looked like a fine contribution to me.

> fewer than 64 columns.

ChangeLogs should fit within 80 columns prefixed with a tab, so that
should be 72 columns.

> I find that a surprising number of individuals cannot produce
> correctly formatted entries on the first attempt.  Is the layout of
> our documentation part of the problem?

I think it's the format that's the problem.  It's archaic and foreign to
most developers.  There's not much to do about it, I think.

> correcting improperly formatted patches individually gets old fast.

I find that it's generally more time-effective to just fix up patches
when installing them, and then say something like:

    Installed.  I changed the commit message to better fit our
    conventions, please have a look for next time.

Usually, people will be more appreciative of that than long lists
enumerating every dot and comma that they got wrong.





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

* Re: [PATCH] dictonary.el documentation
  2024-01-23 17:14 ` Philip Kaludercic
  2024-01-24  4:33   ` Emanuel Berg
@ 2024-01-25 23:33   ` Stefan Kangas
  1 sibling, 0 replies; 10+ messages in thread
From: Stefan Kangas @ 2024-01-25 23:33 UTC (permalink / raw)
  To: Philip Kaludercic, No Wayman; +Cc: emacs-devel

Philip Kaludercic <philipk@posteo.net> writes:

> No Wayman <iarchivedmywholelife@gmail.com> writes:
>
>
> [...]
>
>> -(defun dictionary-read-definition (&ignore)
>> +(defun dictionary-read-definition (_)
>
> [...]
>
> Is there any advantage to the one or the other approach?

It is more idiomatic, I think.  AFAICT, the most idiomatic version is to
also say what the argument is:

+(defun dictionary-read-definition (_reply)



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

end of thread, other threads:[~2024-01-25 23:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-23 15:31 [PATCH] dictonary.el documentation No Wayman
2024-01-23 17:14 ` Philip Kaludercic
2024-01-24  4:33   ` Emanuel Berg
2024-01-25 23:33   ` Stefan Kangas
2024-01-24 10:15 ` bug#68684: " Stefan Kangas
2024-01-24 12:04   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-24 12:20     ` Emanuel Berg
2024-01-24 17:07     ` No Wayman
2024-01-25 23:29     ` Stefan Kangas
2024-01-24 10:15 ` Stefan Kangas

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.