aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/FOR-RELEASE222
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/view.el7
-rw-r--r--lisp/window.el352
-rw-r--r--src/ChangeLog20
-rw-r--r--src/lread.c7
-rw-r--r--src/minibuf.c36
-rw-r--r--src/s/openbsd.h6
-rw-r--r--src/unexelf.c4
9 files changed, 362 insertions, 305 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 45330262041..e1c25ef07f3 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -123,132 +123,136 @@ names of the people who have checked it.
123 123
124SECTION READERS 124SECTION READERS
125---------------------------------- 125----------------------------------
126etc/TUTORIAL rgm (but see Bug#3783) 126TUTORIAL
127etc/TUTORIAL.bg 127TUTORIAL.bg
128etc/TUTORIAL.cn 128TUTORIAL.cn
129etc/TUTORIAL.cs 129TUTORIAL.cs
130etc/TUTORIAL.de Werner Lemberg 130TUTORIAL.de
131etc/TUTORIAL.eo 131TUTORIAL.eo
132etc/TUTORIAL.es 132TUTORIAL.es
133etc/TUTORIAL.fr 133TUTORIAL.fr
134etc/TUTORIAL.it 134TUTORIAL.he
135etc/TUTORIAL.ja 135TUTORIAL.it
136etc/TUTORIAL.ko 136TUTORIAL.ja
137etc/TUTORIAL.nl 137TUTORIAL.ko
138etc/TUTORIAL.pl 138TUTORIAL.nl
139etc/TUTORIAL.pt_BR 139TUTORIAL.pl
140etc/TUTORIAL.ro 140TUTORIAL.pt_BR
141etc/TUTORIAL.ru 141TUTORIAL.ro
142etc/TUTORIAL.sk 142TUTORIAL.ru
143etc/TUTORIAL.sl 143TUTORIAL.sk
144etc/TUTORIAL.sv 144TUTORIAL.sl
145etc/TUTORIAL.th 145TUTORIAL.sv
146etc/TUTORIAL.zh 146TUTORIAL.th
147TUTORIAL.zh
147 148
148** Check the manual. 149** Check the manual.
149 150
150abbrevs.texi -- cyd 151abbrevs.texi
151ack.texi -- rgm 152ack.texi
152anti.texi 153anti.texi
153arevert-xtra.texi 154arevert-xtra.texi
154basic.texi -- cyd 155basic.texi
155buffers.texi -- cyd 156buffers.texi
156building.texi -- cyd 157building.texi
157calendar.texi -- rgm 158calendar.texi
158cal-xtra.texi -- rgm 159cal-xtra.texi
159cmdargs.texi -- cyd 160cmdargs.texi
160commands.texi -- cyd 161commands.texi
161custom.texi -- cyd 162custom.texi
162dired.texi -- cyd 163dired.texi
163dired-xtra.texi 164dired-xtra.texi
164display.texi -- cyd 165display.texi
165emacs.texi -- cyd 166emacs.texi
166emacs-xtra.texi 167emacs-xtra.texi
167emerge-xtra.texi 168emerge-xtra.texi
168entering.texi -- cyd 169entering.texi
169files.texi -- cyd 170files.texi
170fixit.texi -- cyd 171fixit.texi
171fortran-xtra.texi -- rgm 172fortran-xtra.texi
172frames.texi -- cyd 173frames.texi
173glossary.texi 174glossary.texi
174help.texi -- cyd 175help.texi
175indent.texi -- cyd 176indent.texi
176killing.texi -- cyd 177killing.texi
177kmacro.texi -- cyd 178kmacro.texi
178macos.texi -- davidswelt 179macos.texi
179maintaining.texi -- cyd 180maintaining.texi
180major.texi -- cyd 181major.texi
181mark.texi -- cyd 182mark.texi
182mini.texi -- cyd 183mini.texi
183misc.texi -- cyd 184misc.texi
184msdog.texi -- eliz 185msdog.texi
185msdog-xtra.texi -- eliz 186msdog-xtra.texi
186mule.texi -- cyd 187mule.texi
187m-x.texi -- cyd 188m-x.texi
188programs.texi -- cyd 189picture-xtra.texi
189regs.texi -- cyd 190programs.texi
190rmail.texi -- rgm 191regs.texi
191screen.texi -- cyd 192rmail.texi
192search.texi -- cyd 193screen.texi
193sending.texi -- rgm (maybe needs some brief mailclient.el details in 194search.texi
194 "Mail Sending" section?) 195sending.texi
195text.texi -- cyd 196text.texi
196trouble.texi -- cyd 197trouble.texi
197windows.texi -- rudalics 198vc-xtra.texi
198xresources.texi -- cyd 199vc1-xtra.texi
200windows.texi
201xresources.texi
199 202
200** Check the Lisp manual. 203** Check the Lisp manual.
201 204
202abbrevs.texi -- cyd 205abbrevs.texi
203advice.texi -- cyd 206advice.texi
204anti.texi -- cyd 207anti.texi
205back.texi 208back.texi
206backups.texi -- cyd 209backups.texi
207buffers.texi -- cyd 210buffers.texi
208commands.texi -- cyd 211commands.texi
209compile.texi -- cyd 212compile.texi
210control.texi -- cyd 213control.texi
211customize.texi -- cyd 214customize.texi
212debugging.texi -- cyd 215debugging.texi
213display.texi -- cyd 216display.texi
214edebug.texi 217edebug.texi
215elisp.texi 218elisp.texi
216errors.texi -- cyd 219errors.texi
217eval.texi -- cyd 220eval.texi
218files.texi -- cyd 221files.texi
219frames.texi -- cyd 222frames.texi
220functions.texi -- cyd 223functions.texi
221hash.texi -- cyd 224hash.texi
222help.texi -- cyd 225help.texi
223hooks.texi -- cyd 226hooks.texi
224index.texi 227index.texi
225internals.texi -- cyd 228internals.texi
226intro.texi -- cyd 229intro.texi
227keymaps.texi -- cyd 230keymaps.texi
228lists.texi -- cyd 231lists.texi
229loading.texi -- cyd 232loading.texi
230locals.texi -- cyd 233locals.texi
231macros.texi -- cyd 234macros.texi
232maps.texi -- cyd 235maps.texi
233markers.texi -- cyd 236markers.texi
234minibuf.texi -- cyd 237minibuf.texi
235modes.texi -- cyd 238modes.texi
236nonascii.texi -- cyd 239nonascii.texi
237numbers.texi -- cyd 240numbers.texi
238objects.texi -- cyd 241objects.texi
239os.texi -- cyd 242os.texi
240positions.texi -- cyd 243package.texi
244positions.texi
241processes.texi 245processes.texi
242searching.texi -- cyd 246searching.texi
243sequences.texi -- cyd 247sequences.texi
244streams.texi -- cyd 248streams.texi
245strings.texi -- cyd 249strings.texi
246symbols.texi -- cyd 250symbols.texi
247syntax.texi -- cyd 251syntax.texi
248text.texi -- cyd 252text.texi
249tips.texi -- cyd 253tips.texi
250variables.texi -- cyd 254variables.texi
251windows.texi -- rudalics 255windows.texi
252 256
253* PLANNED ADDITIONS 257* PLANNED ADDITIONS
254 258
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0ea3d94a01f..0699a93ac9b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
12011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * view.el (view-buffer): Allow running in `special' modes if we're
4 visiting a file (bug#8615).
5
62011-07-19 Martin Rudalics <rudalics@gmx.at>
7
8 * window.el (display-buffer-alist-of-strings-p)
9 (display-buffer-alist-set-1, display-buffer-alist-set-2): New
10 functions.
11 (display-buffer-alist-set): Rewrite to handle Emacs 23 options
12 more accurately.
13
12011-07-18 Alan Mackenzie <acm@muc.de> 142011-07-18 Alan Mackenzie <acm@muc.de>
2 15
3 Fontify declarators properly when, e.g., a jit-lock chunk begins 16 Fontify declarators properly when, e.g., a jit-lock chunk begins
diff --git a/lisp/view.el b/lisp/view.el
index ee85b4e7823..21479a70a72 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -311,9 +311,10 @@ file: Users may suspend viewing in order to modify the buffer.
311Exiting View mode will then discard the user's edits. Setting 311Exiting View mode will then discard the user's edits. Setting
312EXIT-ACTION to `kill-buffer-if-not-modified' avoids this." 312EXIT-ACTION to `kill-buffer-if-not-modified' avoids this."
313 (interactive "bView buffer: ") 313 (interactive "bView buffer: ")
314 (if (eq (with-current-buffer buffer 314 (if (with-current-buffer buffer
315 (get major-mode 'mode-class)) 315 (and (eq (get major-mode 'mode-class)
316 'special) 316 'special)
317 (null buffer-file-name)))
317 (progn 318 (progn
318 (switch-to-buffer buffer) 319 (switch-to-buffer buffer)
319 (message "Not using View mode because the major mode is special")) 320 (message "Not using View mode because the major mode is special"))
diff --git a/lisp/window.el b/lisp/window.el
index b4b900287e1..12c9da85d57 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -6588,6 +6588,15 @@ split."
6588 6588
6589;; Functions for converting Emacs 23 buffer display options to buffer 6589;; Functions for converting Emacs 23 buffer display options to buffer
6590;; display specifiers. 6590;; display specifiers.
6591(defun display-buffer-alist-of-strings-p (list)
6592 "Return t if LIST is a non-empty list of strings."
6593 (when list
6594 (catch 'failed
6595 (dolist (item list)
6596 (unless (stringp item)
6597 (throw 'failed nil)))
6598 t)))
6599
6591(defun display-buffer-alist-add (identifiers specifiers &optional no-custom) 6600(defun display-buffer-alist-add (identifiers specifiers &optional no-custom)
6592 "Helper function for `display-buffer-alist-set'." 6601 "Helper function for `display-buffer-alist-set'."
6593 (unless identifiers 6602 (unless identifiers
@@ -6602,6 +6611,40 @@ split."
6602 'display-buffer-alist 6611 'display-buffer-alist
6603 (cons (cons identifiers specifiers) display-buffer-alist)))) 6612 (cons (cons identifiers specifiers) display-buffer-alist))))
6604 6613
6614(defun display-buffer-alist-set-1 ()
6615 "Helper function for `display-buffer-alist-set'."
6616 (progn ;; with-no-warnings
6617 (append
6618 '(reuse-window (reuse-window nil same 0))
6619 `(pop-up-frame (pop-up-frame t)
6620 ,(append '(pop-up-frame-alist)
6621 special-display-frame-alist))
6622 '((dedicate . weak)))))
6623
6624(defun display-buffer-alist-set-2 (args)
6625 "Helper function for `display-buffer-alist-set'."
6626 (progn ;; with-no-warnings
6627 (if (and (listp args) (symbolp (car args)))
6628 `(function (function ,(car args) ,(cdr args)))
6629 (append
6630 '(reuse-window (reuse-window nil same 0))
6631 (when (and (listp args) (cdr (assq 'same-window args)))
6632 '(reuse-window
6633 (reuse-window same nil nil) (reuse-window-dedicated . weak)))
6634 (when (and (listp args)
6635 (or (cdr (assq 'same-frame args))
6636 (cdr (assq 'same-window args))))
6637 '(pop-up-window (pop-up-window (largest . nil) (lru . nil))))
6638 (when (and (listp args)
6639 (or (cdr (assq 'same-frame args))
6640 (cdr (assq 'same-window args))))
6641 '(reuse-window (reuse-window nil nil nil)))
6642 `(pop-up-frame (pop-up-frame t)
6643 ,(append '(pop-up-frame-alist)
6644 (when (listp args) args)
6645 special-display-frame-alist))
6646 '((dedicate . weak))))))
6647
6605(defun display-buffer-alist-set (&optional no-custom add) 6648(defun display-buffer-alist-set (&optional no-custom add)
6606 "Set `display-buffer-alist' from Emacs 23 buffer display options. 6649 "Set `display-buffer-alist' from Emacs 23 buffer display options.
6607Optional argument NO-CUSTOM nil means use `customize-set-variable' 6650Optional argument NO-CUSTOM nil means use `customize-set-variable'
@@ -6611,201 +6654,164 @@ means to use `setq' instead.
6611Optional argument ADD nil means to replace the actual value of 6654Optional argument ADD nil means to replace the actual value of
6612`display-buffer-alist' with the value calculated here. ADD 6655`display-buffer-alist' with the value calculated here. ADD
6613non-nil means prepend the value calculated here to the current 6656non-nil means prepend the value calculated here to the current
6614value of `display-buffer-alist'." 6657value of `display-buffer-alist'. Return `display-buffer-alist'."
6615 (unless add 6658 (unless add
6616 (if no-custom 6659 (if no-custom
6617 (setq display-buffer-alist nil) 6660 (setq display-buffer-alist nil)
6618 (customize-set-variable 'display-buffer-alist nil))) 6661 (customize-set-variable 'display-buffer-alist nil)))
6619 6662
6620 ;; Disable warnings, there are too many obsolete options here. 6663 ;; Disable warnings, there are too many obsolete options here.
6621 (with-no-warnings 6664 (progn ;; with-no-warnings
6622 ;; `pop-up-windows' 6665 `other-window-means-other-frame'
6623 (display-buffer-alist-add 6666 (when pop-up-frames
6624 nil 6667 (display-buffer-alist-add
6625 (let ((fun (unless (eq split-window-preferred-function 6668 nil '(pop-up-frame
6626 'split-window-sensibly) 6669 (other-window-means-other-frame . t)) no-custom))
6627 ;; `split-window-sensibly' has been merged into the
6628 ;; `display-buffer-split-window' code as `nil'.
6629 split-window-preferred-function))
6630 (min-height
6631 (if (numberp split-height-threshold)
6632 (/ split-height-threshold 2)
6633 ;; Undocumented hack.
6634 1.0))
6635 (min-width
6636 (if (numberp split-width-threshold)
6637 (/ split-width-threshold 2)
6638 ;; Undocumented hack.
6639 1.0)))
6640 (list
6641 'pop-up-window
6642 (when pop-up-windows
6643 (list
6644 'pop-up-window
6645 (cons 'largest fun)
6646 (cons 'lru fun)))
6647 (cons 'pop-up-window-min-height min-height)
6648 (cons 'pop-up-window-min-width min-width)))
6649 no-custom)
6650 6670
6651 ;; `pop-up-frames' 6671 ;; `reuse-window-even-sizes'
6652 (display-buffer-alist-add 6672 (when even-window-heights
6653 nil 6673 (display-buffer-alist-add
6654 (list 6674 nil '(reuse-window (reuse-window-even-sizes . t)) no-custom))
6655 'pop-up-frame 6675
6656 (when pop-up-frames 6676 ;; `dedicate'
6657 (list 'pop-up-frame pop-up-frames)) 6677 (when display-buffer-mark-dedicated
6658 (when pop-up-frame-function 6678 (display-buffer-alist-add
6659 (cons 'pop-up-frame-function pop-up-frame-function)) 6679 nil '(dedicate (display-buffer-mark-dedicated . t)) no-custom))
6660 (when pop-up-frame-alist 6680
6661 (cons 'pop-up-frame-alist pop-up-frame-alist))) 6681 ;; `pop-up-window' group
6662 no-custom) 6682 (let ((fun (unless (eq split-window-preferred-function
6683 'split-window-sensibly)
6684 split-window-preferred-function))
6685 (min-height
6686 (if (numberp split-height-threshold)
6687 (/ split-height-threshold 2)
6688 1.0))
6689 (min-width
6690 (if (numberp split-width-threshold)
6691 (/ split-width-threshold 2)
6692 1.0)))
6693 (display-buffer-alist-add
6694 nil
6695 (list
6696 'pop-up-window
6697 ;; `pop-up-window'
6698 (when pop-up-windows
6699 (list 'pop-up-window (cons 'largest fun) (cons 'lru fun)))
6700 ;; `pop-up-window-min-height'
6701 (cons 'pop-up-window-min-height min-height)
6702 ;; `pop-up-window-min-width'
6703 (cons 'pop-up-window-min-width min-width))
6704 no-custom))
6705
6706 ;; `pop-up-frame' group
6707 (when (or pop-up-frames
6708 (not (equal pop-up-frame-function
6709 '(lambda nil
6710 (make-frame pop-up-frame-alist))))
6711 pop-up-frame-alist)
6712 (display-buffer-alist-add
6713 nil
6714 (list
6715 'pop-up-frame
6716 (when pop-up-frames
6717 ;; `pop-up-frame'
6718 (list 'pop-up-frame
6719 (when (eq pop-up-frames 'graphic-only)
6720 t)))
6721 (unless (equal pop-up-frame-function
6722 '(lambda nil
6723 (make-frame pop-up-frame-alist)))
6724 ;; `pop-up-frame-function'
6725 (cons 'pop-up-frame-function pop-up-frame-function))
6726 (when pop-up-frame-alist
6727 ;; `pop-up-frame-alist'
6728 (cons 'pop-up-frame-alist pop-up-frame-alist)))
6729 no-custom))
6663 6730
6664 ;; `special-display-regexps' 6731 ;; `special-display-regexps'
6665 (dolist (entry special-display-regexps) 6732 (if (display-buffer-alist-of-strings-p special-display-regexps)
6666 (cond 6733 ;; Handle case where `special-display-regexps' is a plain list
6667 ((stringp entry) 6734 ;; of strings specially.
6668 ;; Plain string. 6735 (let (list)
6669 (display-buffer-alist-add 6736 (dolist (regexp special-display-regexps)
6670 `((regexp . ,entry)) 6737 (setq list (cons (cons 'regexp regexp) list)))
6671 (list 6738 (setq list (nreverse list))
6672 'function 6739 (display-buffer-alist-add
6673 (list 'function special-display-function 6740 list (display-buffer-alist-set-1) no-custom))
6674 special-display-frame-alist)) 6741 ;; Else iterate over the entries.
6675 no-custom)) 6742 (dolist (item special-display-regexps)
6676 ((consp entry) 6743 (if (stringp item)
6677 (let ((name (car entry)) 6744 (display-buffer-alist-add
6678 (rest (cdr entry))) 6745 `((regexp . ,item)) (display-buffer-alist-set-1)
6679 (cond 6746 no-custom)
6680 ((functionp (car rest)) 6747 (display-buffer-alist-add
6681 ;; A function. 6748 `((regexp . ,(car item)))
6682 (display-buffer-alist-add 6749 (display-buffer-alist-set-2 (cdr item))
6683 `((name . ,name)) 6750 no-custom))))
6684 (list
6685 'function
6686 ;; Weary.
6687 (list 'function (car rest) (cadr rest)))
6688 no-custom))
6689 ((listp rest)
6690 ;; A list of parameters.
6691 (cond
6692 ((assq 'same-window rest)
6693 (display-buffer-alist-add
6694 `((name . ,name))
6695 (list 'reuse-window
6696 (list 'reuse-window 'same)
6697 (list 'reuse-window-dedicated 'weak))
6698 no-custom))
6699 ((assq 'same-frame rest)
6700 (display-buffer-alist-add
6701 `((name . ,name)) (list 'same-frame) no-custom))
6702 (t
6703 (display-buffer-alist-add
6704 `((name . ,name))
6705 (list
6706 'function
6707 (list 'function special-display-function
6708 special-display-frame-alist))
6709 no-custom)))))))))
6710 6751
6711 ;; `special-display-buffer-names' 6752 ;; `special-display-buffer-names'
6712 (dolist (entry special-display-buffer-names) 6753 (if (display-buffer-alist-of-strings-p special-display-buffer-names)
6713 (cond 6754 ;; Handle case where `special-display-buffer-names' is a plain
6714 ((stringp entry) 6755 ;; list of strings specially.
6715 ;; Plain string. 6756 (let (list)
6716 (display-buffer-alist-add 6757 (dolist (name special-display-buffer-names)
6717 `((name . ,entry)) 6758 (setq list (cons (cons 'name name) list)))
6718 (list 6759 (setq list (nreverse list))
6719 'function 6760 (display-buffer-alist-add
6720 (list 'function special-display-function 6761 list (display-buffer-alist-set-1) no-custom))
6721 special-display-frame-alist)) 6762 ;; Else iterate over the entries.
6722 no-custom)) 6763 (dolist (item special-display-buffer-names)
6723 ((consp entry) 6764 (if (stringp item)
6724 (let ((name (car entry)) 6765 (display-buffer-alist-add
6725 (rest (cdr entry))) 6766 `((name . ,item)) (display-buffer-alist-set-1)
6726 (cond 6767 no-custom)
6727 ((functionp (car rest)) 6768 (display-buffer-alist-add
6728 ;; A function. 6769 `((name . ,(car item)))
6729 (display-buffer-alist-add 6770 (display-buffer-alist-set-2 (cdr item))
6730 `((name . ,name)) 6771 no-custom))))
6731 (list
6732 'function
6733 ;; Weary.
6734 (list 'function (car rest) (cadr rest)))
6735 no-custom))
6736 ((listp rest)
6737 ;; A list of parameters.
6738 (cond
6739 ((assq 'same-window rest)
6740 (display-buffer-alist-add
6741 `((name . ,name))
6742 (list 'reuse-window
6743 (list 'reuse-window 'same)
6744 (list 'reuse-window-dedicated 'weak))
6745 no-custom))
6746 ((assq 'same-frame rest)
6747 (display-buffer-alist-add
6748 `((name . ,name)) (list 'same-frame) no-custom))
6749 (t
6750 (display-buffer-alist-add
6751 `((name . ,name))
6752 (list
6753 'function
6754 (list 'function special-display-function
6755 special-display-frame-alist))
6756 no-custom)))))))))
6757 6772
6758 ;; `same-window-regexps' 6773 ;; `same-window-regexps'
6759 (dolist (entry same-window-regexps) 6774 (if (display-buffer-alist-of-strings-p same-window-regexps)
6760 (cond 6775 ;; Handle case where `same-window-regexps' is a plain list of
6761 ((stringp entry) 6776 ;; strings specially.
6762 (display-buffer-alist-add 6777 (let (list)
6763 `((regexp . ,entry)) 6778 (dolist (regexp same-window-regexps)
6764 (list 'reuse-window (list 'reuse-window 'same)) 6779 (setq list (cons (cons 'regexp regexp) list)))
6765 no-custom)) 6780 (setq list (nreverse list))
6766 ((consp entry) 6781 (display-buffer-alist-add
6782 list '(reuse-window (reuse-window same nil nil)) no-custom))
6783 (dolist (entry same-window-regexps)
6767 (display-buffer-alist-add 6784 (display-buffer-alist-add
6768 `((regexp . ,(car entry))) 6785 `((regexp . ,(if (stringp entry) entry (car entry))))
6769 (list 'reuse-window (list 'reuse-window 'same)) 6786 '(reuse-window (reuse-window same nil nil)) no-custom)))
6770 no-custom))))
6771 6787
6772 ;; `same-window-buffer-names' 6788 ;; `same-window-buffer-names'
6773 (dolist (entry same-window-buffer-names) 6789 (if (display-buffer-alist-of-strings-p same-window-buffer-names)
6774 (cond 6790 ;; Handle case where `same-window-buffer-names' is a plain list
6775 ((stringp entry) 6791 ;; of strings specially.
6792 (let (list)
6793 (dolist (name same-window-buffer-names)
6794 (setq list (cons (cons 'name name) list)))
6795 (setq list (nreverse list))
6796 (display-buffer-alist-add
6797 list '(reuse-window (reuse-window same nil nil)) no-custom))
6798 (dolist (entry same-window-buffer-names)
6776 (display-buffer-alist-add 6799 (display-buffer-alist-add
6777 `((name . ,entry)) 6800 `((name . ,(if (stringp entry) entry (car entry))))
6778 (list 'reuse-window (list 'reuse-window 'same)) 6801 '(reuse-window (reuse-window same nil nil)) no-custom)))
6779 no-custom))
6780 ((consp entry)
6781 (display-buffer-alist-add
6782 `((name . ,(car entry)))
6783 (list 'reuse-window (list 'reuse-window 'same))
6784 no-custom))))
6785 6802
6786 ;; `reuse-window' 6803 ;; `reuse-window'
6787 (display-buffer-alist-add 6804 (display-buffer-alist-add
6788 nil 6805 nil `(reuse-window
6789 (list 6806 (reuse-window
6790 'reuse-window 6807 nil same
6791 (list 'reuse-window nil 'same 6808 ,(when (or display-buffer-reuse-frames pop-up-frames)
6792 (when (or display-buffer-reuse-frames pop-up-frames) 6809 ;; "0" (all visible and iconified frames) is
6793 ;; "0" (all visible and iconified frames) is hardcoded in 6810 ;; hardcoded in Emacs 23.
6794 ;; Emacs 23. 6811 0)))
6795 0))
6796 (when even-window-heights
6797 (cons 'reuse-window-even-sizes t)))
6798 no-custom) 6812 no-custom)
6799 6813
6800 ;; `display-buffer-mark-dedicated' 6814 display-buffer-alist))
6801 (when display-buffer-mark-dedicated
6802 (display-buffer-alist-add
6803 nil
6804 (list
6805 (cons 'dedicate display-buffer-mark-dedicated))
6806 no-custom)))
6807
6808 display-buffer-alist)
6809 6815
6810(defun set-window-text-height (window height) 6816(defun set-window-text-height (window height)
6811 "Set the height in lines of the text display area of WINDOW to HEIGHT. 6817 "Set the height in lines of the text display area of WINDOW to HEIGHT.
diff --git a/src/ChangeLog b/src/ChangeLog
index f7f68b41838..30af92a57e9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -106,6 +106,8 @@
106 (gs_load): Use printmax_t to print the widest integers possible. 106 (gs_load): Use printmax_t to print the widest integers possible.
107 Check for integer overflow when computing image height and width. 107 Check for integer overflow when computing image height and width.
108 108
1092011-07-19 Paul Eggert <eggert@cs.ucla.edu>
110
109 Integer signedness and overflow and related fixes. (Bug#9079) 111 Integer signedness and overflow and related fixes. (Bug#9079)
110 112
111 * bidi.c: Integer size and overflow fixes. 113 * bidi.c: Integer size and overflow fixes.
@@ -303,6 +305,24 @@
303 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally 305 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
304 well either way, and we prefer signed to unsigned. 306 well either way, and we prefer signed to unsigned.
305 307
3082011-07-19 Paul Eggert <eggert@cs.ucla.edu>
309
310 Port to OpenBSD.
311 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
312 and the surrounding thread.
313 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
314 rather than fgets, and retry after EINTR. Otherwise, 'emacs
315 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
316 timer goes off.
317 * s/openbsd.h (BROKEN_SIGIO): Define.
318 * unexelf.c (unexec) [__OpenBSD__]:
319 Don't update the .mdebug section of the Alpha COFF symbol table.
320
3212011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
322
323 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
324 (bug#8460).
325
3062011-07-18 Paul Eggert <eggert@cs.ucla.edu> 3262011-07-18 Paul Eggert <eggert@cs.ucla.edu>
307 327
308 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask. 328 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
diff --git a/src/lread.c b/src/lread.c
index c0de95dd121..0613ad037bf 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4491,10 +4491,9 @@ to load. See also `load-dangerous-libraries'. */);
4491 Qlexical_binding = intern ("lexical-binding"); 4491 Qlexical_binding = intern ("lexical-binding");
4492 staticpro (&Qlexical_binding); 4492 staticpro (&Qlexical_binding);
4493 DEFVAR_LISP ("lexical-binding", Vlexical_binding, 4493 DEFVAR_LISP ("lexical-binding", Vlexical_binding,
4494 doc: /* If non-nil, use lexical binding when evaluating code. 4494 doc: /* Whether to use lexical binding when evaluating code.
4495This applies to code evaluated by `eval-buffer' and `eval-region' and 4495Non-nil means that the code in the current buffer should be evaluated
4496other commands that call these functions, like `eval-defun' and 4496with lexical binding.
4497the like.
4498This variable is automatically set from the file variables of an 4497This variable is automatically set from the file variables of an
4499interpreted Lisp file read using `load'. */); 4498interpreted Lisp file read using `load'. */);
4500 Fmake_variable_buffer_local (Qlexical_binding); 4499 Fmake_variable_buffer_local (Qlexical_binding);
diff --git a/src/minibuf.c b/src/minibuf.c
index 951bf028c38..eb564a10ec6 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -19,6 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19 19
20 20
21#include <config.h> 21#include <config.h>
22#include <errno.h>
22#include <stdio.h> 23#include <stdio.h>
23#include <setjmp.h> 24#include <setjmp.h>
24 25
@@ -236,8 +237,9 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
236 int allow_props, int inherit_input_method) 237 int allow_props, int inherit_input_method)
237{ 238{
238 ptrdiff_t size, len; 239 ptrdiff_t size, len;
239 char *line, *s; 240 char *line;
240 Lisp_Object val; 241 Lisp_Object val;
242 int c;
241 243
242 fprintf (stdout, "%s", SDATA (prompt)); 244 fprintf (stdout, "%s", SDATA (prompt));
243 fflush (stdout); 245 fflush (stdout);
@@ -246,22 +248,30 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
246 size = 100; 248 size = 100;
247 len = 0; 249 len = 0;
248 line = (char *) xmalloc (size); 250 line = (char *) xmalloc (size);
249 while ((s = fgets (line + len, size - len, stdin)) != NULL 251
250 && (len = strlen (line), 252 while ((c = getchar ()) != '\n')
251 len == size - 1 && line[len - 1] != '\n'))
252 { 253 {
253 if (STRING_BYTES_BOUND / 2 < size) 254 if (c < 0)
254 memory_full (SIZE_MAX); 255 {
255 size *= 2; 256 if (errno != EINTR)
256 line = (char *) xrealloc (line, size); 257 break;
258 }
259 else
260 {
261 if (len == size)
262 {
263 if (STRING_BYTES_BOUND / 2 < size)
264 memory_full (SIZE_MAX);
265 size *= 2;
266 line = (char *) xrealloc (line, size);
267 }
268 line[len++] = c;
269 }
257 } 270 }
258 271
259 if (s) 272 if (len)
260 { 273 {
261 char *nl = strchr (line, '\n'); 274 val = make_string (line, len);
262 if (nl)
263 *nl = '\0';
264 val = build_string (line);
265 xfree (line); 275 xfree (line);
266 } 276 }
267 else 277 else
diff --git a/src/s/openbsd.h b/src/s/openbsd.h
index 175d61dc9c9..0a8bab2290f 100644
--- a/src/s/openbsd.h
+++ b/src/s/openbsd.h
@@ -1,5 +1,9 @@
1/* System file for openbsd. */ 1/* System file for openbsd. */
2 2
3/* The same as NetBSD. Note there are differences in configure. */ 3/* Nearly the same as NetBSD. Note there are differences in configure. */
4#include "netbsd.h" 4#include "netbsd.h"
5 5
6/* The symbol SIGIO is defined, but the feature doesn't work in the
7 way Emacs needs it to. See
8 <http://article.gmane.org/gmane.os.openbsd.ports/46831>. */
9#define BROKEN_SIGIO
diff --git a/src/unexelf.c b/src/unexelf.c
index 951e7c0eea6..a169ffcb5c8 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -1053,7 +1053,7 @@ temacs:
1053 memcpy (NEW_SECTION_H (nn).sh_offset + new_base, src, 1053 memcpy (NEW_SECTION_H (nn).sh_offset + new_base, src,
1054 NEW_SECTION_H (nn).sh_size); 1054 NEW_SECTION_H (nn).sh_size);
1055 1055
1056#ifdef __alpha__ 1056#if defined __alpha__ && !defined __OpenBSD__
1057 /* Update Alpha COFF symbol table: */ 1057 /* Update Alpha COFF symbol table: */
1058 if (strcmp (old_section_names + OLD_SECTION_H (n).sh_name, ".mdebug") 1058 if (strcmp (old_section_names + OLD_SECTION_H (n).sh_name, ".mdebug")
1059 == 0) 1059 == 0)
@@ -1072,7 +1072,7 @@ temacs:
1072 symhdr->cbRfdOffset += new_data2_size; 1072 symhdr->cbRfdOffset += new_data2_size;
1073 symhdr->cbExtOffset += new_data2_size; 1073 symhdr->cbExtOffset += new_data2_size;
1074 } 1074 }
1075#endif /* __alpha__ */ 1075#endif /* __alpha__ && !__OpenBSD__ */
1076 1076
1077#if defined (_SYSTYPE_SYSV) 1077#if defined (_SYSTYPE_SYSV)
1078 if (NEW_SECTION_H (nn).sh_type == SHT_MIPS_DEBUG 1078 if (NEW_SECTION_H (nn).sh_type == SHT_MIPS_DEBUG