------------------------------------------------------------ revno: 117501 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2014-07-09 10:25:35 +0400 message: Next minor cleanup of font subsystem. * font.h (enum font_property_index): Remove FONT_ENTITY_INDEX (no users) and FONT_FORMAT_INDEX (set by a few font drivers but never really used). (FONT_ENTITY_NOT_LOADABLE, FONT_ENTITY_SET_NOT_LOADABLE): Remove; unused. * ftfont.h (ftfont_font_format): Remove prototype. * ftfont.c (ftfont_font_format): Remove; now unused. (ftfont_open): * nsfont.m (nsfont_open): * w32font.c (w32font_open_internal): * w32uniscribe.c (uniscribe_open): * xfont.c (xfont_open): * xftfont.c (xftfont_open): All users changed. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-07-09 02:04:12 +0000 +++ src/ChangeLog 2014-07-09 06:25:35 +0000 @@ -1,3 +1,20 @@ +2014-07-09 Dmitry Antipov + + Next minor cleanup of font subsystem. + * font.h (enum font_property_index): Remove FONT_ENTITY_INDEX (no + users) and FONT_FORMAT_INDEX (set by a few font drivers but never + really used). + (FONT_ENTITY_NOT_LOADABLE, FONT_ENTITY_SET_NOT_LOADABLE): Remove; + unused. + * ftfont.h (ftfont_font_format): Remove prototype. + * ftfont.c (ftfont_font_format): Remove; now unused. + (ftfont_open): + * nsfont.m (nsfont_open): + * w32font.c (w32font_open_internal): + * w32uniscribe.c (uniscribe_open): + * xfont.c (xfont_open): + * xftfont.c (xftfont_open): All users changed. + 2014-07-09 Eli Zaretskii * xdisp.c (move_it_to): Adjust calculation of line_start_x to what === modified file 'src/font.h' --- src/font.h 2014-07-08 14:50:45 +0000 +++ src/font.h 2014-07-09 06:25:35 +0000 @@ -162,9 +162,6 @@ /* List of font-objects opened from the font-entity. */ FONT_OBJLIST_INDEX = FONT_SPEC_MAX, - /* Font-entity from which the font-object is opened. */ - FONT_ENTITY_INDEX = FONT_SPEC_MAX, - /* This value is the length of font-entity vector. */ FONT_ENTITY_MAX, @@ -182,9 +179,6 @@ is not available. */ FONT_FILE_INDEX, - /* Format of the font (symbol) or nil if unknown. */ - FONT_FORMAT_INDEX, - /* This value is the length of font-object vector. */ FONT_OBJECT_MAX }; @@ -442,15 +436,6 @@ #define FONT_OBJECT_P(x) \ (FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_OBJECT_MAX) -/* True iff ENTITY can't be loaded. */ -#define FONT_ENTITY_NOT_LOADABLE(entity) \ - EQ (AREF (entity, FONT_OBJLIST_INDEX), Qt) - -/* Flag ENTITY not loadable. */ -#define FONT_ENTITY_SET_NOT_LOADABLE(entity) \ - ASET (entity, FONT_OBJLIST_INDEX, Qt) - - /* Check macros for various font-related objects. */ #define CHECK_FONT(x) \ === modified file 'src/ftfont.c' --- src/ftfont.c 2014-07-08 14:50:45 +0000 +++ src/ftfont.c 2014-07-09 06:25:35 +0000 @@ -1223,7 +1223,6 @@ font_object = font_build_object (VECSIZE (struct ftfont_info), Qfreetype, entity, size); ASET (font_object, FONT_FILE_INDEX, filename); - ASET (font_object, FONT_FORMAT_INDEX, ftfont_font_format (NULL, filename)); font = XFONT_OBJECT (font_object); ftfont_info = (struct ftfont_info *) font; ftfont_info->ft_size = ft_face->size; @@ -2587,46 +2586,6 @@ #endif /* HAVE_OTF_GET_VARIATION_GLYPHS */ #endif /* HAVE_LIBOTF */ -Lisp_Object -ftfont_font_format (FcPattern *pattern, Lisp_Object filename) -{ - FcChar8 *str; - -#ifdef FC_FONTFORMAT - if (pattern) - { - if (FcPatternGetString (pattern, FC_FONTFORMAT, 0, &str) != FcResultMatch) - return Qnil; - if (strcmp ((char *) str, "TrueType") == 0) - return intern ("truetype"); - if (strcmp ((char *) str, "Type 1") == 0) - return intern ("type1"); - if (strcmp ((char *) str, "PCF") == 0) - return intern ("pcf"); - if (strcmp ((char *) str, "BDF") == 0) - return intern ("bdf"); - } -#endif /* FC_FONTFORMAT */ - if (STRINGP (filename)) - { - int len = SBYTES (filename); - - if (len >= 4) - { - str = (FcChar8 *) (SDATA (filename) + len - 4); - if (xstrcasecmp ((char *) str, ".ttf") == 0) - return intern ("truetype"); - if (xstrcasecmp ((char *) str, ".pfb") == 0) - return intern ("type1"); - if (xstrcasecmp ((char *) str, ".pcf") == 0) - return intern ("pcf"); - if (xstrcasecmp ((char *) str, ".bdf") == 0) - return intern ("bdf"); - } - } - return intern ("unknown"); -} - static const char *const ftfont_booleans [] = { ":antialias", ":hinting", === modified file 'src/ftfont.h' --- src/ftfont.h 2011-01-15 23:16:57 +0000 +++ src/ftfont.h 2014-07-09 06:25:35 +0000 @@ -36,7 +36,6 @@ #endif /* HAVE_M17N_FLT */ #endif /* HAVE_LIBOTF */ -extern Lisp_Object ftfont_font_format (FcPattern *, Lisp_Object); extern FcCharSet *ftfont_get_fc_charset (Lisp_Object); #endif /* EMACS_FTFONT_H */ === modified file 'src/nsfont.m' --- src/nsfont.m 2014-07-08 14:19:34 +0000 +++ src/nsfont.m 2014-07-09 06:25:35 +0000 @@ -830,9 +830,6 @@ font->baseline_offset = 0; font->relative_compose = 0; - font->props[FONT_FORMAT_INDEX] = Qns; - font->props[FONT_FILE_INDEX] = Qnil; - { const char *fontName = [[nsfont fontName] UTF8String]; === modified file 'src/w32font.c' --- src/w32font.c 2014-07-04 02:28:54 +0000 +++ src/w32font.c 2014-07-09 06:25:35 +0000 @@ -886,7 +886,7 @@ LOGFONT logfont; HDC dc; HFONT hfont, old_font; - Lisp_Object val, extra; + Lisp_Object val; struct w32font_info *w32_font; struct font * font; OUTLINETEXTMETRICW* metrics = NULL; @@ -979,21 +979,6 @@ font->default_ascent = w32_font->metrics.tmAscent; font->pixel_size = size; font->driver = &w32font_driver; - /* Use format cached during list, as the information we have access to - here is incomplete. */ - extra = AREF (font_entity, FONT_EXTRA_INDEX); - if (CONSP (extra)) - { - val = assq_no_quit (QCformat, extra); - if (CONSP (val)) - font->props[FONT_FORMAT_INDEX] = XCDR (val); - else - font->props[FONT_FORMAT_INDEX] = Qunknown; - } - else - font->props[FONT_FORMAT_INDEX] = Qunknown; - - font->props[FONT_FILE_INDEX] = Qnil; font->encoding_charset = -1; font->repertory_charset = -1; /* TODO: do we really want the minimum width here, which could be negative? */ === modified file 'src/w32uniscribe.c' --- src/w32uniscribe.c 2014-07-04 02:28:54 +0000 +++ src/w32uniscribe.c 2014-07-09 06:25:35 +0000 @@ -127,8 +127,6 @@ /* Uniscribe backend uses glyph indices. */ uniscribe_font->w32_font.glyph_idx = ETO_GLYPH_INDEX; - /* Mark the format as opentype */ - uniscribe_font->w32_font.font.props[FONT_FORMAT_INDEX] = Qopentype; uniscribe_font->w32_font.font.driver = &uniscribe_font_driver; return font_object; === modified file 'src/xfont.c' --- src/xfont.c 2014-07-04 02:28:54 +0000 +++ src/xfont.c 2014-07-09 06:25:35 +0000 @@ -804,8 +804,6 @@ ASET (font_object, FONT_NAME_INDEX, make_string (buf, len)); } ASET (font_object, FONT_FULLNAME_INDEX, fullname); - ASET (font_object, FONT_FILE_INDEX, Qnil); - ASET (font_object, FONT_FORMAT_INDEX, Qx); font = XFONT_OBJECT (font_object); ((struct xfont_info *) font)->xfont = xfont; ((struct xfont_info *) font)->display = FRAME_X_DISPLAY (f); === modified file 'src/xftfont.c' --- src/xftfont.c 2014-07-08 14:50:45 +0000 +++ src/xftfont.c 2014-07-09 06:25:35 +0000 @@ -343,8 +343,6 @@ font_object = font_build_object (VECSIZE (struct xftfont_info), Qxft, entity, size); ASET (font_object, FONT_FILE_INDEX, filename); - ASET (font_object, FONT_FORMAT_INDEX, - ftfont_font_format (xftfont->pattern, filename)); font = XFONT_OBJECT (font_object); font->pixel_size = size; font->driver = &xftfont_driver; ------------------------------------------------------------ revno: 117500 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2014-07-08 22:20:21 -0400 message: * lisp/rect.el (apply-on-rectangle): Check forward-line really moved to the next line. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-09 02:04:12 +0000 +++ lisp/ChangeLog 2014-07-09 02:20:21 +0000 @@ -1,5 +1,10 @@ 2014-07-09 Stefan Monnier + * rect.el (apply-on-rectangle): Check forward-line really moved to the + next line. + +2014-07-09 Stefan Monnier + * progmodes/sh-script.el (sh-smie-sh-rules): Don't align with a && in the middle of a line (bug#17896). === modified file 'lisp/rect.el' --- lisp/rect.el 2014-07-03 22:22:42 +0000 +++ lisp/rect.el 2014-07-09 02:20:21 +0000 @@ -163,7 +163,7 @@ (progn (apply function startcol endcol args) (setq final-point (point)) - (and (zerop (forward-line 1)) + (and (zerop (forward-line 1)) (bolp) (<= (point) endpt)))) final-point))) ------------------------------------------------------------ revno: 117499 [merge] committer: Glenn Morris branch nick: trunk timestamp: Tue 2014-07-08 19:04:12 -0700 message: Merge from emacs-24; up to r117365 diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2014-07-03 06:00:53 +0000 +++ doc/emacs/ChangeLog 2014-07-09 02:04:12 +0000 @@ -1,3 +1,8 @@ +2014-07-09 Juri Linkov + + * search.texi (Regexp Search): Update lax space matching that is + not active in regexp search by default now. (Bug#17901) + 2014-07-03 Glenn Morris * help.texi (Misc Help): === modified file 'doc/emacs/search.texi' --- doc/emacs/search.texi 2014-04-29 14:45:24 +0000 +++ doc/emacs/search.texi 2014-07-03 23:52:42 +0000 @@ -602,12 +602,13 @@ They also have separate search rings, which you can access with @kbd{M-p} and @kbd{M-n}. - Just as in ordinary incremental search, any @key{SPC} typed in -incremental regexp search matches any sequence of one or more -whitespace characters. The variable @code{search-whitespace-regexp} -specifies the regexp for the lax space matching, and @kbd{M-s @key{SPC}} -(@code{isearch-toggle-lax-whitespace}) toggles the feature. -@xref{Special Isearch}. + Unlike ordinary incremental search, incremental regexp search +do not use lax space matching by default. To toggle this feature +use @kbd{M-s @key{SPC}} (@code{isearch-toggle-lax-whitespace}). +Then any @key{SPC} typed in incremental regexp search will match +any sequence of one or more whitespace characters. The variable +@code{search-whitespace-regexp} specifies the regexp for the lax +space matching. @xref{Special Isearch}. In some cases, adding characters to the regexp in an incremental regexp search can make the cursor move back and start again. For === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-07-03 06:00:53 +0000 +++ doc/lispref/ChangeLog 2014-07-09 02:04:12 +0000 @@ -1,3 +1,8 @@ +2014-07-09 Stefan Monnier + + * debugging.texi (Function Debugging, Debugger Commands): + Update debug-on-entry w.r.t behavior after redefinitions (bug#17902). + 2014-07-03 Glenn Morris * help.texi (Help Functions): "Online" help doesn't mean what it === modified file 'doc/lispref/debugging.texi' --- doc/lispref/debugging.texi 2014-02-13 08:26:01 +0000 +++ doc/lispref/debugging.texi 2014-07-08 18:24:39 +0000 @@ -226,9 +226,7 @@ @deffn Command debug-on-entry function-name This function requests @var{function-name} to invoke the debugger each -time it is called. It works by inserting the form -@code{(implement-debug-on-entry)} into the function definition as the -first form. +time it is called. Any function or macro defined as Lisp code may be set to break on entry, regardless of whether it is interpreted code or compiled code. @@ -244,11 +242,6 @@ up to invoke the debugger on entry, @code{debug-on-entry} does nothing. @code{debug-on-entry} always returns @var{function-name}. -@strong{Warning:} if you redefine a function after using -@code{debug-on-entry} on it, the code to enter the debugger is -discarded by the redefinition. In effect, redefining the function -cancels the break-on-entry feature for that function. - Here's an example to illustrate use of this function: @example @@ -277,12 +270,6 @@ ------ Buffer: *Backtrace* ------ @end group -@group -(symbol-function 'fact) - @result{} (lambda (n) - (debug (quote debug)) - (if (zerop n) 1 (* n (fact (1- n))))) -@end group @end example @end deffn @@ -461,9 +448,7 @@ @item l Display a list of functions that will invoke the debugger when called. This is a list of functions that are set to break on entry by means of -@code{debug-on-entry}. @strong{Warning:} if you redefine such a -function and thus cancel the effect of @code{debug-on-entry}, it may -erroneously show up in this list. +@code{debug-on-entry}. @item v Toggle the display of local variables of the current stack frame. === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-07-03 09:10:05 +0000 +++ doc/misc/ChangeLog 2014-07-09 02:04:12 +0000 @@ -1,3 +1,9 @@ +2014-07-09 Stephen Berman + + * todo-mode.texi (Levels of Organization): Comment out statement + that Emacs recognizes todo files by their extension, since this + feature has been removed due to bug#17482. + 2014-07-03 Michael Albinus * trampver.texi: Update release number. === modified file 'doc/misc/todo-mode.texi' --- doc/misc/todo-mode.texi 2014-06-10 02:20:31 +0000 +++ doc/misc/todo-mode.texi 2014-07-09 02:04:12 +0000 @@ -158,11 +158,10 @@ All todo files reside in a single directory, whose location is specified by the user option @code{todo-directory}. This directory may also contain other types of Todo files, which are discussed later -(@pxref{Todo Archive Mode} and @ref{Todo Filtered Items Mode}). Emacs -recognizes Todo files by their extension, so when you visit the files -the buffer is in the appropriate mode and the current category is -correctly displayed. - +(@pxref{Todo Archive Mode} and @ref{Todo Filtered Items Mode}). +@c Emacs recognizes Todo files by their extension, so when you visit +@c the files the buffer is in the appropriate mode and the current +@c category is correctly displayed. When you use a Todo mode command to create a todo file, the extension @samp{.todo} is automatically added to the base name you choose (as a rule, this name is also used for the other types of Todo files, which === modified file 'etc/NEWS' --- etc/NEWS 2014-07-08 08:49:18 +0000 +++ etc/NEWS 2014-07-09 02:04:12 +0000 @@ -1166,11 +1166,11 @@ Some languages match those as »...«, and others as «...», so it is better for Emacs to stay neutral by default. -** `read-event' does not return decoded chars in ttys any more. -As was the case in Emacs 22 and before, the decoding of terminal -input, according to `keyboard-coding-system', is not performed in -`read-event' any more. But unlike in Emacs 22, this decoding is still -done before `input-decode-map', `function-key-map', etc. +** `read-event' does not always decode chars in ttys any more. As was the case +in Emacs 22 and before, `read-event' (and `read-char') by default read raw +bytes from the terminal. If you want to read decoded chars instead (as was +always the case in Emacs-23, for example), pass a non-nil +`inherit-input-method' argument. ** In `symbol-function', nil and "unbound" are indistinguishable. `symbol-function' does not signal a `void-function' error any more. @@ -1519,10 +1519,13 @@ "Interlocking" in the Emacs User Manual for the details. To disable file locking, customize `create-lockfiles' to nil. -** The "generate a backtrace on fatal error" feature now works on MS Windows. +** The "generate a backtrace on fatal error" feature now works on MS-Windows. The backtrace is written to the 'emacs_backtrace.txt' file in the directory where Emacs was running. +** The `network-interface-list' and `network-interface-info' functions +are now available on MS-Windows. + ** The variable `buffer-file-type' is no longer supported. Setting it has no effect, and %t in the mode-line format is ignored. Likewise, `file-name-buffer-file-type-alist' is now obsolete, and === modified file 'etc/TODO' --- etc/TODO 2014-06-08 00:35:27 +0000 +++ etc/TODO 2014-07-09 02:04:12 +0000 @@ -167,14 +167,6 @@ ** Find a proper fix for rcirc multiline nick adding. http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg00684.html -** Implement `network-interface-list' and `network-interface-info' -on MS-Windows. Hint: the information is present in the Registry, -under the keys -HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Linkage\ -and -HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\\ -where is the network device found under the first key. - ** Check for any included packages that define obsolete bug-reporting commands. Change them to use report-emacs-bug. *** Related functions: @@ -232,8 +224,15 @@ ** FFI (foreign function interface) See eg http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00246.html +One way of doing this is to start with fx's dynamic loading, and use it +to implement things like auto-loaded buffer parsers and database +access in cases which need more than Lisp. + ** Replace unexec with a more portable form of dumping See eg http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01034.html + http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00452.html + +One way is to provide portable undumping using mmap (per gerd design). ** Imenu could be extended into a file-structure browsing mechanism using code like that of customize-groups. @@ -260,13 +259,15 @@ by http://savannah.nongnu.org/projects/emacs-rtf/, which is still in very early stages. + Another place to look is the Wikipedia article at + http://en.wikipedia.org/wiki/Rich_Text_Format + + It currently points to the latest spec of RTF v1.9.1 at + http://www.microsoft.com/en-us/download/details.aspx?id=10725 + ** Implement primitive and higher-level functions to allow filling properly with variable-pitch faces. -** Implement a smoother vertical scroll facility, one that allows - C-v to scroll through a tall image. The primitive operations - posn-at-point and posn-at-x-y should now make it doable in elisp. - ** Implement intelligent search/replace, going beyond query-replace (see http://groups.csail.mit.edu/uid/projects/clustering/chi04.pdf). @@ -301,9 +302,6 @@ Maybe making Lucid menus work like Gtk's (i.e. just force utf-8) is good enough now that Emacs can encode most chars into utf-8. -** Remove the limitation that window and frame widths and heights can - be only full columns/lines. - ** The GNUstep port needs some serious attention, ideally from someone familiar with GNUstep and Objective C. @@ -317,6 +315,7 @@ ** Allow frames(terminals) created by emacsclient to inherit their environment from the emacsclient process. + ** Remove the default toggling behavior of minor modes when called from elisp rather than interactively. This a trivial one-liner in easy-mode.el. @@ -388,23 +387,6 @@ user-selected input method, with the default being the union of latin-1-prefix and latin-1-postfix. -** Switch the Windows port to using Unicode keyboard input (maybe). - Based on http://msdn2.microsoft.com/en-us/library/ms633586.aspx, - this boils down to (1) calling RegisterClassW function to register - Emacs windows, and (2) modifying ALL system messages to use Unicode. - In particular, WM_CHAR messages, which result from keyboard input, - will then come in encoded in UTF-16. - - One advantage of switching to Unicode is to toss encoded-kbd usage, - which will solve the problem with binding non-ASCII keys with modifiers. - - Problem: using this on Windows 9x/ME requires installing the - Microsoft Layer for Unicode (MSLU), which might not implement all - the required functionality that is available built-in on Windows XP - and later. We should not make this change if it would pressure - users of unauthorized copies of older versions of Windows to - downgrade to versions that require activation. - ** Implement a clean way to use different major modes for different parts of a buffer. This could be useful in editing Bison input files, for instance, or other kinds of text @@ -452,9 +434,6 @@ multiple inheritance ? faster where-is ? no more fix_submap_inheritance ? what else ? -** Provide real menus on ttys. The MS-DOS implementation can serve as - an example how to do part of this; see the XMenu* functions on msdos.c. - ** Implement popular parts of the rest of the CL functions as compiler macros in cl-macs. [Is this still relevant now that cl-lib exists?] @@ -518,15 +497,9 @@ tree displays generally, mode-line mail indicator. [See work done already for Emacs 23 and consult fx.] -** Do something to make rms happy with fx's dynamic loading, and use it - to implement things like auto-loaded buffer parsers and database - access in cases which need more than Lisp. - ** Extend ps-print to deal with multiple font sizes, images, and extra encodings. -** Provide portable undumping using mmap (per gerd design). - ** Make byte-compile avoid binding an expanded defsubst's args when the body only calls primitives. @@ -735,7 +708,7 @@ Try (setq image-type-header-regexps nil) for a quick hack to prefer ImageMagick over the jpg loader. -*** For some reason its unbearably slow to look at a page in a large +*** For some reason it's unbearably slow to look at a page in a large image bundle using the :index feature. The ImageMagick "display" command is also a bit slow, but nowhere near as slow as the Emacs code. It seems ImageMagick tries to unpack every page when loading the === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-08 19:33:37 +0000 +++ lisp/ChangeLog 2014-07-09 02:04:12 +0000 @@ -1,3 +1,66 @@ +2014-07-09 Stefan Monnier + + * progmodes/sh-script.el (sh-smie-sh-rules): Don't align with a && in + the middle of a line (bug#17896). + +2014-07-09 Juri Linkov + + * startup.el (command-line): Append displaying the warning about + the errors in the init file to the end of `after-init-hook'. + (Bug#17927) + + * faces.el (face-name): Return input arg `face' as-is + when it's not a symbol. + (x-resolve-font-name): Don't check if the face is a symbol. + (Bug#17956) + + * facemenu.el (list-colors-print): In help-echo format use %.2f + instead of %d because now HSV values are floating-point components + between 0.0 and 1.0. + +2014-07-09 Glenn Morris + + * emulation/cua-rect.el (cua--activate-rectangle): + Avoid setting cua--rectangle to nil. (Bug#17877) + +2014-07-09 Stephen Berman + + * calendar/todo-mode.el: Fix wrong-type-argument error when + marking multiple consecutive items. + (todo-toggle-mark-item): Don't try to mark the empty lines at the + end of the todo and done items sections. Note in doc string that + items marked by passing a numeric prefix argument can include the + last todo and first done items. + (todo-mark-category): Don't try to mark the empty line between the + todo and done items sections. + +2014-07-09 Stefan Monnier + + * emacs-lisp/edebug.el (edebug-eval-defun): Print result using + proper Lisp quoting (bug#17934). + + * progmodes/ruby-mode.el (ruby-mode-variables): Don't meddle with + require-final-newline since prog-mode already took care of it (bug#17947). + +2014-07-09 Stephen Berman + + * calendar/todo-mode.el: Fix two bugs. Shorten Commentary and + refer to the Todo mode Info manual. Update the comment on + requiring cl-lib. + (todo-find-filtered-items-file): Add todo-prefix overlays. + (todo-filter-items): Reorder a let-bound variable to avoid a + wrong-type-argument error on canceling the file choice dialog. + +2014-07-09 Stefan Monnier + + * progmodes/octave.el (inferior-octave-mode): + Set comint-input-ring-size to a number (bug#17912). + +2014-07-09 Juri Linkov + + * desktop.el (desktop-minor-mode-table): Add `defining-kbd-macro' + and `isearch-mode' associated with nil. (Bug#17849) + 2014-07-08 Stefan Monnier * linum.el (linum--face-height): New function (bug#17813). === modified file 'lisp/calendar/todo-mode.el' --- lisp/calendar/todo-mode.el 2014-07-08 19:15:28 +0000 +++ lisp/calendar/todo-mode.el 2014-07-09 02:04:12 +0000 @@ -24,63 +24,37 @@ ;;; Commentary: -;; This package provides facilities for making, displaying, navigating -;; and editing todo lists, which are prioritized lists of todo items. -;; Todo lists are identified with named categories, so you can group -;; together and separately prioritize thematically related todo items. -;; Each category is stored in a file, which thus provides a further -;; level of organization. You can create as many todo files, and in -;; each as many categories, as you want. +;; This package provides facilities for making and maintaining +;; prioritized lists of things to do. These todo lists are identified +;; with named categories, so you can group together thematically +;; related todo items. Each category is stored in a file, providing a +;; further level of organization. You can create as many todo files, +;; and in each as many categories, as you want. ;; With Todo mode you can navigate among the items of a category, and ;; between categories in the same and in different todo files. You -;; can edit todo items, reprioritize them within their category, move -;; them to another category, delete them, or mark items as done and -;; store them separately from the not yet done items in a category. -;; You can add new todo files, edit and delete them. You can add new -;; categories, rename and delete them, move categories to another file -;; and merge the items of two categories. You can also reorder the -;; sequence of categories in a todo file for the purpose of -;; navigation. You can display summary tables of the categories in a -;; file and the types of items they contain. And you can compile -;; lists of existing items from multiple categories in one or more -;; todo files, which are filtered by various criteria. - -;; To get started, load this package and type `M-x todo-show'. This -;; will prompt you for the name of the first todo file, its first -;; category and the category's first item, create these and display -;; them in Todo mode. Now you can insert further items into the list -;; (i.e., the category) and assign them priorities by typing `i i'. - -;; You will probably find it convenient to give `todo-show' a global -;; key binding in your init file, since it is one of the entry points -;; to Todo mode; a good choice is `C-c t', since `todo-show' is -;; bound to `t' in Todo mode. - -;; To see a list of all Todo mode commands and their key bindings, -;; including other entry points, type `C-h m' in Todo mode. Consult -;; the documentation strings of the commands for details of their use. -;; The `todo' customization group and its subgroups list the options -;; you can set to alter the behavior of many commands and various -;; aspects of the display. - -;; This package is a new version of Oliver Seidel's todo-mode.el. -;; While it retains the same basic organization and handling of todo -;; lists and the basic UI, it significantly extends these and adds -;; many features. This required also making changes to the internals, -;; including the file format. If you have a todo file in old format, -;; then the first time you invoke `todo-show' (i.e., before you have -;; created any todo file in the current format), it will ask you -;; whether to convert that file and show it. If you choose not to -;; convert the old-style file at this time, you can do so later by -;; calling the command `todo-convert-legacy-files'. +;; can add and edit todo items, reprioritize them, move them to +;; another category, or delete them. You can also mark items as done +;; and store them within their category or in separate archive files. +;; You can include todo items in the Emacs Fancy Diary display and +;; treat them as appointments. You can add new todo files, and rename +;; or delete them. You can add new categories to a file, rename or +;; delete them, move a category to another file and merge the items of +;; two categories. You can also reorder the sequence of categories in +;; a todo file for the purpose of navigation. You can display +;; sortable summary tables of the categories in a file and the types +;; of items they contain. And you can filter items by various +;; criteria from multiple categories in one or more todo files to +;; create prioritizable cross-category overviews of your todo items. + +;; To get started, type `M-x todo-show'. For full details of the user +;; interface, commands and options, consult the Todo mode user manual, +;; which is included in the Info documentation. ;;; Code: (require 'diary-lib) -;; For cl-remove-duplicates (in todo-insertion-commands-args) and -;; cl-oddp. -(require 'cl-lib) +(require 'cl-lib) ; For cl-oddp and cl-assert. ;; ----------------------------------------------------------------------------- ;;; Setting up todo files, categories, and items @@ -1736,31 +1710,40 @@ (defun todo-toggle-mark-item (&optional n) "Mark item with `todo-item-mark' if unmarked, otherwise unmark it. -With a positive numerical prefix argument N, change the -marking of the next N items." +With positive numerical prefix argument N, change the marking of +the next N items in the current category. If both the todo and +done items sections are visible, the sequence of N items can +consist of the the last todo items and the first done items." (interactive "p") (when (todo-item-string) (unless (> n 1) (setq n 1)) - (dotimes (i n) - (let* ((cat (todo-current-category)) - (marks (assoc cat todo-categories-with-marks)) - (ov (progn - (unless (looking-at todo-item-start) - (todo-item-start)) - (todo-get-overlay 'prefix))) - (pref (overlay-get ov 'before-string))) - (if (todo-marked-item-p) - (progn - (overlay-put ov 'before-string (substring pref 1)) - (if (= (cdr marks) 1) ; Deleted last mark in this category. - (setq todo-categories-with-marks - (assq-delete-all cat todo-categories-with-marks)) - (setcdr marks (1- (cdr marks))))) - (overlay-put ov 'before-string (concat todo-item-mark pref)) - (if marks - (setcdr marks (1+ (cdr marks))) - (push (cons cat 1) todo-categories-with-marks)))) - (todo-forward-item)))) + (catch 'end + (dotimes (i n) + (let* ((cat (todo-current-category)) + (marks (assoc cat todo-categories-with-marks)) + (ov (progn + (unless (looking-at todo-item-start) + (todo-item-start)) + (todo-get-overlay 'prefix))) + (pref (overlay-get ov 'before-string))) + (if (todo-marked-item-p) + (progn + (overlay-put ov 'before-string (substring pref 1)) + (if (= (cdr marks) 1) ; Deleted last mark in this category. + (setq todo-categories-with-marks + (assq-delete-all cat todo-categories-with-marks)) + (setcdr marks (1- (cdr marks))))) + (overlay-put ov 'before-string (concat todo-item-mark pref)) + (if marks + (setcdr marks (1+ (cdr marks))) + (push (cons cat 1) todo-categories-with-marks)))) + (todo-forward-item) + ;; Don't try to mark the empty lines at the end of the todo + ;; and done items sections. + (when (looking-at "^$") + (if (eobp) + (throw 'end nil) + (todo-forward-item))))))) (defun todo-mark-category () "Mark all visible items in this category with `todo-item-mark'." @@ -1777,7 +1760,12 @@ (if marks (setcdr marks (1+ (cdr marks))) (push (cons cat 1) todo-categories-with-marks)))) - (todo-forward-item))))) + (todo-forward-item) + ;; Don't try to mark the empty line between the todo and done + ;; items sections. + (when (looking-at "^$") + (unless (eobp) + (todo-forward-item))))))) (defun todo-unmark-category () "Remove `todo-item-mark' from all visible items in this category." @@ -3973,7 +3961,8 @@ (setq file (cdr (assoc-string file falist))) (find-file file) (unless (derived-mode-p 'todo-filtered-items-mode) - (todo-filtered-items-mode)))) + (todo-filtered-items-mode)) + (todo-prefix-overlays))) (defun todo-go-to-source-item () "Display the file and category of the filtered item at point." @@ -4082,7 +4071,6 @@ (progn (todo-multiple-filter-files) todo-multiple-filter-files)) (list todo-current-todo-file))) - (multi (> (length flist) 1)) (fname (if (equal flist 'quit) ;; Pressed `cancel' in t-m-f-f file selection dialog. (keyboard-quit) @@ -4091,6 +4079,7 @@ (cond (top ".todt") (diary ".tody") (regexp ".todr"))))) + (multi (> (length flist) 1)) (rxfiles (when regexp (directory-files todo-directory t ".*\\.todr$" t))) (file-exists (or (file-exists-p fname) rxfiles)) === modified file 'lisp/desktop.el' --- lisp/desktop.el 2014-07-02 23:45:12 +0000 +++ lisp/desktop.el 2014-07-03 23:48:24 +0000 @@ -528,6 +528,8 @@ (defcustom desktop-minor-mode-table '((auto-fill-function auto-fill-mode) + (defining-kbd-macro nil) + (isearch-mode nil) (vc-mode nil) (vc-dired-mode nil) (erc-track-minor-mode nil) === modified file 'lisp/emacs-lisp/edebug.el' --- lisp/emacs-lisp/edebug.el 2014-02-25 21:55:45 +0000 +++ lisp/emacs-lisp/edebug.el 2014-07-05 19:11:59 +0000 @@ -497,7 +497,7 @@ (setq edebug-result (eval (eval-sexp-add-defvars form) lexical-binding)) (if (not edebugging) (prog1 - (princ edebug-result) + (prin1 edebug-result) (let ((str (eval-expression-print-format edebug-result))) (if str (princ str)))) edebug-result))) === modified file 'lisp/emulation/cua-rect.el' --- lisp/emulation/cua-rect.el 2014-01-01 07:43:34 +0000 +++ lisp/emulation/cua-rect.el 2014-07-06 23:58:52 +0000 @@ -726,11 +726,11 @@ ;; Set cua--rectangle to indicate we're marking a rectangle. ;; Be careful if we are already marking a rectangle. (setq cua--rectangle - (if (and cua--last-rectangle + (or (and cua--last-rectangle (eq (car cua--last-rectangle) (current-buffer)) - (eq (car (cdr cua--last-rectangle)) (point))) - (cdr (cdr cua--last-rectangle)) - (cua--rectangle-get-corners)) + (eq (car (cdr cua--last-rectangle)) (point)) + (cdr (cdr cua--last-rectangle))) + (cua--rectangle-get-corners)) cua--status-string (if (cua--rectangle-virtual-edges) " [R]" "") cua--last-rectangle nil) (activate-mark)) === modified file 'lisp/facemenu.el' --- lisp/facemenu.el 2014-01-01 07:43:34 +0000 +++ lisp/facemenu.el 2014-07-08 08:55:00 +0000 @@ -620,7 +620,7 @@ 'help-echo (let ((hsv (apply 'color-rgb-to-hsv (color-name-to-rgb (car color))))) - (format "H:%d S:%d V:%d" + (format "H:%.2f S:%.2f V:%.2f" (nth 0 hsv) (nth 1 hsv) (nth 2 hsv))))) (when callback (make-text-button === modified file 'lisp/faces.el' --- lisp/faces.el 2014-04-30 19:54:52 +0000 +++ lisp/faces.el 2014-07-09 02:04:12 +0000 @@ -370,7 +370,10 @@ (defun face-name (face) "Return the name of face FACE." - (symbol-name (check-face face))) + (check-face face) + (if (symbolp face) + (symbol-name face) + face)) (defun face-all-attributes (face &optional frame) @@ -2746,8 +2749,8 @@ contains wildcards. Given optional arguments FACE and FRAME, return a font which is also the same size as FACE on FRAME, or fail." - (or (symbolp face) - (setq face (face-name face))) + (when face + (setq face (face-name face))) (and (eq frame t) (setq frame nil)) (if pattern === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2014-04-12 04:07:53 +0000 +++ lisp/progmodes/octave.el 2014-07-04 01:35:23 +0000 @@ -747,9 +747,10 @@ (setq-local info-lookup-mode 'octave-mode) (setq-local eldoc-documentation-function 'octave-eldoc-function) - (setq comint-input-ring-file-name - (or (getenv "OCTAVE_HISTFILE") "~/.octave_hist") - comint-input-ring-size (or (getenv "OCTAVE_HISTSIZE") 1024)) + (setq-local comint-input-ring-file-name + (or (getenv "OCTAVE_HISTFILE") "~/.octave_hist")) + (setq-local comint-input-ring-size + (string-to-number (or (getenv "OCTAVE_HISTSIZE") "1024"))) (comint-read-input-ring t) (setq-local comint-dynamic-complete-functions inferior-octave-dynamic-complete-functions) === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2014-06-16 03:33:29 +0000 +++ lisp/progmodes/ruby-mode.el 2014-07-05 18:37:45 +0000 @@ -749,7 +749,6 @@ :forward-token #'ruby-smie--forward-token :backward-token #'ruby-smie--backward-token) (setq-local indent-line-function 'ruby-indent-line)) - (setq-local require-final-newline t) (setq-local comment-start "# ") (setq-local comment-end "") (setq-local comment-column ruby-comment-column) === modified file 'lisp/progmodes/sh-script.el' --- lisp/progmodes/sh-script.el 2014-06-26 06:55:15 +0000 +++ lisp/progmodes/sh-script.el 2014-07-09 02:04:12 +0000 @@ -2012,9 +2012,10 @@ (<= indent initial))))) `(column . ,(+ initial sh-indentation))) (`(:before . ,(or `"(" `"{" `"[")) - (when (smie-rule-hanging-p) - (if (not (smie-rule-prev-p "&&" "||" "|")) - (smie-rule-parent) + (if (not (smie-rule-prev-p "&&" "||" "|")) + (when (smie-rule-hanging-p) + (smie-rule-parent)) + (unless (smie-rule-bolp) (smie-backward-sexp 'halfexp) `(column . ,(smie-indent-virtual))))) ;; FIXME: Maybe this handling of ;; should be made into === modified file 'lisp/startup.el' --- lisp/startup.el 2014-06-08 23:41:43 +0000 +++ lisp/startup.el 2014-07-09 02:04:12 +0000 @@ -1182,18 +1182,25 @@ (funcall inner) (setq init-file-had-error nil)) (error - (display-warning - 'initialization - (format "An error occurred while loading `%s':\n\n%s%s%s\n\n\ + ;; Postpone displaying the warning until all hooks + ;; in `after-init-hook' like `desktop-read' will finalize + ;; possible changes in the window configuration. + (add-hook + 'after-init-hook + (lambda () + (display-warning + 'initialization + (format "An error occurred while loading `%s':\n\n%s%s%s\n\n\ To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the `--debug-init' option to view a complete error backtrace." - user-init-file - (get (car error) 'error-message) - (if (cdr error) ": " "") - (mapconcat (lambda (s) (prin1-to-string s t)) - (cdr error) ", ")) - :warning) + user-init-file + (get (car error) 'error-message) + (if (cdr error) ": " "") + (mapconcat (lambda (s) (prin1-to-string s t)) + (cdr error) ", ")) + :warning)) + t) (setq init-file-had-error t)))) (if (and deactivate-mark transient-mark-mode) === modified file 'src/ChangeLog' --- src/ChangeLog 2014-07-08 17:13:32 +0000 +++ src/ChangeLog 2014-07-09 02:04:12 +0000 @@ -1,3 +1,37 @@ +2014-07-09 Eli Zaretskii + + * xdisp.c (move_it_to): Adjust calculation of line_start_x to what + x_produce_glyphs does when it generates a stretch glyph that + represents a TAB. (Bug#17969) + + * xdisp.c (pos_visible_p): If CHARPOS is at beginning of window, + and there is a display property at that position, don't call + move_it_to to move to a position before window start. (Bug#17942) + Fix condition for finding CHARPOS by the first call to move_it_to. + (Bug#17944) + +2014-07-09 Stefan Monnier + + * syntax.c (find_defun_start): Try the cache even + if !open_paren_in_column_0_is_defun_start. + (back_comment): If find_defun_start was pessimistic, use the + scan_sexps_forward result to improve the cache (bug#16526). + +2014-07-09 Eli Zaretskii + + * xdisp.c (redisplay_window): If redisplay of a window ends up + with point in a partially visible line at end of the window, make + sure the amended position of point actually has smaller Y + coordinate; if not, give up and scroll the display. (Bug#17905) + + * window.c (window_scroll_pixel_based): When point ends up at the + last fully visible line, don't let move_it_to stop at the left + edge of the line and dupe us into thinking point is inside the + scroll margin. + + * w32.c (network_interface_info): Make sure the argument is a + Lisp string. + 2014-07-08 Paul Eggert * process.c (read_and_dispose_of_process_output): Fix typo === modified file 'src/syntax.c' --- src/syntax.c 2014-02-08 05:12:47 +0000 +++ src/syntax.c 2014-07-05 02:17:14 +0000 @@ -530,17 +530,6 @@ { ptrdiff_t opoint = PT, opoint_byte = PT_BYTE; - if (!open_paren_in_column_0_is_defun_start) - { - find_start_value = BEGV; - find_start_value_byte = BEGV_BYTE; - find_start_buffer = current_buffer; - find_start_modiff = MODIFF; - find_start_begv = BEGV; - find_start_pos = pos; - return BEGV; - } - /* Use previous finding, if it's valid and applies to this inquiry. */ if (current_buffer == find_start_buffer /* Reuse the defun-start even if POS is a little farther on. @@ -552,6 +541,13 @@ && MODIFF == find_start_modiff) return find_start_value; + if (!open_paren_in_column_0_is_defun_start) + { + find_start_value = BEGV; + find_start_value_byte = BEGV_BYTE; + goto found; + } + /* Back up to start of line. */ scan_newline (pos, pos_byte, BEGV, BEGV_BYTE, -1, 1); @@ -582,13 +578,14 @@ /* Record what we found, for the next try. */ find_start_value = PT; find_start_value_byte = PT_BYTE; + TEMP_SET_PT_BOTH (opoint, opoint_byte); + + found: find_start_buffer = current_buffer; find_start_modiff = MODIFF; find_start_begv = BEGV; find_start_pos = pos; - TEMP_SET_PT_BOTH (opoint, opoint_byte); - return find_start_value; } @@ -841,7 +838,9 @@ else { struct lisp_parse_state state; + bool adjusted; lossage: + adjusted = true; /* We had two kinds of string delimiters mixed up together. Decode this going forwards. Scan fwd from a known safe place (beginning-of-defun) @@ -852,6 +851,7 @@ { defun_start = find_defun_start (comment_end, comment_end_byte); defun_start_byte = find_start_value_byte; + adjusted = (defun_start > BEGV); } do { @@ -860,6 +860,16 @@ comment_end, TYPE_MINIMUM (EMACS_INT), 0, Qnil, 0); defun_start = comment_end; + if (!adjusted) + { + adjusted = true; + find_start_value + = CONSP (state.levelstarts) ? XINT (XCAR (state.levelstarts)) + : state.thislevelstart >= 0 ? state.thislevelstart + : find_start_value; + find_start_value_byte = CHAR_TO_BYTE (find_start_value); + } + if (state.incomment == (comnested ? 1 : -1) && state.comstyle == comstyle) from = state.comstr_start; === modified file 'src/w32.c' --- src/w32.c 2014-05-26 16:55:28 +0000 +++ src/w32.c 2014-07-09 02:04:12 +0000 @@ -8612,6 +8612,7 @@ Lisp_Object network_interface_info (Lisp_Object ifname) { + CHECK_STRING (ifname); return network_interface_get_info (ifname); } === modified file 'src/window.c' --- src/window.c 2014-06-17 16:09:19 +0000 +++ src/window.c 2014-07-09 02:04:12 +0000 @@ -5161,6 +5161,32 @@ charpos = IT_CHARPOS (it); bytepos = IT_BYTEPOS (it); + /* If PT is in the screen line at the last fully visible line, + move_it_to will stop at X = 0 in that line, because the + required Y coordinate is reached there. See if we can get to + PT without descending lower in Y, and if we can, it means we + reached PT before the scroll margin. */ + if (charpos != PT) + { + struct it it2; + void *it_data; + + it2 = it; + it_data = bidi_shelve_cache (); + move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); + if (IT_CHARPOS (it) == PT && it.current_y == it2.current_y) + { + charpos = IT_CHARPOS (it); + bytepos = IT_BYTEPOS (it); + bidi_unshelve_cache (it_data, 1); + } + else + { + it = it2; + bidi_unshelve_cache (it_data, 0); + } + } + /* See if point is on a partially visible line at the end. */ if (it.what == IT_EOB) partial_p = it.current_y + it.ascent + it.descent > it.last_visible_y; === modified file 'src/xdisp.c' --- src/xdisp.c 2014-07-03 18:12:41 +0000 +++ src/xdisp.c 2014-07-09 02:04:12 +0000 @@ -1436,7 +1436,7 @@ (charpos >= 0 ? MOVE_TO_POS : 0) | MOVE_TO_Y); if (charpos >= 0 - && (((!it.bidi_p || it.bidi_it.scan_dir == 1) + && (((!it.bidi_p || it.bidi_it.scan_dir != -1) && IT_CHARPOS (it) >= charpos) /* When scanning backwards under bidi iteration, move_it_to stops at or _before_ CHARPOS, because it stops at or to @@ -1585,7 +1585,8 @@ /* Move to the last buffer position before the display property. */ start_display (&it3, w, top); - move_it_to (&it3, start - 1, -1, -1, -1, MOVE_TO_POS); + if (start > CHARPOS (top)) + move_it_to (&it3, start - 1, -1, -1, -1, MOVE_TO_POS); /* Move forward one more line if the position before the display string is a newline or if it is the rightmost character on a line that is @@ -1688,7 +1689,9 @@ } else { - /* We were asked to provide info about WINDOW_END. */ + /* Either we were asked to provide info about WINDOW_END, or + CHARPOS is in the partially visible glyph row at end of + window. */ struct it it2; void *it2data = NULL; @@ -9247,6 +9250,25 @@ { line_start_x = it->current_x + it->pixel_width - it->last_visible_x; + if (FRAME_WINDOW_P (it->f)) + { + struct face *face = FACE_FROM_ID (it->f, it->face_id); + struct font *face_font = face->font; + + /* When display_line produces a continued line + that ends in a TAB, it skips a tab stop that + is closer than the font's space character + width (see x_produce_glyphs where it produces + the stretch glyph which represents a TAB). + We need to reproduce the same logic here. */ + eassert (face_font); + if (face_font) + { + if (line_start_x < face_font->space_width) + line_start_x + += it->tab_width * face_font->space_width; + } + } set_iterator_to_next (it, 0); } } @@ -16088,6 +16110,18 @@ /* Point does appear, but on a line partly visible at end of window. Move it back to a fully-visible line. */ new_vpos = window_box_height (w); + /* But if window_box_height suggests a Y coordinate that is + not less than we already have, that line will clearly not + be fully visible, so give up and scroll the display. + This can happen when the default face uses a font whose + dimensions are different from the frame's default + font. */ + if (new_vpos >= w->cursor.y) + { + w->cursor.vpos = -1; + clear_glyph_matrix (w->desired_matrix); + goto try_to_scroll; + } } else if (w->cursor.vpos >= 0) { === modified file 'test/indent/shell.sh' --- test/indent/shell.sh 2014-06-24 20:16:10 +0000 +++ test/indent/shell.sh 2014-07-08 18:38:07 +0000 @@ -41,6 +41,12 @@ } done +for foo in bar; do # bug#17896 + [ -e $foo ] && [ -e $bar ] && { + echo just fine thanks + } +done + filter_3 () # bug#17842 { tr -d '"`' | tr ' ' ' ' | \ ------------------------------------------------------------ revno: 117498 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2014-07-08 15:45:24 -0400 message: * lisp/erc/erc.el (erc-channel-receive-names): Reduce redundancy. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2014-06-19 16:56:18 +0000 +++ lisp/erc/ChangeLog 2014-07-08 19:45:24 +0000 @@ -1,3 +1,7 @@ +2014-07-08 Stefan Monnier + + * erc.el (erc-channel-receive-names): Reduce redundancy. + 2014-06-19 Kelvin White * erc-backend.el: Handle user modes in relevant server responses === modified file 'lisp/erc/erc.el' --- lisp/erc/erc.el 2014-07-03 12:30:26 +0000 +++ lisp/erc/erc.el 2014-07-08 19:45:24 +0000 @@ -2797,7 +2797,8 @@ (concat "\n" (pp-to-string val)) (format " %S\n" val))))) (apropos-internal "^erc-" 'custom-variable-p)))) - (current-buffer)) t) + (current-buffer)) + t) (t nil))) (defalias 'erc-cmd-VAR 'erc-cmd-SET) (defalias 'erc-cmd-VARIABLE 'erc-cmd-SET) @@ -3874,7 +3875,8 @@ (insert (read-from-minibuffer "Message: " (string (if (featurep 'xemacs) last-command-char - last-command-event)) read-map)) + last-command-event)) + read-map)) (erc-send-current-line))) (defvar erc-action-history-list () @@ -4106,10 +4108,12 @@ host (regexp-quote host)) (or (when (string-match (concat "^\\(Read error\\) to " nick "\\[" host "\\]: " - "\\(.+\\)$") reason) + "\\(.+\\)$") + reason) (concat (match-string 1 reason) ": " (match-string 2 reason))) (when (string-match (concat "^\\(Ping timeout\\) for " - nick "\\[" host "\\]$") reason) + nick "\\[" host "\\]$") + reason) (match-string 1 reason)) reason)) @@ -4226,7 +4230,8 @@ (let ((nick (erc-server-user-nickname user))) (concat (erc-propertize (erc-get-user-mode-prefix nick) - 'face 'erc-nick-prefix-face) nick))) + 'face 'erc-nick-prefix-face) + nick))) (defun erc-get-user-mode-prefix (user) (when user @@ -4252,7 +4257,8 @@ (let ((nick (erc-server-user-nickname user))) (concat (erc-propertize (erc-get-user-mode-prefix nick) - 'face 'erc-nick-prefix-face) nick)))) + 'face 'erc-nick-prefix-face) + nick)))) (defun erc-format-my-nick () "Return the beginning of this user's message, correctly propertized." @@ -4772,24 +4778,16 @@ (let ((updatep t)) (setq name item op 'off voice 'off halfop 'off admin 'off owner 'off) (if (rassq (elt item 0) prefix) - (cond ((= (length item) 1) - (setq updatep nil)) - ((eq (elt item 0) voice-ch) - (setq name (substring item 1) - voice 'on)) - ((eq (elt item 0) hop-ch) - (setq name (substring item 1) - halfop 'on)) - ((eq (elt item 0) op-ch) - (setq name (substring item 1) - op 'on)) - ((eq (elt item 0) adm-ch) - (setq name (substring item 1) - admin 'on)) - ((eq (elt item 0) own-ch) - (setq name (substring item 1) - owner 'on)) - (t (setq name (substring item 1))))) + (if (= (length item) 1) + (setq updatep nil) + (setq name (substring item 1)) + (setf (pcase (aref item 0) + ((pred (eq voice-ch)) voice) + ((pred (eq hop-ch)) hop) + ((pred (eq op-ch)) op) + ((pred (eq adm-ch)) adm) + ((pred (eq own-ch)) own)) + 'on))) (when updatep (puthash (erc-downcase name) t erc-channel-new-member-names) ------------------------------------------------------------ revno: 117497 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17813 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2014-07-08 15:33:37 -0400 message: * lisp/linum.el (linum--face-height): New function. (linum-update-window): Use it to adjust margin to linum's width. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-08 19:15:28 +0000 +++ lisp/ChangeLog 2014-07-08 19:33:37 +0000 @@ -1,5 +1,8 @@ 2014-07-08 Stefan Monnier + * linum.el (linum--face-height): New function (bug#17813). + (linum-update-window): Use it to adjust margin to linum's width. + * leim/quail/sisheng.el (sisheng-list): Don't bother with-case-table. * eshell/em-smart.el (eshell-smart-scroll-window): Use with-selected-window. === modified file 'lisp/linum.el' --- lisp/linum.el 2014-02-10 01:34:22 +0000 +++ lisp/linum.el 2014-07-08 19:33:37 +0000 @@ -138,6 +138,9 @@ (mapc #'delete-overlay linum-available) (setq linum-available nil)))) +(defun linum--face-height (face) + (aref (font-info (face-font face)) 2)) + (defun linum-update-window (win) "Update line numbers for the portion visible in window WIN." (goto-char (window-start win)) @@ -178,6 +181,12 @@ (let ((inhibit-point-motion-hooks t)) (forward-line)) (setq line (1+ line))) + (when (display-graphic-p) + (setq width (ceiling + ;; We'd really want to check the widths rather than the + ;; heights, but it's a start. + (/ (* width 1.0 (linum--face-height 'linum)) + (frame-char-height))))) (set-window-margins win width (cdr (window-margins win))))) (defun linum-after-change (beg end _len) ------------------------------------------------------------ revno: 117496 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2014-07-08 15:15:28 -0400 message: * lisp/leim/quail/sisheng.el (sisheng-list): Don't bother with-case-table. * lisp/eshell/em-smart.el (eshell-smart-scroll-window): Use with-selected-window. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-08 18:47:47 +0000 +++ lisp/ChangeLog 2014-07-08 19:15:28 +0000 @@ -1,5 +1,9 @@ 2014-07-08 Stefan Monnier + * leim/quail/sisheng.el (sisheng-list): Don't bother with-case-table. + * eshell/em-smart.el (eshell-smart-scroll-window): Use + with-selected-window. + * xt-mouse.el (xterm-mouse-translate-1): Intern drag event (bug#17894). Remove also pointless window&mark manipulation. === modified file 'lisp/calendar/todo-mode.el' --- lisp/calendar/todo-mode.el 2014-06-27 15:15:30 +0000 +++ lisp/calendar/todo-mode.el 2014-07-08 19:15:28 +0000 @@ -2117,7 +2117,8 @@ (save-excursion (todo-item-start) (if (re-search-forward (concat " \\[" (regexp-quote todo-comment-string) - ": \\([^]]+\\)\\]") end t) + ": \\([^]]+\\)\\]") + end t) (if comment-delete (when (todo-y-or-n-p "Delete comment? ") (delete-region (match-beginning 0) (match-end 0))) @@ -2148,7 +2149,8 @@ (cons item 0)))))) (when include-header (while (not (string-match (concat todo-date-string-start - todo-date-pattern) new)) + todo-date-pattern) + new)) (setq new (read-from-minibuffer "Item must start with a date: " new)))) ;; Ensure lines following hard newlines are indented. === modified file 'lisp/eshell/em-smart.el' --- lisp/eshell/em-smart.el 2014-01-01 07:43:34 +0000 +++ lisp/eshell/em-smart.el 2014-07-08 19:15:28 +0000 @@ -188,7 +188,8 @@ (add-hook 'eshell-post-command-hook (function (lambda () - (setq eshell-smart-command-done t))) t t) + (setq eshell-smart-command-done t))) + t t) (unless (eq eshell-review-quick-commands t) (add-hook 'eshell-post-command-hook @@ -200,8 +201,7 @@ (unless eshell-currently-handling-window (let ((inhibit-point-motion-hooks t) (eshell-currently-handling-window t)) - (save-selected-window - (select-window wind) + (with-selected-window wind (eshell-smart-redisplay))))) (defun eshell-refresh-windows (&optional frame) @@ -212,12 +212,12 @@ (lambda (wind) (with-current-buffer (window-buffer wind) (if eshell-mode - (let (window-scroll-functions) + (let (window-scroll-functions) ;;FIXME: Why? (eshell-smart-scroll-window wind (window-start)) (setq affected t)))))) 0 frame) (if affected - (let (window-scroll-functions) + (let (window-scroll-functions) ;;FIXME: Why? (eshell-redisplay))))) (defun eshell-smart-display-setup () === modified file 'lisp/leim/quail/sisheng.el' --- lisp/leim/quail/sisheng.el 2014-04-12 19:30:14 +0000 +++ lisp/leim/quail/sisheng.el 2014-07-08 19:15:28 +0000 @@ -250,39 +250,38 @@ ;; Call quail-make-sisheng-rules for all syllables in sisheng-syllable-table. ;; (let (sisheng-list) - (with-case-table (standard-case-table) ;FIXME: Why? - (dolist (syllable sisheng-syllable-table) - (setq sisheng-list - (append (quail-make-sisheng-rules syllable) - sisheng-list))) - - (dolist (syllable sisheng-syllable-table) - (setq sisheng-list - (append (quail-make-sisheng-rules (upcase-initials syllable)) - sisheng-list))) - - (dolist (syllable sisheng-syllable-table) - (setq sisheng-list - (append (quail-make-sisheng-rules (upcase syllable)) - sisheng-list))) - - (eval `(quail-define-rules - ,@sisheng-list - - ("lv5" ["lü"]) - ("lve5" ["lüe"]) - ("nv5" ["nü"]) - ("nve5" ["nüe"]) - - ("Lv5" ["Lü"]) - ("Lve5" ["Lüe"]) - ("Nv5" ["Nü"]) - ("Nve5" ["Nüe"]) - - ("LV5" ["LÜ"]) - ("LVE5" ["LÜE"]) - ("NV5" ["NÜ"]) - ("NVE5" ["NÜE"]))))) + (dolist (syllable sisheng-syllable-table) + (setq sisheng-list + (append (quail-make-sisheng-rules syllable) + sisheng-list))) + + (dolist (syllable sisheng-syllable-table) + (setq sisheng-list + (append (quail-make-sisheng-rules (upcase-initials syllable)) + sisheng-list))) + + (dolist (syllable sisheng-syllable-table) + (setq sisheng-list + (append (quail-make-sisheng-rules (upcase syllable)) + sisheng-list))) + + (eval `(quail-define-rules + ,@sisheng-list + + ("lv5" ["lü"]) + ("lve5" ["lüe"]) + ("nv5" ["nü"]) + ("nve5" ["nüe"]) + + ("Lv5" ["Lü"]) + ("Lve5" ["Lüe"]) + ("Nv5" ["Nü"]) + ("Nve5" ["Nüe"]) + + ("LV5" ["LÜ"]) + ("LVE5" ["LÜE"]) + ("NV5" ["NÜ"]) + ("NVE5" ["NÜE"])))) ;; Local Variables: ;; coding: utf-8 === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2014-07-08 08:02:50 +0000 +++ lisp/minibuffer.el 2014-07-08 19:15:28 +0000 @@ -3306,6 +3306,7 @@ (string-match completion-pcm--delim-wild-regex str (car bounds))) (if (zerop (car bounds)) + ;; FIXME: Don't hardcode "-" (bug#17559). (mapconcat 'string str "-") ;; If there's a boundary, it's trickier. The main use-case ;; we consider here is file-name completion. We'd like === modified file 'lisp/server.el' --- lisp/server.el 2014-05-05 07:35:50 +0000 +++ lisp/server.el 2014-07-08 19:15:28 +0000 @@ -794,32 +794,33 @@ (error "Invalid terminal type")) (add-to-list 'frame-inherited-parameters 'client) (let ((frame - (server-with-environment (process-get proc 'env) - '("LANG" "LC_CTYPE" "LC_ALL" - ;; For tgetent(3); list according to ncurses(3). - "BAUDRATE" "COLUMNS" "ESCDELAY" "HOME" "LINES" - "NCURSES_ASSUMED_COLORS" "NCURSES_NO_PADDING" - "NCURSES_NO_SETBUF" "TERM" "TERMCAP" "TERMINFO" - "TERMINFO_DIRS" "TERMPATH" - ;; rxvt wants these - "COLORFGBG" "COLORTERM") - (make-frame `((window-system . nil) - (tty . ,tty) - (tty-type . ,type) - ;; Ignore nowait here; we always need to - ;; clean up opened ttys when the client dies. - (client . ,proc) - ;; This is a leftover from an earlier - ;; attempt at making it possible for process - ;; run in the server process to use the - ;; environment of the client process. - ;; It has no effect now and to make it work - ;; we'd need to decide how to make - ;; process-environment interact with client - ;; envvars, and then to change the - ;; C functions `child_setup' and - ;; `getenv_internal' accordingly. - (environment . ,(process-get proc 'env))))))) + (server-with-environment + (process-get proc 'env) + '("LANG" "LC_CTYPE" "LC_ALL" + ;; For tgetent(3); list according to ncurses(3). + "BAUDRATE" "COLUMNS" "ESCDELAY" "HOME" "LINES" + "NCURSES_ASSUMED_COLORS" "NCURSES_NO_PADDING" + "NCURSES_NO_SETBUF" "TERM" "TERMCAP" "TERMINFO" + "TERMINFO_DIRS" "TERMPATH" + ;; rxvt wants these + "COLORFGBG" "COLORTERM") + (make-frame `((window-system . nil) + (tty . ,tty) + (tty-type . ,type) + ;; Ignore nowait here; we always need to + ;; clean up opened ttys when the client dies. + (client . ,proc) + ;; This is a leftover from an earlier + ;; attempt at making it possible for process + ;; run in the server process to use the + ;; environment of the client process. + ;; It has no effect now and to make it work + ;; we'd need to decide how to make + ;; process-environment interact with client + ;; envvars, and then to change the + ;; C functions `child_setup' and + ;; `getenv_internal' accordingly. + (environment . ,(process-get proc 'env))))))) ;; ttys don't use the `display' parameter, but callproc.c does to set ;; the DISPLAY environment on subprocesses. === modified file 'lisp/term.el' --- lisp/term.el 2014-06-22 05:43:58 +0000 +++ lisp/term.el 2014-07-08 19:15:28 +0000 @@ -165,15 +165,13 @@ ;; full advantage of this package ;; ;; (add-hook 'term-mode-hook -;; (function -;; (lambda () -;; (setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *") -;; (make-local-variable 'mouse-yank-at-point) -;; (make-local-variable 'transient-mark-mode) -;; (setq mouse-yank-at-point t) -;; (setq transient-mark-mode nil) -;; (auto-fill-mode -1) -;; (setq tab-width 8 )))) +;; (function +;; (lambda () +;; (setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *") +;; (setq-local mouse-yank-at-point t) +;; (setq-local transient-mark-mode nil) +;; (auto-fill-mode -1) +;; (setq tab-width 8 )))) ;; ;; ;; ---------------------------------------- ------------------------------------------------------------ revno: 117495 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17894 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2014-07-08 14:47:47 -0400 message: * lisp/xt-mouse.el (xterm-mouse-translate-1): Intern drag event. Remove also pointless window&mark manipulation. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-08 16:51:35 +0000 +++ lisp/ChangeLog 2014-07-08 18:47:47 +0000 @@ -1,5 +1,8 @@ 2014-07-08 Stefan Monnier + * xt-mouse.el (xterm-mouse-translate-1): Intern drag event (bug#17894). + Remove also pointless window&mark manipulation. + * progmodes/perl-mode.el: Use syntax-ppss; fix one indentation case. (perl-indent-line): Use syntax-ppss to detect we're in a doc-section. (perl-continuation-line-p): Don't skip over anything else than labels. === modified file 'lisp/xt-mouse.el' --- lisp/xt-mouse.el 2014-07-01 16:10:02 +0000 +++ lisp/xt-mouse.el 2014-07-08 18:47:47 +0000 @@ -62,49 +62,44 @@ (defun xterm-mouse-translate-1 (&optional extension) (save-excursion - (save-window-excursion ;FIXME: Why? - (deactivate-mark) ;FIXME: Why? - (let* ((event (xterm-mouse-event extension)) - (ev-command (nth 0 event)) - (ev-data (nth 1 event)) - (ev-where (nth 1 ev-data)) - (vec (if (and (symbolp ev-where) (consp ev-where)) - ;; FIXME: This condition can *never* be non-nil!?! - (vector (list ev-where ev-data) event) - (vector event))) - (is-down (string-match "down-" (symbol-name ev-command)))) + (let* ((event (xterm-mouse-event extension)) + (ev-command (nth 0 event)) + (ev-data (nth 1 event)) + (ev-where (nth 1 ev-data)) + (vec (vector event)) + (is-down (string-match "down-" (symbol-name ev-command)))) - (cond - ((null event) nil) ;Unknown/bogus byte sequence! - (is-down - (setf (terminal-parameter nil 'xterm-mouse-last-down) event) - vec) - (t - (let* ((down (terminal-parameter nil 'xterm-mouse-last-down)) - (down-data (nth 1 down)) - (down-where (nth 1 down-data))) - (setf (terminal-parameter nil 'xterm-mouse-last-down) nil) - (cond - ((null down) - ;; This is an "up-only" event. Pretend there was an up-event - ;; right before and keep the up-event for later. - (push event unread-command-events) - (vector (cons (intern (replace-regexp-in-string - "\\`\\([ACMHSs]-\\)*" "\\&down-" - (symbol-name ev-command) t)) - (cdr event)))) - ((equal ev-where down-where) vec) + (cond + ((null event) nil) ;Unknown/bogus byte sequence! + (is-down + (setf (terminal-parameter nil 'xterm-mouse-last-down) event) + vec) + (t + (let* ((down (terminal-parameter nil 'xterm-mouse-last-down)) + (down-data (nth 1 down)) + (down-where (nth 1 down-data))) + (setf (terminal-parameter nil 'xterm-mouse-last-down) nil) + (cond + ((null down) + ;; This is an "up-only" event. Pretend there was an up-event + ;; right before and keep the up-event for later. + (push event unread-command-events) + (vector (cons (intern (replace-regexp-in-string + "\\`\\([ACMHSs]-\\)*" "\\&down-" + (symbol-name ev-command) t)) + (cdr event)))) + ((equal ev-where down-where) vec) (t - (let ((drag (if (symbolp ev-where) - 0 ;FIXME: Why?!? - (list (replace-regexp-in-string - "\\`\\([ACMHSs]-\\)*" "\\&drag-" - (symbol-name ev-command) t) - down-data ev-data)))) - (if (null track-mouse) - (vector drag) - (push drag unread-command-events) - (vector (list 'mouse-movement ev-data))))))))))))) + (let ((drag (if (symbolp ev-where) + 0 ;FIXME: Why?!? + (list (intern (replace-regexp-in-string + "\\`\\([ACMHSs]-\\)*" "\\&drag-" + (symbol-name ev-command) t)) + down-data ev-data)))) + (if (null track-mouse) + (vector drag) + (push drag unread-command-events) + (vector (list 'mouse-movement ev-data)))))))))))) ;; These two variables have been converted to terminal parameters. ;; ------------------------------------------------------------ revno: 117494 committer: Paul Eggert branch nick: trunk timestamp: Tue 2014-07-08 10:13:32 -0700 message: * process.c (read_and_dispose_of_process_output): Fix typo in previous patch: we want nonnegative fds, not nonzero fds. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-07-08 14:50:45 +0000 +++ src/ChangeLog 2014-07-08 17:13:32 +0000 @@ -1,3 +1,8 @@ +2014-07-08 Paul Eggert + + * process.c (read_and_dispose_of_process_output): Fix typo + in previous patch: we want nonnegative fds, not nonzero fds. + 2014-07-08 Dmitry Antipov * chartab.c (char_table_translate): Move to... === modified file 'src/process.c' --- src/process.c 2014-07-08 06:24:07 +0000 +++ src/process.c 2014-07-08 17:13:32 +0000 @@ -5134,7 +5134,7 @@ proc_encode_coding_system[p->outfd] surely points to a valid memory because p->outfd will be changed once EOF is sent to the process. */ - if (NILP (p->encode_coding_system) && p->outfd + if (NILP (p->encode_coding_system) && p->outfd >= 0 && proc_encode_coding_system[p->outfd]) { pset_encode_coding_system ------------------------------------------------------------ revno: 117493 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2014-07-08 12:51:35 -0400 message: * lisp/progmodes/perl-mode.el: Use syntax-ppss; fix one indentation case. (perl-indent-line): Use syntax-ppss to detect we're in a doc-section. (perl-continuation-line-p): Don't skip over anything else than labels. Return the previous char. (perl-calculate-indent): Use syntax-ppss instead of parse-start and update callers accordingly. For continuation lines, check the the case of array hashes. (perl-backward-to-noncomment): Make it non-interactive. (perl-backward-to-start-of-continued-exp): Rewrite. * test/indent/perl.perl: Add indentation pattern for hash-table entries. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-08 15:35:29 +0000 +++ lisp/ChangeLog 2014-07-08 16:51:35 +0000 @@ -1,3 +1,15 @@ +2014-07-08 Stefan Monnier + + * progmodes/perl-mode.el: Use syntax-ppss; fix one indentation case. + (perl-indent-line): Use syntax-ppss to detect we're in a doc-section. + (perl-continuation-line-p): Don't skip over anything else than labels. + Return the previous char. + (perl-calculate-indent): Use syntax-ppss instead of parse-start + and update callers accordingly. For continuation lines, check the + the case of array hashes. + (perl-backward-to-noncomment): Make it non-interactive. + (perl-backward-to-start-of-continued-exp): Rewrite. + 2014-07-08 Sam Steingold * progmodes/inf-lisp.el (lisp-eval-paragraph, lisp-eval-form-and-next): @@ -25,8 +37,8 @@ (with-temp-buffer-window, with-current-buffer-window): Use `macroexp-let2' to evaluate and bind variables in the same order as macro arguments. - (display-buffer--action-function-custom-type): Add - `display-buffer-below-selected' and `display-buffer-at-bottom'. + (display-buffer--action-function-custom-type): + Add `display-buffer-below-selected' and `display-buffer-at-bottom'. * minibuffer.el (minibuffer-completion-help): Replace `with-output-to-temp-buffer' with `with-displayed-buffer-window' === modified file 'lisp/progmodes/perl-mode.el' --- lisp/progmodes/perl-mode.el 2014-04-25 19:22:26 +0000 +++ lisp/progmodes/perl-mode.el 2014-07-08 16:51:35 +0000 @@ -748,7 +748,7 @@ (bof (perl-beginning-of-function)) (delta (progn (goto-char oldpnt) - (perl-indent-line "\f\\|;?#" bof)))) + (perl-indent-line "\f\\|;?#")))) (and perl-tab-to-comment (= oldpnt (point)) ; done if point moved (if (listp delta) ; if line starts in a quoted string @@ -786,28 +786,23 @@ (ding t))))))))) (make-obsolete 'perl-indent-command 'indent-according-to-mode "24.4") -(defun perl-indent-line (&optional nochange parse-start) +(defun perl-indent-line (&optional nochange) "Indent current line as Perl code. Return the amount the indentation changed by, or (parse-state) if line starts in a quoted string." (let ((case-fold-search nil) (pos (- (point-max) (point))) - (bof (or parse-start (save-excursion - ;; Don't consider text on this line as a - ;; valid BOF from which to indent. - (goto-char (line-end-position 0)) - (perl-beginning-of-function)))) beg indent shift-amt) (beginning-of-line) (setq beg (point)) (setq shift-amt - (cond ((eq (char-after bof) ?=) 0) - ((listp (setq indent (perl-calculate-indent bof))) indent) + (cond ((eq 1 (nth 7 (syntax-ppss))) 0) ;For doc sections! + ((listp (setq indent (perl-calculate-indent))) indent) ((eq 'noindent indent) indent) ((looking-at (or nochange perl-nochange)) 0) (t (skip-chars-forward " \t\f") - (setq indent (perl-indent-new-calculate nil indent bof)) + (setq indent (perl-indent-new-calculate nil indent)) (- indent (current-column))))) (skip-chars-forward " \t\f") (if (and (numberp shift-amt) (/= 0 shift-amt)) @@ -819,23 +814,21 @@ (goto-char (- (point-max) pos))) shift-amt)) -(defun perl-continuation-line-p (limit) +(defun perl-continuation-line-p () "Move to end of previous line and return non-nil if continued." ;; Statement level. Is it a continuation or a new statement? ;; Find previous non-comment character. (perl-backward-to-noncomment) ;; Back up over label lines, since they don't ;; affect whether our line is a continuation. - (while (or (eq (preceding-char) ?\,) - (and (eq (preceding-char) ?:) - (memq (char-syntax (char-after (- (point) 2))) - '(?w ?_)))) - (if (eq (preceding-char) ?\,) - (perl-backward-to-start-of-continued-exp limit) - (beginning-of-line)) + (while (and (eq (preceding-char) ?:) + (memq (char-syntax (char-after (- (point) 2))) + '(?w ?_))) + (beginning-of-line) (perl-backward-to-noncomment)) ;; Now we get the answer. - (not (memq (preceding-char) '(?\; ?\} ?\{)))) + (unless (memq (preceding-char) '(?\; ?\} ?\{)) + (preceding-char))) (defun perl-hanging-paren-p () "Non-nil if we are right after a hanging parenthesis-like char." @@ -843,173 +836,151 @@ (save-excursion (skip-syntax-backward " (") (not (bolp))))) -(defun perl-indent-new-calculate (&optional virtual default parse-start) +(defun perl-indent-new-calculate (&optional virtual default) (or (and virtual (save-excursion (skip-chars-backward " \t") (bolp)) (current-column)) (and (looking-at "\\(\\w\\|\\s_\\)+:[^:]") - (max 1 (+ (or default (perl-calculate-indent parse-start)) + (max 1 (+ (or default (perl-calculate-indent)) perl-label-offset))) (and (= (char-syntax (following-char)) ?\)) (save-excursion (forward-char 1) (when (condition-case nil (progn (forward-sexp -1) t) (scan-error nil)) - (perl-indent-new-calculate - ;; Recalculate the parsing-start, since we may have jumped - ;; dangerously close (typically in the case of nested functions). - 'virtual nil (save-excursion (perl-beginning-of-function)))))) + (perl-indent-new-calculate 'virtual)))) (and (and (= (following-char) ?{) (save-excursion (forward-char) (perl-hanging-paren-p))) - (+ (or default (perl-calculate-indent parse-start)) + (+ (or default (perl-calculate-indent)) perl-brace-offset)) - (or default (perl-calculate-indent parse-start)))) + (or default (perl-calculate-indent)))) -(defun perl-calculate-indent (&optional parse-start) +(defun perl-calculate-indent () "Return appropriate indentation for current line as Perl code. In usual case returns an integer: the column to indent to. -Returns (parse-state) if line starts inside a string. -Optional argument PARSE-START should be the position of `beginning-of-defun'." +Returns (parse-state) if line starts inside a string." (save-excursion (let ((indent-point (point)) (case-fold-search nil) (colon-line-end 0) + prev-char state containing-sexp) - (if parse-start ;used to avoid searching - (goto-char parse-start) - (perl-beginning-of-function)) - ;; We might be now looking at a local function that has nothing to - ;; do with us because `indent-point' is past it. In this case - ;; look further back up for another `perl-beginning-of-function'. - (while (and (looking-at "{") - (save-excursion - (beginning-of-line) - (looking-at "\\s-+sub\\>")) - (> indent-point (save-excursion - (condition-case nil - (forward-sexp 1) - (scan-error nil)) - (point)))) - (perl-beginning-of-function)) - (while (< (point) indent-point) ;repeat until right sexp - (setq state (parse-partial-sexp (point) indent-point 0)) - ;; state = (depth_in_parens innermost_containing_list - ;; last_complete_sexp string_terminator_or_nil inside_commentp - ;; following_quotep minimum_paren-depth_this_scan) - ;; Parsing stops if depth in parentheses becomes equal to third arg. - (setq containing-sexp (nth 1 state))) + (setq containing-sexp (nth 1 (syntax-ppss indent-point))) (cond ;; Don't auto-indent in a quoted string or a here-document. ((or (nth 3 state) (eq 2 (nth 7 state))) 'noindent) - ((null containing-sexp) ; Line is at top level. - (skip-chars-forward " \t\f") - (if (memq (following-char) - (if perl-indent-parens-as-block '(?\{ ?\( ?\[) '(?\{))) - 0 ; move to beginning of line if it starts a function body - ;; indent a little if this is a continuation line - (perl-backward-to-noncomment) - (if (or (bobp) - (memq (preceding-char) '(?\; ?\}))) - 0 perl-continued-statement-offset))) - ((/= (char-after containing-sexp) ?{) - ;; line is expression, not statement: - ;; indent to just after the surrounding open. - (goto-char (1+ containing-sexp)) - (if (perl-hanging-paren-p) - ;; We're indenting an arg of a call like: - ;; $a = foobarlongnamefun ( - ;; arg1 - ;; arg2 - ;; ); - (progn - (skip-syntax-backward "(") - (condition-case nil - (while (save-excursion - (skip-syntax-backward " ") (not (bolp))) - (forward-sexp -1)) - (scan-error nil)) - (+ (current-column) perl-indent-level)) - (if perl-indent-continued-arguments - (+ perl-indent-continued-arguments (current-indentation)) - (skip-chars-forward " \t") - (current-column)))) - (t - ;; Statement level. Is it a continuation or a new statement? - (if (perl-continuation-line-p containing-sexp) - ;; This line is continuation of preceding line's statement; - ;; indent perl-continued-statement-offset more than the - ;; previous line of the statement. - (progn - (perl-backward-to-start-of-continued-exp containing-sexp) - (+ (if (save-excursion - (perl-continuation-line-p containing-sexp)) - ;; If the continued line is itself a continuation - ;; line, then align, otherwise add an offset. - 0 perl-continued-statement-offset) - (current-column) - (if (save-excursion (goto-char indent-point) - (looking-at - (if perl-indent-parens-as-block - "[ \t]*[{(\[]" "[ \t]*{"))) - perl-continued-brace-offset 0))) - ;; This line starts a new statement. - ;; Position at last unclosed open. - (goto-char containing-sexp) - (or - ;; Is line first statement after an open-brace? - ;; If no, find that first statement and indent like it. - (save-excursion - (forward-char 1) - ;; Skip over comments and labels following openbrace. - (while (progn - (skip-chars-forward " \t\f\n") - (cond ((looking-at ";?#") - (forward-line 1) t) - ((looking-at "\\(\\w\\|\\s_\\)+:[^:]") - (setq colon-line-end (line-end-position)) - (search-forward ":"))))) - ;; The first following code counts - ;; if it is before the line we want to indent. - (and (< (point) indent-point) - (if (> colon-line-end (point)) - (- (current-indentation) perl-label-offset) - (current-column)))) - ;; If no previous statement, - ;; indent it relative to line brace is on. - ;; For open paren in column zero, don't let statement - ;; start there too. If perl-indent-level is zero, - ;; use perl-brace-offset + perl-continued-statement-offset - ;; For open-braces not the first thing in a line, - ;; add in perl-brace-imaginary-offset. - (+ (if (and (bolp) (zerop perl-indent-level)) - (+ perl-brace-offset perl-continued-statement-offset) - perl-indent-level) - ;; Move back over whitespace before the openbrace. - ;; If openbrace is not first nonwhite thing on the line, - ;; add the perl-brace-imaginary-offset. - (progn (skip-chars-backward " \t") - (if (bolp) 0 perl-brace-imaginary-offset)) - ;; If the openbrace is preceded by a parenthesized exp, - ;; move to the beginning of that; - ;; possibly a different line - (progn - (if (eq (preceding-char) ?\)) - (forward-sexp -1)) - ;; Get initial indentation of the line we are on. - (current-indentation)))))))))) + ((null containing-sexp) ; Line is at top level. + (skip-chars-forward " \t\f") + (if (memq (following-char) + (if perl-indent-parens-as-block '(?\{ ?\( ?\[) '(?\{))) + 0 ; move to beginning of line if it starts a function body + ;; indent a little if this is a continuation line + (perl-backward-to-noncomment) + (if (or (bobp) + (memq (preceding-char) '(?\; ?\}))) + 0 perl-continued-statement-offset))) + ((/= (char-after containing-sexp) ?{) + ;; line is expression, not statement: + ;; indent to just after the surrounding open. + (goto-char (1+ containing-sexp)) + (if (perl-hanging-paren-p) + ;; We're indenting an arg of a call like: + ;; $a = foobarlongnamefun ( + ;; arg1 + ;; arg2 + ;; ); + (progn + (skip-syntax-backward "(") + (condition-case nil + (while (save-excursion + (skip-syntax-backward " ") (not (bolp))) + (forward-sexp -1)) + (scan-error nil)) + (+ (current-column) perl-indent-level)) + (if perl-indent-continued-arguments + (+ perl-indent-continued-arguments (current-indentation)) + (skip-chars-forward " \t") + (current-column)))) + ;; Statement level. Is it a continuation or a new statement? + ((setq prev-char (perl-continuation-line-p)) + ;; This line is continuation of preceding line's statement; + ;; indent perl-continued-statement-offset more than the + ;; previous line of the statement. + (perl-backward-to-start-of-continued-exp) + (+ (if (or (save-excursion + (perl-continuation-line-p)) + (and (eq prev-char ?\,) + (looking-at "[[:alnum:]_]+[ \t\n]*=>"))) + ;; If the continued line is itself a continuation + ;; line, then align, otherwise add an offset. + 0 perl-continued-statement-offset) + (current-column) + (if (save-excursion (goto-char indent-point) + (looking-at + (if perl-indent-parens-as-block + "[ \t]*[{(\[]" "[ \t]*{"))) + perl-continued-brace-offset 0))) + (t + ;; This line starts a new statement. + ;; Position at last unclosed open. + (goto-char containing-sexp) + (or + ;; Is line first statement after an open-brace? + ;; If no, find that first statement and indent like it. + (save-excursion + (forward-char 1) + ;; Skip over comments and labels following openbrace. + (while (progn + (skip-chars-forward " \t\f\n") + (cond ((looking-at ";?#") + (forward-line 1) t) + ((looking-at "\\(\\w\\|\\s_\\)+:[^:]") + (setq colon-line-end (line-end-position)) + (search-forward ":"))))) + ;; The first following code counts + ;; if it is before the line we want to indent. + (and (< (point) indent-point) + (if (> colon-line-end (point)) + (- (current-indentation) perl-label-offset) + (current-column)))) + ;; If no previous statement, + ;; indent it relative to line brace is on. + ;; For open paren in column zero, don't let statement + ;; start there too. If perl-indent-level is zero, + ;; use perl-brace-offset + perl-continued-statement-offset + ;; For open-braces not the first thing in a line, + ;; add in perl-brace-imaginary-offset. + (+ (if (and (bolp) (zerop perl-indent-level)) + (+ perl-brace-offset perl-continued-statement-offset) + perl-indent-level) + ;; Move back over whitespace before the openbrace. + ;; If openbrace is not first nonwhite thing on the line, + ;; add the perl-brace-imaginary-offset. + (progn (skip-chars-backward " \t") + (if (bolp) 0 perl-brace-imaginary-offset)) + ;; If the openbrace is preceded by a parenthesized exp, + ;; move to the beginning of that; + ;; possibly a different line + (progn + (if (eq (preceding-char) ?\)) + (forward-sexp -1)) + ;; Get initial indentation of the line we are on. + (current-indentation))))))))) (defun perl-backward-to-noncomment () "Move point backward to after the first non-white-space, skipping comments." - (interactive) (forward-comment (- (point-max)))) -(defun perl-backward-to-start-of-continued-exp (lim) - (if (= (preceding-char) ?\)) - (forward-sexp -1)) - (beginning-of-line) - (if (<= (point) lim) - (goto-char (1+ lim))) - (skip-chars-forward " \t\f")) +(defun perl-backward-to-start-of-continued-exp () + (while + (let ((c (preceding-char))) + (cond + ((memq c '(?\; ?\{ ?\[ ?\()) (forward-comment (point-max)) nil) + ((memq c '(?\) ?\] ?\} ?\")) + (forward-sexp -1) (forward-comment (- (point))) t) + ((eq ?w (char-syntax c)) + (forward-word -1) (forward-comment (- (point))) t) + (t (forward-char -1) (forward-comment (- (point))) t))))) ;; note: this may be slower than the c-mode version, but I can understand it. (defalias 'indent-perl-exp 'perl-indent-exp) @@ -1034,7 +1005,7 @@ (setq lsexp-mark bof-mark) (beginning-of-line) (while (< (point) (marker-position last-mark)) - (setq delta (perl-indent-line nil (marker-position bof-mark))) + (setq delta (perl-indent-line nil)) (if (numberp delta) ; unquoted start-of-line? (progn (if (eolp) === modified file 'test/ChangeLog' --- test/ChangeLog 2014-07-04 10:07:45 +0000 +++ test/ChangeLog 2014-07-08 16:51:35 +0000 @@ -1,3 +1,7 @@ +2014-07-08 Stefan Monnier + + * indent/perl.perl: Add indentation pattern for hash-table entries. + 2014-07-04 Michael Albinus * automated/dbus-tests.el (dbus-test02-register-service-session) === modified file 'test/indent/perl.perl' --- test/indent/perl.perl 2014-05-12 06:59:30 +0000 +++ test/indent/perl.perl 2014-07-08 16:51:35 +0000 @@ -24,6 +24,13 @@ bar EOF1 +$config = { + b => + [ + "123", + ], + c => "123", +}; print <<"EOF1" . <<\EOF2 . s/he"llo/th'ere/; foo ------------------------------------------------------------ revno: 117492 committer: Sam Steingold branch nick: trunk timestamp: Tue 2014-07-08 11:35:29 -0400 message: New user commands, similar to what is available in ESS * lisp/progmodes/inf-lisp.el (lisp-eval-paragraph, lisp-eval-form-and-next): New user commands. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-08 08:49:18 +0000 +++ lisp/ChangeLog 2014-07-08 15:35:29 +0000 @@ -1,3 +1,8 @@ +2014-07-08 Sam Steingold + + * progmodes/inf-lisp.el (lisp-eval-paragraph, lisp-eval-form-and-next): + New user commands. + 2014-07-08 Juri Linkov * vc/vc-annotate.el (vc-annotate-background-mode): New defcustom. === modified file 'lisp/progmodes/inf-lisp.el' --- lisp/progmodes/inf-lisp.el 2014-01-01 07:43:34 +0000 +++ lisp/progmodes/inf-lisp.el 2014-07-08 15:35:29 +0000 @@ -112,6 +112,8 @@ (define-key lisp-mode-map "\C-x\C-e" 'lisp-eval-last-sexp) ; Gnu convention (define-key lisp-mode-map "\C-c\C-e" 'lisp-eval-defun) (define-key lisp-mode-map "\C-c\C-r" 'lisp-eval-region) +(define-key lisp-mode-map "\C-c\C-n" 'lisp-eval-form-and-next) +(define-key lisp-mode-map "\C-c\C-p" 'lisp-eval-paragraph) (define-key lisp-mode-map "\C-c\C-c" 'lisp-compile-defun) (define-key lisp-mode-map "\C-c\C-z" 'switch-to-lisp) (define-key lisp-mode-map "\C-c\C-l" 'lisp-load-file) @@ -311,6 +313,14 @@ ;;;###autoload (defalias 'run-lisp 'inferior-lisp) +(defun lisp-eval-paragraph (&optional and-go) + "Send the current paragraph to the inferior Lisp process. +Prefix argument means switch to the Lisp buffer afterwards." + (interactive "P") + (save-excursion + (mark-paragraph) + (lisp-eval-region (point) (mark) and-go))) + (defun lisp-eval-region (start end &optional and-go) "Send the current region to the inferior Lisp process. Prefix argument means switch to the Lisp buffer afterwards." @@ -361,6 +371,14 @@ (interactive "P") (lisp-eval-region (save-excursion (backward-sexp) (point)) (point) and-go)) +(defun lisp-eval-form-and-next () + "Send the previous sexp to the inferior Lisp process and move to the next one." + (interactive "") + (while (not (zerop (car (syntax-ppss)))) + (up-list)) + (lisp-eval-last-sexp) + (forward-sexp)) + (defun lisp-compile-region (start end &optional and-go) "Compile the current region in the inferior Lisp process. Prefix argument means switch to the Lisp buffer afterwards." ------------------------------------------------------------ revno: 117491 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2014-07-08 18:50:45 +0400 message: * font.c (font_build_object) [HAVE_XFT || HAVE_FREETYPE || HAVE_NS]: New function, with an intention to avoid code duplication between a few font drivers. * font.h (font_build_object) [HAVE_XFT || HAVE_FREETYPE || HAVE_NS]: Add prototype. * ftfont.c (ftfont_open): * macfont.m (macfont_open): * xftfont.c (xftfont_open): Use it. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-07-08 14:19:34 +0000 +++ src/ChangeLog 2014-07-08 14:50:45 +0000 @@ -5,7 +5,16 @@ Avoid Faref and assume that args are always valid. This helps to speedup search, which is especially important for a huge buffers. * lisp.h (char_table_translate): Remove prototype. + * nsfont.m (nsfont_close): Free glyphs and metrics arrays as well. + * font.c (font_build_object) [HAVE_XFT || HAVE_FREETYPE || HAVE_NS]: + New function, with an intention to avoid code duplication between + a few font drivers. + * font.h (font_build_object) [HAVE_XFT || HAVE_FREETYPE || HAVE_NS]: + Add prototype. + * ftfont.c (ftfont_open): + * macfont.m (macfont_open): + * xftfont.c (xftfont_open): Use it. 2014-07-08 Paul Eggert === modified file 'src/font.c' --- src/font.c 2014-07-03 12:20:00 +0000 +++ src/font.c 2014-07-08 14:50:45 +0000 @@ -225,7 +225,33 @@ return font_object; } - +#if defined (HAVE_XFT) || defined (HAVE_FREETYPE) || defined (HAVE_NS) + +/* Like above, but also set `type', `name' and `fullname' properties + of font-object. */ + +Lisp_Object +font_build_object (int vectorsize, Lisp_Object type, + Lisp_Object entity, double pixelsize) +{ + int len; + char name[256]; + Lisp_Object font_object = font_make_object (vectorsize, entity, pixelsize); + + ASET (font_object, FONT_TYPE_INDEX, type); + len = font_unparse_xlfd (entity, pixelsize, name, sizeof name); + if (len > 0) + ASET (font_object, FONT_NAME_INDEX, make_string (name, len)); + len = font_unparse_fcname (entity, pixelsize, name, sizeof name); + if (len > 0) + ASET (font_object, FONT_FULLNAME_INDEX, make_string (name, len)); + else + ASET (font_object, FONT_FULLNAME_INDEX, + AREF (font_object, FONT_NAME_INDEX)); + return font_object; +} + +#endif /* HAVE_XFT || HAVE_FREETYPE || HAVE_NS */ static int font_pixel_size (struct frame *f, Lisp_Object); static Lisp_Object font_open_entity (struct frame *, Lisp_Object, int); === modified file 'src/font.h' --- src/font.h 2014-07-04 02:28:54 +0000 +++ src/font.h 2014-07-08 14:50:45 +0000 @@ -719,6 +719,9 @@ extern Lisp_Object font_make_entity (void); extern Lisp_Object font_make_object (int, Lisp_Object, int); +#if defined (HAVE_XFT) || defined (HAVE_FREETYPE) || defined (HAVE_NS) +extern Lisp_Object font_build_object (int, Lisp_Object, Lisp_Object, double); +#endif extern Lisp_Object find_font_encoding (Lisp_Object); extern int font_registry_charsets (Lisp_Object, struct charset **, === modified file 'src/ftfont.c' --- src/ftfont.c 2014-07-04 02:28:54 +0000 +++ src/ftfont.c 2014-07-08 14:50:45 +0000 @@ -1183,8 +1183,7 @@ Lisp_Object val, filename, idx, cache, font_object; bool scalable; int spacing; - char name[256]; - int i, len; + int i; int upEM; val = assq_no_quit (QCfont_entity, AREF (entity, FONT_EXTRA_INDEX)); @@ -1221,17 +1220,8 @@ return Qnil; } - font_object = font_make_object (VECSIZE (struct ftfont_info), entity, size); - ASET (font_object, FONT_TYPE_INDEX, Qfreetype); - len = font_unparse_xlfd (entity, size, name, 256); - if (len > 0) - ASET (font_object, FONT_NAME_INDEX, make_string (name, len)); - len = font_unparse_fcname (entity, size, name, 256); - if (len > 0) - ASET (font_object, FONT_FULLNAME_INDEX, make_string (name, len)); - else - ASET (font_object, FONT_FULLNAME_INDEX, - AREF (font_object, FONT_NAME_INDEX)); + font_object = font_build_object (VECSIZE (struct ftfont_info), + Qfreetype, entity, size); ASET (font_object, FONT_FILE_INDEX, filename); ASET (font_object, FONT_FORMAT_INDEX, ftfont_font_format (NULL, filename)); font = XFONT_OBJECT (font_object); === modified file 'src/macfont.m' --- src/macfont.m 2014-07-04 02:28:54 +0000 +++ src/macfont.m 2014-07-08 14:50:45 +0000 @@ -2444,8 +2444,7 @@ int size; FontRef macfont; FontSymbolicTraits sym_traits; - char name[256]; - int len, i, total_width; + int i, total_width; CGGlyph glyph; CGFloat ascent, descent, leading; @@ -2472,17 +2471,8 @@ if (! macfont) return Qnil; - font_object = font_make_object (VECSIZE (struct macfont_info), entity, size); - ASET (font_object, FONT_TYPE_INDEX, macfont_driver.type); - len = font_unparse_xlfd (entity, size, name, 256); - if (len > 0) - ASET (font_object, FONT_NAME_INDEX, make_string (name, len)); - len = font_unparse_fcname (entity, size, name, 256); - if (len > 0) - ASET (font_object, FONT_FULLNAME_INDEX, make_string (name, len)); - else - ASET (font_object, FONT_FULLNAME_INDEX, - AREF (font_object, FONT_NAME_INDEX)); + font_object = font_build_object (VECSIZE (struct macfont_info), + Qmac_ct, entity, size); font = XFONT_OBJECT (font_object); font->pixel_size = size; font->driver = &macfont_driver; === modified file 'src/xftfont.c' --- src/xftfont.c 2014-07-03 12:20:00 +0000 +++ src/xftfont.c 2014-07-08 14:50:45 +0000 @@ -270,8 +270,7 @@ double size = 0; XftFont *xftfont = NULL; int spacing; - char name[256]; - int len, i; + int i; XGlyphInfo extents; FT_Face ft_face; FcMatrix *matrix; @@ -341,17 +340,8 @@ /* We should not destroy PAT here because it is kept in XFTFONT and destroyed automatically when XFTFONT is closed. */ - font_object = font_make_object (VECSIZE (struct xftfont_info), entity, size); - ASET (font_object, FONT_TYPE_INDEX, Qxft); - len = font_unparse_xlfd (entity, size, name, 256); - if (len > 0) - ASET (font_object, FONT_NAME_INDEX, make_string (name, len)); - len = font_unparse_fcname (entity, size, name, 256); - if (len > 0) - ASET (font_object, FONT_FULLNAME_INDEX, make_string (name, len)); - else - ASET (font_object, FONT_FULLNAME_INDEX, - AREF (font_object, FONT_NAME_INDEX)); + font_object = font_build_object (VECSIZE (struct xftfont_info), + Qxft, entity, size); ASET (font_object, FONT_FILE_INDEX, filename); ASET (font_object, FONT_FORMAT_INDEX, ftfont_font_format (xftfont->pattern, filename)); ------------------------------------------------------------ revno: 117490 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2014-07-08 18:19:34 +0400 message: * nsfont.m (nsfont_close): Free glyphs and metrics arrays as well. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-07-08 07:17:04 +0000 +++ src/ChangeLog 2014-07-08 14:19:34 +0000 @@ -5,6 +5,7 @@ Avoid Faref and assume that args are always valid. This helps to speedup search, which is especially important for a huge buffers. * lisp.h (char_table_translate): Remove prototype. + * nsfont.m (nsfont_close): Free glyphs and metrics arrays as well. 2014-07-08 Paul Eggert === modified file 'src/nsfont.m' --- src/nsfont.m 2014-07-04 02:28:54 +0000 +++ src/nsfont.m 2014-07-08 14:19:34 +0000 @@ -945,6 +945,8 @@ xfree (font_info->glyphs[i]); xfree (font_info->metrics[i]); } + xfree (font_info->glyphs); + xfree (font_info->metrics); [font_info->nsfont release]; #ifdef NS_IMPL_COCOA CGFontRelease (font_info->cgfont); ------------------------------------------------------------ revno: 117489 fixes bug: http://debbugs.gnu.org/17808 committer: Juri Linkov branch nick: trunk timestamp: Tue 2014-07-08 11:49:18 +0300 message: * lisp/vc/vc-annotate.el (vc-annotate-background-mode): New defcustom. (vc-annotate-color-map): Use less saturated colors (20%) for background-mode. (vc-annotate-very-old-color): Add default value for background-mode. (vc-annotate-background): Set default value to nil since now text on the default backgrounds should be legible in light and dark modes. (vc-annotate-lines): Use `vc-annotate-background-mode'. Doc fix. diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-07-07 08:59:32 +0000 +++ etc/NEWS 2014-07-08 08:49:18 +0000 @@ -115,6 +115,12 @@ *** New connection method "nc", which allows to access dumb busyboxes. +** VC and related modes + +*** New option `vc-annotate-background-mode' controls whether +the color range from `vc-annotate-color-map' is applied to the +background or to the foreground. + ** Calculator: decimal display mode uses "," groups, so it's more fitting for use in money calculations; factorial works with non-integer inputs. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-08 08:27:46 +0000 +++ lisp/ChangeLog 2014-07-08 08:49:18 +0000 @@ -1,5 +1,16 @@ 2014-07-08 Juri Linkov + * vc/vc-annotate.el (vc-annotate-background-mode): New defcustom. + (vc-annotate-color-map): Use less saturated colors (20%) for + background-mode. + (vc-annotate-very-old-color): Add default value for background-mode. + (vc-annotate-background): Set default value to nil since now text on + the default backgrounds should be legible in light and dark modes. + (vc-annotate-lines): Use `vc-annotate-background-mode'. Doc fix. + (Bug#17808) + +2014-07-08 Juri Linkov + * simple.el (transpose-chars): Don't move point into read-only area. (Bug#17829) === modified file 'lisp/vc/vc-annotate.el' --- lisp/vc/vc-annotate.el 2014-02-10 01:34:22 +0000 +++ lisp/vc/vc-annotate.el 2014-07-08 08:49:18 +0000 @@ -40,6 +40,23 @@ :value "20.5")) :group 'vc) +(defcustom vc-annotate-background-mode + (not (or (eq (or frame-background-mode + (frame-parameter nil 'background-mode)) + 'dark) + (and (tty-display-color-p) (<= (display-color-cells) 8)))) + "Non-nil means `vc-annotate-color-map' is applied to the background. + +When non-nil, the color range from `vc-annotate-color-map' is applied +to the background, while the foreground remains default. + +When nil, the color range from `vc-annotate-color-map' is applied +to the foreground, and the color from the option `vc-annotate-background' +is applied to the background." + :type 'boolean + :version "24.5" + :group 'vc) + (defcustom vc-annotate-color-map (if (and (tty-display-color-p) (<= (display-color-cells) 8)) ;; A custom sorted TTY colormap @@ -71,25 +88,49 @@ (prog1 (cons date x) (setq date (+ date delta)))) colors)) - ;; Normal colormap: hue stepped from 0-240deg, value=1., saturation=0.75 - '(( 20. . "#FF3F3F") - ( 40. . "#FF6C3F") - ( 60. . "#FF993F") - ( 80. . "#FFC63F") - (100. . "#FFF33F") - (120. . "#DDFF3F") - (140. . "#B0FF3F") - (160. . "#83FF3F") - (180. . "#56FF3F") - (200. . "#3FFF56") - (220. . "#3FFF83") - (240. . "#3FFFB0") - (260. . "#3FFFDD") - (280. . "#3FF3FF") - (300. . "#3FC6FF") - (320. . "#3F99FF") - (340. . "#3F6CFF") - (360. . "#3F3FFF"))) + (cond + ;; Normal colormap for background colors with dark foreground: + ;; hue stepped from 0-240deg, value=1., saturation=0.20 + (vc-annotate-background-mode + '(( 20. . "#FFCCCC") + ( 40. . "#FFD8CC") + ( 60. . "#FFE4CC") + ( 80. . "#FFF0CC") + (100. . "#FFFCCC") + (120. . "#F6FFCC") + (140. . "#EAFFCC") + (160. . "#DEFFCC") + (180. . "#D2FFCC") + (200. . "#CCFFD2") + (220. . "#CCFFDE") + (240. . "#CCFFEA") + (260. . "#CCFFF6") + (280. . "#CCFCFF") + (300. . "#CCF0FF") + (320. . "#CCE4FF") + (340. . "#CCD8FF") + (360. . "#CCCCFF"))) + ;; Normal colormap for foreground colors on dark background: + ;; hue stepped from 0-240deg, value=1., saturation=0.75 + (t + '(( 20. . "#FF3F3F") + ( 40. . "#FF6C3F") + ( 60. . "#FF993F") + ( 80. . "#FFC63F") + (100. . "#FFF33F") + (120. . "#DDFF3F") + (140. . "#B0FF3F") + (160. . "#83FF3F") + (180. . "#56FF3F") + (200. . "#3FFF56") + (220. . "#3FFF83") + (240. . "#3FFFB0") + (260. . "#3FFFDD") + (280. . "#3FF3FF") + (300. . "#3FC6FF") + (320. . "#3F99FF") + (340. . "#3F6CFF") + (360. . "#3F3FFF"))))) "Association list of age versus color, for \\[vc-annotate]. Ages are given in units of fractional days. Default is eighteen steps using a twenty day increment, from red to blue. For TTY @@ -98,12 +139,12 @@ :type 'alist :group 'vc) -(defcustom vc-annotate-very-old-color "#3F3FFF" +(defcustom vc-annotate-very-old-color (if vc-annotate-background-mode "#CCCCFF" "#3F3FFF") "Color for lines older than the current color range in \\[vc-annotate]." :type 'string :group 'vc) -(defcustom vc-annotate-background "black" +(defcustom vc-annotate-background nil "Background color for \\[vc-annotate]. Default color is used if nil." :type '(choice (const :tag "Default background" nil) (color)) @@ -347,7 +388,9 @@ `vc-annotate-menu-elements' customizes the menu elements of the mode-specific menu. `vc-annotate-color-map' and `vc-annotate-very-old-color' define the mapping of time to colors. -`vc-annotate-background' specifies the background color." +`vc-annotate-background' specifies the background color. +`vc-annotate-background-mode' specifies whether the color map +should be applied to the background or to the foreground." (interactive (save-current-buffer (vc-ensure-vc-buffer) @@ -666,10 +709,13 @@ ;; Make the face if not done. (face (or (intern-soft face-name) (let ((tmp-face (make-face (intern face-name)))) - (set-face-foreground tmp-face (cdr color)) - (when vc-annotate-background - (set-face-background tmp-face - vc-annotate-background)) + (cond + (vc-annotate-background-mode + (set-face-background tmp-face (cdr color))) + (t + (set-face-foreground tmp-face (cdr color)) + (when vc-annotate-background + (set-face-background tmp-face vc-annotate-background)))) tmp-face)))) ; Return the face (put-text-property start end 'face face))))) ;; Pretend to font-lock there were no matches. ------------------------------------------------------------ revno: 117488 fixes bug: http://debbugs.gnu.org/17829 committer: Juri Linkov branch nick: trunk timestamp: Tue 2014-07-08 11:27:46 +0300 message: * lisp/simple.el (transpose-chars): Don't move point into read-only area. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-08 08:02:50 +0000 +++ lisp/ChangeLog 2014-07-08 08:27:46 +0000 @@ -1,5 +1,10 @@ 2014-07-08 Juri Linkov + * simple.el (transpose-chars): Don't move point into read-only area. + (Bug#17829) + +2014-07-08 Juri Linkov + * window.el (with-displayed-buffer-window): New macro. (with-temp-buffer-window, with-current-buffer-window): Use `macroexp-let2' to evaluate and bind variables === modified file 'lisp/simple.el' --- lisp/simple.el 2014-07-01 18:13:28 +0000 +++ lisp/simple.el 2014-07-08 08:27:46 +0000 @@ -5934,7 +5934,9 @@ and drag it forward past ARG other characters (backward if ARG negative). If no argument and at end of line, the previous two chars are exchanged." (interactive "*P") - (and (null arg) (eolp) (forward-char -1)) + (when (and (null arg) (eolp) (not (bobp)) + (not (get-text-property (1- (point)) 'read-only))) + (forward-char -1)) (transpose-subr 'forward-char (prefix-numeric-value arg))) (defun transpose-words (arg) ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.