emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110876: Merge from emacs-24; up to r


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110876: Merge from emacs-24; up to r110855
Date: Mon, 12 Nov 2012 18:25:59 -0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110876 [merge]
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Mon 2012-11-12 18:25:59 -0800
message:
  Merge from emacs-24; up to r110855
modified:
  doc/emacs/ChangeLog
  doc/emacs/building.texi
  doc/emacs/misc.texi
  doc/lispref/ChangeLog
  doc/lispref/control.texi
  doc/lispref/debugging.texi
  doc/lispref/errors.texi
  doc/lispref/variables.texi
  doc/misc/ChangeLog
  doc/misc/flymake.texi
  etc/NEWS
  lisp/ChangeLog
  lisp/ansi-color.el
  lisp/cedet/ChangeLog
  lisp/cedet/semantic/grammar.el
  lisp/cedet/semantic/mru-bookmark.el
  lisp/cedet/semantic/util-modes.el
  lisp/cedet/srecode/srt-mode.el
  lisp/emacs-lisp/debug.el
  lisp/emacs-lisp/gv.el
  lisp/help.el
  lisp/ibuffer.el
  lisp/progmodes/flymake.el
  lisp/progmodes/python.el
  lisp/progmodes/ruby-mode.el
  lisp/window.el
  src/ChangeLog
  src/xdisp.c
  test/automated/ruby-mode-tests.el
=== modified file 'doc/emacs/ChangeLog'
--- a/doc/emacs/ChangeLog       2012-11-10 23:13:33 +0000
+++ b/doc/emacs/ChangeLog       2012-11-13 02:25:59 +0000
@@ -1,3 +1,12 @@
+2012-11-13  Chong Yidong  <address@hidden>
+
+       * building.texi (Multithreaded Debugging): gdb-stopped-hooks is
+       actually named gdb-stopped-functions.
+
+2012-11-13  Glenn Morris  <address@hidden>
+
+       * misc.texi (Single Shell): Mention async-shell-command-buffer.
+
 2012-11-10  Glenn Morris  <address@hidden>
 
        * misc.texi (Terminal emulator): Rename `term-face' to `term'.

=== modified file 'doc/emacs/building.texi'
--- a/doc/emacs/building.texi   2012-10-27 05:03:52 +0000
+++ b/doc/emacs/building.texi   2012-11-12 19:54:37 +0000
@@ -1244,8 +1244,8 @@
 @code{gdb-switch-reasons} to select the stop reasons which will cause
 a thread switch.
 
address@hidden gdb-stopped-hooks
-  The variable @code{gdb-stopped-hooks} allows you to execute your
address@hidden gdb-stopped-functions
+  The variable @code{gdb-stopped-functions} allows you to execute your
 functions whenever some thread stops.
 
   In non-stop mode, you can switch between different modes for GUD

=== modified file 'doc/emacs/misc.texi'
--- a/doc/emacs/misc.texi       2012-11-10 01:40:48 +0000
+++ b/doc/emacs/misc.texi       2012-11-12 08:18:38 +0000
@@ -542,11 +542,19 @@
 You can also type @kbd{M-&} (@code{async-shell-command}) to execute a
 shell command asynchronously; this is exactly like calling @kbd{M-!}
 with a trailing @samp{&}, except that you do not need the @samp{&}.
-The output buffer for asynchronous shell commands is named
+The default output buffer for asynchronous shell commands is named
 @samp{*Async Shell Command*}.  Emacs inserts the output into this
 buffer as it comes in, whether or not the buffer is visible in a
 window.
 
address@hidden async-shell-command-buffer
+  If you want to run more than one asynchronous shell command at the
+same time, they could end up competing for the output buffer.  The
+option @code{async-shell-command-buffer} specifies what to do about
+this; e.g., whether to rename the pre-existing output buffer, or to
+use a different buffer for the new command.  Consult the variable's
+documentation for more possibilities.
+
 @kindex M-|
 @findex shell-command-on-region
   @kbd{M-|} (@code{shell-command-on-region}) is like @kbd{M-!}, but

=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog     2012-11-10 23:13:33 +0000
+++ b/doc/lispref/ChangeLog     2012-11-13 02:25:59 +0000
@@ -1,3 +1,18 @@
+2012-11-13  Glenn Morris  <address@hidden>
+
+       * variables.texi (Adding Generalized Variables):
+       At least mention gv-define-expander and gv-letplace.
+
+       * debugging.texi (Error Debugging): Mention debug-on-message.
+       (Using Debugger): Mention debugger-bury-or-kill.
+
+       * control.texi (Signaling Errors):
+       * debugging.texi (Error Debugging):
+       * errors.texi (Standard Errors): Add user-error.
+
+       * variables.texi (Adding Generalized Variables):
+       Use standard formatting for common lisp note about setf functions.
+
 2012-11-10  Martin Rudalics  <address@hidden>
 
        * elisp.texi (Top): Add Recombining Windows to menu.

=== modified file 'doc/lispref/control.texi'
--- a/doc/lispref/control.texi  2012-10-31 21:00:57 +0000
+++ b/doc/lispref/control.texi  2012-11-11 00:37:40 +0000
@@ -824,6 +824,19 @@
 @end example
 @end defun
 
address@hidden user errors, signaling
address@hidden user-error format-string &rest args
+This function behaves exactly like @code{error}, except that it uses
+the error symbol @code{user-error} rather than @code{error}.  As the
+name suggests, this is intended to report errors on the part of the
+user, rather than errors in the code itself.  For example,
+if you try to use the command @code{Info-history-back} (@kbd{l}) to
+move back beyond the start of your Info browsing history, Emacs
+signals a @code{user-error}.  Such errors do not cause entry to the
+debugger, even when @code{debug-on-error} is address@hidden
address@hidden Debugging}.
address@hidden defun
+
 @cindex CL note---no continuable errors
 @quotation
 @b{Common Lisp note:} Emacs Lisp has nothing like the Common Lisp

=== modified file 'doc/lispref/debugging.texi'
--- a/doc/lispref/debugging.texi        2012-09-21 03:03:48 +0000
+++ b/doc/lispref/debugging.texi        2012-11-11 01:16:25 +0000
@@ -117,12 +117,12 @@
 any of the regular expressions, then that error does not enter the
 debugger.
 
-The normal value of this variable lists several errors that happen
-often during editing but rarely result from bugs in Lisp programs.
-However, ``rarely'' is not ``never''; if your program fails with an
-error that matches this list, you may try changing this list to debug
-the error.  The easiest way is usually to set
address@hidden to @code{nil}.
+The normal value of this variable includes @code{user-error}, as well
+as several errors that happen often during editing but rarely result
+from bugs in Lisp programs.  However, ``rarely'' is not ``never''; if
+your program fails with an error that matches this list, you may try
+changing this list to debug the error.  The easiest way is usually to
+set @code{debug-ignored-errors} to @code{nil}.
 @end defopt
 
 @defopt eval-expression-debug-on-error
@@ -163,6 +163,14 @@
 @code{inhibit-quit} is set and Emacs is not otherwise responding.
 @end defopt
 
address@hidden message, finding what causes a particular message
address@hidden debug-on-message
+If you set @code{debug-on-message} to a regular expression,
+Emacs will enter the debugger if it displays a matching message in the
+echo area.  For example, this can be useful when trying to find the
+cause of a particular message.
address@hidden defvar
+
   To debug an error that happens during loading of the init
 file, use the option @samp{--debug-init}.  This binds
 @code{debug-on-error} to @code{t} while loading the init file, and
@@ -314,6 +322,7 @@
 as the error message and associated data, if it was invoked due to an
 error).
 
address@hidden debugger-bury-or-kill
   The backtrace buffer is read-only and uses a special major mode,
 Debugger mode, in which letters are defined as debugger commands.  The
 usual Emacs editing commands are available; thus, you can switch windows
@@ -322,8 +331,12 @@
 the debugger is a recursive editing level (@pxref{Recursive Editing})
 and it is wise to go back to the backtrace buffer and exit the debugger
 (with the @kbd{q} command) when you are finished with it.  Exiting
-the debugger gets out of the recursive edit and kills the backtrace
-buffer.
+the debugger gets out of the recursive edit and buries the backtrace
+buffer.  (You can customize what the @kbd{q} command does with the
+backtrace buffer by setting the variable @code{debugger-bury-or-kill}.
+For example, set it to @code{kill} if you prefer to kill the buffer
+rather than bury it.  Consult the variable's documentation for more
+possibilities.)
 
   When the debugger has been entered, the @code{debug-on-error}
 variable is temporarily set according to

=== modified file 'doc/lispref/errors.texi'
--- a/doc/lispref/errors.texi   2012-10-31 20:59:04 +0000
+++ b/doc/lispref/errors.texi   2012-11-11 00:37:40 +0000
@@ -172,6 +172,9 @@
 @item undefined-color
 The message is @samp{Undefined color}.  @xref{Color Names}.
 
address@hidden user-error
+The message is the empty string.  @xref{Signaling Errors}.
+
 @item void-function
 The message is @samp{Symbol's function definition is void}.
 @xref{Function Cells}.

=== modified file 'doc/lispref/variables.texi'
--- a/doc/lispref/variables.texi        2012-11-07 05:22:10 +0000
+++ b/doc/lispref/variables.texi        2012-11-12 08:23:23 +0000
@@ -2133,20 +2133,24 @@
 @end example
 @end defmac
 
address@hidden FIXME?  Not sure what, if anything, to say about this.
address@hidden
address@hidden gv-define-expander name handler
-This is the most general way to define a new @code{setf} expansion.
address@hidden defmac
address@hidden ignore
address@hidden gv-define-expander
address@hidden gv-letplace
address@hidden FIXME?  Not sure what or how much to say about these.
address@hidden See cl.texi for an example of using gv-letplace.
+For more control over the expansion, see the macro @code{gv-define-expander}.
+The macro @code{gv-letplace} can be useful in defining macros that
+perform similarly to @code{setf}; for example, the @code{incf} macro
+of Common Lisp.  Consult the source file @file{gv.el} for more details.
 
 @cindex CL note---no @code{setf} functions
-Common Lisp defines another way to specify the @code{setf} behavior of
-a function, namely address@hidden functions'', whose names are lists
address@hidden(setf @var{name})} rather than symbols.  For example,
address@hidden(defun (setf foo) @dots{})} defines the function that is used
-when @code{setf} is applied to @code{foo}.  Emacs does not support
-this.  It is a compile-time error to use @code{setf} on a form that
-has not already had an appropriate expansion defined.  In Common Lisp,
-this is not an error since the function @code{(setf @var{func})} might
-be defined later.
address@hidden
address@hidden Lisp note:} Common Lisp defines another way to specify the
address@hidden behavior of a function, namely address@hidden functions'',
+whose names are lists @code{(setf @var{name})} rather than symbols.
+For example, @code{(defun (setf foo) @dots{})} defines the function
+that is used when @code{setf} is applied to @code{foo}.  Emacs does
+not support this.  It is a compile-time error to use @code{setf} on a
+form that has not already had an appropriate expansion defined.  In
+Common Lisp, this is not an error since the function @code{(setf
address@hidden)} might be defined later.
address@hidden quotation

=== modified file 'doc/misc/ChangeLog'
--- a/doc/misc/ChangeLog        2012-11-12 05:53:53 +0000
+++ b/doc/misc/ChangeLog        2012-11-13 02:25:59 +0000
@@ -1,3 +1,9 @@
+2012-11-13  Glenn Morris  <address@hidden>
+
+       * flymake.texi (Customizable variables)
+       (Highlighting erroneous lines): Mention flymake-error-bitmap,
+       flymake-warning-bitmap, and flymake-fringe-indicator-position.
+
 2012-11-12  Vincent Belaïche  <address@hidden>
 
        * ses.texi: Doc for ses-rename-cell, ses-repair-cell-reference-all & 
ses-range.

=== modified file 'doc/misc/flymake.texi'
--- a/doc/misc/flymake.texi     2012-03-10 04:10:21 +0000
+++ b/doc/misc/flymake.texi     2012-11-12 08:42:27 +0000
@@ -337,6 +337,17 @@
 A custom face for highlighting lines for which at least one warning
 and no errors have been reported.
 
address@hidden flymake-error-bitmap
+A bitmap used in the fringe to mark lines for which an error has
+been reported.
+
address@hidden flymake-warning-bitmap
+A bitmap used in the fringe to mark lines for which a warning has
+been reported.
+
address@hidden flymake-fringe-indicator-position
+Which fringe (if any) should show the warning/error bitmaps.
+
 @end table
 
 @node Adding support for a new syntax check tool
@@ -718,6 +729,15 @@
 @code{flymake-warnline}.  Errors belonging outside the current
 buffer are considered to belong to line 1 of the current buffer.
 
address@hidden This manual does not use vindex.
address@hidden @vindex flymake-fringe-indicator-position
address@hidden @vindex flymake-error-bitmap
address@hidden @vindex flymake-warning-bitmap
+If the option @code{flymake-fringe-indicator-position} is address@hidden,
+errors and warnings are also highlighted in the left or right fringe,
+using the bitmaps specified by @code{flymake-error-bitmap}
+and @code{flymake-warning-bitmap}.
+
 @node Interaction with other modes
 @section Interaction with other modes
 @cindex Interaction with other modes

=== modified file 'etc/NEWS'
--- a/etc/NEWS  2012-11-12 20:43:43 +0000
+++ b/etc/NEWS  2012-11-13 02:25:59 +0000
@@ -162,6 +162,7 @@
 *** minibuffer-electric-default-mode can rewrite (default ...) to [...].
 Just set minibuffer-eldef-shorten-default to t before enabling the mode.
 
++++
 ** ImageMagick support, if available, is automatically enabled.
 It is no longer necessary to call `imagemagick-register-types'
 explicitly to install ImageMagick image types; that function is called
@@ -470,6 +471,7 @@
 *** ERC will look up server/channel names via auth-source and use any
 channel keys found.
 
++++
 ** Flymake uses fringe bitmaps to indicate errors and warnings.
 See `flymake-fringe-indicator-position', `flymake-error-bitmap' and
 `flymake-warning-bitmap'.
@@ -478,10 +480,12 @@
 ** Follow mode no longer works by using advice.
 The option `follow-intercept-processes' has been removed.
 
+---
 ** The FFAP option `ffap-url-unwrap-remote' can now be a list of strings,
-specifying URL types which should be converted to remote file names at
+specifying URL types that should be converted to remote file names at
 the FFAP prompt.  The default is now '("ftp").
 
+---
 ** New Ibuffer `derived-mode' filter, bound to `/ M'.
 The old binding for `/ M' (filter by used-mode) is now bound to `/ m'.
 
@@ -497,11 +501,14 @@
 The function `notifications-get-capabilities' returns the supported
 server properties.
 
+---
 ** In Perl mode, new option `perl-indent-parens-as-block' causes non-block
 closing brackets to be aligned with the line of the opening bracket.
 
+---
 ** In Proced mode, new command `proced-renice' renices marked processes.
 
+---
 ** Python mode
 
 A new version of python.el, which provides several new features, including:
@@ -548,6 +555,8 @@
 python-find-function      | python-nav-jump-to-defun
 python-next-statement     | python-nav-forward-sentence
 python-previous-statement | python-nav-backward-sentence
+python-beginning-of-defun-function  | python-nav-beginning-of-defun
+python-end-of-defun-function        | python-nav-end-of-defun
 python-send-buffer        | python-shell-send-buffer
 python-send-defun         | python-shell-send-defun
 python-send-region        | python-shell-send-region
@@ -586,8 +595,9 @@
 
 *** `sh-use-smie' lets you choose a new indentation and navigation code.
 
++++
 ** New option `async-shell-command-buffer' specifies the buffer to use
-for a new asynchronous shell command when the default output buffer
+for a new asynchronous `shell-command' when the default output buffer
 `*Async Shell Command*' is already in use.
 
 ---
@@ -831,11 +841,15 @@
 
 ** Debugger changes
 
++++
 *** New error type and new function `user-error'.
 These do not trigger the debugger.
 
-*** New option `debugger-bury-or-kill'.
++++
+*** New option `debugger-bury-or-kill', saying what to do with the
+debugger buffer when exiting debug.
 
++++
 *** Set `debug-on-message' to enter the debugger when a certain
 message is displayed in the echo area.  This can be useful when trying
 to work out which code is doing something.
@@ -900,7 +914,7 @@
 *** `current-time-string' no longer requires that its argument's year
 must be in the range 1000..9999.  It now works with any year supported
 by the underlying C implementation.
-
++++
 *** `current-time' now returns extended-format time stamps
 (HIGH LOW USEC PSEC), where the new PSEC slot specifies picoseconds.
 PSEC is typically a multiple of 1000 on current machines.  Other
@@ -912,7 +926,7 @@
 [TRIGGERED-P HI-SECS LO-SECS USECS REPEAT-DELAY FUNCTION ARGS IDLE-DELAY 
PSECS].
 The PSECS slot is new, and uses picosecond resolution.  It can be
 accessed via the new timer--psecs accessor.
-
++++
 *** Last-modified time stamps in undo lists now are of the form
 (t HI-SECS LO-SECS USECS PSECS) instead of (t HI-SECS . LO-SECS).
 

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-11-12 20:43:43 +0000
+++ b/lisp/ChangeLog    2012-11-13 02:25:59 +0000
@@ -1,3 +1,53 @@
+2012-11-13  Stefan Monnier  <address@hidden>
+
+       * emacs-lisp/gv.el (gv-define-simple-setter): One more fix (bug#12871).
+
+2012-11-13  Wolfgang Jenkner  <address@hidden>
+
+       * ansi-color.el (ansi-color-apply-sequence): Implement SGR codes
+       39 and 49 (bug#12792).  Also, treat unimplemented parameters as 0,
+       thereby restoring the behavior of revisions prior to 109621.
+
+2012-11-13  Fabián Ezequiel Gallina  <address@hidden>
+
+       Fix end-of-defun misbehavior.
+       * progmodes/python.el (python-nav-beginning-of-defun): Rename from
+       python-beginning-of-defun-function.  Handle nested defuns
+       correctly.
+       (python-nav-end-of-defun): Rename from
+       python-end-of-defun-function.  Ensure forward movement.
+       (python-info-current-defun): Reimplement to work as intended
+       with new fixed python-nav-{end,beginning}-of-defun.  Stop scanning
+       parent defuns as soon as possible.
+
+2012-11-13  Glenn Morris  <address@hidden>
+
+       * progmodes/flymake.el (flymake-error-bitmap)
+       (flymake-warning-bitmap, flymake-fringe-indicator-position): Doc fixes.
+       (flymake-error-bitmap, flymake-warning-bitmap): Fix :types.
+
+2012-11-13  Dmitry Gutov  <address@hidden>
+
+       * progmodes/ruby-mode.el (ruby-move-to-block): When moving
+       backward, always stop at indentation.  Reverts the change from
+       109576 (Bug#12851).
+
+2012-11-13  Glenn Morris  <address@hidden>
+
+       * ibuffer.el (ibuffer-mode-map, ibuffer-mode):
+       Add ibuffer-filter-by-derived-mode.
+
+       * ibuffer.el (ibuffer-mode-map): Don't have two menu items with
+       the same name shadowing each other.
+
+       * window.el (with-temp-buffer-window): Doc tweak.
+
+       * emacs-lisp/debug.el (debugger-bury-or-kill): Doc tweak.
+
+       * help.el (temp-buffer-max-height):
+       * window.el (fit-frame-to-buffer, fit-frame-to-buffer-bottom-margin):
+       * emacs-lisp/debug.el (debugger-bury-or-kill): Fix :version.
+
 2012-11-12  Stefan Monnier  <address@hidden>
 
        * emacs-lisp/nadvice.el: New package.

=== modified file 'lisp/ansi-color.el'
--- a/lisp/ansi-color.el        2012-09-25 04:13:02 +0000
+++ b/lisp/ansi-color.el        2012-11-12 17:12:33 +0000
@@ -534,34 +534,39 @@
 
 ESCAPE-SEQ is an escape sequence parsed by `ansi-color-parse-sequence'.
 
-If the new codes resulting from ESCAPE-SEQ start with 0, then the
-old codes are discarded and the remaining new codes are
-processed.  Otherwise, for each new code: if it is 21-25 or 27-29
-delete appropriate parameters from the list of codes; any other
-code that makes sense is added to the list of codes.  Finally,
-the so changed list of codes is returned."
+For each new code, the following happens: if it is 1-7, add it to
+the list of codes; if it is 21-25 or 27, delete appropriate
+parameters from the list of codes; if it is 30-37 resp. 39, the
+foreground color code is replaced or added resp. deleted; if it
+is 40-47 resp. 49, the background color code is replaced or added
+resp. deleted; any other code is discarded together with the old
+codes. Finally, the so changed list of codes is returned."
   (let ((new-codes (ansi-color-parse-sequence escape-sequence)))
     (while new-codes
-      (setq codes
-           (let ((new (pop new-codes)))
-             (cond ((zerop new)
-                    nil)
-                   ((or (<= new 20)
-                        (>= new 30))
-                    (if (memq new codes)
-                        codes
-                      (cons new codes)))
-                   ;; The standard says `21 doubly underlined' while
-                   ;; http://en.wikipedia.org/wiki/ANSI_escape_code claims
-                   ;; `21 Bright/Bold: off or Underline: Double'.
-                   ((/= new 26)
-                    (remq (- new 20)
-                          (cond ((= new 22)
-                                 (remq 1 codes))
-                                ((= new 25)
-                                 (remq 6 codes))
-                                (t codes))))
-                   (t codes)))))
+      (let* ((new (pop new-codes))
+            (q (/ new 10)))
+       (setq codes
+             (pcase q
+               (0 (unless (memq new '(0 8 9))
+                    (cons new (remq new codes))))
+               (2 (unless (memq new '(20 26 28 29))
+                    ;; The standard says `21 doubly underlined' while
+                    ;; http://en.wikipedia.org/wiki/ANSI_escape_code claims
+                    ;; `21 Bright/Bold: off or Underline: Double'.
+                    (remq (- new 20) (pcase new
+                                       (22 (remq 1 codes))
+                                       (25 (remq 6 codes))
+                                       (_ codes)))))
+               ((or 3 4) (let ((r (mod new 10)))
+                           (unless (= r 8)
+                             (let (beg)
+                               (while (and codes (/= q (/ (car codes) 10)))
+                                 (push (pop codes) beg))
+                               (setq codes (nconc (nreverse beg) (cdr codes)))
+                               (if (= r 9)
+                                   codes
+                                 (cons new codes))))))
+               (_ nil)))))
     codes))
 
 (defun ansi-color-make-color-map ()

=== modified file 'lisp/cedet/ChangeLog'
--- a/lisp/cedet/ChangeLog      2012-10-25 20:13:16 +0000
+++ b/lisp/cedet/ChangeLog      2012-11-13 02:25:59 +0000
@@ -1,7 +1,20 @@
+2012-11-13  Stefan Monnier  <address@hidden>
+
+       * semantic/mru-bookmark.el (semantic-mru-bookmark-mode):
+       * semantic/grammar.el (semantic-grammar-mode):
+       * semantic/util-modes.el (semantic-highlight-edits-mode)
+       (semantic-show-parser-state-mode): Avoid obsolete name
+       semantic-edits-new-change-hooks (bug#12869).
+
+2012-11-13  Glenn Morris  <address@hidden>
+
+       * srecode/srt-mode.el (srecode-template-mode):
+       Don't change global values of comment-start, comment-end.  (Bug#12781)
+
 2012-10-25  David Engster  <address@hidden>
 
-       * semantic/analyze.el (semantic-analyze-dereference-alias): New
-       function to dereference aliases.
+       * semantic/analyze.el (semantic-analyze-dereference-alias):
+       New function to dereference aliases.
        (semantic-analyze-current-context-default): Use it.
 
        * semantic/grammar.el (semantic-grammar-create-package):
@@ -12,8 +25,8 @@
 
        * semantic.el (semantic-elapsed-time): Make it a defsubst.
 
-       * srecode/dictionary.el (srecode-adebug-dictionary): Remove
-       require for `semantic'.
+       * srecode/dictionary.el (srecode-adebug-dictionary):
+       Remove require for `semantic'.
 
        * srecode/map.el:
        * srecode/insert.el: Declare functions from `data-debug'.

=== modified file 'lisp/cedet/semantic/grammar.el'
--- a/lisp/cedet/semantic/grammar.el    2012-10-25 20:13:16 +0000
+++ b/lisp/cedet/semantic/grammar.el    2012-11-12 16:50:08 +0000
@@ -1333,8 +1333,8 @@
   (add-hook 'before-change-functions
             'semantic--grammar-clear-macros-regexp-2 nil t)
   ;; Handle safe re-parse of grammar rules.
-  (semantic-make-local-hook 'semantic-edits-new-change-hooks)
-  (add-hook 'semantic-edits-new-change-hooks
+  (semantic-make-local-hook 'semantic-edits-new-change-functions)
+  (add-hook 'semantic-edits-new-change-functions
             'semantic-grammar-edits-new-change-hook-fcn
             nil t)
   (semantic-run-mode-hooks 'semantic-grammar-mode-hook))

=== modified file 'lisp/cedet/semantic/mru-bookmark.el'
--- a/lisp/cedet/semantic/mru-bookmark.el       2012-10-01 18:10:29 +0000
+++ b/lisp/cedet/semantic/mru-bookmark.el       2012-11-12 16:50:08 +0000
@@ -292,13 +292,13 @@
             (setq semantic-mru-bookmark-mode nil)
             (error "Buffer %s was not set up for parsing"
                    (buffer-name)))
-        (semantic-make-local-hook 'semantic-edits-new-change-hooks)
-        (add-hook 'semantic-edits-new-change-hooks
+        (semantic-make-local-hook 'semantic-edits-new-change-functions)
+        (add-hook 'semantic-edits-new-change-functions
                   'semantic-mru-bookmark-change-hook-fcn nil t)
         (add-hook 'semantic-edits-move-change-hooks
                   'semantic-mru-bookmark-change-hook-fcn nil t))
     ;; Remove hooks
-    (remove-hook 'semantic-edits-new-change-hooks
+    (remove-hook 'semantic-edits-new-change-functions
                 'semantic-mru-bookmark-change-hook-fcn t)
     (remove-hook 'semantic-edits-move-change-hooks
                 'semantic-mru-bookmark-change-hook-fcn t)))

=== modified file 'lisp/cedet/semantic/util-modes.el'
--- a/lisp/cedet/semantic/util-modes.el 2012-01-19 07:21:25 +0000
+++ b/lisp/cedet/semantic/util-modes.el 2012-11-12 16:50:08 +0000
@@ -221,11 +221,11 @@
            (setq semantic-highlight-edits-mode nil)
            (error "Buffer %s was not set up for parsing"
                   (buffer-name)))
-       (semantic-make-local-hook 'semantic-edits-new-change-hooks)
-       (add-hook 'semantic-edits-new-change-hooks
+       (semantic-make-local-hook 'semantic-edits-new-change-functions)
+       (add-hook 'semantic-edits-new-change-functions
                  'semantic-highlight-edits-new-change-hook-fcn nil t))
     ;; Remove hooks
-    (remove-hook 'semantic-edits-new-change-hooks
+    (remove-hook 'semantic-edits-new-change-functions
                 'semantic-highlight-edits-new-change-hook-fcn t)))
 
 (semantic-add-minor-mode 'semantic-highlight-edits-mode
@@ -460,8 +460,8 @@
                (append mode-line-modified
                        '(semantic-show-parser-state-string))))
        ;; Add hooks
-        (semantic-make-local-hook 'semantic-edits-new-change-hooks)
-        (add-hook 'semantic-edits-new-change-hooks
+        (semantic-make-local-hook 'semantic-edits-new-change-functions)
+        (add-hook 'semantic-edits-new-change-functions
                   'semantic-show-parser-state-marker nil t)
        (semantic-make-local-hook 
'semantic-edits-incremental-reparse-failed-hook)
        (add-hook 'semantic-edits-incremental-reparse-failed-hook
@@ -491,7 +491,7 @@
     (setq mode-line-modified
          (delq 'semantic-show-parser-state-string mode-line-modified))
     ;; Remove hooks
-    (remove-hook 'semantic-edits-new-change-hooks
+    (remove-hook 'semantic-edits-new-change-functions
                 'semantic-show-parser-state-marker t)
     (remove-hook 'semantic-edits-incremental-reparse-failed-hook
                 'semantic-show-parser-state-marker t)

=== modified file 'lisp/cedet/srecode/srt-mode.el'
--- a/lisp/cedet/srecode/srt-mode.el    2012-10-01 18:10:29 +0000
+++ b/lisp/cedet/srecode/srt-mode.el    2012-11-10 23:43:47 +0000
@@ -189,8 +189,8 @@
 ;;;###autoload
 (define-derived-mode srecode-template-mode fundamental-mode "SRecorder"
   "Major-mode for writing SRecode macros."
-  (setq comment-start ";;"
-       comment-end "")
+  (set (make-local-variable 'comment-start) ";;")
+  (set (make-local-variable 'comment-end) "")
   (set (make-local-variable 'parse-sexp-ignore-comments) t)
   (set (make-local-variable 'comment-start-skip)
        "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")

=== modified file 'lisp/emacs-lisp/debug.el'
--- a/lisp/emacs-lisp/debug.el  2012-11-12 20:43:43 +0000
+++ b/lisp/emacs-lisp/debug.el  2012-11-13 02:25:59 +0000
@@ -49,9 +49,9 @@
   :version "21.1")
 
 (defcustom debugger-bury-or-kill 'bury
-  "How to proceed with the debugger buffer when exiting `debug'.
-The value used here affects the behavior of operations on any
-window previously showing the debugger buffer.
+  "What to do with the debugger buffer when exiting `debug'.
+The value affects the behavior of operations on any window
+previously showing the debugger buffer.
 
 `nil' means that if its window is not deleted when exiting the
   debugger, invoking `switch-to-prev-buffer' will usually show
@@ -79,7 +79,7 @@
          (const :tag "Bury" bury)
          (const :tag "Kill" kill))
   :group 'debugger
-  :version "24.2")
+  :version "24.3")
 
 (defvar debugger-step-after-exit nil
   "Non-nil means \"single-step\" after the debugger exits.")

=== modified file 'lisp/emacs-lisp/gv.el'
--- a/lisp/emacs-lisp/gv.el     2012-11-10 23:13:33 +0000
+++ b/lisp/emacs-lisp/gv.el     2012-11-13 02:25:59 +0000
@@ -220,8 +220,9 @@
   `(gv-define-setter ,name (val &rest args)
      ,(if fix-return
           `(macroexp-let2 nil v val
-             (cons ',setter (append args (list v)))
-             v)
+             `(progn
+                (,',setter ,@(append args (list v)))
+                ,v))
         `(cons ',setter (append args (list val))))))
 
 ;;; Typical operations on generalized variables.

=== modified file 'lisp/help.el'
--- a/lisp/help.el      2012-10-26 09:11:24 +0000
+++ b/lisp/help.el      2012-11-11 00:43:54 +0000
@@ -979,7 +979,7 @@
 function is called, the window to be resized is selected."
   :type '(choice integer function)
   :group 'help
-  :version "24.2")
+  :version "24.3")
 
 (define-minor-mode temp-buffer-resize-mode
   "Toggle auto-resizing temporary buffer windows (Temp Buffer Resize Mode).

=== modified file 'lisp/ibuffer.el'
--- a/lisp/ibuffer.el   2012-09-24 10:20:50 +0000
+++ b/lisp/ibuffer.el   2012-11-11 02:22:26 +0000
@@ -632,10 +632,13 @@
       '(menu-item "Disable all filtering" ibuffer-filter-disable
         :enable (and (featurep 'ibuf-ext) ibuffer-filtering-qualifiers)))
     (define-key-after map [menu-bar view filter filter-by-mode]
-      '(menu-item "Add filter by major mode..." ibuffer-filter-by-mode))
-    (define-key-after map [menu-bar view filter filter-by-mode]
-      '(menu-item "Add filter by major mode in use..."
+      '(menu-item "Add filter by any major mode..." ibuffer-filter-by-mode))
+    (define-key-after map [menu-bar view filter filter-by-used-mode]
+      '(menu-item "Add filter by a major mode in use..."
         ibuffer-filter-by-used-mode))
+    (define-key-after map [menu-bar view filter filter-by-derived-mode]
+      '(menu-item "Add filter by derived mode..."
+                  ibuffer-filter-by-derived-mode))
     (define-key-after map [menu-bar view filter filter-by-name]
       '(menu-item "Add filter by buffer name..." ibuffer-filter-by-name))
     (define-key-after map [menu-bar view filter filter-by-filename]
@@ -2438,8 +2441,9 @@
 
 Filtering commands:
 
-  '\\[ibuffer-filter-by-mode]' - Add a filter by major mode.
-  '\\[ibuffer-filter-by-used-mode]' - Add a filter by major mode now in use.
+  '\\[ibuffer-filter-by-mode]' - Add a filter by any major mode.
+  '\\[ibuffer-filter-by-used-mode]' - Add a filter by a major mode now in use.
+  '\\[ibuffer-filter-by-derived-mode]' - Add a filter by derived mode.
   '\\[ibuffer-filter-by-name]' - Add a filter by buffer name.
   '\\[ibuffer-filter-by-content]' - Add a filter by buffer content.
   '\\[ibuffer-filter-by-filename]' - Add a filter by filename.

=== modified file 'lisp/progmodes/flymake.el'
--- a/lisp/progmodes/flymake.el 2012-10-20 11:34:06 +0000
+++ b/lisp/progmodes/flymake.el 2012-11-12 08:42:27 +0000
@@ -764,25 +764,39 @@
   (and (overlayp ov) (overlay-get ov 'flymake-overlay)))
 
 (defcustom flymake-error-bitmap '(exclamation-mark error)
-  "Bitmap used in the fringe for indicating errors.
+  "Bitmap (a symbol) used in the fringe for indicating errors.
 The value may also be a list of two elements where the second
-element specifies the face for the bitmap."
+element specifies the face for the bitmap.  For possible bitmap
+symbols, see `fringe-bitmaps'.  See also `flymake-warning-bitmap'.
+
+The option `flymake-fringe-indicator-position' controls how and where
+this is used."
   :group 'flymake
   :version "24.3"
-  :type 'symbol)
+  :type '(choice (symbol :tag "Bitmap")
+                 (list :tag "Bitmap and face"
+                       (symbol :tag "Bitmap")
+                       (face :tag "Face"))))
 
 (defcustom flymake-warning-bitmap 'question-mark
-  "Bitmap used in the fringe for indicating warnings.
+  "Bitmap (a symbol) used in the fringe for indicating warnings.
 The value may also be a list of two elements where the second
-element specifies the face for the bitmap."
+element specifies the face for the bitmap.  For possible bitmap
+symbols, see `fringe-bitmaps'.  See also `flymake-error-bitmap'.
+
+The option `flymake-fringe-indicator-position' controls how and where
+this is used."
   :group 'flymake
   :version "24.3"
-  :type 'symbol)
+  :type '(choice (symbol :tag "Bitmap")
+                 (list :tag "Bitmap and face"
+                       (symbol :tag "Bitmap")
+                       (face :tag "Face"))))
 
 (defcustom flymake-fringe-indicator-position 'left-fringe
   "The position to put flymake fringe indicator.
-The value can be nil, left-fringe or right-fringe.
-Fringe indicators are disabled if nil."
+The value can be nil (do not use indicators), `left-fringe' or `right-fringe'.
+See `flymake-error-bitmap' and `flymake-warning-bitmap'."
   :group 'flymake
   :version "24.3"
   :type '(choice (const left-fringe)

=== modified file 'lisp/progmodes/python.el'
--- a/lisp/progmodes/python.el  2012-11-03 12:20:02 +0000
+++ b/lisp/progmodes/python.el  2012-11-12 13:26:50 +0000
@@ -1074,12 +1074,9 @@
 The name of the defun should be grouped so it can be retrieved
 via `match-string'.")
 
-(defun python-nav-beginning-of-defun (&optional arg)
-  "Move point to `beginning-of-defun'.
-With positive ARG move search backwards.  With negative do the
-same but forward.  When ARG is nil or 0 defaults to 1.  This is
-the main part of `python-beginning-of-defun-function'.  Return
-non-nil if point is moved to `beginning-of-defun'."
+(defun python-nav--beginning-of-defun (&optional arg)
+  "Internal implementation of `python-nav-beginning-of-defun'.
+With positive ARG search backwards, else search forwards."
   (when (or (null arg) (= arg 0)) (setq arg 1))
   (let* ((re-search-fn (if (> arg 0)
                            #'re-search-backward
@@ -1087,6 +1084,15 @@
          (line-beg-pos (line-beginning-position))
          (line-content-start (+ line-beg-pos (current-indentation)))
          (pos (point-marker))
+         (beg-indentation
+          (and (> arg 0)
+               (save-excursion
+                 (and (python-info-current-line-empty-p)
+                      (python-util-forward-comment -1))
+                 (python-nav-beginning-of-statement)
+                 (if (python-info-looking-at-beginning-of-defun)
+                     (+ (current-indentation) python-indent-offset)
+                   (current-indentation)))))
          (found
           (progn
             (when (and (< arg 0)
@@ -1094,7 +1100,12 @@
               (end-of-line 1))
             (while (and (funcall re-search-fn
                                  python-nav-beginning-of-defun-regexp nil t)
-                        (python-syntax-context-type)))
+                        (or (python-syntax-context-type)
+                            ;; Handle nested defuns when moving
+                            ;; backwards by checking indentation.
+                            (and (> arg 0)
+                                 (not (= (current-indentation) 0))
+                                 (>= (current-indentation) beg-indentation)))))
             (and (python-info-looking-at-beginning-of-defun)
                  (or (not (= (line-number-at-pos pos)
                              (line-number-at-pos)))
@@ -1105,55 +1116,43 @@
         (or (beginning-of-line 1) t)
       (and (goto-char pos) nil))))
 
-(defun python-beginning-of-defun-function (&optional arg)
-  "Move point to the beginning of def or class.
-With positive ARG move that number of functions backwards.  With
-negative do the same but forward.  When ARG is nil or 0 defaults
-to 1.  Return non-nil if point is moved to `beginning-of-defun'."
+(defun python-nav-beginning-of-defun (&optional arg)
+  "Move point to `beginning-of-defun'.
+With positive ARG search backwards else search forward.  When ARG
+is nil or 0 defaults to 1.  When searching backwards nested
+defuns are handled with care depending on current point
+position.  Return non-nil if point is moved to
+`beginning-of-defun'."
   (when (or (null arg) (= arg 0)) (setq arg 1))
   (let ((found))
     (cond ((and (eq this-command 'mark-defun)
                 (python-info-looking-at-beginning-of-defun)))
           (t
            (dotimes (i (if (> arg 0) arg (- arg)))
-             (when (and (python-nav-beginning-of-defun arg)
+             (when (and (python-nav--beginning-of-defun arg)
                         (not found))
                (setq found t)))))
     found))
 
-(defun python-end-of-defun-function ()
+(defun python-nav-end-of-defun ()
   "Move point to the end of def or class.
 Returns nil if point is not in a def or class."
   (interactive)
-  (let ((beg-defun-indent))
+  (let ((beg-defun-indent)
+        (beg-pos (point)))
     (when (or (python-info-looking-at-beginning-of-defun)
-              (python-beginning-of-defun-function 1)
-              (python-beginning-of-defun-function -1))
+              (python-nav-beginning-of-defun 1)
+              (python-nav-beginning-of-defun -1))
       (setq beg-defun-indent (current-indentation))
-      (forward-line 1)
-      ;; Go as forward as possible
-      (while (and (or
-                   (python-nav-beginning-of-defun -1)
-                   (and (goto-char (point-max)) nil))
-                  (> (current-indentation) beg-defun-indent)))
-      (beginning-of-line 1)
-      ;; Go as backwards as possible
-      (while (and (forward-line -1)
-                  (not (bobp))
-                  (or (not (current-word))
-                      (equal (char-after (+ (point) (current-indentation))) ?#)
-                      (<= (current-indentation) beg-defun-indent)
-                      (looking-at (python-rx decorator))
-                      (python-syntax-context-type))))
-      (forward-line 1)
-      ;; If point falls inside a paren or string context the point is
-      ;; forwarded at the end of it (or end of buffer if its not closed)
-      (let ((context-type (python-syntax-context-type)))
-        (when (memq context-type '(paren string))
-          ;; Slow but safe.
-          (while (and (not (eobp))
-                      (python-syntax-context-type))
-            (forward-line 1)))))))
+      (while (progn
+               (python-nav-end-of-statement)
+               (python-util-forward-comment 1)
+               (and (> (current-indentation) beg-defun-indent)
+                    (not (eobp)))))
+      (python-util-forward-comment -1)
+      (forward-line 1)
+      ;; Ensure point moves forward.
+      (and (> beg-pos (point)) (goto-char beg-pos)))))
 
 (defun python-nav-beginning-of-statement ()
   "Move to start of current statement."
@@ -2022,7 +2021,7 @@
     (python-shell-send-region
      (progn
        (end-of-line 1)
-       (while (and (or (python-beginning-of-defun-function)
+       (while (and (or (python-nav-beginning-of-defun)
                        (beginning-of-line 1))
                    (> (current-indentation) 0)))
        (when (not arg)
@@ -2031,7 +2030,7 @@
          (forward-line 1))
        (point-marker))
      (progn
-       (or (python-end-of-defun-function)
+       (or (python-nav-end-of-defun)
            (end-of-line 1))
        (point-marker)))))
 
@@ -2879,38 +2878,40 @@
 This function is compatible to be used as
 `add-log-current-defun-function' since it returns nil if point is
 not inside a defun."
-  (let ((names '())
-        (starting-indentation)
-        (starting-point)
-        (first-run t))
     (save-restriction
       (widen)
       (save-excursion
-        (setq starting-point (point-marker))
-        (setq starting-indentation (save-excursion
-                                     (python-nav-beginning-of-statement)
-                                     (current-indentation)))
         (end-of-line 1)
-        (while (python-beginning-of-defun-function 1)
-          (when (or (< (current-indentation) starting-indentation)
-                    (and first-run
-                         (<
-                          starting-point
-                          (save-excursion
-                            (python-end-of-defun-function)
-                            (point-marker)))))
-            (setq first-run nil)
-            (setq starting-indentation (current-indentation))
-            (looking-at python-nav-beginning-of-defun-regexp)
-            (setq names (cons
+        (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-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))))))
-    (when names
-      (mapconcat (lambda (string) string) names "."))))
+                         names)))
+                (and (= (current-indentation) 0) (throw 'exit t)))))
+          (and names
+               (mapconcat (lambda (string) string) names "."))))))
 
 (defun python-info-current-symbol (&optional replace-self)
   "Return current symbol using dotty syntax.
@@ -3200,9 +3201,9 @@
        'python-fill-paragraph)
 
   (set (make-local-variable 'beginning-of-defun-function)
-       #'python-beginning-of-defun-function)
+       #'python-nav-beginning-of-defun)
   (set (make-local-variable 'end-of-defun-function)
-       #'python-end-of-defun-function)
+       #'python-nav-end-of-defun)
 
   (add-hook 'completion-at-point-functions
             'python-completion-complete-at-point nil 'local)
@@ -3230,7 +3231,7 @@
   (add-to-list 'hs-special-modes-alist
                `(python-mode "^\\s-*\\(?:def\\|class\\)\\>" nil "#"
                              ,(lambda (arg)
-                                (python-end-of-defun-function)) nil))
+                                (python-nav-end-of-defun)) nil))
 
   (set (make-local-variable 'mode-require-final-newline) t)
 

=== modified file 'lisp/progmodes/ruby-mode.el'
--- a/lisp/progmodes/ruby-mode.el       2012-11-08 16:37:34 +0000
+++ b/lisp/progmodes/ruby-mode.el       2012-11-13 02:25:59 +0000
@@ -898,17 +898,7 @@
             (back-to-indentation)
             (if (looking-at (concat "\\<\\(" ruby-block-mid-re "\\)\\>"))
                 (setq done nil)))))
-    (back-to-indentation)
-    (when (< n 0)
-      (let ((eol (point-at-eol)) state next)
-        (if (< orig eol) (setq eol orig))
-        (setq orig (point))
-        (while (and (setq next (apply 'ruby-parse-partial eol state))
-                    (< (point) eol))
-          (setq state next))
-        (when (cdaadr state)
-          (goto-char (cdaadr state)))
-        (backward-word)))))
+    (back-to-indentation)))
 
 (defun ruby-beginning-of-block (&optional arg)
   "Move backward to the beginning of the current block.

=== modified file 'lisp/window.el'
--- a/lisp/window.el    2012-11-03 10:47:03 +0000
+++ b/lisp/window.el    2012-11-11 01:47:56 +0000
@@ -143,37 +143,36 @@
        window))))
 
 (defmacro with-temp-buffer-window (buffer-or-name action quit-function &rest 
body)
-  "Evaluate BODY and display buffer specified by BUFFER-OR-NAME.
-BUFFER-OR-NAME must specify either a live buffer or the name of a
-buffer.  If no buffer with such a name exists, create one.
+  "Evaluate BODY and display the buffer specified by BUFFER-OR-NAME.
+BUFFER-OR-NAME must specify either a live buffer, or the name of a
+buffer (if it does not exist, this macro creates it).
 
 Make sure the specified buffer is empty before evaluating BODY.
 Do not make that buffer current for BODY.  Instead, bind
 `standard-output' to that buffer, so that output generated with
 `prin1' and similar functions in BODY goes into that buffer.
 
-After evaluating BODY, mark the specified buffer unmodified and
-read-only, and display it in a window via `display-buffer'.  Pass
-ACTION as action argument to `display-buffer'.  Automatically
-shrink the window used if `temp-buffer-resize-mode' is enabled.
+After evaluating BODY, this marks the specified buffer unmodified and
+read-only, and displays it in a window via `display-buffer', passing
+ACTION as the action argument to `display-buffer'.  It automatically
+shrinks the relevant window if `temp-buffer-resize-mode' is enabled.
 
-Return the value returned by BODY unless QUIT-FUNCTION specifies
-a function.  In that case, run the function with two arguments -
+Returns the value returned by BODY, unless QUIT-FUNCTION specifies
+a function.  In that case, runs the function with two arguments -
 the window showing the specified buffer and the value returned by
-BODY - and return the value returned by that function.
+BODY - and returns the value returned by that function.
 
 If the buffer is displayed on a new frame, the window manager may
 decide to select that frame.  In that case, it's usually a good
 strategy if the function specified by QUIT-FUNCTION selects the
 window showing the buffer before reading a value from the
-minibuffer, for example, when asking a `yes-or-no-p' question.
+minibuffer; for example, when asking a `yes-or-no-p' question.
 
-This construct is similar to `with-output-to-temp-buffer' but
-does neither put the buffer in help mode nor does it call
-`temp-buffer-show-function'.  It also runs different hooks,
-namely `temp-buffer-window-setup-hook' (with the specified buffer
-current) and `temp-buffer-window-show-hook' (with the specified
-buffer current and the window showing it selected).
+This construct is similar to `with-output-to-temp-buffer', but does
+not put the buffer in help mode, or call `temp-buffer-show-function'.
+It also runs different hooks, namely `temp-buffer-window-setup-hook'
+\(with the specified buffer current) and `temp-buffer-window-show-hook'
+\(with the specified buffer current and the window showing it selected).
 
 Since this macro calls `display-buffer', the window displaying
 the buffer is usually not selected and the specified buffer
@@ -6065,7 +6064,7 @@
 window.  The height of the root window is subject to the values
 of `fit-frame-to-buffer-max-height' and `window-min-height'."
   :type 'boolean
-  :version "24.2"
+  :version "24.3"
   :group 'help)
 
 (defcustom fit-frame-to-buffer-bottom-margin 4
@@ -6073,7 +6072,7 @@
 This is the number of lines `fit-frame-to-buffer' leaves free at the
 bottom of the display in order to not obscure the system task bar."
   :type 'integer
-  :version "24.2"
+  :version "24.3"
   :group 'windows)
 
 (defun fit-frame-to-buffer (&optional frame max-height min-height)

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-11-13 01:35:14 +0000
+++ b/src/ChangeLog     2012-11-13 02:25:59 +0000
@@ -1,3 +1,11 @@
+2012-11-13  Eli Zaretskii  <address@hidden>
+
+       * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
+       passed to pint2str and pint2hrstr to be at most the size of the
+       frame's decode_mode_spec_buffer.  This avoids crashes with very
+       large values of FIELD_WIDTH argument to decode_mode_spec.
+       (Bug#12867)
+
 2012-11-13  Paul Eggert  <address@hidden>
 
        Fix a race with verify-visited-file-modtime (Bug#12863).

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2012-11-12 04:00:55 +0000
+++ b/src/xdisp.c       2012-11-13 02:25:59 +0000
@@ -21371,6 +21371,12 @@
   Lisp_Object obj;
   struct frame *f = XFRAME (WINDOW_FRAME (w));
   char *decode_mode_spec_buf = f->decode_mode_spec_buffer;
+  /* We are going to use f->decode_mode_spec_buffer as the buffer to
+     produce strings from numerical values, so limit preposterously
+     large values of FIELD_WIDTH to avoid overrunning the buffer's
+     end.  The size of the buffer is enough for FRAME_MESSAGE_BUF_SIZE
+     bytes plus the terminating null.  */
+  int width = min (field_width, FRAME_MESSAGE_BUF_SIZE (f));
   struct buffer *b = current_buffer;
 
   obj = Qnil;
@@ -21466,7 +21472,7 @@
        {
          ptrdiff_t col = current_column ();
          wset_column_number_displayed (w, make_number (col));
-         pint2str (decode_mode_spec_buf, field_width, col);
+         pint2str (decode_mode_spec_buf, width, col);
          return decode_mode_spec_buf;
        }
 
@@ -21497,14 +21503,14 @@
     case 'i':
       {
        ptrdiff_t size = ZV - BEGV;
-       pint2str (decode_mode_spec_buf, field_width, size);
+       pint2str (decode_mode_spec_buf, width, size);
        return decode_mode_spec_buf;
       }
 
     case 'I':
       {
        ptrdiff_t size = ZV - BEGV;
-       pint2hrstr (decode_mode_spec_buf, field_width, size);
+       pint2hrstr (decode_mode_spec_buf, width, size);
        return decode_mode_spec_buf;
       }
 
@@ -21611,12 +21617,12 @@
        line_number_displayed = 1;
 
        /* Make the string to show.  */
-       pint2str (decode_mode_spec_buf, field_width, topline + nlines);
+       pint2str (decode_mode_spec_buf, width, topline + nlines);
        return decode_mode_spec_buf;
     no_value:
         {
          char* p = decode_mode_spec_buf;
-         int pad = field_width - 2;
+         int pad = width - 2;
          while (pad-- > 0)
            *p++ = ' ';
          *p++ = '?';

=== modified file 'test/automated/ruby-mode-tests.el'
--- a/test/automated/ruby-mode-tests.el 2012-09-18 22:10:19 +0000
+++ b/test/automated/ruby-mode-tests.el 2012-11-12 01:11:06 +0000
@@ -202,13 +202,13 @@
    |  end
    |"))
 
-(ert-deftest ruby-move-to-block-stops-at-opening ()
+(ert-deftest ruby-move-to-block-stops-at-indentation ()
   (with-temp-buffer
     (insert "def f\nend")
     (beginning-of-line)
     (ruby-mode)
     (ruby-move-to-block -1)
-    (should (looking-at "f$"))))
+    (should (looking-at "^def"))))
 
 (ert-deftest ruby-toggle-block-to-do-end ()
   (with-temp-buffer


reply via email to

[Prev in Thread] Current Thread [Next in Thread]