emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Bell <mail@nickbell.org>
To: Leo <sdl.web@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: Preventing (or mitigating) accidental deletion in	org-mode
Date: Sun, 23 Aug 2009 13:59:22 +0100	[thread overview]
Message-ID: <4A913D2A.40003@nickbell.org> (raw)
In-Reply-To: <m0zl9qiu08.fsf@cam.ac.uk>

Leo wrote:
> On 2009-08-23 13:27 +0100, Nick Bell wrote:
>> I'm trying to write a little function using before-save-hook to
>> compare the current buffer to the saved version and output the result
>> of diffstat, asking the user whether they want to go ahead with the
>> save or view the full diff. Or has someone done something like this
>> before?
> 
> See diff-buffer-with-file.

Yes, that was the idea. I was going to hook a function into 
before-save-hook which does pipe diff -u $1 $2 | diffstat and  show the 
result in some kind of minibuffer. Not sure how to set $1 and $2 (in 
fact, I've never written any elisp at all). I don't suppose anyone could 
whip up the code in a moment or two? ;-)

Nick

-- 
Nick Bell

  reply	other threads:[~2009-08-23 12:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-23 10:58 Preventing (or mitigating) accidental deletion in org-mode Nick Bell
2009-08-23 12:04 ` Leo
2009-08-23 12:30   ` Andrew Stribblehill
2009-08-23 12:20 ` PT
2009-08-23 12:27   ` Nick Bell
2009-08-23 12:39     ` Leo
2009-08-23 12:59       ` Nick Bell [this message]
2009-08-23 14:39 ` Sebastian Rose
2009-08-23 18:39   ` Russell Adams
2009-08-23 18:45     ` Nick Bell

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.orgmode.org/

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

  git send-email \
    --in-reply-to=4A913D2A.40003@nickbell.org \
    --to=mail@nickbell.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=sdl.web@gmail.com \
    /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/org-mode.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).