aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJoakim Verona2011-09-05 10:37:16 +0200
committerJoakim Verona2011-09-05 10:37:16 +0200
commit687faaf59cdf4029b5e8da16965b257592059e37 (patch)
treec19fc758dc421ec1e6619de88d7cd70258927b47 /lisp
parentd47f8c5baeaa804548a73675077c8e37cdfe5142 (diff)
parentf62bd846552a090f3ba5e136d6d9cdb4c07ed7be (diff)
downloademacs-687faaf59cdf4029b5e8da16965b257592059e37.tar.gz
emacs-687faaf59cdf4029b5e8da16965b257592059e37.zip
upstream
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog91
-rw-r--r--lisp/abbrev.el2
-rw-r--r--lisp/arc-mode.el2
-rw-r--r--lisp/autoinsert.el2
-rw-r--r--lisp/bookmark.el2
-rw-r--r--lisp/files.el9
-rw-r--r--lisp/gnus/ChangeLog23
-rw-r--r--lisp/gnus/gnus-art.el4
-rw-r--r--lisp/gnus/gnus-score.el14
-rw-r--r--lisp/gnus/gnus-spec.el58
-rw-r--r--lisp/gnus/gnus.el7
-rw-r--r--lisp/gnus/message.el4
-rw-r--r--lisp/gnus/nnimap.el3
-rw-r--r--lisp/help.el2
-rw-r--r--lisp/mail/rmail.el2
-rw-r--r--lisp/mail/rmailmm.el4
-rw-r--r--lisp/mail/sendmail.el90
-rw-r--r--lisp/mail/smtpmail.el2
-rw-r--r--lisp/net/rcirc.el22
-rw-r--r--lisp/net/tramp-sh.el172
-rw-r--r--lisp/net/tramp.el94
-rw-r--r--lisp/org/ChangeLog26
-rw-r--r--lisp/org/ob-ref.el4
-rw-r--r--lisp/org/org-agenda.el8
-rw-r--r--lisp/org/org-capture.el6
-rw-r--r--lisp/org/org-clock.el3
-rw-r--r--lisp/org/org-compat.el9
-rw-r--r--lisp/org/org-ctags.el4
-rw-r--r--lisp/org/org-exp.el4
-rw-r--r--lisp/org/org-feed.el2
-rw-r--r--lisp/org/org-html.el4
-rw-r--r--lisp/org/org-id.el4
-rw-r--r--lisp/org/org-irc.el8
-rw-r--r--lisp/org/org-mobile.el5
-rw-r--r--lisp/org/org-publish.el6
-rw-r--r--lisp/org/org-remember.el4
-rw-r--r--lisp/org/org-src.el12
-rw-r--r--lisp/org/org.el25
-rw-r--r--lisp/progmodes/compile.el2
-rw-r--r--lisp/progmodes/grep.el9
-rw-r--r--lisp/progmodes/python.el12
-rw-r--r--lisp/subr.el2
-rw-r--r--lisp/textmodes/bibtex.el2
-rw-r--r--lisp/vc/vc-rcs.el5
-rw-r--r--lisp/view.el2
-rw-r--r--lisp/window.el145
46 files changed, 546 insertions, 376 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7ea1dffe1c2..d30010d6016 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,94 @@
12011-09-05 Juri Linkov <juri@jurta.org>
2
3 * progmodes/grep.el (grep-filter): Avoid incomplete processing by
4 keeping point where processing of grep matches begins, and
5 continue to delete remaining escape sequences from the same point.
6 (grep-filter): Make leading zero optional in "0?1;31m" because
7 git-grep emits "\033[1;31m" escape sequences unlike expected
8 "\033[01;31m" as GNU Grep does (bug#9408).
9 (grep-process-setup): Replace obsolete "ml=" with newer "sl=".
10
112011-09-05 Juri Linkov <juri@jurta.org>
12
13 * subr.el (y-or-n-p): Capitalize "yes".
14
152011-09-04 Michael Albinus <michael.albinus@gmx.de>
16
17 * net/tramp.el (top): Require 'shell. Use `tramp-unload-hook' but
18 `tramp-cache-unload-hook' where appropriate.
19 (tramp-methods): Rename `tramp-remote-sh' to
20 `tramp-remote-shell'. Add `tramp-remote-shell-args'.
21 (tramp-handle-shell-command): New defun, moved from tramp-sh.el.
22
23 * net/tramp-sh.el (top): Don't require 'shell.
24 (tramp-methods): Add `tramp-remote-shell' and
25 `tramp-remote-shell-args' entries.
26 (tramp-sh-file-name-handler-alist): Use `tramp-handle-shell-command'.
27 (tramp-sh-handle-shell-command): Remove.
28 (tramp-find-shell, tramp-open-connection-setup-interactive-shell):
29 Use `tramp-remote-shell'.
30
312011-09-03 Chong Yidong <cyd@stupidchicken.com>
32
33 * mail/sendmail.el (sendmail-query-once-function): Deleted.
34 (sendmail-query-once): Save directly to send-mail-function.
35 Update message-send-mail-function too.
36
37 * mail/smtpmail.el (smtpmail-try-auth-methods): Clarify prompt.
38
392011-09-03 Christoph Scholtes <cschol2112@googlemail.com>
40
41 * progmodes/python.el (python-mode-map): Use correct function to
42 start python interpreter from menu-bar (as reported by Geert
43 Kloosterman).
44 (inferior-python-mode-map): Fix typo.
45 (python-shell-map): Removed.
46
472011-09-03 Deniz Dogan <deniz@dogan.se>
48
49 * net/rcirc.el (rcirc-print): Simplify code for
50 rcirc-scroll-show-maximum-output. There is no need to walk
51 through all windows to find the right one.
52
532011-09-03 Christoph Scholtes <cschol2112@googlemail.com>
54
55 * help.el (help-return-method): Doc fix.
56
572011-09-03 Martin Rudalics <rudalics@gmx.at>
58
59 * window.el (window-deletable-p): Don't return a non-nil value
60 when there's a buffer that was shown in the window before.
61 (Bug#9419)
62 (display-buffer-pop-up-frame, display-buffer-pop-up-window): Set
63 window's previous buffers to nil.
64
652011-09-03 Eli Zaretskii <eliz@gnu.org>
66
67 * mail/rmailmm.el (rmail-mime-insert-tagline): Insert an extra
68 newline before and after the tag line, so it doesn't interfere
69 with determining the paragraph direction of bidirectional text.
70
712011-09-03 Leo Liu <sdl.web@gmail.com>
72
73 * files.el (find-file-not-true-dirname-list): Remove. (Bug#9422)
74
752011-09-02 Chong Yidong <cyd@stupidchicken.com>
76
77 * window.el (pop-to-buffer-1, pop-to-buffer-same-window): Deleted.
78 (pop-to-buffer): Change interactive spec. Pass second argument
79 directly to display-buffer.
80 (display-buffer): Fix interactive spec. Use functionp to
81 distinguish between a function and a list of functions.
82
83 * abbrev.el (edit-abbrevs):
84 * arc-mode.el (archive-extract):
85 * autoinsert.el (auto-insert):
86 * bookmark.el (bookmark-bmenu-list):
87 * files.el (find-file):
88 * view.el (view-buffer):
89 * progmodes/compile.el (compilation-goto-locus):
90 * textmodes/bibtex.el (bibtex-initialize): Use switch-to-buffer.
91
12011-09-02 Chong Yidong <cyd@stupidchicken.com> 922011-09-02 Chong Yidong <cyd@stupidchicken.com>
2 93
3 * window.el (display-buffer-alist): Doc fix. 94 * window.el (display-buffer-alist): Doc fix.
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 3795dd46010..5a7a741a3a6 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -159,7 +159,7 @@ where NAME and EXPANSION are strings with quotes,
159USECOUNT is an integer, and HOOK is any valid function 159USECOUNT is an integer, and HOOK is any valid function
160or may be omitted (it is usually omitted)." 160or may be omitted (it is usually omitted)."
161 (interactive) 161 (interactive)
162 (pop-to-buffer-same-window (prepare-abbrev-list-buffer))) 162 (switch-to-buffer (prepare-abbrev-list-buffer)))
163 163
164(defun edit-abbrevs-redefine () 164(defun edit-abbrevs-redefine ()
165 "Redefine abbrevs according to current buffer contents." 165 "Redefine abbrevs according to current buffer contents."
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index ea875b9989d..e3d1955ded5 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -1083,7 +1083,7 @@ using `make-temp-file', and the generated name is returned."
1083 (view-buffer buffer (and just-created 'kill-buffer-if-not-modified))) 1083 (view-buffer buffer (and just-created 'kill-buffer-if-not-modified)))
1084 ((eq other-window-p 'display) (display-buffer buffer)) 1084 ((eq other-window-p 'display) (display-buffer buffer))
1085 (other-window-p (switch-to-buffer-other-window buffer)) 1085 (other-window-p (switch-to-buffer-other-window buffer))
1086 (t (pop-to-buffer-same-window buffer)))))) 1086 (t (switch-to-buffer buffer))))))
1087 1087
1088(defun archive-*-extract (archive name command) 1088(defun archive-*-extract (archive name command)
1089 (let* ((default-directory (file-name-as-directory archive-tmpdir)) 1089 (let* ((default-directory (file-name-as-directory archive-tmpdir))
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el
index 3b849cece22..5793c3180be 100644
--- a/lisp/autoinsert.el
+++ b/lisp/autoinsert.el
@@ -360,7 +360,7 @@ Matches the visited file name against the elements of `auto-insert-alist'."
360 (save-window-excursion 360 (save-window-excursion
361 ;; make buffer visible before skeleton or function 361 ;; make buffer visible before skeleton or function
362 ;; which might ask the user for something 362 ;; which might ask the user for something
363 (pop-to-buffer-same-window (current-buffer)) 363 (switch-to-buffer (current-buffer))
364 (if (and (consp action) 364 (if (and (consp action)
365 (not (eq (car action) 'lambda))) 365 (not (eq (car action) 'lambda)))
366 (skeleton-insert action) 366 (skeleton-insert action)
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index bb7ad153e8b..51e869e3a21 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1539,7 +1539,7 @@ deletion, or > if it is flagged for displaying."
1539 (bookmark-maybe-load-default-file) 1539 (bookmark-maybe-load-default-file)
1540 (let ((buf (get-buffer-create "*Bookmark List*"))) 1540 (let ((buf (get-buffer-create "*Bookmark List*")))
1541 (if (called-interactively-p 'interactive) 1541 (if (called-interactively-p 'interactive)
1542 (pop-to-buffer-same-window buf) 1542 (switch-to-buffer buf)
1543 (set-buffer buf))) 1543 (set-buffer buf)))
1544 (let ((inhibit-read-only t)) 1544 (let ((inhibit-read-only t))
1545 (erase-buffer) 1545 (erase-buffer)
diff --git a/lisp/files.el b/lisp/files.el
index 07188e152b3..a0f55517546 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1342,8 +1342,8 @@ automatically choosing a major mode, use \\[find-file-literally]."
1342 (confirm-nonexistent-file-or-buffer))) 1342 (confirm-nonexistent-file-or-buffer)))
1343 (let ((value (find-file-noselect filename nil nil wildcards))) 1343 (let ((value (find-file-noselect filename nil nil wildcards)))
1344 (if (listp value) 1344 (if (listp value)
1345 (mapcar #'pop-to-buffer-same-window (nreverse value)) 1345 (mapcar 'switch-to-buffer (nreverse value))
1346 (pop-to-buffer-same-window value)))) 1346 (switch-to-buffer value))))
1347 1347
1348(defun find-file-other-window (filename &optional wildcards) 1348(defun find-file-other-window (filename &optional wildcards)
1349 "Edit file FILENAME, in another window. 1349 "Edit file FILENAME, in another window.
@@ -1639,11 +1639,6 @@ home directory is a root directory) and removes automounter prefixes
1639 (substring filename (match-end 0))))) 1639 (substring filename (match-end 0)))))
1640 filename))) 1640 filename)))
1641 1641
1642(defcustom find-file-not-true-dirname-list nil
1643 "List of logical names for which visiting shouldn't save the true dirname."
1644 :type '(repeat (string :tag "Name"))
1645 :group 'find-file)
1646
1647(defun find-buffer-visiting (filename &optional predicate) 1642(defun find-buffer-visiting (filename &optional predicate)
1648 "Return the buffer visiting file FILENAME (a string). 1643 "Return the buffer visiting file FILENAME (a string).
1649This is like `get-file-buffer', except that it checks for any buffer 1644This is like `get-file-buffer', except that it checks for any buffer
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 8646f687420..9d719136cc1 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,26 @@
12011-09-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * gnus.el (gnus-home-directory): Add warning about setting in .gnus.el
4 (bug#9405).
5
6 * gnus-score.el (gnus-summary-increase-score): Doc clarification
7 (bug#9421).
8
9 * gnus-spec.el (gnus-face-0): Make all the face specs into defcustoms
10 (bug#9425).
11
12 * gnus-art.el (gnus-treatment-function-alist): Remove CRs as the first
13 thing (bug#9426).
14
152011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16
17 * nnimap.el (nnimap-open-connection-1): Use the correct port number in
18 the error message.
19
202011-09-02 Eli Zaretskii <eliz@gnu.org>
21
22 * message.el (message-setup-1): Return t (Bug#9392).
23
12011-09-01 Andrew Cohen <cohen@andy.bu.edu> 242011-09-01 Andrew Cohen <cohen@andy.bu.edu>
2 25
3 * gnus-sum.el: When adding article headers to a summary buffer also 26 * gnus-sum.el: When adding article headers to a summary buffer also
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index eaf0ed52f51..9d962fc6d99 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -1657,14 +1657,14 @@ regexp."
1657 1657
1658(defvar gnus-article-mime-handle-alist-1 nil) 1658(defvar gnus-article-mime-handle-alist-1 nil)
1659(defvar gnus-treatment-function-alist 1659(defvar gnus-treatment-function-alist
1660 '((gnus-treat-x-pgp-sig gnus-article-verify-x-pgp-sig) 1660 '((gnus-treat-strip-cr gnus-article-remove-cr)
1661 (gnus-treat-x-pgp-sig gnus-article-verify-x-pgp-sig)
1661 (gnus-treat-strip-banner gnus-article-strip-banner) 1662 (gnus-treat-strip-banner gnus-article-strip-banner)
1662 (gnus-treat-strip-headers-in-body gnus-article-strip-headers-in-body) 1663 (gnus-treat-strip-headers-in-body gnus-article-strip-headers-in-body)
1663 (gnus-treat-highlight-signature gnus-article-highlight-signature) 1664 (gnus-treat-highlight-signature gnus-article-highlight-signature)
1664 (gnus-treat-buttonize gnus-article-add-buttons) 1665 (gnus-treat-buttonize gnus-article-add-buttons)
1665 (gnus-treat-fill-article gnus-article-fill-cited-article) 1666 (gnus-treat-fill-article gnus-article-fill-cited-article)
1666 (gnus-treat-fill-long-lines gnus-article-fill-cited-long-lines) 1667 (gnus-treat-fill-long-lines gnus-article-fill-cited-long-lines)
1667 (gnus-treat-strip-cr gnus-article-remove-cr)
1668 (gnus-treat-unsplit-urls gnus-article-unsplit-urls) 1668 (gnus-treat-unsplit-urls gnus-article-unsplit-urls)
1669 (gnus-treat-display-x-face gnus-article-display-x-face) 1669 (gnus-treat-display-x-face gnus-article-display-x-face)
1670 (gnus-treat-display-face gnus-article-display-face) 1670 (gnus-treat-display-face gnus-article-display-face)
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index eb7234a811e..d8e424eacc8 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -522,9 +522,10 @@ of the last successful match.")
522(defun gnus-summary-lower-score (&optional score symp) 522(defun gnus-summary-lower-score (&optional score symp)
523 "Make a score entry based on the current article. 523 "Make a score entry based on the current article.
524The user will be prompted for header to score on, match type, 524The user will be prompted for header to score on, match type,
525permanence, and the string to be used. The numerical prefix will be 525permanence, and the string to be used. The numerical prefix will
526used as score. A symbolic prefix of `a' says to use the `all.SCORE' 526be used as SCORE. A symbolic prefix of `a' (the SYMP parameter)
527file for the command instead of the current score file." 527says to use the `all.SCORE' file for the command instead of the
528current score file."
528 (interactive (gnus-interactive "P\ny")) 529 (interactive (gnus-interactive "P\ny"))
529 (gnus-summary-increase-score (- (gnus-score-delta-default score)) symp)) 530 (gnus-summary-increase-score (- (gnus-score-delta-default score)) symp))
530 531
@@ -537,9 +538,10 @@ file for the command instead of the current score file."
537(defun gnus-summary-increase-score (&optional score symp) 538(defun gnus-summary-increase-score (&optional score symp)
538 "Make a score entry based on the current article. 539 "Make a score entry based on the current article.
539The user will be prompted for header to score on, match type, 540The user will be prompted for header to score on, match type,
540permanence, and the string to be used. The numerical prefix will be 541permanence, and the string to be used. The numerical prefix will
541used as score. A symbolic prefix of `a' says to use the `all.SCORE' 542be used as SCORE. A symbolic prefix of `a' (the SYMP parameter)
542file for the command instead of the current score file." 543says to use the `all.SCORE' file for the command instead of the
544current score file."
543 (interactive (gnus-interactive "P\ny")) 545 (interactive (gnus-interactive "P\ny"))
544 (let* ((nscore (gnus-score-delta-default score)) 546 (let* ((nscore (gnus-score-delta-default score))
545 (prefix (if (< nscore 0) ?L ?I)) 547 (prefix (if (< nscore 0) ?L ?I))
diff --git a/lisp/gnus/gnus-spec.el b/lisp/gnus/gnus-spec.el
index 0fa64a84b75..31cb9864ff2 100644
--- a/lisp/gnus/gnus-spec.el
+++ b/lisp/gnus/gnus-spec.el
@@ -264,11 +264,30 @@ Return a list of updated types."
264 (push (cons 'version emacs-version) gnus-format-specs)) 264 (push (cons 'version emacs-version) gnus-format-specs))
265 updated)) 265 updated))
266 266
267(defvar gnus-mouse-face-0 'highlight) 267(defcustom gnus-mouse-face-0 'highlight
268(defvar gnus-mouse-face-1 'highlight) 268 "The \"%(hello%)\" face."
269(defvar gnus-mouse-face-2 'highlight) 269 :group 'gnus-format
270(defvar gnus-mouse-face-3 'highlight) 270 :type 'face)
271(defvar gnus-mouse-face-4 'highlight) 271
272(defcustom gnus-mouse-face-1 'highlight
273 "The \"%1(hello%)\" face."
274 :group 'gnus-format
275 :type 'face)
276
277(defcustom gnus-mouse-face-2 'highlight
278 "The \"%2(hello%)\" face."
279 :group 'gnus-format
280 :type 'face)
281
282(defcustom gnus-mouse-face-3 'highlight
283 "The \"%3(hello%)\" face."
284 :group 'gnus-format
285 :type 'face)
286
287(defcustom gnus-mouse-face-4 'highlight
288 "The \"%4(hello%)\" face."
289 :group 'gnus-format
290 :type 'face)
272 291
273(defun gnus-mouse-face-function (form type) 292(defun gnus-mouse-face-function (form type)
274 `(gnus-put-text-property 293 `(gnus-put-text-property
@@ -278,11 +297,30 @@ Return a list of updated types."
278 'gnus-mouse-face 297 'gnus-mouse-face
279 `(quote ,(symbol-value (intern (format "gnus-mouse-face-%d" type))))))) 298 `(quote ,(symbol-value (intern (format "gnus-mouse-face-%d" type)))))))
280 299
281(defvar gnus-face-0 'bold) 300(defcustom gnus-face-0 'bold
282(defvar gnus-face-1 'italic) 301 "The \"%{hello%}\" face."
283(defvar gnus-face-2 'bold-italic) 302 :group 'gnus-format
284(defvar gnus-face-3 'bold) 303 :type 'face)
285(defvar gnus-face-4 'bold) 304
305(defcustom gnus-face-1 'italic
306 "The \"%1{hello%}\" face."
307 :group 'gnus-format
308 :type 'face)
309
310(defcustom gnus-face-2 'bold-italic
311 "The \"%2{hello%}\" face."
312 :group 'gnus-format
313 :type 'face)
314
315(defcustom gnus-face-3 'bold
316 "The \"%3{hello%}\" face."
317 :group 'gnus-format
318 :type 'face)
319
320(defcustom gnus-face-4 'bold
321 "The \"%4{hello%}\" face."
322 :group 'gnus-format
323 :type 'face)
286 324
287(defun gnus-face-face-function (form type) 325(defun gnus-face-face-function (form type)
288 `(gnus-add-text-properties 326 `(gnus-add-text-properties
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index cd9b6eeb949..34759cee06f 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -1245,7 +1245,12 @@ REST is a plist of following:
1245 1245
1246(defcustom gnus-home-directory "~/" 1246(defcustom gnus-home-directory "~/"
1247 "Directory variable that specifies the \"home\" directory. 1247 "Directory variable that specifies the \"home\" directory.
1248All other Gnus file and directory variables are initialized from this variable." 1248All other Gnus file and directory variables are initialized from this variable.
1249
1250Note that Gnus is mostly loaded when the `.gnus.el' file is read.
1251This means that other directory variables that are initialized
1252from this variable won't be set properly if you set this variable
1253in `.gnus.el'. Set this variable in `.emacs' instead."
1249 :group 'gnus-files 1254 :group 'gnus-files
1250 :type 'directory) 1255 :type 'directory)
1251 1256
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 52cef1925a2..194ebf81873 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -6530,7 +6530,9 @@ are not included."
6530 (message-position-point) 6530 (message-position-point)
6531 ;; Allow correct handling of `message-checksum' in `message-yank-original': 6531 ;; Allow correct handling of `message-checksum' in `message-yank-original':
6532 (set-buffer-modified-p nil) 6532 (set-buffer-modified-p nil)
6533 (undo-boundary)) 6533 (undo-boundary)
6534 ;; rmail-start-mail expects message-mail to return t (Bug#9392)
6535 t)
6534 6536
6535(defun message-set-auto-save-file-name () 6537(defun message-set-auto-save-file-name ()
6536 "Associate the message buffer with a file in the drafts directory." 6538 "Associate the message buffer with a file in the drafts directory."
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 2dbc465f8c9..52c4b3c4290 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -350,7 +350,6 @@ textual parts.")
350 (with-current-buffer (nnimap-make-process-buffer buffer) 350 (with-current-buffer (nnimap-make-process-buffer buffer)
351 (let* ((coding-system-for-read 'binary) 351 (let* ((coding-system-for-read 'binary)
352 (coding-system-for-write 'binary) 352 (coding-system-for-write 'binary)
353 (port nil)
354 (ports 353 (ports
355 (cond 354 (cond
356 ((memq nnimap-stream '(network plain starttls)) 355 ((memq nnimap-stream '(network plain starttls))
@@ -395,7 +394,7 @@ textual parts.")
395 (if (not stream) 394 (if (not stream)
396 (progn 395 (progn
397 (nnheader-report 'nnimap "Unable to contact %s:%s via %s" 396 (nnheader-report 'nnimap "Unable to contact %s:%s via %s"
398 nnimap-address port nnimap-stream) 397 nnimap-address (car ports) nnimap-stream)
399 'no-connect) 398 'no-connect)
400 (gnus-set-process-query-on-exit-flag stream nil) 399 (gnus-set-process-query-on-exit-flag stream nil)
401 (if (not (gnus-string-match-p "[*.] \\(OK\\|PREAUTH\\)" greeting)) 400 (if (not (gnus-string-match-p "[*.] \\(OK\\|PREAUTH\\)" greeting))
diff --git a/lisp/help.el b/lisp/help.el
index 710dc34ea89..3ed6f79275a 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -132,7 +132,7 @@
132 "What to do to \"exit\" the help buffer. 132 "What to do to \"exit\" the help buffer.
133This is a list 133This is a list
134 (WINDOW . t) delete the selected window (and possibly its frame, 134 (WINDOW . t) delete the selected window (and possibly its frame,
135 see `quit-window' and `View-quit'), go to WINDOW. 135 see `quit-window'), go to WINDOW.
136 (WINDOW . quit-window) do quit-window, then select WINDOW. 136 (WINDOW . quit-window) do quit-window, then select WINDOW.
137 (WINDOW BUF START POINT) display BUF at START, POINT, then select WINDOW.") 137 (WINDOW BUF START POINT) display BUF at START, POINT, then select WINDOW.")
138 138
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 252fb112a5d..ac07f07a76b 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -4482,7 +4482,7 @@ With prefix argument N moves forward N messages with these labels.
4482 4482
4483;;;*** 4483;;;***
4484 4484
4485;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "a7d3e7205efa4e20ca9038c9b260ce83") 4485;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "2c8675d7c069c68bc36a4003b15448d1")
4486;;; Generated autoloads from rmailmm.el 4486;;; Generated autoloads from rmailmm.el
4487 4487
4488(autoload 'rmail-mime "rmailmm" "\ 4488(autoload 'rmail-mime "rmailmm" "\
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index 597068562b5..d3351255583 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -426,7 +426,7 @@ The value is a vector [ INDEX HEADER TAGLINE BODY END], where
426 "Insert a tag line for MIME-entity ENTITY. 426 "Insert a tag line for MIME-entity ENTITY.
427ITEM-LIST is a list of strings or button-elements (list) to be added 427ITEM-LIST is a list of strings or button-elements (list) to be added
428to the tag line." 428to the tag line."
429 (insert "[") 429 (insert "\n[")
430 (let ((tag (aref (rmail-mime-entity-tagline entity) 0))) 430 (let ((tag (aref (rmail-mime-entity-tagline entity) 0)))
431 (if (> (length tag) 0) (insert (substring tag 1) ":"))) 431 (if (> (length tag) 0) (insert (substring tag 1) ":")))
432 (insert (car (rmail-mime-entity-type entity)) " ") 432 (insert (car (rmail-mime-entity-type entity)) " ")
@@ -439,7 +439,7 @@ to the tag line."
439 (if (stringp item) 439 (if (stringp item)
440 (insert item) 440 (insert item)
441 (apply 'insert-button item)))) 441 (apply 'insert-button item))))
442 (insert "]\n")) 442 (insert "]\n\n"))
443 443
444(defun rmail-mime-update-tagline (entity) 444(defun rmail-mime-update-tagline (entity)
445 "Update the current tag line for MIME-entity ENTITY." 445 "Update the current tag line for MIME-entity ENTITY."
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 158435de86b..cb02a4b374d 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -156,51 +156,6 @@ This is used by the default mail-sending commands. See also
156 :version "24.1" 156 :version "24.1"
157 :group 'sendmail) 157 :group 'sendmail)
158 158
159(defvar sendmail-query-once-function 'query
160 "Either a function to send email, or the symbol `query'.")
161
162;;;###autoload
163(defun sendmail-query-once ()
164 "Send an email via `sendmail-query-once-function'.
165If `sendmail-query-once-function' is `query', ask the user what
166function to use, and then save that choice."
167 (when (equal sendmail-query-once-function 'query)
168 (let* ((mail-buffer (current-buffer))
169 (default
170 (cond
171 ((or (and window-system (eq system-type 'darwin))
172 (eq system-type 'windows-nt))
173 'mailclient-send-it)
174 ((and sendmail-program
175 (executable-find sendmail-program))
176 'sendmail-send-it)))
177 (function
178 (if (or (not default)
179 ;; We have detected no OS-level mail senders, or we
180 ;; have already configured smtpmail, so we use the
181 ;; internal SMTP service.
182 (and (boundp 'smtpmail-smtp-server)
183 smtpmail-smtp-server))
184 'smtpmail-send-it
185 ;; Query the user.
186 (unwind-protect
187 (progn
188 (pop-to-buffer "*Mail Help*")
189 (erase-buffer)
190 (insert "Sending mail from Emacs hasn't been set up yet.\n\n"
191 "Type `y' to configure outgoing SMTP, or `n' to use\n"
192 "the default mail sender on your system.\n\n"
193 "To change this again at a later date, customize the\n"
194 "`send-mail-function' variable.\n")
195 (goto-char (point-min))
196 (if (y-or-n-p "Configure outgoing SMTP in Emacs? ")
197 'smtpmail-send-it
198 default))
199 (kill-buffer (current-buffer))
200 (set-buffer mail-buffer)))))
201 (customize-save-variable 'sendmail-query-once-function function)))
202 (funcall sendmail-query-once-function))
203
204;;;###autoload 159;;;###autoload
205(defcustom mail-header-separator (purecopy "--text follows this line--") 160(defcustom mail-header-separator (purecopy "--text follows this line--")
206 "Line used to separate headers from text in messages being composed." 161 "Line used to separate headers from text in messages being composed."
@@ -543,6 +498,51 @@ by Emacs.)")
543 "Additional expressions to highlight in Mail mode.") 498 "Additional expressions to highlight in Mail mode.")
544 499
545 500
501;;;###autoload
502(defun sendmail-query-once ()
503 "Query for `send-mail-function' and send mail with it.
504This also saves the value of `send-mail-function' via Customize."
505 (let* ((mail-buffer (current-buffer))
506 ;; Compute default mail sender, preferring smtpmail if it's
507 ;; already configured.
508 (default (cond
509 ((and (boundp 'smtpmail-smtp-server)
510 smtpmail-smtp-server)
511 'smtpmail-send-it)
512 ((or (and window-system (eq system-type 'darwin))
513 (eq system-type 'windows-nt))
514 'mailclient-send-it)
515 ((and sendmail-program
516 (executable-find sendmail-program))
517 'sendmail-send-it)))
518 (send-function (if (eq default 'smtpmail-send-it)
519 'smtpmail-send-it)))
520 (unless send-function
521 ;; Query the user.
522 (with-temp-buffer
523 (rename-buffer "*Mail Help*" t)
524 (erase-buffer)
525 (insert "Emacs has not been set up for sending mail.\n
526Type `y' to configure and use Emacs as a mail client,
527or `n' to use your system's default mailer.\n
528To change your decision later, customize `send-mail-function'.\n")
529 (goto-char (point-min))
530 (display-buffer (current-buffer))
531 (if (y-or-n-p "Set up Emacs for sending SMTP mail? ")
532 ;; FIXME: We should check and correct the From: field too.
533 (setq send-function 'smtpmail-send-it)
534 (setq send-function default))))
535 (when send-function
536 (customize-save-variable 'send-mail-function send-function)
537 ;; HACK: Message mode stupidly has `message-send-mail-function',
538 ;; so we must update it too or sending again in the current
539 ;; Emacs session will still call `sendmail-query-once'.
540 (and (boundp 'message-send-mail-function)
541 (eq message-send-mail-function 'sendmail-query-once)
542 (customize-set-variable 'message-send-mail-function
543 send-function))
544 (funcall send-function))))
545
546(defun sendmail-sync-aliases () 546(defun sendmail-sync-aliases ()
547 (when mail-personal-alias-file 547 (when mail-personal-alias-file
548 (let ((modtime (nth 5 (file-attributes mail-personal-alias-file)))) 548 (let ((modtime (nth 5 (file-attributes mail-personal-alias-file))))
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 69c49c471c0..544570a1bc3 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -490,7 +490,7 @@ The list is in preference order.")
490 (let* ((mechs (cdr-safe (assoc 'auth supported-extensions))) 490 (let* ((mechs (cdr-safe (assoc 'auth supported-extensions)))
491 (mech (car (smtpmail-intersection mechs smtpmail-auth-supported))) 491 (mech (car (smtpmail-intersection mechs smtpmail-auth-supported)))
492 (auth-source-creation-prompts 492 (auth-source-creation-prompts
493 '((user . "SMTP user at %h: ") 493 '((user . "SMTP user name for %h: ")
494 (secret . "SMTP password for %u@%h: "))) 494 (secret . "SMTP password for %u@%h: ")))
495 (auth-info (car 495 (auth-info (car
496 (auth-source-search 496 (auth-source-search
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 71b3fe0c4a1..06bbfb0b78c 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -1556,18 +1556,16 @@ record activity."
1556 1556
1557 ;; keep window on bottom line if it was already there 1557 ;; keep window on bottom line if it was already there
1558 (when rcirc-scroll-show-maximum-output 1558 (when rcirc-scroll-show-maximum-output
1559 (walk-windows (lambda (w) 1559 (let ((window (get-buffer-window)))
1560 (when (eq (window-buffer w) (current-buffer)) 1560 (when window
1561 (with-current-buffer (window-buffer w) 1561 (with-selected-window window
1562 (when (eq major-mode 'rcirc-mode) 1562 (when (eq major-mode 'rcirc-mode)
1563 (with-selected-window w 1563 (when (<= (- (window-height)
1564 (when (<= (- (window-height) 1564 (count-screen-lines (window-point)
1565 (count-screen-lines (window-point) 1565 (window-start))
1566 (window-start)) 1566 1)
1567 1) 1567 0)
1568 0) 1568 (recenter -1)))))))
1569 (recenter -1)))))))
1570 nil t))
1571 1569
1572 ;; flush undo (can we do something smarter here?) 1570 ;; flush undo (can we do something smarter here?)
1573 (buffer-disable-undo) 1571 (buffer-disable-undo)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 428bd6422d8..1fa358e9277 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -28,7 +28,6 @@
28 28
29(eval-when-compile (require 'cl)) ; ignore-errors 29(eval-when-compile (require 'cl)) ; ignore-errors
30(require 'tramp) 30(require 'tramp)
31(require 'shell)
32 31
33;; Pacify byte-compiler. The function is needed on XEmacs only. I'm 32;; Pacify byte-compiler. The function is needed on XEmacs only. I'm
34;; not sure at all that this is the right way to do it, but let's hope 33;; not sure at all that this is the right way to do it, but let's hope
@@ -91,7 +90,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
91 '("rcp" 90 '("rcp"
92 (tramp-login-program "rsh") 91 (tramp-login-program "rsh")
93 (tramp-login-args (("%h") ("-l" "%u"))) 92 (tramp-login-args (("%h") ("-l" "%u")))
94 (tramp-remote-sh "/bin/sh") 93 (tramp-remote-shell "/bin/sh")
94 (tramp-remote-shell-args ("-c"))
95 (tramp-copy-program "rcp") 95 (tramp-copy-program "rcp")
96 (tramp-copy-args (("-p" "%k") ("-r"))) 96 (tramp-copy-args (("-p" "%k") ("-r")))
97 (tramp-copy-keep-date t) 97 (tramp-copy-keep-date t)
@@ -101,7 +101,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
101 '("remcp" 101 '("remcp"
102 (tramp-login-program "remsh") 102 (tramp-login-program "remsh")
103 (tramp-login-args (("%h") ("-l" "%u"))) 103 (tramp-login-args (("%h") ("-l" "%u")))
104 (tramp-remote-sh "/bin/sh") 104 (tramp-remote-shell "/bin/sh")
105 (tramp-remote-shell-args ("-c"))
105 (tramp-copy-program "rcp") 106 (tramp-copy-program "rcp")
106 (tramp-copy-args (("-p" "%k"))) 107 (tramp-copy-args (("-p" "%k")))
107 (tramp-copy-keep-date t))) 108 (tramp-copy-keep-date t)))
@@ -111,7 +112,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
111 (tramp-login-program "ssh") 112 (tramp-login-program "ssh")
112 (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) 113 (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h")))
113 (tramp-async-args (("-q"))) 114 (tramp-async-args (("-q")))
114 (tramp-remote-sh "/bin/sh") 115 (tramp-remote-shell "/bin/sh")
116 (tramp-remote-shell-args ("-c"))
115 (tramp-copy-program "scp") 117 (tramp-copy-program "scp")
116 (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r"))) 118 (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")))
117 (tramp-copy-keep-date t) 119 (tramp-copy-keep-date t)
@@ -127,7 +129,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
127 (tramp-login-args (("-l" "%u") ("-p" "%p") 129 (tramp-login-args (("-l" "%u") ("-p" "%p")
128 ("-1") ("-e" "none") ("%h"))) 130 ("-1") ("-e" "none") ("%h")))
129 (tramp-async-args (("-q"))) 131 (tramp-async-args (("-q")))
130 (tramp-remote-sh "/bin/sh") 132 (tramp-remote-shell "/bin/sh")
133 (tramp-remote-shell-args ("-c"))
131 (tramp-copy-program "scp") 134 (tramp-copy-program "scp")
132 (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r"))) 135 (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r")))
133 (tramp-copy-keep-date t) 136 (tramp-copy-keep-date t)
@@ -143,7 +146,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
143 (tramp-login-args (("-l" "%u") ("-p" "%p") 146 (tramp-login-args (("-l" "%u") ("-p" "%p")
144 ("-2") ("-e" "none") ("%h"))) 147 ("-2") ("-e" "none") ("%h")))
145 (tramp-async-args (("-q"))) 148 (tramp-async-args (("-q")))
146 (tramp-remote-sh "/bin/sh") 149 (tramp-remote-shell "/bin/sh")
150 (tramp-remote-shell-args ("-c"))
147 (tramp-copy-program "scp") 151 (tramp-copy-program "scp")
148 (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r"))) 152 (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r")))
149 (tramp-copy-keep-date t) 153 (tramp-copy-keep-date t)
@@ -161,7 +165,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
161 ("-o" "ControlMaster=yes") 165 ("-o" "ControlMaster=yes")
162 ("-e" "none") ("%h"))) 166 ("-e" "none") ("%h")))
163 (tramp-async-args (("-q"))) 167 (tramp-async-args (("-q")))
164 (tramp-remote-sh "/bin/sh") 168 (tramp-remote-shell "/bin/sh")
169 (tramp-remote-shell-args ("-c"))
165 (tramp-copy-program "scp") 170 (tramp-copy-program "scp")
166 (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r") 171 (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")
167 ("-o" "ControlPath=%t.%%r@%%h:%%p") 172 ("-o" "ControlPath=%t.%%r@%%h:%%p")
@@ -180,7 +185,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
180 ("-e" "none") ("-t" "-t") 185 ("-e" "none") ("-t" "-t")
181 ("%h") ("/bin/sh"))) 186 ("%h") ("/bin/sh")))
182 (tramp-async-args (("-q"))) 187 (tramp-async-args (("-q")))
183 (tramp-remote-sh "/bin/sh") 188 (tramp-remote-shell "/bin/sh")
189 (tramp-remote-shell-args ("-c"))
184 (tramp-copy-program "scp") 190 (tramp-copy-program "scp")
185 (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r"))) 191 (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")))
186 (tramp-copy-keep-date t) 192 (tramp-copy-keep-date t)
@@ -195,7 +201,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
195 (tramp-login-program "ssh") 201 (tramp-login-program "ssh")
196 (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) 202 (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h")))
197 (tramp-async-args (("-q"))) 203 (tramp-async-args (("-q")))
198 (tramp-remote-sh "/bin/sh") 204 (tramp-remote-shell "/bin/sh")
205 (tramp-remote-shell-args ("-c"))
199 (tramp-copy-program "sftp"))) 206 (tramp-copy-program "sftp")))
200;;;###tramp-autoload 207;;;###tramp-autoload
201(add-to-list 'tramp-methods 208(add-to-list 'tramp-methods
@@ -203,7 +210,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
203 (tramp-login-program "ssh") 210 (tramp-login-program "ssh")
204 (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) 211 (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h")))
205 (tramp-async-args (("-q"))) 212 (tramp-async-args (("-q")))
206 (tramp-remote-sh "/bin/sh") 213 (tramp-remote-shell "/bin/sh")
214 (tramp-remote-shell-args ("-c"))
207 (tramp-copy-program "rsync") 215 (tramp-copy-program "rsync")
208 (tramp-copy-args (("-e" "ssh") ("-t" "%k") ("-r"))) 216 (tramp-copy-args (("-e" "ssh") ("-t" "%k") ("-r")))
209 (tramp-copy-keep-date t) 217 (tramp-copy-keep-date t)
@@ -218,7 +226,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
218 ("-o" "ControlMaster=yes") 226 ("-o" "ControlMaster=yes")
219 ("-e" "none") ("%h"))) 227 ("-e" "none") ("%h")))
220 (tramp-async-args (("-q"))) 228 (tramp-async-args (("-q")))
221 (tramp-remote-sh "/bin/sh") 229 (tramp-remote-shell "/bin/sh")
230 (tramp-remote-shell-args ("-c"))
222 (tramp-copy-program "rsync") 231 (tramp-copy-program "rsync")
223 (tramp-copy-args (("-t" "%k") ("-r"))) 232 (tramp-copy-args (("-t" "%k") ("-r")))
224 (tramp-copy-env (("RSYNC_RSH") 233 (tramp-copy-env (("RSYNC_RSH")
@@ -234,20 +243,23 @@ detected as prompt when being sent on echoing hosts, therefore.")
234 '("rsh" 243 '("rsh"
235 (tramp-login-program "rsh") 244 (tramp-login-program "rsh")
236 (tramp-login-args (("%h") ("-l" "%u"))) 245 (tramp-login-args (("%h") ("-l" "%u")))
237 (tramp-remote-sh "/bin/sh"))) 246 (tramp-remote-shell "/bin/sh")
247 (tramp-remote-shell-args ("-c"))))
238;;;###tramp-autoload 248;;;###tramp-autoload
239(add-to-list 'tramp-methods 249(add-to-list 'tramp-methods
240 '("remsh" 250 '("remsh"
241 (tramp-login-program "remsh") 251 (tramp-login-program "remsh")
242 (tramp-login-args (("%h") ("-l" "%u"))) 252 (tramp-login-args (("%h") ("-l" "%u")))
243 (tramp-remote-sh "/bin/sh"))) 253 (tramp-remote-shell "/bin/sh")
254 (tramp-remote-shell-args ("-c"))))
244;;;###tramp-autoload 255;;;###tramp-autoload
245(add-to-list 'tramp-methods 256(add-to-list 'tramp-methods
246 '("ssh" 257 '("ssh"
247 (tramp-login-program "ssh") 258 (tramp-login-program "ssh")
248 (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) 259 (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h")))
249 (tramp-async-args (("-q"))) 260 (tramp-async-args (("-q")))
250 (tramp-remote-sh "/bin/sh") 261 (tramp-remote-shell "/bin/sh")
262 (tramp-remote-shell-args ("-c"))
251 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") 263 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
252 ("-o" "UserKnownHostsFile=/dev/null") 264 ("-o" "UserKnownHostsFile=/dev/null")
253 ("-o" "StrictHostKeyChecking=no"))) 265 ("-o" "StrictHostKeyChecking=no")))
@@ -259,7 +271,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
259 (tramp-login-args (("-l" "%u") ("-p" "%p") 271 (tramp-login-args (("-l" "%u") ("-p" "%p")
260 ("-1") ("-e" "none") ("%h"))) 272 ("-1") ("-e" "none") ("%h")))
261 (tramp-async-args (("-q"))) 273 (tramp-async-args (("-q")))
262 (tramp-remote-sh "/bin/sh") 274 (tramp-remote-shell "/bin/sh")
275 (tramp-remote-shell-args ("-c"))
263 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") 276 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
264 ("-o" "UserKnownHostsFile=/dev/null") 277 ("-o" "UserKnownHostsFile=/dev/null")
265 ("-o" "StrictHostKeyChecking=no"))) 278 ("-o" "StrictHostKeyChecking=no")))
@@ -271,7 +284,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
271 (tramp-login-args (("-l" "%u") ("-p" "%p") 284 (tramp-login-args (("-l" "%u") ("-p" "%p")
272 ("-2") ("-e" "none") ("%h"))) 285 ("-2") ("-e" "none") ("%h")))
273 (tramp-async-args (("-q"))) 286 (tramp-async-args (("-q")))
274 (tramp-remote-sh "/bin/sh") 287 (tramp-remote-shell "/bin/sh")
288 (tramp-remote-shell-args ("-c"))
275 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") 289 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
276 ("-o" "UserKnownHostsFile=/dev/null") 290 ("-o" "UserKnownHostsFile=/dev/null")
277 ("-o" "StrictHostKeyChecking=no"))) 291 ("-o" "StrictHostKeyChecking=no")))
@@ -284,7 +298,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
284 ("-e" "none") ("-t" "-t") 298 ("-e" "none") ("-t" "-t")
285 ("%h") ("/bin/sh"))) 299 ("%h") ("/bin/sh")))
286 (tramp-async-args (("-q"))) 300 (tramp-async-args (("-q")))
287 (tramp-remote-sh "/bin/sh") 301 (tramp-remote-shell "/bin/sh")
302 (tramp-remote-shell-args ("-c"))
288 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") 303 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
289 ("-o" "UserKnownHostsFile=/dev/null") 304 ("-o" "UserKnownHostsFile=/dev/null")
290 ("-o" "StrictHostKeyChecking=no"))) 305 ("-o" "StrictHostKeyChecking=no")))
@@ -294,38 +309,44 @@ detected as prompt when being sent on echoing hosts, therefore.")
294 '("telnet" 309 '("telnet"
295 (tramp-login-program "telnet") 310 (tramp-login-program "telnet")
296 (tramp-login-args (("%h") ("%p"))) 311 (tramp-login-args (("%h") ("%p")))
297 (tramp-remote-sh "/bin/sh") 312 (tramp-remote-shell "/bin/sh")
313 (tramp-remote-shell-args ("-c"))
298 (tramp-default-port 23))) 314 (tramp-default-port 23)))
299;;;###tramp-autoload 315;;;###tramp-autoload
300(add-to-list 'tramp-methods 316(add-to-list 'tramp-methods
301 '("su" 317 '("su"
302 (tramp-login-program "su") 318 (tramp-login-program "su")
303 (tramp-login-args (("-") ("%u"))) 319 (tramp-login-args (("-") ("%u")))
304 (tramp-remote-sh "/bin/sh"))) 320 (tramp-remote-shell "/bin/sh")
321 (tramp-remote-shell-args ("-c"))))
305;;;###tramp-autoload 322;;;###tramp-autoload
306(add-to-list 'tramp-methods 323(add-to-list 'tramp-methods
307 '("sudo" 324 '("sudo"
308 (tramp-login-program "sudo") 325 (tramp-login-program "sudo")
309 (tramp-login-args (("-u" "%u") ("-s") ("-H") ("-p" "Password:"))) 326 (tramp-login-args (("-u" "%u") ("-s") ("-H") ("-p" "Password:")))
310 (tramp-remote-sh "/bin/sh"))) 327 (tramp-remote-shell "/bin/sh")
328 (tramp-remote-shell-args ("-c"))))
311;;;###tramp-autoload 329;;;###tramp-autoload
312(add-to-list 'tramp-methods 330(add-to-list 'tramp-methods
313 '("ksu" 331 '("ksu"
314 (tramp-login-program "ksu") 332 (tramp-login-program "ksu")
315 (tramp-login-args (("%u") ("-q"))) 333 (tramp-login-args (("%u") ("-q")))
316 (tramp-remote-sh "/bin/sh"))) 334 (tramp-remote-shell "/bin/sh")
335 (tramp-remote-shell-args ("-c"))))
317;;;###tramp-autoload 336;;;###tramp-autoload
318(add-to-list 'tramp-methods 337(add-to-list 'tramp-methods
319 '("krlogin" 338 '("krlogin"
320 (tramp-login-program "krlogin") 339 (tramp-login-program "krlogin")
321 (tramp-login-args (("%h") ("-l" "%u") ("-x"))) 340 (tramp-login-args (("%h") ("-l" "%u") ("-x")))
322 (tramp-remote-sh "/bin/sh"))) 341 (tramp-remote-shell "/bin/sh")
342 (tramp-remote-shell-args ("-c"))))
323;;;###tramp-autoload 343;;;###tramp-autoload
324(add-to-list 'tramp-methods 344(add-to-list 'tramp-methods
325 '("plink" 345 '("plink"
326 (tramp-login-program "plink") 346 (tramp-login-program "plink")
327 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) 347 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
328 (tramp-remote-sh "/bin/sh") 348 (tramp-remote-shell "/bin/sh")
349 (tramp-remote-shell-args ("-c"))
329 (tramp-password-end-of-line "xy") ;see docstring for "xy" 350 (tramp-password-end-of-line "xy") ;see docstring for "xy"
330 (tramp-default-port 22))) 351 (tramp-default-port 22)))
331;;;###tramp-autoload 352;;;###tramp-autoload
@@ -333,7 +354,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
333 '("plink1" 354 '("plink1"
334 (tramp-login-program "plink") 355 (tramp-login-program "plink")
335 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-1" "-ssh") ("%h"))) 356 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-1" "-ssh") ("%h")))
336 (tramp-remote-sh "/bin/sh") 357 (tramp-remote-shell "/bin/sh")
358 (tramp-remote-shell-args ("-c"))
337 (tramp-password-end-of-line "xy") ;see docstring for "xy" 359 (tramp-password-end-of-line "xy") ;see docstring for "xy"
338 (tramp-default-port 22))) 360 (tramp-default-port 22)))
339;;;###tramp-autoload 361;;;###tramp-autoload
@@ -348,13 +370,15 @@ detected as prompt when being sent on echoing hosts, therefore.")
348 tramp-terminal-type 370 tramp-terminal-type
349 tramp-initial-end-of-output)) 371 tramp-initial-end-of-output))
350 ("/bin/sh"))) 372 ("/bin/sh")))
351 (tramp-remote-sh "/bin/sh"))) 373 (tramp-remote-shell "/bin/sh")
374 (tramp-remote-shell-args ("-c"))))
352;;;###tramp-autoload 375;;;###tramp-autoload
353(add-to-list 'tramp-methods 376(add-to-list 'tramp-methods
354 '("pscp" 377 '("pscp"
355 (tramp-login-program "plink") 378 (tramp-login-program "plink")
356 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) 379 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
357 (tramp-remote-sh "/bin/sh") 380 (tramp-remote-shell "/bin/sh")
381 (tramp-remote-shell-args ("-c"))
358 (tramp-copy-program "pscp") 382 (tramp-copy-program "pscp")
359 (tramp-copy-args (("-P" "%p") ("-scp") ("-p" "%k") 383 (tramp-copy-args (("-P" "%p") ("-scp") ("-p" "%k")
360 ("-q") ("-r"))) 384 ("-q") ("-r")))
@@ -367,7 +391,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
367 '("psftp" 391 '("psftp"
368 (tramp-login-program "plink") 392 (tramp-login-program "plink")
369 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) 393 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
370 (tramp-remote-sh "/bin/sh") 394 (tramp-remote-shell "/bin/sh")
395 (tramp-remote-shell-args ("-c"))
371 (tramp-copy-program "pscp") 396 (tramp-copy-program "pscp")
372 (tramp-copy-args (("-P" "%p") ("-sftp") ("-p" "%k") 397 (tramp-copy-args (("-P" "%p") ("-sftp") ("-p" "%k")
373 ("-q") ("-r"))) 398 ("-q") ("-r")))
@@ -379,7 +404,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
379 '("fcp" 404 '("fcp"
380 (tramp-login-program "fsh") 405 (tramp-login-program "fsh")
381 (tramp-login-args (("%h") ("-l" "%u") ("sh" "-i"))) 406 (tramp-login-args (("%h") ("-l" "%u") ("sh" "-i")))
382 (tramp-remote-sh "/bin/sh -i") 407 (tramp-remote-shell "/bin/sh")
408 (tramp-remote-shell-args ("-i") ("-c"))
383 (tramp-copy-program "fcp") 409 (tramp-copy-program "fcp")
384 (tramp-copy-args (("-p" "%k"))) 410 (tramp-copy-args (("-p" "%k")))
385 (tramp-copy-keep-date t))) 411 (tramp-copy-keep-date t)))
@@ -942,7 +968,7 @@ This is used to map a mode number to a permission string.")
942 (executable-find . tramp-sh-handle-executable-find) 968 (executable-find . tramp-sh-handle-executable-find)
943 (start-file-process . tramp-sh-handle-start-file-process) 969 (start-file-process . tramp-sh-handle-start-file-process)
944 (process-file . tramp-sh-handle-process-file) 970 (process-file . tramp-sh-handle-process-file)
945 (shell-command . tramp-sh-handle-shell-command) 971 (shell-command . tramp-handle-shell-command)
946 (insert-directory . tramp-sh-handle-insert-directory) 972 (insert-directory . tramp-sh-handle-insert-directory)
947 (expand-file-name . tramp-sh-handle-expand-file-name) 973 (expand-file-name . tramp-sh-handle-expand-file-name)
948 (substitute-in-file-name . tramp-handle-substitute-in-file-name) 974 (substitute-in-file-name . tramp-handle-substitute-in-file-name)
@@ -2853,7 +2879,7 @@ the result will be a local, non-Tramp, filename."
2853 ;; `process-file-side-effects' has been introduced with GNU 2879 ;; `process-file-side-effects' has been introduced with GNU
2854 ;; Emacs 23.2. If set to `nil', no remote file will be changed 2880 ;; Emacs 23.2. If set to `nil', no remote file will be changed
2855 ;; by `program'. If it doesn't exist, we assume its default 2881 ;; by `program'. If it doesn't exist, we assume its default
2856 ;; value 't'. 2882 ;; value `t'.
2857 (unless (and (boundp 'process-file-side-effects) 2883 (unless (and (boundp 'process-file-side-effects)
2858 (not (symbol-value 'process-file-side-effects))) 2884 (not (symbol-value 'process-file-side-effects)))
2859 (tramp-flush-directory-property v "")) 2885 (tramp-flush-directory-property v ""))
@@ -2873,87 +2899,6 @@ the result will be a local, non-Tramp, filename."
2873 (apply 'call-process program tmpfile buffer display args) 2899 (apply 'call-process program tmpfile buffer display args)
2874 (delete-file tmpfile)))) 2900 (delete-file tmpfile))))
2875 2901
2876(defun tramp-sh-handle-shell-command
2877 (command &optional output-buffer error-buffer)
2878 "Like `shell-command' for Tramp files."
2879 (let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command))
2880 ;; We cannot use `shell-file-name' and `shell-command-switch',
2881 ;; they are variables of the local host.
2882 (args (list
2883 (tramp-get-method-parameter
2884 (tramp-file-name-method
2885 (tramp-dissect-file-name default-directory))
2886 'tramp-remote-sh)
2887 "-c" (substring command 0 asynchronous)))
2888 current-buffer-p
2889 (output-buffer
2890 (cond
2891 ((bufferp output-buffer) output-buffer)
2892 ((stringp output-buffer) (get-buffer-create output-buffer))
2893 (output-buffer
2894 (setq current-buffer-p t)
2895 (current-buffer))
2896 (t (get-buffer-create
2897 (if asynchronous
2898 "*Async Shell Command*"
2899 "*Shell Command Output*")))))
2900 (error-buffer
2901 (cond
2902 ((bufferp error-buffer) error-buffer)
2903 ((stringp error-buffer) (get-buffer-create error-buffer))))
2904 (buffer
2905 (if (and (not asynchronous) error-buffer)
2906 (with-parsed-tramp-file-name default-directory nil
2907 (list output-buffer (tramp-make-tramp-temp-file v)))
2908 output-buffer))
2909 (p (get-buffer-process output-buffer)))
2910
2911 ;; Check whether there is another process running. Tramp does not
2912 ;; support 2 (asynchronous) processes in parallel.
2913 (when p
2914 (if (yes-or-no-p "A command is running. Kill it? ")
2915 (ignore-errors (kill-process p))
2916 (error "Shell command in progress")))
2917
2918 (if current-buffer-p
2919 (progn
2920 (barf-if-buffer-read-only)
2921 (push-mark nil t))
2922 (with-current-buffer output-buffer
2923 (setq buffer-read-only nil)
2924 (erase-buffer)))
2925
2926 (if (and (not current-buffer-p) (integerp asynchronous))
2927 (prog1
2928 ;; Run the process.
2929 (apply 'start-file-process "*Async Shell*" buffer args)
2930 ;; Display output.
2931 (pop-to-buffer output-buffer)
2932 (setq mode-line-process '(":%s"))
2933 (shell-mode))
2934
2935 (prog1
2936 ;; Run the process.
2937 (apply 'process-file (car args) nil buffer nil (cdr args))
2938 ;; Insert error messages if they were separated.
2939 (when (listp buffer)
2940 (with-current-buffer error-buffer
2941 (insert-file-contents (cadr buffer)))
2942 (delete-file (cadr buffer)))
2943 (if current-buffer-p
2944 ;; This is like exchange-point-and-mark, but doesn't
2945 ;; activate the mark. It is cleaner to avoid activation,
2946 ;; even though the command loop would deactivate the mark
2947 ;; because we inserted text.
2948 (goto-char (prog1 (mark t)
2949 (set-marker (mark-marker) (point)
2950 (current-buffer))))
2951 ;; There's some output, display it.
2952 (when (with-current-buffer output-buffer (> (point-max) (point-min)))
2953 (if (functionp 'display-message-or-buffer)
2954 (tramp-compat-funcall 'display-message-or-buffer output-buffer)
2955 (pop-to-buffer output-buffer))))))))
2956
2957(defun tramp-sh-handle-file-local-copy (filename) 2902(defun tramp-sh-handle-file-local-copy (filename)
2958 "Like `file-local-copy' for Tramp files." 2903 "Like `file-local-copy' for Tramp files."
2959 (with-parsed-tramp-file-name filename nil 2904 (with-parsed-tramp-file-name filename nil
@@ -3680,7 +3625,7 @@ file exists and nonzero exit status otherwise."
3680 (tramp-set-connection-property 3625 (tramp-set-connection-property
3681 vec "remote-shell" 3626 vec "remote-shell"
3682 (tramp-get-method-parameter 3627 (tramp-get-method-parameter
3683 (tramp-file-name-method vec) 'tramp-remote-sh))))))))) 3628 (tramp-file-name-method vec) 'tramp-remote-shell)))))))))
3684 3629
3685;; Utility functions. 3630;; Utility functions.
3686 3631
@@ -3716,7 +3661,8 @@ process to set up. VEC specifies the connection."
3716 ;; discarded as well. 3661 ;; discarded as well.
3717 (tramp-open-shell 3662 (tramp-open-shell
3718 vec 3663 vec
3719 (tramp-get-method-parameter (tramp-file-name-method vec) 'tramp-remote-sh)) 3664 (tramp-get-method-parameter
3665 (tramp-file-name-method vec) 'tramp-remote-shell))
3720 3666
3721 ;; Disable echo. 3667 ;; Disable echo.
3722 (tramp-message vec 5 "Setting up remote shell environment") 3668 (tramp-message vec 5 "Setting up remote shell environment")
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 274bc72391b..6475ea42ec8 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -58,6 +58,7 @@
58;;; Code: 58;;; Code:
59 59
60(require 'tramp-compat) 60(require 'tramp-compat)
61(require 'shell)
61 62
62;;; User Customizable Internal Variables: 63;;; User Customizable Internal Variables:
63 64
@@ -190,13 +191,16 @@ See the variable `tramp-encoding-shell' for more information."
190This is a list of entries of the form (NAME PARAM1 PARAM2 ...). 191This is a list of entries of the form (NAME PARAM1 PARAM2 ...).
191Each NAME stands for a remote access method. Each PARAM is a 192Each NAME stands for a remote access method. Each PARAM is a
192pair of the form (KEY VALUE). The following KEYs are defined: 193pair of the form (KEY VALUE). The following KEYs are defined:
193 * `tramp-remote-sh' 194 * `tramp-remote-shell'
194 This specifies the Bourne shell to use on the remote host. This 195 This specifies the Bourne shell to use on the remote host. This
195 MUST be a Bourne-like shell. It is normally not necessary to set 196 MUST be a Bourne-like shell. It is normally not necessary to set
196 this to any value other than \"/bin/sh\": Tramp wants to use a shell 197 this to any value other than \"/bin/sh\": Tramp wants to use a shell
197 which groks tilde expansion, but it can search for it. Also note 198 which groks tilde expansion, but it can search for it. Also note
198 that \"/bin/sh\" exists on all Unixen, this might not be true for 199 that \"/bin/sh\" exists on all Unixen, this might not be true for
199 the value that you decide to use. You Have Been Warned. 200 the value that you decide to use. You Have Been Warned.
201 * `tramp-remote-shell-args'
202 For implementation of `shell-command', this specifies the
203 argument to let `tramp-remote-shell' run a command.
200 * `tramp-login-program' 204 * `tramp-login-program'
201 This specifies the name of the program to use for logging in to the 205 This specifies the name of the program to use for logging in to the
202 remote host. This may be the name of rsh or a workalike program, 206 remote host. This may be the name of rsh or a workalike program,
@@ -2959,6 +2963,92 @@ User is always nil."
2959 (delete-file local-copy))))) 2963 (delete-file local-copy)))))
2960 t))) 2964 t)))
2961 2965
2966(defun tramp-handle-shell-command
2967 (command &optional output-buffer error-buffer)
2968 "Like `shell-command' for Tramp files."
2969 (let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command))
2970 ;; We cannot use `shell-file-name' and `shell-command-switch',
2971 ;; they are variables of the local host.
2972 (args (append
2973 (cons
2974 (tramp-get-method-parameter
2975 (tramp-file-name-method
2976 (tramp-dissect-file-name default-directory))
2977 'tramp-remote-shell)
2978 (tramp-get-method-parameter
2979 (tramp-file-name-method
2980 (tramp-dissect-file-name default-directory))
2981 'tramp-remote-shell-args))
2982 (list (substring command 0 asynchronous))))
2983 current-buffer-p
2984 (output-buffer
2985 (cond
2986 ((bufferp output-buffer) output-buffer)
2987 ((stringp output-buffer) (get-buffer-create output-buffer))
2988 (output-buffer
2989 (setq current-buffer-p t)
2990 (current-buffer))
2991 (t (get-buffer-create
2992 (if asynchronous
2993 "*Async Shell Command*"
2994 "*Shell Command Output*")))))
2995 (error-buffer
2996 (cond
2997 ((bufferp error-buffer) error-buffer)
2998 ((stringp error-buffer) (get-buffer-create error-buffer))))
2999 (buffer
3000 (if (and (not asynchronous) error-buffer)
3001 (with-parsed-tramp-file-name default-directory nil
3002 (list output-buffer (tramp-make-tramp-temp-file v)))
3003 output-buffer))
3004 (p (get-buffer-process output-buffer)))
3005
3006 ;; Check whether there is another process running. Tramp does not
3007 ;; support 2 (asynchronous) processes in parallel.
3008 (when p
3009 (if (yes-or-no-p "A command is running. Kill it? ")
3010 (ignore-errors (kill-process p))
3011 (error "Shell command in progress")))
3012
3013 (if current-buffer-p
3014 (progn
3015 (barf-if-buffer-read-only)
3016 (push-mark nil t))
3017 (with-current-buffer output-buffer
3018 (setq buffer-read-only nil)
3019 (erase-buffer)))
3020
3021 (if (and (not current-buffer-p) (integerp asynchronous))
3022 (prog1
3023 ;; Run the process.
3024 (apply 'start-file-process "*Async Shell*" buffer args)
3025 ;; Display output.
3026 (pop-to-buffer output-buffer)
3027 (setq mode-line-process '(":%s"))
3028 (shell-mode))
3029
3030 (prog1
3031 ;; Run the process.
3032 (apply 'process-file (car args) nil buffer nil (cdr args))
3033 ;; Insert error messages if they were separated.
3034 (when (listp buffer)
3035 (with-current-buffer error-buffer
3036 (insert-file-contents (cadr buffer)))
3037 (delete-file (cadr buffer)))
3038 (if current-buffer-p
3039 ;; This is like exchange-point-and-mark, but doesn't
3040 ;; activate the mark. It is cleaner to avoid activation,
3041 ;; even though the command loop would deactivate the mark
3042 ;; because we inserted text.
3043 (goto-char (prog1 (mark t)
3044 (set-marker (mark-marker) (point)
3045 (current-buffer))))
3046 ;; There's some output, display it.
3047 (when (with-current-buffer output-buffer (> (point-max) (point-min)))
3048 (if (functionp 'display-message-or-buffer)
3049 (tramp-compat-funcall 'display-message-or-buffer output-buffer)
3050 (pop-to-buffer output-buffer))))))))
3051
2962(defun tramp-handle-substitute-in-file-name (filename) 3052(defun tramp-handle-substitute-in-file-name (filename)
2963 "Like `substitute-in-file-name' for Tramp files. 3053 "Like `substitute-in-file-name' for Tramp files.
2964\"//\" and \"/~\" substitute only in the local filename part. 3054\"//\" and \"/~\" substitute only in the local filename part.
@@ -3477,7 +3567,7 @@ Return the local name of the temporary file."
3477 (ignore-errors (delete-file tramp-temp-buffer-file-name)))) 3567 (ignore-errors (delete-file tramp-temp-buffer-file-name))))
3478 3568
3479(add-hook 'kill-buffer-hook 'tramp-delete-temp-file-function) 3569(add-hook 'kill-buffer-hook 'tramp-delete-temp-file-function)
3480(add-hook 'tramp-cache-unload-hook 3570(add-hook 'tramp-unload-hook
3481 (lambda () 3571 (lambda ()
3482 (remove-hook 'kill-buffer-hook 3572 (remove-hook 'kill-buffer-hook
3483 'tramp-delete-temp-file-function))) 3573 'tramp-delete-temp-file-function)))
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index 625e0926c52..d63929d794e 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,29 @@
12011-09-02 Chong Yidong <cyd@stupidchicken.com>
2
3 * org-compat.el (org-pop-to-buffer-same-window): Deleted.
4
5 * ob-ref.el (org-babel-ref-goto-headline-id):
6 * org.el (org-get-location, org-tree-to-indirect-buffer)
7 (org-mark-ring-goto, org-refile, org-add-log-note)
8 (org-revert-all-org-buffers, org-switchb)
9 (org-cycle-agenda-files, org-submit-bug-report)
10 (org-goto-marker-or-bmk):
11 * org-agenda.el (org-prepare-agenda, org-agenda-switch-to):
12 * org-capture.el (org-capture-goto-target)
13 (org-capture-fill-template):
14 * org-clock.el (org-clock-goto):
15 * org-ctags.el (org-ctags-visit-buffer-or-file):
16 * org-exp.el (org-export-as-org):
17 * org-feed.el (org-feed-show-raw-feed):
18 * org-html.el (org-export-htmlize-generate-css):
19 * org-id.el (org-id-goto):
20 * org-irc.el (org-irc-visit-erc):
21 * org-mobile.el (org-mobile-apply):
22 * org-publish.el (org-publish-org-to, org-publish-find-date):
23 * org-remember.el (org-go-to-remember-target):
24 * org-src.el (org-src-switch-to-buffer)
25 (org-edit-fixed-width-region): Use switch-to-buffer.
26
12011-08-31 Martin Rudalics <rudalics@gmx.at> 272011-08-31 Martin Rudalics <rudalics@gmx.at>
2 28
3 * org-compat.el (org-pop-to-buffer-same-window): Remove LABEL 29 * org-compat.el (org-pop-to-buffer-same-window): Remove LABEL
diff --git a/lisp/org/ob-ref.el b/lisp/org/ob-ref.el
index b27bd20db40..d0a2c14bee9 100644
--- a/lisp/org/ob-ref.el
+++ b/lisp/org/ob-ref.el
@@ -61,8 +61,6 @@
61(declare-function org-narrow-to-subtree "org" ()) 61(declare-function org-narrow-to-subtree "org" ())
62(declare-function org-id-find-id-in-file "org-id" (id file &optional markerp)) 62(declare-function org-id-find-id-in-file "org-id" (id file &optional markerp))
63(declare-function org-show-context "org" (&optional key)) 63(declare-function org-show-context "org" (&optional key))
64(declare-function org-pop-to-buffer-same-window
65 "org-compat" (&optional buffer-or-name norecord label))
66 64
67(defvar org-babel-ref-split-regexp 65(defvar org-babel-ref-split-regexp
68 "[ \f\t\n\r\v]*\\(.+?\\)[ \f\t\n\r\v]*=[ \f\t\n\r\v]*\\(.+\\)[ \f\t\n\r\v]*") 66 "[ \f\t\n\r\v]*\\(.+?\\)[ \f\t\n\r\v]*=[ \f\t\n\r\v]*\\(.+\\)[ \f\t\n\r\v]*")
@@ -96,7 +94,7 @@ the variable."
96 (m (when file (org-id-find-id-in-file id file 'marker)))) 94 (m (when file (org-id-find-id-in-file id file 'marker))))
97 (when (and file m) 95 (when (and file m)
98 (message "file:%S" file) 96 (message "file:%S" file)
99 (org-pop-to-buffer-same-window (marker-buffer m)) 97 (switch-to-buffer (marker-buffer m))
100 (goto-char m) 98 (goto-char m)
101 (move-marker m nil) 99 (move-marker m nil)
102 (org-show-context) 100 (org-show-context)
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 9f23c4011d1..aea284fe72c 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -60,8 +60,6 @@
60(declare-function org-is-habit-p "org-habit" (&optional pom)) 60(declare-function org-is-habit-p "org-habit" (&optional pom))
61(declare-function org-habit-parse-todo "org-habit" (&optional pom)) 61(declare-function org-habit-parse-todo "org-habit" (&optional pom))
62(declare-function org-habit-get-priority "org-habit" (habit &optional moment)) 62(declare-function org-habit-get-priority "org-habit" (habit &optional moment))
63(declare-function org-pop-to-buffer-same-window "org-compat"
64 (&optional buffer-or-name norecord label))
65 63
66(defvar calendar-mode-map) 64(defvar calendar-mode-map)
67(defvar org-clock-current-task) ; defined in org-clock.el 65(defvar org-clock-current-task) ; defined in org-clock.el
@@ -3067,7 +3065,7 @@ the global options and expect it to be applied to the entire view.")
3067 (awin (select-window awin)) 3065 (awin (select-window awin))
3068 ((not (setq org-pre-agenda-window-conf (current-window-configuration)))) 3066 ((not (setq org-pre-agenda-window-conf (current-window-configuration))))
3069 ((equal org-agenda-window-setup 'current-window) 3067 ((equal org-agenda-window-setup 'current-window)
3070 (org-pop-to-buffer-same-window abuf)) 3068 (switch-to-buffer abuf))
3071 ((equal org-agenda-window-setup 'other-window) 3069 ((equal org-agenda-window-setup 'other-window)
3072 (org-switch-to-buffer-other-window abuf)) 3070 (org-switch-to-buffer-other-window abuf))
3073 ((equal org-agenda-window-setup 'other-frame) 3071 ((equal org-agenda-window-setup 'other-frame)
@@ -3078,7 +3076,7 @@ the global options and expect it to be applied to the entire view.")
3078 ;; additional test in case agenda is invoked from within agenda 3076 ;; additional test in case agenda is invoked from within agenda
3079 ;; buffer via elisp link 3077 ;; buffer via elisp link
3080 (unless (equal (current-buffer) abuf) 3078 (unless (equal (current-buffer) abuf)
3081 (org-pop-to-buffer-same-window abuf))) 3079 (switch-to-buffer abuf)))
3082 (setq buffer-read-only nil) 3080 (setq buffer-read-only nil)
3083 (let ((inhibit-read-only t)) (erase-buffer)) 3081 (let ((inhibit-read-only t)) (erase-buffer))
3084 (org-agenda-mode) 3082 (org-agenda-mode)
@@ -6972,7 +6970,7 @@ at the text of the entry itself."
6972 (org-agenda-error))) 6970 (org-agenda-error)))
6973 (buffer (marker-buffer marker)) 6971 (buffer (marker-buffer marker))
6974 (pos (marker-position marker))) 6972 (pos (marker-position marker)))
6975 (org-pop-to-buffer-same-window buffer) 6973 (switch-to-buffer buffer)
6976 (and delete-other-windows (delete-other-windows)) 6974 (and delete-other-windows (delete-other-windows))
6977 (widen) 6975 (widen)
6978 (goto-char pos) 6976 (goto-char pos)
diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el
index 133460b49ec..05cca0e311e 100644
--- a/lisp/org/org-capture.el
+++ b/lisp/org/org-capture.el
@@ -57,8 +57,6 @@
57 (date &optional keep-restriction)) 57 (date &optional keep-restriction))
58(declare-function org-table-get-specials "org-table" ()) 58(declare-function org-table-get-specials "org-table" ())
59(declare-function org-table-goto-line "org-table" (N)) 59(declare-function org-table-goto-line "org-table" (N))
60(declare-function org-pop-to-buffer-same-window "org-compat"
61 (&optional buffer-or-name norecord label))
62 60
63(defvar org-remember-default-headline) 61(defvar org-remember-default-headline)
64(defvar org-remember-templates) 62(defvar org-remember-templates)
@@ -1201,7 +1199,7 @@ The user is queried for the template."
1201 (error "No capture template selected")) 1199 (error "No capture template selected"))
1202 (org-capture-set-plist entry) 1200 (org-capture-set-plist entry)
1203 (org-capture-set-target-location) 1201 (org-capture-set-target-location)
1204 (org-pop-to-buffer-same-window (org-capture-get :buffer)) 1202 (switch-to-buffer (org-capture-get :buffer))
1205 (goto-char (org-capture-get :pos)))) 1203 (goto-char (org-capture-get :pos))))
1206 1204
1207(defun org-capture-get-indirect-buffer (&optional buffer prefix) 1205(defun org-capture-get-indirect-buffer (&optional buffer prefix)
@@ -1311,7 +1309,7 @@ The template may still contain \"%?\" for cursor positioning."
1311 (sit-for 1)) 1309 (sit-for 1))
1312 (save-window-excursion 1310 (save-window-excursion
1313 (delete-other-windows) 1311 (delete-other-windows)
1314 (org-pop-to-buffer-same-window (get-buffer-create "*Capture*")) 1312 (switch-to-buffer (get-buffer-create "*Capture*"))
1315 (erase-buffer) 1313 (erase-buffer)
1316 (insert template) 1314 (insert template)
1317 (goto-char (point-min)) 1315 (goto-char (point-min))
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 4cf26e359f1..de5087e163c 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -36,7 +36,6 @@
36 36
37(declare-function calendar-absolute-from-iso "cal-iso" (&optional date)) 37(declare-function calendar-absolute-from-iso "cal-iso" (&optional date))
38(declare-function notifications-notify "notifications" (&rest params)) 38(declare-function notifications-notify "notifications" (&rest params))
39(declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label))
40(defvar org-time-stamp-formats) 39(defvar org-time-stamp-formats)
41(defvar org-ts-what) 40(defvar org-ts-what)
42 41
@@ -1498,7 +1497,7 @@ With prefix arg SELECT, offer recently clocked tasks for selection."
1498 (setq recent t) 1497 (setq recent t)
1499 (car org-clock-history)) 1498 (car org-clock-history))
1500 (t (error "No active or recent clock task"))))) 1499 (t (error "No active or recent clock task")))))
1501 (org-pop-to-buffer-same-window (marker-buffer m)) 1500 (switch-to-buffer (marker-buffer m))
1502 (if (or (< m (point-min)) (> m (point-max))) (widen)) 1501 (if (or (< m (point-min)) (> m (point-max))) (widen))
1503 (goto-char m) 1502 (goto-char m)
1504 (org-show-entry) 1503 (org-show-entry)
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index 9b0a935a515..896acc5aeae 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -432,15 +432,6 @@ With two arguments, return floor and remainder of their quotient."
432 (let ((q (floor x y))) 432 (let ((q (floor x y)))
433 (list q (- x (if y (* y q) q))))) 433 (list q (- x (if y (* y q) q)))))
434 434
435;; `pop-to-buffer-same-window' has been introduced with Emacs 24.1.
436(defun org-pop-to-buffer-same-window
437 (&optional buffer-or-name norecord label)
438 "Pop to buffer specified by BUFFER-OR-NAME in the selected window."
439 (if (fboundp 'pop-to-buffer-same-window)
440 (funcall
441 'pop-to-buffer-same-window buffer-or-name norecord)
442 (funcall 'switch-to-buffer buffer-or-name norecord)))
443
444(provide 'org-compat) 435(provide 'org-compat)
445 436
446 437
diff --git a/lisp/org/org-ctags.el b/lisp/org/org-ctags.el
index 9ba5024d58b..48eced9ea08 100644
--- a/lisp/org/org-ctags.el
+++ b/lisp/org/org-ctags.el
@@ -140,8 +140,6 @@
140 140
141(require 'org) 141(require 'org)
142 142
143(declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label))
144
145(defgroup org-ctags nil 143(defgroup org-ctags nil
146 "Options concerning use of ctags within org mode." 144 "Options concerning use of ctags within org mode."
147 :tag "Org-Ctags" 145 :tag "Org-Ctags"
@@ -387,7 +385,7 @@ the new file."
387 (cond 385 (cond
388 ((get-buffer (concat name ".org")) 386 ((get-buffer (concat name ".org"))
389 ;; Buffer is already open 387 ;; Buffer is already open
390 (org-pop-to-buffer-same-window (get-buffer (concat name ".org")))) 388 (switch-to-buffer (get-buffer (concat name ".org"))))
391 ((file-exists-p filename) 389 ((file-exists-p filename)
392 ;; File exists but is not open --> open it 390 ;; File exists but is not open --> open it
393 (message "Opening existing org file `%S'..." 391 (message "Opening existing org file `%S'..."
diff --git a/lisp/org/org-exp.el b/lisp/org/org-exp.el
index 59459b0d578..ee8e6027706 100644
--- a/lisp/org/org-exp.el
+++ b/lisp/org/org-exp.el
@@ -47,8 +47,6 @@
47(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ()) 47(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
48(declare-function org-table-cookie-line-p "org-table" (line)) 48(declare-function org-table-cookie-line-p "org-table" (line))
49(declare-function org-table-colgroup-line-p "org-table" (line)) 49(declare-function org-table-colgroup-line-p "org-table" (line))
50(declare-function org-pop-to-buffer-same-window "org-compat"
51 (&optional buffer-or-name norecord label))
52 50
53(autoload 'org-export-generic "org-export-generic" "Export using the generic exporter" t) 51(autoload 'org-export-generic "org-export-generic" "Export using the generic exporter" t)
54 52
@@ -2974,7 +2972,7 @@ directory."
2974 (region (buffer-string)) 2972 (region (buffer-string))
2975 str-ret) 2973 str-ret)
2976 (save-excursion 2974 (save-excursion
2977 (org-pop-to-buffer-same-window buffer) 2975 (switch-to-buffer buffer)
2978 (erase-buffer) 2976 (erase-buffer)
2979 (insert region) 2977 (insert region)
2980 (let ((org-inhibit-startup t)) (org-mode)) 2978 (let ((org-inhibit-startup t)) (org-mode))
diff --git a/lisp/org/org-feed.el b/lisp/org/org-feed.el
index a07ecc619e5..d1b31f11b4a 100644
--- a/lisp/org/org-feed.el
+++ b/lisp/org/org-feed.el
@@ -436,7 +436,7 @@ it can be a list structured like an entry in `org-feed-alist'."
436 (if (stringp feed) (setq feed (assoc feed org-feed-alist))) 436 (if (stringp feed) (setq feed (assoc feed org-feed-alist)))
437 (unless feed 437 (unless feed
438 (error "No such feed in `org-feed-alist")) 438 (error "No such feed in `org-feed-alist"))
439 (org-pop-to-buffer-same-window 439 (switch-to-buffer
440 (org-feed-update feed 'retrieve-only)) 440 (org-feed-update feed 'retrieve-only))
441 (goto-char (point-min))) 441 (goto-char (point-min)))
442 442
diff --git a/lisp/org/org-html.el b/lisp/org/org-html.el
index 54f6cb44dab..46126ce2573 100644
--- a/lisp/org/org-html.el
+++ b/lisp/org/org-html.el
@@ -34,8 +34,6 @@
34 34
35(declare-function org-id-find-id-file "org-id" (id)) 35(declare-function org-id-find-id-file "org-id" (id))
36(declare-function htmlize-region "ext:htmlize" (beg end)) 36(declare-function htmlize-region "ext:htmlize" (beg end))
37(declare-function org-pop-to-buffer-same-window
38 "org-compat" (&optional buffer-or-name norecord label))
39 37
40(defgroup org-export-html nil 38(defgroup org-export-html nil
41 "Options specific for HTML export of Org-mode files." 39 "Options specific for HTML export of Org-mode files."
@@ -2265,7 +2263,7 @@ that uses these same face definitions."
2265 (when (and (symbolp f) (or (not i) (not (listp i)))) 2263 (when (and (symbolp f) (or (not i) (not (listp i))))
2266 (insert (org-add-props (copy-sequence "1") nil 'face f)))) 2264 (insert (org-add-props (copy-sequence "1") nil 'face f))))
2267 (htmlize-region (point-min) (point-max)))) 2265 (htmlize-region (point-min) (point-max))))
2268 (org-pop-to-buffer-same-window "*html*") 2266 (switch-to-buffer "*html*")
2269 (goto-char (point-min)) 2267 (goto-char (point-min))
2270 (if (re-search-forward "<style" nil t) 2268 (if (re-search-forward "<style" nil t)
2271 (delete-region (point-min) (match-beginning 0))) 2269 (delete-region (point-min) (match-beginning 0)))
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el
index c840d5aeb75..c2d5cf0f25b 100644
--- a/lisp/org/org-id.el
+++ b/lisp/org/org-id.el
@@ -74,8 +74,6 @@
74(require 'org) 74(require 'org)
75 75
76(declare-function message-make-fqdn "message" ()) 76(declare-function message-make-fqdn "message" ())
77(declare-function org-pop-to-buffer-same-window
78 "org-compat" (&optional buffer-or-name norecord label))
79 77
80;;; Customization 78;;; Customization
81 79
@@ -255,7 +253,7 @@ Move the cursor to that entry in that buffer."
255 (let ((m (org-id-find id 'marker))) 253 (let ((m (org-id-find id 'marker)))
256 (unless m 254 (unless m
257 (error "Cannot find entry with ID \"%s\"" id)) 255 (error "Cannot find entry with ID \"%s\"" id))
258 (org-pop-to-buffer-same-window (marker-buffer m)) 256 (switch-to-buffer (marker-buffer m))
259 (goto-char m) 257 (goto-char m)
260 (move-marker m nil) 258 (move-marker m nil)
261 (org-show-context))) 259 (org-show-context)))
diff --git a/lisp/org/org-irc.el b/lisp/org/org-irc.el
index c604858b28c..7a84d2053ad 100644
--- a/lisp/org/org-irc.el
+++ b/lisp/org/org-irc.el
@@ -60,8 +60,6 @@
60(declare-function erc-server-buffer "erc" ()) 60(declare-function erc-server-buffer "erc" ())
61(declare-function erc-get-server-nickname-list "erc" ()) 61(declare-function erc-get-server-nickname-list "erc" ())
62(declare-function erc-cmd-JOIN "erc" (channel &optional key)) 62(declare-function erc-cmd-JOIN "erc" (channel &optional key))
63(declare-function org-pop-to-buffer-same-window
64 "org-compat" (&optional buffer-or-name norecord label))
65 63
66(defvar org-irc-client 'erc 64(defvar org-irc-client 'erc
67 "The IRC client to act on.") 65 "The IRC client to act on.")
@@ -234,7 +232,7 @@ default."
234 (throw 'found x)))))) 232 (throw 'found x))))))
235 (if chan-buf 233 (if chan-buf
236 (progn 234 (progn
237 (org-pop-to-buffer-same-window chan-buf) 235 (switch-to-buffer chan-buf)
238 ;; if we got a nick, and they're in the chan, 236 ;; if we got a nick, and they're in the chan,
239 ;; then start a chat with them 237 ;; then start a chat with them
240 (let ((nick (pop link))) 238 (let ((nick (pop link)))
@@ -245,9 +243,9 @@ default."
245 (insert (concat nick ": "))) 243 (insert (concat nick ": ")))
246 (error "%s not found in %s" nick chan-name))))) 244 (error "%s not found in %s" nick chan-name)))))
247 (progn 245 (progn
248 (org-pop-to-buffer-same-window server-buffer) 246 (switch-to-buffer server-buffer)
249 (erc-cmd-JOIN chan-name)))) 247 (erc-cmd-JOIN chan-name))))
250 (org-pop-to-buffer-same-window server-buffer))) 248 (switch-to-buffer server-buffer)))
251 ;; no server match, make new connection 249 ;; no server match, make new connection
252 (erc-select :server server :port port)))) 250 (erc-select :server server :port port))))
253 251
diff --git a/lisp/org/org-mobile.el b/lisp/org/org-mobile.el
index df01ee44f7d..f270419877e 100644
--- a/lisp/org/org-mobile.el
+++ b/lisp/org/org-mobile.el
@@ -38,9 +38,6 @@
38 38
39(eval-when-compile (require 'cl)) 39(eval-when-compile (require 'cl))
40 40
41(declare-function org-pop-to-buffer-same-window
42 "org-compat" (&optional buffer-or-name norecord label))
43
44(defgroup org-mobile nil 41(defgroup org-mobile nil
45 "Options concerning support for a viewer/editor on a mobile device." 42 "Options concerning support for a viewer/editor on a mobile device."
46 :tag "Org Mobile" 43 :tag "Org Mobile"
@@ -912,7 +909,7 @@ If BEG and END are given, only do this in that region."
912 (buffer-file-name (current-buffer)))))) 909 (buffer-file-name (current-buffer))))))
913 (error (setq org-mobile-error msg)))) 910 (error (setq org-mobile-error msg))))
914 (when org-mobile-error 911 (when org-mobile-error
915 (org-pop-to-buffer-same-window (marker-buffer marker)) 912 (switch-to-buffer (marker-buffer marker))
916 (goto-char marker) 913 (goto-char marker)
917 (incf cnt-error) 914 (incf cnt-error)
918 (insert (if (stringp (nth 1 org-mobile-error)) 915 (insert (if (stringp (nth 1 org-mobile-error))
diff --git a/lisp/org/org-publish.el b/lisp/org/org-publish.el
index 05f82c154e5..ddb3cf7b63a 100644
--- a/lisp/org/org-publish.el
+++ b/lisp/org/org-publish.el
@@ -369,8 +369,6 @@ This is a compatibility function for Emacsen without `delete-dups'."
369 369
370(declare-function org-publish-delete-dups "org-publish" (list)) 370(declare-function org-publish-delete-dups "org-publish" (list))
371(declare-function find-lisp-find-files "find-lisp" (directory regexp)) 371(declare-function find-lisp-find-files "find-lisp" (directory regexp))
372(declare-function org-pop-to-buffer-same-window
373 "org-compat" (&optional buffer-or-name norecord label))
374 372
375;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 373;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376;;; Getting project information out of org-publish-project-alist 374;;; Getting project information out of org-publish-project-alist
@@ -561,7 +559,7 @@ PUB-DIR is the publishing directory."
561 (make-directory pub-dir t)) 559 (make-directory pub-dir t))
562 (let ((visiting (find-buffer-visiting filename))) 560 (let ((visiting (find-buffer-visiting filename)))
563 (save-excursion 561 (save-excursion
564 (org-pop-to-buffer-same-window (or visiting (find-file filename))) 562 (switch-to-buffer (or visiting (find-file filename)))
565 (let* ((plist (cons :buffer-will-be-killed (cons t plist))) 563 (let* ((plist (cons :buffer-will-be-killed (cons t plist)))
566 (init-buf (current-buffer)) 564 (init-buf (current-buffer))
567 (init-point (point)) 565 (init-point (point))
@@ -862,7 +860,7 @@ system's modification time.
862It returns time in `current-time' format." 860It returns time in `current-time' format."
863 (let ((visiting (find-buffer-visiting file))) 861 (let ((visiting (find-buffer-visiting file)))
864 (save-excursion 862 (save-excursion
865 (org-pop-to-buffer-same-window (or visiting (find-file-noselect file nil t))) 863 (switch-to-buffer (or visiting (find-file-noselect file nil t)))
866 (let* ((plist (org-infile-export-plist)) 864 (let* ((plist (org-infile-export-plist))
867 (date (plist-get plist :date))) 865 (date (plist-get plist :date)))
868 (unless visiting 866 (unless visiting
diff --git a/lisp/org/org-remember.el b/lisp/org/org-remember.el
index 0eb4f899e14..2bc5ef92ae7 100644
--- a/lisp/org/org-remember.el
+++ b/lisp/org/org-remember.el
@@ -40,8 +40,6 @@
40(declare-function remember "remember" (&optional initial)) 40(declare-function remember "remember" (&optional initial))
41(declare-function remember-buffer-desc "remember" ()) 41(declare-function remember-buffer-desc "remember" ())
42(declare-function remember-finalize "remember" ()) 42(declare-function remember-finalize "remember" ())
43(declare-function org-pop-to-buffer-same-window
44 "org-compat" (&optional buffer-or-name norecord label))
45 43
46(defvar remember-save-after-remembering) 44(defvar remember-save-after-remembering)
47(defvar remember-register) 45(defvar remember-register)
@@ -788,7 +786,7 @@ The user is queried for the template."
788 (setq heading org-remember-default-headline)) 786 (setq heading org-remember-default-headline))
789 (setq visiting (org-find-base-buffer-visiting file)) 787 (setq visiting (org-find-base-buffer-visiting file))
790 (if (not visiting) (find-file-noselect file)) 788 (if (not visiting) (find-file-noselect file))
791 (org-pop-to-buffer-same-window (or visiting (get-file-buffer file))) 789 (switch-to-buffer (or visiting (get-file-buffer file)))
792 (widen) 790 (widen)
793 (goto-char (point-min)) 791 (goto-char (point-min))
794 (if (re-search-forward 792 (if (re-search-forward
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el
index dd56b120219..5de55fa455f 100644
--- a/lisp/org/org-src.el
+++ b/lisp/org/org-src.el
@@ -42,8 +42,6 @@
42(declare-function org-at-table.el-p "org" ()) 42(declare-function org-at-table.el-p "org" ())
43(declare-function org-get-indentation "org" (&optional line)) 43(declare-function org-get-indentation "org" (&optional line))
44(declare-function org-switch-to-buffer-other-window "org" (&rest args)) 44(declare-function org-switch-to-buffer-other-window "org" (&rest args))
45(declare-function org-pop-to-buffer-same-window
46 "org-compat" (&optional buffer-or-name norecord label))
47 45
48(defcustom org-edit-src-region-extra nil 46(defcustom org-edit-src-region-extra nil
49 "Additional regexps to identify regions for editing with `org-edit-src-code'. 47 "Additional regexps to identify regions for editing with `org-edit-src-code'.
@@ -341,7 +339,7 @@ buffer."
341(defun org-src-switch-to-buffer (buffer context) 339(defun org-src-switch-to-buffer (buffer context)
342 (case org-src-window-setup 340 (case org-src-window-setup
343 ('current-window 341 ('current-window
344 (org-pop-to-buffer-same-window buffer)) 342 (switch-to-buffer buffer))
345 ('other-window 343 ('other-window
346 (switch-to-buffer-other-window buffer)) 344 (switch-to-buffer-other-window buffer))
347 ('other-frame 345 ('other-frame
@@ -352,7 +350,7 @@ buffer."
352 (delete-frame frame))) 350 (delete-frame frame)))
353 ('save 351 ('save
354 (kill-buffer (current-buffer)) 352 (kill-buffer (current-buffer))
355 (org-pop-to-buffer-same-window buffer)) 353 (switch-to-buffer buffer))
356 (t 354 (t
357 (switch-to-buffer-other-frame buffer)))) 355 (switch-to-buffer-other-frame buffer))))
358 ('reorganize-frame 356 ('reorganize-frame
@@ -364,7 +362,7 @@ buffer."
364 (t 362 (t
365 (message "Invalid value %s for org-src-window-setup" 363 (message "Invalid value %s for org-src-window-setup"
366 (symbol-name org-src-window-setup)) 364 (symbol-name org-src-window-setup))
367 (org-pop-to-buffer-same-window buffer)))) 365 (switch-to-buffer buffer))))
368 366
369(defun org-src-construct-edit-buffer-name (org-buffer-name lang) 367(defun org-src-construct-edit-buffer-name (org-buffer-name lang)
370 "Construct the buffer name for a source editing buffer." 368 "Construct the buffer name for a source editing buffer."
@@ -424,7 +422,7 @@ the fragment in the Org-mode buffer."
424 begline (save-excursion (goto-char beg) (org-current-line))) 422 begline (save-excursion (goto-char beg) (org-current-line)))
425 (if (and (setq buffer (org-edit-src-find-buffer beg end)) 423 (if (and (setq buffer (org-edit-src-find-buffer beg end))
426 (y-or-n-p "Return to existing edit buffer? [n] will revert changes: ")) 424 (y-or-n-p "Return to existing edit buffer? [n] will revert changes: "))
427 (org-pop-to-buffer-same-window buffer) 425 (switch-to-buffer buffer)
428 (when buffer 426 (when buffer
429 (with-current-buffer buffer 427 (with-current-buffer buffer
430 (if (boundp 'org-edit-src-overlay) 428 (if (boundp 'org-edit-src-overlay)
@@ -444,7 +442,7 @@ the fragment in the Org-mode buffer."
444 (define-key map [mouse-1] 'org-edit-src-continue) 442 (define-key map [mouse-1] 'org-edit-src-continue)
445 map)) 443 map))
446 (overlay-put ovl :read-only "Leave me alone") 444 (overlay-put ovl :read-only "Leave me alone")
447 (org-pop-to-buffer-same-window buffer) 445 (switch-to-buffer buffer)
448 (insert code) 446 (insert code)
449 (remove-text-properties (point-min) (point-max) 447 (remove-text-properties (point-min) (point-max)
450 '(display nil invisible nil intangible nil)) 448 '(display nil invisible nil intangible nil))
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 341525537bb..d494bdb28fa 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -105,7 +105,6 @@
105(declare-function org-inlinetask-at-task-p "org-inlinetask" ()) 105(declare-function org-inlinetask-at-task-p "org-inlinetask" ())
106(declare-function org-inlinetask-outline-regexp "org-inlinetask" ()) 106(declare-function org-inlinetask-outline-regexp "org-inlinetask" ())
107(declare-function org-inlinetask-toggle-visibility "org-inlinetask" ()) 107(declare-function org-inlinetask-toggle-visibility "org-inlinetask" ())
108(declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label))
109(declare-function org-at-clock-log-p "org-clock" ()) 108(declare-function org-at-clock-log-p "org-clock" ())
110(declare-function org-clock-timestamps-up "org-clock" ()) 109(declare-function org-clock-timestamps-up "org-clock" ())
111(declare-function org-clock-timestamps-down "org-clock" ()) 110(declare-function org-clock-timestamps-down "org-clock" ())
@@ -6651,7 +6650,7 @@ or nil."
6651 (save-window-excursion 6650 (save-window-excursion
6652 (delete-other-windows) 6651 (delete-other-windows)
6653 (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*")) 6652 (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*"))
6654 (org-pop-to-buffer-same-window 6653 (switch-to-buffer
6655 (condition-case nil 6654 (condition-case nil
6656 (make-indirect-buffer (current-buffer) "*org-goto*") 6655 (make-indirect-buffer (current-buffer) "*org-goto*")
6657 (error (make-indirect-buffer (current-buffer) "*org-goto*")))) 6656 (error (make-indirect-buffer (current-buffer) "*org-goto*"))))
@@ -6789,7 +6788,7 @@ frame is not changed."
6789 (and arg (eq org-indirect-buffer-display 'dedicated-frame))) 6788 (and arg (eq org-indirect-buffer-display 'dedicated-frame)))
6790 (select-frame (make-frame)) 6789 (select-frame (make-frame))
6791 (delete-other-windows) 6790 (delete-other-windows)
6792 (org-pop-to-buffer-same-window ibuf) 6791 (switch-to-buffer ibuf)
6793 (org-set-frame-title heading)) 6792 (org-set-frame-title heading))
6794 ((eq org-indirect-buffer-display 'dedicated-frame) 6793 ((eq org-indirect-buffer-display 'dedicated-frame)
6795 (raise-frame 6794 (raise-frame
@@ -6798,10 +6797,10 @@ frame is not changed."
6798 org-indirect-dedicated-frame) 6797 org-indirect-dedicated-frame)
6799 (setq org-indirect-dedicated-frame (make-frame))))) 6798 (setq org-indirect-dedicated-frame (make-frame)))))
6800 (delete-other-windows) 6799 (delete-other-windows)
6801 (org-pop-to-buffer-same-window ibuf) 6800 (switch-to-buffer ibuf)
6802 (org-set-frame-title (concat "Indirect: " heading))) 6801 (org-set-frame-title (concat "Indirect: " heading)))
6803 ((eq org-indirect-buffer-display 'current-window) 6802 ((eq org-indirect-buffer-display 'current-window)
6804 (org-pop-to-buffer-same-window ibuf)) 6803 (switch-to-buffer ibuf))
6805 ((eq org-indirect-buffer-display 'other-window) 6804 ((eq org-indirect-buffer-display 'other-window)
6806 (pop-to-buffer ibuf)) 6805 (pop-to-buffer ibuf))
6807 (t (error "Invalid value"))) 6806 (t (error "Invalid value")))
@@ -9833,7 +9832,7 @@ onto the ring."
9833 (setq p org-mark-ring)) 9832 (setq p org-mark-ring))
9834 (setq org-mark-ring-last-goto p) 9833 (setq org-mark-ring-last-goto p)
9835 (setq m (car p)) 9834 (setq m (car p))
9836 (org-pop-to-buffer-same-window (marker-buffer m)) 9835 (switch-to-buffer (marker-buffer m))
9837 (goto-char m) 9836 (goto-char m)
9838 (if (or (outline-invisible-p) (org-invisible-p2)) (org-show-context 'mark-goto)))) 9837 (if (or (outline-invisible-p) (org-invisible-p2)) (org-show-context 'mark-goto))))
9839 9838
@@ -10429,7 +10428,7 @@ prefix argument (`C-u C-u C-u C-c C-w')."
10429 (find-file-noselect file))) 10428 (find-file-noselect file)))
10430 (if goto 10429 (if goto
10431 (progn 10430 (progn
10432 (org-pop-to-buffer-same-window nbuf) 10431 (switch-to-buffer nbuf)
10433 (goto-char pos) 10432 (goto-char pos)
10434 (org-show-context 'org-goto)) 10433 (org-show-context 'org-goto))
10435 (if regionp 10434 (if regionp
@@ -12041,7 +12040,7 @@ EXTRA is additional text that will be inserted into the notes buffer."
12041 (setq org-log-note-window-configuration (current-window-configuration)) 12040 (setq org-log-note-window-configuration (current-window-configuration))
12042 (delete-other-windows) 12041 (delete-other-windows)
12043 (move-marker org-log-note-return-to (point)) 12042 (move-marker org-log-note-return-to (point))
12044 (org-pop-to-buffer-same-window (marker-buffer org-log-note-marker)) 12043 (switch-to-buffer (marker-buffer org-log-note-marker))
12045 (goto-char org-log-note-marker) 12044 (goto-char org-log-note-marker)
12046 (org-switch-to-buffer-other-window "*Org Note*") 12045 (org-switch-to-buffer-other-window "*Org Note*")
12047 (erase-buffer) 12046 (erase-buffer)
@@ -15883,7 +15882,7 @@ changes from another. I believe the procedure must be like this:
15883 (lambda (b) 15882 (lambda (b)
15884 (when (and (with-current-buffer b (org-mode-p)) 15883 (when (and (with-current-buffer b (org-mode-p))
15885 (with-current-buffer b buffer-file-name)) 15884 (with-current-buffer b buffer-file-name))
15886 (org-pop-to-buffer-same-window b) 15885 (switch-to-buffer b)
15887 (revert-buffer t 'no-confirm))) 15886 (revert-buffer t 'no-confirm)))
15888 (buffer-list)) 15887 (buffer-list))
15889 (when (and (featurep 'org-id) org-id-track-globally) 15888 (when (and (featurep 'org-id) org-id-track-globally)
@@ -15907,7 +15906,7 @@ Set `org-completion-use-ido' to make it use ido instead."
15907 (org-completion-use-ido org-completion-use-ido)) 15906 (org-completion-use-ido org-completion-use-ido))
15908 (unless (or org-completion-use-ido org-completion-use-iswitchb) 15907 (unless (or org-completion-use-ido org-completion-use-iswitchb)
15909 (setq org-completion-use-iswitchb t)) 15908 (setq org-completion-use-iswitchb t))
15910 (org-pop-to-buffer-same-window 15909 (switch-to-buffer
15911 (org-icompleting-read "Org buffer: " 15910 (org-icompleting-read "Org buffer: "
15912 (mapcar 'list (mapcar 'buffer-name blist)) 15911 (mapcar 'list (mapcar 'buffer-name blist))
15913 nil t)))) 15912 nil t))))
@@ -16074,7 +16073,7 @@ If the current buffer does not, find the first agenda file."
16074 (find-file (car files)) 16073 (find-file (car files))
16075 (throw 'exit t)))) 16074 (throw 'exit t))))
16076 (find-file (car fs))) 16075 (find-file (car fs)))
16077 (if (buffer-base-buffer) (org-pop-to-buffer-same-window (buffer-base-buffer))))) 16076 (if (buffer-base-buffer) (switch-to-buffer (buffer-base-buffer)))))
16078 16077
16079(defun org-agenda-file-to-front (&optional to-end) 16078(defun org-agenda-file-to-front (&optional to-end)
16080 "Move/add the current file to the top of the agenda file list. 16079 "Move/add the current file to the top of the agenda file list.
@@ -18511,7 +18510,7 @@ information about your Org-mode version and configuration."
18511 (org-version) 18510 (org-version)
18512 (let (list) 18511 (let (list)
18513 (save-window-excursion 18512 (save-window-excursion
18514 (org-pop-to-buffer-same-window (get-buffer-create "*Warn about privacy*")) 18513 (switch-to-buffer (get-buffer-create "*Warn about privacy*"))
18515 (delete-other-windows) 18514 (delete-other-windows)
18516 (erase-buffer) 18515 (erase-buffer)
18517 (insert "You are about to submit a bug report to the Org-mode mailing list. 18516 (insert "You are about to submit a bug report to the Org-mode mailing list.
@@ -18708,7 +18707,7 @@ With prefix arg UNCOMPILED, load the uncompiled versions."
18708 (if (and marker (marker-buffer marker) 18707 (if (and marker (marker-buffer marker)
18709 (buffer-live-p (marker-buffer marker))) 18708 (buffer-live-p (marker-buffer marker)))
18710 (progn 18709 (progn
18711 (org-pop-to-buffer-same-window (marker-buffer marker)) 18710 (switch-to-buffer (marker-buffer marker))
18712 (if (or (> marker (point-max)) (< marker (point-min))) 18711 (if (or (> marker (point-max)) (< marker (point-min)))
18713 (widen)) 18712 (widen))
18714 (goto-char marker) 18713 (goto-char marker)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 79fec080d57..5f99cfe0028 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -2413,7 +2413,7 @@ and overlay is highlighted between MK and END-MK."
2413 ;; display the source in another window. 2413 ;; display the source in another window.
2414 (let ((pop-up-windows t)) 2414 (let ((pop-up-windows t))
2415 (pop-to-buffer (marker-buffer mk) 'other-window)) 2415 (pop-to-buffer (marker-buffer mk) 'other-window))
2416 (pop-to-buffer-same-window (marker-buffer mk))) 2416 (switch-to-buffer (marker-buffer mk)))
2417 (unless (eq (goto-char mk) (point)) 2417 (unless (eq (goto-char mk) (point))
2418 ;; If narrowing gets in the way of going to the right place, widen. 2418 ;; If narrowing gets in the way of going to the right place, widen.
2419 (widen) 2419 (widen)
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 709f01444bf..eeebcc6648f 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -459,7 +459,7 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
459 ;; GREP_COLOR is used in GNU grep 2.5.1, but deprecated in later versions 459 ;; GREP_COLOR is used in GNU grep 2.5.1, but deprecated in later versions
460 (setenv "GREP_COLOR" "01;31") 460 (setenv "GREP_COLOR" "01;31")
461 ;; GREP_COLORS is used in GNU grep 2.5.2 and later versions 461 ;; GREP_COLORS is used in GNU grep 2.5.2 and later versions
462 (setenv "GREP_COLORS" "mt=01;31:fn=:ln=:bn=:se=:ml=:cx=:ne")) 462 (setenv "GREP_COLORS" "mt=01;31:fn=:ln=:bn=:se=:sl=:cx=:ne"))
463 (set (make-local-variable 'compilation-exit-message-function) 463 (set (make-local-variable 'compilation-exit-message-function)
464 (lambda (status code msg) 464 (lambda (status code msg)
465 (if (eq status 'exit) 465 (if (eq status 'exit)
@@ -480,20 +480,21 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
480This function is called from `compilation-filter-hook'." 480This function is called from `compilation-filter-hook'."
481 (save-excursion 481 (save-excursion
482 (forward-line 0) 482 (forward-line 0)
483 (let ((end (point))) 483 (let ((end (point)) beg)
484 (goto-char compilation-filter-start) 484 (goto-char compilation-filter-start)
485 (forward-line 0) 485 (forward-line 0)
486 (setq beg (point))
486 ;; Only operate on whole lines so we don't get caught with part of an 487 ;; Only operate on whole lines so we don't get caught with part of an
487 ;; escape sequence in one chunk and the rest in another. 488 ;; escape sequence in one chunk and the rest in another.
488 (when (< (point) end) 489 (when (< (point) end)
489 (setq end (copy-marker end)) 490 (setq end (copy-marker end))
490 ;; Highlight grep matches and delete marking sequences. 491 ;; Highlight grep matches and delete marking sequences.
491 (while (re-search-forward "\033\\[01;31m\\(.*?\\)\033\\[[0-9]*m" end 1) 492 (while (re-search-forward "\033\\[0?1;31m\\(.*?\\)\033\\[[0-9]*m" end 1)
492 (replace-match (propertize (match-string 1) 493 (replace-match (propertize (match-string 1)
493 'face nil 'font-lock-face grep-match-face) 494 'face nil 'font-lock-face grep-match-face)
494 t t)) 495 t t))
495 ;; Delete all remaining escape sequences 496 ;; Delete all remaining escape sequences
496 (goto-char compilation-filter-start) 497 (goto-char beg)
497 (while (re-search-forward "\033\\[[0-9;]*[mK]" end 1) 498 (while (re-search-forward "\033\\[[0-9;]*[mK]" end 1)
498 (replace-match "" t t)))))) 499 (replace-match "" t t))))))
499 500
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 4d2f15c69d8..3f923f496b9 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -296,7 +296,7 @@ Used for syntactic keywords. N is the match number (1, 2 or 3)."
296 :filter (lambda (&rest junk) 296 :filter (lambda (&rest junk)
297 (abbrev-table-menu python-mode-abbrev-table))) 297 (abbrev-table-menu python-mode-abbrev-table)))
298 "-" 298 "-"
299 ["Start interpreter" python-shell 299 ["Start interpreter" run-python
300 :help "Run `inferior' Python in separate buffer"] 300 :help "Run `inferior' Python in separate buffer"]
301 ["Import/reload file" python-load-file 301 ["Import/reload file" python-load-file
302 :help "Load into inferior Python session"] 302 :help "Load into inferior Python session"]
@@ -328,14 +328,6 @@ Used for syntactic keywords. N is the match number (1, 2 or 3)."
328;; eric has items including: (un)indent, (un)comment, restart script, 328;; eric has items including: (un)indent, (un)comment, restart script,
329;; run script, debug script; also things for profiling, unit testing. 329;; run script, debug script; also things for profiling, unit testing.
330 330
331(defvar python-shell-map
332 (let ((map (copy-keymap comint-mode-map)))
333 (define-key map [tab] 'tab-to-tab-stop)
334 (define-key map "\C-c-" 'py-up-exception)
335 (define-key map "\C-c=" 'py-down-exception)
336 map)
337 "Keymap used in *Python* shell buffers.")
338
339(defvar python-mode-syntax-table 331(defvar python-mode-syntax-table
340 (let ((table (make-syntax-table))) 332 (let ((table (make-syntax-table)))
341 ;; Give punctuation syntax to ASCII that normally has symbol 333 ;; Give punctuation syntax to ASCII that normally has symbol
@@ -1345,7 +1337,7 @@ local value.")
1345 (define-key map "\C-c\C-l" 'python-load-file) 1337 (define-key map "\C-c\C-l" 'python-load-file)
1346 (define-key map "\C-c\C-v" 'python-check) 1338 (define-key map "\C-c\C-v" 'python-check)
1347 ;; Note that we _can_ still use these commands which send to the 1339 ;; Note that we _can_ still use these commands which send to the
1348 ;; Python process even at the prompt iff we have a normal prompt, 1340 ;; Python process even at the prompt if we have a normal prompt,
1349 ;; i.e. '>>> ' and not '... '. See the comment before 1341 ;; i.e. '>>> ' and not '... '. See the comment before
1350 ;; python-send-region. Fixme: uncomment these if we address that. 1342 ;; python-send-region. Fixme: uncomment these if we address that.
1351 1343
diff --git a/lisp/subr.el b/lisp/subr.el
index b49a20e7f6e..a2676b1173d 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2254,7 +2254,7 @@ is nil and `use-dialog-box' is non-nil."
2254 (listp last-nonmenu-event) 2254 (listp last-nonmenu-event)
2255 use-dialog-box) 2255 use-dialog-box)
2256 (setq answer 2256 (setq answer
2257 (x-popup-dialog t `(,prompt ("yes" . act) ("No" . skip)))) 2257 (x-popup-dialog t `(,prompt ("Yes" . act) ("No" . skip))))
2258 (setq prompt (concat prompt 2258 (setq prompt (concat prompt
2259 (if (eq ?\s (aref prompt (1- (length prompt)))) 2259 (if (eq ?\s (aref prompt (1- (length prompt))))
2260 "" " ") 2260 "" " ")
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index a660bdb6488..0383251523f 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -3060,7 +3060,7 @@ When called interactively, FORCE is t, CURRENT is t if current buffer uses
3060 ;; select BibTeX buffer 3060 ;; select BibTeX buffer
3061 (if select 3061 (if select
3062 (if buffer-list 3062 (if buffer-list
3063 (pop-to-buffer-same-window 3063 (switch-to-buffer
3064 (completing-read "Switch to BibTeX buffer: " 3064 (completing-read "Switch to BibTeX buffer: "
3065 (mapcar 'buffer-name buffer-list) 3065 (mapcar 'buffer-name buffer-list)
3066 nil t 3066 nil t
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index 488efaa3522..8051009a983 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -314,7 +314,10 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
314(defun vc-rcs-responsible-p (file) 314(defun vc-rcs-responsible-p (file)
315 "Return non-nil if RCS thinks it would be responsible for registering FILE." 315 "Return non-nil if RCS thinks it would be responsible for registering FILE."
316 ;; TODO: check for all the patterns in vc-rcs-master-templates 316 ;; TODO: check for all the patterns in vc-rcs-master-templates
317 (file-directory-p (expand-file-name "RCS" (file-name-directory file)))) 317 (file-directory-p (expand-file-name "RCS"
318 (if (file-directory-p file)
319 file
320 (file-name-directory file)))))
318 321
319(defun vc-rcs-receive-file (file rev) 322(defun vc-rcs-receive-file (file rev)
320 "Implementation of receive-file for RCS." 323 "Implementation of receive-file for RCS."
diff --git a/lisp/view.el b/lisp/view.el
index 96fecd9df1c..11cbc79449f 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -318,7 +318,7 @@ EXIT-ACTION to `kill-buffer-if-not-modified' avoids this."
318 (progn 318 (progn
319 (switch-to-buffer buffer) 319 (switch-to-buffer buffer)
320 (message "Not using View mode because the major mode is special")) 320 (message "Not using View mode because the major mode is special"))
321 (pop-to-buffer-same-window buffer) 321 (switch-to-buffer buffer)
322 (view-mode-enter nil exit-action))) 322 (view-mode-enter nil exit-action)))
323 323
324;;;###autoload 324;;;###autoload
diff --git a/lisp/window.el b/lisp/window.el
index 8bdf4131c51..5272841a9c7 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -2291,29 +2291,45 @@ frame."
2291 (setq window (window-atom-root window)))) 2291 (setq window (window-atom-root window))))
2292 (let ((parent (window-parent window)) 2292 (let ((parent (window-parent window))
2293 (frame (window-frame window)) 2293 (frame (window-frame window))
2294 (buffer (window-buffer window))
2294 (dedicated (and (window-buffer window) (window-dedicated-p window))) 2295 (dedicated (and (window-buffer window) (window-dedicated-p window)))
2295 (quit-restore (window-parameter window 'quit-restore))) 2296 (quit-restore (window-parameter window 'quit-restore)))
2296 (cond 2297 (cond
2297 ((frame-root-window-p window) 2298 ((frame-root-window-p window)
2299 ;; Don't delete FRAME if `frame-auto-delete' is nil.
2298 (when (and (or (eq frame-auto-delete t) 2300 (when (and (or (eq frame-auto-delete t)
2299 (and (eq frame-auto-delete 'automatic) 2301 (and (eq frame-auto-delete 'automatic)
2302 ;; Delete FRAME only if it's either dedicated
2303 ;; or quit-restore's car is `new-frame' and
2304 ;; WINDOW still displays the same buffer
2300 (or dedicated 2305 (or dedicated
2301 (and (eq (car-safe quit-restore) 'new-frame) 2306 (and (eq (car-safe quit-restore) 'new-frame)
2302 (eq (nth 1 quit-restore) 2307 (eq (nth 1 quit-restore)
2303 (window-buffer window)))))) 2308 (window-buffer window))))))
2309 ;; Don't delete FRAME if we have another buffer in
2310 ;; WINDOW's previous buffers. Bug#9419.
2311 (or (not (window-prev-buffers window))
2312 (eq (caar (window-prev-buffers window)) buffer))
2313 ;; Don't try to delete FRAME when there are no other
2314 ;; visible frames left.
2304 (other-visible-frames-p frame)) 2315 (other-visible-frames-p frame))
2305 ;; WINDOW is the root window of its frame. Return `frame' but
2306 ;; only if WINDOW is (1) either dedicated or quit-restore's car
2307 ;; is `new-frame' and the window still displays the same buffer
2308 ;; and (2) there are other frames left.
2309 'frame)) 2316 'frame))
2310 ((and (not ignore-window-parameters) 2317 ;; Don't delete WINDOW if we find another buffer in WINDOW's
2311 (eq (window-parameter window 'window-side) 'none) 2318 ;; previous buffers.
2312 (or (not parent) 2319 ((and (or (not (window-prev-buffers window))
2313 (not (eq (window-parameter parent 'window-side) 'none)))) 2320 (eq (caar (window-prev-buffers window)) buffer))
2314 ;; Can't delete last main window. 2321 ;; Delete WINDOW only if it's dedicated or quit-restore's car
2315 nil) 2322 ;; is `new-frame' or `new-window' and it still displays the
2316 (t)))) 2323 ;; same buffer.
2324 (or dedicated
2325 (and (memq (car-safe quit-restore) '(new-window new-frame))
2326 (eq (nth 1 quit-restore) (window-buffer window))))
2327 ;; Don't delete the last main window.
2328 (or ignore-window-parameters
2329 (not (eq (window-parameter window 'window-side) 'none))
2330 (and parent
2331 (eq (window-parameter parent 'window-side) 'none))))
2332 t))))
2317 2333
2318(defun window-or-subwindow-p (subwindow window) 2334(defun window-or-subwindow-p (subwindow window)
2319 "Return t if SUBWINDOW is either WINDOW or a subwindow of WINDOW." 2335 "Return t if SUBWINDOW is either WINDOW or a subwindow of WINDOW."
@@ -4584,7 +4600,8 @@ frame (actually the last non-minibuffer frame), except if
4584case check all visible or iconified frames. Otherwise, FRAME can 4600case check all visible or iconified frames. Otherwise, FRAME can
4585be a specific frame, `visible' (all visible frames), 0 (all 4601be a specific frame, `visible' (all visible frames), 0 (all
4586frames on the current terminal), or t (all frames)." 4602frames on the current terminal), or t (all frames)."
4587 (interactive "BDisplay buffer:\nP") 4603 (interactive (list (read-buffer "Display buffer: " (other-buffer))
4604 (if current-prefix-arg t)))
4588 (let ((buffer (window-normalize-buffer-to-display buffer-or-name)) 4605 (let ((buffer (window-normalize-buffer-to-display buffer-or-name))
4589 ;; Handle the old form of the first argument. 4606 ;; Handle the old form of the first argument.
4590 (inhibit-same-window (and action (not (listp action))))) 4607 (inhibit-same-window (and action (not (listp action)))))
@@ -4609,7 +4626,7 @@ frames on the current terminal), or t (all frames)."
4609 (functions (apply 'append 4626 (functions (apply 'append
4610 (mapcar (lambda (x) 4627 (mapcar (lambda (x)
4611 (setq x (car x)) 4628 (setq x (car x))
4612 (if (listp x) x (list x))) 4629 (if (functionp x) (list x) x))
4613 actions))) 4630 actions)))
4614 (alist (apply 'append (mapcar 'cdr actions))) 4631 (alist (apply 'append (mapcar 'cdr actions)))
4615 window) 4632 window)
@@ -4713,7 +4730,10 @@ return the window on the new frame; otherwise return nil."
4713 (setq frame (funcall fun)) 4730 (setq frame (funcall fun))
4714 (setq window (frame-selected-window frame))) 4731 (setq window (frame-selected-window frame)))
4715 (display-buffer-record-window 'pop-up-frame window buffer) 4732 (display-buffer-record-window 'pop-up-frame window buffer)
4716 (window--display-buffer-2 buffer window)))) 4733 (window--display-buffer-2 buffer window)
4734 ;; Reset list of WINDOW's previous buffers to nil.
4735 (set-window-prev-buffers window nil)
4736 window)))
4717 4737
4718(defun display-buffer-pop-up-window (buffer alist) 4738(defun display-buffer-pop-up-window (buffer alist)
4719 "Display BUFFER by popping up a new window. 4739 "Display BUFFER by popping up a new window.
@@ -4736,7 +4756,10 @@ If sucessful, return the new window; otherwise return nil."
4736 (window--try-to-split-window 4756 (window--try-to-split-window
4737 (get-lru-window frame t))))) 4757 (get-lru-window frame t)))))
4738 (display-buffer-record-window 'pop-up-window window buffer) 4758 (display-buffer-record-window 'pop-up-window window buffer)
4739 (window--display-buffer-2 buffer window)))) 4759 (window--display-buffer-2 buffer window)
4760 ;; Reset list of WINDOW's previous buffers to nil.
4761 (set-window-prev-buffers window nil)
4762 window)))
4740 4763
4741;; This display action function groups together some lower-level ones: 4764;; This display action function groups together some lower-level ones:
4742(defun display-buffer-reuse-or-pop-window (buffer alist) 4765(defun display-buffer-reuse-or-pop-window (buffer alist)
@@ -4822,70 +4845,42 @@ return the window. If no suitable window is found, return nil."
4822 4845
4823;;; Display + selection commands: 4846;;; Display + selection commands:
4824 4847
4825(defun pop-to-buffer (buffer-or-name &optional other-window norecord) 4848(defun pop-to-buffer (buffer &optional action norecord)
4826 "Select buffer BUFFER-OR-NAME in some window, preferably a different one. 4849 "Select buffer BUFFER in some window, preferably a different one.
4827BUFFER-OR-NAME may be a buffer, a string \(a buffer name), or 4850BUFFER may be a buffer, a string (a buffer name), or nil. If it
4828nil. If BUFFER-OR-NAME is a string not naming an existent 4851is a string not naming an existent buffer, create a buffer with
4829buffer, create a buffer with that name. If BUFFER-OR-NAME is 4852that name. If BUFFER is nil, choose some other buffer. Return
4830nil, choose some other buffer. 4853the buffer.
4831 4854
4832If `pop-up-windows' is non-nil, windows can be split to display 4855This uses `display-buffer' as a subroutine. The optional ACTION
4833the buffer. If optional second arg OTHER-WINDOW is non-nil, 4856argument is passed to `display-buffer' as its ACTION argument.
4834insist on finding another window even if the specified buffer is 4857See `display-buffer' for more information. ACTION is t if called
4835already visible in the selected window, and ignore 4858interactively with a prefix argument, which means to pop to a
4836`same-window-regexps' and `same-window-buffer-names'. 4859window other than the selected one even if the buffer is already
4837 4860displayed in the selected window.
4838If the window to show BUFFER-OR-NAME is not on the selected 4861
4862If the window to show BUFFER is not on the selected
4839frame, raise that window's frame and give it input focus. 4863frame, raise that window's frame and give it input focus.
4840 4864
4841This function returns the buffer it switched to. This uses the
4842function `display-buffer' as a subroutine; see the documentation
4843of `display-buffer' for additional customization information.
4844
4845Optional third arg NORECORD non-nil means do not put this buffer 4865Optional third arg NORECORD non-nil means do not put this buffer
4846at the front of the list of recently selected ones." 4866at the front of the list of recently selected ones."
4847 (interactive "BPop to buffer:\nP") 4867 (interactive (list (read-buffer "Pop to buffer: " (other-buffer))
4848 (pop-to-buffer-1 buffer-or-name (if other-window t nil) norecord)) 4868 (if current-prefix-arg t)))
4849 4869 (setq buffer (window-normalize-buffer-to-display
4850(defun pop-to-buffer-same-window (&optional buffer-or-name norecord) 4870 ;; BUFFER nil means another buffer.
4851 "Pop to buffer specified by BUFFER-OR-NAME in the selected window. 4871 (or buffer (other-buffer))))
4852Another window will be used only if the buffer can't be shown in 4872 (set-buffer buffer)
4853the selected window, usually because it is dedicated to another 4873 (let* ((old-window (selected-window))
4854buffer. Optional arguments BUFFER-OR-NAME and NORECORD are as 4874 (old-frame (selected-frame))
4855for `pop-to-buffer'." 4875 (window (display-buffer (current-buffer) action))
4856 (interactive "BPop to buffer in selected window:\nP") 4876 (frame (window-frame window)))
4857 (pop-to-buffer-1 buffer-or-name 'same-window norecord)) 4877 (if (eq frame old-frame)
4858 4878 ;; Make sure new window is selected (Bug#8615), (Bug#6954).
4859(defun pop-to-buffer-1 (buffer-or-name window-choice norecord) 4879 (select-window window norecord)
4860 (set-buffer (window-normalize-buffer-to-display 4880 ;; If `display-buffer' has chosen another frame, make sure it
4861 ;; BUFFER-OR-NAME nil means another buffer. 4881 ;; gets input focus.
4862 (or buffer-or-name 4882 (select-frame-set-input-focus frame norecord))
4863 (other-buffer (current-buffer))))) 4883 buffer))
4864 (let ((old-window (selected-window))
4865 (old-frame (selected-frame))
4866 (same-window-buffer-names same-window-buffer-names)
4867 (same-window-regexps same-window-regexps))
4868 (if (eq window-choice t)
4869 (setq same-window-buffer-names nil
4870 same-window-regexps nil))
4871 (let* ((action
4872 ;; Based on the WINDOW-CHOICE argument, choose an action
4873 ;; argument to pass to `display-buffer'.
4874 (cond
4875 ((eq window-choice 'same-window)
4876 '((display-buffer-reuse-selected-window
4877 display-buffer-same-window)))
4878 (window-choice
4879 '(nil (inhibit-same-window . t)))))
4880 (window (display-buffer (current-buffer) action))
4881 (frame (window-frame window)))
4882 (if (eq frame old-frame)
4883 ;; Make sure new window gets selected (Bug#8615), (Bug#6954).
4884 (select-window window norecord)
4885 ;; If `display-buffer' has chosen another frame, make sure it
4886 ;; gets input focus.
4887 (select-frame-set-input-focus frame norecord))
4888 (current-buffer))))
4889 4884
4890(defun read-buffer-to-switch (prompt) 4885(defun read-buffer-to-switch (prompt)
4891 "Read the name of a buffer to switch to, prompting with PROMPT. 4886 "Read the name of a buffer to switch to, prompting with PROMPT.