aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog74
-rw-r--r--lisp/battery.el4
-rw-r--r--lisp/comint.el34
-rw-r--r--lisp/emacs-lisp/tabulated-list.el4
-rw-r--r--lisp/net/network-stream.el5
-rw-r--r--lisp/progmodes/cc-cmds.el39
-rw-r--r--lisp/progmodes/cc-mode.el4
-rw-r--r--lisp/progmodes/gdb-mi.el121
-rw-r--r--lisp/progmodes/grep.el13
-rw-r--r--lisp/server.el7
-rw-r--r--lisp/subr.el5
-rw-r--r--lisp/window.el137
12 files changed, 305 insertions, 142 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 42f99ec9c9e..c9cece95445 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,77 @@
12012-04-20 Dan Nicolaescu <dann@gnu.org>
2
3 * battery.el (battery-echo-area-format): Display remaining time
4 for sysfs backend too (Bug#11269).
5 (battery-linux-sysfs): Fix conditional for the charge.
6
72012-04-20 Chong Yidong <cyd@gnu.org>
8
9 * progmodes/gdb-mi.el (gdb): Revert previous change.
10 (gdb-inferior-io--init-proc): New function.
11 (gdb-init-1): Use it.
12 (gdb-inferior-io-sentinel): New sentinel for the gdb-inferior pty,
13 responsible for allocating a new pty and hooking it to gdb when
14 the old pty gets an EIO due to process exit.
15 (gdb-delchar-or-quit): New command. Bind it in gdb-mi buffers.
16 (gdb-tooltip-print): Don't use obsolete tooltip-use-echo-area.
17 (gdb-inferior-io--maybe-delete-pty): Move into gdb-reset.
18
192012-04-20 Eli Zaretskii <eliz@gnu.org>
20
21 * window.el (window-min-size, window-sizable, window-min-delta)
22 (window-max-delta, window--resizable, window-resizable)
23 (window-total-size, window-full-height-p, window-full-width-p)
24 (window-in-direction, window--resize-mini-window, window-resize)
25 (window--resize-child-windows-normal)
26 (window--resize-child-windows, window--resize-siblings)
27 (window--resize-this-window, adjust-window-trailing-edge)
28 (enlarge-window, shrink-window): Doc fixes.
29
302012-04-20 Chong Yidong <cyd@gnu.org>
31
32 * progmodes/gdb-mi.el (gdb-inferior-io--maybe-delete-pty): New
33 function to call delete-process on the gdb-inferior buffer's pty.
34 (gdb-reset): Use it, instead of relying on kill-buffer to kill the
35 pty process (Bug#11273).
36 (gdb-update): New arg to suppress talking to the gdb process.
37 (gdb-done-or-error): Use it.
38 (gdb-stopped-functions): Rename from gdb-stopped-hooks.
39 (gdb): Call gdb-inferior-io--maybe-delete-pty as a workaround for
40 sentinel not being called.
41
42 * comint.el (make-comint-in-buffer, comint-exec): Doc fix.
43
44 * progmodes/grep.el (grep, rgrep): Doc fix (Bug#11268).
45
462012-04-20 Glenn Morris <rgm@gnu.org>
47
48 * net/network-stream.el (open-network-stream): Doc fix.
49
502012-04-20 Chong Yidong <cyd@gnu.org>
51
52 * emacs-lisp/tabulated-list.el (tabulated-list-print): Fix typos.
53
542012-04-20 Alan Mackenzie <acm@muc.de>
55
56 Ensure searching for keywords is case sensitive.
57
58 * progmodes/cc-cmds.el (c-electric-brace, c-electric-lt-gt)
59 (c-electric-paren, c-beginning-of-defun, c-end-of-defun)
60 (c-defun-name, c-mark-function, c-cpp-define-name)
61 (c-comment-indent, c-scan-conditionals, c-indent-defun)
62 (c-context-line-break): Bind case-fold-search to nil.
63
64 * progmodes/cc-mode.el (c-font-lock-fontify-region): Bind
65 case-fold-search to nil.
66
672012-04-20 Chong Yidong <cyd@gnu.org>
68
69 * mail/sendmail.el (mail-bury): Call return action with the right
70 Rmail buffer (Bug#11242).
71
72 * server.el (server-process-filter): Handle corner case where both
73 tty and nowait options are present (Bug#11102).
74
12012-04-20 Eli Zaretskii <eliz@gnu.org> 752012-04-20 Eli Zaretskii <eliz@gnu.org>
2 76
3 * version.el (emacs-bzr-version, emacs-bzr-get-version): Doc fixes. 77 * version.el (emacs-bzr-version, emacs-bzr-get-version): Doc fixes.
diff --git a/lisp/battery.el b/lisp/battery.el
index 78898534a47..dcfe07121b3 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -78,7 +78,7 @@ introduced by a `%' character in a control string."
78 (cond ((eq battery-status-function 'battery-linux-proc-acpi) 78 (cond ((eq battery-status-function 'battery-linux-proc-acpi)
79 "Power %L, battery %B at %r (%p%% load, remaining time %t)") 79 "Power %L, battery %B at %r (%p%% load, remaining time %t)")
80 ((eq battery-status-function 'battery-linux-sysfs) 80 ((eq battery-status-function 'battery-linux-sysfs)
81 "Power %L, battery %B (%p%% load)") 81 "Power %L, battery %B (%p%% load, remaining time %t)")
82 ((eq battery-status-function 'battery-pmset) 82 ((eq battery-status-function 'battery-pmset)
83 "%L power, battery %B (%p%% load, remaining time %t)") 83 "%L power, battery %B (%p%% load, remaining time %t)")
84 (battery-status-function 84 (battery-status-function
@@ -509,7 +509,7 @@ The following %-sequences are provided:
509 "N/A")) 509 "N/A"))
510 (cons ?d (or temperature "N/A")) 510 (cons ?d (or temperature "N/A"))
511 (cons ?B (or charging-state "N/A")) 511 (cons ?B (or charging-state "N/A"))
512 (cons ?p (cond ((> charge-full 0) 512 (cons ?p (cond ((and (> charge-full 0) (> charge-now 0))
513 (format "%.1f" 513 (format "%.1f"
514 (/ (* 100 charge-now) charge-full))) 514 (/ (* 100 charge-now) charge-full)))
515 ((> energy-full 0) 515 ((> energy-full 0)
diff --git a/lisp/comint.el b/lisp/comint.el
index 68fedeb88a9..10981675971 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -699,16 +699,21 @@ BUFFER can be either a buffer or the name of one."
699(defun make-comint-in-buffer (name buffer program &optional startfile &rest switches) 699(defun make-comint-in-buffer (name buffer program &optional startfile &rest switches)
700 "Make a Comint process NAME in BUFFER, running PROGRAM. 700 "Make a Comint process NAME in BUFFER, running PROGRAM.
701If BUFFER is nil, it defaults to NAME surrounded by `*'s. 701If BUFFER is nil, it defaults to NAME surrounded by `*'s.
702PROGRAM should be either a string denoting an executable program to create 702If there is a running process in BUFFER, it is not restarted.
703via `start-file-process', or a cons pair of the form (HOST . SERVICE) denoting 703
704a TCP connection to be opened via `open-network-stream'. If there is already 704PROGRAM should be one of the following:
705a running process in that buffer, it is not restarted. Optional fourth arg 705- a string, denoting an executable program to create via
706STARTFILE is the name of a file, whose contents are sent to the 706 `start-file-process'
707process as its initial input. 707- a cons pair of the form (HOST . SERVICE), denoting a TCP
708 connection to be opened via `open-network-stream'
709- nil, denoting a newly-allocated pty.
710
711Optional fourth arg STARTFILE is the name of a file, whose
712contents are sent to the process as its initial input.
708 713
709If PROGRAM is a string, any more args are arguments to PROGRAM. 714If PROGRAM is a string, any more args are arguments to PROGRAM.
710 715
711Returns the (possibly newly created) process buffer." 716Return the (possibly newly created) process buffer."
712 (or (fboundp 'start-file-process) 717 (or (fboundp 'start-file-process)
713 (error "Multi-processing is not supported for this system")) 718 (error "Multi-processing is not supported for this system"))
714 (setq buffer (get-buffer-create (or buffer (concat "*" name "*")))) 719 (setq buffer (get-buffer-create (or buffer (concat "*" name "*"))))
@@ -752,9 +757,18 @@ See `make-comint' and `comint-exec'."
752(defun comint-exec (buffer name command startfile switches) 757(defun comint-exec (buffer name command startfile switches)
753 "Start up a process named NAME in buffer BUFFER for Comint modes. 758 "Start up a process named NAME in buffer BUFFER for Comint modes.
754Runs the given COMMAND with SWITCHES, and initial input from STARTFILE. 759Runs the given COMMAND with SWITCHES, and initial input from STARTFILE.
755Blasts any old process running in the buffer. Doesn't set the buffer mode. 760
756You can use this to cheaply run a series of processes in the same Comint 761COMMAND should be one of the following:
757buffer. The hook `comint-exec-hook' is run after each exec." 762- a string, denoting an executable program to create via
763 `start-file-process'
764- a cons pair of the form (HOST . SERVICE), denoting a TCP
765 connection to be opened via `open-network-stream'
766- nil, denoting a newly-allocated pty.
767
768This function blasts any old process running in the buffer, and
769does not set the buffer mode. You can use this to cheaply run a
770series of processes in the same Comint buffer. The hook
771`comint-exec-hook' is run after each exec."
758 (with-current-buffer buffer 772 (with-current-buffer buffer
759 (let ((proc (get-buffer-process buffer))) ; Blast any old process. 773 (let ((proc (get-buffer-process buffer))) ; Blast any old process.
760 (if proc (delete-process proc))) 774 (if proc (delete-process proc)))
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index f17b12da6a0..9439fba2b86 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -215,7 +215,7 @@ buffer and inserts the entries with `tabulated-list-printer'.
215Optional argument REMEMBER-POS, if non-nil, means to move point 215Optional argument REMEMBER-POS, if non-nil, means to move point
216to the entry with the same ID element as the current line." 216to the entry with the same ID element as the current line."
217 (let ((inhibit-read-only t) 217 (let ((inhibit-read-only t)
218 (entries (if (functionp 'tabulated-list-entries) 218 (entries (if (functionp tabulated-list-entries)
219 (funcall tabulated-list-entries) 219 (funcall tabulated-list-entries)
220 tabulated-list-entries)) 220 tabulated-list-entries))
221 entry-id saved-pt saved-col) 221 entry-id saved-pt saved-col)
@@ -246,7 +246,7 @@ to the entry with the same ID element as the current line."
246 (setq entries (sort entries sorter)) 246 (setq entries (sort entries sorter))
247 (if (cdr tabulated-list-sort-key) 247 (if (cdr tabulated-list-sort-key)
248 (setq entries (nreverse entries))) 248 (setq entries (nreverse entries)))
249 (unless (functionp 'tabulated-list-entries) 249 (unless (functionp tabulated-list-entries)
250 (setq tabulated-list-entries entries))))) 250 (setq tabulated-list-entries entries)))))
251 ;; Print the resulting list. 251 ;; Print the resulting list.
252 (dolist (elt entries) 252 (dolist (elt entries)
diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el
index 7a3d47ef1d1..81d05eabc5a 100644
--- a/lisp/net/network-stream.el
+++ b/lisp/net/network-stream.el
@@ -125,9 +125,8 @@ values:
125 certificate. This parameter will only be used when doing TLS 125 certificate. This parameter will only be used when doing TLS
126 or STARTTLS connections. 126 or STARTTLS connections.
127 127
128If :use-starttls-if-possible is non-nil, do opportunistic 128:use-starttls-if-possible is a boolean that says to do opportunistic
129STARTTLS upgrades even if Emacs doesn't have built-in TLS 129STARTTLS upgrades even if Emacs doesn't have built-in TLS functionality.
130functionality.
131 130
132:nowait is a boolean that says the connection should be made 131:nowait is a boolean that says the connection should be made
133 asynchronously, if possible." 132 asynchronously, if possible."
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 55ab6c9981c..9cf20ccb516 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -679,7 +679,7 @@ settings of `c-cleanup-list' are done."
679 ;; We want to inhibit blinking the paren since this would be 679 ;; We want to inhibit blinking the paren since this would be
680 ;; most disruptive. We'll blink it ourselves later on. 680 ;; most disruptive. We'll blink it ourselves later on.
681 (old-blink-paren blink-paren-function) 681 (old-blink-paren blink-paren-function)
682 blink-paren-function) 682 blink-paren-function case-fold-search)
683 683
684 (c-save-buffer-state () 684 (c-save-buffer-state ()
685 (setq safepos (c-safe-position (point) (c-parse-state)) 685 (setq safepos (c-safe-position (point) (c-parse-state))
@@ -1086,7 +1086,7 @@ numeric argument is supplied, or the point is inside a literal."
1086 1086
1087 (interactive "*P") 1087 (interactive "*P")
1088 (let ((c-echo-syntactic-information-p nil) 1088 (let ((c-echo-syntactic-information-p nil)
1089 final-pos close-paren-inserted found-delim) 1089 final-pos close-paren-inserted found-delim case-fold-search)
1090 1090
1091 (self-insert-command (prefix-numeric-value arg)) 1091 (self-insert-command (prefix-numeric-value arg))
1092 (setq final-pos (point)) 1092 (setq final-pos (point))
@@ -1172,7 +1172,8 @@ newline cleanups are done if appropriate; see the variable `c-cleanup-list'."
1172 (interactive "*P") 1172 (interactive "*P")
1173 (let ((literal (c-save-buffer-state () (c-in-literal))) 1173 (let ((literal (c-save-buffer-state () (c-in-literal)))
1174 ;; shut this up 1174 ;; shut this up
1175 (c-echo-syntactic-information-p nil)) 1175 (c-echo-syntactic-information-p nil)
1176 case-fold-search)
1176 (self-insert-command (prefix-numeric-value arg)) 1177 (self-insert-command (prefix-numeric-value arg))
1177 1178
1178 (if (and (not arg) (not literal)) 1179 (if (and (not arg) (not literal))
@@ -1585,7 +1586,7 @@ defun."
1585 ; structure with other users of c-state-cache. 1586 ; structure with other users of c-state-cache.
1586 (orig-point-min (point-min)) (orig-point-max (point-max)) 1587 (orig-point-min (point-min)) (orig-point-max (point-max))
1587 lim ; Position of { which has been widened to. 1588 lim ; Position of { which has been widened to.
1588 where pos) 1589 where pos case-fold-search)
1589 1590
1590 (save-restriction 1591 (save-restriction
1591 (if (eq c-defun-tactic 'go-outward) 1592 (if (eq c-defun-tactic 'go-outward)
@@ -1709,7 +1710,8 @@ the open-parenthesis that starts a defun; see `beginning-of-defun'."
1709 ; structure with other users of c-state-cache. 1710 ; structure with other users of c-state-cache.
1710 (orig-point-min (point-min)) (orig-point-max (point-max)) 1711 (orig-point-min (point-min)) (orig-point-max (point-max))
1711 lim 1712 lim
1712 where pos) 1713 where pos case-fold-search)
1714
1713 (save-restriction 1715 (save-restriction
1714 (if (eq c-defun-tactic 'go-outward) 1716 (if (eq c-defun-tactic 'go-outward)
1715 (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace 1717 (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace
@@ -1769,8 +1771,8 @@ with a brace block."
1769 (interactive) 1771 (interactive)
1770 (c-save-buffer-state 1772 (c-save-buffer-state
1771 (beginning-of-defun-function end-of-defun-function 1773 (beginning-of-defun-function end-of-defun-function
1772 where pos name-end) 1774 where pos name-end case-fold-search)
1773 1775
1774 (save-restriction 1776 (save-restriction
1775 (widen) 1777 (widen)
1776 (save-excursion 1778 (save-excursion
@@ -1969,7 +1971,7 @@ As opposed to \\[c-beginning-of-defun] and \\[c-end-of-defun], this
1969function does not require the declaration to contain a brace block." 1971function does not require the declaration to contain a brace block."
1970 (interactive) 1972 (interactive)
1971 1973
1972 (let (decl-limits) 1974 (let (decl-limits case-fold-search)
1973 (c-save-buffer-state nil 1975 (c-save-buffer-state nil
1974 ;; We try to be line oriented, unless there are several 1976 ;; We try to be line oriented, unless there are several
1975 ;; declarations on the same line. 1977 ;; declarations on the same line.
@@ -2001,11 +2003,12 @@ function does not require the declaration to contain a brace block."
2001(defun c-cpp-define-name () 2003(defun c-cpp-define-name ()
2002 "Return the name of the current CPP macro, or NIL if we're not in one." 2004 "Return the name of the current CPP macro, or NIL if we're not in one."
2003 (interactive) 2005 (interactive)
2004 (save-excursion 2006 (let (case-fold-search)
2005 (and c-opt-cpp-macro-define-start 2007 (save-excursion
2006 (c-beginning-of-macro) 2008 (and c-opt-cpp-macro-define-start
2007 (looking-at c-opt-cpp-macro-define-start) 2009 (c-beginning-of-macro)
2008 (match-string-no-properties 1)))) 2010 (looking-at c-opt-cpp-macro-define-start)
2011 (match-string-no-properties 1)))))
2009 2012
2010 2013
2011;; Movement by statements. 2014;; Movement by statements.
@@ -2888,7 +2891,8 @@ See `c-indent-comment-alist' for a description."
2888 (eq (match-end 0) eot)) 2891 (eq (match-end 0) eot))
2889 'cpp-end-block) 2892 'cpp-end-block)
2890 (t 2893 (t
2891 'other)))) 2894 'other)))
2895 case-fold-search)
2892 (if (and (memq line-type '(anchored-comment empty-line)) 2896 (if (and (memq line-type '(anchored-comment empty-line))
2893 c-indent-comments-syntactically-p) 2897 c-indent-comments-syntactically-p)
2894 (let ((c-syntactic-context (c-guess-basic-syntax))) 2898 (let ((c-syntactic-context (c-guess-basic-syntax)))
@@ -3024,7 +3028,7 @@ are treated as conditional clause limits. Normally they are ignored."
3024 (let* ((forward (> count 0)) 3028 (let* ((forward (> count 0))
3025 (increment (if forward -1 1)) 3029 (increment (if forward -1 1))
3026 (search-function (if forward 're-search-forward 're-search-backward)) 3030 (search-function (if forward 're-search-forward 're-search-backward))
3027 new) 3031 new case-fold-search)
3028 (unless (integerp target-depth) 3032 (unless (integerp target-depth)
3029 (setq target-depth (if target-depth -1 0))) 3033 (setq target-depth (if target-depth -1 0)))
3030 (save-excursion 3034 (save-excursion
@@ -3226,7 +3230,7 @@ balanced expression is found."
3226In the macro case this also has the effect of realigning any line 3230In the macro case this also has the effect of realigning any line
3227continuation backslashes, unless `c-auto-align-backslashes' is nil." 3231continuation backslashes, unless `c-auto-align-backslashes' is nil."
3228 (interactive "*") 3232 (interactive "*")
3229 (let ((here (point-marker)) decl-limits) 3233 (let ((here (point-marker)) decl-limits case-fold-search)
3230 (unwind-protect 3234 (unwind-protect
3231 (progn 3235 (progn
3232 (c-save-buffer-state nil 3236 (c-save-buffer-state nil
@@ -4638,7 +4642,8 @@ inside a preprocessor directive."
4638 4642
4639 (interactive "*") 4643 (interactive "*")
4640 (let* (c-lit-limits c-lit-type 4644 (let* (c-lit-limits c-lit-type
4641 (c-macro-start c-macro-start)) 4645 (c-macro-start c-macro-start)
4646 case-fold-search)
4642 4647
4643 (c-save-buffer-state () 4648 (c-save-buffer-state ()
4644 (setq c-lit-limits (c-literal-limits nil nil t) 4649 (setq c-lit-limits (c-literal-limits nil nil t)
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 7c018feefbb..ff18f56bbe8 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -1170,10 +1170,10 @@ Note that the style variables are always made local to the buffer."
1170 ;; 1170 ;;
1171 ;; 1171 ;;
1172 ;; void myfunc(T* p) {} 1172 ;; void myfunc(T* p) {}
1173 ;; 1173 ;;
1174 ;; Type a space in the first blank line, and the fontification of the next 1174 ;; Type a space in the first blank line, and the fontification of the next
1175 ;; line was fouled up by context fontification. 1175 ;; line was fouled up by context fontification.
1176 (let ((new-beg beg) (new-end end) new-region) 1176 (let ((new-beg beg) (new-end end) new-region case-fold-search)
1177 (if c-in-after-change-fontification 1177 (if c-in-after-change-fontification
1178 (setq c-in-after-change-fontification nil) 1178 (setq c-in-after-change-fontification nil)
1179 (save-restriction 1179 (save-restriction
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 497d2440cfd..1be74ff544b 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -375,9 +375,8 @@ Emacs always switches to the thread which caused the stop."
375 :version "23.2" 375 :version "23.2"
376 :link '(info-link "(gdb)GDB/MI Async Records")) 376 :link '(info-link "(gdb)GDB/MI Async Records"))
377 377
378(defcustom gdb-stopped-hooks nil 378(defcustom gdb-stopped-functions nil
379 "This variable holds a list of functions to be called whenever 379 "List of functions called whenever GDB stops.
380GDB stops.
381 380
382Each function takes one argument, a parsed MI response, which 381Each function takes one argument, a parsed MI response, which
383contains fields of corresponding MI *stopped async record: 382contains fields of corresponding MI *stopped async record:
@@ -818,6 +817,8 @@ detailed description of this mode.
818 nil 'local) 817 nil 'local)
819 (local-set-key "\C-i" 'completion-at-point) 818 (local-set-key "\C-i" 'completion-at-point)
820 819
820 (local-set-key [remap comint-delchar-or-maybe-eof] 'gdb-delchar-or-quit)
821
821 (setq gdb-first-prompt t) 822 (setq gdb-first-prompt t)
822 (setq gud-running nil) 823 (setq gud-running nil)
823 824
@@ -859,15 +860,8 @@ detailed description of this mode.
859 860
860 (gdb-get-buffer-create 'gdb-inferior-io) 861 (gdb-get-buffer-create 'gdb-inferior-io)
861 (gdb-clear-inferior-io) 862 (gdb-clear-inferior-io)
862 (set-process-filter (get-process "gdb-inferior") 'gdb-inferior-filter) 863 (gdb-inferior-io--init-proc (get-process "gdb-inferior"))
863 (gdb-input 864
864 ;; Needs GDB 6.4 onwards
865 (concat "-inferior-tty-set "
866 (or
867 ;; The process can run on a remote host.
868 (process-get (get-process "gdb-inferior") 'remote-tty)
869 (process-tty-name (get-process "gdb-inferior"))))
870 'ignore)
871 (if (eq window-system 'w32) 865 (if (eq window-system 'w32)
872 (gdb-input "-gdb-set new-console off" 'ignore)) 866 (gdb-input "-gdb-set new-console off" 'ignore))
873 (gdb-input "-gdb-set height 0" 'ignore) 867 (gdb-input "-gdb-set height 0" 'ignore)
@@ -905,6 +899,25 @@ detailed description of this mode.
905 (setq gdb-non-stop nil) 899 (setq gdb-non-stop nil)
906 (gdb-input "-gdb-set non-stop 0" 'ignore))) 900 (gdb-input "-gdb-set non-stop 0" 'ignore)))
907 901
902(defun gdb-delchar-or-quit (arg)
903 "Delete ARG characters or send a quit command to GDB.
904Send a quit only if point is at the end of the buffer, there is
905no input, and GDB is waiting for input."
906 (interactive "p")
907 (unless (and (eq (current-buffer) gud-comint-buffer)
908 (eq gud-minor-mode 'gdbmi))
909 (error "Not in a GDB-MI buffer"))
910 (let ((proc (get-buffer-process gud-comint-buffer)))
911 (if (and (eobp) proc (process-live-p proc)
912 (not gud-running)
913 (= (point) (marker-position (process-mark proc))))
914 ;; Sending an EOF does not work with GDB-MI; submit an
915 ;; explicit quit command.
916 (progn
917 (insert "quit")
918 (comint-send-input t t))
919 (delete-char arg))))
920
908(defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") 921(defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.")
909 922
910(defun gdb-create-define-alist () 923(defun gdb-create-define-alist ()
@@ -929,7 +942,6 @@ detailed description of this mode.
929 (push (cons name define) gdb-define-alist)))) 942 (push (cons name define) gdb-define-alist))))
930 943
931(declare-function tooltip-show "tooltip" (text &optional use-echo-area)) 944(declare-function tooltip-show "tooltip" (text &optional use-echo-area))
932(defvar tooltip-use-echo-area)
933 945
934(defun gdb-tooltip-print (expr) 946(defun gdb-tooltip-print (expr)
935 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) 947 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
@@ -937,7 +949,7 @@ detailed description of this mode.
937 (if (re-search-forward ".*value=\\(\".*\"\\)" nil t) 949 (if (re-search-forward ".*value=\\(\".*\"\\)" nil t)
938 (tooltip-show 950 (tooltip-show
939 (concat expr " = " (read (match-string 1))) 951 (concat expr " = " (read (match-string 1)))
940 (or gud-tooltip-echo-area tooltip-use-echo-area 952 (or gud-tooltip-echo-area
941 (not (display-graphic-p))))))) 953 (not (display-graphic-p)))))))
942 954
943;; If expr is a macro for a function don't print because of possible dangerous 955;; If expr is a macro for a function don't print because of possible dangerous
@@ -1510,6 +1522,31 @@ DOC is an optional documentation string."
1510 (gdb-display-buffer 1522 (gdb-display-buffer
1511 (gdb-get-buffer-create 'gdb-inferior-io) t)) 1523 (gdb-get-buffer-create 'gdb-inferior-io) t))
1512 1524
1525(defun gdb-inferior-io--init-proc (proc)
1526 ;; Set up inferior I/O. Needs GDB 6.4 onwards.
1527 (set-process-filter proc 'gdb-inferior-filter)
1528 (set-process-sentinel proc 'gdb-inferior-io-sentinel)
1529 (gdb-input
1530 (concat "-inferior-tty-set "
1531 ;; The process can run on a remote host.
1532 (or (process-get proc 'remote-tty)
1533 (process-tty-name proc)))
1534 'ignore))
1535
1536(defun gdb-inferior-io-sentinel (proc str)
1537 (when (eq (process-status proc) 'failed)
1538 ;; When the debugged process exits, Emacs gets an EIO error on
1539 ;; read from the pty, and stops listening to it. If the gdb
1540 ;; process is still running, remove the pty, make a new one, and
1541 ;; pass it to gdb.
1542 (let ((gdb-proc (get-buffer-process gud-comint-buffer))
1543 (io-buffer (process-buffer proc)))
1544 (when (and gdb-proc (process-live-p gdb-proc)
1545 (buffer-live-p io-buffer))
1546 ;; `comint-exec' deletes the original process as a side effect.
1547 (comint-exec io-buffer "gdb-inferior" nil nil nil)
1548 (gdb-inferior-io--init-proc (get-buffer-process io-buffer))))))
1549
1513(defconst gdb-frame-parameters 1550(defconst gdb-frame-parameters
1514 '((height . 14) (width . 80) 1551 '((height . 14) (width . 80)
1515 (unsplittable . t) 1552 (unsplittable . t)
@@ -1746,24 +1783,27 @@ If `gdb-thread-number' is nil, just wrap NAME in asterisks."
1746 (setq gdb-output-sink 'user) 1783 (setq gdb-output-sink 'user)
1747 (setq gdb-pending-triggers nil)) 1784 (setq gdb-pending-triggers nil))
1748 1785
1749(defun gdb-update () 1786(defun gdb-update (&optional no-proc)
1750 "Update buffers showing status of debug session." 1787 "Update buffers showing status of debug session.
1788If NO-PROC is non-nil, do not try to contact the GDB process."
1751 (when gdb-first-prompt 1789 (when gdb-first-prompt
1752 (gdb-force-mode-line-update 1790 (gdb-force-mode-line-update
1753 (propertize "initializing..." 'face font-lock-variable-name-face)) 1791 (propertize "initializing..." 'face font-lock-variable-name-face))
1754 (gdb-init-1) 1792 (gdb-init-1)
1755 (setq gdb-first-prompt nil)) 1793 (setq gdb-first-prompt nil))
1756 1794
1757 (gdb-get-main-selected-frame) 1795 (unless no-proc
1796 (gdb-get-main-selected-frame))
1797
1758 ;; We may need to update gdb-threads-list so we can use 1798 ;; We may need to update gdb-threads-list so we can use
1759 (gdb-get-buffer-create 'gdb-threads-buffer) 1799 (gdb-get-buffer-create 'gdb-threads-buffer)
1760 ;; gdb-break-list is maintained in breakpoints handler 1800 ;; gdb-break-list is maintained in breakpoints handler
1761 (gdb-get-buffer-create 'gdb-breakpoints-buffer) 1801 (gdb-get-buffer-create 'gdb-breakpoints-buffer)
1762 1802
1763 (gdb-emit-signal gdb-buf-publisher 'update) 1803 (unless no-proc
1804 (gdb-emit-signal gdb-buf-publisher 'update))
1764 1805
1765 (gdb-get-changed-registers) 1806 (gdb-get-changed-registers)
1766
1767 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) 1807 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
1768 (dolist (var gdb-var-list) 1808 (dolist (var gdb-var-list)
1769 (setcar (nthcdr 5 var) nil)) 1809 (setcar (nthcdr 5 var) nil))
@@ -2045,7 +2085,7 @@ current thread and update GDB buffers."
2045 ;; In all-stop this updates gud-running properly as well. 2085 ;; In all-stop this updates gud-running properly as well.
2046 (gdb-update) 2086 (gdb-update)
2047 (setq gdb-first-done-or-error nil)) 2087 (setq gdb-first-done-or-error nil))
2048 (run-hook-with-args 'gdb-stopped-hooks result))) 2088 (run-hook-with-args 'gdb-stopped-functions result)))
2049 2089
2050;; Remove the trimmings from log stream containing debugging messages 2090;; Remove the trimmings from log stream containing debugging messages
2051;; being produced by GDB's internals, use warning face and send to GUD 2091;; being produced by GDB's internals, use warning face and send to GUD
@@ -2085,23 +2125,28 @@ current thread and update GDB buffers."
2085 (setq gdb-output-sink 'emacs)) 2125 (setq gdb-output-sink 'emacs))
2086 2126
2087 (gdb-clear-partial-output) 2127 (gdb-clear-partial-output)
2088 (when gdb-first-done-or-error
2089 (unless (or token-number gud-running)
2090 (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name)))
2091 (gdb-update)
2092 (setq gdb-first-done-or-error nil))
2093 2128
2094 (setq gdb-filter-output 2129 ;; The process may already be dead (e.g. C-d at the gdb prompt).
2095 (gdb-concat-output gdb-filter-output output-field)) 2130 (let* ((proc (get-buffer-process gud-comint-buffer))
2131 (no-proc (or (null proc)
2132 (memq (process-status proc) '(exit signal)))))
2096 2133
2097 (if token-number 2134 (when gdb-first-done-or-error
2098 (progn 2135 (unless (or token-number gud-running no-proc)
2099 (with-current-buffer 2136 (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name)))
2100 (gdb-get-buffer-create 'gdb-partial-output-buffer) 2137 (gdb-update no-proc)
2101 (funcall 2138 (setq gdb-first-done-or-error nil))
2102 (cdr (assoc (string-to-number token-number) gdb-handler-alist)))) 2139
2103 (setq gdb-handler-alist 2140 (setq gdb-filter-output
2104 (assq-delete-all token-number gdb-handler-alist))))) 2141 (gdb-concat-output gdb-filter-output output-field))
2142
2143 (when token-number
2144 (with-current-buffer
2145 (gdb-get-buffer-create 'gdb-partial-output-buffer)
2146 (funcall
2147 (cdr (assoc (string-to-number token-number) gdb-handler-alist))))
2148 (setq gdb-handler-alist
2149 (assq-delete-all token-number gdb-handler-alist)))))
2105 2150
2106(defun gdb-concat-output (so-far new) 2151(defun gdb-concat-output (so-far new)
2107 (cond 2152 (cond
@@ -4105,9 +4150,15 @@ This arrangement depends on the value of `gdb-many-windows'."
4105 (gud-find-file gdb-main-file))) 4150 (gud-find-file gdb-main-file)))
4106 (setq gdb-source-window win))))) 4151 (setq gdb-source-window win)))))
4107 4152
4153;; Called from `gud-sentinel' in gud.el:
4108(defun gdb-reset () 4154(defun gdb-reset ()
4109 "Exit a debugging session cleanly. 4155 "Exit a debugging session cleanly.
4110Kills the gdb buffers, and resets variables and the source buffers." 4156Kills the gdb buffers, and resets variables and the source buffers."
4157 ;; The gdb-inferior buffer has a pty hooked up to the main gdb
4158 ;; process. This pty must be deleted explicitly.
4159 (let ((pty (get-process "gdb-inferior")))
4160 (if pty (delete-process pty)))
4161 ;; Find gdb-mi buffers and kill them.
4111 (dolist (buffer (buffer-list)) 4162 (dolist (buffer (buffer-list))
4112 (unless (eq buffer gud-comint-buffer) 4163 (unless (eq buffer gud-comint-buffer)
4113 (with-current-buffer buffer 4164 (with-current-buffer buffer
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 569e864a1c6..a6ae42f86b1 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -728,9 +728,9 @@ This function is called from `compilation-filter-hook'."
728(defun grep (command-args) 728(defun grep (command-args)
729 "Run grep, with user-specified args, and collect output in a buffer. 729 "Run grep, with user-specified args, and collect output in a buffer.
730While grep runs asynchronously, you can use \\[next-error] (M-x next-error), 730While grep runs asynchronously, you can use \\[next-error] (M-x next-error),
731or \\<grep-mode-map>\\[compile-goto-error] in the grep \ 731or \\<grep-mode-map>\\[compile-goto-error] in the *grep* \
732output buffer, to go to the lines where grep 732buffer, to go to the lines where grep found
733found matches. 733matches. To kill the grep job before it finishes, type \\[kill-compilation].
734 734
735For doing a recursive `grep', see the `rgrep' command. For running 735For doing a recursive `grep', see the `rgrep' command. For running
736`grep' in a specific directory, see `lgrep'. 736`grep' in a specific directory, see `lgrep'.
@@ -957,10 +957,11 @@ With \\[universal-argument] prefix, you can edit the constructed shell command l
957before it is executed. 957before it is executed.
958With two \\[universal-argument] prefixes, directly edit and run `grep-find-command'. 958With two \\[universal-argument] prefixes, directly edit and run `grep-find-command'.
959 959
960Collect output in a buffer. While find runs asynchronously, you 960Collect output in a buffer. While the recursive grep is running,
961can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error] \ 961you can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error] \
962in the grep output buffer, 962in the grep output buffer,
963to go to the lines where grep found matches. 963to visit the lines where matches were found. To kill the job
964before it finishes, type \\[kill-compilation].
964 965
965This command shares argument histories with \\[lgrep] and \\[grep-find]. 966This command shares argument histories with \\[lgrep] and \\[grep-find].
966 967
diff --git a/lisp/server.el b/lisp/server.el
index c82a639eadf..123fea3743a 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -1174,6 +1174,13 @@ The following commands are accepted by the client:
1174 ;; Unknown command. 1174 ;; Unknown command.
1175 (arg (error "Unknown command: %s" arg)))) 1175 (arg (error "Unknown command: %s" arg))))
1176 1176
1177 ;; If both -no-wait and -tty are given with file or sexp
1178 ;; arguments, use an existing frame.
1179 (and nowait
1180 (not (eq tty-name 'window-system))
1181 (or files commands)
1182 (setq use-current-frame t))
1183
1177 (setq frame 1184 (setq frame
1178 (cond 1185 (cond
1179 ((and use-current-frame 1186 ((and use-current-frame
diff --git a/lisp/subr.el b/lisp/subr.el
index ff93cd22210..8e296aa7422 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1888,8 +1888,7 @@ Used from `delayed-warnings-hook' (which see)."
1888 (push warning collapsed))) 1888 (push warning collapsed)))
1889 (setq delayed-warnings-list (nreverse collapsed)))) 1889 (setq delayed-warnings-list (nreverse collapsed))))
1890 1890
1891;; At present this is only really useful for Emacs internals. 1891;; At present this is only used for Emacs internals.
1892;; Document in the lispref if it becomes generally useful.
1893;; Ref http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00085.html 1892;; Ref http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00085.html
1894(defvar delayed-warnings-hook '(collapse-delayed-warnings 1893(defvar delayed-warnings-hook '(collapse-delayed-warnings
1895 display-delayed-warnings) 1894 display-delayed-warnings)
@@ -2308,6 +2307,8 @@ is nil and `use-dialog-box' is non-nil."
2308 (discard-input)))) 2307 (discard-input))))
2309 (let ((ret (eq answer 'act))) 2308 (let ((ret (eq answer 'act)))
2310 (unless noninteractive 2309 (unless noninteractive
2310 ;; FIXME this prints one too many spaces, since prompt
2311 ;; already ends in a space. Eg "... (y or n) y".
2311 (message "%s %s" prompt (if ret "y" "n"))) 2312 (message "%s %s" prompt (if ret "y" "n")))
2312 ret))) 2313 ret)))
2313 2314
diff --git a/lisp/window.el b/lisp/window.el
index 934b6067d08..c148f5ee01f 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -514,17 +514,19 @@ window).")
514 (if (window-valid-p ignore) (eq window ignore) ignore)) 514 (if (window-valid-p ignore) (eq window ignore) ignore))
515 515
516(defun window-min-size (&optional window horizontal ignore) 516(defun window-min-size (&optional window horizontal ignore)
517 "Return the minimum number of lines of WINDOW. 517 "Return the minimum size of WINDOW.
518WINDOW can be an arbitrary window and defaults to the selected 518WINDOW can be an arbitrary window and defaults to the selected
519one. Optional argument HORIZONTAL non-nil means return the 519one. Optional argument HORIZONTAL non-nil means return the
520minimum number of columns of WINDOW. 520minimum number of columns of WINDOW; otherwise return the minimum
521number of WINDOW's lines.
521 522
522Optional argument IGNORE non-nil means ignore any restrictions 523Optional argument IGNORE, if non-nil, means ignore restrictions
523imposed by fixed size windows, `window-min-height' or 524imposed by fixed size windows, `window-min-height' or
524`window-min-width' settings. IGNORE equal `safe' means live 525`window-min-width' settings. If IGNORE equals `safe', live
525windows may get as small as `window-safe-min-height' lines and 526windows may get as small as `window-safe-min-height' lines and
526`window-safe-min-width' columns. IGNORE a window means ignore 527`window-safe-min-width' columns. If IGNORE is a window, ignore
527restrictions for that window only." 528restrictions for that window only. Any other non-nil value
529means ignore all of the above restrictions for all windows."
528 (window--min-size-1 530 (window--min-size-1
529 (window-normalize-window window) horizontal ignore)) 531 (window-normalize-window window) horizontal ignore))
530 532
@@ -614,12 +616,13 @@ columns. If WINDOW cannot be shrunk by -DELTA lines or columns,
614return the minimum value in the range DELTA..0 by which WINDOW 616return the minimum value in the range DELTA..0 by which WINDOW
615can be shrunk. 617can be shrunk.
616 618
617Optional argument IGNORE non-nil means ignore any restrictions 619Optional argument IGNORE non-nil means ignore restrictions
618imposed by fixed size windows, `window-min-height' or 620imposed by fixed size windows, `window-min-height' or
619`window-min-width' settings. IGNORE equal `safe' means live 621`window-min-width' settings. If IGNORE equals `safe', live
620windows may get as small as `window-safe-min-height' lines and 622windows may get as small as `window-safe-min-height' lines and
621`window-safe-min-width' columns. IGNORE any window means ignore 623`window-safe-min-width' columns. If IGNORE is a window, ignore
622restrictions for that window only." 624restrictions for that window only. Any other non-nil value means
625ignore all of the above restrictions for all windows."
623 (setq window (window-normalize-window window)) 626 (setq window (window-normalize-window window))
624 (cond 627 (cond
625 ((< delta 0) 628 ((< delta 0)
@@ -734,20 +737,21 @@ window. Return zero if WINDOW cannot be shrunk.
734Optional argument HORIZONTAL non-nil means return number of 737Optional argument HORIZONTAL non-nil means return number of
735columns by which WINDOW can be shrunk. 738columns by which WINDOW can be shrunk.
736 739
737Optional argument IGNORE non-nil means ignore any restrictions 740Optional argument IGNORE non-nil means ignore restrictions
738imposed by fixed size windows, `window-min-height' or 741imposed by fixed size windows, `window-min-height' or
739`window-min-width' settings. IGNORE a window means ignore 742`window-min-width' settings. If IGNORE is a window, ignore
740restrictions for that window only. IGNORE equal `safe' means 743restrictions for that window only. If IGNORE equals `safe',
741live windows may get as small as `window-safe-min-height' lines 744live windows may get as small as `window-safe-min-height' lines
742and `window-safe-min-width' columns. 745and `window-safe-min-width' columns. Any other non-nil value
746means ignore all of the above restrictions for all windows.
743 747
744Optional argument TRAIL `before' means only windows to the left 748Optional argument TRAIL restricts the windows that can be enlarged.
745of or above WINDOW can be enlarged. Optional argument TRAIL 749If its value is `before', only windows to the left of or above WINDOW
746`after' means only windows to the right of or below WINDOW can be 750can be enlarged. If it is `after', only windows to the right of or
747enlarged. 751below WINDOW can be enlarged.
748 752
749Optional argument NOUP non-nil means don't go up in the window 753Optional argument NOUP non-nil means don't go up in the window
750tree but try to enlarge windows within WINDOW's combination only. 754tree, but try to enlarge windows within WINDOW's combination only.
751 755
752Optional argument NODOWN non-nil means don't check whether WINDOW 756Optional argument NODOWN non-nil means don't check whether WINDOW
753itself (and its child windows) can be shrunk; check only whether 757itself (and its child windows) can be shrunk; check only whether
@@ -808,24 +812,25 @@ at least one other window can be enlarged appropriately."
808 (window--max-delta-1 parent delta horizontal ignore trail)))))) 812 (window--max-delta-1 parent delta horizontal ignore trail))))))
809 813
810(defun window-max-delta (&optional window horizontal ignore trail noup nodown) 814(defun window-max-delta (&optional window horizontal ignore trail noup nodown)
811 "Return maximum number of lines WINDOW by which WINDOW can be enlarged. 815 "Return maximum number of lines by which WINDOW can be enlarged.
812WINDOW can be an arbitrary window and defaults to the selected 816WINDOW can be an arbitrary window and defaults to the selected
813window. The return value is zero if WINDOW cannot be enlarged. 817window. The return value is zero if WINDOW cannot be enlarged.
814 818
815Optional argument HORIZONTAL non-nil means return maximum number 819Optional argument HORIZONTAL non-nil means return maximum number
816of columns by which WINDOW can be enlarged. 820of columns by which WINDOW can be enlarged.
817 821
818Optional argument IGNORE non-nil means ignore any restrictions 822Optional argument IGNORE non-nil means ignore restrictions
819imposed by fixed size windows, `window-min-height' or 823imposed by fixed size windows, `window-min-height' or
820`window-min-width' settings. IGNORE a window means ignore 824`window-min-width' settings. If IGNORE is a window, ignore
821restrictions for that window only. IGNORE equal `safe' means 825restrictions for that window only. If IGNORE equals `safe',
822live windows may get as small as `window-safe-min-height' lines 826live windows may get as small as `window-safe-min-height' lines
823and `window-safe-min-width' columns. 827and `window-safe-min-width' columns. Any other non-nil value means
828ignore all of the above restrictions for all windows.
824 829
825Optional argument TRAIL `before' means only windows to the left 830Optional argument TRAIL restricts the windows that can be enlarged.
826of or below WINDOW can be shrunk. Optional argument TRAIL 831If its value is `before', only windows to the left of or above WINDOW
827`after' means only windows to the right of or above WINDOW can be 832can be enlarged. If it is `after', only windows to the right of or
828shrunk. 833below WINDOW can be enlarged.
829 834
830Optional argument NOUP non-nil means don't go up in the window 835Optional argument NOUP non-nil means don't go up in the window
831tree but try to obtain the entire space from windows within 836tree but try to obtain the entire space from windows within
@@ -860,12 +865,13 @@ columns. If WINDOW cannot be shrunk by -DELTA lines or columns,
860return the minimum value in the range DELTA..0 that can be used 865return the minimum value in the range DELTA..0 that can be used
861for shrinking WINDOW. 866for shrinking WINDOW.
862 867
863Optional argument IGNORE non-nil means ignore any restrictions 868Optional argument IGNORE non-nil means ignore restrictions
864imposed by fixed size windows, `window-min-height' or 869imposed by fixed size windows, `window-min-height' or
865`window-min-width' settings. IGNORE a window means ignore 870`window-min-width' settings. If IGNORE is a window, ignore
866restrictions for that window only. IGNORE equal `safe' means 871restrictions for that window only. If IGNORE equals `safe',
867live windows may get as small as `window-safe-min-height' lines 872live windows may get as small as `window-safe-min-height' lines
868and `window-safe-min-width' columns. 873and `window-safe-min-width' columns. Any other non-nil value
874means ignore all of the above restrictions for all windows.
869 875
870Optional argument TRAIL `before' means only windows to the left 876Optional argument TRAIL `before' means only windows to the left
871of or below WINDOW can be shrunk. Optional argument TRAIL 877of or below WINDOW can be shrunk. Optional argument TRAIL
@@ -916,17 +922,18 @@ columns. If WINDOW cannot be shrunk by -DELTA lines or columns,
916return the minimum value in the range DELTA..0 that can be used 922return the minimum value in the range DELTA..0 that can be used
917for shrinking WINDOW. 923for shrinking WINDOW.
918 924
919Optional argument IGNORE non-nil means ignore any restrictions 925Optional argument IGNORE non-nil means ignore restrictions
920imposed by fixed size windows, `window-min-height' or 926imposed by fixed size windows, `window-min-height' or
921`window-min-width' settings. IGNORE a window means ignore 927`window-min-width' settings. If IGNORE is a window, ignore
922restrictions for that window only. IGNORE equal `safe' means 928restrictions for that window only. If IGNORE equals `safe',
923live windows may get as small as `window-safe-min-height' lines 929live windows may get as small as `window-safe-min-height' lines
924and `window-safe-min-width' columns." 930and `window-safe-min-width' columns. Any other non-nil value
931means ignore all of the above restrictions for all windows."
925 (setq window (window-normalize-window window)) 932 (setq window (window-normalize-window window))
926 (window--resizable window delta horizontal ignore)) 933 (window--resizable window delta horizontal ignore))
927 934
928(defun window-total-size (&optional window horizontal) 935(defun window-total-size (&optional window horizontal)
929 "Return the total height or width of window WINDOW. 936 "Return the total height or width of WINDOW.
930If WINDOW is omitted or nil, it defaults to the selected window. 937If WINDOW is omitted or nil, it defaults to the selected window.
931 938
932If HORIZONTAL is omitted or nil, return the total height of 939If HORIZONTAL is omitted or nil, return the total height of
@@ -941,7 +948,7 @@ the total width, in columns, like `window-total-width'."
941 948
942;; See discussion in bug#4543. 949;; See discussion in bug#4543.
943(defun window-full-height-p (&optional window) 950(defun window-full-height-p (&optional window)
944 "Return t if WINDOW is as high as the containing frame. 951 "Return t if WINDOW is as high as its containing frame.
945More precisely, return t if and only if the total height of 952More precisely, return t if and only if the total height of
946WINDOW equals the total height of the root window of WINDOW's 953WINDOW equals the total height of the root window of WINDOW's
947frame. WINDOW can be any window and defaults to the selected 954frame. WINDOW can be any window and defaults to the selected
@@ -951,7 +958,7 @@ one."
951 (window-total-size (frame-root-window window)))) 958 (window-total-size (frame-root-window window))))
952 959
953(defun window-full-width-p (&optional window) 960(defun window-full-width-p (&optional window)
954 "Return t if WINDOW is as wide as the containing frame. 961 "Return t if WINDOW is as wide as its containing frame.
955More precisely, return t if and only if the total width of WINDOW 962More precisely, return t if and only if the total width of WINDOW
956equals the total width of the root window of WINDOW's frame. 963equals the total width of the root window of WINDOW's frame.
957WINDOW can be any window and defaults to the selected one." 964WINDOW can be any window and defaults to the selected one."
@@ -1115,7 +1122,7 @@ SIDE can be any of the symbols `left', `top', `right' or
1115 "Return window in DIRECTION as seen from WINDOW. 1122 "Return window in DIRECTION as seen from WINDOW.
1116DIRECTION must be one of `above', `below', `left' or `right'. 1123DIRECTION must be one of `above', `below', `left' or `right'.
1117WINDOW must be a live window and defaults to the selected one. 1124WINDOW must be a live window and defaults to the selected one.
1118IGNORE, when non-nil means a window can be returned even if its 1125IGNORE non-nil means a window can be returned even if its
1119`no-other-window' parameter is non-nil." 1126`no-other-window' parameter is non-nil."
1120 (setq window (window-normalize-window window t)) 1127 (setq window (window-normalize-window window t))
1121 (unless (memq direction '(above below left right)) 1128 (unless (memq direction '(above below left right))
@@ -1420,7 +1427,7 @@ windows."
1420(defun window--resize-mini-window (window delta) 1427(defun window--resize-mini-window (window delta)
1421 "Resize minibuffer window WINDOW by DELTA lines. 1428 "Resize minibuffer window WINDOW by DELTA lines.
1422If WINDOW cannot be resized by DELTA lines make it as large (or 1429If WINDOW cannot be resized by DELTA lines make it as large (or
1423as small) as possible but don't signal an error." 1430as small) as possible, but don't signal an error."
1424 (when (window-minibuffer-p window) 1431 (when (window-minibuffer-p window)
1425 (let* ((frame (window-frame window)) 1432 (let* ((frame (window-frame window))
1426 (root (frame-root-window frame)) 1433 (root (frame-root-window frame))
@@ -1461,12 +1468,13 @@ horizontally by DELTA columns. In this case a positive DELTA
1461means enlarge WINDOW by DELTA columns. DELTA negative means 1468means enlarge WINDOW by DELTA columns. DELTA negative means
1462WINDOW shall be shrunk by -DELTA columns. 1469WINDOW shall be shrunk by -DELTA columns.
1463 1470
1464Optional argument IGNORE non-nil means ignore any restrictions 1471Optional argument IGNORE non-nil means ignore restrictions
1465imposed by fixed size windows, `window-min-height' or 1472imposed by fixed size windows, `window-min-height' or
1466`window-min-width' settings. IGNORE any window means ignore 1473`window-min-width' settings. If IGNORE is a window, ignore
1467restrictions for that window only. IGNORE equal `safe' means 1474restrictions for that window only. If IGNORE equals `safe',
1468live windows may get as small as `window-safe-min-height' lines 1475live windows may get as small as `window-safe-min-height' lines
1469and `window-safe-min-width' columns. 1476and `window-safe-min-width' columns. Any other non-nil value
1477means ignore all of the above restrictions for all windows.
1470 1478
1471This function resizes other windows proportionally and never 1479This function resizes other windows proportionally and never
1472deletes any windows. If you want to move only the low (right) 1480deletes any windows. If you want to move only the low (right)
@@ -1516,9 +1524,9 @@ HORIZONTAL non-nil means set the new normal width of these
1516windows. WINDOW specifies a child window of PARENT that has been 1524windows. WINDOW specifies a child window of PARENT that has been
1517resized by THIS-DELTA lines (columns). 1525resized by THIS-DELTA lines (columns).
1518 1526
1519Optional argument TRAIL either 'before or 'after means set values 1527Optional argument TRAIL either `before' or `after' means set values
1520for windows before or after WINDOW only. Optional argument 1528only for windows before or after WINDOW. Optional argument
1521OTHER-DELTA a number specifies that this many lines (columns) 1529OTHER-DELTA, a number, specifies that this many lines (columns)
1522have been obtained from (or returned to) an ancestor window of 1530have been obtained from (or returned to) an ancestor window of
1523PARENT in order to resize WINDOW." 1531PARENT in order to resize WINDOW."
1524 (let* ((delta-normal 1532 (let* ((delta-normal
@@ -1618,12 +1626,13 @@ be a horizontally combined internal window.
1618WINDOW, if specified, must denote a child window of PARENT that 1626WINDOW, if specified, must denote a child window of PARENT that
1619is resized by DELTA lines. 1627is resized by DELTA lines.
1620 1628
1621Optional argument IGNORE non-nil means ignore any restrictions 1629Optional argument IGNORE non-nil means ignore restrictions
1622imposed by fixed size windows, `window-min-height' or 1630imposed by fixed size windows, `window-min-height' or
1623`window-min-width' settings. IGNORE equal `safe' means live 1631`window-min-width' settings. If IGNORE equals `safe', live
1624windows may get as small as `window-safe-min-height' lines and 1632windows may get as small as `window-safe-min-height' lines and
1625`window-safe-min-width' columns. IGNORE any window means ignore 1633`window-safe-min-width' columns. If IGNORE is a window, ignore
1626restrictions for that window only. 1634restrictions for that window only. Any other non-nil value means
1635ignore all of the above restrictions for all windows.
1627 1636
1628Optional arguments TRAIL and EDGE, when non-nil, restrict the set 1637Optional arguments TRAIL and EDGE, when non-nil, restrict the set
1629of windows that shall be resized. If TRAIL equals `before', 1638of windows that shall be resized. If TRAIL equals `before',
@@ -1790,12 +1799,13 @@ Optional argument HORIZONTAL non-nil means resize other windows
1790when WINDOW is resized horizontally by DELTA columns. WINDOW 1799when WINDOW is resized horizontally by DELTA columns. WINDOW
1791itself is not resized by this function. 1800itself is not resized by this function.
1792 1801
1793Optional argument IGNORE non-nil means ignore any restrictions 1802Optional argument IGNORE non-nil means ignore restrictions
1794imposed by fixed size windows, `window-min-height' or 1803imposed by fixed size windows, `window-min-height' or
1795`window-min-width' settings. IGNORE equal `safe' means live 1804`window-min-width' settings. If IGNORE equals `safe', live
1796windows may get as small as `window-safe-min-height' lines and 1805windows may get as small as `window-safe-min-height' lines and
1797`window-safe-min-width' columns. IGNORE any window means ignore 1806`window-safe-min-width' columns. If IGNORE is a window, ignore
1798restrictions for that window only. 1807restrictions for that window only. Any other non-nil value means
1808ignore all of the above restrictions for all windows.
1799 1809
1800Optional arguments TRAIL and EDGE, when non-nil, refine the set 1810Optional arguments TRAIL and EDGE, when non-nil, refine the set
1801of windows that shall be resized. If TRAIL equals `before', 1811of windows that shall be resized. If TRAIL equals `before',
@@ -1891,12 +1901,13 @@ preferably only resize windows adjacent to EDGE."
1891Optional argument HORIZONTAL non-nil means resize WINDOW 1901Optional argument HORIZONTAL non-nil means resize WINDOW
1892horizontally by DELTA columns. 1902horizontally by DELTA columns.
1893 1903
1894Optional argument IGNORE non-nil means ignore any restrictions 1904Optional argument IGNORE non-nil means ignore restrictions
1895imposed by fixed size windows, `window-min-height' or 1905imposed by fixed size windows, `window-min-height' or
1896`window-min-width' settings. IGNORE equal `safe' means live 1906`window-min-width' settings. If IGNORE equals `safe', live
1897windows may get as small as `window-safe-min-height' lines and 1907windows may get as small as `window-safe-min-height' lines and
1898`window-safe-min-width' columns. IGNORE any window means ignore 1908`window-safe-min-width' columns. If IGNORE is a window, ignore
1899restrictions for that window only. 1909restrictions for that window only. Any other non-nil value
1910means ignore all of the above restrictions for all windows.
1900 1911
1901Optional argument ADD non-nil means add DELTA to the new total 1912Optional argument ADD non-nil means add DELTA to the new total
1902size of WINDOW. 1913size of WINDOW.
@@ -1986,7 +1997,7 @@ any windows."
1986Optional argument HORIZONTAL non-nil means move WINDOW's right 1997Optional argument HORIZONTAL non-nil means move WINDOW's right
1987edge by DELTA columns. WINDOW defaults to the selected window. 1998edge by DELTA columns. WINDOW defaults to the selected window.
1988 1999
1989If DELTA is greater zero, then move the edge downwards or to the 2000If DELTA is greater than zero, move the edge downwards or to the
1990right. If DELTA is less than zero, move the edge upwards or to 2001right. If DELTA is less than zero, move the edge upwards or to
1991the left. If the edge can't be moved by DELTA lines or columns, 2002the left. If the edge can't be moved by DELTA lines or columns,
1992move it as far as possible in the desired direction." 2003move it as far as possible in the desired direction."
@@ -2091,7 +2102,7 @@ move it as far as possible in the desired direction."
2091 (error "Failed adjusting window %s" window))))))) 2102 (error "Failed adjusting window %s" window)))))))
2092 2103
2093(defun enlarge-window (delta &optional horizontal) 2104(defun enlarge-window (delta &optional horizontal)
2094 "Make selected window DELTA lines taller. 2105 "Make the selected window DELTA lines taller.
2095Interactively, if no argument is given, make the selected window 2106Interactively, if no argument is given, make the selected window
2096one line taller. If optional argument HORIZONTAL is non-nil, 2107one line taller. If optional argument HORIZONTAL is non-nil,
2097make selected window wider by DELTA columns. If DELTA is 2108make selected window wider by DELTA columns. If DELTA is
@@ -2112,7 +2123,7 @@ Return nil."
2112 horizontal)))) 2123 horizontal))))
2113 2124
2114(defun shrink-window (delta &optional horizontal) 2125(defun shrink-window (delta &optional horizontal)
2115 "Make selected window DELTA lines smaller. 2126 "Make the selected window DELTA lines smaller.
2116Interactively, if no argument is given, make the selected window 2127Interactively, if no argument is given, make the selected window
2117one line smaller. If optional argument HORIZONTAL is non-nil, 2128one line smaller. If optional argument HORIZONTAL is non-nil,
2118make selected window narrower by DELTA columns. If DELTA is 2129make selected window narrower by DELTA columns. If DELTA is