all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-devel@gnu.org
Subject: Re: feature proposal: change-log-exit: save change-log buffer and	bury it.
Date: Sun, 18 Oct 2015 10:01:18 +0300	[thread overview]
Message-ID: <87k2qkoe2p.fsf@mat.ucm.es> (raw)
In-Reply-To: 83mvvk879j.fsf@gnu.org



   > 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")))))






  parent reply	other threads:[~2015-10-18  7:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=87k2qkoe2p.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=emacs-devel@gnu.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.