emacs-devel
[Top][All Lists]
Advanced

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

Re: TODO


From: Stefan Monnier
Subject: Re: TODO
Date: Tue, 26 Feb 2008 13:26:34 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>> Please let me know if anyone is already working on one of these tasks.
>> 
>> ** make emacsclient accept -nw as a synonym to -t.
>> 
>> ** Replace some uses of the preprocessor code in Makefile.in with the
>> equivalent autoconf.
>> 
>> ** Make "emacs --daemon" start emacs without showing any frame.
>> Use emacsclient later to open frames.

> AFAIK nobody has publicly announced that is working on any of these.

> Do you have a copyright assignment on file?  If not, it would make sense
> to get started on that as soon as possible, so that it is ready by the
> time you finish writing the code.


>> ** Make vc-checkin avoid reverting the buffer if has not changed after
>> the checkin. Comparing (md5 BUFFER) to (md5 FILE) should be enough.

> I have a patch for this one.

> But it needs a few more eyes on it from people that know the code
> involved very well to make sure it is correct and the right thing to do.
> The patch itself is not too complicated.

BTW, I'd like someone to clarify the goal.  I.e. what is it trying
to fix.  It seems that if the file hasn't been changed, the current code
should at the very least end up not modifying the buffer (since
insert-file-contents already compares the bytes to find the unchanged
prefix and suffix).  So what is the difference in this case between
calling revert-buffer and not calling it?

Also I expect that if the file hasn't changed, it will often have kept
its modification time as well, so in which circumstances would the
modtime check fail but the md5 check succeed?


        Stefan


> --- vc.el       10 Oct 2007 10:34:53 -0700      1.464
> +++ vc.el       11 Oct 2007 12:18:02 -0700      
> @@ -1328,7 +1327,19 @@
>      (save-excursion
>        ;; t means don't call normal-mode;
>        ;; that's to preserve various minor modes.
> -      (revert-buffer arg no-confirm t))
> +      (if (string=
> +          (with-temp-buffer
> +            ;; Insert the file on disk in a temporary buffer and compute the 
> md5 there.
> +            (let ((coding-system-for-read 'binary))
> +              (insert-file-contents file)
> +              (md5 (current-buffer))))
> +          (md5 (current-buffer)))  ;; md5 for the current buffer
> +         (let ((writable (file-writable-p (buffer-file-name)))) ;; Try to 
> set the read-only state.
> +           (unless (eq buffer-read-only writable)
> +             (setq buffer-read-only writable))
> +           (message "not reverting"))
> +       (message "reverting :-(")
> +       (revert-buffer arg no-confirm t)))
>      (vc-restore-buffer-context context)))
 
>  (defun vc-buffer-sync (&optional not-urgent)





reply via email to

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