aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKenichi Handa2011-11-11 16:08:47 +0900
committerKenichi Handa2011-11-11 16:08:47 +0900
commit0756b0c3a6e60dd623da6f12bc8d2de05ef7b8f1 (patch)
tree0846cacac3ba56cb8d2054fbc851fee2fb9606d2 /lisp
parent9ac0394b8d1e54bf1b49291c85770af36a94531e (diff)
parent68cbc58be59373e805fa200db02e4022e20050f0 (diff)
downloademacs-0756b0c3a6e60dd623da6f12bc8d2de05ef7b8f1.tar.gz
emacs-0756b0c3a6e60dd623da6f12bc8d2de05ef7b8f1.zip
merge trunk
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog119
-rw-r--r--lisp/calendar/cal-menu.el12
-rw-r--r--lisp/delim-col.el2
-rw-r--r--lisp/electric.el1
-rw-r--r--lisp/emacs-lisp/bytecomp.el2
-rw-r--r--lisp/emacs-lisp/find-func.el40
-rw-r--r--lisp/emulation/edt.el2
-rw-r--r--lisp/files.el12
-rw-r--r--lisp/generic-x.el2
-rw-r--r--lisp/gnus/ChangeLog2
-rw-r--r--lisp/gnus/smime.el2
-rw-r--r--lisp/international/robin.el2
-rw-r--r--lisp/mail/rmail.el28
-rw-r--r--lisp/net/secrets.el2
-rw-r--r--lisp/org/org-agenda.el24
-rw-r--r--lisp/progmodes/compile.el76
-rw-r--r--lisp/progmodes/cperl-mode.el2
-rw-r--r--lisp/progmodes/delphi.el4
-rw-r--r--lisp/progmodes/gdb-mi.el2
-rw-r--r--lisp/progmodes/gud.el2
-rw-r--r--lisp/progmodes/meta-mode.el50
-rw-r--r--lisp/progmodes/python.el21
-rw-r--r--lisp/progmodes/vhdl-mode.el2
-rw-r--r--lisp/rot13.el2
-rw-r--r--lisp/subr.el43
-rw-r--r--lisp/textmodes/reftex-parse.el2
-rw-r--r--lisp/textmodes/rst.el4
-rw-r--r--lisp/url/url-http.el2
-rw-r--r--lisp/vc/vc-svn.el26
-rw-r--r--lisp/window.el496
-rw-r--r--lisp/woman.el2
31 files changed, 528 insertions, 460 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6cc9cc86515..6df54fb4527 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,120 @@
12011-11-11 Glenn Morris <rgm@gnu.org>
2
3 * subr.el (eval-after-load): If FILE is already loaded,
4 evaluate FORM before it gets wrapped in more stuff. (Bug#10009)
5
62011-11-10 Glenn Morris <rgm@gnu.org>
7
8 * vc/vc-svn.el (vc-svn-create-repo, vc-svn-modify-change-comment):
9 Call svn via vc-svn-command rather than vc-do-command.
10 (vc-svn-command): Add --non-interactive. (Bug#9993)
11 (vc-svn-update, vc-svn-merge-news): No need for --non-interactive.
12
13 * emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions):
14 Add toggle-read-only. (Bug#7292)
15 * files.el (toggle-read-only): Mention that it should only
16 be used interactively. (Bug#10006)
17
182011-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
19
20 * progmodes/compile.el (compilation-error-regexp-alist-alist):
21 Adjust regexp for OCaml warnings.
22
23 * electric.el (electric-pair-post-self-insert-function): Let user
24 turn it off buffer-locally (bug#9932).
25
26 * progmodes/python.el (python-beginning-of-statement):
27 Rewrite (bug#2703).
28
29 * progmodes/compile.el: Better handle TABs (bug#9749).
30 (compilation-internal-error-properties)
31 (compilation-next-error-function): Obey the target buffer's
32 compilation-error-screen-columns.
33
342011-11-09 Juanma Barranquero <lekktu@gmail.com>
35
36 * progmodes/meta-mode.el: Remove obsolete comments.
37 (meta-right-comment-regexp, meta-ignore-comment-regexp):
38 Fix typos in docstrings.
39
402011-11-09 Martin Rudalics <rudalics@gmx.at>
41
42 * window.el (window-size-fixed-p): Rewrite doc-string.
43 (window-resizable-p): Rename to window--resizable-p. Update callers.
44 (window--resizable): New function. Make all callers of
45 window-resizable call window--resizable instead.
46 (window-resizable): Rewrite in terms of window--resizable.
47
482011-11-08 Glenn Morris <rgm@gnu.org>
49
50 * progmodes/delphi.el (delphi-mode-syntax-table):
51 Let define-derived-mode define a proper syntax table. (Bug#9994)
52
532011-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
54
55 * window.el: Stay away from defsubst.
56 (window-list-no-nils): Remove.
57 (window-state-get-1, window-state-get): Use backquote instead.
58
592011-11-08 thierry <thierry.volpiatto@gmail.com>
60
61 * emacs-lisp/find-func.el (find-function-read):
62 Fix incorrect use of default argument in `completing-read'.
63
642011-11-08 Martin Rudalics <rudalics@gmx.at>
65
66 * window.el (display-buffer-function, special-display-function):
67 Mention display-buffer-record-window but do not mention
68 help-setup parameter in doc-strings.
69 (window-min-delta): Fix doc-string typo.
70
712011-11-08 Chong Yidong <cyd@gnu.org>
72
73 * window.el (window-total-height, window-total-width): Doc fix.
74 (window-body-size): Move from C.
75 (window-body-height, window-body-width): Move to C.
76
772011-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
78
79 * window.el: Make special-display like display-buffer-alist (bug#9532).
80 (display-buffer--special-action): New function, morphed
81 from display-buffer--special.
82 (display-buffer): Use it to handle special-display-buffers at higher
83 priority (just after display-buffer-alist).
84 (display-buffer-fallback-action, display-buffer--other-frame-action)
85 (pop-to-buffer-same-window): Remove display-buffer--special.
86
872011-11-07 Glenn Morris <rgm@gnu.org>
88
89 * calendar/cal-menu.el (cal-menu-set-date-title):
90 Do nothing if not in a calendar. (Bug#9976)
91
922011-11-07 Stefan Monnier <monnier@iro.umontreal.ca>
93
94 * files.el (find-file): Always use selected-window.
95
962011-11-07 Martin Rudalics <rudalics@gmx.at>
97
98 * window.el (window-combinations): Make WINDOW argument
99 mandatory. Rewrite doc-string.
100 (walk-window-subtree, window-atom-check, window-min-delta)
101 (window-max-delta, window--resize-this-window)
102 (window--resize-root-window-vertically, window-tree)
103 (balance-windows, window-state-put): Rewrite doc-strings as to
104 not mention the term "subwindow".
105 (window--resize-subwindows-skip-p): Rename to
106 window--resize-child-windows-skip-p.
107 (window--resize-subwindows-normal): Rename to
108 window--resize-child-windows-normal.
109 (window--resize-subwindows): Rename to
110 window--resize-child-windows.
111 (window-or-subwindow-p): Rename to window--in-subtree-p.
112
1132011-11-07 Mark Lillibridge <mark.lillibridge@hp.com> (tiny change)
114
115 * mail/rmail.el (rmail-get-new-mail, rmail-insert-inbox-text):
116 Ensure that mbox format messages end in two newlines (Bug#9974).
117
12011-11-06 Chong Yidong <cyd@gnu.org> 1182011-11-06 Chong Yidong <cyd@gnu.org>
2 119
3 * window.el (window-combination-p): Function deleted; its 120 * window.el (window-combination-p): Function deleted; its
@@ -11,7 +128,7 @@
11 (window-size-ignore, window-state-get): Callers changed. 128 (window-size-ignore, window-state-get): Callers changed.
12 (window-normalize-window): Rename from window-normalize-any-window. 129 (window-normalize-window): Rename from window-normalize-any-window.
13 New arg LIVE-ONLY, replacing window-normalize-live-window. 130 New arg LIVE-ONLY, replacing window-normalize-live-window.
14 (window-normalize-live-window): Deleted. 131 (window-normalize-live-window): Delete.
15 (window-combination-p, window-combined-p, window-combinations) 132 (window-combination-p, window-combined-p, window-combinations)
16 (walk-window-subtree, window-atom-root, window-min-size) 133 (walk-window-subtree, window-atom-root, window-min-size)
17 (window-sizable, window-sizable-p, window-size-fixed-p) 134 (window-sizable, window-sizable-p, window-size-fixed-p)
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el
index 3ebb7edab3f..d8de171c0a1 100644
--- a/lisp/calendar/cal-menu.el
+++ b/lisp/calendar/cal-menu.el
@@ -215,13 +215,15 @@ is non-nil."
215;; but easymenu does not seem to allow this (?). 215;; but easymenu does not seem to allow this (?).
216;; The ignore-errors is because `documentation' can end up calling 216;; The ignore-errors is because `documentation' can end up calling
217;; this in a non-calendar buffer where displayed-month is unbound. (Bug#3862) 217;; this in a non-calendar buffer where displayed-month is unbound. (Bug#3862)
218;; This still has issues - bug#9976, so added derived-mode-p call.
218(defun cal-menu-set-date-title (menu) 219(defun cal-menu-set-date-title (menu)
219 "Convert date of last event to title suitable for MENU." 220 "Convert date of last event to title suitable for MENU."
220 (let ((date (ignore-errors (calendar-cursor-to-date nil last-input-event)))) 221 (when (derived-mode-p 'calendar-mode)
221 (if date 222 (let ((date (ignore-errors (calendar-cursor-to-date nil last-input-event))))
222 (easy-menu-filter-return menu (calendar-date-string date t nil)) 223 (if date
223 (message "Not on a date!") 224 (easy-menu-filter-return menu (calendar-date-string date t nil))
224 nil))) 225 (message "Not on a date!")
226 nil))))
225 227
226(easy-menu-define cal-menu-context-mouse-menu nil 228(easy-menu-define cal-menu-context-mouse-menu nil
227 "Pop up mouse menu for selected date in the calendar window." 229 "Pop up mouse menu for selected date in the calendar window."
diff --git a/lisp/delim-col.el b/lisp/delim-col.el
index d9f8634fb54..ed6ab96107a 100644
--- a/lisp/delim-col.el
+++ b/lisp/delim-col.el
@@ -194,7 +194,7 @@ Any other value is treated as t."
194 :tag "Column Formating" 194 :tag "Column Formating"
195 (const :tag "No Formating" nil) 195 (const :tag "No Formating" nil)
196 (const :tag "Column Alignment" t) 196 (const :tag "Column Alignment" t)
197 (const :tag "Separator Aligment" separator) 197 (const :tag "Separator Alignment" separator)
198 (const :tag "Column Padding" padding)) 198 (const :tag "Column Padding" padding))
199 :group 'columns) 199 :group 'columns)
200 200
diff --git a/lisp/electric.el b/lisp/electric.el
index 26fba20ea12..3d7c1fd8ac4 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -284,6 +284,7 @@ This can be convenient for people who find it easier to hit ) than C-f."
284 284
285(defun electric-pair-post-self-insert-function () 285(defun electric-pair-post-self-insert-function ()
286 (let* ((syntax (and (eq (char-before) last-command-event) ; Sanity check. 286 (let* ((syntax (and (eq (char-before) last-command-event) ; Sanity check.
287 electric-pair-mode
287 (let ((x (assq last-command-event electric-pair-pairs))) 288 (let ((x (assq last-command-event electric-pair-pairs)))
288 (cond 289 (cond
289 (x (if (eq (car x) (cdr x)) ?\" ?\()) 290 (x (if (eq (car x) (cdr x)) ?\" ?\())
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index fae402d4215..84aaf8718ed 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -355,7 +355,7 @@ else the global value will be modified."
355(defvar byte-compile-interactive-only-functions 355(defvar byte-compile-interactive-only-functions
356 '(beginning-of-buffer end-of-buffer replace-string replace-regexp 356 '(beginning-of-buffer end-of-buffer replace-string replace-regexp
357 insert-file insert-buffer insert-file-literally previous-line next-line 357 insert-file insert-buffer insert-file-literally previous-line next-line
358 goto-line comint-run delete-backward-char) 358 goto-line comint-run delete-backward-char toggle-read-only)
359 "List of commands that are not meant to be called from Lisp.") 359 "List of commands that are not meant to be called from Lisp.")
360 360
361(defvar byte-compile-not-obsolete-vars nil 361(defvar byte-compile-not-obsolete-vars nil
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 08e73b32a15..070faca8d91 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -363,29 +363,23 @@ If TYPE is nil, insist on a symbol with a function definition.
363Otherwise TYPE should be `defvar' or `defface'. 363Otherwise TYPE should be `defvar' or `defface'.
364If TYPE is nil, defaults using `function-called-at-point', 364If TYPE is nil, defaults using `function-called-at-point',
365otherwise uses `variable-at-point'." 365otherwise uses `variable-at-point'."
366 (let ((symb (if (null type) 366 (let* ((symb1 (cond ((null type) (function-called-at-point))
367 (function-called-at-point) 367 ((eq type 'defvar) (variable-at-point))
368 (if (eq type 'defvar) 368 (t (variable-at-point t))))
369 (variable-at-point) 369 (symb (unless (eq symb1 0) symb1))
370 (variable-at-point t)))) 370 (predicate (cdr (assq type '((nil . fboundp)
371 (predicate (cdr (assq type '((nil . fboundp) (defvar . boundp) 371 (defvar . boundp)
372 (defface . facep))))) 372 (defface . facep)))))
373 (prompt (cdr (assq type '((nil . "function") (defvar . "variable") 373 (prompt-type (cdr (assq type '((nil . "function")
374 (defface . "face"))))) 374 (defvar . "variable")
375 (enable-recursive-minibuffers t) 375 (defface . "face")))))
376 val) 376 (prompt (concat "Find " prompt-type
377 (if (equal symb 0) 377 (and symb (format " (default %s)" symb))
378 (setq symb nil)) 378 ": "))
379 (setq val (completing-read 379 (enable-recursive-minibuffers t))
380 (concat "Find " 380 (list (intern (completing-read
381 prompt 381 prompt obarray predicate
382 (if symb 382 t nil nil (and symb (symbol-name symb)))))))
383 (format " (default %s)" symb))
384 ": ")
385 obarray predicate t nil))
386 (list (if (equal val "")
387 symb
388 (intern val)))))
389 383
390(defun find-function-do-it (symbol type switch-fn) 384(defun find-function-do-it (symbol type switch-fn)
391 "Find Emacs Lisp SYMBOL in a buffer and display it. 385 "Find Emacs Lisp SYMBOL in a buffer and display it.
diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el
index 7ed0255d987..acdc3caa449 100644
--- a/lisp/emulation/edt.el
+++ b/lisp/emulation/edt.el
@@ -2484,7 +2484,7 @@ Argument GOLD-BINDING is the Emacs function to be bound to GOLD <KEY>."
2484 F10: Cut Rectangle 2484 F10: Cut Rectangle
2485G-F10: Paste Rectangle 2485G-F10: Paste Rectangle
2486 F11: ESC 2486 F11: ESC
2487 F12: Begining of Line +----------+----------+----------+----------+ 2487 F12: Beginning of Line +----------+----------+----------+----------+
2488G-F12: Delete Other Windows | GOLD | HELP | FNDNXT | DEL L | 2488G-F12: Delete Other Windows | GOLD | HELP | FNDNXT | DEL L |
2489 F13: Delete to Begin of Word | (PF1) | (PF2) | (PF3) | (PF4) | 2489 F13: Delete to Begin of Word | (PF1) | (PF2) | (PF3) | (PF4) |
2490 HELP: Keypad Help |Mark Wisel|Desc Funct| FIND | UND L | 2490 HELP: Keypad Help |Mark Wisel|Desc Funct| FIND | UND L |
diff --git a/lisp/files.el b/lisp/files.el
index 40e2df14c1b..aac415c1a96 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1343,7 +1343,7 @@ automatically choosing a major mode, use \\[find-file-literally]."
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 'switch-to-buffer (nreverse value)) 1345 (mapcar 'switch-to-buffer (nreverse value))
1346 (switch-to-buffer value)))) 1346 (switch-to-buffer value nil 'force-same-window))))
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.
@@ -4686,7 +4686,15 @@ prints a message in the minibuffer. Instead, use `set-buffer-modified-p'."
4686 "Change whether this buffer is read-only. 4686 "Change whether this buffer is read-only.
4687With prefix argument ARG, make the buffer read-only if ARG is 4687With prefix argument ARG, make the buffer read-only if ARG is
4688positive, otherwise make it writable. If buffer is read-only 4688positive, otherwise make it writable. If buffer is read-only
4689and `view-read-only' is non-nil, enter view mode." 4689and `view-read-only' is non-nil, enter view mode.
4690
4691This function is usually the wrong thing to use in a Lisp program.
4692It can have side-effects beyond changing the read-only status of a buffer
4693\(e.g., enabling view mode), and does not affect read-only regions that
4694are caused by text properties. To make a buffer read-only in Lisp code,
4695set `buffer-read-only'. To ignore read-only status (whether due to text
4696properties or buffer state) and make changes, temporarily bind
4697`inhibit-read-only'."
4690 (interactive "P") 4698 (interactive "P")
4691 (if (and arg 4699 (if (and arg
4692 (if (> (prefix-numeric-value arg) 0) buffer-read-only 4700 (if (> (prefix-numeric-value arg) 0) buffer-read-only
diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index 5205a6811f6..2c00229c76e 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -1436,7 +1436,7 @@ like an INI file. You can add this hook to `find-file-hook'."
1436 "REGDB_APPPATH" 1436 "REGDB_APPPATH"
1437 "REGDB_BINARY" 1437 "REGDB_BINARY"
1438 "REGDB_ERR_CONNECTIONEXISTS" 1438 "REGDB_ERR_CONNECTIONEXISTS"
1439 "REGDB_ERR_CORRUPTEDREGSITRY" 1439 "REGDB_ERR_CORRUPTEDREGISTRY"
1440 "REGDB_ERR_INITIALIZATION" 1440 "REGDB_ERR_INITIALIZATION"
1441 "REGDB_ERR_INVALIDHANDLE" 1441 "REGDB_ERR_INVALIDHANDLE"
1442 "REGDB_ERR_INVALIDNAME" 1442 "REGDB_ERR_INVALIDNAME"
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index c36d4729518..fbbf3bad5a8 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -18491,7 +18491,7 @@
184912004-10-05 Jesper Harder <harder@ifa.au.dk> 184912004-10-05 Jesper Harder <harder@ifa.au.dk>
18492 18492
18493 * nnsoup.el (nnsoup-read-active-file): Use dolist, mapc or last 18493 * nnsoup.el (nnsoup-read-active-file): Use dolist, mapc or last
18494 where approriate. 18494 where appropriate.
18495 18495
18496 * nnml.el (nnml-generate-active-info): do. 18496 * nnml.el (nnml-generate-active-info): do.
18497 18497
diff --git a/lisp/gnus/smime.el b/lisp/gnus/smime.el
index 5a7079883e6..f0951b7b803 100644
--- a/lisp/gnus/smime.el
+++ b/lisp/gnus/smime.el
@@ -689,7 +689,7 @@ The following commands are available:
689 (dolist (key smime-keys) 689 (dolist (key smime-keys)
690 (insert 690 (insert
691 (format "\t\t%s: %s\n" (car key) (cadr key)))) 691 (format "\t\t%s: %s\n" (car key) (cadr key))))
692 (insert "\nTrusted Certificate Authoritys:\n") 692 (insert "\nTrusted Certificate Authorities:\n")
693 (insert "\nKnown Certificates:\n")))) 693 (insert "\nKnown Certificates:\n"))))
694 694
695(defun smime () 695(defun smime ()
diff --git a/lisp/international/robin.el b/lisp/international/robin.el
index 7e98a507f93..6f78aaede3f 100644
--- a/lisp/international/robin.el
+++ b/lisp/international/robin.el
@@ -22,7 +22,7 @@
22;; You should have received a copy of the GNU General Public License 22;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. 23;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24 24
25;;; Comentary: 25;;; Commentary:
26 26
27;; Functionalities 27;; Functionalities
28;; --------------- 28;; ---------------
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index a535d3a86db..4b3441a8cdc 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1721,10 +1721,12 @@ not be a new one). It returns non-nil if it got any new messages."
1721 (setq all-files (cdr all-files))) 1721 (setq all-files (cdr all-files)))
1722 ;; Put them back in their original order. 1722 ;; Put them back in their original order.
1723 (setq files (nreverse files)) 1723 (setq files (nreverse files))
1724 ;; In case of brain damage caused by require-final-newline.
1725 (goto-char (point-max)) 1724 (goto-char (point-max))
1726 (skip-chars-backward " \t\n") 1725 ;; Make sure we end with a blank line unless there are
1727 (delete-region (point) (point-max)) 1726 ;; no messages, as required by mbox format (Bug#9974).
1727 (unless (bobp)
1728 (while (not (looking-back "\n\n"))
1729 (insert "\n")))
1728 (setq found (or 1730 (setq found (or
1729 (rmail-get-new-mail-1 file-name files delete-files) 1731 (rmail-get-new-mail-1 file-name files delete-files)
1730 found)))) 1732 found))))
@@ -2024,22 +2026,12 @@ Value is the size of the newly read mail after conversion."
2024 (rmail-unrmail-new-mail-maybe 2026 (rmail-unrmail-new-mail-maybe
2025 tofile 2027 tofile
2026 (nth 1 (insert-file-contents tofile)))) 2028 (nth 1 (insert-file-contents tofile))))
2027 ;; Determine if a pair of newline message separators need
2028 ;; to be added to the new collection of messages. This is
2029 ;; the case for all new message collections added to a
2030 ;; non-empty mail file.
2031 (unless (zerop size)
2032 (save-restriction
2033 (let ((start (point-min)))
2034 (widen)
2035 (unless (eq start (point-min))
2036 (goto-char start)
2037 (insert "\n\n")
2038 (setq size (+ 2 size))))))
2039 (goto-char (point-max)) 2029 (goto-char (point-max))
2040 (or (= (preceding-char) ?\n) 2030 ;; Make sure the read-in mbox data properly ends with a
2041 (zerop size) 2031 ;; blank line unless it is of size 0.
2042 (insert ?\n)) 2032 (unless (zerop size)
2033 (while (not (looking-back "\n\n"))
2034 (insert "\n")))
2043 (if (not (and rmail-preserve-inbox (string= file tofile))) 2035 (if (not (and rmail-preserve-inbox (string= file tofile)))
2044 (setq delete-files (cons tofile delete-files))))) 2036 (setq delete-files (cons tofile delete-files)))))
2045 (message "") 2037 (message "")
diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el
index 89378497c36..9fa5eb32d43 100644
--- a/lisp/net/secrets.el
+++ b/lisp/net/secrets.el
@@ -774,7 +774,7 @@ to their attributes."
774 (cons 774 (cons
775 (1+ (length "password")) 775 (1+ (length "password"))
776 (mapcar 776 (mapcar
777 ;; Atribute names have a leading ":", which will be suppressed. 777 ;; Attribute names have a leading ":", which will be suppressed.
778 (lambda (attribute) (length (symbol-name (car attribute)))) 778 (lambda (attribute) (length (symbol-name (car attribute))))
779 attributes))))) 779 attributes)))))
780 (cons 780 (cons
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index aea284fe72c..53a0c5587a2 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -764,7 +764,7 @@ because you will take care of it on the day when scheduled."
764 :group 'org-agenda-skip 764 :group 'org-agenda-skip
765 :group 'org-agenda-daily/weekly 765 :group 'org-agenda-daily/weekly
766 :type '(choice 766 :type '(choice
767 (const :tag "Alwas show prewarning" nil) 767 (const :tag "Always show prewarning" nil)
768 (const :tag "Remove prewarning if entry is scheduled" t) 768 (const :tag "Remove prewarning if entry is scheduled" t)
769 (integer :tag "Restart prewarning N days before deadline"))) 769 (integer :tag "Restart prewarning N days before deadline")))
770 770
@@ -1388,13 +1388,13 @@ When nil, such items are sorted as 0 minutes effort."
1388 (tags . " %i %-12:c") 1388 (tags . " %i %-12:c")
1389 (search . " %i %-12:c")) 1389 (search . " %i %-12:c"))
1390 "Format specifications for the prefix of items in the agenda views. 1390 "Format specifications for the prefix of items in the agenda views.
1391An alist with five entries, each for the different agenda types. The 1391An alist with five entries, each for the different agenda types. The
1392keys of the sublists are `agenda', `timeline', `todo', `search' and `tags'. 1392keys of the sublists are `agenda', `timeline', `todo', `search' and `tags'.
1393The values are format strings. 1393The values are format strings.
1394 1394
1395This format works similar to a printf format, with the following meaning: 1395This format works similar to a printf format, with the following meaning:
1396 1396
1397 %c the category of the item, \"Diary\" for entries from the diary, 1397 %c the category of the item, \"Diary\" for entries from the diary,
1398 or as given by the CATEGORY keyword or derived from the file name 1398 or as given by the CATEGORY keyword or derived from the file name
1399 %i the icon category of the item, see `org-agenda-category-icon-alist' 1399 %i the icon category of the item, see `org-agenda-category-icon-alist'
1400 %T the last tag of the item (ignore inherited tags, which come first) 1400 %T the last tag of the item (ignore inherited tags, which come first)
@@ -1408,10 +1408,10 @@ contain two additional characters: a question mark just after the `%'
1408and a whitespace/punctuation character just before the final letter. 1408and a whitespace/punctuation character just before the final letter.
1409 1409
1410If the first character after `%' is a question mark, the entire field 1410If the first character after `%' is a question mark, the entire field
1411will only be included if the corresponding value applies to the current 1411will only be included if the corresponding value applies to the current
1412entry. This is useful for fields which should have fixed width when 1412entry. This is useful for fields which should have fixed width when
1413present, but zero width when absent. For example, \"%?-12t\" will 1413present, but zero width when absent. For example, \"%?-12t\" will
1414result in a 12 character time field if a time of the day is specified, 1414result in a 12 character time field if a time of the day is specified,
1415but will completely disappear in entries which do not contain a time. 1415but will completely disappear in entries which do not contain a time.
1416 1416
1417If there is punctuation or whitespace character just before the final 1417If there is punctuation or whitespace character just before the final
@@ -1420,7 +1420,7 @@ the value is not empty. For example, the format \"%-12:c\" leads to
1420\"Diary: \" if the category is \"Diary\". If the category were be 1420\"Diary: \" if the category is \"Diary\". If the category were be
1421empty, no additional colon would be inserted. 1421empty, no additional colon would be inserted.
1422 1422
1423The default value for the agenda sublist is \" %-12:c%?-12t% s\", 1423The default value for the agenda sublist is \" %-12:c%?-12t% s\",
1424which means: 1424which means:
1425 1425
1426- Indent the line with two space characters 1426- Indent the line with two space characters
@@ -1697,7 +1697,7 @@ For example, this value makes those two functions available:
1697 (?C bulk-cut)) 1697 (?C bulk-cut))
1698 1698
1699With selected entries in an agenda buffer, `B R' will call 1699With selected entries in an agenda buffer, `B R' will call
1700the custom function `set-category' on the selected entries. 1700the custom function `set-category' on the selected entries.
1701Note that functions in this alist don't need to be quoted." 1701Note that functions in this alist don't need to be quoted."
1702 :type 'alist 1702 :type 'alist
1703 :group 'org-agenda) 1703 :group 'org-agenda)
@@ -5003,9 +5003,9 @@ See also the user option `org-agenda-clock-consistency-checks'."
5003 "\\(-\\{1,3\\}\\(\\[.*?\\]\\)\\)?")) ; group 3 is second 5003 "\\(-\\{1,3\\}\\(\\[.*?\\]\\)\\)?")) ; group 3 is second
5004 (tlstart 0.) 5004 (tlstart 0.)
5005 (tlend 0.) 5005 (tlend 0.)
5006 (maxtime (org-hh:mm-string-to-minutes 5006 (maxtime (org-hh:mm-string-to-minutes
5007 (or (plist-get pl :max-duration) "24:00"))) 5007 (or (plist-get pl :max-duration) "24:00")))
5008 (mintime (org-hh:mm-string-to-minutes 5008 (mintime (org-hh:mm-string-to-minutes
5009 (or (plist-get pl :min-duration) 0))) 5009 (or (plist-get pl :min-duration) 0)))
5010 (maxgap (org-hh:mm-string-to-minutes 5010 (maxgap (org-hh:mm-string-to-minutes
5011 ;; default 30:00 means never complain 5011 ;; default 30:00 means never complain
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 156c90159cd..3dba1af515a 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -157,7 +157,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
157 157
158 (python-tracebacks-and-caml 158 (python-tracebacks-and-caml
159 "^[ \t]*File \\(\"?\\)\\([^,\" \n\t<>]+\\)\\1, lines? \\([0-9]+\\)-?\\([0-9]+\\)?\\(?:$\\|,\ 159 "^[ \t]*File \\(\"?\\)\\([^,\" \n\t<>]+\\)\\1, lines? \\([0-9]+\\)-?\\([0-9]+\\)?\\(?:$\\|,\
160\\(?: characters? \\([0-9]+\\)-?\\([0-9]+\\)?:\\)?\\([ \n]Warning:\\)?\\)" 160\\(?: characters? \\([0-9]+\\)-?\\([0-9]+\\)?:\\)?\\([ \n]Warning\\(?: [0-9]+\\)?:\\)?\\)"
161 2 (3 . 4) (5 . 6) (7)) 161 2 (3 . 4) (5 . 6) (7))
162 162
163 (comma 163 (comma
@@ -1056,7 +1056,7 @@ FMTS is a list of format specs for transforming the file name.
1056 (cadr (compilation--file-struct->loc-tree file-struct))) 1056 (cadr (compilation--file-struct->loc-tree file-struct)))
1057 (marker 1057 (marker
1058 (if marker-line (compilation--loc->marker (cadr marker-line)))) 1058 (if marker-line (compilation--loc->marker (cadr marker-line))))
1059 (compilation-error-screen-columns compilation-error-screen-columns) 1059 (screen-columns compilation-error-screen-columns)
1060 end-marker loc end-loc) 1060 end-marker loc end-loc)
1061 (if (not (and marker (marker-buffer marker))) 1061 (if (not (and marker (marker-buffer marker)))
1062 (setq marker nil) ; no valid marker for this file 1062 (setq marker nil) ; no valid marker for this file
@@ -1064,16 +1064,21 @@ FMTS is a list of format specs for transforming the file name.
1064 (catch 'marker ; find nearest loc, at least one exists 1064 (catch 'marker ; find nearest loc, at least one exists
1065 (dolist (x (cddr (compilation--file-struct->loc-tree 1065 (dolist (x (cddr (compilation--file-struct->loc-tree
1066 file-struct))) ; Loop over remaining lines. 1066 file-struct))) ; Loop over remaining lines.
1067 (if (> (car x) loc) ; still bigger 1067 (if (> (car x) loc) ; Still bigger.
1068 (setq marker-line x) 1068 (setq marker-line x)
1069 (if (> (- (or (car marker-line) 1) loc) 1069 (if (> (- (or (car marker-line) 1) loc)
1070 (- loc (car x))) ; current line is nearer 1070 (- loc (car x))) ; Current line is nearer.
1071 (setq marker-line x)) 1071 (setq marker-line x))
1072 (throw 'marker t)))) 1072 (throw 'marker t))))
1073 (setq marker (compilation--loc->marker (cadr marker-line)) 1073 (setq marker (compilation--loc->marker (cadr marker-line))
1074 marker-line (or (car marker-line) 1)) 1074 marker-line (or (car marker-line) 1))
1075 (with-current-buffer (marker-buffer marker) 1075 (with-current-buffer (marker-buffer marker)
1076 (save-excursion 1076 (let ((screen-columns
1077 ;; Obey the compilation-error-screen-columns of the target
1078 ;; buffer if its major mode set it buffer-locally.
1079 (if (local-variable-p 'compilation-error-screen-columns)
1080 compilation-error-screen-columns screen-columns)))
1081 (save-excursion
1077 (save-restriction 1082 (save-restriction
1078 (widen) 1083 (widen)
1079 (goto-char (marker-position marker)) 1084 (goto-char (marker-position marker))
@@ -1081,17 +1086,15 @@ FMTS is a list of format specs for transforming the file name.
1081 (beginning-of-line (- (or end-line line) marker-line -1)) 1086 (beginning-of-line (- (or end-line line) marker-line -1))
1082 (if (or (null end-col) (< end-col 0)) 1087 (if (or (null end-col) (< end-col 0))
1083 (end-of-line) 1088 (end-of-line)
1084 (compilation-move-to-column 1089 (compilation-move-to-column end-col screen-columns))
1085 end-col compilation-error-screen-columns))
1086 (setq end-marker (point-marker))) 1090 (setq end-marker (point-marker)))
1087 (beginning-of-line (if end-line 1091 (beginning-of-line (if end-line
1088 (- line end-line -1) 1092 (- line end-line -1)
1089 (- loc marker-line -1))) 1093 (- loc marker-line -1)))
1090 (if col 1094 (if col
1091 (compilation-move-to-column 1095 (compilation-move-to-column col screen-columns)
1092 col compilation-error-screen-columns)
1093 (forward-to-indentation 0)) 1096 (forward-to-indentation 0))
1094 (setq marker (point-marker)))))) 1097 (setq marker (point-marker)))))))
1095 1098
1096 (setq loc (compilation-assq line (compilation--file-struct->loc-tree 1099 (setq loc (compilation-assq line (compilation--file-struct->loc-tree
1097 file-struct))) 1100 file-struct)))
@@ -2266,7 +2269,7 @@ This is the value of `next-error-function' in Compilation buffers."
2266 (interactive "p") 2269 (interactive "p")
2267 (when reset 2270 (when reset
2268 (setq compilation-current-error nil)) 2271 (setq compilation-current-error nil))
2269 (let* ((columns compilation-error-screen-columns) ; buffer's local value 2272 (let* ((screen-columns compilation-error-screen-columns)
2270 (last 1) 2273 (last 1)
2271 (msg (compilation-next-error (or n 1) nil 2274 (msg (compilation-next-error (or n 1) nil
2272 (or compilation-current-error 2275 (or compilation-current-error
@@ -2301,29 +2304,34 @@ This is the value of `next-error-function' in Compilation buffers."
2301 marker 2304 marker
2302 (caar (compilation--loc->file-struct loc)) 2305 (caar (compilation--loc->file-struct loc))
2303 (cadr (car (compilation--loc->file-struct loc)))) 2306 (cadr (car (compilation--loc->file-struct loc))))
2304 (save-restriction 2307 (let ((screen-columns
2305 (widen) 2308 ;; Obey the compilation-error-screen-columns of the target
2306 (goto-char (point-min)) 2309 ;; buffer if its major mode set it buffer-locally.
2307 ;; Treat file's found lines in forward order, 1 by 1. 2310 (if (local-variable-p 'compilation-error-screen-columns)
2308 (dolist (line (reverse (cddr (compilation--loc->file-struct loc)))) 2311 compilation-error-screen-columns screen-columns)))
2309 (when (car line) ; else this is a filename w/o a line# 2312 (save-restriction
2310 (beginning-of-line (- (car line) last -1)) 2313 (widen)
2311 (setq last (car line))) 2314 (goto-char (point-min))
2312 ;; Treat line's found columns and store/update a marker for each. 2315 ;; Treat file's found lines in forward order, 1 by 1.
2313 (dolist (col (cdr line)) 2316 (dolist (line (reverse (cddr (compilation--loc->file-struct loc))))
2314 (if (compilation--loc->col col) 2317 (when (car line) ; else this is a filename w/o a line#
2315 (if (eq (compilation--loc->col col) -1) 2318 (beginning-of-line (- (car line) last -1))
2316 ;; Special case for range end. 2319 (setq last (car line)))
2317 (end-of-line) 2320 ;; Treat line's found columns and store/update a marker for each.
2318 (compilation-move-to-column (compilation--loc->col col) 2321 (dolist (col (cdr line))
2319 columns)) 2322 (if (compilation--loc->col col)
2320 (beginning-of-line) 2323 (if (eq (compilation--loc->col col) -1)
2321 (skip-chars-forward " \t")) 2324 ;; Special case for range end.
2322 (if (compilation--loc->marker col) 2325 (end-of-line)
2323 (set-marker (compilation--loc->marker col) (point)) 2326 (compilation-move-to-column (compilation--loc->col col)
2324 (setf (compilation--loc->marker col) (point-marker))) 2327 screen-columns))
2325 ;; (setf (compilation--loc->timestamp col) timestamp) 2328 (beginning-of-line)
2326 ))))) 2329 (skip-chars-forward " \t"))
2330 (if (compilation--loc->marker col)
2331 (set-marker (compilation--loc->marker col) (point))
2332 (setf (compilation--loc->marker col) (point-marker)))
2333 ;; (setf (compilation--loc->timestamp col) timestamp)
2334 ))))))
2327 (compilation-goto-locus marker (compilation--loc->marker loc) 2335 (compilation-goto-locus marker (compilation--loc->marker loc)
2328 (compilation--loc->marker end-loc)) 2336 (compilation--loc->marker end-loc))
2329 (setf (compilation--loc->visited loc) t))) 2337 (setf (compilation--loc->visited loc) t)))
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index ad3b777977c..a79d1a2c064 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -6481,7 +6481,7 @@ are CPerl, PerlStyle, GNU, K&R, BSD, C++ and Whitesmith.
6481The current value of style is memorized (unless there is a memorized 6481The current value of style is memorized (unless there is a memorized
6482data already), may be restored by `cperl-set-style-back'. 6482data already), may be restored by `cperl-set-style-back'.
6483 6483
6484Chosing \"Current\" style will not change style, so this may be used for 6484Choosing \"Current\" style will not change style, so this may be used for
6485side-effect of memorizing only. Examples in `cperl-style-examples'." 6485side-effect of memorizing only. Examples in `cperl-style-examples'."
6486 (interactive 6486 (interactive
6487 (let ((list (mapcar (function (lambda (elt) (list (car elt)))) 6487 (let ((list (mapcar (function (lambda (elt) (list (car elt))))
diff --git a/lisp/progmodes/delphi.el b/lisp/progmodes/delphi.el
index e8e2f8ffbf0..e513b617022 100644
--- a/lisp/progmodes/delphi.el
+++ b/lisp/progmodes/delphi.el
@@ -1959,10 +1959,6 @@ comment block. If not in a // comment, just does a normal newline."
1959 kmap) 1959 kmap)
1960 "Keymap used in Delphi mode.") 1960 "Keymap used in Delphi mode.")
1961 1961
1962(defvar delphi-mode-syntax-table nil
1963 "Delphi mode's syntax table. It is just a standard syntax table.
1964This is ok since we do our own keyword/comment/string face coloring.")
1965
1966;;;###autoload 1962;;;###autoload
1967(define-derived-mode delphi-mode prog-mode "Delphi" 1963(define-derived-mode delphi-mode prog-mode "Delphi"
1968 "Major mode for editing Delphi code. \\<delphi-mode-map> 1964 "Major mode for editing Delphi code. \\<delphi-mode-map>
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index f9ddabf1552..e47ba3c92f3 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1965,7 +1965,7 @@ Sets `gdb-thread-number' to new id."
1965 (setq gud-running t) 1965 (setq gud-running t)
1966 ;; GDB doesn't seem to respond to -thread-info before first stop or 1966 ;; GDB doesn't seem to respond to -thread-info before first stop or
1967 ;; thread exit (even in non-stop mode), so this is useless. 1967 ;; thread exit (even in non-stop mode), so this is useless.
1968 ;; Behaviour may change in the future. 1968 ;; Behavior may change in the future.
1969 (gdb-emit-signal gdb-buf-publisher 'update-threads)) 1969 (gdb-emit-signal gdb-buf-publisher 'update-threads))
1970 1970
1971;; -break-insert -t didn't give a reason before gdb 6.9 1971;; -break-insert -t didn't give a reason before gdb 6.9
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 7b3a2893610..944a412fb63 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2155,7 +2155,7 @@ during jdb initialization depending on the value of
2155 string 2155 string
2156 (concat "[ \t\n\r,\"" path-separator "]+"))))) 2156 (concat "[ \t\n\r,\"" path-separator "]+")))))
2157 2157
2158;; See comentary for other debugger's marker filters - there you will find 2158;; See commentary for other debugger's marker filters - there you will find
2159;; important notes about STRING. 2159;; important notes about STRING.
2160(defun gud-jdb-marker-filter (string) 2160(defun gud-jdb-marker-filter (string)
2161 2161
diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el
index ab640c0e270..e15f765ea58 100644
--- a/lisp/progmodes/meta-mode.el
+++ b/lisp/progmodes/meta-mode.el
@@ -27,53 +27,17 @@
27;; 27;;
28;; This Emacs Lisp package provides a major mode for editing Metafont 28;; This Emacs Lisp package provides a major mode for editing Metafont
29;; or MetaPost sources. It includes all the necessary code to set up 29;; or MetaPost sources. It includes all the necessary code to set up
30;; a major mode including an approriate syntax table, keymap, and a 30;; a major mode including an appropriate syntax table, keymap, and a
31;; mode-specific pull-down menu. It also provides a sophisticated set 31;; mode-specific pull-down menu. It also provides a sophisticated set
32;; of font-lock patterns, a fancy indentation function adapted from 32;; of font-lock patterns, a fancy indentation function adapted from
33;; AUCTeX's latex.el, and some basic mode-specific editing functions 33;; AUCTeX's latex.el, and some basic mode-specific editing functions
34;; such as functions to move to the beginning or end of the enclosing 34;; such as functions to move to the beginning or end of the enclosing
35;; environment, or to mark, re-indent, or comment-out environments. 35;; environment, or to mark, re-indent, or comment-out environments.
36;; On the other hand, it doesn't yet provide any functionality for 36;; On the other hand, it doesn't yet provide any functionality for
37;; running Metafont or MetaPost in a shell buffer form within Emacs, 37;; running Metafont or MetaPost in a shell buffer from within Emacs,
38;; but such functionality might be added later, either as part of this 38;; but such functionality might be added later, either as part of this
39;; package or as a separate Emacs Lisp package. 39;; package or as a separate Emacs Lisp package.
40 40
41;; Installation:
42;;
43;; An interface to running Metafont or MetaPost as a shell process
44;; from within Emacs is currently under development as a separate
45;; Emacs Lisp package (meta-buf.el). In order to have that package
46;; loaded automatically when first entering Metafont or MetaPost mode,
47;; you might use the load-hook provided in this package by adding
48;; these lines to your startup file:
49;;
50;; (add-hook 'meta-mode-load-hook
51;; (lambda () (require 'meta-buf)))
52;;
53;; The add-on package loaded this way may in turn make use of the
54;; mode-hooks provided in this package to activate additional features
55;; when entering Metafont or MetaPost mode.
56
57;; Font Lock Support:
58;;
59;; If you are using global-font-lock-mode (introduced in Emacs 19.31),
60;; fontification in Metafont and/or MetaPost mode will be activated
61;; automatically. To speed up fontification for the rather complex
62;; patterns used in these modes, it may be a good idea to activate
63;; lazy-lock as a font-lock-support-mode (introduced in Emacs 19.32)
64;; by adding these lines to your startup file:
65;;
66;; (global-font-lock-mode t)
67;; (setq font-lock-support-mode 'lazy-lock-mode)
68;;
69;; If you are using an older version of Emacs, which doesn't provide
70;; global-font-lock-mode or font-lock-support-mode, you can also
71;; activate fontification in Metafont and/or MetaPost mode by adding
72;; the following lines to your startup file:
73;;
74;; (add-hook 'meta-common-mode-hook 'turn-on-font-lock)
75;; (add-hook 'meta-common-mode-hook 'turn-on-lazy-lock)
76
77;; Customization: 41;; Customization:
78;; 42;;
79;; Following the usual Emacs Lisp coding conventions, the major modes 43;; Following the usual Emacs Lisp coding conventions, the major modes
@@ -88,10 +52,6 @@
88 52
89;; Availability: 53;; Availability:
90;; 54;;
91;; This package is currently available via my "TeX Software" WWW page:
92;;
93;; http://www.thphy.uni-duesseldorf.de/~vieth/subjects/tex/software.html
94;;
95;; As of this version 1.0, this package will be uploaded to CTAN 55;; As of this version 1.0, this package will be uploaded to CTAN
96;; archives, where it shall find a permanent home, presumably in 56;; archives, where it shall find a permanent home, presumably in
97;; tex-archive/support/emacs-modes. It will also be submitted for 57;; tex-archive/support/emacs-modes. It will also be submitted for
@@ -104,7 +64,7 @@
104;; v 0.2 -- 1997/02/03 UV Improved and debugged font-lock patterns. 64;; v 0.2 -- 1997/02/03 UV Improved and debugged font-lock patterns.
105;; Added indent-line-function for TAB. 65;; Added indent-line-function for TAB.
106;; v 0.3 -- 1997/02/17 UV Improved font-lock patterns and syntax table. 66;; v 0.3 -- 1997/02/17 UV Improved font-lock patterns and syntax table.
107;; Improved and debbuged indentation function. 67;; Improved and debugged indentation function.
108;; v 0.4 -- 1997/02/18 UV Added functions to indent regions for M-C-q, 68;; v 0.4 -- 1997/02/18 UV Added functions to indent regions for M-C-q,
109;; also added a preliminary mode-specific menu. 69;; also added a preliminary mode-specific menu.
110;; v 0.5 -- 1997/02/19 UV Added functions to skip to next or previous 70;; v 0.5 -- 1997/02/19 UV Added functions to skip to next or previous
@@ -513,13 +473,13 @@ If the list was changed, sort the list and remove duplicates first."
513 :group 'meta-font) 473 :group 'meta-font)
514 474
515(defcustom meta-right-comment-regexp nil 475(defcustom meta-right-comment-regexp nil
516 "Regexp matching comments that should be placed to the right margin." 476 "Regexp matching comments that should be placed on the right margin."
517 :type '(choice regexp 477 :type '(choice regexp
518 (const :tag "None" nil)) 478 (const :tag "None" nil))
519 :group 'meta-font) 479 :group 'meta-font)
520 480
521(defcustom meta-ignore-comment-regexp "%[^%]" 481(defcustom meta-ignore-comment-regexp "%[^%]"
522 "Regexp matching comments that whose indentation should not be touched." 482 "Regexp matching comments whose indentation should not be touched."
523 :type 'regexp 483 :type 'regexp
524 :group 'meta-font) 484 :group 'meta-font)
525 485
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 38bf9552b2a..8615400bf6a 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -948,22 +948,12 @@ Finds end of innermost nested class or method definition."
948 "Go to start of current statement. 948 "Go to start of current statement.
949Accounts for continuation lines, multi-line strings, and 949Accounts for continuation lines, multi-line strings, and
950multi-line bracketed expressions." 950multi-line bracketed expressions."
951 (beginning-of-line) 951 (while
952 (python-beginning-of-string)
953 (let (point)
954 (while (and (python-continuation-line-p)
955 (if point
956 (< (point) point)
957 t))
958 (beginning-of-line)
959 (if (python-backslash-continuation-line-p) 952 (if (python-backslash-continuation-line-p)
960 (progn 953 (progn (forward-line -1) t)
961 (forward-line -1) 954 (beginning-of-line)
962 (while (python-backslash-continuation-line-p) 955 (or (python-beginning-of-string)
963 (forward-line -1))) 956 (python-skip-out))))
964 (python-beginning-of-string)
965 (python-skip-out))
966 (setq point (point))))
967 (back-to-indentation)) 957 (back-to-indentation))
968 958
969(defun python-skip-out (&optional forward syntax) 959(defun python-skip-out (&optional forward syntax)
@@ -971,6 +961,7 @@ multi-line bracketed expressions."
971Skip forward if FORWARD is non-nil, else backward. 961Skip forward if FORWARD is non-nil, else backward.
972If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point. 962If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point.
973Return non-nil if and only if skipping was done." 963Return non-nil if and only if skipping was done."
964 ;; FIXME: Use syntax-ppss-toplevel-pos.
974 (let ((depth (syntax-ppss-depth (or syntax (syntax-ppss)))) 965 (let ((depth (syntax-ppss-depth (or syntax (syntax-ppss))))
975 (forward (if forward -1 1))) 966 (forward (if forward -1 1)))
976 (unless (zerop depth) 967 (unless (zerop depth)
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index d7aa82aee1b..2f06afaa5ef 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -3510,7 +3510,7 @@ STRING are replaced by `-' and substrings are converted to lower case."
3510 menu-list)) 3510 menu-list))
3511 (setq comp-alist (cdr comp-alist))) 3511 (setq comp-alist (cdr comp-alist)))
3512 (setq menu-list (nreverse menu-list)) 3512 (setq menu-list (nreverse menu-list))
3513 (vhdl-menu-split menu-list "Compler"))) 3513 (vhdl-menu-split menu-list "Compiler")))
3514 ["Use Local Error Regexp" 3514 ["Use Local Error Regexp"
3515 (customize-set-variable 'vhdl-compile-use-local-error-regexp 3515 (customize-set-variable 'vhdl-compile-use-local-error-regexp
3516 (not vhdl-compile-use-local-error-regexp)) 3516 (not vhdl-compile-use-local-error-regexp))
diff --git a/lisp/rot13.el b/lisp/rot13.el
index 89b687efdc6..d4885395900 100644
--- a/lisp/rot13.el
+++ b/lisp/rot13.el
@@ -32,7 +32,7 @@
32;; This hack is mainly to show off the char table stuff. 32;; This hack is mainly to show off the char table stuff.
33;; 33;;
34;; New entry points, `rot13', `rot13-string', and `rot13-region' that 34;; New entry points, `rot13', `rot13-string', and `rot13-region' that
35;; performs Ceasar cipher encrypt/decrypt on buffers and strings, was 35;; performs Caesar cipher encrypt/decrypt on buffers and strings, was
36;; added by Simon Josefsson. 36;; added by Simon Josefsson.
37 37
38;;; Code: 38;;; Code:
diff --git a/lisp/subr.el b/lisp/subr.el
index d5120826812..1cd6598eeb5 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1797,30 +1797,29 @@ This function makes or adds to an entry on `after-load-alist'."
1797 (push elt after-load-alist)) 1797 (push elt after-load-alist))
1798 ;; Make sure `form' is evalled in the current lexical/dynamic code. 1798 ;; Make sure `form' is evalled in the current lexical/dynamic code.
1799 (setq form `(funcall ',(eval `(lambda () ,form) lexical-binding))) 1799 (setq form `(funcall ',(eval `(lambda () ,form) lexical-binding)))
1800 (when (symbolp regexp-or-feature)
1801 ;; For features, the after-load-alist elements get run when `provide' is
1802 ;; called rather than at the end of the file. So add an indirection to
1803 ;; make sure that `form' is really run "after-load" in case the provide
1804 ;; call happens early.
1805 (setq form
1806 `(when load-file-name
1807 (let ((fun (make-symbol "eval-after-load-helper")))
1808 (fset fun `(lambda (file)
1809 (if (not (equal file ',load-file-name))
1810 nil
1811 (remove-hook 'after-load-functions ',fun)
1812 ,',form)))
1813 (add-hook 'after-load-functions fun)))))
1814 ;; Add FORM to the element unless it's already there.
1815 (unless (member form (cdr elt))
1816 (nconc elt (purecopy (list form))))
1817
1818 ;; Is there an already loaded file whose name (or `provide' name) 1800 ;; Is there an already loaded file whose name (or `provide' name)
1819 ;; matches FILE? 1801 ;; matches FILE?
1820 (if (if (stringp file) 1802 (prog1 (if (if (stringp file)
1821 (load-history-filename-element regexp-or-feature) 1803 (load-history-filename-element regexp-or-feature)
1822 (featurep file)) 1804 (featurep file))
1823 (eval form)))) 1805 (eval form))
1806 (when (symbolp regexp-or-feature)
1807 ;; For features, the after-load-alist elements get run when `provide' is
1808 ;; called rather than at the end of the file. So add an indirection to
1809 ;; make sure that `form' is really run "after-load" in case the provide
1810 ;; call happens early.
1811 (setq form
1812 `(when load-file-name
1813 (let ((fun (make-symbol "eval-after-load-helper")))
1814 (fset fun `(lambda (file)
1815 (if (not (equal file ',load-file-name))
1816 nil
1817 (remove-hook 'after-load-functions ',fun)
1818 ,',form)))
1819 (add-hook 'after-load-functions fun)))))
1820 ;; Add FORM to the element unless it's already there.
1821 (unless (member form (cdr elt))
1822 (nconc elt (purecopy (list form)))))))
1824 1823
1825(defvar after-load-functions nil 1824(defvar after-load-functions nil
1826 "Special hook run after loading a file. 1825 "Special hook run after loading a file.
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index b0f22085064..4d6b5e5fb83 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -443,7 +443,7 @@ of master file."
443(defvar test-dummy) 443(defvar test-dummy)
444(defun reftex-index-info (file) 444(defun reftex-index-info (file)
445 ;; Return an index entry for the current match. 445 ;; Return an index entry for the current match.
446 ;; Carefull: This function expects the match-data to be still in place! 446 ;; Careful: This function expects the match-data to be still in place!
447 (catch 'exit 447 (catch 'exit
448 (let* ((macro (reftex-match-string 10)) 448 (let* ((macro (reftex-match-string 10))
449 (bom (match-beginning 10)) 449 (bom (match-beginning 10))
diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el
index f9fda7e0a74..0ce71c25ad7 100644
--- a/lisp/textmodes/rst.el
+++ b/lisp/textmodes/rst.el
@@ -476,8 +476,8 @@ for modes derived from Text mode, like Mail mode."
476 476
477 477
478;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 478;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
479;; Section Decoration Adjusment 479;; Section Decoration Adjustment
480;; ============================ 480;; =============================
481;; 481;;
482;; The following functions implement a smart automatic title sectioning feature. 482;; The following functions implement a smart automatic title sectioning feature.
483;; The idea is that with the cursor sitting on a section title, we try to get as 483;; The idea is that with the cursor sitting on a section title, we try to get as
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 557ef33919c..6e192cd5aae 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -257,7 +257,7 @@ request.")
257 (if (not (equal extra-headers "")) 257 (if (not (equal extra-headers ""))
258 (setq extra-headers (concat extra-headers "\r\n"))) 258 (setq extra-headers (concat extra-headers "\r\n")))
259 259
260 ;; This was done with a call to `format'. Concatting parts has 260 ;; This was done with a call to `format'. Concatenating parts has
261 ;; the advantage of keeping the parts of each header together and 261 ;; the advantage of keeping the parts of each header together and
262 ;; allows us to elide null lines directly, at the cost of making 262 ;; allows us to elide null lines directly, at the cost of making
263 ;; the layout less clear. 263 ;; the layout less clear.
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index 7362258a42d..dc4e179e060 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -263,8 +263,8 @@ RESULT is a list of conses (FILE . STATE) for directory DIR."
263(defun vc-svn-create-repo () 263(defun vc-svn-create-repo ()
264 "Create a new SVN repository." 264 "Create a new SVN repository."
265 (vc-do-command "*vc*" 0 "svnadmin" '("create" "SVN")) 265 (vc-do-command "*vc*" 0 "svnadmin" '("create" "SVN"))
266 (vc-do-command "*vc*" 0 vc-svn-program '(".") 266 (vc-svn-command "*vc*" 0 "." "checkout"
267 "checkout" (concat "file://" default-directory "SVN"))) 267 (concat "file://" default-directory "SVN")))
268 268
269(defun vc-svn-register (files &optional rev comment) 269(defun vc-svn-register (files &optional rev comment)
270 "Register FILES into the SVN version-control system. 270 "Register FILES into the SVN version-control system.
@@ -334,7 +334,6 @@ This is only possible if SVN is responsible for FILE's directory.")
334 ;; Check out a particular version (or recreate the file). 334 ;; Check out a particular version (or recreate the file).
335 (vc-file-setprop file 'vc-working-revision nil) 335 (vc-file-setprop file 'vc-working-revision nil)
336 (apply 'vc-svn-command nil 0 file 336 (apply 'vc-svn-command nil 0 file
337 "--non-interactive" ; bug#4280
338 "update" 337 "update"
339 (cond 338 (cond
340 ((null rev) "-rBASE") 339 ((null rev) "-rBASE")
@@ -373,7 +372,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
373 (message "Merging changes into %s..." file) 372 (message "Merging changes into %s..." file)
374 ;; (vc-file-setprop file 'vc-working-revision nil) 373 ;; (vc-file-setprop file 'vc-working-revision nil)
375 (vc-file-setprop file 'vc-checkout-time 0) 374 (vc-file-setprop file 'vc-checkout-time 0)
376 (vc-svn-command nil 0 file "--non-interactive" "update") ; see bug#7152 375 (vc-svn-command nil 0 file "update")
377 ;; Analyze the merge result reported by SVN, and set 376 ;; Analyze the merge result reported by SVN, and set
378 ;; file properties accordingly. 377 ;; file properties accordingly.
379 (with-current-buffer (get-buffer "*vc*") 378 (with-current-buffer (get-buffer "*vc*")
@@ -425,7 +424,7 @@ This is only supported if the repository access method is either file://
425or svn+ssh://." 424or svn+ssh://."
426 (let (tempfile host remotefile directory fileurl-p) 425 (let (tempfile host remotefile directory fileurl-p)
427 (with-temp-buffer 426 (with-temp-buffer
428 (vc-do-command (current-buffer) 0 vc-svn-program nil "info") 427 (vc-svn-command (current-buffer) 0 nil "info")
429 (goto-char (point-min)) 428 (goto-char (point-min))
430 (unless (re-search-forward "Repository Root: \\(file://\\(/.*\\)\\)\\|\\(svn\\+ssh://\\([^/]+\\)\\(/.*\\)\\)" nil t) 429 (unless (re-search-forward "Repository Root: \\(file://\\(/.*\\)\\)\\|\\(svn\\+ssh://\\([^/]+\\)\\(/.*\\)\\)" nil t)
431 (error "Repository information is unavailable")) 430 (error "Repository information is unavailable"))
@@ -581,12 +580,19 @@ NAME is assumed to be a URL."
581(defun vc-svn-command (buffer okstatus file-or-list &rest flags) 580(defun vc-svn-command (buffer okstatus file-or-list &rest flags)
582 "A wrapper around `vc-do-command' for use in vc-svn.el. 581 "A wrapper around `vc-do-command' for use in vc-svn.el.
583The difference to vc-do-command is that this function always invokes `svn', 582The difference to vc-do-command is that this function always invokes `svn',
584and that it passes `vc-svn-global-switches' to it before FLAGS." 583and that it passes \"--non-interactive\" and `vc-svn-global-switches' to
585 (apply 'vc-do-command (or buffer "*vc*") okstatus vc-svn-program file-or-list 584it before FLAGS."
586 (if (stringp vc-svn-global-switches) 585 ;; Might be nice if svn defaulted to non-interactive if stdin not tty.
586 ;; http://svn.haxx.se/dev/archive-2008-05/0762.shtml
587 ;; http://svn.haxx.se/dev/archive-2009-04/0094.shtml
588 ;; Maybe newer ones do?
589 (or (member "--non-interactive"
590 (setq flags (if (stringp vc-svn-global-switches)
587 (cons vc-svn-global-switches flags) 591 (cons vc-svn-global-switches flags)
588 (append vc-svn-global-switches 592 (append vc-svn-global-switches flags))))
589 flags)))) 593 (setq flags (cons "--non-interactive" flags)))
594 (apply 'vc-do-command (or buffer "*vc*") okstatus vc-svn-program file-or-list
595 flags))
590 596
591(defun vc-svn-repository-hostname (dirname) 597(defun vc-svn-repository-hostname (dirname)
592 (with-temp-buffer 598 (with-temp-buffer
diff --git a/lisp/window.el b/lisp/window.el
index 1b51bde36bd..ecd4a62b093 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -68,19 +68,19 @@ are not altered by this macro (unless they are altered in BODY)."
68;; they don't substitute the selected window for nil), and they return 68;; they don't substitute the selected window for nil), and they return
69;; nil when WINDOW doesn't have a parent (like a frame's root window or 69;; nil when WINDOW doesn't have a parent (like a frame's root window or
70;; a minibuffer window). 70;; a minibuffer window).
71(defsubst window-right (window) 71(defun window-right (window)
72 "Return WINDOW's right sibling. 72 "Return WINDOW's right sibling.
73Return nil if WINDOW is the root window of its frame. WINDOW can 73Return nil if WINDOW is the root window of its frame. WINDOW can
74be any window." 74be any window."
75 (and window (window-parent window) (window-next-sibling window))) 75 (and window (window-parent window) (window-next-sibling window)))
76 76
77(defsubst window-left (window) 77(defun window-left (window)
78 "Return WINDOW's left sibling. 78 "Return WINDOW's left sibling.
79Return nil if WINDOW is the root window of its frame. WINDOW can 79Return nil if WINDOW is the root window of its frame. WINDOW can
80be any window." 80be any window."
81 (and window (window-parent window) (window-prev-sibling window))) 81 (and window (window-parent window) (window-prev-sibling window)))
82 82
83(defsubst window-child (window) 83(defun window-child (window)
84 "Return WINDOW's first child window." 84 "Return WINDOW's first child window."
85 (or (window-top-child window) (window-left-child window))) 85 (or (window-top-child window) (window-left-child window)))
86 86
@@ -100,7 +100,7 @@ be any window."
100 (setq window (window-next-sibling window)))) 100 (setq window (window-next-sibling window))))
101 window) 101 window)
102 102
103(defsubst window-valid-p (object) 103(defun window-valid-p (object)
104 "Return t if OBJECT denotes a live window or internal window. 104 "Return t if OBJECT denotes a live window or internal window.
105Otherwise, return nil; this includes the case where OBJECT is a 105Otherwise, return nil; this includes the case where OBJECT is a
106deleted window." 106deleted window."
@@ -108,7 +108,7 @@ deleted window."
108 (or (window-buffer object) (window-child object)) 108 (or (window-buffer object) (window-child object))
109 t)) 109 t))
110 110
111(defsubst window-normalize-buffer (buffer-or-name) 111(defun window-normalize-buffer (buffer-or-name)
112 "Return buffer specified by BUFFER-OR-NAME. 112 "Return buffer specified by BUFFER-OR-NAME.
113BUFFER-OR-NAME must be either a buffer or a string naming a live 113BUFFER-OR-NAME must be either a buffer or a string naming a live
114buffer and defaults to the current buffer." 114buffer and defaults to the current buffer."
@@ -123,7 +123,7 @@ buffer and defaults to the current buffer."
123 (t 123 (t
124 (error "No such buffer %s" buffer-or-name)))) 124 (error "No such buffer %s" buffer-or-name))))
125 125
126(defsubst window-normalize-frame (frame) 126(defun window-normalize-frame (frame)
127 "Return frame specified by FRAME. 127 "Return frame specified by FRAME.
128FRAME must be a live frame and defaults to the selected frame." 128FRAME must be a live frame and defaults to the selected frame."
129 (if frame 129 (if frame
@@ -132,7 +132,7 @@ FRAME must be a live frame and defaults to the selected frame."
132 (error "%s is not a live frame" frame)) 132 (error "%s is not a live frame" frame))
133 (selected-frame))) 133 (selected-frame)))
134 134
135(defsubst window-normalize-window (window &optional live-only) 135(defun window-normalize-window (window &optional live-only)
136 "Return window specified by WINDOW. 136 "Return window specified by WINDOW.
137If WINDOW is nil, return `selected-window'. 137If WINDOW is nil, return `selected-window'.
138If WINDOW is a live window or internal window, return WINDOW; 138If WINDOW is a live window or internal window, return WINDOW;
@@ -195,7 +195,7 @@ narrower, explictly specify the SIZE argument of that function."
195 :version "24.1" 195 :version "24.1"
196 :group 'windows) 196 :group 'windows)
197 197
198(defsubst window-combined-p (&optional window horizontal) 198(defun window-combined-p (&optional window horizontal)
199 "Return non-nil if WINDOW has siblings in a given direction. 199 "Return non-nil if WINDOW has siblings in a given direction.
200If WINDOW is omitted or nil, it defaults to the selected window. 200If WINDOW is omitted or nil, it defaults to the selected window.
201 201
@@ -211,11 +211,11 @@ horizontal window combination."
211 (window-left-child parent) 211 (window-left-child parent)
212 (window-top-child parent))))) 212 (window-top-child parent)))))
213 213
214(defun window-combinations (&optional window horizontal) 214(defun window-combinations (window &optional horizontal)
215 "Return largest number of vertically arranged subwindows of WINDOW. 215 "Return largest number of windows vertically arranged within WINDOW.
216If WINDOW is omitted or nil, it defaults to the selected window. 216If WINDOW is omitted or nil, it defaults to the selected window.
217If HORIZONTAL is non-nil, return the largest number of 217If HORIZONTAL is non-nil, return the largest number of
218horizontally arranged subwindows of WINDOW." 218windows horizontally arranged within WINDOW."
219 (setq window (window-normalize-window window)) 219 (setq window (window-normalize-window window))
220 (cond 220 (cond
221 ((window-live-p window) 221 ((window-live-p window)
@@ -225,7 +225,7 @@ horizontally arranged subwindows of WINDOW."
225 (window-left-child window) 225 (window-left-child window)
226 (window-top-child window)) 226 (window-top-child window))
227 ;; If WINDOW is iso-combined, return the sum of the values for all 227 ;; If WINDOW is iso-combined, return the sum of the values for all
228 ;; subwindows of WINDOW. 228 ;; child windows of WINDOW.
229 (let ((child (window-child window)) 229 (let ((child (window-child window))
230 (count 0)) 230 (count 0))
231 (while child 231 (while child
@@ -236,7 +236,7 @@ horizontally arranged subwindows of WINDOW."
236 count)) 236 count))
237 (t 237 (t
238 ;; If WINDOW is not iso-combined, return the maximum value of any 238 ;; If WINDOW is not iso-combined, return the maximum value of any
239 ;; subwindow of WINDOW. 239 ;; child window of WINDOW.
240 (let ((child (window-child window)) 240 (let ((child (window-child window))
241 (count 1)) 241 (count 1))
242 (while child 242 (while child
@@ -279,14 +279,16 @@ unpredictable."
279 proc (frame-root-window walk-window-tree-frame) any))) 279 proc (frame-root-window walk-window-tree-frame) any)))
280 280
281(defun walk-window-subtree (proc &optional window any) 281(defun walk-window-subtree (proc &optional window any)
282 "Run function PROC on each live subwindow of WINDOW. 282 "Run function PROC on the subtree of windows rooted at WINDOW.
283WINDOW defaults to the selected window. PROC must be a function 283WINDOW defaults to the selected window. PROC must be a function
284with one argument - a window. ANY, if non-nil means to run PROC 284with one argument - a window. By default, run PROC only on live
285on all live and internal subwindows of WINDOW. 285windows of the subtree. If the optional argument ANY is non-nil,
286run PROC on all live and internal windows of the subtree. If
287WINDOW is live, run PROC on WINDOW only.
286 288
287This function performs a pre-order, depth-first traversal of the 289This function performs a pre-order, depth-first traversal of the
288window tree rooted at WINDOW. If PROC changes that window tree, 290subtree rooted at WINDOW. If PROC changes that tree, the result
289the result is unpredictable." 291is unpredictable."
290 (setq window (window-normalize-window window)) 292 (setq window (window-normalize-window window))
291 (walk-window-tree-1 proc window any t)) 293 (walk-window-tree-1 proc window any t))
292 294
@@ -381,9 +383,9 @@ WINDOW must be an internal window. Return WINDOW."
381(defun window-atom-check (&optional frame) 383(defun window-atom-check (&optional frame)
382 "Check atomicity of all windows on FRAME. 384 "Check atomicity of all windows on FRAME.
383FRAME defaults to the selected frame. If an atomic window is 385FRAME defaults to the selected frame. If an atomic window is
384wrongly configured, reset the atomicity of all its subwindows to 386wrongly configured, reset the atomicity of all its windows on
385nil. An atomic window is wrongly configured if it has no 387FRAME to nil. An atomic window is wrongly configured if it has
386subwindows or one of its subwindows is not atomic." 388no child windows or one of its child windows is not atomic."
387 (window-atom-check-1 (frame-root-window frame))) 389 (window-atom-check-1 (frame-root-window frame)))
388 390
389;; Side windows. 391;; Side windows.
@@ -528,7 +530,7 @@ unless it has no other choice \(like when deleting a neighboring
528window).") 530window).")
529(make-variable-buffer-local 'window-size-fixed) 531(make-variable-buffer-local 'window-size-fixed)
530 532
531(defsubst window-size-ignore (window ignore) 533(defun window-size-ignore (window ignore)
532 "Return non-nil if IGNORE says to ignore size restrictions for WINDOW." 534 "Return non-nil if IGNORE says to ignore size restrictions for WINDOW."
533 (if (window-valid-p ignore) (eq window ignore) ignore)) 535 (if (window-valid-p ignore) (eq window ignore) ignore))
534 536
@@ -555,13 +557,13 @@ restrictions for that window only."
555 ;; WINDOW is an internal window. 557 ;; WINDOW is an internal window.
556 (if (window-combined-p sub horizontal) 558 (if (window-combined-p sub horizontal)
557 ;; The minimum size of an iso-combination is the sum of 559 ;; The minimum size of an iso-combination is the sum of
558 ;; the minimum sizes of its subwindows. 560 ;; the minimum sizes of its child windows.
559 (while sub 561 (while sub
560 (setq value (+ value 562 (setq value (+ value
561 (window-min-size-1 sub horizontal ignore))) 563 (window-min-size-1 sub horizontal ignore)))
562 (setq sub (window-right sub))) 564 (setq sub (window-right sub)))
563 ;; The minimum size of an ortho-combination is the maximum of 565 ;; The minimum size of an ortho-combination is the maximum of
564 ;; the minimum sizes of its subwindows. 566 ;; the minimum sizes of its child windows.
565 (while sub 567 (while sub
566 (setq value (max value 568 (setq value (max value
567 (window-min-size-1 sub horizontal ignore))) 569 (window-min-size-1 sub horizontal ignore)))
@@ -619,8 +621,9 @@ Optional argument HORIZONTAL non-nil means return DELTA if DELTA
619columns can be added to WINDOW. A return value of zero means 621columns can be added to WINDOW. A return value of zero means
620that no lines (or columns) can be added to WINDOW. 622that no lines (or columns) can be added to WINDOW.
621 623
622This function looks only at WINDOW and its subwindows. The 624This function looks only at WINDOW and, recursively, its child
623function `window-resizable' looks at other windows as well. 625windows. The function `window-resizable' looks at other windows
626as well.
624 627
625DELTA positive means WINDOW shall be enlarged by DELTA lines or 628DELTA positive means WINDOW shall be enlarged by DELTA lines or
626columns. If WINDOW cannot be enlarged by DELTA lines or columns 629columns. If WINDOW cannot be enlarged by DELTA lines or columns
@@ -652,7 +655,7 @@ restrictions for that window only."
652 delta)) 655 delta))
653 (t 0))) 656 (t 0)))
654 657
655(defsubst window-sizable-p (window delta &optional horizontal ignore) 658(defun window-sizable-p (window delta &optional horizontal ignore)
656 "Return t if WINDOW can be resized by DELTA lines. 659 "Return t if WINDOW can be resized by DELTA lines.
657For the meaning of the arguments of this function see the 660For the meaning of the arguments of this function see the
658doc-string of `window-sizable'." 661doc-string of `window-sizable'."
@@ -668,24 +671,24 @@ doc-string of `window-sizable'."
668 (if sub 671 (if sub
669 ;; WINDOW is an internal window. 672 ;; WINDOW is an internal window.
670 (if (window-combined-p sub horizontal) 673 (if (window-combined-p sub horizontal)
671 ;; An iso-combination is fixed size if all its subwindows 674 ;; An iso-combination is fixed size if all its child
672 ;; are fixed-size. 675 ;; windows are fixed-size.
673 (progn 676 (progn
674 (while sub 677 (while sub
675 (unless (window-size-fixed-1 sub horizontal) 678 (unless (window-size-fixed-1 sub horizontal)
676 ;; We found a non-fixed-size subwindow, so WINDOW's 679 ;; We found a non-fixed-size child window, so
677 ;; size is not fixed. 680 ;; WINDOW's size is not fixed.
678 (throw 'fixed nil)) 681 (throw 'fixed nil))
679 (setq sub (window-right sub))) 682 (setq sub (window-right sub)))
680 ;; All subwindows are fixed-size, so WINDOW's size is 683 ;; All child windows are fixed-size, so WINDOW's size is
681 ;; fixed. 684 ;; fixed.
682 (throw 'fixed t)) 685 (throw 'fixed t))
683 ;; An ortho-combination is fixed-size if at least one of its 686 ;; An ortho-combination is fixed-size if at least one of its
684 ;; subwindows is fixed-size. 687 ;; child windows is fixed-size.
685 (while sub 688 (while sub
686 (when (window-size-fixed-1 sub horizontal) 689 (when (window-size-fixed-1 sub horizontal)
687 ;; We found a fixed-size subwindow, so WINDOW's size is 690 ;; We found a fixed-size child window, so WINDOW's size
688 ;; fixed. 691 ;; is fixed.
689 (throw 'fixed t)) 692 (throw 'fixed t))
690 (setq sub (window-right sub)))) 693 (setq sub (window-right sub))))
691 ;; WINDOW is a live window. 694 ;; WINDOW is a live window.
@@ -701,8 +704,8 @@ window. Optional argument HORIZONTAL non-nil means return
701non-nil if WINDOW's width is fixed. 704non-nil if WINDOW's width is fixed.
702 705
703If this function returns nil, this does not necessarily mean that 706If this function returns nil, this does not necessarily mean that
704WINDOW can be resized in the desired direction. The functions 707WINDOW can be resized in the desired direction. The function
705`window-resizable' and `window-resizable-p' will tell that." 708`window-resizable' can tell that."
706 (window-size-fixed-1 709 (window-size-fixed-1
707 (window-normalize-window window) horizontal)) 710 (window-normalize-window window) horizontal))
708 711
@@ -717,8 +720,8 @@ WINDOW can be resized in the desired direction. The functions
717 (catch 'done 720 (catch 'done
718 (if (window-combined-p sub horizontal) 721 (if (window-combined-p sub horizontal)
719 ;; In an iso-combination throw DELTA if we find at least one 722 ;; In an iso-combination throw DELTA if we find at least one
720 ;; subwindow and that subwindow is either not of fixed-size 723 ;; child window and that window is either not fixed-size or
721 ;; or we can ignore fixed-sizeness. 724 ;; we can ignore fixed-sizeness.
722 (let ((skip (eq trail 'after))) 725 (let ((skip (eq trail 'after)))
723 (while sub 726 (while sub
724 (cond 727 (cond
@@ -728,11 +731,11 @@ WINDOW can be resized in the desired direction. The functions
728 ((and (not (window-size-ignore window ignore)) 731 ((and (not (window-size-ignore window ignore))
729 (window-size-fixed-p sub horizontal))) 732 (window-size-fixed-p sub horizontal)))
730 (t 733 (t
731 ;; We found a non-fixed-size subwindow. 734 ;; We found a non-fixed-size child window.
732 (throw 'done delta))) 735 (throw 'done delta)))
733 (setq sub (window-right sub)))) 736 (setq sub (window-right sub))))
734 ;; In an ortho-combination set DELTA to the minimum value by 737 ;; In an ortho-combination set DELTA to the minimum value by
735 ;; which other subwindows can shrink. 738 ;; which other child windows can shrink.
736 (while sub 739 (while sub
737 (unless (eq sub window) 740 (unless (eq sub window)
738 (setq delta 741 (setq delta
@@ -768,8 +771,8 @@ Optional argument NOUP non-nil means don't go up in the window
768tree but try to enlarge windows within WINDOW's combination only. 771tree but try to enlarge windows within WINDOW's combination only.
769 772
770Optional argument NODOWN non-nil means don't check whether WINDOW 773Optional argument NODOWN non-nil means don't check whether WINDOW
771itself \(and its subwindows) can be shrunk; check only whether at 774itself \(and its child windows) can be shrunk; check only whether
772least one other windows can be enlarged appropriately." 775at least one other window can be enlarged appropriately."
773 (setq window (window-normalize-window window)) 776 (setq window (window-normalize-window window))
774 (let ((size (window-total-size window horizontal)) 777 (let ((size (window-total-size window horizontal))
775 (minimum (window-min-size window horizontal ignore))) 778 (minimum (window-min-size window horizontal ignore)))
@@ -797,7 +800,7 @@ least one other windows can be enlarged appropriately."
797 (catch 'fixed 800 (catch 'fixed
798 (if (window-combined-p sub horizontal) 801 (if (window-combined-p sub horizontal)
799 ;; For an iso-combination calculate how much we can get from 802 ;; For an iso-combination calculate how much we can get from
800 ;; other subwindows. 803 ;; other child windows.
801 (let ((skip (eq trail 'after))) 804 (let ((skip (eq trail 'after)))
802 (while sub 805 (while sub
803 (cond 806 (cond
@@ -811,7 +814,7 @@ least one other windows can be enlarged appropriately."
811 (window-min-size sub horizontal ignore)))))) 814 (window-min-size sub horizontal ignore))))))
812 (setq sub (window-right sub)))) 815 (setq sub (window-right sub))))
813 ;; For an ortho-combination throw DELTA when at least one 816 ;; For an ortho-combination throw DELTA when at least one
814 ;; subwindow is fixed-size. 817 ;; child window is fixed-size.
815 (while sub 818 (while sub
816 (when (and (not (eq sub window)) 819 (when (and (not (eq sub window))
817 (not (window-size-ignore sub ignore)) 820 (not (window-size-ignore sub ignore))
@@ -850,8 +853,8 @@ tree but try to obtain the entire space from windows within
850WINDOW's combination. 853WINDOW's combination.
851 854
852Optional argument NODOWN non-nil means do not check whether 855Optional argument NODOWN non-nil means do not check whether
853WINDOW itself \(and its subwindows) can be enlarged; check only 856WINDOW itself \(and its child windows) can be enlarged; check
854whether other windows can be shrunk appropriately." 857only whether other windows can be shrunk appropriately."
855 (setq window (window-normalize-window window)) 858 (setq window (window-normalize-window window))
856 (if (and (not (window-size-ignore window ignore)) 859 (if (and (not (window-size-ignore window ignore))
857 (not nodown) (window-size-fixed-p window horizontal)) 860 (not nodown) (window-size-fixed-p window horizontal))
@@ -862,14 +865,14 @@ whether other windows can be shrunk appropriately."
862 (window-max-delta-1 window 0 horizontal ignore trail noup))) 865 (window-max-delta-1 window 0 horizontal ignore trail noup)))
863 866
864;; Make NOUP also inhibit the min-size check. 867;; Make NOUP also inhibit the min-size check.
865(defun window-resizable (window delta &optional horizontal ignore trail noup nodown) 868(defun window--resizable (window delta &optional horizontal ignore trail noup nodown)
866 "Return DELTA if WINDOW can be resized vertically by DELTA lines. 869 "Return DELTA if WINDOW can be resized vertically by DELTA lines.
867Optional argument HORIZONTAL non-nil means return DELTA if WINDOW 870Optional argument HORIZONTAL non-nil means return DELTA if WINDOW
868can be resized horizontally by DELTA columns. A return value of 871can be resized horizontally by DELTA columns. A return value of
869zero means that WINDOW is not resizable. 872zero means that WINDOW is not resizable.
870 873
871DELTA positive means WINDOW shall be enlarged by DELTA lines or 874DELTA positive means WINDOW shall be enlarged by DELTA lines or
872columns. If WINDOW cannot be enlarged by DELTA lines or columns 875columns. If WINDOW cannot be enlarged by DELTA lines or columns,
873return the maximum value in the range 0..DELTA by which WINDOW 876return the maximum value in the range 0..DELTA by which WINDOW
874can be enlarged. 877can be enlarged.
875 878
@@ -891,11 +894,12 @@ of or below WINDOW can be shrunk. Optional argument TRAIL
891shrunk. 894shrunk.
892 895
893Optional argument NOUP non-nil means don't go up in the window 896Optional argument NOUP non-nil means don't go up in the window
894tree but try to distribute the space among the other windows 897tree but check only whether space can be obtained from (or given
895within WINDOW's combination. 898to) WINDOW's siblings.
896 899
897Optional argument NODOWN non-nil means don't check whether WINDOW 900Optional argument NODOWN non-nil means don't go down in the
898and its subwindows can be resized." 901window tree. This means do not check whether resizing would
902violate size restrictions of WINDOW or its child windows."
899 (setq window (window-normalize-window window)) 903 (setq window (window-normalize-window window))
900 (cond 904 (cond
901 ((< delta 0) 905 ((< delta 0)
@@ -906,34 +910,58 @@ and its subwindows can be resized."
906 delta)) 910 delta))
907 (t 0))) 911 (t 0)))
908 912
909(defun window-resizable-p (window delta &optional horizontal ignore trail noup nodown) 913(defun window--resizable-p (window delta &optional horizontal ignore trail noup nodown)
910 "Return t if WINDOW can be resized vertically by DELTA lines. 914 "Return t if WINDOW can be resized vertically by DELTA lines.
911For the meaning of the arguments of this function see the 915For the meaning of the arguments of this function see the
912doc-string of `window-resizable'." 916doc-string of `window--resizable'."
913 (setq window (window-normalize-window window)) 917 (setq window (window-normalize-window window))
914 (if (> delta 0) 918 (if (> delta 0)
915 (>= (window-resizable window delta horizontal ignore trail noup nodown) 919 (>= (window--resizable window delta horizontal ignore trail noup nodown)
916 delta) 920 delta)
917 (<= (window-resizable window delta horizontal ignore trail noup nodown) 921 (<= (window--resizable window delta horizontal ignore trail noup nodown)
918 delta))) 922 delta)))
919 923
920(defsubst window-total-height (&optional window) 924(defun window-resizable (window delta &optional horizontal ignore)
921 "Return the total number of lines of WINDOW. 925 "Return DELTA if WINDOW can be resized vertically by DELTA lines.
922WINDOW can be any window and defaults to the selected one. The 926Optional argument HORIZONTAL non-nil means return DELTA if WINDOW
923return value includes WINDOW's mode line and header line, if any. 927can be resized horizontally by DELTA columns. A return value of
924If WINDOW is internal the return value is the sum of the total 928zero means that WINDOW is not resizable.
925number of lines of WINDOW's child windows if these are vertically 929
926combined and the height of WINDOW's first child otherwise. 930DELTA positive means WINDOW shall be enlarged by DELTA lines or
931columns. If WINDOW cannot be enlarged by DELTA lines or columns
932return the maximum value in the range 0..DELTA by which WINDOW
933can be enlarged.
934
935DELTA negative means WINDOW shall be shrunk by -DELTA lines or
936columns. If WINDOW cannot be shrunk by -DELTA lines or columns,
937return the minimum value in the range DELTA..0 that can be used
938for shrinking WINDOW.
939
940Optional argument IGNORE non-nil means ignore any restrictions
941imposed by fixed size windows, `window-min-height' or
942`window-min-width' settings. IGNORE a window means ignore
943restrictions for that window only. IGNORE equal `safe' means
944live windows may get as small as `window-safe-min-height' lines
945and `window-safe-min-width' columns."
946 (setq window (window-normalize-window window))
947 (window--resizable window delta horizontal ignore))
927 948
928Note: This function does not take into account the value of 949(defun window-total-size (&optional window horizontal)
929`line-spacing' when calculating the number of lines in WINDOW." 950 "Return the total height or width of window WINDOW.
930 (window-total-size window)) 951If WINDOW is omitted or nil, it defaults to the selected window.
952
953If HORIZONTAL is omitted or nil, return the total height of
954WINDOW, in lines, like `window-total-height'. Otherwise return
955the total width, in columns, like `window-total-width'."
956 (if horizontal
957 (window-total-width window)
958 (window-total-height window)))
931 959
932;; Eventually we should make `window-height' obsolete. 960;; Eventually we should make `window-height' obsolete.
933(defalias 'window-height 'window-total-height) 961(defalias 'window-height 'window-total-height)
934 962
935;; See discussion in bug#4543. 963;; See discussion in bug#4543.
936(defsubst window-full-height-p (&optional window) 964(defun window-full-height-p (&optional window)
937 "Return t if WINDOW is as high as the containing frame. 965 "Return t if WINDOW is as high as the containing frame.
938More precisely, return t if and only if the total height of 966More precisely, return t if and only if the total height of
939WINDOW equals the total height of the root window of WINDOW's 967WINDOW equals the total height of the root window of WINDOW's
@@ -943,17 +971,7 @@ one."
943 (= (window-total-size window) 971 (= (window-total-size window)
944 (window-total-size (frame-root-window window)))) 972 (window-total-size (frame-root-window window))))
945 973
946(defsubst window-total-width (&optional window) 974(defun window-full-width-p (&optional window)
947 "Return the total number of columns of WINDOW.
948WINDOW can be any window and defaults to the selected one. The
949return value includes any vertical dividers or scrollbars of
950WINDOW. If WINDOW is internal, the return value is the sum of
951the total number of columns of WINDOW's child windows if these
952are horizontally combined and the width of WINDOW's first child
953otherwise."
954 (window-total-size window t))
955
956(defsubst window-full-width-p (&optional window)
957 "Return t if WINDOW is as wide as the containing frame. 975 "Return t if WINDOW is as wide as the containing frame.
958More precisely, return t if and only if the total width of WINDOW 976More precisely, return t if and only if the total width of WINDOW
959equals the total width of the root window of WINDOW's frame. 977equals the total width of the root window of WINDOW's frame.
@@ -962,40 +980,17 @@ WINDOW can be any window and defaults to the selected one."
962 (= (window-total-size window t) 980 (= (window-total-size window t)
963 (window-total-size (frame-root-window window) t))) 981 (window-total-size (frame-root-window window) t)))
964 982
965(defsubst window-body-height (&optional window) 983(defun window-body-size (&optional window horizontal)
966 "Return the number of lines of WINDOW's body. 984 "Return the height or width of WINDOW's text area.
967WINDOW must be a live window and defaults to the selected one. 985If WINDOW is omitted or nil, it defaults to the selected window.
968 986Signal an error if the window is not live.
969The return value does not include WINDOW's mode line and header
970line, if any. If a line at the bottom of the window is only
971partially visible, that line is included in the return value. If
972you do not want to include a partially visible bottom line in the
973return value, use `window-text-height' instead.
974
975Note that the return value is measured in canonical units, i.e. for
976the default frame's face. If the window shows some characters with
977non-default face, e.g., if the font of some characters is larger or
978smaller than the default font, the value returned by this function
979will not match the actual number of lines shown in the window. To
980get the actual number of lines, use `posn-at-point'."
981 (window-body-size window))
982
983(defsubst window-body-width (&optional window)
984 "Return the number of columns of WINDOW's body.
985WINDOW must be a live window and defaults to the selected one.
986
987The return value does not include any vertical dividers or scroll
988bars owned by WINDOW. On a window-system the return value does
989not include the number of columns used for WINDOW's fringes or
990display margins either.
991 987
992Note that the return value is measured in canonical units, i.e. for 988If HORIZONTAL is omitted or nil, return the height of the text
993the default frame's face. If the window shows some characters with 989area, like `window-body-height'. Otherwise, return the width of
994non-default face, e.g., if the font of some characters is larger or 990the text area, like `window-body-width'."
995smaller than the default font, the value returned by this function 991 (if horizontal
996will not match the actual number of characters per line shown in the 992 (window-body-width window)
997window. To get the actual number of columns, use `posn-at-point'." 993 (window-body-height window)))
998 (window-body-size window t))
999 994
1000;; Eventually we should make `window-height' obsolete. 995;; Eventually we should make `window-height' obsolete.
1001(defalias 'window-width 'window-body-width) 996(defalias 'window-width 'window-body-width)
@@ -1463,9 +1458,9 @@ as small) as possible but don't signal an error."
1463 1458
1464 ;; Resize now. 1459 ;; Resize now.
1465 (window--resize-reset frame) 1460 (window--resize-reset frame)
1466 ;; Ideally we should be able to resize just the last subwindow of 1461 ;; Ideally we should be able to resize just the last child of root
1467 ;; root here. See the comment in `resize-root-window-vertically' 1462 ;; here. See the comment in `resize-root-window-vertically' for
1468 ;; for why we do not do that. 1463 ;; why we do not do that.
1469 (window--resize-this-window root (- delta) nil nil t) 1464 (window--resize-this-window root (- delta) nil nil t)
1470 (set-window-new-total window (+ height delta)) 1465 (set-window-new-total window (+ height delta))
1471 ;; The following routine catches the case where we want to resize 1466 ;; The following routine catches the case where we want to resize
@@ -1506,7 +1501,7 @@ instead."
1506 (error "Cannot resize the root window of a frame")) 1501 (error "Cannot resize the root window of a frame"))
1507 ((window-minibuffer-p window) 1502 ((window-minibuffer-p window)
1508 (window--resize-mini-window window delta)) 1503 (window--resize-mini-window window delta))
1509 ((window-resizable-p window delta horizontal ignore) 1504 ((window--resizable-p window delta horizontal ignore)
1510 (window--resize-reset frame horizontal) 1505 (window--resize-reset frame horizontal)
1511 (window--resize-this-window window delta horizontal ignore t) 1506 (window--resize-this-window window delta horizontal ignore t)
1512 (if (and (not (window-splits window)) 1507 (if (and (not (window-splits window))
@@ -1532,14 +1527,14 @@ instead."
1532 (t 1527 (t
1533 (error "Cannot resize window %s" window))))) 1528 (error "Cannot resize window %s" window)))))
1534 1529
1535(defsubst window--resize-subwindows-skip-p (window) 1530(defun window--resize-child-windows-skip-p (window)
1536 "Return non-nil if WINDOW shall be skipped by resizing routines." 1531 "Return non-nil if WINDOW shall be skipped by resizing routines."
1537 (memq (window-new-normal window) '(ignore stuck skip))) 1532 (memq (window-new-normal window) '(ignore stuck skip)))
1538 1533
1539(defun window--resize-subwindows-normal (parent horizontal window this-delta &optional trail other-delta) 1534(defun window--resize-child-windows-normal (parent horizontal window this-delta &optional trail other-delta)
1540 "Set the new normal height of subwindows of window PARENT. 1535 "Recursively set new normal height of child windows of window PARENT.
1541HORIZONTAL non-nil means set the new normal width of these 1536HORIZONTAL non-nil means set the new normal width of these
1542windows. WINDOW specifies a subwindow of PARENT that has been 1537windows. WINDOW specifies a child window of PARENT that has been
1543resized by THIS-DELTA lines \(columns). 1538resized by THIS-DELTA lines \(columns).
1544 1539
1545Optional argument TRAIL either 'before or 'after means set values 1540Optional argument TRAIL either 'before or 'after means set values
@@ -1561,8 +1556,8 @@ PARENT in order to resize WINDOW."
1561 (parent-normal 0.0) 1556 (parent-normal 0.0)
1562 (skip (eq trail 'after))) 1557 (skip (eq trail 'after)))
1563 1558
1564 ;; Set parent-normal to the sum of the normal sizes of all 1559 ;; Set parent-normal to the sum of the normal sizes of all child
1565 ;; subwindows of PARENT that shall be resized, excluding only WINDOW 1560 ;; windows of PARENT that shall be resized, excluding only WINDOW
1566 ;; and any windows specified by the optional TRAIL argument. 1561 ;; and any windows specified by the optional TRAIL argument.
1567 (while sub 1562 (while sub
1568 (cond 1563 (cond
@@ -1574,7 +1569,7 @@ PARENT in order to resize WINDOW."
1574 (+ parent-normal (window-normal-size sub horizontal))))) 1569 (+ parent-normal (window-normal-size sub horizontal)))))
1575 (setq sub (window-right sub))) 1570 (setq sub (window-right sub)))
1576 1571
1577 ;; Set the new normal size of all subwindows of PARENT from what 1572 ;; Set the new normal size of all child windows of PARENT from what
1578 ;; they should have contributed for recovering THIS-DELTA lines 1573 ;; they should have contributed for recovering THIS-DELTA lines
1579 ;; (columns). 1574 ;; (columns).
1580 (setq sub (window-child parent)) 1575 (setq sub (window-child parent))
@@ -1633,11 +1628,11 @@ PARENT in order to resize WINDOW."
1633 ;; Don't get larger than 1 or smaller than 0. 1628 ;; Don't get larger than 1 or smaller than 0.
1634 (min 1.0 (max (- 1.0 sum) 0.0)))))) 1629 (min 1.0 (max (- 1.0 sum) 0.0))))))
1635 1630
1636(defun window--resize-subwindows (parent delta &optional horizontal window ignore trail edge) 1631(defun window--resize-child-windows (parent delta &optional horizontal window ignore trail edge)
1637 "Resize subwindows of window PARENT vertically by DELTA lines. 1632 "Resize child windows of window PARENT vertically by DELTA lines.
1638PARENT must be a vertically combined internal window. 1633PARENT must be a vertically combined internal window.
1639 1634
1640Optional argument HORIZONTAL non-nil means resize subwindows of 1635Optional argument HORIZONTAL non-nil means resize child windows of
1641PARENT horizontally by DELTA columns. In this case PARENT must 1636PARENT horizontally by DELTA columns. In this case PARENT must
1642be a horizontally combined internal window. 1637be a horizontally combined internal window.
1643 1638
@@ -1669,10 +1664,10 @@ already set by this routine."
1669 (setq sub first) 1664 (setq sub first)
1670 (while (and (window-right sub) 1665 (while (and (window-right sub)
1671 (or (and (eq trail 'before) 1666 (or (and (eq trail 'before)
1672 (not (window--resize-subwindows-skip-p 1667 (not (window--resize-child-windows-skip-p
1673 (window-right sub)))) 1668 (window-right sub))))
1674 (and (eq trail 'after) 1669 (and (eq trail 'after)
1675 (window--resize-subwindows-skip-p sub)))) 1670 (window--resize-child-windows-skip-p sub))))
1676 (setq sub (window-right sub))) 1671 (setq sub (window-right sub)))
1677 sub) 1672 sub)
1678 (if horizontal 1673 (if horizontal
@@ -1700,7 +1695,7 @@ already set by this routine."
1700 window (- (window-normal-size window horizontal) 1695 window (- (window-normal-size window horizontal)
1701 (- (window-new-normal sub) 1696 (- (window-new-normal sub)
1702 (window-normal-size sub horizontal))))) 1697 (window-normal-size sub horizontal)))))
1703 (window--resize-subwindows-normal 1698 (window--resize-child-windows-normal
1704 parent horizontal sub 0 trail delta)) 1699 parent horizontal sub 0 trail delta))
1705 ;; Return 'normalized to notify `window--resize-siblings' that 1700 ;; Return 'normalized to notify `window--resize-siblings' that
1706 ;; normal sizes have been already set. 1701 ;; normal sizes have been already set.
@@ -1709,9 +1704,9 @@ already set by this routine."
1709 (setq sub first) 1704 (setq sub first)
1710 (while sub 1705 (while sub
1711 (cond 1706 (cond
1712 ((or (window--resize-subwindows-skip-p sub) 1707 ((or (window--resize-child-windows-skip-p sub)
1713 ;; Ignore windows to skip and fixed-size subwindows - in 1708 ;; Ignore windows to skip and fixed-size child windows -
1714 ;; the latter case make it a window to skip. 1709 ;; in the latter case make it a window to skip.
1715 (and (not ignore) 1710 (and (not ignore)
1716 (window-size-fixed-p sub horizontal) 1711 (window-size-fixed-p sub horizontal)
1717 (set-window-new-normal sub 'ignore)))) 1712 (set-window-new-normal sub 'ignore))))
@@ -1799,7 +1794,7 @@ already set by this routine."
1799 (set-window-new-normal sub)) 1794 (set-window-new-normal sub))
1800 1795
1801 (unless (eq (window-new-normal sub) 'ignore) 1796 (unless (eq (window-new-normal sub) 'ignore)
1802 ;; Resize this subwindow's subwindows (back-engineering 1797 ;; Resize this window's child windows (back-engineering
1803 ;; delta from sub's old and new total sizes). 1798 ;; delta from sub's old and new total sizes).
1804 (let ((delta (- (window-new-total sub) 1799 (let ((delta (- (window-new-total sub)
1805 (window-total-size sub horizontal)))) 1800 (window-total-size sub horizontal))))
@@ -1860,7 +1855,7 @@ preferably only resize windows adjacent to EDGE."
1860 ;; Set this-delta to what we can get from WINDOW's siblings. 1855 ;; Set this-delta to what we can get from WINDOW's siblings.
1861 (if (= (- delta) (window-total-size window horizontal)) 1856 (if (= (- delta) (window-total-size window horizontal))
1862 ;; A deletion, presumably. We must handle this case 1857 ;; A deletion, presumably. We must handle this case
1863 ;; specially since `window-resizable' can't be used. 1858 ;; specially since `window--resizable' can't be used.
1864 (if this-delta 1859 (if this-delta
1865 ;; There's at least one resizable sibling we can 1860 ;; There's at least one resizable sibling we can
1866 ;; give WINDOW's size to. 1861 ;; give WINDOW's size to.
@@ -1869,7 +1864,7 @@ preferably only resize windows adjacent to EDGE."
1869 (setq this-delta 0)) 1864 (setq this-delta 0))
1870 ;; Any other form of resizing. 1865 ;; Any other form of resizing.
1871 (setq this-delta 1866 (setq this-delta
1872 (window-resizable window delta horizontal ignore trail t))) 1867 (window--resizable window delta horizontal ignore trail t)))
1873 1868
1874 ;; Set other-delta to what we still have to get from 1869 ;; Set other-delta to what we still have to get from
1875 ;; ancestor windows of parent. 1870 ;; ancestor windows of parent.
@@ -1882,19 +1877,19 @@ preferably only resize windows adjacent to EDGE."
1882 (if (zerop this-delta) 1877 (if (zerop this-delta)
1883 ;; We haven't got anything from WINDOW's siblings but we 1878 ;; We haven't got anything from WINDOW's siblings but we
1884 ;; must update the normal sizes to respect other-delta. 1879 ;; must update the normal sizes to respect other-delta.
1885 (window--resize-subwindows-normal 1880 (window--resize-child-windows-normal
1886 parent horizontal window this-delta trail other-delta) 1881 parent horizontal window this-delta trail other-delta)
1887 ;; We did get something from WINDOW's siblings which means 1882 ;; We did get something from WINDOW's siblings which means
1888 ;; we have to resize their subwindows. 1883 ;; we have to resize their child windows.
1889 (unless (eq (window--resize-subwindows 1884 (unless (eq (window--resize-child-windows
1890 parent (- this-delta) horizontal 1885 parent (- this-delta) horizontal
1891 window ignore trail edge) 1886 window ignore trail edge)
1892 ;; If `window--resize-subwindows' returns 1887 ;; If `window--resize-child-windows' returns
1893 ;; 'normalized, this means it has set the 1888 ;; 'normalized, this means it has set the
1894 ;; normal sizes already. 1889 ;; normal sizes already.
1895 'normalized) 1890 'normalized)
1896 ;; Set the normal sizes. 1891 ;; Set the normal sizes.
1897 (window--resize-subwindows-normal 1892 (window--resize-child-windows-normal
1898 parent horizontal window this-delta trail other-delta)) 1893 parent horizontal window this-delta trail other-delta))
1899 ;; Set DELTA to what we still have to get from ancestor 1894 ;; Set DELTA to what we still have to get from ancestor
1900 ;; windows. 1895 ;; windows.
@@ -1934,8 +1929,8 @@ resize only windows on the left or above EDGE. If TRAIL equals
1934`after', resize only windows on the right or below EDGE. Also, 1929`after', resize only windows on the right or below EDGE. Also,
1935preferably only resize windows adjacent to EDGE. 1930preferably only resize windows adjacent to EDGE.
1936 1931
1937This function recursively resizes WINDOW's subwindows to fit the 1932This function recursively resizes WINDOW's child windows to fit the
1938new size. Make sure that WINDOW is `window-resizable' before 1933new size. Make sure that WINDOW is `window--resizable' before
1939calling this function. Note that this function does not resize 1934calling this function. Note that this function does not resize
1940siblings of WINDOW or WINDOW's parent window. You have to 1935siblings of WINDOW or WINDOW's parent window. You have to
1941eventually call `window-resize-apply' in order to make resizing 1936eventually call `window-resize-apply' in order to make resizing
@@ -1948,11 +1943,11 @@ actually take effect."
1948 (cond 1943 (cond
1949 ((not sub)) 1944 ((not sub))
1950 ((window-combined-p sub horizontal) 1945 ((window-combined-p sub horizontal)
1951 ;; In an iso-combination resize subwindows according to their 1946 ;; In an iso-combination resize child windows according to their
1952 ;; normal sizes. 1947 ;; normal sizes.
1953 (window--resize-subwindows 1948 (window--resize-child-windows
1954 window delta horizontal nil ignore trail edge)) 1949 window delta horizontal nil ignore trail edge))
1955 ;; In an ortho-combination resize each subwindow by DELTA. 1950 ;; In an ortho-combination resize each child window by DELTA.
1956 (t 1951 (t
1957 (while sub 1952 (while sub
1958 (window--resize-this-window 1953 (window--resize-this-window
@@ -1978,7 +1973,7 @@ resizes windows proportionally and never deletes any windows."
1978 "Resize root window WINDOW vertically by DELTA lines. 1973 "Resize root window WINDOW vertically by DELTA lines.
1979If DELTA is less than zero and we can't shrink WINDOW by DELTA 1974If DELTA is less than zero and we can't shrink WINDOW by DELTA
1980lines, shrink it as much as possible. If DELTA is greater than 1975lines, shrink it as much as possible. If DELTA is greater than
1981zero, this function can resize fixed-size subwindows in order to 1976zero, this function can resize fixed-size windows in order to
1982recover the necessary lines. 1977recover the necessary lines.
1983 1978
1984Return the number of lines that were recovered. 1979Return the number of lines that were recovered.
@@ -2075,7 +2070,7 @@ move it as far as possible in the desired direction."
2075 ;; Start resizing. 2070 ;; Start resizing.
2076 (window--resize-reset frame horizontal) 2071 (window--resize-reset frame horizontal)
2077 ;; Try to enlarge LEFT first. 2072 ;; Try to enlarge LEFT first.
2078 (setq this-delta (window-resizable left delta horizontal)) 2073 (setq this-delta (window--resizable left delta horizontal))
2079 (unless (zerop this-delta) 2074 (unless (zerop this-delta)
2080 (window--resize-this-window 2075 (window--resize-this-window
2081 left this-delta horizontal nil t 'before 2076 left this-delta horizontal nil t 'before
@@ -2098,7 +2093,7 @@ move it as far as possible in the desired direction."
2098 ;; Start resizing. 2093 ;; Start resizing.
2099 (window--resize-reset frame horizontal) 2094 (window--resize-reset frame horizontal)
2100 ;; Try to enlarge RIGHT. 2095 ;; Try to enlarge RIGHT.
2101 (setq this-delta (window-resizable right (- delta) horizontal)) 2096 (setq this-delta (window--resizable right (- delta) horizontal))
2102 (unless (zerop this-delta) 2097 (unless (zerop this-delta)
2103 (window--resize-this-window 2098 (window--resize-this-window
2104 right this-delta horizontal nil t 'after 2099 right this-delta horizontal nil t 'after
@@ -2129,7 +2124,7 @@ Return nil."
2129 ((zerop delta)) 2124 ((zerop delta))
2130 ((window-size-fixed-p nil horizontal) 2125 ((window-size-fixed-p nil horizontal)
2131 (error "Selected window has fixed size")) 2126 (error "Selected window has fixed size"))
2132 ((window-resizable-p nil delta horizontal) 2127 ((window--resizable-p nil delta horizontal)
2133 (window-resize nil delta horizontal)) 2128 (window-resize nil delta horizontal))
2134 (t 2129 (t
2135 (window-resize 2130 (window-resize
@@ -2150,7 +2145,7 @@ Return nil."
2150 ((zerop delta)) 2145 ((zerop delta))
2151 ((window-size-fixed-p nil horizontal) 2146 ((window-size-fixed-p nil horizontal)
2152 (error "Selected window has fixed size")) 2147 (error "Selected window has fixed size"))
2153 ((window-resizable-p nil (- delta) horizontal) 2148 ((window--resizable-p nil (- delta) horizontal)
2154 (window-resize nil (- delta) horizontal)) 2149 (window-resize nil (- delta) horizontal))
2155 (t 2150 (t
2156 (window-resize 2151 (window-resize
@@ -2177,7 +2172,7 @@ WINDOW can be any window and defaults to the selected window."
2177 (window-resize window (- (window-min-delta window))) 2172 (window-resize window (- (window-min-delta window)))
2178 (window-resize window (- (window-min-delta window t)) t)) 2173 (window-resize window (- (window-min-delta window t)) t))
2179 2174
2180(defsubst frame-root-window-p (window) 2175(defun frame-root-window-p (window)
2181 "Return non-nil if WINDOW is the root window of its frame." 2176 "Return non-nil if WINDOW is the root window of its frame."
2182 (eq window (frame-root-window window))) 2177 (eq window (frame-root-window window)))
2183 2178
@@ -2214,9 +2209,9 @@ is the frame's minibuffer window.
2214If the root window is not split, ROOT is the root window itself. 2209If the root window is not split, ROOT is the root window itself.
2215Otherwise, ROOT is a list (DIR EDGES W1 W2 ...) where DIR is nil 2210Otherwise, ROOT is a list (DIR EDGES W1 W2 ...) where DIR is nil
2216for a horizontal split, and t for a vertical split. EDGES gives 2211for a horizontal split, and t for a vertical split. EDGES gives
2217the combined size and position of the subwindows in the split, 2212the combined size and position of the child windows in the split,
2218and the rest of the elements are the subwindows in the split. 2213and the rest of the elements are the child windows in the split.
2219Each of the subwindows may again be a window or a list 2214Each of the child windows may again be a window or a list
2220representing a window split, and so on. EDGES is a list \(LEFT 2215representing a window split, and so on. EDGES is a list \(LEFT
2221TOP RIGHT BOTTOM) as returned by `window-edges'." 2216TOP RIGHT BOTTOM) as returned by `window-edges'."
2222 (setq frame (window-normalize-frame frame)) 2217 (setq frame (window-normalize-frame frame))
@@ -2352,13 +2347,13 @@ frame."
2352 ;; frame. 2347 ;; frame.
2353 t)))) 2348 t))))
2354 2349
2355(defun window-or-subwindow-p (subwindow window) 2350(defun window--in-subtree-p (window root)
2356 "Return t if SUBWINDOW is either WINDOW or a subwindow of WINDOW." 2351 "Return t if WINDOW is either ROOT or a member of ROOT's subtree."
2357 (or (eq subwindow window) 2352 (or (eq window root)
2358 (let ((parent (window-parent subwindow))) 2353 (let ((parent (window-parent window)))
2359 (catch 'done 2354 (catch 'done
2360 (while parent 2355 (while parent
2361 (if (eq parent window) 2356 (if (eq parent root)
2362 (throw 'done t) 2357 (throw 'done t)
2363 (setq parent (window-parent parent)))))))) 2358 (setq parent (window-parent parent))))))))
2364 2359
@@ -2410,7 +2405,7 @@ non-side window, signal an error."
2410 (let* ((horizontal (window-left-child parent)) 2405 (let* ((horizontal (window-left-child parent))
2411 (size (window-total-size window horizontal)) 2406 (size (window-total-size window horizontal))
2412 (frame-selected 2407 (frame-selected
2413 (window-or-subwindow-p (frame-selected-window frame) window)) 2408 (window--in-subtree-p (frame-selected-window frame) window))
2414 ;; Emacs 23 preferably gives WINDOW's space to its left 2409 ;; Emacs 23 preferably gives WINDOW's space to its left
2415 ;; sibling. 2410 ;; sibling.
2416 (sibling (or (window-left window) (window-right window)))) 2411 (sibling (or (window-left window) (window-right window))))
@@ -2423,7 +2418,7 @@ non-side window, signal an error."
2423 (set-window-new-normal 2418 (set-window-new-normal
2424 sibling (+ (window-normal-size sibling horizontal) 2419 sibling (+ (window-normal-size sibling horizontal)
2425 (window-normal-size window horizontal)))) 2420 (window-normal-size window horizontal))))
2426 ((window-resizable-p window (- size) horizontal nil nil nil t) 2421 ((window--resizable-p window (- size) horizontal nil nil nil t)
2427 ;; Can do without resizing fixed-size windows. 2422 ;; Can do without resizing fixed-size windows.
2428 (window--resize-siblings window (- size) horizontal)) 2423 (window--resize-siblings window (- size) horizontal))
2429 (t 2424 (t
@@ -3050,7 +3045,7 @@ showing BUFFER-OR-NAME."
3050 (unrecord-window-buffer window buffer))))) 3045 (unrecord-window-buffer window buffer)))))
3051 3046
3052;;; Splitting windows. 3047;;; Splitting windows.
3053(defsubst window-split-min-size (&optional horizontal) 3048(defun window-split-min-size (&optional horizontal)
3054 "Return minimum height of any window when splitting windows. 3049 "Return minimum height of any window when splitting windows.
3055Optional argument HORIZONTAL non-nil means return minimum width." 3050Optional argument HORIZONTAL non-nil means return minimum width."
3056 (if horizontal 3051 (if horizontal
@@ -3126,8 +3121,8 @@ frame. The selected window is not changed by this function."
3126 ;; The `split-window' parameter specifies the function to call. 3121 ;; The `split-window' parameter specifies the function to call.
3127 ;; If that function is `ignore', do nothing. 3122 ;; If that function is `ignore', do nothing.
3128 (throw 'done (funcall function window size side))) 3123 (throw 'done (funcall function window size side)))
3129 ;; If WINDOW is a subwindow of an atomic window, split the root 3124 ;; If WINDOW is part of an atomic window, split the root window
3130 ;; window of that atomic window instead. 3125 ;; of that atomic window instead.
3131 ((and (window-parameter window 'window-atom) 3126 ((and (window-parameter window 'window-atom)
3132 (setq atom-root (window-atom-root window)) 3127 (setq atom-root (window-atom-root window))
3133 (not (eq atom-root window))) 3128 (not (eq atom-root window)))
@@ -3249,7 +3244,7 @@ frame. The selected window is not changed by this function."
3249 ;; we won't be able to return space to those windows when we 3244 ;; we won't be able to return space to those windows when we
3250 ;; delete the one we create here. Hence we do not go up. 3245 ;; delete the one we create here. Hence we do not go up.
3251 (progn 3246 (progn
3252 (window--resize-subwindows parent (- new-size) horizontal) 3247 (window--resize-child-windows parent (- new-size) horizontal)
3253 (let* ((normal (- 1.0 new-normal)) 3248 (let* ((normal (- 1.0 new-normal))
3254 (sub (window-child parent))) 3249 (sub (window-child parent)))
3255 (while sub 3250 (while sub
@@ -3365,8 +3360,8 @@ right, if any."
3365;;; Balancing windows. 3360;;; Balancing windows.
3366 3361
3367;; The following routine uses the recycled code from an old version of 3362;; The following routine uses the recycled code from an old version of
3368;; `window--resize-subwindows'. It's not very pretty, but coding it the way the 3363;; `window--resize-child-windows'. It's not very pretty, but coding it the way the
3369;; new `window--resize-subwindows' code does would hardly make it any shorter or 3364;; new `window--resize-child-windows' code does would hardly make it any shorter or
3370;; more readable (FWIW we'd need three loops - one to calculate the 3365;; more readable (FWIW we'd need three loops - one to calculate the
3371;; minimum sizes per window, one to enlarge or shrink windows until the 3366;; minimum sizes per window, one to enlarge or shrink windows until the
3372;; new parent-size matches, and one where we shrink the largest/enlarge 3367;; new parent-size matches, and one where we shrink the largest/enlarge
@@ -3395,14 +3390,14 @@ is non-nil."
3395 (setq failed nil) 3390 (setq failed nil)
3396 (setq sub first) 3391 (setq sub first)
3397 (while (and sub (not failed)) 3392 (while (and sub (not failed))
3398 ;; Ignore subwindows that should be ignored or are stuck. 3393 ;; Ignore child windows that should be ignored or are stuck.
3399 (unless (window--resize-subwindows-skip-p sub) 3394 (unless (window--resize-child-windows-skip-p sub)
3400 (setq found t) 3395 (setq found t)
3401 (setq sub-total (window-total-size sub horizontal)) 3396 (setq sub-total (window-total-size sub horizontal))
3402 (setq sub-delta (- size sub-total)) 3397 (setq sub-delta (- size sub-total))
3403 (setq sub-amount 3398 (setq sub-amount
3404 (window-sizable sub sub-delta horizontal)) 3399 (window-sizable sub sub-delta horizontal))
3405 ;; Register the new total size for this subwindow. 3400 ;; Register the new total size for this child window.
3406 (set-window-new-total sub (+ sub-total sub-amount)) 3401 (set-window-new-total sub (+ sub-total sub-amount))
3407 (unless (= sub-amount sub-delta) 3402 (unless (= sub-amount sub-delta)
3408 (setq total-sum (- total-sum sub-total sub-amount)) 3403 (setq total-sum (- total-sum sub-total sub-amount))
@@ -3417,7 +3412,7 @@ is non-nil."
3417 ;; (column) until `rest' is zero. 3412 ;; (column) until `rest' is zero.
3418 (setq sub first) 3413 (setq sub first)
3419 (while (and sub (> rest 0)) 3414 (while (and sub (> rest 0))
3420 (unless (window--resize-subwindows-skip-p window) 3415 (unless (window--resize-child-windows-skip-p window)
3421 (set-window-new-total sub 1 t) 3416 (set-window-new-total sub 1 t)
3422 (setq rest (1- rest))) 3417 (setq rest (1- rest)))
3423 (setq sub (window-right sub))) 3418 (setq sub (window-right sub)))
@@ -3439,7 +3434,7 @@ is non-nil."
3439 (window-total-size sub horizontal) 3434 (window-total-size sub horizontal)
3440 (window-new-total sub)) 3435 (window-new-total sub))
3441 (float parent-size))) 3436 (float parent-size)))
3442 ;; Recursively balance each subwindow's subwindows. 3437 ;; Recursively balance each window's child windows.
3443 (balance-windows-1 sub horizontal) 3438 (balance-windows-1 sub horizontal)
3444 (setq sub (window-right sub))))) 3439 (setq sub (window-right sub)))))
3445 3440
@@ -3456,11 +3451,11 @@ is non-nil."
3456 (setq sub (window-right sub)))))))) 3451 (setq sub (window-right sub))))))))
3457 3452
3458(defun balance-windows (&optional window-or-frame) 3453(defun balance-windows (&optional window-or-frame)
3459 "Balance the sizes of subwindows of WINDOW-OR-FRAME. 3454 "Balance the sizes of windows of WINDOW-OR-FRAME.
3460WINDOW-OR-FRAME is optional and defaults to the selected frame. 3455WINDOW-OR-FRAME is optional and defaults to the selected frame.
3461If WINDOW-OR-FRAME denotes a frame, balance the sizes of all 3456If WINDOW-OR-FRAME denotes a frame, balance the sizes of all
3462subwindows of that frame's root window. If WINDOW-OR-FRAME 3457windows of that frame. If WINDOW-OR-FRAME denots a window,
3463denots a window, balance the sizes of all subwindows of that 3458recursively balance the sizes of all child windows of that
3464window." 3459window."
3465 (interactive) 3460 (interactive)
3466 (let* ((window 3461 (let* ((window
@@ -3593,10 +3588,6 @@ specific buffers."
3593 )) 3588 ))
3594 3589
3595;;; Window states, how to get them and how to put them in a window. 3590;;; Window states, how to get them and how to put them in a window.
3596(defsubst window-list-no-nils (&rest args)
3597 "Like LIST but do not add nil elements of ARGS."
3598 (delq nil (apply 'list args)))
3599
3600(defvar window-state-ignored-parameters '(quit-restore) 3591(defvar window-state-ignored-parameters '(quit-restore)
3601 "List of window parameters ignored by `window-state-get'.") 3592 "List of window parameters ignored by `window-state-get'.")
3602 3593
@@ -3610,46 +3601,47 @@ specific buffers."
3610 (buffer (window-buffer window)) 3601 (buffer (window-buffer window))
3611 (selected (eq window (selected-window))) 3602 (selected (eq window (selected-window)))
3612 (head 3603 (head
3613 (window-list-no-nils 3604 `(,type
3614 type 3605 ,@(unless (window-next-sibling window) `((last . t)))
3615 (unless (window-next-sibling window) (cons 'last t)) 3606 (total-height . ,(window-total-size window))
3616 (cons 'total-height (window-total-size window)) 3607 (total-width . ,(window-total-size window t))
3617 (cons 'total-width (window-total-size window t)) 3608 (normal-height . ,(window-normal-size window))
3618 (cons 'normal-height (window-normal-size window)) 3609 (normal-width . ,(window-normal-size window t))
3619 (cons 'normal-width (window-normal-size window t)) 3610 (splits . ,(window-splits window))
3620 (cons 'splits (window-splits window)) 3611 (nest . ,(window-nest window))
3621 (cons 'nest (window-nest window)) 3612 ,@(let (list)
3622 (let (list) 3613 (dolist (parameter (window-parameters window))
3623 (dolist (parameter (window-parameters window)) 3614 (unless (memq (car parameter)
3624 (unless (memq (car parameter) 3615 window-state-ignored-parameters)
3625 window-state-ignored-parameters) 3616 (setq list (cons parameter list))))
3626 (setq list (cons parameter list)))) 3617 (unless (window-parameter window 'clone-of)
3627 (unless (window-parameter window 'clone-of) 3618 ;; Make a clone-of parameter.
3628 ;; Make a clone-of parameter. 3619 (setq list (cons (cons 'clone-of window) list)))
3629 (setq list (cons (cons 'clone-of window) list))) 3620 (when list
3630 (when list 3621 `((parameters . ,list))))
3631 (cons 'parameters list))) 3622 ,@(when buffer
3632 (when buffer 3623 ;; All buffer related things go in here - make the buffer
3633 ;; All buffer related things go in here - make the buffer 3624 ;; current when retrieving `point' and `mark'.
3634 ;; current when retrieving `point' and `mark'. 3625 (with-current-buffer (window-buffer window)
3635 (with-current-buffer (window-buffer window) 3626 (let ((point (window-point-1 window))
3636 (let ((point (window-point-1 window)) 3627 (start (window-start window))
3637 (start (window-start window)) 3628 (mark (mark)))
3638 (mark (mark))) 3629 `((buffer
3639 (window-list-no-nils 3630 ,(buffer-name buffer)
3640 'buffer (buffer-name buffer) 3631 (selected . ,selected)
3641 (cons 'selected selected) 3632 ,@(when window-size-fixed
3642 (when window-size-fixed (cons 'size-fixed window-size-fixed)) 3633 `((size-fixed . ,window-size-fixed)))
3643 (cons 'hscroll (window-hscroll window)) 3634 (hscroll . ,(window-hscroll window))
3644 (cons 'fringes (window-fringes window)) 3635 (fringes . ,(window-fringes window))
3645 (cons 'margins (window-margins window)) 3636 (margins . ,(window-margins window))
3646 (cons 'scroll-bars (window-scroll-bars window)) 3637 (scroll-bars . ,(window-scroll-bars window))
3647 (cons 'vscroll (window-vscroll window)) 3638 (vscroll . ,(window-vscroll window))
3648 (cons 'dedicated (window-dedicated-p window)) 3639 (dedicated . ,(window-dedicated-p window))
3649 (cons 'point (if markers (copy-marker point) point)) 3640 (point . ,(if markers (copy-marker point) point))
3650 (cons 'start (if markers (copy-marker start) start)) 3641 (start . ,(if markers (copy-marker start) start))
3651 (when mark 3642 ,@(when mark
3652 (cons 'mark (if markers (copy-marker mark) mark))))))))) 3643 `((mark . ,(if markers
3644 (copy-marker mark) mark)))))))))))
3653 (tail 3645 (tail
3654 (when (memq type '(vc hc)) 3646 (when (memq type '(vc hc))
3655 (let (list) 3647 (let (list)
@@ -3680,21 +3672,20 @@ value can be also stored on disk and read back in a new session."
3680 (error "%s is not a live or internal window" window)) 3672 (error "%s is not a live or internal window" window))
3681 (frame-root-window))) 3673 (frame-root-window)))
3682 ;; The return value is a cons whose car specifies some constraints on 3674 ;; The return value is a cons whose car specifies some constraints on
3683 ;; the size of WINDOW. The cdr lists the states of the subwindows of 3675 ;; the size of WINDOW. The cdr lists the states of the child windows
3684 ;; WINDOW. 3676 ;; of WINDOW.
3685 (cons 3677 (cons
3686 ;; Frame related things would go into a function, say `frame-state', 3678 ;; Frame related things would go into a function, say `frame-state',
3687 ;; calling `window-state-get' to insert the frame's root window. 3679 ;; calling `window-state-get' to insert the frame's root window.
3688 (window-list-no-nils 3680 `((min-height . ,(window-min-size window))
3689 (cons 'min-height (window-min-size window)) 3681 (min-width . ,(window-min-size window t))
3690 (cons 'min-width (window-min-size window t)) 3682 (min-height-ignore . ,(window-min-size window nil t))
3691 (cons 'min-height-ignore (window-min-size window nil t)) 3683 (min-width-ignore . ,(window-min-size window t t))
3692 (cons 'min-width-ignore (window-min-size window t t)) 3684 (min-height-safe . ,(window-min-size window nil 'safe))
3693 (cons 'min-height-safe (window-min-size window nil 'safe)) 3685 (min-width-safe . ,(window-min-size window t 'safe))
3694 (cons 'min-width-safe (window-min-size window t 'safe)) 3686 ;; These are probably not needed.
3695 ;; These are probably not needed. 3687 ,@(when (window-size-fixed-p window) `((fixed-height . t)))
3696 (when (window-size-fixed-p window) (cons 'fixed-height t)) 3688 ,@(when (window-size-fixed-p window t) `((fixed-width . t))))
3697 (when (window-size-fixed-p window t) (cons 'fixed-width t)))
3698 (window-state-get-1 window markers))) 3689 (window-state-get-1 window markers)))
3699 3690
3700(defvar window-state-put-list nil 3691(defvar window-state-put-list nil
@@ -3798,13 +3789,13 @@ value can be also stored on disk and read back in a new session."
3798 (let ((delta (- (cdr (assq 'total-height item)) 3789 (let ((delta (- (cdr (assq 'total-height item))
3799 (window-total-height window))) 3790 (window-total-height window)))
3800 window-size-fixed) 3791 window-size-fixed)
3801 (when (window-resizable-p window delta) 3792 (when (window--resizable-p window delta)
3802 (window-resize window delta))) 3793 (window-resize window delta)))
3803 ;; Else check whether the window is not high enough. 3794 ;; Else check whether the window is not high enough.
3804 (let* ((min-size (window-min-size window nil ignore)) 3795 (let* ((min-size (window-min-size window nil ignore))
3805 (delta (- min-size (window-total-size window)))) 3796 (delta (- min-size (window-total-size window))))
3806 (when (and (> delta 0) 3797 (when (and (> delta 0)
3807 (window-resizable-p window delta nil ignore)) 3798 (window--resizable-p window delta nil ignore))
3808 (window-resize window delta nil ignore)))) 3799 (window-resize window delta nil ignore))))
3809 ;; Adjust horizontally. 3800 ;; Adjust horizontally.
3810 (if (memq window-size-fixed '(t width)) 3801 (if (memq window-size-fixed '(t width))
@@ -3812,13 +3803,13 @@ value can be also stored on disk and read back in a new session."
3812 (let ((delta (- (cdr (assq 'total-width item)) 3803 (let ((delta (- (cdr (assq 'total-width item))
3813 (window-total-width window))) 3804 (window-total-width window)))
3814 window-size-fixed) 3805 window-size-fixed)
3815 (when (window-resizable-p window delta) 3806 (when (window--resizable-p window delta)
3816 (window-resize window delta))) 3807 (window-resize window delta)))
3817 ;; Else check whether the window is not wide enough. 3808 ;; Else check whether the window is not wide enough.
3818 (let* ((min-size (window-min-size window t ignore)) 3809 (let* ((min-size (window-min-size window t ignore))
3819 (delta (- min-size (window-total-size window t)))) 3810 (delta (- min-size (window-total-size window t))))
3820 (when (and (> delta 0) 3811 (when (and (> delta 0)
3821 (window-resizable-p window delta t ignore)) 3812 (window--resizable-p window delta t ignore))
3822 (window-resize window delta t ignore)))) 3813 (window-resize window delta t ignore))))
3823 ;; Set dedicated status. 3814 ;; Set dedicated status.
3824 (set-window-dedicated-p window (cdr (assq 'dedicated state))) 3815 (set-window-dedicated-p window (cdr (assq 'dedicated state)))
@@ -3843,7 +3834,7 @@ specify a live window and defaults to the selected one.
3843 3834
3844Optional argument IGNORE non-nil means ignore minimum window 3835Optional argument IGNORE non-nil means ignore minimum window
3845sizes and fixed size restrictions. IGNORE equal `safe' means 3836sizes and fixed size restrictions. IGNORE equal `safe' means
3846subwindows can get as small as `window-safe-min-height' and 3837windows can get as small as `window-safe-min-height' and
3847`window-safe-min-width'." 3838`window-safe-min-width'."
3848 (setq window (window-normalize-window window t)) 3839 (setq window (window-normalize-window window t))
3849 (let* ((frame (window-frame window)) 3840 (let* ((frame (window-frame window))
@@ -3948,8 +3939,9 @@ means that the currently selected window is not acceptable. It
3948should choose or create a window, display the specified buffer in 3939should choose or create a window, display the specified buffer in
3949it, and return the window. 3940it, and return the window.
3950 3941
3951The function specified here is responsible for setting the 3942The specified function should call `display-buffer-record-window'
3952quit-restore and help-setup parameters of the window used." 3943with corresponding arguments to set up the quit-restore parameter
3944of the window used."
3953 :type '(choice 3945 :type '(choice
3954 (const nil) 3946 (const nil)
3955 (function :tag "function")) 3947 (function :tag "function"))
@@ -4202,6 +4194,7 @@ and (cdr ARGS) as second."
4202 (make-frame (append args special-display-frame-alist)))) 4194 (make-frame (append args special-display-frame-alist))))
4203 (window (frame-selected-window frame))) 4195 (window (frame-selected-window frame)))
4204 (display-buffer-record-window 'frame window buffer) 4196 (display-buffer-record-window 'frame window buffer)
4197 ;; FIXME: Use window--display-buffer-2?
4205 (set-window-buffer window buffer) 4198 (set-window-buffer window buffer)
4206 ;; Reset list of WINDOW's previous buffers to nil. 4199 ;; Reset list of WINDOW's previous buffers to nil.
4207 (set-window-prev-buffers window nil) 4200 (set-window-prev-buffers window nil)
@@ -4221,8 +4214,9 @@ A buffer is special when its name is either listed in
4221`special-display-buffer-names' or matches a regexp in 4214`special-display-buffer-names' or matches a regexp in
4222`special-display-regexps'. 4215`special-display-regexps'.
4223 4216
4224The function specified here is responsible for setting the 4217The specified function should call `display-buffer-record-window'
4225quit-restore and help-setup parameters of the window used." 4218with corresponding arguments to set up the quit-restore parameter
4219of the window used."
4226 :type 'function 4220 :type 'function
4227 :group 'frames) 4221 :group 'frames)
4228 4222
@@ -4622,9 +4616,8 @@ See `display-buffer' for details."
4622 :group 'windows) 4616 :group 'windows)
4623 4617
4624(defconst display-buffer-fallback-action 4618(defconst display-buffer-fallback-action
4625 '((display-buffer--maybe-same-window 4619 '((display-buffer--maybe-same-window ;FIXME: why isn't this redundant?
4626 display-buffer-reuse-window 4620 display-buffer-reuse-window
4627 display-buffer--special
4628 display-buffer--maybe-pop-up-frame-or-window 4621 display-buffer--maybe-pop-up-frame-or-window
4629 display-buffer-use-some-window 4622 display-buffer-use-some-window
4630 ;; If all else fails, pop up a new frame. 4623 ;; If all else fails, pop up a new frame.
@@ -4655,7 +4648,6 @@ specified, e.g. by the user options `display-buffer-alist' or
4655 4648
4656(defvar display-buffer--other-frame-action 4649(defvar display-buffer--other-frame-action
4657 '((display-buffer-reuse-window 4650 '((display-buffer-reuse-window
4658 display-buffer--special
4659 display-buffer-pop-up-frame) 4651 display-buffer-pop-up-frame)
4660 (reusable-frames . 0) 4652 (reusable-frames . 0)
4661 (inhibit-same-window . t)) 4653 (inhibit-same-window . t))
@@ -4721,6 +4713,7 @@ search for a window that is already displaying the buffer. See
4721 (let* ((user-action 4713 (let* ((user-action
4722 (display-buffer-assq-regexp (buffer-name buffer) 4714 (display-buffer-assq-regexp (buffer-name buffer)
4723 display-buffer-alist)) 4715 display-buffer-alist))
4716 (special-action (display-buffer--special-action buffer))
4724 ;; Extra actions from the arguments to this function: 4717 ;; Extra actions from the arguments to this function:
4725 (extra-action 4718 (extra-action
4726 (cons nil (append (if inhibit-same-window 4719 (cons nil (append (if inhibit-same-window
@@ -4729,7 +4722,7 @@ search for a window that is already displaying the buffer. See
4729 `((reusable-frames . ,frame)))))) 4722 `((reusable-frames . ,frame))))))
4730 ;; Construct action function list and action alist. 4723 ;; Construct action function list and action alist.
4731 (actions (list display-buffer-overriding-action 4724 (actions (list display-buffer-overriding-action
4732 user-action action extra-action 4725 user-action special-action action extra-action
4733 display-buffer-base-action 4726 display-buffer-base-action
4734 display-buffer-fallback-action)) 4727 display-buffer-fallback-action))
4735 (functions (apply 'append 4728 (functions (apply 'append
@@ -4812,7 +4805,7 @@ terminal if either of those variables is non-nil."
4812 (display-buffer-record-window 'reuse window buffer) 4805 (display-buffer-record-window 'reuse window buffer)
4813 (window--display-buffer-1 window)))) 4806 (window--display-buffer-1 window))))
4814 4807
4815(defun display-buffer--special (buffer alist) 4808(defun display-buffer--special-action (buffer)
4816 "Try to display BUFFER using `special-display-function'. 4809 "Try to display BUFFER using `special-display-function'.
4817Call `special-display-p' on BUFFER's name, and if that returns 4810Call `special-display-p' on BUFFER's name, and if that returns
4818non-nil, call `special-display-function' on BUFFER." 4811non-nil, call `special-display-function' on BUFFER."
@@ -4821,8 +4814,10 @@ non-nil, call `special-display-function' on BUFFER."
4821 ;; parameters to pass to `special-display-function'. 4814 ;; parameters to pass to `special-display-function'.
4822 (let ((pars (special-display-p (buffer-name buffer)))) 4815 (let ((pars (special-display-p (buffer-name buffer))))
4823 (when pars 4816 (when pars
4824 (funcall special-display-function 4817 (list (list #'display-buffer-reuse-window
4825 buffer (if (listp pars) pars)))))) 4818 `(lambda (buffer _alist)
4819 (funcall special-display-function
4820 buffer ',(if (listp pars) pars)))))))))
4826 4821
4827(defun display-buffer-pop-up-frame (buffer alist) 4822(defun display-buffer-pop-up-frame (buffer alist)
4828 "Display BUFFER in a new frame. 4823 "Display BUFFER in a new frame.
@@ -4970,8 +4965,7 @@ the buffer.
4970NORECORD, if non-nil means do not put this buffer at the front of 4965NORECORD, if non-nil means do not put this buffer at the front of
4971the list of recently selected ones." 4966the list of recently selected ones."
4972 (pop-to-buffer buffer 4967 (pop-to-buffer buffer
4973 '((display-buffer--special 4968 '(display-buffer-same-window
4974 display-buffer-same-window)
4975 (inhibit-same-window . nil)) 4969 (inhibit-same-window . nil))
4976 norecord)) 4970 norecord))
4977 4971
@@ -5435,8 +5429,8 @@ by `recenter-positions'."
5435 5429
5436;;; Scrolling commands. 5430;;; Scrolling commands.
5437 5431
5438;;; Scrolling commands which does not signal errors at top/bottom 5432;;; Scrolling commands which do not signal errors at top/bottom
5439;;; of buffer at first key-press (instead moves to top/bottom 5433;;; of buffer at first key-press (instead move to top/bottom
5440;;; of buffer). 5434;;; of buffer).
5441 5435
5442(defcustom scroll-error-top-bottom nil 5436(defcustom scroll-error-top-bottom nil
diff --git a/lisp/woman.el b/lisp/woman.el
index 7b530d1004f..078acfc0362 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -1440,7 +1440,7 @@ The cdr of each alist element is the path-index / filename."
1440 files)) 1440 files))
1441 (setq path-index (1+ path-index))) 1441 (setq path-index (1+ path-index)))
1442 ;; Uniquefy topics: 1442 ;; Uniquefy topics:
1443 ;; Concate all lists with a single nconc call to 1443 ;; Concatenate all lists with a single nconc call to
1444 ;; avoid retraversing the first lists repeatedly -- dak 1444 ;; avoid retraversing the first lists repeatedly -- dak
1445 (woman-topic-all-completions-merge 1445 (woman-topic-all-completions-merge
1446 (apply #'nconc files)))) 1446 (apply #'nconc files))))