unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Sean Whitton <spwhitton@spwhitton.name>
Cc: philipk@posteo.net, emacs-devel@gnu.org
Subject: Re: New optional Eshell module: em-elecslash
Date: Sun, 17 Apr 2022 09:20:59 +0300	[thread overview]
Message-ID: <837d7oz0vo.fsf@gnu.org> (raw)
In-Reply-To: <87fsmckd6d.fsf@melete.silentflame.com> (message from Sean Whitton on Sat, 16 Apr 2022 13:04:26 -0700)

> From: Sean Whitton <spwhitton@spwhitton.name>
> Cc: emacs-devel@gnu.org, philipk@posteo.net
> Date: Sat, 16 Apr 2022 13:04:26 -0700
> 
> On Sat 16 Apr 2022 at 10:18PM +03, Eli Zaretskii wrote:
> 
> >> +If the @code{eshell-elecslash} module has been added to
> >> +@code{eshell-modules-list}, and @code{default-directory} is remote,
> >> +then when you type the first forward slash of an argument to a Lisp
> >> +function, the Tramp prefix will be filled in for you.  A second
> >> +forward slash can be used to undo the insertion, for when you really
> >> +do want to pass a local absolute path, such as when you want to copy a
> >> +remote file to the local machine.  And when typing arguments to
> >> +external commands, the Tramp prefix is not filled in.  The result is
> >> +that you don't have to think about inserting the Tramp prefix and can
> >> +just type absolute paths in the same way for both types of command.
> >> +The Tramp prefix is additionally filled in when you type @code{~/}.
> >
> > You use passive tense a lot (here and elsewhere), which in many cases
> > makes the text longer, more complicated, and harder to understand.
> > Please try rephrasing without using passive tense so much.
> 
> I'm happy to try to make it clearer, but in the U.K. we don't have this
> idea that the passive voice is worse than the active -- I didn't learn
> the distinction until after finishing a humanities degree -- so could
> you be more specific, please?

IME, use of passive tense is not the "disease", it's a symptom.  The
"disease" is overly complicated sentences that make the text hard to
understand.  Using passive tense is a good indicator that the
structure of the text is sub-optimal and needs to be rethought.
Trying to use active tense as much as possible in many cases leads to
such rethinking and makes the text more clear.

For example, here's how I'd rephrase the above paragraph:

  To help you type file-name arguments to remote commands, add the
  @code{eshell-elecslash} module to @code{eshell-modules-list}.  Then
  typing the first @kbd{/} character of a command-line argument will
  automatically insert the Tramp prefix if the
  @code{default-directory} is remote.  If this is not what you want
  (e.g., you want to type a local absolute file name instead), type
  another @kbd{/} to undo this automatic prefix insertion.  Typing
  @kbd{~/} also inserts the Tramp prefix.  By contrast, typing
  arguments to external commands, which always run locally, doesn't
  insert the prefix.  The result is that in most cases you get the
  Tramp prefix inserted automatically only when you should reasonably
  expect it.

Do you see how using the active tense makes the text more clear?
Another thing to remember for writing clear documentation is not to
put the important parts too far near the end of a sentence; the above
rewording fixed a few instances of that in your original text.

> >> +*** New optional Eshell module to help avoid mistakes when supplying
> >
> > The first line of a NEWS entry is a heading, so it should be a
> > complete sentence, to facilitate reading the outlines.
> 
> Hmm interesting.  I found continuing sentences from the outline heading
> to the next line strange, but noticed that many NEWS entries did it, so
> thought it was how outline-mode is meant to be used.

No, the NEWS entries where the first line is not a complete sentence
ending in a period are in error and should be fixed.  (We usually fix
that close to starting a pretest, if not earlier.)

> >> +;;;###autoload
> >> +(progn
> >> +(defgroup eshell-elecslash nil
> >> +  "When `default-directory' is remote thanks to Eshell's TRAMP
> >
> > the first line of a doc string should be a complete sentence, because
> > some Help commands only show that single line.
> >
> >> +(defun eshell-electric-forward-slash ()
> >> +  "Electric insertion of TRAMP part of `default-directory' in
> >> +remote Eshells.  Added to `post-self-insert-hook' when the
> >
> > Likewise.
> 
> I'll try to come up with something.  This rule can be very difficult to
> satisfy given line length restrictions.

We all bump into that from time to time.  Some techniques for dealing
with the difficulties:

  . omit some less important parts, like "the" etc.
  . rearrange the text to make it shorter (for example, say "buffer
    text" instead of "the text of the buffer")
  . omit less important details from the first sentence, and describe
    them in the following parts of the doc string

Thanks.



  parent reply	other threads:[~2022-04-17  6:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27  2:48 Optional Eshell modules -- to emacs.git or ELPA? Sean Whitton
2022-01-29 11:51 ` Philip Kaludercic
2022-04-16 18:57   ` New optional Eshell module: em-elecslash Sean Whitton
2022-04-16 19:18     ` Eli Zaretskii
2022-04-16 20:04       ` Sean Whitton
2022-04-16 21:42         ` [External] : " Drew Adams
2022-04-17  6:20         ` Eli Zaretskii [this message]
2022-04-17 16:48           ` Drew Adams
2022-04-19 16:52           ` Sean Whitton
2022-04-20  0:36             ` Sean Whitton
2022-04-20  6:19               ` Eli Zaretskii
2022-04-20 20:14                 ` Sean Whitton
2022-04-21  6:15                   ` Eli Zaretskii
2022-04-16 21:12       ` Sean Whitton
2022-04-16 22:58     ` Stefan Monnier
2022-04-17  5:02       ` Sean Whitton
2022-04-17  6:24     ` Jim Porter
2022-04-19 15:28       ` Sean Whitton

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=837d7oz0vo.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=philipk@posteo.net \
    --cc=spwhitton@spwhitton.name \
    /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 public inbox

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

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