diff options
-rw-r--r-- | doc/emacs/ChangeLog | 9 | ||||
-rw-r--r-- | doc/emacs/building.texi | 4 | ||||
-rw-r--r-- | doc/emacs/misc.texi | 10 | ||||
-rw-r--r-- | doc/lispref/ChangeLog | 15 | ||||
-rw-r--r-- | doc/lispref/control.texi | 13 | ||||
-rw-r--r-- | doc/lispref/debugging.texi | 29 | ||||
-rw-r--r-- | doc/lispref/errors.texi | 3 | ||||
-rw-r--r-- | doc/lispref/variables.texi | 34 | ||||
-rw-r--r-- | doc/misc/ChangeLog | 6 | ||||
-rw-r--r-- | doc/misc/flymake.texi | 20 | ||||
-rw-r--r-- | etc/NEWS | 24 | ||||
-rw-r--r-- | lisp/ChangeLog | 50 | ||||
-rw-r--r-- | lisp/ansi-color.el | 57 | ||||
-rw-r--r-- | lisp/cedet/ChangeLog | 21 | ||||
-rw-r--r-- | lisp/cedet/semantic/grammar.el | 4 | ||||
-rw-r--r-- | lisp/cedet/semantic/mru-bookmark.el | 6 | ||||
-rw-r--r-- | lisp/cedet/semantic/util-modes.el | 12 | ||||
-rw-r--r-- | lisp/cedet/srecode/srt-mode.el | 4 | ||||
-rw-r--r-- | lisp/emacs-lisp/debug.el | 8 | ||||
-rw-r--r-- | lisp/emacs-lisp/gv.el | 5 | ||||
-rw-r--r-- | lisp/help.el | 2 | ||||
-rw-r--r-- | lisp/ibuffer.el | 14 | ||||
-rw-r--r-- | lisp/progmodes/flymake.el | 30 | ||||
-rw-r--r-- | lisp/progmodes/python.el | 137 | ||||
-rw-r--r-- | lisp/progmodes/ruby-mode.el | 12 | ||||
-rw-r--r-- | lisp/window.el | 37 | ||||
-rw-r--r-- | src/ChangeLog | 8 | ||||
-rw-r--r-- | src/xdisp.c | 16 | ||||
-rw-r--r-- | test/automated/ruby-mode-tests.el | 4 |
29 files changed, 395 insertions, 199 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index f6d536a08d1..fbdb6363b34 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,12 @@ +2012-11-13 Chong Yidong <cyd@gnu.org> + + * building.texi (Multithreaded Debugging): gdb-stopped-hooks is + actually named gdb-stopped-functions. + +2012-11-13 Glenn Morris <rgm@gnu.org> + + * misc.texi (Single Shell): Mention async-shell-command-buffer. + 2012-11-10 Glenn Morris <rgm@gnu.org> * misc.texi (Terminal emulator): Rename `term-face' to `term'. diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 3a3630138de..e0ea72902fb 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -1244,8 +1244,8 @@ depending on the reason which caused the stop. Customize the variable @code{gdb-switch-reasons} to select the stop reasons which will cause a thread switch. -@vindex gdb-stopped-hooks - The variable @code{gdb-stopped-hooks} allows you to execute your +@vindex 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 diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 244920a23ae..1836c1982e6 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -542,11 +542,19 @@ which is impossible to ignore. 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. +@vindex 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 diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 7eb75ceac55..6d6ddf4da9a 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,18 @@ +2012-11-13 Glenn Morris <rgm@gnu.org> + + * 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 <rudalics@gmx.at> * elisp.texi (Top): Add Recombining Windows to menu. diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index cf393b59c49..489e5cc5b22 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -824,6 +824,19 @@ The function @code{signal} never returns. @end example @end defun +@cindex user errors, signaling +@defun 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 non-@code{nil}. +@xref{Error Debugging}. +@end defun + @cindex CL note---no continuable errors @quotation @b{Common Lisp note:} Emacs Lisp has nothing like the Common Lisp diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi index 2226db942d1..11532b19781 100644 --- a/doc/lispref/debugging.texi +++ b/doc/lispref/debugging.texi @@ -117,12 +117,12 @@ has any of those condition symbols, or if the error message matches 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 -@code{debug-ignored-errors} 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 @@ supported values correspond to the signals @code{SIGUSR1} and @code{inhibit-quit} is set and Emacs is not otherwise responding. @end defopt +@cindex message, finding what causes a particular message +@defvar 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. +@end 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 @@ is a message describing the reason that the debugger was invoked (such as the error message and associated data, if it was invoked due to an error). +@vindex 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 @@ switch buffers, visit files, or do any other sort of editing. However, 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 diff --git a/doc/lispref/errors.texi b/doc/lispref/errors.texi index a57f74d6c86..b92fd9ed665 100644 --- a/doc/lispref/errors.texi +++ b/doc/lispref/errors.texi @@ -172,6 +172,9 @@ The message is @samp{Text is read-only}. This is a subcategory of @item undefined-color The message is @samp{Undefined color}. @xref{Color Names}. +@item 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}. diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index c8451527d4f..dfde3c45c04 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2133,20 +2133,24 @@ set. An example of using this macro is: @end example @end defmac -@c FIXME? Not sure what, if anything, to say about this. -@ignore -@defmac gv-define-expander name handler -This is the most general way to define a new @code{setf} expansion. -@end defmac -@end ignore +@findex gv-define-expander +@findex gv-letplace +@c FIXME? Not sure what or how much to say about these. +@c 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 ``@code{setf} 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 @var{func})} might -be defined later. +@quotation +@b{Common Lisp note:} Common Lisp defines another way to specify the +@code{setf} behavior of a function, namely ``@code{setf} 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 +@var{func})} might be defined later. +@end quotation diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index bfe58fe0a88..7322613e0db 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,9 @@ +2012-11-13 Glenn Morris <rgm@gnu.org> + + * 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 <vincentb1@users.sourceforge.net> * ses.texi: Doc for ses-rename-cell, ses-repair-cell-reference-all & ses-range. diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index 28fb7864f06..4a873490e86 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -337,6 +337,17 @@ been reported. A custom face for highlighting lines for which at least one warning and no errors have been reported. +@item flymake-error-bitmap +A bitmap used in the fringe to mark lines for which an error has +been reported. + +@item flymake-warning-bitmap +A bitmap used in the fringe to mark lines for which a warning has +been reported. + +@item 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 @@ are used: @code{flymake-errline} and @code{flymake-warnline}. Errors belonging outside the current buffer are considered to belong to line 1 of the current buffer. +@c This manual does not use vindex. +@c @vindex flymake-fringe-indicator-position +@c @vindex flymake-error-bitmap +@c @vindex flymake-warning-bitmap +If the option @code{flymake-fringe-indicator-position} is non-@code{nil}, +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 @@ -162,6 +162,7 @@ next and previous path separator, respectively. *** 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 @@ when you receive a private message or your nickname is mentioned. *** 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 @@ See `flymake-fringe-indicator-position', `flymake-error-bitmap' and ** 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 old binding for `/ M' (filter by used-mode) is now bound to `/ m'. 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-insert-while | python-skeleton-while 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 @@ Sphinx support has been improved. *** `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 @@ table, but with a different prefix. ** 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 @@ in Emacs 24.1: *** `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 @@ stamps are still accepted. [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). diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f53b58b0129..6ab2880f09f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,53 @@ +2012-11-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * emacs-lisp/gv.el (gv-define-simple-setter): One more fix (bug#12871). + +2012-11-13 Wolfgang Jenkner <wjenkner@inode.at> + + * 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 2012-08-15T03:33:55Z!monnier@iro.umontreal.ca. + +2012-11-13 Fabián Ezequiel Gallina <fgallina@cuca> + + 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 <rgm@gnu.org> + + * 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 <dgutov@yandex.ru> + + * progmodes/ruby-mode.el (ruby-move-to-block): When moving + backward, always stop at indentation. Reverts the change from + 2012-08-12T22:06:56Z!monnier@iro.umontreal.ca (Bug#12851). + +2012-11-13 Glenn Morris <rgm@gnu.org> + + * 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 <monnier@iro.umontreal.ca> * emacs-lisp/nadvice.el: New package. diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el index 047b4b944b9..da2880c404c 100644 --- a/lisp/ansi-color.el +++ b/lisp/ansi-color.el @@ -534,34 +534,39 @@ Returns nil only if there's no match for `ansi-color-parameter-regexp'." 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 () diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog index 6f2669e9fee..755f4c8159b 100644 --- a/lisp/cedet/ChangeLog +++ b/lisp/cedet/ChangeLog @@ -1,7 +1,20 @@ +2012-11-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * 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 <rgm@gnu.org> + + * srecode/srt-mode.el (srecode-template-mode): + Don't change global values of comment-start, comment-end. (Bug#12781) + 2012-10-25 David Engster <deng@randomsample.de> - * 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'. diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el index c0e7b8f9038..8535c067e09 100644 --- a/lisp/cedet/semantic/grammar.el +++ b/lisp/cedet/semantic/grammar.el @@ -1333,8 +1333,8 @@ the change bounds to encompass the whole nonterminal tag." (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)) diff --git a/lisp/cedet/semantic/mru-bookmark.el b/lisp/cedet/semantic/mru-bookmark.el index d042ba42582..1358fc7d062 100644 --- a/lisp/cedet/semantic/mru-bookmark.el +++ b/lisp/cedet/semantic/mru-bookmark.el @@ -292,13 +292,13 @@ minor mode is enabled." (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))) diff --git a/lisp/cedet/semantic/util-modes.el b/lisp/cedet/semantic/util-modes.el index c9a0faefe6c..744d37ff189 100644 --- a/lisp/cedet/semantic/util-modes.el +++ b/lisp/cedet/semantic/util-modes.el @@ -221,11 +221,11 @@ minor mode is enabled." (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 @@ minor mode is enabled." (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 @@ minor mode is enabled." (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) diff --git a/lisp/cedet/srecode/srt-mode.el b/lisp/cedet/srecode/srt-mode.el index 12fc08b90e4..298c8949435 100644 --- a/lisp/cedet/srecode/srt-mode.el +++ b/lisp/cedet/srecode/srt-mode.el @@ -189,8 +189,8 @@ we can tell font lock about them.") ;;;###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]\\)\\(\\\\\\\\\\)*\\);+ *") diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 3d4f41be8ee..a378941a5a4 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -49,9 +49,9 @@ the middle is discarded, and just the beginning and end are displayed." :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 @@ The value used here is passed to `quit-restore-window'." (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.") diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 58bfae5b503..02eec08f96b 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -220,8 +220,9 @@ so as to preserve the semantics of `setf'." `(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. diff --git a/lisp/help.el b/lisp/help.el index 449818207b3..de2a22714f9 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -979,7 +979,7 @@ buffer, and should return a positive integer. At the time the 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). diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index c9dcff41618..72ca189e9d5 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -632,10 +632,13 @@ directory, like `default-directory'." '(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 @@ Marking commands: 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. diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 2614af9ffa4..5ba84f8991e 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -764,25 +764,39 @@ line number outside the file being compiled." (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) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index ee98feaef5e..949b0252bf1 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1074,12 +1074,9 @@ automatically if needed." 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 @@ non-nil if point is moved to `beginning-of-defun'." (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 @@ non-nil if point is moved to `beginning-of-defun'." (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 @@ non-nil if point is moved to `beginning-of-defun'." (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)) + (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) - ;; 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))))))) + ;; 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 @@ When argument ARG is non-nil do not include decorators." (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 @@ When argument ARG is non-nil do not include decorators." (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 @@ 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." - (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 @@ if that value is non-nil." '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 @@ if that value is non-nil." (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) diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index c9bfcefb748..67f25eda288 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -898,17 +898,7 @@ or blocks containing the current block." (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. diff --git a/lisp/window.el b/lisp/window.el index be6ddf8ab9e..30ee622cfe6 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -143,37 +143,36 @@ to `display-buffer'." 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 @@ A frame can be resized if and only if its root window is a live 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 @@ of `fit-frame-to-buffer-max-height' and `window-min-height'." 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) diff --git a/src/ChangeLog b/src/ChangeLog index 5905c667852..88352c201b6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2012-11-13 Eli Zaretskii <eliz@gnu.org> + + * 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 <eggert@cs.ucla.edu> Fix a race with verify-visited-file-modtime (Bug#12863). diff --git a/src/xdisp.c b/src/xdisp.c index 5bda3347fe8..12d7b89291c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -21371,6 +21371,12 @@ decode_mode_spec (struct window *w, register int c, int field_width, 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 @@ decode_mode_spec (struct window *w, register int c, int field_width, { 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 @@ decode_mode_spec (struct window *w, register int c, int field_width, 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 @@ decode_mode_spec (struct window *w, register int c, int field_width, 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++ = '?'; diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el index ba3040577b1..8da0041e9a4 100644 --- a/test/automated/ruby-mode-tests.el +++ b/test/automated/ruby-mode-tests.el @@ -202,13 +202,13 @@ VALUES-PLIST is a list with alternating index and value elements." | 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 |