summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-02-14 22:35:54 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2013-02-14 22:35:54 -0800
commit648e5523fbfc3dfbce58f66437112bc442470c87 (patch)
tree6ead7871ba1026168c7f7c4d1f4cffa5241f864b
parentdec2a322921d74de8f251a54931d4c50ab00713d (diff)
parent974c7646ec5b2985a50007c9d599154d667df349 (diff)
downloademacs-648e5523fbfc3dfbce58f66437112bc442470c87.tar.gz
Merge from emacs-24; up to 2012-12-19T13:01:16Z!michael.albinus@gmx.de
-rw-r--r--ChangeLog5
-rw-r--r--configure.ac5
-rw-r--r--doc/lispref/ChangeLog4
-rw-r--r--doc/lispref/modes.texi5
-rw-r--r--lisp/ChangeLog27
-rw-r--r--lisp/emacs-lisp/easy-mmode.el15
-rw-r--r--lisp/net/goto-addr.el23
-rw-r--r--lisp/progmodes/python.el129
-rw-r--r--lisp/xml.el4
-rw-r--r--src/ChangeLog20
-rw-r--r--src/lisp.h4
-rw-r--r--src/w32.c21
-rw-r--r--src/w32proc.c27
13 files changed, 204 insertions, 85 deletions
diff --git a/ChangeLog b/ChangeLog
index 6a90eb178f5..9db5d2c3f39 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix AIX port (Bug#13650).
+ * configure.ac (DATA_START, DATA_SEG_BITS): Set to 0x20000000 on AIX.
+
2013-02-12 Eli Zaretskii <eliz@gnu.org>
* lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/memrchr.$(O).
diff --git a/configure.ac b/configure.ac
index e751dc1a3c6..3b1b9a92b54 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3750,6 +3750,11 @@ case $opsys in
AC_DEFINE(DATA_START, [({ extern int data_start; (char *) &data_start; })])
;;
+ aix*)
+ dnl This works with 32-bit executables; Emacs doesn't support 64-bit.
+ AC_DEFINE(DATA_START, [0x20000000])
+ AC_DEFINE(DATA_SEG_BITS, [0x20000000])
+ ;;
hpux*)
dnl The data segment on this machine always starts at address 0x40000000.
AC_DEFINE(DATA_START, [0x40000000])
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index be1bdfcfa3d..ffda87384b5 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,7 @@
+2013-02-14 Glenn Morris <rgm@gnu.org>
+
+ * modes.texi (Basic Major Modes): 'z' no longer bound in special-mode.
+
2013-02-13 Glenn Morris <rgm@gnu.org>
* objects.texi (Char-Table Type): Add footnote about #^^.
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 5f1eb8619ee..7d42d2591d6 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -905,9 +905,8 @@ modes derived from Special mode are given a @code{mode-class} property
of @code{special} (@pxref{Major Mode Conventions}).
Special mode sets the buffer to read-only. Its keymap defines several
-common bindings, including @kbd{q} for @code{quit-window}, @kbd{z} for
-@code{kill-this-buffer}, and @kbd{g} for @code{revert-buffer}
-(@pxref{Reverting}).
+common bindings, including @kbd{q} for @code{quit-window} and @kbd{g}
+for @code{revert-buffer} (@pxref{Reverting}).
An example of a major mode derived from Special mode is Buffer Menu
mode, which is used by the @file{*Buffer List*} buffer. @xref{List
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9172866b49c..9cc086ffe6e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,30 @@
+2013-02-15 Michael Albinus <michael.albinus@gmx.de>
+
+ * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix.
+
+2013-02-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * net/goto-addr.el (goto-address-fontify): Add start and end args.
+ (goto-address-fontify-region): Use them instead of narrowing, so
+ syntax-ppss has access to the whole buffer.
+
+2013-02-15 Fabián Ezequiel Gallina <fgallina@cuca>
+
+ * progmodes/python.el: Explain how to restore "cc-mode"-like
+ forward-sexp movement in header documentation (Bug#13642).
+ (python-nav--forward-sexp): Behave like emacs-lisp-mode in
+ comments and strings (GH bug 114).
+
+2013-02-15 Fabián Ezequiel Gallina <fgallina@cuca>
+
+ * progmodes/python.el (python-info-current-defun): Fix current
+ defun detection (Bug#13618).
+
+2013-02-15 Chong Yidong <cyd@gnu.org>
+
+ * xml.el (xml-parse-string): Fix typo in handling of bad character
+ references.
+
2013-02-15 Glenn Morris <rgm@gnu.org>
* play/fortune.el (fortune-compile): Simplify and fix previous change.
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 9173d148c6a..166c093f37b 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -132,13 +132,14 @@ BODY contains code to execute each time the mode is enabled or disabled.
:require SYM Same as in `defcustom'.
:variable PLACE The location to use instead of the variable MODE to store
the state of the mode. This can be simply a different
- named variable, or more generally anything that can be used
- with the CL macro `setf'. PLACE can also be of the form
- \(GET . SET), where GET is an expression that returns the
- current state, and SET is a function that takes one argument,
- the new state, and sets it. If you specify a :variable,
- this function does not define a MODE variable (nor any of
- the terms used in :variable).
+ named variable, or a generalized variable.
+ PLACE can also be of the form \(GET . SET), where GET is
+ an expression that returns the current state, and SET is
+ a function that takes one argument, the new state, and
+ sets it. If you specify a :variable, this function does
+ not define a MODE variable (nor any of the terms used
+ in :variable).
+
:after-hook A single lisp form which is evaluated after the mode hooks
have been run. It should not be quoted.
diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el
index 1005285917e..59e4da16619 100644
--- a/lisp/net/goto-addr.el
+++ b/lisp/net/goto-addr.el
@@ -156,18 +156,19 @@ A value of t means there is no limit--fontify regardless of the size."
(defvar goto-address-prog-mode)
-(defun goto-address-fontify ()
+(defun goto-address-fontify (&optional start end)
"Fontify the URLs and e-mail addresses in the current buffer.
This function implements `goto-address-highlight-p'
and `goto-address-fontify-p'."
;; Clean up from any previous go.
- (goto-address-unfontify (point-min) (point-max))
+ (goto-address-unfontify (or start (point-min)) (or end (point-max)))
(save-excursion
(let ((inhibit-point-motion-hooks t))
- (goto-char (point-min))
+ (goto-char (or start (point-min)))
(when (or (eq t goto-address-fontify-maximum-size)
- (< (- (point-max) (point)) goto-address-fontify-maximum-size))
- (while (re-search-forward goto-address-url-regexp nil t)
+ (< (- (or end (point-max)) (point))
+ goto-address-fontify-maximum-size))
+ (while (re-search-forward goto-address-url-regexp end t)
(let* ((s (match-beginning 0))
(e (match-end 0))
this-overlay)
@@ -187,8 +188,8 @@ and `goto-address-fontify-p'."
(overlay-put this-overlay
'keymap goto-address-highlight-keymap)
(overlay-put this-overlay 'goto-address t))))
- (goto-char (point-min))
- (while (re-search-forward goto-address-mail-regexp nil t)
+ (goto-char (or start (point-min)))
+ (while (re-search-forward goto-address-mail-regexp end t)
(let* ((s (match-beginning 0))
(e (match-end 0))
this-overlay)
@@ -212,11 +213,9 @@ and `goto-address-fontify-p'."
(defun goto-address-fontify-region (start end)
"Fontify URLs and e-mail addresses in the given region."
(save-excursion
- (save-restriction
- (let ((beg-line (progn (goto-char start) (line-beginning-position)))
- (end-line (progn (goto-char end) (line-end-position))))
- (narrow-to-region beg-line end-line)
- (goto-address-fontify)))))
+ (let ((beg-line (progn (goto-char start) (line-beginning-position)))
+ (end-line (progn (goto-char end) (line-end-position))))
+ (goto-address-fontify beg-line end-line))))
;; code to find and goto addresses; much of this has been blatantly
;; snarfed from browse-url.el
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 35c5ba19e33..eadb06fa61e 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -54,8 +54,13 @@
;; `python-nav-beginning-of-statement', `python-nav-end-of-statement',
;; `python-nav-beginning-of-block' and `python-nav-end-of-block' are
;; included but no bound to any key. At last but not least the
-;; specialized `python-nav-forward-sexp' allows easy
-;; navigation between code blocks.
+;; specialized `python-nav-forward-sexp' allows easy navigation
+;; between code blocks. If you prefer `cc-mode'-like `forward-sexp'
+;; movement, setting `forward-sexp-function' to nil is enough, You can
+;; do that using the `python-mode-hook':
+
+;; (add-hook 'python-mode-hook
+;; (lambda () (setq forward-sexp-function nil)))
;; Shell interaction: is provided and allows you to execute easily any
;; block of code of your current buffer in an inferior Python process.
@@ -1349,13 +1354,10 @@ backwards."
're-search-backward))
(context-type (python-syntax-context-type)))
(cond
- ((eq context-type 'string)
+ ((memq context-type '(string comment))
;; Inside of a string, get out of it.
- (while (and (funcall re-search-fn "[\"']" nil t)
- (python-syntax-context 'string))))
- ((eq context-type 'comment)
- ;; Inside of a comment, just move forward.
- (python-util-forward-comment dir))
+ (let ((forward-sexp-function))
+ (forward-sexp dir)))
((or (eq context-type 'paren)
(and forward-p (looking-at (python-rx open-paren)))
(and (not forward-p)
@@ -1378,16 +1380,16 @@ backwards."
(save-excursion
(python-nav-lisp-forward-sexp-safe dir)
(point)))
- (next-sexp-context
- (save-excursion
- (goto-char next-sexp-pos)
- (cond
- ((python-info-beginning-of-block-p) 'block-start)
- ((python-info-end-of-block-p) 'block-end)
- ((python-info-beginning-of-statement-p) 'statement-start)
- ((python-info-end-of-statement-p) 'statement-end)
- ((python-info-statement-starts-block-p) 'starts-block)
- ((python-info-statement-ends-block-p) 'ends-block)))))
+ (next-sexp-context
+ (save-excursion
+ (goto-char next-sexp-pos)
+ (cond
+ ((python-info-beginning-of-block-p) 'block-start)
+ ((python-info-end-of-block-p) 'block-end)
+ ((python-info-beginning-of-statement-p) 'statement-start)
+ ((python-info-end-of-statement-p) 'statement-end)
+ ((python-info-statement-starts-block-p) 'starts-block)
+ ((python-info-statement-ends-block-p) 'ends-block)))))
(if forward-p
(cond ((and (not (eobp))
(python-info-current-line-empty-p))
@@ -1411,8 +1413,8 @@ backwards."
(t (goto-char next-sexp-pos)))
(cond ((and (not (bobp))
(python-info-current-line-empty-p))
- (python-util-forward-comment dir)
- (python-nav--forward-sexp dir))
+ (python-util-forward-comment dir)
+ (python-nav--forward-sexp dir))
((eq context 'block-end)
(python-nav-beginning-of-block))
((eq context 'statement-end)
@@ -2946,40 +2948,61 @@ Optional argument INCLUDE-TYPE indicates to include the type of the defun.
This function is compatible to be used as
`add-log-current-defun-function' since it returns nil if point is
not inside a defun."
- (save-restriction
- (widen)
- (save-excursion
- (end-of-line 1)
- (let ((names)
- (starting-indentation
- (save-excursion
- (and
- (python-nav-beginning-of-defun 1)
- ;; This extra number is just for checking code
- ;; against indentation to work well on first run.
- (+ (current-indentation) 4))))
- (starting-point (point)))
- ;; Check point is inside a defun.
- (when (and starting-indentation
- (< starting-point
+ (save-restriction
+ (widen)
+ (save-excursion
+ (end-of-line 1)
+ (let ((names)
+ (starting-indentation (current-indentation))
+ (starting-pos (point))
+ (first-run t)
+ (last-indent)
+ (type))
+ (catch 'exit
+ (while (python-nav-beginning-of-defun 1)
+ (when (and
+ (or (not last-indent)
+ (< (current-indentation) last-indent))
+ (or
+ (and first-run
(save-excursion
- (python-nav-end-of-defun)
- (point))))
- (catch 'exit
- (while (python-nav-beginning-of-defun 1)
- (when (< (current-indentation) starting-indentation)
- (setq starting-indentation (current-indentation))
- (setq names
- (cons
- (if (not include-type)
- (match-string-no-properties 1)
- (mapconcat 'identity
- (split-string
- (match-string-no-properties 0)) " "))
- names)))
- (and (= (current-indentation) 0) (throw 'exit t)))))
- (and names
- (mapconcat (lambda (string) string) names "."))))))
+ ;; If this is the first run, we may add
+ ;; the current defun at point.
+ (setq first-run nil)
+ (goto-char starting-pos)
+ (python-nav-beginning-of-statement)
+ (beginning-of-line 1)
+ (looking-at-p
+ python-nav-beginning-of-defun-regexp)))
+ (< starting-pos
+ (save-excursion
+ (let ((min-indent
+ (+ (current-indentation)
+ python-indent-offset)))
+ (if (< starting-indentation min-indent)
+ ;; If the starting indentation is not
+ ;; within the min defun indent make the
+ ;; check fail.
+ starting-pos
+ ;; Else go to the end of defun and add
+ ;; up the current indentation to the
+ ;; ending position.
+ (python-nav-end-of-defun)
+ (+ (point)
+ (if (>= (current-indentation) min-indent)
+ (1+ (current-indentation))
+ 0))))))))
+ (setq last-indent (current-indentation))
+ (if (or (not include-type) type)
+ (setq names (cons (match-string-no-properties 1) names))
+ (let ((match (split-string (match-string-no-properties 0))))
+ (setq type (car match))
+ (setq names (cons (cadr match) names)))))
+ ;; Stop searching ASAP.
+ (and (= (current-indentation) 0) (throw 'exit t))))
+ (and names
+ (concat (and type (format "%s " type))
+ (mapconcat 'identity names ".")))))))
(defun python-info-current-symbol (&optional replace-self)
"Return current symbol using dotty syntax.
diff --git a/lisp/xml.el b/lisp/xml.el
index 2232746f02a..a3d34670bfb 100644
--- a/lisp/xml.el
+++ b/lisp/xml.el
@@ -611,7 +611,7 @@ references."
xml-validating-parser
(error "XML: (Validity) Invalid character reference `%s'"
(match-string 0)))
- (replace-match (or (string val) xml-undefined-entity) t t))
+ (replace-match (if val (string val) xml-undefined-entity) t t))
;; For an entity reference, search again from the start of
;; the replaced text, since the replacement can contain
;; entity or character references, or markup.
@@ -620,7 +620,7 @@ references."
(and (null val)
xml-validating-parser
(error "XML: (Validity) Undefined entity `%s'" ref))
- (replace-match (cdr val) t t)
+ (replace-match (or (cdr val) xml-undefined-entity) t t)
(goto-char (match-beginning 0)))
;; Check for XML bombs.
(and xml-entity-expansion-limit
diff --git a/src/ChangeLog b/src/ChangeLog
index 8b1c429e406..00cb40df9e6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,23 @@
+2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix AIX port (Bug#13650).
+ * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
+ Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
+ was #undeffed earlier, so it cannot be used as a macro here.
+ Use the constant and not the macro.
+
+2013-02-15 Eli Zaretskii <eliz@gnu.org>
+
+ * w32proc.c (new_child): If no vacant slots are found in
+ child_procs[], make another pass looking for slots whose process
+ has exited or died. (Bug#13546)
+
+ * w32.c (sys_pipe): When failing due to file descriptors above
+ MAXDESC, set errno to EMFILE.
+ (_sys_read_ahead): Update cp->status when failing to read serial
+ communications input, so that the status doesn't stay at
+ STATUS_READ_IN_PROGRESS. (Bug#13546)
+
2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
* gtkutil.c (tb_size_cb): New function.
diff --git a/src/lisp.h b/src/lisp.h
index 37d2b45e85b..da1531cc1be 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -505,13 +505,9 @@ static EMACS_INT const VALMASK
(XIL ((EMACS_INT) ((EMACS_UINT) (type) << VALBITS) \
+ ((intptr_t) (ptr) & VALMASK)))
-#if DATA_SEG_BITS
/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers
which were stored in a Lisp_Object. */
#define XPNTR(a) ((uintptr_t) ((XLI (a) & VALMASK)) | DATA_SEG_BITS))
-#else
-#define XPNTR(a) ((uintptr_t) (XLI (a) & VALMASK))
-#endif
#endif /* not USE_LSB_TAG */
diff --git a/src/w32.c b/src/w32.c
index 8b89bd3e660..03e65bf9431 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -6800,6 +6800,7 @@ sys_pipe (int * phandles)
{
_close (phandles[0]);
_close (phandles[1]);
+ errno = EMFILE;
rc = -1;
}
else
@@ -6873,19 +6874,31 @@ _sys_read_ahead (int fd)
/* Configure timeouts for blocking read. */
if (!GetCommTimeouts (hnd, &ct))
- return STATUS_READ_ERROR;
+ {
+ cp->status = STATUS_READ_ERROR;
+ return STATUS_READ_ERROR;
+ }
ct.ReadIntervalTimeout = 0;
ct.ReadTotalTimeoutMultiplier = 0;
ct.ReadTotalTimeoutConstant = 0;
if (!SetCommTimeouts (hnd, &ct))
- return STATUS_READ_ERROR;
+ {
+ cp->status = STATUS_READ_ERROR;
+ return STATUS_READ_ERROR;
+ }
if (!ReadFile (hnd, &cp->chr, sizeof (char), (DWORD*) &rc, ovl))
{
if (GetLastError () != ERROR_IO_PENDING)
- return STATUS_READ_ERROR;
+ {
+ cp->status = STATUS_READ_ERROR;
+ return STATUS_READ_ERROR;
+ }
if (!GetOverlappedResult (hnd, ovl, (DWORD*) &rc, TRUE))
- return STATUS_READ_ERROR;
+ {
+ cp->status = STATUS_READ_ERROR;
+ return STATUS_READ_ERROR;
+ }
}
}
else if (fd_info[fd].flags & FILE_SOCKET)
diff --git a/src/w32proc.c b/src/w32proc.c
index 8bf57602927..ce1474c7323 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -803,6 +803,33 @@ new_child (void)
if (!CHILD_ACTIVE (cp) && cp->procinfo.hProcess == NULL)
goto Initialize;
if (child_proc_count == MAX_CHILDREN)
+ {
+ DebPrint (("new_child: No vacant slots, looking for dead processes\n"));
+ for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--)
+ if (!CHILD_ACTIVE (cp) && cp->procinfo.hProcess)
+ {
+ DWORD status = 0;
+
+ if (!GetExitCodeProcess (cp->procinfo.hProcess, &status))
+ {
+ DebPrint (("new_child.GetExitCodeProcess: error %lu for PID %lu\n",
+ GetLastError (), cp->procinfo.dwProcessId));
+ status = STILL_ACTIVE;
+ }
+ if (status != STILL_ACTIVE
+ || WaitForSingleObject (cp->procinfo.hProcess, 0) == WAIT_OBJECT_0)
+ {
+ DebPrint (("new_child: Freeing slot of dead process %d\n",
+ cp->procinfo.dwProcessId));
+ CloseHandle (cp->procinfo.hProcess);
+ cp->procinfo.hProcess = NULL;
+ CloseHandle (cp->procinfo.hThread);
+ cp->procinfo.hThread = NULL;
+ goto Initialize;
+ }
+ }
+ }
+ if (child_proc_count == MAX_CHILDREN)
return NULL;
cp = &child_procs[child_proc_count++];