bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#38575: 27.0.50; Document that `diff' arguments OLD and NEW can be bu


From: Phil Sainty
Subject: bug#38575: 27.0.50; Document that `diff' arguments OLD and NEW can be buffers
Date: Thu, 12 Dec 2019 19:46:40 +1300
User-agent: Orcon Webmail

The docstring for `diff' is:

    (diff OLD NEW &optional SWITCHES NO-ASYNC)

    Find and display the differences between OLD and NEW files.
    When called interactively, read NEW, then OLD, using the
    minibuffer.  The default for NEW is the current buffer’s file
    name, and the default for OLD is a backup file for NEW, if one
    exists.  If NO-ASYNC is non-nil, call diff synchronously.

    When called interactively with a prefix argument, prompt
    interactively for diff switches.  Otherwise, the switches
    specified in the variable ‘diff-switches’ are passed to the
    diff command.


However either (or both) of OLD and NEW may alternatively be buffers,
with temporary files automatically created as necessary.  This happens
via `diff-file-local-copy' called by `diff-no-select'.

This feature is utilised by `diff-buffer-with-file', and is far too
useful to be undocumented by `diff'.

I suggest the following additional paragraph:

    Non-interactively, OLD and NEW may each be buffers, in which
    case a temporary file will be used.


If that wording is ok, I can commit the change.


-Phil






reply via email to

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