emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r105121: * mh-compat.el (mh-pop-to-bu


From: Bill Wohler
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105121: * mh-compat.el (mh-pop-to-buffer-same-window): Add compatibility
Date: Mon, 11 Jul 2011 21:40:16 -0700
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105121
committer: Bill Wohler <address@hidden>
branch nick: trunk
timestamp: Mon 2011-07-11 21:40:16 -0700
message:
  * mh-compat.el (mh-pop-to-buffer-same-window): Add compatibility
  function to call switch-to-buffer on systems that lack
  pop-to-buffer-same-window.
  * mh-folder.el (mh-inc-folder, mh-modify, mh-scan-folder)
  (mh-make-folder): Call mh-pop-to-buffer-same-window instead of
  switch-to-buffer. The previous change which used pop-to-buffer
  produced the wrong behavior.
modified:
  lisp/mh-e/ChangeLog
  lisp/mh-e/mh-compat.el
  lisp/mh-e/mh-folder.el
=== modified file 'lisp/mh-e/ChangeLog'
--- a/lisp/mh-e/ChangeLog       2011-07-12 03:25:46 +0000
+++ b/lisp/mh-e/ChangeLog       2011-07-12 04:40:16 +0000
@@ -1,3 +1,13 @@
+2011-07-12  Bill Wohler  <address@hidden>
+
+       * mh-compat.el (mh-pop-to-buffer-same-window): Add compatibility
+       function to call switch-to-buffer on systems that lack
+       pop-to-buffer-same-window.
+       * mh-folder.el (mh-inc-folder, mh-modify, mh-scan-folder)
+       (mh-make-folder): Call mh-pop-to-buffer-same-window instead of
+       switch-to-buffer. The previous change which used pop-to-buffer
+       produced the wrong behavior.
+
 2011-07-12  Henrique Martins  <address@hidden>   (tiny change)
 
        * mh-xface.el (mh-picon-get-image): Remove quote from block

=== modified file 'lisp/mh-e/mh-compat.el'
--- a/lisp/mh-e/mh-compat.el    2011-07-04 00:27:22 +0000
+++ b/lisp/mh-e/mh-compat.el    2011-07-12 04:40:16 +0000
@@ -122,16 +122,6 @@
   "XEmacs does not have `font-lock-add-keywords'.
 This function returns nil on that system.")
 
-(defun-mh mh-window-full-height-p
-  window-full-height-p (&optional WINDOW)
-  "Return non-nil if WINDOW is not the result of a vertical split.
-This function is defined in XEmacs as it lacks
-`window-full-height-p'. The values of the functions
-`window-height' and `frame-height' are compared instead. The
-argument WINDOW is ignored."
-  (= (1+ (window-height))
-     (frame-height)))
-
 (defun-mh mh-image-load-path-for-library
   image-load-path-for-library (library image &optional path no-error)
   "Return a suitable search path for images used by LIBRARY.
@@ -261,6 +251,18 @@
   (buffer-substring-no-properties
    (match-beginning num) (match-end num)))
 
+(defun-mh mh-pop-to-buffer-same-window
+  pop-to-buffer-same-window (&optional buffer-or-name norecord label)
+  "Pop to buffer specified by BUFFER-OR-NAME in the selected window.
+Another window will be used only if the buffer can't be shown in
+the selected window, usually because it is dedicated to another
+buffer. Optional arguments BUFFER-OR-NAME, NORECORD and LABEL are
+as for `pop-to-buffer'. This macro is used by Emacs versions that
+lack the `pop-to-buffer-same-window' function, introduced in
+Emacs 24. The function `switch-to-buffer' is used instead and
+LABEL is ignored."
+  (switch-to-buffer buffer-or-name norecord))
+
 (defun-mh mh-replace-regexp-in-string replace-regexp-in-string
   (regexp rep string &optional fixedcase literal subexp start)
   "Replace REGEXP with REP everywhere in STRING and return result.
@@ -312,6 +314,16 @@
   (if exit-action nil)
   (view-mode 1))
 
+(defun-mh mh-window-full-height-p
+  window-full-height-p (&optional WINDOW)
+  "Return non-nil if WINDOW is not the result of a vertical split.
+This function is defined in XEmacs as it lacks
+`window-full-height-p'. The values of the functions
+`window-height' and `frame-height' are compared instead. The
+argument WINDOW is ignored."
+  (= (1+ (window-height))
+     (frame-height)))
+
 (defmacro mh-write-file-functions ()
   "Return `write-file-functions' if it exists.
 Otherwise return `local-write-file-hooks'.

=== modified file 'lisp/mh-e/mh-folder.el'
--- a/lisp/mh-e/mh-folder.el    2011-07-10 16:23:40 +0000
+++ b/lisp/mh-e/mh-folder.el    2011-07-12 04:40:16 +0000
@@ -795,7 +795,7 @@
              (setq threading-needed-flag mh-show-threads-flag)
              (setq mh-previous-window-config config))
             ((not (eq (current-buffer) (get-buffer folder)))
-             (pop-to-buffer folder)
+             (mh-pop-to-buffer-same-window folder)
              (setq mh-previous-window-config config))))
     (mh-get-new-mail file)
     (when (and threading-needed-flag
@@ -855,7 +855,7 @@
 
     ;; Just show the edit buffer...
     (delete-other-windows)
-    (pop-to-buffer edit-buffer)))
+    (mh-pop-to-buffer-same-window edit-buffer)))
 
 ;;;###mh-autoload
 (defun mh-next-button (&optional backward-flag)
@@ -1705,7 +1705,7 @@
          (unless dont-exec-pending
            (mh-process-or-undo-commands folder)
            (mh-reset-threads-and-narrowing))
-         (pop-to-buffer folder)))
+         (mh-pop-to-buffer-same-window folder)))
   (mh-regenerate-headers range)
   (if (zerop (buffer-size))
       (if (equal range "all")
@@ -1786,7 +1786,7 @@
 (defun mh-make-folder (name)
   "Create a new mail folder called NAME.
 Make it the current folder."
-  (pop-to-buffer name)
+  (mh-pop-to-buffer-same-window name)
   (setq buffer-read-only nil)
   (erase-buffer)
   (if mh-adaptive-cmd-note-flag


reply via email to

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