unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17970: log-edit creates unwanted ChangeLog buffers
@ 2014-07-08  2:35 Glenn Morris
  2014-07-09  7:09 ` Glenn Morris
  2014-07-09 18:54 ` Stefan Monnier
  0 siblings, 2 replies; 19+ messages in thread
From: Glenn Morris @ 2014-07-08  2:35 UTC (permalink / raw)
  To: 17970

Package: emacs
Version: 24.3.92
Severity: minor

## Just making a test repo:
mkdir /tmp/foo
cd /tmp/foo
bzr init
touch 1
bzr add 1

emacs -Q 1
C-x v v
enter some log message
C-c C-c

C-x C-b
  -> Now there is an empty, unwanted "/tmp/foo/ChangeLog" buffer.


I wish it would not create the ChangeLog buffer (especially when the
the repo does not use ChangeLogs).

Emacs 24.3 does not create these buffers.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-08  2:35 bug#17970: log-edit creates unwanted ChangeLog buffers Glenn Morris
@ 2014-07-09  7:09 ` Glenn Morris
  2014-07-09 13:55   ` Eli Zaretskii
  2014-07-09 18:54 ` Stefan Monnier
  1 sibling, 1 reply; 19+ messages in thread
From: Glenn Morris @ 2014-07-09  7:09 UTC (permalink / raw)
  To: 17970

Glenn Morris wrote:

> C-x v v
[...]
>   -> Now there is an empty, unwanted "/tmp/foo/ChangeLog" buffer.

It looks like this has the same cause as http://debbugs.gnu.org/17884,
namely the fact that vc-next-action now calls log-edit with SETUP = t.
This runs log-edit-hook, which runs log-edit-insert-changelog, which
ends up running log-edit-changelog-entries, which visits the ChangeLog
files, even if they don't exist.

Perhaps log-edit-changelog-entries should not bother visiting
non-existent files. (Could it use invisible buffers?)





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-09  7:09 ` Glenn Morris
@ 2014-07-09 13:55   ` Eli Zaretskii
  2014-07-09 15:41     ` Glenn Morris
  2014-07-10  3:09     ` Stefan Monnier
  0 siblings, 2 replies; 19+ messages in thread
From: Eli Zaretskii @ 2014-07-09 13:55 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 17970

> From: Glenn Morris <rgm@gnu.org>
> Date: Wed, 09 Jul 2014 03:09:23 -0400
> 
> Perhaps log-edit-changelog-entries should not bother visiting
> non-existent files.

That wouldn't be TRT when starting a new repository, or a new
directory in an existing one.

It sounds like a user option is in order.  In addition, if the ignore
file mentions ChangeLog, the command could deduce automatically what
is TRT.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-09 13:55   ` Eli Zaretskii
@ 2014-07-09 15:41     ` Glenn Morris
  2014-07-09 16:28       ` Eli Zaretskii
  2014-07-10  3:09     ` Stefan Monnier
  1 sibling, 1 reply; 19+ messages in thread
From: Glenn Morris @ 2014-07-09 15:41 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 17970

Eli Zaretskii wrote:

>> Perhaps log-edit-changelog-entries should not bother visiting
>> non-existent files.
>
> That wouldn't be TRT when starting a new repository, or a new
> directory in an existing one.

What benefit is there to vc-next-action creating empty ChangeLog buffers
in such cases?

> In addition, if the ignore file mentions ChangeLog, the command could
> deduce automatically what is TRT.

(Then we need an ignore-file parser.)
Why would you have an unversioned ChangeLog, and why would this matter
to vc-next-action?





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-09 15:41     ` Glenn Morris
@ 2014-07-09 16:28       ` Eli Zaretskii
  2014-07-09 16:39         ` Glenn Morris
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2014-07-09 16:28 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 17970

> From: Glenn Morris <rgm@gnu.org>
> Cc: 17970@debbugs.gnu.org
> Date: Wed, 09 Jul 2014 11:41:35 -0400
> 
> Eli Zaretskii wrote:
> 
> >> Perhaps log-edit-changelog-entries should not bother visiting
> >> non-existent files.
> >
> > That wouldn't be TRT when starting a new repository, or a new
> > directory in an existing one.
> 
> What benefit is there to vc-next-action creating empty ChangeLog buffers
> in such cases?

To let me _create_ one.

> > In addition, if the ignore file mentions ChangeLog, the command could
> > deduce automatically what is TRT.
> 
> (Then we need an ignore-file parser.)

With one file name per line, I wouldn't call it a "parser", really.

> Why would you have an unversioned ChangeLog

I didn't say I would.  What I meant was that if ChangeLog is in the
ignore file, that's a sign that a non-existent ChangeLog file should
not be visited, since this repository doesn't want such files.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-09 16:28       ` Eli Zaretskii
@ 2014-07-09 16:39         ` Glenn Morris
  2014-07-09 16:54           ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Glenn Morris @ 2014-07-09 16:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 17970

Eli Zaretskii wrote:

>> What benefit is there to vc-next-action creating empty ChangeLog buffers
>> in such cases?
>
> To let me _create_ one.

The point of this stuff is to prepopulate the vc log buffer with the
relevant ChangeLog entries. If the ChangeLog does not exist, then
obviously it is not going to find any. It does not show you the
ChangeLog buffer that it creates or in any way notify you, so I do not
see how this would help you in the scenario that you meant to write a
ChangeLog entry but forgot, which I presume is what you were referring
to. Could you give an example?

>> (Then we need an ignore-file parser.)
>
> With one file name per line, I wouldn't call it a "parser", really.

They contain wildcards, ! and ** patterns, etc.

>> Why would you have an unversioned ChangeLog
>
> I didn't say I would.  What I meant was that if ChangeLog is in the
> ignore file, that's a sign that a non-existent ChangeLog file should
> not be visited, since this repository doesn't want such files.

Why would you ignore a file that it not expected to exist in your repo?





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-09 16:39         ` Glenn Morris
@ 2014-07-09 16:54           ` Eli Zaretskii
  2014-07-09 20:17             ` Glenn Morris
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2014-07-09 16:54 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 17970

> From: Glenn Morris <rgm@gnu.org>
> Cc: 17970@debbugs.gnu.org
> Date: Wed, 09 Jul 2014 12:39:28 -0400
> 
> The point of this stuff is to prepopulate the vc log buffer with the
> relevant ChangeLog entries. If the ChangeLog does not exist, then
> obviously it is not going to find any. It does not show you the
> ChangeLog buffer that it creates or in any way notify you, so I do not
> see how this would help you in the scenario that you meant to write a
> ChangeLog entry but forgot, which I presume is what you were referring
> to. Could you give an example?
> 
> >> (Then we need an ignore-file parser.)
> >
> > With one file name per line, I wouldn't call it a "parser", really.
> 
> They contain wildcards, ! and ** patterns, etc.
> 
> >> Why would you have an unversioned ChangeLog
> >
> > I didn't say I would.  What I meant was that if ChangeLog is in the
> > ignore file, that's a sign that a non-existent ChangeLog file should
> > not be visited, since this repository doesn't want such files.
> 
> Why would you ignore a file that it not expected to exist in your repo?

I don't really know what else to say.  I've written everything I could
about this, and it sounds pretty clear to me.  If none of that makes
sense, feel free to ignore.  I will know to keep my mouth shut next
time.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-08  2:35 bug#17970: log-edit creates unwanted ChangeLog buffers Glenn Morris
  2014-07-09  7:09 ` Glenn Morris
@ 2014-07-09 18:54 ` Stefan Monnier
  2014-07-09 20:19   ` Glenn Morris
  1 sibling, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2014-07-09 18:54 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 17970-done

> C-x C-b
-> Now there is an empty, unwanted "/tmp/foo/ChangeLog" buffer.

I installed the patch below which seems to fix this problem.


        Stefan


=== modified file 'lisp/vc/log-edit.el'
--- lisp/vc/log-edit.el	2014-07-01 15:15:03 +0000
+++ lisp/vc/log-edit.el	2014-07-09 18:52:47 +0000
@@ -905,6 +905,7 @@
              ;; that memoizing which is undesired here.
              (setq change-log-default-name nil)
              (find-change-log)))))
+    (when (file-exists-p changelog-file-name)
     (with-current-buffer (find-file-noselect changelog-file-name)
       (unless (eq major-mode 'change-log-mode) (change-log-mode))
       (goto-char (point-min))
@@ -942,7 +943,7 @@
                   (setq pos (max (1+ pos) (elt entry 1)))
 		  (goto-char pos)))
 
-	      (cons (current-buffer) texts))))))))
+                (cons (current-buffer) texts)))))))))
 
 (defun log-edit-changelog-insert-entries (buffer beg end &rest files)
   "Insert the text from BUFFER between BEG and END.






^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-09 16:54           ` Eli Zaretskii
@ 2014-07-09 20:17             ` Glenn Morris
  0 siblings, 0 replies; 19+ messages in thread
From: Glenn Morris @ 2014-07-09 20:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 17970

Eli Zaretskii wrote:

> I don't really know what else to say.  I've written everything I could
> about this, and it sounds pretty clear to me.  If none of that makes
> sense, feel free to ignore.  I will know to keep my mouth shut next
> time.

Sorry, but it basically made no sense to me.
It didn't seem to bear any relation to what this report was (IMO) about.
I wasn't trying to be difficult or anything like that.
Never mind! :)





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-09 18:54 ` Stefan Monnier
@ 2014-07-09 20:19   ` Glenn Morris
  2014-07-09 22:22     ` Stefan Monnier
  0 siblings, 1 reply; 19+ messages in thread
From: Glenn Morris @ 2014-07-09 20:19 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 17970

Stefan Monnier wrote:

> I installed the patch below which seems to fix this problem.

Thanks.
I'm still going to find it a bit irritating when the file _does_ exist.
Why can't it use hidden buffers?
Is it in case you have edited but not saved the ChangeLog?
If so, could it use (or (find-buffer-visiting ...) <hidden buffer>)?





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-09 20:19   ` Glenn Morris
@ 2014-07-09 22:22     ` Stefan Monnier
  0 siblings, 0 replies; 19+ messages in thread
From: Stefan Monnier @ 2014-07-09 22:22 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 17970

>> I installed the patch below which seems to fix this problem.
> Thanks.
> I'm still going to find it a bit irritating when the file _does_ exist.

Indeed for those very projects that don't use a ChangeLog but do
auto-generate one, it could be a bit annoying.  But I don't think it's
a very serious issue.

> Why can't it use hidden buffers?
> Is it in case you have edited but not saved the ChangeLog?

Yes.

> If so, could it use (or (find-buffer-visiting ...) <hidden buffer>)?

It could do that, indeed.  Or it could kill the buffer at the end if the
buffer didn't exist earlier.  It seems more trouble than it's
worth, tho.


        Stefan





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-09 13:55   ` Eli Zaretskii
  2014-07-09 15:41     ` Glenn Morris
@ 2014-07-10  3:09     ` Stefan Monnier
  2014-07-10 14:59       ` Eli Zaretskii
  1 sibling, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2014-07-10  3:09 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 17970

>> Perhaps log-edit-changelog-entries should not bother visiting
>> non-existent files.
> That wouldn't be TRT when starting a new repository, or a new
> directory in an existing one.

Of course it's correct.  You misunderstand the purpose of
log-edit-changelog-entries: it's not there to fill the ChangeLog but to
extract pre-existing text from it to fill the *VC-Log* buffer.
So if the file doesn't exist, there's nothing to get from it and we
might as well not visit the file.


        Stefan





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-10  3:09     ` Stefan Monnier
@ 2014-07-10 14:59       ` Eli Zaretskii
  2014-07-10 16:45         ` Stefan Monnier
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2014-07-10 14:59 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 17970

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Glenn Morris <rgm@gnu.org>,  17970@debbugs.gnu.org
> Date: Wed, 09 Jul 2014 23:09:02 -0400
> 
> You misunderstand the purpose of log-edit-changelog-entries

No, I don't misunderstand.

> So if the file doesn't exist, there's nothing to get from it and we
> might as well not visit the file.

What if I already did "C-x 4 a", which visited a non-existing
ChangeLog, and wrote my entry, but didn't yet save that buffer?





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-10 14:59       ` Eli Zaretskii
@ 2014-07-10 16:45         ` Stefan Monnier
  2014-07-10 16:54           ` Glenn Morris
  0 siblings, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2014-07-10 16:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 17970

>> So if the file doesn't exist, there's nothing to get from it and we
>> might as well not visit the file.
> What if I already did "C-x 4 a", which visited a non-existing
> ChangeLog, and wrote my entry, but didn't yet save that buffer?

I guess that would make sense, indeed.  Could you refine my patch so
as to handle that case?


        Stefan





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-10 16:45         ` Stefan Monnier
@ 2014-07-10 16:54           ` Glenn Morris
  2014-07-10 17:18             ` Stefan Monnier
  0 siblings, 1 reply; 19+ messages in thread
From: Glenn Morris @ 2014-07-10 16:54 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 17970

Stefan Monnier wrote:

>> What if I already did "C-x 4 a", which visited a non-existing
>> ChangeLog, and wrote my entry, but didn't yet save that buffer?

Then you get punished for not committing your ChangeLog at the same time
as the associated commit. ;)

> I guess that would make sense, indeed.  Could you refine my patch so
> as to handle that case?

(or (find-buffer-visiting changelog-file-name)
    (file-exists-p changelog-file-name))






^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-10 16:54           ` Glenn Morris
@ 2014-07-10 17:18             ` Stefan Monnier
  2014-07-10 17:22               ` Eli Zaretskii
  2014-07-10 17:46               ` Glenn Morris
  0 siblings, 2 replies; 19+ messages in thread
From: Stefan Monnier @ 2014-07-10 17:18 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 17970

>>> What if I already did "C-x 4 a", which visited a non-existing
>>> ChangeLog, and wrote my entry, but didn't yet save that buffer?
> Then you get punished for not committing your ChangeLog at the same time
> as the associated commit. ;)

But this case is actually interesting because for repositories such as
`elpa' which don't use ChangeLogs but do want to use the ChangeLog
conventions in the commit message, a way to do that is to use C-x 4 a to
fill the ChangeLog buffer but you won't want to save this buffer.


        Stefan





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-10 17:18             ` Stefan Monnier
@ 2014-07-10 17:22               ` Eli Zaretskii
  2014-07-10 17:46               ` Glenn Morris
  1 sibling, 0 replies; 19+ messages in thread
From: Eli Zaretskii @ 2014-07-10 17:22 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 17970

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Eli Zaretskii <eliz@gnu.org>,  17970@debbugs.gnu.org
> Date: Thu, 10 Jul 2014 13:18:05 -0400
> 
> >>> What if I already did "C-x 4 a", which visited a non-existing
> >>> ChangeLog, and wrote my entry, but didn't yet save that buffer?
> > Then you get punished for not committing your ChangeLog at the same time
> > as the associated commit. ;)
> 
> But this case is actually interesting because for repositories such as
> `elpa' which don't use ChangeLogs but do want to use the ChangeLog
> conventions in the commit message, a way to do that is to use C-x 4 a to
> fill the ChangeLog buffer but you won't want to save this buffer.

Not just elpa, but other projects as well.  Guile and Coreutils, for
example.  That's how I bumped into this use case.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-10 17:18             ` Stefan Monnier
  2014-07-10 17:22               ` Eli Zaretskii
@ 2014-07-10 17:46               ` Glenn Morris
  2014-07-10 18:19                 ` Stefan Monnier
  1 sibling, 1 reply; 19+ messages in thread
From: Glenn Morris @ 2014-07-10 17:46 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 17970

Stefan Monnier wrote:

> But this case is actually interesting because for repositories such as
> `elpa' which don't use ChangeLogs but do want to use the ChangeLog
> conventions in the commit message, a way to do that is to use C-x 4 a to
> fill the ChangeLog buffer but you won't want to save this buffer.

Sounds like Emacs should provide a better mechanism for this,
rather than one that could eg leave unwanted auto-saves around.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17970: log-edit creates unwanted ChangeLog buffers
  2014-07-10 17:46               ` Glenn Morris
@ 2014-07-10 18:19                 ` Stefan Monnier
  0 siblings, 0 replies; 19+ messages in thread
From: Stefan Monnier @ 2014-07-10 18:19 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 17970

> Sounds like Emacs should provide a better mechanism for this,
> rather than one that could eg leave unwanted auto-saves around.

Indeed it should.


        Stefan





^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2014-07-10 18:19 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-08  2:35 bug#17970: log-edit creates unwanted ChangeLog buffers Glenn Morris
2014-07-09  7:09 ` Glenn Morris
2014-07-09 13:55   ` Eli Zaretskii
2014-07-09 15:41     ` Glenn Morris
2014-07-09 16:28       ` Eli Zaretskii
2014-07-09 16:39         ` Glenn Morris
2014-07-09 16:54           ` Eli Zaretskii
2014-07-09 20:17             ` Glenn Morris
2014-07-10  3:09     ` Stefan Monnier
2014-07-10 14:59       ` Eli Zaretskii
2014-07-10 16:45         ` Stefan Monnier
2014-07-10 16:54           ` Glenn Morris
2014-07-10 17:18             ` Stefan Monnier
2014-07-10 17:22               ` Eli Zaretskii
2014-07-10 17:46               ` Glenn Morris
2014-07-10 18:19                 ` Stefan Monnier
2014-07-09 18:54 ` Stefan Monnier
2014-07-09 20:19   ` Glenn Morris
2014-07-09 22:22     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).