aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorBill Wohler2011-07-11 21:40:16 -0700
committerBill Wohler2011-07-11 21:40:16 -0700
commit93d4ce1e19dd390cbf6b8e0e49e0f7eface5f279 (patch)
tree7fb2bfea35d8c3746b0788599bb08f22c4b301d4 /lisp
parent644509873286e39a24207d47fea38bd11d1d6386 (diff)
downloademacs-93d4ce1e19dd390cbf6b8e0e49e0f7eface5f279.tar.gz
emacs-93d4ce1e19dd390cbf6b8e0e49e0f7eface5f279.zip
* 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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mh-e/ChangeLog10
-rw-r--r--lisp/mh-e/mh-compat.el32
-rw-r--r--lisp/mh-e/mh-folder.el8
3 files changed, 36 insertions, 14 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index d6ee6329ae7..1ee4867fde6 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,13 @@
12011-07-12 Bill Wohler <wohler@newt.com>
2
3 * mh-compat.el (mh-pop-to-buffer-same-window): Add compatibility
4 function to call switch-to-buffer on systems that lack
5 pop-to-buffer-same-window.
6 * mh-folder.el (mh-inc-folder, mh-modify, mh-scan-folder)
7 (mh-make-folder): Call mh-pop-to-buffer-same-window instead of
8 switch-to-buffer. The previous change which used pop-to-buffer
9 produced the wrong behavior.
10
12011-07-12 Henrique Martins <henrique@martins.cc> (tiny change) 112011-07-12 Henrique Martins <henrique@martins.cc> (tiny change)
2 12
3 * mh-xface.el (mh-picon-get-image): Remove quote from block 13 * mh-xface.el (mh-picon-get-image): Remove quote from block
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index ae2cbff408f..16dfe05b094 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -122,16 +122,6 @@ introduced in Emacs 22."
122 "XEmacs does not have `font-lock-add-keywords'. 122 "XEmacs does not have `font-lock-add-keywords'.
123This function returns nil on that system.") 123This function returns nil on that system.")
124 124
125(defun-mh mh-window-full-height-p
126 window-full-height-p (&optional WINDOW)
127 "Return non-nil if WINDOW is not the result of a vertical split.
128This function is defined in XEmacs as it lacks
129`window-full-height-p'. The values of the functions
130`window-height' and `frame-height' are compared instead. The
131argument WINDOW is ignored."
132 (= (1+ (window-height))
133 (frame-height)))
134
135(defun-mh mh-image-load-path-for-library 125(defun-mh mh-image-load-path-for-library
136 image-load-path-for-library (library image &optional path no-error) 126 image-load-path-for-library (library image &optional path no-error)
137 "Return a suitable search path for images used by LIBRARY. 127 "Return a suitable search path for images used by LIBRARY.
@@ -261,6 +251,18 @@ The argument STRING is ignored."
261 (buffer-substring-no-properties 251 (buffer-substring-no-properties
262 (match-beginning num) (match-end num))) 252 (match-beginning num) (match-end num)))
263 253
254(defun-mh mh-pop-to-buffer-same-window
255 pop-to-buffer-same-window (&optional buffer-or-name norecord label)
256 "Pop to buffer specified by BUFFER-OR-NAME in the selected window.
257Another window will be used only if the buffer can't be shown in
258the selected window, usually because it is dedicated to another
259buffer. Optional arguments BUFFER-OR-NAME, NORECORD and LABEL are
260as for `pop-to-buffer'. This macro is used by Emacs versions that
261lack the `pop-to-buffer-same-window' function, introduced in
262Emacs 24. The function `switch-to-buffer' is used instead and
263LABEL is ignored."
264 (switch-to-buffer buffer-or-name norecord))
265
264(defun-mh mh-replace-regexp-in-string replace-regexp-in-string 266(defun-mh mh-replace-regexp-in-string replace-regexp-in-string
265 (regexp rep string &optional fixedcase literal subexp start) 267 (regexp rep string &optional fixedcase literal subexp start)
266 "Replace REGEXP with REP everywhere in STRING and return result. 268 "Replace REGEXP with REP everywhere in STRING and return result.
@@ -312,6 +314,16 @@ The arguments RETURN-TO and EXIT-ACTION are ignored."
312 (if exit-action nil) 314 (if exit-action nil)
313 (view-mode 1)) 315 (view-mode 1))
314 316
317(defun-mh mh-window-full-height-p
318 window-full-height-p (&optional WINDOW)
319 "Return non-nil if WINDOW is not the result of a vertical split.
320This function is defined in XEmacs as it lacks
321`window-full-height-p'. The values of the functions
322`window-height' and `frame-height' are compared instead. The
323argument WINDOW is ignored."
324 (= (1+ (window-height))
325 (frame-height)))
326
315(defmacro mh-write-file-functions () 327(defmacro mh-write-file-functions ()
316 "Return `write-file-functions' if it exists. 328 "Return `write-file-functions' if it exists.
317Otherwise return `local-write-file-hooks'. 329Otherwise return `local-write-file-hooks'.
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el
index 2248221664b..1d9a79d0deb 100644
--- a/lisp/mh-e/mh-folder.el
+++ b/lisp/mh-e/mh-folder.el
@@ -795,7 +795,7 @@ instead."
795 (setq threading-needed-flag mh-show-threads-flag) 795 (setq threading-needed-flag mh-show-threads-flag)
796 (setq mh-previous-window-config config)) 796 (setq mh-previous-window-config config))
797 ((not (eq (current-buffer) (get-buffer folder))) 797 ((not (eq (current-buffer) (get-buffer folder)))
798 (pop-to-buffer folder) 798 (mh-pop-to-buffer-same-window folder)
799 (setq mh-previous-window-config config)))) 799 (setq mh-previous-window-config config))))
800 (mh-get-new-mail file) 800 (mh-get-new-mail file)
801 (when (and threading-needed-flag 801 (when (and threading-needed-flag
@@ -855,7 +855,7 @@ From a program, edit MESSAGE; nil means edit current message."
855 855
856 ;; Just show the edit buffer... 856 ;; Just show the edit buffer...
857 (delete-other-windows) 857 (delete-other-windows)
858 (pop-to-buffer edit-buffer))) 858 (mh-pop-to-buffer-same-window edit-buffer)))
859 859
860;;;###mh-autoload 860;;;###mh-autoload
861(defun mh-next-button (&optional backward-flag) 861(defun mh-next-button (&optional backward-flag)
@@ -1705,7 +1705,7 @@ DONT-EXEC-PENDING is non-nil."
1705 (unless dont-exec-pending 1705 (unless dont-exec-pending
1706 (mh-process-or-undo-commands folder) 1706 (mh-process-or-undo-commands folder)
1707 (mh-reset-threads-and-narrowing)) 1707 (mh-reset-threads-and-narrowing))
1708 (pop-to-buffer folder))) 1708 (mh-pop-to-buffer-same-window folder)))
1709 (mh-regenerate-headers range) 1709 (mh-regenerate-headers range)
1710 (if (zerop (buffer-size)) 1710 (if (zerop (buffer-size))
1711 (if (equal range "all") 1711 (if (equal range "all")
@@ -1786,7 +1786,7 @@ Also removes all content from the folder buffer."
1786(defun mh-make-folder (name) 1786(defun mh-make-folder (name)
1787 "Create a new mail folder called NAME. 1787 "Create a new mail folder called NAME.
1788Make it the current folder." 1788Make it the current folder."
1789 (pop-to-buffer name) 1789 (mh-pop-to-buffer-same-window name)
1790 (setq buffer-read-only nil) 1790 (setq buffer-read-only nil)
1791 (erase-buffer) 1791 (erase-buffer)
1792 (if mh-adaptive-cmd-note-flag 1792 (if mh-adaptive-cmd-note-flag