emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 9ce1d38: Use curved quotes in core elisp diagno


From: Paul Eggert
Subject: Re: [Emacs-diffs] master 9ce1d38: Use curved quotes in core elisp diagnostics
Date: Tue, 18 Aug 2015 21:52:17 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0

Richard Stallman wrote:

The issue at hand is doc strings in the source code, not format strings.

True.  Sorry about the confusion.

It's a bad practice to copy text from a help buffer into
a doc string in the source code

That's a bit like saying it's bad practice to copy from a text file into a Lisp string. Although such copying can lead to problems because arbitrary text can be misinterpreted in a Lisp string, as a practical matter it's often quite convenient to copy snippets of text files into Lisp strings or vice versa, and it often works well, either because users know the text doesn't have string escapes or delimiters, or because they repair any glitches that may arise.

And it's not just *Help* buffers. I often cut and paste from documentation into code. The Emacs info files have used curved quotes for some time, and it's helpful to have these work in doc strings too. As a simple example, the Elisp manual says this:

 -- Function: eql value1 value2
     This function acts like ‘eq’ except when both arguments are
     numbers.  It compares numbers by type and numeric value,...

If I were to write a similar function I might copy some of this into the new function's doc string and then adapt it, like this:

  (defun eqfuzz (value1 value2)
    "Compare two values but use fuzzy comparison on numbers.
  This function acts like ‘eq’ except when both arguments are numbers....

This sort of editing is natural and convenient, and there's no compelling reason to prohibit it.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]