all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Toru Tsuneyoshi" <tune@bg.wakwak.com>
Subject: improving function "mode-line-unbury-buffer" in bindings.el
Date: Fri, 12 Jul 2002 10:35:00 +0900 (JST)	[thread overview]
Message-ID: <20020712.103500.40922275.tune@bg.wakwak.com> (raw)

[-- Attachment #1: Type: Text/Plain, Size: 539 bytes --]


Hello!!

This is the first report for me.
This report is not bug but improving as giving a subject.

I made files "bindings.el.diff", "ChangeLog", and "report.txt", which
are attached files. Please check them.

Addition:

(emacs-version)
	=> "GNU Emacs 21.2.1 (i386-msvc-nt5.0.2195) of 2002-07-12 on localhost"

File "bindings.el.diff" is made, and is tested on this emacs version.

Improved function "mode-line-unbury-buffer" operate more precisely as
`unbury-buffer' symmetrically with `bury-buffer'.

--
Toru Tsuneyoshi
(Tokyo, Japan)

[-- Attachment #2: bindings.el.diff --]
[-- Type: Text/Plain, Size: 1573 bytes --]

*** bindings.el.orig	Mon Jul  1 15:25:12 2002
--- bindings.el	Fri Jul 12 00:20:49 2002
***************
*** 262,271 ****
    (interactive "e")
    (save-selected-window
      (select-window (posn-window (event-start event)))
!     (let ((list (reverse (buffer-list))))
!       (while (eq (aref (buffer-name (car list)) 0) ? )
! 	(setq list (cdr list)))
!       (switch-to-buffer (car list)))))
  
  (defun mode-line-bury-buffer (event) "\
  Like bury-buffer, but temporarily select EVENT's window."
--- 262,286 ----
    (interactive "e")
    (save-selected-window
      (select-window (posn-window (event-start event)))
!     (let ((cur-buffer-name (buffer-name (current-buffer)))
! 	  (cur-buffer-list (mapcar (function buffer-name) (buffer-list)))
! 	  selected-buffer-name)
!       ;; Reverse buffer-list.
!       (mapcar
!        (function bury-buffer)
!        (reverse cur-buffer-list))
!       ;; Select the most likely candidate  for `other-buffer' to return.
!       (setq selected-buffer-name (buffer-name (other-buffer)))
!       (if (string= selected-buffer-name cur-buffer-name)
! 	  (setq selected-buffer-name "*scratch*"))
!       ;; Select buffer of selected-buffer-name in the current window.
!       (switch-to-buffer selected-buffer-name)
!       ;; Return to the original state (except a head) of buffer-list.
!       (delete selected-buffer-name cur-buffer-list)
!       (mapcar
!        (function bury-buffer)
!        cur-buffer-list)))
!   nil)
  
  (defun mode-line-bury-buffer (event) "\
  Like bury-buffer, but temporarily select EVENT's window."

[-- Attachment #3: ChangeLog --]
[-- Type: Text/Plain, Size: 172 bytes --]

2002-07-12  Toru Tsuneyoshi  <tune@bg.wakwak.com>

	* bindings.el (mode-line-unbury-buffer): Improve so that this
	function may operate more precisely as `unbury-buffer'.


[-- Attachment #4: report.txt --]
[-- Type: Text/Plain, Size: 1773 bytes --]

-*- mode: outline; outline-regexp: "\t*[*]+"; tab-width: 8 -*-

* spec of function "bury-buffer" called by "mode-line-bury-buffer"

	* example 1

		current-buffer
		  |
		  V
		("A" "B" "C" "D" "E")	: (buffer-name of) buffer-list

			 |
			 | bury-buffer <f>
			 V
		
		("B" "C" "D" "E" "A")

	* example 2

		("A")

			 |
			 | bury-buffer <f>
			 V
		
		("*scratch*" "A")	: "*scratch*" is made

	* example 3

				not displayed yet
				   |
				   V
		("A" "*scratch*" "*Messages*")

			 |
			 | bury-buffer <f>
			 V
		
		("*scratch*" "*Messages*" "A")

			 |
			 | bury-buffer <f>
			 V

		("A" "*Messages*" "*scratch*")	: "*Messages*" isn't displayed

* spec of original function "mode-line-unbury-buffer"

	* example 1

		("A" "B" "C" "D" "E")

			 |
			 | mode-line-unbury-buffer <f>
			 V
		
		("E" "A" "B" "C" "D")

	* example 2

		("A")

			 |
			 | mode-line-unbury-buffer <f>
			 V
		
		("A")			: "*scratch*" isn't made

	* example 3

				not displayed yet
				   |
				   V
		("A" "*scratch*" "*Messages*")

			 |
			 | mode-line-unbury-buffer <f>
			 V
		
		("*Messages*" "A" "*scratch*")	: "*Messages*" is displayed

			 |
			 | mode-line-unbury-buffer <f>
			 V

		("*scratch*" "*Messages*" "A")

* spec of fixed function "mode-line-unbury-buffer"

	* example 1

		("A" "B" "C" "D" "E")

			 |
			 | mode-line-unbury-buffer <f>
			 V
		
		("E" "A" "B" "C" "D")

	* example 2

		("A")

			 |
			 | mode-line-unbury-buffer <f>
			 V
		
		("*scratch*" "A")	: "*scratch*" is made

	* example 3

				not displayed yet
				   |
				   V
		("A" "*scratch*" "*Messages*")

			 |
			 | mode-line-unbury-buffer <f>
			 V
		
		("*scratch*" "A" "*Messages*")

			 |
			 | mode-line-unbury-buffer <f>
			 V

		("A" "*scratch*" "*Messages*")	: "*Messages*" isn't displayed

             reply	other threads:[~2002-07-12  1:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-12  1:35 Toru Tsuneyoshi [this message]
2002-07-14 15:22 ` improving function "mode-line-unbury-buffer" in bindings.el Richard Stallman
2002-07-14 17:13   ` Toru Tsuneyoshi
2002-07-16 13:29     ` Richard Stallman
2002-07-16 15:08       ` Kim F. Storm
2002-07-18 14:56         ` Richard Stallman
2002-07-18 16:04           ` Kim F. Storm
2002-07-20 10:38           ` Toru Tsuneyoshi
2002-07-21 20:14             ` Richard Stallman

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=20020712.103500.40922275.tune@bg.wakwak.com \
    --to=tune@bg.wakwak.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 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.