From: Mario Lang <mlang@delysid.org>
Subject: Re: Offering the differences on exit
Date: Tue, 02 Jul 2002 22:25:47 +0200 [thread overview]
Message-ID: <8765zxev1w.fsf@lexx.delysid.org> (raw)
In-Reply-To: <5x1yalg8mq.fsf@kfs2.cua.dk> (storm@cua.dk's message of "02 Jul 2002 22:47:09 +0200")
storm@cua.dk (Kim F. Storm) writes:
> Mario Lang <mlang@delysid.org> writes:
>
>> One feature I miss since I tried out Emacs the first time
>> is the ability to see a diff when you are asked if you want to
>> save changed you've made.
>
> I agree this would be extremely useful.
>
> However, I would prefer if this was built-in as a default option in
> save-some-buffers.
>
> In that case, I don't see a great need for the more general approach
> you have taken with the save-some-buffers-action-alist (although it
> might have other uses).
I figure people might want to use ediff instead of external diff.
Also, when diff is available, I would like to remove C-r, as I never
used it really before.
> The following function may be useful here (it doesn't
> use a temp file, but maybe that's not portable diff
> behaviour):
shell-command-on-region uses make-tempfile AFAICS.
> (defun diff-buffer-to-visited-file (&optional buffer)
> (interactive "bBuffer: ")
> (setq buffer (get-buffer (or buffer (current-buffer))))
> (let ((file (buffer-file-name buffer)))
> (if file
> (with-current-buffer buffer
> (save-restriction
> (widen)
> (shell-command-on-region (point-min) (point-max)
> (concat "diff -c " file " -"))))
If it went as a built-in into emacs I'd prefer to be able to configure
the diff options. Either use vc-cvs-diff-switches, or
ediff-custom-diff-options or some other variable.
> (message "No file is associated with buffer"))))
--
CYa,
Mario
prev parent reply other threads:[~2002-07-02 20:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-02 19:08 Offering the differences on exit Mario Lang
2002-07-02 20:47 ` Kim F. Storm
2002-07-02 20:25 ` Mario Lang [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8765zxev1w.fsf@lexx.delysid.org \
--to=mlang@delysid.org \
/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 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.