all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* feature proposal: change-log-exit: save change-log buffer and bury it.
@ 2015-10-15  6:43 Uwe Brauer
  2015-10-15 11:11 ` Dmitry Gutov
  0 siblings, 1 reply; 10+ messages in thread
From: Uwe Brauer @ 2015-10-15  6:43 UTC (permalink / raw)
  To: emacs-devel


Hello

In older (maybe several years old) version of add-log, there was a
function change-log-exit which saved the ChangeLog file, killed the
buffer and returned to the file in which I started add-change-log-entry.

I think could get a similar behavior if I changed change-log-find-file
using defadvice, however I don't like that solution since it makes
debugging difficult.

Could such a functionality be implemented per default?

Thanks

Uwe Brauer 







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

* Re: feature proposal: change-log-exit: save change-log buffer and bury it.
  2015-10-15  6:43 feature proposal: change-log-exit: save change-log buffer and bury it Uwe Brauer
@ 2015-10-15 11:11 ` Dmitry Gutov
  2015-10-15 15:46   ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Gutov @ 2015-10-15 11:11 UTC (permalink / raw)
  To: emacs-devel

On 10/15/2015 09:43 AM, Uwe Brauer wrote:

> In older (maybe several years old) version of add-log, there was a
> function change-log-exit which saved the ChangeLog file, killed the
> buffer and returned to the file in which I started add-change-log-entry.

Sounds handy.

> Could such a functionality be implemented per default?

Do you know why it was removed? I imagine that would've been mentioned 
in NEWS, at least.



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

* Re: feature proposal: change-log-exit: save change-log buffer and bury it.
  2015-10-15 11:11 ` Dmitry Gutov
@ 2015-10-15 15:46   ` Eli Zaretskii
  2015-10-15 15:50     ` Kaushal Modi
  2015-10-18  7:01     ` Uwe Brauer
  0 siblings, 2 replies; 10+ messages in thread
From: Eli Zaretskii @ 2015-10-15 15:46 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: emacs-devel

> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Thu, 15 Oct 2015 14:11:11 +0300
> 
> On 10/15/2015 09:43 AM, Uwe Brauer wrote:
> 
> > In older (maybe several years old) version of add-log, there was a
> > function change-log-exit which saved the ChangeLog file, killed the
> > buffer and returned to the file in which I started add-change-log-entry.
> 
> Sounds handy.
> 
> > Could such a functionality be implemented per default?
> 
> Do you know why it was removed? I imagine that would've been mentioned 
> in NEWS, at least.

FWIW, I see no such function in any of the ChangeLog files, and "git
grep" reports no matches for it.

Uwe, are you sure there was such a function?



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

* Re: feature proposal: change-log-exit: save change-log buffer and bury it.
  2015-10-15 15:46   ` Eli Zaretskii
@ 2015-10-15 15:50     ` Kaushal Modi
  2015-10-15 15:52       ` Kaushal Modi
  2015-10-18  7:01     ` Uwe Brauer
  1 sibling, 1 reply; 10+ messages in thread
From: Kaushal Modi @ 2015-10-15 15:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs developers, Dmitry Gutov

[-- Attachment #1: Type: text/plain, Size: 935 bytes --]

Search on github came up with 1 result:
https://github.com/search?type=Code&q=extension:el+change-log-exit
References to xemacs.


--
Kaushal Modi

On Thu, Oct 15, 2015 at 11:46 AM, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Dmitry Gutov <dgutov@yandex.ru>
> > Date: Thu, 15 Oct 2015 14:11:11 +0300
> >
> > On 10/15/2015 09:43 AM, Uwe Brauer wrote:
> >
> > > In older (maybe several years old) version of add-log, there was a
> > > function change-log-exit which saved the ChangeLog file, killed the
> > > buffer and returned to the file in which I started
> add-change-log-entry.
> >
> > Sounds handy.
> >
> > > Could such a functionality be implemented per default?
> >
> > Do you know why it was removed? I imagine that would've been mentioned
> > in NEWS, at least.
>
> FWIW, I see no such function in any of the ChangeLog files, and "git
> grep" reports no matches for it.
>
> Uwe, are you sure there was such a function?
>
>

[-- Attachment #2: Type: text/html, Size: 1850 bytes --]

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

* Re: feature proposal: change-log-exit: save change-log buffer and bury it.
  2015-10-15 15:50     ` Kaushal Modi
@ 2015-10-15 15:52       ` Kaushal Modi
  0 siblings, 0 replies; 10+ messages in thread
From: Kaushal Modi @ 2015-10-15 15:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs developers, Dmitry Gutov

From: https://github.com/boukeversteegh/chise/blob/master/xemacs/lisp/ChangeLog.1

1997-10-15 Hrvoje Niksic <hniksic@srce.hr>
* cl/cl-macs.el (extent-property): Updated SETF methods for `get'
and `extent-property'.
* custom/wid-edit.el (widget-field-value-create): Revert to using
two markers.
(widget-setup): Ditto.
(widget-color-sample-face-get): Get only a unique face per widget.
(widget-color-notify): Change the color of the face instead of
creating a new one.
* packages/add-log.el (add-change-log-entry): Push window
configuration.
(change-log-exit): New function.
(change-log-cancel): Ditto.
(change-log-mode-map): Bind them.

--
Kaushal Modi


On Thu, Oct 15, 2015 at 11:50 AM, Kaushal Modi <kaushal.modi@gmail.com> wrote:
> Search on github came up with 1 result:
> https://github.com/search?type=Code&q=extension:el+change-log-exit
> References to xemacs.
>
>
> --
> Kaushal Modi
>
> On Thu, Oct 15, 2015 at 11:46 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>>
>> > From: Dmitry Gutov <dgutov@yandex.ru>
>> > Date: Thu, 15 Oct 2015 14:11:11 +0300
>> >
>> > On 10/15/2015 09:43 AM, Uwe Brauer wrote:
>> >
>> > > In older (maybe several years old) version of add-log, there was a
>> > > function change-log-exit which saved the ChangeLog file, killed the
>> > > buffer and returned to the file in which I started
>> > > add-change-log-entry.
>> >
>> > Sounds handy.
>> >
>> > > Could such a functionality be implemented per default?
>> >
>> > Do you know why it was removed? I imagine that would've been mentioned
>> > in NEWS, at least.
>>
>> FWIW, I see no such function in any of the ChangeLog files, and "git
>> grep" reports no matches for it.
>>
>> Uwe, are you sure there was such a function?
>>
>



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

* Re: feature proposal: change-log-exit: save change-log buffer and bury it.
  2015-10-15 15:46   ` Eli Zaretskii
  2015-10-15 15:50     ` Kaushal Modi
@ 2015-10-18  7:01     ` Uwe Brauer
  2015-10-18  9:43       ` Dmitry Gutov
  1 sibling, 1 reply; 10+ messages in thread
From: Uwe Brauer @ 2015-10-18  7:01 UTC (permalink / raw)
  To: emacs-devel



   > FWIW, I see no such function in any of the ChangeLog files, and "git
   > grep" reports no matches for it.

   > Uwe, are you sure there was such a function?

Sorry for the delay in my answer. My memory did not serve me well. I
thought this was in Emacs 19.34 but I could not find any working Emacs
19.34 version anymore. However it is a Xemacs function.


(defun change-log-exit ()
  "Save the change-log buffer, and restores the old window configuration.
Buries the buffer."
  (interactive)
  (save-buffer)
  (let ((buf (current-buffer)))
    (pop-window-configuration)
    (bury-buffer buf)))

The problem is bury-buffer, it is a C function from buffer.c that of
course makes it more difficult to port to GNU Emacs.

The definition of 
 pop-window-configuration

You find below.


So the short question is: can such a functionality implemented easily I
found it very useful.

Right now I use

(defadvice change-log-find-file (before savebury activate)
  "Save and kill the buffer before turning to source."
  (save-buffer 1)
  (kill-this-buffer))



Thanks

Uwe


(defun pop-window-configuration ()
  "Pop the top window configuration off the window-config stack and set it.
Before setting the new window configuration, the current window configuration
 is pushed onto the \"unpop\" stack.
`unpop-window-configuration' undoes what this function does.
Each frame has its own window-config and \"unpop\" stack."
  (interactive)
  (let ((stack (window-config-stack))
	(wc (current-window-configuration))
	popped)
    (condition-case nil
	(progn
	  (setq popped (undoable-stack-pop stack))
	  (while (equal popped wc)
	    (setq popped (undoable-stack-pop stack)))
	  (undoable-stack-push stack wc)
	  (undoable-stack-undo stack)
	  (set-window-configuration popped)
	  popped)
      (trunc-stack-bottom
       (error "Bottom of window config stack")))))






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

* Re: feature proposal: change-log-exit: save change-log buffer and bury it.
  2015-10-18  7:01     ` Uwe Brauer
@ 2015-10-18  9:43       ` Dmitry Gutov
  2015-10-18 10:13         ` Uwe Brauer
  2015-10-20  7:52         ` Uwe Brauer
  0 siblings, 2 replies; 10+ messages in thread
From: Dmitry Gutov @ 2015-10-18  9:43 UTC (permalink / raw)
  To: emacs-devel

On 10/18/2015 10:01 AM, Uwe Brauer wrote:

 > Right now I use
>
> (defadvice change-log-find-file (before savebury activate)
>    "Save and kill the buffer before turning to source."
>    (save-buffer 1)
>    (kill-this-buffer))

Have you tried using quit-window instead of this command?



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

* Re: feature proposal: change-log-exit: save change-log buffer and bury it.
  2015-10-18  9:43       ` Dmitry Gutov
@ 2015-10-18 10:13         ` Uwe Brauer
  2015-10-20  7:52         ` Uwe Brauer
  1 sibling, 0 replies; 10+ messages in thread
From: Uwe Brauer @ 2015-10-18 10:13 UTC (permalink / raw)
  To: emacs-devel

>>> "Dmitry" == Dmitry Gutov <dgutov@yandex.ru> writes:

> On 10/18/2015 10:01 AM, Uwe Brauer wrote:
>> Right now I use
>> 
>> (defadvice change-log-find-file (before savebury activate)
>> "Save and kill the buffer before turning to source."
>> (save-buffer 1)
>> (kill-this-buffer))

> Have you tried using quit-window instead of this command?
At first I thought you suggest to use quit-window instead of
kill-this-buffer, but it seems you suggest to use it instead of the
adviced command.

So far it works as expected, thanks, I will try it out in the days to
come to see whether maybe some changes were not saved.





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

* Re: feature proposal: change-log-exit: save change-log buffer and bury it.
  2015-10-18  9:43       ` Dmitry Gutov
  2015-10-18 10:13         ` Uwe Brauer
@ 2015-10-20  7:52         ` Uwe Brauer
  2015-10-20  8:36           ` Dmitry Gutov
  1 sibling, 1 reply; 10+ messages in thread
From: Uwe Brauer @ 2015-10-20  7:52 UTC (permalink / raw)
  To: emacs-devel

>>> "Dmitry" == Dmitry Gutov <dgutov@yandex.ru> writes:

   > On 10/18/2015 10:01 AM, Uwe Brauer wrote:
   >> Right now I use
   >> 
   >> (defadvice change-log-find-file (before savebury activate)
   >> "Save and kill the buffer before turning to source."
   >> (save-buffer 1)
   >> (kill-this-buffer))

   > Have you tried using quit-window instead of this command?

I tried it out for a few days, it does not save the buffer and that is
annoying. The Xemacs command I mentioned does it.

Me defadvice solution works, but a message pops up

No such file or directory: nil

But it seems harmless.




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

* Re: feature proposal: change-log-exit: save change-log buffer and bury it.
  2015-10-20  7:52         ` Uwe Brauer
@ 2015-10-20  8:36           ` Dmitry Gutov
  0 siblings, 0 replies; 10+ messages in thread
From: Dmitry Gutov @ 2015-10-20  8:36 UTC (permalink / raw)
  To: emacs-devel

On 10/20/2015 10:52 AM, Uwe Brauer wrote:

> I tried it out for a few days, it does not save the buffer and that is
> annoying. The Xemacs command I mentioned does it.

You could define a save-buffer-and-quit command, then. I think `quit' 
might be better than `change-log-find-file' here, because you don't have 
to care about the cursor position.



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

end of thread, other threads:[~2015-10-20  8:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-15  6:43 feature proposal: change-log-exit: save change-log buffer and bury it Uwe Brauer
2015-10-15 11:11 ` Dmitry Gutov
2015-10-15 15:46   ` Eli Zaretskii
2015-10-15 15:50     ` Kaushal Modi
2015-10-15 15:52       ` Kaushal Modi
2015-10-18  7:01     ` Uwe Brauer
2015-10-18  9:43       ` Dmitry Gutov
2015-10-18 10:13         ` Uwe Brauer
2015-10-20  7:52         ` Uwe Brauer
2015-10-20  8:36           ` Dmitry Gutov

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.