summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-07-19 13:37:27 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-07-19 13:37:27 -0700
commit63cf7836ae7616ce91d7eeaeac997d71609e191b (patch)
tree801b7c438808303fd47cf19aec1d899c78c2472f
parent7403ff044d82d390bdc4cdd3954448daedcd4571 (diff)
parent0d8de0fd0a5a63cc9558b5c99f9c7f1ddcaf338a (diff)
downloademacs-63cf7836ae7616ce91d7eeaeac997d71609e191b.tar.gz
Merge from intsign.
-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.
SECTION READERS
----------------------------------
-etc/TUTORIAL rgm (but see Bug#3783)
-etc/TUTORIAL.bg
-etc/TUTORIAL.cn
-etc/TUTORIAL.cs
-etc/TUTORIAL.de Werner Lemberg
-etc/TUTORIAL.eo
-etc/TUTORIAL.es
-etc/TUTORIAL.fr
-etc/TUTORIAL.it
-etc/TUTORIAL.ja
-etc/TUTORIAL.ko
-etc/TUTORIAL.nl
-etc/TUTORIAL.pl
-etc/TUTORIAL.pt_BR
-etc/TUTORIAL.ro
-etc/TUTORIAL.ru
-etc/TUTORIAL.sk
-etc/TUTORIAL.sl
-etc/TUTORIAL.sv
-etc/TUTORIAL.th
-etc/TUTORIAL.zh
+TUTORIAL
+TUTORIAL.bg
+TUTORIAL.cn
+TUTORIAL.cs
+TUTORIAL.de
+TUTORIAL.eo
+TUTORIAL.es
+TUTORIAL.fr
+TUTORIAL.he
+TUTORIAL.it
+TUTORIAL.ja
+TUTORIAL.ko
+TUTORIAL.nl
+TUTORIAL.pl
+TUTORIAL.pt_BR
+TUTORIAL.ro
+TUTORIAL.ru
+TUTORIAL.sk
+TUTORIAL.sl
+TUTORIAL.sv
+TUTORIAL.th
+TUTORIAL.zh
** Check the manual.
-abbrevs.texi -- cyd
-ack.texi -- rgm
+abbrevs.texi
+ack.texi
anti.texi
arevert-xtra.texi
-basic.texi -- cyd
-buffers.texi -- cyd
-building.texi -- cyd
-calendar.texi -- rgm
-cal-xtra.texi -- rgm
-cmdargs.texi -- cyd
-commands.texi -- cyd
-custom.texi -- cyd
-dired.texi -- cyd
+basic.texi
+buffers.texi
+building.texi
+calendar.texi
+cal-xtra.texi
+cmdargs.texi
+commands.texi
+custom.texi
+dired.texi
dired-xtra.texi
-display.texi -- cyd
-emacs.texi -- cyd
+display.texi
+emacs.texi
emacs-xtra.texi
emerge-xtra.texi
-entering.texi -- cyd
-files.texi -- cyd
-fixit.texi -- cyd
-fortran-xtra.texi -- rgm
-frames.texi -- cyd
+entering.texi
+files.texi
+fixit.texi
+fortran-xtra.texi
+frames.texi
glossary.texi
-help.texi -- cyd
-indent.texi -- cyd
-killing.texi -- cyd
-kmacro.texi -- cyd
-macos.texi -- davidswelt
-maintaining.texi -- cyd
-major.texi -- cyd
-mark.texi -- cyd
-mini.texi -- cyd
-misc.texi -- cyd
-msdog.texi -- eliz
-msdog-xtra.texi -- eliz
-mule.texi -- cyd
-m-x.texi -- cyd
-programs.texi -- cyd
-regs.texi -- cyd
-rmail.texi -- rgm
-screen.texi -- cyd
-search.texi -- cyd
-sending.texi -- rgm (maybe needs some brief mailclient.el details in
- "Mail Sending" section?)
-text.texi -- cyd
-trouble.texi -- cyd
-windows.texi -- rudalics
-xresources.texi -- cyd
+help.texi
+indent.texi
+killing.texi
+kmacro.texi
+macos.texi
+maintaining.texi
+major.texi
+mark.texi
+mini.texi
+misc.texi
+msdog.texi
+msdog-xtra.texi
+mule.texi
+m-x.texi
+picture-xtra.texi
+programs.texi
+regs.texi
+rmail.texi
+screen.texi
+search.texi
+sending.texi
+text.texi
+trouble.texi
+vc-xtra.texi
+vc1-xtra.texi
+windows.texi
+xresources.texi
** Check the Lisp manual.
-abbrevs.texi -- cyd
-advice.texi -- cyd
-anti.texi -- cyd
+abbrevs.texi
+advice.texi
+anti.texi
back.texi
-backups.texi -- cyd
-buffers.texi -- cyd
-commands.texi -- cyd
-compile.texi -- cyd
-control.texi -- cyd
-customize.texi -- cyd
-debugging.texi -- cyd
-display.texi -- cyd
+backups.texi
+buffers.texi
+commands.texi
+compile.texi
+control.texi
+customize.texi
+debugging.texi
+display.texi
edebug.texi
elisp.texi
-errors.texi -- cyd
-eval.texi -- cyd
-files.texi -- cyd
-frames.texi -- cyd
-functions.texi -- cyd
-hash.texi -- cyd
-help.texi -- cyd
-hooks.texi -- cyd
+errors.texi
+eval.texi
+files.texi
+frames.texi
+functions.texi
+hash.texi
+help.texi
+hooks.texi
index.texi
-internals.texi -- cyd
-intro.texi -- cyd
-keymaps.texi -- cyd
-lists.texi -- cyd
-loading.texi -- cyd
-locals.texi -- cyd
-macros.texi -- cyd
-maps.texi -- cyd
-markers.texi -- cyd
-minibuf.texi -- cyd
-modes.texi -- cyd
-nonascii.texi -- cyd
-numbers.texi -- cyd
-objects.texi -- cyd
-os.texi -- cyd
-positions.texi -- cyd
+internals.texi
+intro.texi
+keymaps.texi
+lists.texi
+loading.texi
+locals.texi
+macros.texi
+maps.texi
+markers.texi
+minibuf.texi
+modes.texi
+nonascii.texi
+numbers.texi
+objects.texi
+os.texi
+package.texi
+positions.texi
processes.texi
-searching.texi -- cyd
-sequences.texi -- cyd
-streams.texi -- cyd
-strings.texi -- cyd
-symbols.texi -- cyd
-syntax.texi -- cyd
-text.texi -- cyd
-tips.texi -- cyd
-variables.texi -- cyd
-windows.texi -- rudalics
+searching.texi
+sequences.texi
+streams.texi
+strings.texi
+symbols.texi
+syntax.texi
+text.texi
+tips.texi
+variables.texi
+windows.texi
* PLANNED ADDITIONS
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0ea3d94a01f..0699a93ac9b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
+2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * view.el (view-buffer): Allow running in `special' modes if we're
+ visiting a file (bug#8615).
+
+2011-07-19 Martin Rudalics <rudalics@gmx.at>
+
+ * window.el (display-buffer-alist-of-strings-p)
+ (display-buffer-alist-set-1, display-buffer-alist-set-2): New
+ functions.
+ (display-buffer-alist-set): Rewrite to handle Emacs 23 options
+ more accurately.
+
2011-07-18 Alan Mackenzie <acm@muc.de>
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.
Exiting View mode will then discard the user's edits. Setting
EXIT-ACTION to `kill-buffer-if-not-modified' avoids this."
(interactive "bView buffer: ")
- (if (eq (with-current-buffer buffer
- (get major-mode 'mode-class))
- 'special)
+ (if (with-current-buffer buffer
+ (and (eq (get major-mode 'mode-class)
+ 'special)
+ (null buffer-file-name)))
(progn
(switch-to-buffer buffer)
(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."
;; Functions for converting Emacs 23 buffer display options to buffer
;; display specifiers.
+(defun display-buffer-alist-of-strings-p (list)
+ "Return t if LIST is a non-empty list of strings."
+ (when list
+ (catch 'failed
+ (dolist (item list)
+ (unless (stringp item)
+ (throw 'failed nil)))
+ t)))
+
(defun display-buffer-alist-add (identifiers specifiers &optional no-custom)
"Helper function for `display-buffer-alist-set'."
(unless identifiers
@@ -6602,6 +6611,40 @@ split."
'display-buffer-alist
(cons (cons identifiers specifiers) display-buffer-alist))))
+(defun display-buffer-alist-set-1 ()
+ "Helper function for `display-buffer-alist-set'."
+ (progn ;; with-no-warnings
+ (append
+ '(reuse-window (reuse-window nil same 0))
+ `(pop-up-frame (pop-up-frame t)
+ ,(append '(pop-up-frame-alist)
+ special-display-frame-alist))
+ '((dedicate . weak)))))
+
+(defun display-buffer-alist-set-2 (args)
+ "Helper function for `display-buffer-alist-set'."
+ (progn ;; with-no-warnings
+ (if (and (listp args) (symbolp (car args)))
+ `(function (function ,(car args) ,(cdr args)))
+ (append
+ '(reuse-window (reuse-window nil same 0))
+ (when (and (listp args) (cdr (assq 'same-window args)))
+ '(reuse-window
+ (reuse-window same nil nil) (reuse-window-dedicated . weak)))
+ (when (and (listp args)
+ (or (cdr (assq 'same-frame args))
+ (cdr (assq 'same-window args))))
+ '(pop-up-window (pop-up-window (largest . nil) (lru . nil))))
+ (when (and (listp args)
+ (or (cdr (assq 'same-frame args))
+ (cdr (assq 'same-window args))))
+ '(reuse-window (reuse-window nil nil nil)))
+ `(pop-up-frame (pop-up-frame t)
+ ,(append '(pop-up-frame-alist)
+ (when (listp args) args)
+ special-display-frame-alist))
+ '((dedicate . weak))))))
+
(defun display-buffer-alist-set (&optional no-custom add)
"Set `display-buffer-alist' from Emacs 23 buffer display options.
Optional argument NO-CUSTOM nil means use `customize-set-variable'
@@ -6611,201 +6654,164 @@ means to use `setq' instead.
Optional argument ADD nil means to replace the actual value of
`display-buffer-alist' with the value calculated here. ADD
non-nil means prepend the value calculated here to the current
-value of `display-buffer-alist'."
+value of `display-buffer-alist'. Return `display-buffer-alist'."
(unless add
(if no-custom
(setq display-buffer-alist nil)
(customize-set-variable 'display-buffer-alist nil)))
;; Disable warnings, there are too many obsolete options here.
- (with-no-warnings
- ;; `pop-up-windows'
- (display-buffer-alist-add
- nil
- (let ((fun (unless (eq split-window-preferred-function
- 'split-window-sensibly)
- ;; `split-window-sensibly' has been merged into the
- ;; `display-buffer-split-window' code as `nil'.
- split-window-preferred-function))
- (min-height
- (if (numberp split-height-threshold)
- (/ split-height-threshold 2)
- ;; Undocumented hack.
- 1.0))
- (min-width
- (if (numberp split-width-threshold)
- (/ split-width-threshold 2)
- ;; Undocumented hack.
- 1.0)))
- (list
- 'pop-up-window
- (when pop-up-windows
- (list
- 'pop-up-window
- (cons 'largest fun)
- (cons 'lru fun)))
- (cons 'pop-up-window-min-height min-height)
- (cons 'pop-up-window-min-width min-width)))
- no-custom)
+ (progn ;; with-no-warnings
+ `other-window-means-other-frame'
+ (when pop-up-frames
+ (display-buffer-alist-add
+ nil '(pop-up-frame
+ (other-window-means-other-frame . t)) no-custom))
- ;; `pop-up-frames'
- (display-buffer-alist-add
- nil
- (list
- 'pop-up-frame
- (when pop-up-frames
- (list 'pop-up-frame pop-up-frames))
- (when pop-up-frame-function
- (cons 'pop-up-frame-function pop-up-frame-function))
- (when pop-up-frame-alist
- (cons 'pop-up-frame-alist pop-up-frame-alist)))
- no-custom)
+ ;; `reuse-window-even-sizes'
+ (when even-window-heights
+ (display-buffer-alist-add
+ nil '(reuse-window (reuse-window-even-sizes . t)) no-custom))
+
+ ;; `dedicate'
+ (when display-buffer-mark-dedicated
+ (display-buffer-alist-add
+ nil '(dedicate (display-buffer-mark-dedicated . t)) no-custom))
+
+ ;; `pop-up-window' group
+ (let ((fun (unless (eq split-window-preferred-function
+ 'split-window-sensibly)
+ split-window-preferred-function))
+ (min-height
+ (if (numberp split-height-threshold)
+ (/ split-height-threshold 2)
+ 1.0))
+ (min-width
+ (if (numberp split-width-threshold)
+ (/ split-width-threshold 2)
+ 1.0)))
+ (display-buffer-alist-add
+ nil
+ (list
+ 'pop-up-window
+ ;; `pop-up-window'
+ (when pop-up-windows
+ (list 'pop-up-window (cons 'largest fun) (cons 'lru fun)))
+ ;; `pop-up-window-min-height'
+ (cons 'pop-up-window-min-height min-height)
+ ;; `pop-up-window-min-width'
+ (cons 'pop-up-window-min-width min-width))
+ no-custom))
+
+ ;; `pop-up-frame' group
+ (when (or pop-up-frames
+ (not (equal pop-up-frame-function
+ '(lambda nil
+ (make-frame pop-up-frame-alist))))
+ pop-up-frame-alist)
+ (display-buffer-alist-add
+ nil
+ (list
+ 'pop-up-frame
+ (when pop-up-frames
+ ;; `pop-up-frame'
+ (list 'pop-up-frame
+ (when (eq pop-up-frames 'graphic-only)
+ t)))
+ (unless (equal pop-up-frame-function
+ '(lambda nil
+ (make-frame pop-up-frame-alist)))
+ ;; `pop-up-frame-function'
+ (cons 'pop-up-frame-function pop-up-frame-function))
+ (when pop-up-frame-alist
+ ;; `pop-up-frame-alist'
+ (cons 'pop-up-frame-alist pop-up-frame-alist)))
+ no-custom))
;; `special-display-regexps'
- (dolist (entry special-display-regexps)
- (cond
- ((stringp entry)
- ;; Plain string.
- (display-buffer-alist-add
- `((regexp . ,entry))
- (list
- 'function
- (list 'function special-display-function
- special-display-frame-alist))
- no-custom))
- ((consp entry)
- (let ((name (car entry))
- (rest (cdr entry)))
- (cond
- ((functionp (car rest))
- ;; A function.
- (display-buffer-alist-add
- `((name . ,name))
- (list
- 'function
- ;; Weary.
- (list 'function (car rest) (cadr rest)))
- no-custom))
- ((listp rest)
- ;; A list of parameters.
- (cond
- ((assq 'same-window rest)
- (display-buffer-alist-add
- `((name . ,name))
- (list 'reuse-window
- (list 'reuse-window 'same)
- (list 'reuse-window-dedicated 'weak))
- no-custom))
- ((assq 'same-frame rest)
- (display-buffer-alist-add
- `((name . ,name)) (list 'same-frame) no-custom))
- (t
- (display-buffer-alist-add
- `((name . ,name))
- (list
- 'function
- (list 'function special-display-function
- special-display-frame-alist))
- no-custom)))))))))
+ (if (display-buffer-alist-of-strings-p special-display-regexps)
+ ;; Handle case where `special-display-regexps' is a plain list
+ ;; of strings specially.
+ (let (list)
+ (dolist (regexp special-display-regexps)
+ (setq list (cons (cons 'regexp regexp) list)))
+ (setq list (nreverse list))
+ (display-buffer-alist-add
+ list (display-buffer-alist-set-1) no-custom))
+ ;; Else iterate over the entries.
+ (dolist (item special-display-regexps)
+ (if (stringp item)
+ (display-buffer-alist-add
+ `((regexp . ,item)) (display-buffer-alist-set-1)
+ no-custom)
+ (display-buffer-alist-add
+ `((regexp . ,(car item)))
+ (display-buffer-alist-set-2 (cdr item))
+ no-custom))))
;; `special-display-buffer-names'
- (dolist (entry special-display-buffer-names)
- (cond
- ((stringp entry)
- ;; Plain string.
- (display-buffer-alist-add
- `((name . ,entry))
- (list
- 'function
- (list 'function special-display-function
- special-display-frame-alist))
- no-custom))
- ((consp entry)
- (let ((name (car entry))
- (rest (cdr entry)))
- (cond
- ((functionp (car rest))
- ;; A function.
- (display-buffer-alist-add
- `((name . ,name))
- (list
- 'function
- ;; Weary.
- (list 'function (car rest) (cadr rest)))
- no-custom))
- ((listp rest)
- ;; A list of parameters.
- (cond
- ((assq 'same-window rest)
- (display-buffer-alist-add
- `((name . ,name))
- (list 'reuse-window
- (list 'reuse-window 'same)
- (list 'reuse-window-dedicated 'weak))
- no-custom))
- ((assq 'same-frame rest)
- (display-buffer-alist-add
- `((name . ,name)) (list 'same-frame) no-custom))
- (t
- (display-buffer-alist-add
- `((name . ,name))
- (list
- 'function
- (list 'function special-display-function
- special-display-frame-alist))
- no-custom)))))))))
+ (if (display-buffer-alist-of-strings-p special-display-buffer-names)
+ ;; Handle case where `special-display-buffer-names' is a plain
+ ;; list of strings specially.
+ (let (list)
+ (dolist (name special-display-buffer-names)
+ (setq list (cons (cons 'name name) list)))
+ (setq list (nreverse list))
+ (display-buffer-alist-add
+ list (display-buffer-alist-set-1) no-custom))
+ ;; Else iterate over the entries.
+ (dolist (item special-display-buffer-names)
+ (if (stringp item)
+ (display-buffer-alist-add
+ `((name . ,item)) (display-buffer-alist-set-1)
+ no-custom)
+ (display-buffer-alist-add
+ `((name . ,(car item)))
+ (display-buffer-alist-set-2 (cdr item))
+ no-custom))))
;; `same-window-regexps'
- (dolist (entry same-window-regexps)
- (cond
- ((stringp entry)
- (display-buffer-alist-add
- `((regexp . ,entry))
- (list 'reuse-window (list 'reuse-window 'same))
- no-custom))
- ((consp entry)
+ (if (display-buffer-alist-of-strings-p same-window-regexps)
+ ;; Handle case where `same-window-regexps' is a plain list of
+ ;; strings specially.
+ (let (list)
+ (dolist (regexp same-window-regexps)
+ (setq list (cons (cons 'regexp regexp) list)))
+ (setq list (nreverse list))
+ (display-buffer-alist-add
+ list '(reuse-window (reuse-window same nil nil)) no-custom))
+ (dolist (entry same-window-regexps)
(display-buffer-alist-add
- `((regexp . ,(car entry)))
- (list 'reuse-window (list 'reuse-window 'same))
- no-custom))))
+ `((regexp . ,(if (stringp entry) entry (car entry))))
+ '(reuse-window (reuse-window same nil nil)) no-custom)))
;; `same-window-buffer-names'
- (dolist (entry same-window-buffer-names)
- (cond
- ((stringp entry)
+ (if (display-buffer-alist-of-strings-p same-window-buffer-names)
+ ;; Handle case where `same-window-buffer-names' is a plain list
+ ;; of strings specially.
+ (let (list)
+ (dolist (name same-window-buffer-names)
+ (setq list (cons (cons 'name name) list)))
+ (setq list (nreverse list))
+ (display-buffer-alist-add
+ list '(reuse-window (reuse-window same nil nil)) no-custom))
+ (dolist (entry same-window-buffer-names)
(display-buffer-alist-add
- `((name . ,entry))
- (list 'reuse-window (list 'reuse-window 'same))
- no-custom))
- ((consp entry)
- (display-buffer-alist-add
- `((name . ,(car entry)))
- (list 'reuse-window (list 'reuse-window 'same))
- no-custom))))
+ `((name . ,(if (stringp entry) entry (car entry))))
+ '(reuse-window (reuse-window same nil nil)) no-custom)))
;; `reuse-window'
(display-buffer-alist-add
- nil
- (list
- 'reuse-window
- (list 'reuse-window nil 'same
- (when (or display-buffer-reuse-frames pop-up-frames)
- ;; "0" (all visible and iconified frames) is hardcoded in
- ;; Emacs 23.
- 0))
- (when even-window-heights
- (cons 'reuse-window-even-sizes t)))
+ nil `(reuse-window
+ (reuse-window
+ nil same
+ ,(when (or display-buffer-reuse-frames pop-up-frames)
+ ;; "0" (all visible and iconified frames) is
+ ;; hardcoded in Emacs 23.
+ 0)))
no-custom)
- ;; `display-buffer-mark-dedicated'
- (when display-buffer-mark-dedicated
- (display-buffer-alist-add
- nil
- (list
- (cons 'dedicate display-buffer-mark-dedicated))
- no-custom)))
-
- display-buffer-alist)
+ display-buffer-alist))
(defun set-window-text-height (window height)
"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 @@
(gs_load): Use printmax_t to print the widest integers possible.
Check for integer overflow when computing image height and width.
+2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
+
Integer signedness and overflow and related fixes. (Bug#9079)
* bidi.c: Integer size and overflow fixes.
@@ -303,6 +305,24 @@
Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
well either way, and we prefer signed to unsigned.
+2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ Port to OpenBSD.
+ See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
+ and the surrounding thread.
+ * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
+ rather than fgets, and retry after EINTR. Otherwise, 'emacs
+ --batch -f byte-compile-file' fails on OpenBSD if an inactivity
+ timer goes off.
+ * s/openbsd.h (BROKEN_SIGIO): Define.
+ * unexelf.c (unexec) [__OpenBSD__]:
+ Don't update the .mdebug section of the Alpha COFF symbol table.
+
+2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
+ (bug#8460).
+
2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
* 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'. */);
Qlexical_binding = intern ("lexical-binding");
staticpro (&Qlexical_binding);
DEFVAR_LISP ("lexical-binding", Vlexical_binding,
- doc: /* If non-nil, use lexical binding when evaluating code.
-This applies to code evaluated by `eval-buffer' and `eval-region' and
-other commands that call these functions, like `eval-defun' and
-the like.
+ doc: /* Whether to use lexical binding when evaluating code.
+Non-nil means that the code in the current buffer should be evaluated
+with lexical binding.
This variable is automatically set from the file variables of an
interpreted Lisp file read using `load'. */);
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/>. */
#include <config.h>
+#include <errno.h>
#include <stdio.h>
#include <setjmp.h>
@@ -236,8 +237,9 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
int allow_props, int inherit_input_method)
{
ptrdiff_t size, len;
- char *line, *s;
+ char *line;
Lisp_Object val;
+ int c;
fprintf (stdout, "%s", SDATA (prompt));
fflush (stdout);
@@ -246,22 +248,30 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
size = 100;
len = 0;
line = (char *) xmalloc (size);
- while ((s = fgets (line + len, size - len, stdin)) != NULL
- && (len = strlen (line),
- len == size - 1 && line[len - 1] != '\n'))
+
+ while ((c = getchar ()) != '\n')
{
- if (STRING_BYTES_BOUND / 2 < size)
- memory_full (SIZE_MAX);
- size *= 2;
- line = (char *) xrealloc (line, size);
+ if (c < 0)
+ {
+ if (errno != EINTR)
+ break;
+ }
+ else
+ {
+ if (len == size)
+ {
+ if (STRING_BYTES_BOUND / 2 < size)
+ memory_full (SIZE_MAX);
+ size *= 2;
+ line = (char *) xrealloc (line, size);
+ }
+ line[len++] = c;
+ }
}
- if (s)
+ if (len)
{
- char *nl = strchr (line, '\n');
- if (nl)
- *nl = '\0';
- val = build_string (line);
+ val = make_string (line, len);
xfree (line);
}
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 @@
/* System file for openbsd. */
-/* The same as NetBSD. Note there are differences in configure. */
+/* Nearly the same as NetBSD. Note there are differences in configure. */
#include "netbsd.h"
+/* The symbol SIGIO is defined, but the feature doesn't work in the
+ way Emacs needs it to. See
+ <http://article.gmane.org/gmane.os.openbsd.ports/46831>. */
+#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:
memcpy (NEW_SECTION_H (nn).sh_offset + new_base, src,
NEW_SECTION_H (nn).sh_size);
-#ifdef __alpha__
+#if defined __alpha__ && !defined __OpenBSD__
/* Update Alpha COFF symbol table: */
if (strcmp (old_section_names + OLD_SECTION_H (n).sh_name, ".mdebug")
== 0)
@@ -1072,7 +1072,7 @@ temacs:
symhdr->cbRfdOffset += new_data2_size;
symhdr->cbExtOffset += new_data2_size;
}
-#endif /* __alpha__ */
+#endif /* __alpha__ && !__OpenBSD__ */
#if defined (_SYSTYPE_SYSV)
if (NEW_SECTION_H (nn).sh_type == SHT_MIPS_DEBUG