Now on revision 110978. ------------------------------------------------------------ revno: 110978 committer: Paul Eggert branch nick: trunk timestamp: Wed 2012-11-21 23:31:45 -0800 message: * calc/calc.el (calc-gregorian-switch): Move to after calc-refresh definition. This fixes a bootstrap failure. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-22 01:47:04 +0000 +++ lisp/ChangeLog 2012-11-22 07:31:45 +0000 @@ -1,3 +1,8 @@ +2012-11-22 Paul Eggert + + * calc/calc.el (calc-gregorian-switch): Move to after calc-refresh + definition. This fixes a bootstrap failure. + 2012-11-22 Jay Belanger * calc/calc.el (calc-gregorian-switch): Refresh the Calc buffer === modified file 'lisp/calc/calc.el' --- lisp/calc/calc.el 2012-11-22 01:47:04 +0000 +++ lisp/calc/calc.el 2012-11-22 07:31:45 +0000 @@ -466,51 +466,6 @@ (defvar math-format-date-cache) ; calc-forms.el -;; Dates that are built-in options for `calc-gregorian-switch' should be -;; (YEAR MONTH DAY math-date-from-gregorian-dt(YEAR MONTH DAY)) for speed. -(defcustom calc-gregorian-switch nil - "The first day the Gregorian calendar is used by Calc's date forms. -This is `nil' (the default) if the Gregorian calendar is the only one used. -Otherwise, it should be a list `(YEAR MONTH DAY)' when Calc begins to use -the Gregorian calendar; Calc will use the Julian calendar for earlier dates. -The dates in which different regions of the world began to use the -Gregorian calendar vary quite a bit, even within a single country. -If you want Calc's date forms to switch between the Julian and -Gregorian calendar, you can specify the date or choose from several -common choices. Some of these choices should be taken with a grain -of salt; for example different parts of France changed calendars at -different times, and Sweden's change to the Gregorian calendar was -complicated. Also, the boundaries of the countries were different at -the times of the calendar changes than they are now. -The Vatican decided that the Gregorian calendar should take effect -on 15 October 1582 (Gregorian), and many Catholic countries made -the change then. Great Britian and its colonies had the Gregorian -calendar take effect on 14 September 1752 (Gregorian); this includes -the United States." - :group 'calc - :version "24.4" - :type '(choice (const :tag "Always use the Gregorian calendar" nil) - (const :tag "Great Britian and the US (1752 9 14)" (1752 9 14 639797)) - (const :tag "Vatican (1582 10 15)" (1582 10 15 577736)) - (const :tag "Czechoslovakia (1584 1 17)" (1584 1 17 578195)) - (const :tag "Denmark (1700 3 1)" (1700 3 1 620607)) - (const :tag "France (1582 12 20)" (1582 12 20 577802)) - (const :tag "Hungary (1587 11 1)" (1587 11 1 579579)) - (const :tag "Luxemburg (1582 12 25)" (1582 12 25 577807)) - (const :tag "Romania (1919 4 14)" (1919 4 14 700638)) - (const :tag "Russia (1918 2 14)" (1918 2 14 700214)) - (const :tag "Sweden (1753 3 1)" (1753 3 1 639965)) - (const :tag "Switzerland (Catholic) (1584 1 22)" (1584 1 22 578200)) - (const :tag "Switzerland (Protestant) (1701 1 12)" (1701 1 12 620924)) - (list :tag "(YEAR MONTH DAY)" - (integer :tag "Year") - (integer :tag "Month (integer)") - (integer :tag "Day"))) - :set (lambda (symbol value) - (set-default symbol value) - (setq math-format-date-cache nil) - (calc-refresh))) - (defface calc-nonselected-face '((t :inherit shadow :slant italic)) @@ -2067,6 +2022,51 @@ (calc-refresh align))) (setq calc-refresh-count (1+ calc-refresh-count))) +;; Dates that are built-in options for `calc-gregorian-switch' should be +;; (YEAR MONTH DAY math-date-from-gregorian-dt(YEAR MONTH DAY)) for speed. +(defcustom calc-gregorian-switch nil + "The first day the Gregorian calendar is used by Calc's date forms. +This is `nil' (the default) if the Gregorian calendar is the only one used. +Otherwise, it should be a list `(YEAR MONTH DAY)' when Calc begins to use +the Gregorian calendar; Calc will use the Julian calendar for earlier dates. +The dates in which different regions of the world began to use the +Gregorian calendar vary quite a bit, even within a single country. +If you want Calc's date forms to switch between the Julian and +Gregorian calendar, you can specify the date or choose from several +common choices. Some of these choices should be taken with a grain +of salt; for example different parts of France changed calendars at +different times, and Sweden's change to the Gregorian calendar was +complicated. Also, the boundaries of the countries were different at +the times of the calendar changes than they are now. +The Vatican decided that the Gregorian calendar should take effect +on 15 October 1582 (Gregorian), and many Catholic countries made +the change then. Great Britian and its colonies had the Gregorian +calendar take effect on 14 September 1752 (Gregorian); this includes +the United States." + :group 'calc + :version "24.4" + :type '(choice (const :tag "Always use the Gregorian calendar" nil) + (const :tag "Great Britian and the US (1752 9 14)" (1752 9 14 639797)) + (const :tag "Vatican (1582 10 15)" (1582 10 15 577736)) + (const :tag "Czechoslovakia (1584 1 17)" (1584 1 17 578195)) + (const :tag "Denmark (1700 3 1)" (1700 3 1 620607)) + (const :tag "France (1582 12 20)" (1582 12 20 577802)) + (const :tag "Hungary (1587 11 1)" (1587 11 1 579579)) + (const :tag "Luxemburg (1582 12 25)" (1582 12 25 577807)) + (const :tag "Romania (1919 4 14)" (1919 4 14 700638)) + (const :tag "Russia (1918 2 14)" (1918 2 14 700214)) + (const :tag "Sweden (1753 3 1)" (1753 3 1 639965)) + (const :tag "Switzerland (Catholic) (1584 1 22)" (1584 1 22 578200)) + (const :tag "Switzerland (Protestant) (1701 1 12)" (1701 1 12 620924)) + (list :tag "(YEAR MONTH DAY)" + (integer :tag "Year") + (integer :tag "Month (integer)") + (integer :tag "Day"))) + :set (lambda (symbol value) + (set-default symbol value) + (setq math-format-date-cache nil) + (calc-refresh))) + ;;;; The Calc Trail buffer. (defun calc-check-trail-aligned () ------------------------------------------------------------ revno: 110977 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2012-11-22 10:52:30 +0400 message: * xdisp.c (window_buffer_changed): New function. (update_menu_bar, update_tool_bar): Use it to simplify large 'if' statements. (redisplay_internal): Generalize commonly used 'tail' and 'frame' local variables. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-22 03:56:38 +0000 +++ src/ChangeLog 2012-11-22 06:52:30 +0000 @@ -1,3 +1,11 @@ +2012-11-22 Dmitry Antipov + + * xdisp.c (window_buffer_changed): New function. + (update_menu_bar, update_tool_bar): Use it to + simplify large 'if' statements. + (redisplay_internal): Generalize commonly used + 'tail' and 'frame' local variables. + 2012-11-22 Eli Zaretskii * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts === modified file 'src/xdisp.c' --- src/xdisp.c 2012-11-21 16:34:35 +0000 +++ src/xdisp.c 2012-11-22 06:52:30 +0000 @@ -10908,6 +10908,21 @@ || w->last_overlay_modified < OVERLAY_MODIFF); } +/* Nonzero if W's buffer was changed but not saved or Transient Mark mode + is enabled and mark of W's buffer was changed since last W's update. */ + +static int +window_buffer_changed (struct window *w) +{ + struct buffer *b = XBUFFER (w->buffer); + + eassert (BUFFER_LIVE_P (b)); + + return (((BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) != w->last_had_star) + || ((!NILP (Vtransient_mark_mode) && !NILP (BVAR (b, mark_active))) + != !NILP (w->region_showing))); +} + /*********************************************************************** Mode Lines and Frame Titles ***********************************************************************/ @@ -11327,12 +11342,7 @@ /* This used to test w->update_mode_line, but we believe there is no need to recompute the menu in that case. */ || update_mode_lines - || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer)) - < BUF_MODIFF (XBUFFER (w->buffer))) - != w->last_had_star) - || ((!NILP (Vtransient_mark_mode) - && !NILP (BVAR (XBUFFER (w->buffer), mark_active))) - != !NILP (w->region_showing))) + || window_buffer_changed (w)) { struct buffer *prev = current_buffer; ptrdiff_t count = SPECPDL_INDEX (); @@ -11532,12 +11542,7 @@ if (windows_or_buffers_changed || w->update_mode_line || update_mode_lines - || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer)) - < BUF_MODIFF (XBUFFER (w->buffer))) - != w->last_had_star) - || ((!NILP (Vtransient_mark_mode) - && !NILP (BVAR (XBUFFER (w->buffer), mark_active))) - != !NILP (w->region_showing))) + || window_buffer_changed (w)) { struct buffer *prev = current_buffer; ptrdiff_t count = SPECPDL_INDEX (); @@ -12988,7 +12993,7 @@ ptrdiff_t count, count1; struct frame *sf; int polling_stopped_here = 0; - Lisp_Object old_frame = selected_frame; + Lisp_Object tail, frame, old_frame = selected_frame; struct backtrace backtrace; /* Non-zero means redisplay has to consider all windows on all @@ -13040,15 +13045,8 @@ backtrace.debug_on_exit = 0; backtrace_list = &backtrace; - { - Lisp_Object tail, frame; - - FOR_EACH_FRAME (tail, frame) - { - struct frame *f = XFRAME (frame); - f->already_hscrolled_p = 0; - } - } + FOR_EACH_FRAME (tail, frame) + XFRAME (frame)->already_hscrolled_p = 0; retry: /* Remember the currently selected window. */ @@ -13098,25 +13096,20 @@ FRAME_TTY (sf)->previous_frame = sf; } - /* Set the visible flags for all frames. Do this before checking - for resized or garbaged frames; they want to know if their frames - are visible. See the comment in frame.h for - FRAME_SAMPLE_VISIBILITY. */ - { - Lisp_Object tail, frame; - - number_of_visible_frames = 0; - - FOR_EACH_FRAME (tail, frame) - { - struct frame *f = XFRAME (frame); - - FRAME_SAMPLE_VISIBILITY (f); - if (FRAME_VISIBLE_P (f)) - ++number_of_visible_frames; - clear_desired_matrices (f); - } - } + /* Set the visible flags for all frames. Do this before checking for + resized or garbaged frames; they want to know if their frames are + visible. See the comment in frame.h for FRAME_SAMPLE_VISIBILITY. */ + number_of_visible_frames = 0; + + FOR_EACH_FRAME (tail, frame) + { + struct frame *f = XFRAME (frame); + + FRAME_SAMPLE_VISIBILITY (f); + if (FRAME_VISIBLE_P (f)) + ++number_of_visible_frames; + clear_desired_matrices (f); + } /* Notice any pending interrupt request to change frame size. */ do_pending_window_change (1); @@ -13467,8 +13460,6 @@ if (consider_all_windows_p) { - Lisp_Object tail, frame; - FOR_EACH_FRAME (tail, frame) XFRAME (frame)->updated_p = 0; @@ -13678,7 +13669,6 @@ frames here explicitly. */ if (!pending) { - Lisp_Object tail, frame; int new_count = 0; FOR_EACH_FRAME (tail, frame) ------------------------------------------------------------ revno: 110976 fixes bug: http://debbugs.gnu.org/12945 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2012-11-22 05:56:38 +0200 message: Fix MS-Windows build following revision 110972. src/w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts with Windows system header. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-21 21:06:52 +0000 +++ src/ChangeLog 2012-11-22 03:56:38 +0000 @@ -1,3 +1,8 @@ +2012-11-22 Eli Zaretskii + + * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts + with Windows system header. + 2012-11-21 Paul Eggert Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945). === modified file 'src/w32.c' --- src/w32.c 2012-11-21 21:06:52 +0000 +++ src/w32.c 2012-11-22 03:56:38 +0000 @@ -908,7 +908,7 @@ /* Get the current working directory. */ char * -getcwd (char *dir, size_t dirsize) +getcwd (char *dir, int dirsize) { if (!dirsize) { ------------------------------------------------------------ revno: 110975 committer: Jay Belanger branch nick: trunk timestamp: Wed 2012-11-21 19:47:04 -0600 message: * doc/misc/calc.texi (Date Forms): Mention the customizable Gregorian-Julian switch. (Customizing Calc): Mention the variable `calc-gregorian-switch'. * calc/calc.el (calc-gregorian-switch): Refresh the Calc buffer after the variable is changed. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-11-21 04:47:55 +0000 +++ doc/misc/ChangeLog 2012-11-22 01:47:04 +0000 @@ -1,3 +1,9 @@ +2012-11-22 Jay Belanger + + * doc/misc/calc.texi (Date Forms): Mention the customizable + Gregorian-Julian switch. + (Customizing Calc): Mention the variable `calc-gregorian-switch'. + 2012-11-17 Paul Eggert Calc now uses the Gregorian calendar for all dates, === modified file 'doc/misc/calc.texi' --- doc/misc/calc.texi 2012-11-17 22:01:59 +0000 +++ doc/misc/calc.texi 2012-11-22 01:47:04 +0000 @@ -10987,10 +10987,10 @@ notations for dates and times. @xref{Date Formats}. Date forms are stored internally as numbers, specifically the number -of days since midnight on the morning of January 1 of the year 1 AD. +of days since midnight on the morning of December 31 of the year 1 BC. If the internal number is an integer, the form represents a date only; if the internal number is a fraction or float, the form represents -a date and time. For example, @samp{<6:00am Wed Jan 9, 1991>} +a date and time. For example, @samp{<6:00am Thu Jan 10, 1991>} is represented by the number 726842.25. The standard precision of 12 decimal digits is enough to ensure that a (reasonable) date and time can be stored without roundoff error. @@ -11014,42 +11014,55 @@ before @samp{} is @samp{}. These are days 1 and 0 respectively in Calc's internal numbering scheme. The Gregorian calendar is used for all dates, including dates before the -Gregorian calendar was invented. Thus Calc's use of the day number -@mathit{-10000} to represent August 15, 28 BC should be taken with a -grain of salt. +Gregorian calendar was invented (although that can be configured; see +below). Thus Calc's use of the day number @mathit{-10000} to +represent August 15, 28 BC should be taken with a grain of salt. @cindex Julian calendar @cindex Gregorian calendar Some historical background: The Julian calendar was created by Julius Caesar in the year 46 BC as an attempt to fix the confusion caused by the irregular Roman calendar that was used before that time. -The Julian calendar introduced an extra day in -all years divisible by four. After some initial confusion, the -calendar was adopted around the year we call 8 AD, although the years were -numbered differently and did not necessarily begin on January 1. Some centuries -later it became apparent that the Julian year of 365.25 days was -itself not quite right. In 1582 Pope Gregory XIII introduced the -Gregorian calendar, which added the new rule that years divisible -by 100, but not by 400, were not to be considered leap years -despite being divisible by four. Many countries delayed adoption -of the Gregorian calendar because of religious differences, and -used differing year numbers and start-of-year for other reasons; -for example, in early 1752 England changed the start of its year from -March 25 to January 1, and in September it switched to the Gregorian -calendar: in England, the day after December 31, 1750 was January 1, -1750 and the day after March 24, 1750 was March 25, 1751, but the day -after December 31, 1751 was January 1, 1752 and the day after -September 2, 1752 was September 14, 1752. To take another example, -Russia switched both year numbering and start-of-year in 1700, but did -not adopt the Gregorian calendar until 1918. Calc's reckoning -therefore matches English practice starting in 1752 and Russian -practice starting in 1918, but disagrees with earlier dates in both -countries. - -Today's timekeepers introduce an occasional ``leap second'' as -well, but Calc does not take these minor effects into account. -(If it did, it would have to report a non-integer number of days -between, say, @samp{<12:00am Mon Jan 1, 1900>} and +The Julian calendar introduced an extra day in all years divisible by +four. After some initial confusion, the calendar was adopted around +the year we call 8 AD. Some centuries later it became +apparent that the Julian year of 365.25 days was itself not quite +right. In 1582 Pope Gregory XIII introduced the Gregorian calendar, +which added the new rule that years divisible by 100, but not by 400, +were not to be considered leap years despite being divisible by four. +Many countries delayed adoption of the Gregorian calendar +because of religious differences. For example, Great Britain and the +British colonies switched to the Gregorian calendar in September +1752, when the Julian calendar was eleven days behind the +Gregorian calendar. That year in Britain, the day after September 2 +was September 14. To take another example, Russia did not adopt the +Gregorian calendar until 1918, and that year in Russia the day after +January 31 was February 14. Calc's reckoning therefore matches English +practice starting in 1752 and Russian practice starting in 1918, but +disagrees with earlier dates in both countries. + +When the Julian calendar was introduced, it had January 1 as the first +day of the year. By the Middle Ages, many European countries +had changed the beginning of a new year to a different date, often to +a religious festival. Almost all countries reverted to using January 1 +as the beginning of the year by the time they adopted the Gregorian +calendar. + +Some calendars attempt to mimic the historical situation by using the +Gregorian calendar for recent dates and the Julian calendar for older +dates. The @code{cal} program in most Unix implementations does this, +for example. While January 1 wasn't always the beginning of a calendar +year, these hybrid calendars still use January 1 as the beginning of +the year even for older dates. The customizable variable +@code{calc-gregorian-switch} (@pxref{Customizing Calc}) can be set to +have Calc's date forms switch from the Julian to Gregorian calendar at +any specified date. + +Today's timekeepers introduce an occasional ``leap second''. +These do not occur regularly and Calc does not take these minor +effects into account. (If it did, it would have to report a +non-integer number of days between, say, +@samp{<12:00am Mon Jan 1, 1900>} and @samp{<12:00am Sat Jan 1, 2000>}.) @cindex Julian day counting @@ -35590,6 +35603,20 @@ be preserved. The default value of @code{calc-undo-length} is @expr{100}. @end defvar +@defvar calc-gregorian-switch +See @ref{Date Forms}.@* +The variable @code{calc-gregorian-switch} is either a list of integers +@code{(@var{YEAR} @var{MONTH} @var{DAY})} or @code{nil}. +If it is @code{nil}, then Calc's date forms always represent Gregorian dates. +Otherwise, @code{calc-gregorian-switch} represents the date that the +calendar switches from Julian dates to Gregorian dates; +@code{(@var{YEAR} @var{MONTH} @var{DAY})} will be the first Gregorian +date. The customization buffer will offer several standard dates to +choose from, or the user can enter their own date. + +The default value of @code{calc-gregorian-switch} is @code{nil}. +@end defvar + @node Reporting Bugs, Summary, Customizing Calc, Top @appendix Reporting Bugs === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-21 21:47:10 +0000 +++ lisp/ChangeLog 2012-11-22 01:47:04 +0000 @@ -1,3 +1,8 @@ +2012-11-22 Jay Belanger + + * calc/calc.el (calc-gregorian-switch): Refresh the Calc buffer + after the variable is changed. + 2012-11-21 Daniel Colascione * progmodes/sql.el (sql-mode-font-lock-object-name): Support IF NOT EXISTS === modified file 'lisp/calc/README' --- lisp/calc/README 2012-08-15 16:29:11 +0000 +++ lisp/calc/README 2012-11-22 01:47:04 +0000 @@ -70,11 +70,18 @@ Summary of changes to "Calc" ------- -- ------- -- ---- +Emacs 24.4 + +* The date forms use the Gregorian calendar for all dates. + (Previously they were a combination of Julian and Gregorian + dates.) This can be configured with the customizable variable + `calc-gregorian-switch'. + Emacs 24.3 -Algebraic simplification mode is now the default. -To restrict to the limited simplifications given by the former -default simplification mode, use `m I'. +* Algebraic simplification mode is now the default. + To restrict to the limited simplifications given by the former + default simplification mode, use `m I'. Emacs 24.1 === modified file 'lisp/calc/calc.el' --- lisp/calc/calc.el 2012-11-18 01:20:04 +0000 +++ lisp/calc/calc.el 2012-11-22 01:47:04 +0000 @@ -508,7 +508,8 @@ (integer :tag "Day"))) :set (lambda (symbol value) (set-default symbol value) - (setq math-format-date-cache nil))) + (setq math-format-date-cache nil) + (calc-refresh))) (defface calc-nonselected-face '((t :inherit shadow ------------------------------------------------------------ revno: 110974 [merge] committer: Daniel Colascione branch nick: trunk timestamp: Wed 2012-11-21 13:47:10 -0800 message: Teach sql-mode's imenu about IF NOT EXISTS diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-21 21:38:56 +0000 +++ lisp/ChangeLog 2012-11-21 21:47:10 +0000 @@ -1,7 +1,8 @@ 2012-11-21 Daniel Colascione * progmodes/sql.el (sql-mode-font-lock-object-name): Support IF NOT EXISTS - in SQL declarations. + in SQL declarations for font-lock. + (sql-imenu-generic-expression): Teach imenu about IF NOT EXISTS. 2012-11-21 Glenn Morris === modified file 'lisp/progmodes/sql.el' --- lisp/progmodes/sql.el 2012-11-21 21:38:56 +0000 +++ lisp/progmodes/sql.el 2012-11-21 21:47:10 +0000 @@ -736,15 +736,15 @@ (defvar sql-imenu-generic-expression ;; Items are in reverse order because they are rendered in reverse. - '(("Rules/Defaults" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*\\(rule\\|default\\)\\s-+\\(\\w+\\)" 3) - ("Sequences" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*sequence\\s-+\\(\\w+\\)" 2) - ("Triggers" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*trigger\\s-+\\(\\w+\\)" 2) - ("Functions" "^\\s-*\\(create\\s-+\\(\\w+\\s-+\\)*\\)?function\\s-+\\(\\w+\\)" 3) - ("Procedures" "^\\s-*\\(create\\s-+\\(\\w+\\s-+\\)*\\)?proc\\(edure\\)?\\s-+\\(\\w+\\)" 4) - ("Packages" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*package\\s-+\\(body\\s-+\\)?\\(\\w+\\)" 3) - ("Types" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*type\\s-+\\(body\\s-+\\)?\\(\\w+\\)" 3) - ("Indexes" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*index\\s-+\\(\\w+\\)" 2) - ("Tables/Views" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*\\(table\\|view\\)\\s-+\\(\\w+\\)" 3)) + '(("Rules/Defaults" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*\\(?:rule\\|default\\)\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\s-+\\(\\w+\\)" 1) + ("Sequences" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*sequence\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1) + ("Triggers" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*trigger\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1) + ("Functions" "^\\s-*\\(?:create\\s-+\\(?:\\w+\\s-+\\)*\\)?function\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1) + ("Procedures" "^\\s-*\\(?:create\\s-+\\(?:\\w+\\s-+\\)*\\)?proc\\(?:edure\\)?\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1) + ("Packages" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*package\\s-+\\(?:body\\s-+\\)?\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1) + ("Types" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*type\\s-+\\(?:body\\s-+\\)?\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1) + ("Indexes" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*index\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1) + ("Tables/Views" "^\\s-*create\\s-+\\(?:\\w+\\s-+\\)*\\(?:table\\|view\\)\\s-+\\(?:if\\s-+not\\s-+exists\\s-+\\)?\\(\\w+\\)" 1)) "Define interesting points in the SQL buffer for `imenu'. This is used to set `imenu-generic-expression' when SQL mode is ------------------------------------------------------------ revno: 110973 [merge] committer: Daniel Colascione branch nick: trunk timestamp: Wed 2012-11-21 13:38:56 -0800 message: Support IF NOT EXISTS in SQL declarations diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-21 08:39:08 +0000 +++ lisp/ChangeLog 2012-11-21 21:38:56 +0000 @@ -1,3 +1,8 @@ +2012-11-21 Daniel Colascione + + * progmodes/sql.el (sql-mode-font-lock-object-name): Support IF NOT EXISTS + in SQL declarations. + 2012-11-21 Glenn Morris * faces.el (face-underline-p, face-inverse-video-p, face-bold-p) === modified file 'lisp/progmodes/sql.el' --- lisp/progmodes/sql.el 2012-11-09 04:10:16 +0000 +++ lisp/progmodes/sql.el 2012-11-21 21:38:56 +0000 @@ -1339,6 +1339,7 @@ "\\(?:\\w+\\s-+\\)*" ;; optional intervening keywords "\\(?:table\\|view\\|\\(?:package\\|type\\)\\(?:\\s-+body\\)?\\|proc\\(?:edure\\)?" "\\|function\\|trigger\\|sequence\\|rule\\|default\\)\\s-+" + "\\(?:if\\s-+not\\s-+exists\\s-+\\)?" ;; IF NOT EXISTS "\\(\\w+\\)") 1 'font-lock-function-name-face)) ------------------------------------------------------------ revno: 110972 fixes bug: http://debbugs.gnu.org/12945 committer: Paul Eggert branch nick: trunk timestamp: Wed 2012-11-21 13:06:52 -0800 message: Assume POSIX 1003.1-1988 or later for unistd.h. * admin/CPP-DEFINES (BROKEN_GETWD, HAVE_GETCWD, HAVE_GETWD, HAVE_SIZE_T) (HAVE_UNISTD_H): Remove. * configure.ac: Do not check for getcwd or getwd. * lib-src/emacsclient.c (getcwd): Remove decl. (get_current_dir_name): Assume getcwd exists. * lib-src/etags.c (HAVE_GETCWD): Remove. (getcwd): Remove decl. (NO_LONG_OPTIONS): Remove this. All uses removed. Emacs always has GNU getopt. (etags_getcwd): Assume getcwd exists. * lib-src/movemail.c (F_OK, X_OK, W_OK, R_OK): Remove. * nt/config.nt (HAVE_GETCWD): Remove. * src/alloc.c: Assume unistd.h exists. * src/fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd. * src/sysdep.c (get_current_dir_name): Assume getcwd exists. (getwd) [USG]: Remove; no longer needed. (sys_subshell) [DOS_NT]: Use getcwd, not getwd. * src/w32.c (getcwd): Rename from getwd, and switch to getcwd's API. * src/w32.h (getcwd): Remove decl. diff: === modified file 'ChangeLog' --- ChangeLog 2012-11-21 04:47:55 +0000 +++ ChangeLog 2012-11-21 21:06:52 +0000 @@ -1,3 +1,8 @@ +2012-11-21 Paul Eggert + + Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945). + * configure.ac: Do not check for getcwd or getwd. + 2012-11-21 Glenn Morris * configure.ac (--enable-profiling): Doc fix. === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2012-11-17 22:12:47 +0000 +++ admin/CPP-DEFINES 2012-11-21 21:06:52 +0000 @@ -86,7 +86,6 @@ AMPERSAND_FULL_NAME BROKEN_DATAGRAM_SOCKETS BROKEN_FIONREAD -BROKEN_GETWD BROKEN_GET_CURRENT_DIR_NAME BROKEN_NON_BLOCKING_CONNECT BROKEN_PTY_READ_AFTER_EAGAIN @@ -161,7 +160,6 @@ HAVE_GAI_STRERROR HAVE_GCONF HAVE_GETADDRINFO -HAVE_GETCWD HAVE_GETDELIM HAVE_GETGRENT HAVE_GETHOSTNAME @@ -178,7 +176,6 @@ HAVE_GETRUSAGE HAVE_GETSOCKNAME HAVE_GETTIMEOFDAY -HAVE_GETWD HAVE_GET_CURRENT_DIR_NAME HAVE_GHOSTSCRIPT HAVE_GIF @@ -304,7 +301,6 @@ HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T HAVE_SIGSET_T -HAVE_SIZE_T HAVE_SNPRINTF HAVE_SOCKETS HAVE_SOUND @@ -369,7 +365,6 @@ HAVE_TOUCHLOCK HAVE_TZNAME HAVE_TZSET -HAVE_UNISTD_H HAVE_UNSIGNED_LONG_LONG_INT HAVE_UTIL_H HAVE_UTIMENSAT === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-11-17 22:12:47 +0000 +++ admin/ChangeLog 2012-11-21 21:06:52 +0000 @@ -1,3 +1,9 @@ +2012-11-21 Paul Eggert + + Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945). + * CPP-DEFINES (BROKEN_GETWD, HAVE_GETCWD, HAVE_GETWD, HAVE_SIZE_T) + (HAVE_UNISTD_H): Remove. + 2012-11-17 Paul Eggert Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881). === modified file 'configure.ac' --- configure.ac 2012-11-21 04:47:55 +0000 +++ configure.ac 2012-11-21 21:06:52 +0000 @@ -2894,7 +2894,7 @@ closedir getrusage get_current_dir_name \ lrand48 \ select getpagesize setlocale \ -utimes getrlimit setrlimit getcwd shutdown getaddrinfo \ +utimes getrlimit setrlimit shutdown getaddrinfo \ strsignal setitimer \ sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \ gai_strerror mkstemp getline getdelim fsync sync \ @@ -2903,14 +2903,6 @@ touchlock \ cfmakeraw cfsetspeed copysign __executable_start) -dnl getwd appears to be buggy on SVR4.2, so we don't use it. -if test $opsys = unixware; then - dnl In case some other test ends up checking for getwd. - AC_DEFINE(BROKEN_GETWD, 1, [Define if getwd should not be used.]) -else - AC_CHECK_FUNCS(getwd) -fi - ## Eric Backus says, HP-UX 9.x on HP 700 machines ## has a broken `rint' in some library versions including math library ## version number A.09.05. === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2012-11-20 08:31:19 +0000 +++ lib-src/ChangeLog 2012-11-21 21:06:52 +0000 @@ -1,3 +1,15 @@ +2012-11-21 Paul Eggert + + Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945). + * emacsclient.c (getcwd): Remove decl. + (get_current_dir_name): Assume getcwd exists. + * etags.c (HAVE_GETCWD): Remove. + (getcwd): Remove decl. + (NO_LONG_OPTIONS): Remove this. All uses removed. + Emacs always has GNU getopt. + (etags_getcwd): Assume getcwd exists. + * movemail.c (F_OK, X_OK, W_OK, R_OK): Remove. + 2012-11-20 Paul Eggert * emacsclient.c (handle_sigcont, handle_sigtstp): Use raise (sig) === modified file 'lib-src/emacsclient.c' --- lib-src/emacsclient.c 2012-11-20 08:31:19 +0000 +++ lib-src/emacsclient.c 2012-11-21 21:06:52 +0000 @@ -88,10 +88,7 @@ -char *getenv (const char *), *getwd (char *); -#ifdef HAVE_GETCWD -char *(getcwd) (char *, size_t); -#endif +char *getenv (const char *); #ifndef VERSION #define VERSION "unspecified" @@ -223,7 +220,7 @@ char *buf; const char *pwd; struct stat dotstat, pwdstat; - /* If PWD is accurate, use it instead of calling getwd. PWD is + /* If PWD is accurate, use it instead of calling getcwd. PWD is sometimes a nicer name, and using it may avoid a fatal error if a parent directory is searchable but not readable. */ if ((pwd = egetenv ("PWD")) != 0 @@ -240,7 +237,6 @@ buf = (char *) xmalloc (strlen (pwd) + 1); strcpy (buf, pwd); } -#ifdef HAVE_GETCWD else { size_t buf_size = 1024; @@ -267,20 +263,6 @@ } } } -#else - else - { - /* We need MAXPATHLEN here. */ - buf = (char *) xmalloc (MAXPATHLEN + 1); - if (getwd (buf) == NULL) - { - int tmp_errno = errno; - free (buf); - errno = tmp_errno; - return NULL; - } - } -#endif return buf; } #endif @@ -1592,7 +1574,6 @@ cwd = get_current_dir_name (); if (cwd == 0) { - /* getwd puts message in STRING if it fails. */ message (TRUE, "%s: %s\n", progname, "Cannot get current working directory"); fail (); === modified file 'lib-src/etags.c' --- lib-src/etags.c 2012-09-17 00:56:08 +0000 +++ lib-src/etags.c 2012-11-21 21:06:52 +0000 @@ -123,19 +123,9 @@ # undef HAVE_NTGUI # undef DOS_NT # define DOS_NT -# ifndef HAVE_GETCWD -# define HAVE_GETCWD -# endif /* undef HAVE_GETCWD */ -#else /* not WINDOWSNT */ -#endif /* !WINDOWSNT */ +#endif /* WINDOWSNT */ #include -#ifndef HAVE_UNISTD_H -# if defined (HAVE_GETCWD) && !defined (WINDOWSNT) - extern char *getcwd (char *buf, size_t size); -# endif -#endif /* HAVE_UNISTD_H */ - #include #include #include @@ -152,16 +142,7 @@ # define assert(x) ((void) 0) #endif -#ifdef NO_LONG_OPTIONS /* define this if you don't have GNU getopt */ -# define NO_LONG_OPTIONS TRUE -# define getopt_long(argc,argv,optstr,lopts,lind) getopt (argc, argv, optstr) - extern char *optarg; - extern int optind, opterr; -#else -# define NO_LONG_OPTIONS FALSE -# include -#endif /* NO_LONG_OPTIONS */ - +#include #include /* Define CTAGS to make the program "ctags" compatible with the usual one. @@ -869,11 +850,7 @@ printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\ \n\ These are the options accepted by %s.\n", progname, progname); - if (NO_LONG_OPTIONS) - puts ("WARNING: long option names do not work with this executable,\n\ -as it is not linked with GNU getopt."); - else - puts ("You may use unambiguous abbreviations for the long option names."); + puts ("You may use unambiguous abbreviations for the long option names."); puts (" A - as file name means read names from stdin (one per line).\n\ Absolute names are stored in the output file as they are.\n\ Relative ones are stored relative to the output file's directory.\n"); @@ -1065,9 +1042,9 @@ /* When the optstring begins with a '-' getopt_long does not rearrange the non-options arguments to be at the end, but leaves them alone. */ - optstring = concat (NO_LONG_OPTIONS ? "" : "-", - "ac:Cf:Il:o:r:RSVhH", - (CTAGS) ? "BxdtTuvw" : "Di:"); + optstring = concat ("-ac:Cf:Il:o:r:RSVhH", + (CTAGS) ? "BxdtTuvw" : "Di:", + ""); while ((opt = getopt_long (argc, argv, optstring, longopts, NULL)) != EOF) switch (opt) @@ -6333,8 +6310,8 @@ static void suggest_asking_for_help (void) { - fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", - progname, NO_LONG_OPTIONS ? "-h" : "--help"); + fprintf (stderr, "\tTry `%s --help' for a complete list of options.\n", + progname); exit (EXIT_FAILURE); } @@ -6372,7 +6349,6 @@ static char * etags_getcwd (void) { -#ifdef HAVE_GETCWD int bufsize = 200; char *path = xnew (bufsize, char); @@ -6387,34 +6363,6 @@ canonicalize_filename (path); return path; - -#else /* not HAVE_GETCWD */ -#if MSDOS - - char *p, path[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */ - - getwd (path); - - for (p = path; *p != '\0'; p++) - if (*p == '\\') - *p = '/'; - else - *p = lowcase (*p); - - return strdup (path); -#else /* not MSDOS */ - linebuffer path; - FILE *pipe; - - linebuffer_init (&path); - pipe = (FILE *) popen ("pwd 2>/dev/null", "r"); - if (pipe == NULL || readline_internal (&path, pipe) == 0) - pfatal ("pwd"); - pclose (pipe); - - return path.buffer; -#endif /* not MSDOS */ -#endif /* not HAVE_GETCWD */ } /* Return a newly allocated string containing the file name of FILE === modified file 'lib-src/movemail.c' --- lib-src/movemail.c 2012-11-17 22:12:47 +0000 +++ lib-src/movemail.c 2012-11-21 21:06:52 +0000 @@ -96,13 +96,6 @@ #include #endif /* WINDOWSNT */ -#ifndef F_OK -#define F_OK 0 -#define X_OK 1 -#define W_OK 2 -#define R_OK 4 -#endif - #ifdef WINDOWSNT #include #endif === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-11-21 04:47:55 +0000 +++ nt/ChangeLog 2012-11-21 21:06:52 +0000 @@ -1,3 +1,8 @@ +2012-11-21 Paul Eggert + + Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945). + * config.nt (HAVE_GETCWD): Remove. + 2012-11-21 Eli Zaretskii * nmake.defs: Use !if, not !ifdef. For the details, see === modified file 'nt/config.nt' --- nt/config.nt 2012-11-17 23:58:56 +0000 +++ nt/config.nt 2012-11-21 21:06:52 +0000 @@ -411,12 +411,6 @@ /* Define to 1 if you have the `getaddrinfo' function. */ #undef HAVE_GETADDRINFO -/* Define to 1 if you have the `getcwd' function. - If you think about defining HAVE_GETCWD, don't: the alternative - getwd is redefined on w32.c, and does not really return the current - directory, to get the desired results elsewhere in Emacs. */ -#undef HAVE_GETCWD - /* Define to 1 if you have the `getdelim' function. */ #undef HAVE_GETDELIM === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-21 16:34:35 +0000 +++ src/ChangeLog 2012-11-21 21:06:52 +0000 @@ -1,3 +1,14 @@ +2012-11-21 Paul Eggert + + Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945). + * alloc.c: Assume unistd.h exists. + * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd. + * sysdep.c (get_current_dir_name): Assume getcwd exists. + (getwd) [USG]: Remove; no longer needed. + (sys_subshell) [DOS_NT]: Use getcwd, not getwd. + * w32.c (getcwd): Rename from getwd, and switch to getcwd's API. + * w32.h (getcwd): Remove decl. + 2012-11-21 Stefan Monnier * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind. === modified file 'src/alloc.c' --- src/alloc.c 2012-11-20 20:06:17 +0000 +++ src/alloc.c 2012-11-21 21:06:52 +0000 @@ -63,10 +63,6 @@ #endif #include -#ifndef HAVE_UNISTD_H -extern void *sbrk (); -#endif - #include #ifdef USE_GTK === modified file 'src/fileio.c' --- src/fileio.c 2012-11-21 04:47:55 +0000 +++ src/fileio.c 2012-11-21 21:06:52 +0000 @@ -1148,7 +1148,7 @@ newdir = "/"; } else - getwd (adir); + getcwd (adir, MAXPATHLEN + 1); newdir = adir; } === modified file 'src/sysdep.c' --- src/sysdep.c 2012-11-17 22:12:47 +0000 +++ src/sysdep.c 2012-11-21 21:06:52 +0000 @@ -101,7 +101,6 @@ #define _P_WAIT 0 int _cdecl _spawnlp (int, const char *, const char *, ...); int _cdecl _getpid (void); -extern char *getwd (char *); #endif #include "syssignal.h" @@ -134,12 +133,12 @@ get_current_dir_name (void) { char *buf; - char *pwd; + char *pwd = getenv ("PWD"); struct stat dotstat, pwdstat; - /* If PWD is accurate, use it instead of calling getwd. PWD is + /* If PWD is accurate, use it instead of calling getcwd. PWD is sometimes a nicer name, and using it may avoid a fatal error if a parent directory is searchable but not readable. */ - if ((pwd = getenv ("PWD")) != 0 + if (pwd && (IS_DIRECTORY_SEP (*pwd) || (*pwd && IS_DEVICE_SEP (pwd[1]))) && stat (pwd, &pwdstat) == 0 && stat (".", &dotstat) == 0 @@ -155,7 +154,6 @@ return NULL; strcpy (buf, pwd); } -#ifdef HAVE_GETCWD else { size_t buf_size = 1024; @@ -179,22 +177,6 @@ return NULL; } } -#else - else - { - /* We need MAXPATHLEN here. */ - buf = malloc (MAXPATHLEN + 1); - if (!buf) - return NULL; - if (getwd (buf) == NULL) - { - int tmp_errno = errno; - free (buf); - errno = tmp_errno; - return NULL; - } - } -#endif return buf; } #endif @@ -521,7 +503,7 @@ const char *sh = 0; #ifdef DOS_NT /* MW, Aug 1993 */ - getwd (oldwd); + getcwd (oldwd, sizeof oldwd); if (sh == 0) sh = (char *) egetenv ("SUSPEND"); /* KFS, 1994-12-14 */ #endif @@ -2238,60 +2220,6 @@ &emacs_norealloc_allocator, careadlinkatcwd); } -#ifdef USG -/* - * All of the following are for USG. - * - * On USG systems the system calls are INTERRUPTIBLE by signals - * that the user program has elected to catch. Thus the system call - * must be retried in these cases. To handle this without massive - * changes in the source code, we remap the standard system call names - * to names for our own functions in sysdep.c that do the system call - * with retries. Actually, for portability reasons, it is good - * programming practice, as this example shows, to limit all actual - * system calls to a single occurrence in the source. Sure, this - * adds an extra level of function call overhead but it is almost - * always negligible. Fred Fish, Unisoft Systems Inc. - */ - -/* - * Warning, this function may not duplicate 4.2 action properly - * under error conditions. - */ - -#if !defined (HAVE_GETWD) || defined (BROKEN_GETWD) - -#ifndef MAXPATHLEN -/* In 4.1, param.h fails to define this. */ -#define MAXPATHLEN 1024 -#endif - -char * -getwd (char *pathname) -{ - char *npath, *spath; - extern char *getcwd (char *, size_t); - - block_input (); /* getcwd uses malloc */ - spath = npath = getcwd ((char *) 0, MAXPATHLEN); - if (spath == 0) - { - unblock_input (); - return spath; - } - /* On Altos 3068, getcwd can return @hostname/dir, so discard - up to first slash. Should be harmless on other systems. */ - while (*npath && *npath != '/') - npath++; - strcpy (pathname, npath); - free (spath); /* getcwd uses malloc */ - unblock_input (); - return pathname; -} - -#endif /* !defined (HAVE_GETWD) || defined (BROKEN_GETWD) */ -#endif /* USG */ - /* Directory routines for systems that don't have them. */ #ifdef HAVE_DIRENT_H === modified file 'src/w32.c' --- src/w32.c 2012-11-21 04:47:55 +0000 +++ src/w32.c 2012-11-21 21:06:52 +0000 @@ -908,8 +908,18 @@ /* Get the current working directory. */ char * -getwd (char *dir) +getcwd (char *dir, size_t dirsize) { + if (!dirsize) + { + errno = EINVAL; + return NULL; + } + if (dirsize <= strlen (startup_dir)) + { + errno = ERANGE; + return NULL; + } #if 0 if (GetCurrentDirectory (MAXPATHLEN, dir) > 0) return dir; @@ -1825,7 +1835,7 @@ memcpy (*envp, "COMSPEC=", 8); } - /* Remember the initial working directory for getwd. */ + /* Remember the initial working directory for getcwd. */ /* FIXME: Do we need to resolve possible symlinks in startup_dir? Does it matter anywhere in Emacs? */ if (!GetCurrentDirectory (MAXPATHLEN, startup_dir)) === modified file 'src/w32.h' --- src/w32.h 2012-10-17 19:02:44 +0000 +++ src/w32.h 2012-11-21 21:06:52 +0000 @@ -163,7 +163,6 @@ extern void register_child (int, int); extern void sys_sleep (int); -extern char *getwd (char *); extern int sys_link (const char *, const char *); @@ -181,4 +180,3 @@ #endif /* HAVE_GNUTLS */ #endif /* EMACS_W32_H */ - ------------------------------------------------------------ revno: 110971 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-11-21 11:34:35 -0500 message: * src/xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind. Make it set selected_window as well. (update_tool_bar): Use it. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-21 04:47:55 +0000 +++ src/ChangeLog 2012-11-21 16:34:35 +0000 @@ -1,3 +1,9 @@ +2012-11-21 Stefan Monnier + + * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind. + Make it set selected_window as well. + (update_tool_bar): Use it. + 2012-11-21 Ken Brown * emacs.c (main): Set the G_SLICE environment variable for all === modified file 'src/xdisp.c' --- src/xdisp.c 2012-11-21 04:47:55 +0000 +++ src/xdisp.c 2012-11-21 16:34:35 +0000 @@ -11484,11 +11484,18 @@ int last_tool_bar_item; - +/* Select `frame' temporarily without running all the code in + do_switch_frame. + FIXME: Maybe do_switch_frame should be trimmed down similarly + when `norecord' is set. */ static Lisp_Object -update_tool_bar_unwind (Lisp_Object frame) +fast_set_selected_frame (Lisp_Object frame) { - selected_frame = frame; + if (!EQ (selected_frame, frame)) + { + selected_frame = frame; + selected_window = XFRAME (frame)->selected_window; + } return Qnil; } @@ -11560,9 +11567,13 @@ before calling tool_bar_items, because the calculation of the tool-bar keymap uses the selected frame (see `tool-bar-make-keymap' in tool-bar.el). */ - record_unwind_protect (update_tool_bar_unwind, selected_frame); + eassert (EQ (selected_window, + /* Since we only explicitly preserve selected_frame, + check that selected_window would be redundant. */ + XFRAME (selected_frame)->selected_window)); + record_unwind_protect (fast_set_selected_frame, selected_frame); XSETFRAME (frame, f); - selected_frame = frame; + fast_set_selected_frame (frame); /* Build desired tool-bar items from keymaps. */ new_tool_bar ------------------------------------------------------------ revno: 110970 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-11-21 06:17:40 -0500 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2012-11-20 11:17:33 +0000 +++ autogen/configure 2012-11-21 11:17:40 +0000 @@ -2058,8 +2058,9 @@ enable compile time checks for the Lisp_Object data type. This is useful for development for catching certain types of bugs. - --enable-profiling build emacs with profiling support. This might not - work on all platforms + --enable-profiling build emacs with low-level, gprof profiling support. + Mainly useful for debugging Emacs itself. May not + work on all platforms. Stops profiler.el working. --enable-autodepend automatically generate dependencies to .h-files. Requires GNU Make and Gcc. Enabled if GNU Make and Gcc is found ------------------------------------------------------------ revno: 110969 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-11-21 00:39:08 -0800 message: Add optional "inherit" argument for face-bold-p and related functions * lisp/faces.el (face-underline-p, face-inverse-video-p, face-bold-p) (face-italic-p): Add optional argument "inherit". * doc/lispref/display.texi (Attribute Functions): Add new "inherit" argument for face-bold-p etc. Move description of this argument to a common section, like "frame". diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-11-21 08:27:13 +0000 +++ doc/lispref/ChangeLog 2012-11-21 08:39:08 +0000 @@ -2,6 +2,8 @@ * display.texi (Attribute Functions): Update for set-face-* name changes. + Add new "inherit" argument for face-bold-p etc. + Move description of this argument to a common section, like "frame". * debugging.texi (Profiling): New section. (Debugging): Mention profiling in the introduction. === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2012-11-21 08:27:13 +0000 +++ doc/lispref/display.texi 2012-11-21 08:39:08 +0000 @@ -2453,59 +2453,48 @@ don't specify @var{frame}, they refer to the selected frame; @code{t} refers to the default data for new frames. They return the symbol @code{unspecified} if the face doesn't define any value for that -attribute. +attribute. If @var{inherit} is @code{nil}, only an attribute directly +defined by the face is returned. If @var{inherit} is non-@code{nil}, +any faces specified by its @code{:inherit} attribute are considered as +well, and if @var{inherit} is a face or a list of faces, then they are +also considered, until a specified attribute is found. To ensure that +the return value is always specified, use a value of @code{default} for +@var{inherit}. + +@defun face-font face &optional frame +This function returns the name of the font of face @var{face}. +@end defun @defun face-foreground face &optional frame inherit @defunx face-background face &optional frame inherit These functions return the foreground color (or background color, respectively) of face @var{face}, as a string. - -If @var{inherit} is @code{nil}, only a color directly defined by the face is -returned. If @var{inherit} is non-@code{nil}, any faces specified by its -@code{:inherit} attribute are considered as well, and if @var{inherit} -is a face or a list of faces, then they are also considered, until a -specified color is found. To ensure that the return value is always -specified, use a value of @code{default} for @var{inherit}. @end defun @defun face-stipple face &optional frame inherit This function returns the name of the background stipple pattern of face @var{face}, or @code{nil} if it doesn't have one. - -If @var{inherit} is @code{nil}, only a stipple directly defined by the -face is returned. If @var{inherit} is non-@code{nil}, any faces -specified by its @code{:inherit} attribute are considered as well, and -if @var{inherit} is a face or a list of faces, then they are also -considered, until a specified stipple is found. To ensure that the -return value is always specified, use a value of @code{default} for -@var{inherit}. -@end defun - -@defun face-font face &optional frame -This function returns the name of the font of face @var{face}. -@end defun - -@defun face-bold-p face &optional frame +@end defun + +@defun face-bold-p face &optional frame inherit This function returns a non-@code{nil} value if the @code{:weight} attribute of @var{face} is bolder than normal (i.e., one of @code{semi-bold}, @code{bold}, @code{extra-bold}, or @code{ultra-bold}). Otherwise, it returns @code{nil}. @end defun -@defun face-italic-p face &optional frame +@defun face-italic-p face &optional frame inherit This function returns a non-@code{nil} value if the @code{:slant} attribute of @var{face} is @code{italic} or @code{oblique}, and @code{nil} otherwise. @end defun -@c Note the weasel words. A face that inherits from an underlined -@c face but does not specify :underline will return nil. -@defun face-underline-p face &optional frame +@defun face-underline-p face &optional frame inherit This function returns non-@code{nil} if face @var{face} specifies a non-@code{nil} @code{:underline} attribute. @end defun -@defun face-inverse-video-p face &optional frame +@defun face-inverse-video-p face &optional frame inherit This function returns non-@code{nil} if face @var{face} specifies a non-@code{nil} @code{:inverse-video} attribute. @end defun === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-21 08:27:13 +0000 +++ lisp/ChangeLog 2012-11-21 08:39:08 +0000 @@ -1,5 +1,8 @@ 2012-11-21 Glenn Morris + * faces.el (face-underline-p, face-inverse-video-p, face-bold-p) + (face-italic-p): Add optional argument "inherit". + * faces.el (set-face-inverse-video, set-face-bold, set-face-italic): Remove -p suffix from names, for consistency with other set-face-*. (set-face-inverse-video): Fix interactive spec. === modified file 'lisp/faces.el' --- lisp/faces.el 2012-11-21 08:27:13 +0000 +++ lisp/faces.el 2012-11-21 08:39:08 +0000 @@ -487,44 +487,44 @@ (defalias 'face-background-pixmap 'face-stipple) -;; FIXME all of these -p functions ignore inheritance (cf face-stipple). -;; Ie, a face that inherits from an underlined face but does not -;; specify :underline will return nil. -;; So these functions don't actually tell you anything about how the -;; face will _appear_. So not very useful IMO. -(defun face-underline-p (face &optional frame) +(defun face-underline-p (face &optional frame inherit) "Return non-nil if FACE specifies a non-nil underlining. If the optional argument FRAME is given, report on face FACE in that frame. If FRAME is t, report on the defaults for face FACE (for new frames). -If FRAME is omitted or nil, use the selected frame." - (face-attribute-specified-or (face-attribute face :underline frame) nil)) - - -(defun face-inverse-video-p (face &optional frame) +If FRAME is omitted or nil, use the selected frame. +Optional argument INHERIT is passed to `face-attribute'." + (face-attribute-specified-or + (face-attribute face :underline frame inherit) nil)) + + +(defun face-inverse-video-p (face &optional frame inherit) "Return non-nil if FACE specifies a non-nil inverse-video. If the optional argument FRAME is given, report on face FACE in that frame. If FRAME is t, report on the defaults for face FACE (for new frames). -If FRAME is omitted or nil, use the selected frame." - (eq (face-attribute face :inverse-video frame) t)) - - -(defun face-bold-p (face &optional frame) +If FRAME is omitted or nil, use the selected frame. +Optional argument INHERIT is passed to `face-attribute'." + (eq (face-attribute face :inverse-video frame inherit) t)) + + +(defun face-bold-p (face &optional frame inherit) "Return non-nil if the font of FACE is bold on FRAME. If the optional argument FRAME is given, report on face FACE in that frame. If FRAME is t, report on the defaults for face FACE (for new frames). If FRAME is omitted or nil, use the selected frame. +Optional argument INHERIT is passed to `face-attribute'. Use `face-attribute' for finer control." - (let ((bold (face-attribute face :weight frame))) + (let ((bold (face-attribute face :weight frame inherit))) (memq bold '(semi-bold bold extra-bold ultra-bold)))) -(defun face-italic-p (face &optional frame) +(defun face-italic-p (face &optional frame inherit) "Return non-nil if the font of FACE is italic on FRAME. If the optional argument FRAME is given, report on face FACE in that frame. If FRAME is t, report on the defaults for face FACE (for new frames). If FRAME is omitted or nil, use the selected frame. +Optional argument INHERIT is passed to `face-attribute'. Use `face-attribute' for finer control." - (let ((italic (face-attribute face :slant frame))) + (let ((italic (face-attribute face :slant frame inherit))) (memq italic '(italic oblique)))) ------------------------------------------------------------ revno: 110968 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-11-21 00:27:13 -0800 message: Remove -p suffix from set-face-* functions * lisp/faces.el (set-face-inverse-video, set-face-bold, set-face-italic): Remove -p suffix from names, for consistency with other set-face-*. (set-face-inverse-video): Fix interactive spec. * lisp/play/gamegrid.el (gamegrid-make-mono-tty-face): * lisp/textmodes/table.el (table--update-cell-face): Use set-face-inverse-video rather than now obsolete alias. * doc/lispref/display.texi (Attribute Functions): Update for set-face-* name changes. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-11-21 04:47:55 +0000 +++ doc/lispref/ChangeLog 2012-11-21 08:27:13 +0000 @@ -1,5 +1,8 @@ 2012-11-21 Glenn Morris + * display.texi (Attribute Functions): + Update for set-face-* name changes. + * debugging.texi (Profiling): New section. (Debugging): Mention profiling in the introduction. * tips.texi (Compilation Tips): Move profiling to separate section. === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2012-11-17 02:29:58 +0000 +++ doc/lispref/display.texi 2012-11-21 08:27:13 +0000 @@ -2425,12 +2425,12 @@ This sets the @code{:font} attribute of @var{face} to @var{font}. @end deffn -@defun set-face-bold-p face bold-p &optional frame +@defun set-face-bold face bold-p &optional frame This sets the @code{:weight} attribute of @var{face} to @var{normal} if @var{bold-p} is @code{nil}, and to @var{bold} otherwise. @end defun -@defun set-face-italic-p face italic-p &optional frame +@defun set-face-italic face italic-p &optional frame This sets the @code{:slant} attribute of @var{face} to @var{normal} if @var{italic-p} is @code{nil}, and to @var{italic} otherwise. @end defun @@ -2440,7 +2440,7 @@ @var{underline}. @end defun -@defun set-face-inverse-video-p face inverse-video-p &optional frame +@defun set-face-inverse-video face inverse-video-p &optional frame This sets the @code{:inverse-video} attribute of @var{face} to @var{inverse-video-p}. @end defun === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-21 04:47:55 +0000 +++ lisp/ChangeLog 2012-11-21 08:27:13 +0000 @@ -1,3 +1,12 @@ +2012-11-21 Glenn Morris + + * faces.el (set-face-inverse-video, set-face-bold, set-face-italic): + Remove -p suffix from names, for consistency with other set-face-*. + (set-face-inverse-video): Fix interactive spec. + * play/gamegrid.el (gamegrid-make-mono-tty-face): + * textmodes/table.el (table--update-cell-face): + Use set-face-inverse-video rather than now obsolete alias. + 2012-11-21 Eli Zaretskii * simple.el (line-move): Don't call line-move-partial if === modified file 'lisp/faces.el' --- lisp/faces.el 2012-11-16 02:44:02 +0000 +++ lisp/faces.el 2012-11-21 08:27:13 +0000 @@ -862,7 +862,7 @@ 'set-face-underline "24.3") -(defun set-face-inverse-video-p (face inverse-video-p &optional frame) +(defun set-face-inverse-video (face inverse-video-p &optional frame) "Specify whether face FACE is in inverse video. INVERSE-VIDEO-P non-nil means FACE displays explicitly in inverse video. INVERSE-VIDEO-P nil means FACE explicitly is not in inverse video. @@ -870,14 +870,13 @@ Use `set-face-attribute' to ``unspecify'' the inverse video attribute." (interactive (let ((list (read-face-and-attribute :inverse-video))) - (list (car list) (eq (car (cdr list)) t)))) + (list (car list) (if (cadr list) t)))) (set-face-attribute face frame :inverse-video inverse-video-p)) +(define-obsolete-function-alias 'set-face-inverse-video-p + 'set-face-inverse-video "24.4") -;; The -p suffix is a hostage to fortune. What if we want to extend -;; this to allow more than boolean options? Exactly this happened -;; to set-face-underline-p. -(defun set-face-bold-p (face bold-p &optional frame) +(defun set-face-bold (face bold-p &optional frame) "Specify whether face FACE is bold. BOLD-P non-nil means FACE should explicitly display bold. BOLD-P nil means FACE should explicitly display non-bold. @@ -887,8 +886,10 @@ (make-face-unbold face frame) (make-face-bold face frame))) - -(defun set-face-italic-p (face italic-p &optional frame) +(define-obsolete-function-alias 'set-face-bold-p 'set-face-bold "24.4") + + +(defun set-face-italic (face italic-p &optional frame) "Specify whether face FACE is italic. ITALIC-P non-nil means FACE should explicitly display italic. ITALIC-P nil means FACE should explicitly display non-italic. @@ -898,6 +899,8 @@ (make-face-unitalic face frame) (make-face-italic face frame))) +(define-obsolete-function-alias 'set-face-italic-p 'set-face-italic "24.4") + (defalias 'set-face-background-pixmap 'set-face-stipple) === modified file 'lisp/play/gamegrid.el' --- lisp/play/gamegrid.el 2012-11-17 07:00:35 +0000 +++ lisp/play/gamegrid.el 2012-11-21 08:27:13 +0000 @@ -175,7 +175,7 @@ (defun gamegrid-make-mono-tty-face () (let ((face (make-face 'gamegrid-mono-tty-face))) - (set-face-inverse-video-p face t) + (set-face-inverse-video face t) face)) (defun gamegrid-make-color-tty-face (color) === modified file 'lisp/textmodes/table.el' --- lisp/textmodes/table.el 2012-10-02 03:46:08 +0000 +++ lisp/textmodes/table.el 2012-11-21 08:27:13 +0000 @@ -5210,7 +5210,7 @@ "Update cell face according to the current mode." (if (featurep 'xemacs) (set-face-property 'table-cell 'underline table-fixed-width-mode) - (set-face-inverse-video-p 'table-cell table-fixed-width-mode))) + (set-face-inverse-video 'table-cell table-fixed-width-mode))) (table--update-cell-face) ------------------------------------------------------------ revno: 110967 [merge] committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-11-20 20:47:55 -0800 message: Merge from emacs-24; up to r110931 diff: === modified file 'ChangeLog' --- ChangeLog 2012-11-20 08:29:04 +0000 +++ ChangeLog 2012-11-21 04:47:55 +0000 @@ -1,3 +1,7 @@ +2012-11-21 Glenn Morris + + * configure.ac (--enable-profiling): Doc fix. + 2012-11-20 Paul Eggert Improve static checking of integer overflow and stack smashing. === modified file 'configure.ac' --- configure.ac 2012-11-20 08:29:04 +0000 +++ configure.ac 2012-11-21 04:47:55 +0000 @@ -329,10 +329,15 @@ fi) +dnl The name of this option is unfortunate. It predates, and has no +dnl relation to, the "sampling-based elisp profiler" added in 24.3. +dnl Actually, it stops it working. +dnl http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00393.html AC_ARG_ENABLE(profiling, [AS_HELP_STRING([--enable-profiling], - [build emacs with profiling support. - This might not work on all platforms])], + [build emacs with low-level, gprof profiling support. + Mainly useful for debugging Emacs itself. May not work on + all platforms. Stops profiler.el working.])], [ac_enable_profiling="${enableval}"],[]) if test x$ac_enable_profiling != x ; then PROFILING_CFLAGS="-DPROFILING=1 -pg" === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2012-11-18 01:52:36 +0000 +++ doc/emacs/ChangeLog 2012-11-21 04:47:55 +0000 @@ -1,3 +1,9 @@ +2012-11-21 Dani Moncayo + + * display.texi (Auto Scrolling): Fix some inaccuracies, plus + clarifications (Bug#12865). + (Horizontal Scrolling): Clarifications. + 2012-11-18 Dani Moncayo * mark.texi (Disabled Transient Mark): Doc fixes (Bug#12746). === modified file 'doc/emacs/display.texi' --- doc/emacs/display.texi 2012-11-07 20:43:38 +0000 +++ doc/emacs/display.texi 2012-11-18 06:27:43 +0000 @@ -213,59 +213,62 @@ @node Auto Scrolling @section Automatic Scrolling +@cindex automatic scrolling Emacs performs @dfn{automatic scrolling} when point moves out of the -visible portion of the text. +visible portion of the text. Normally, automatic scrolling centers +point vertically in the window, but there are several ways to alter +this behavior. @vindex scroll-conservatively - Normally, this centers point vertically within the window. However, -if you set @code{scroll-conservatively} to a small number @var{n}, -then if you move point just a little off the screen (less than @var{n} -lines), Emacs scrolls the text just far enough to bring point back on -screen. If doing so fails to make point visible, Emacs centers point -in the window. By default, @code{scroll-conservatively} is@tie{}0. -If you set @code{scroll-conservatively} to a large number (larger than -100), Emacs will never center point as result of scrolling, even if -point moves far away from the text previously displayed in the window. -With such a large value, Emacs will always scroll text just enough for -bringing point into view, so point will end up at the top or bottom of -the window, depending on the scroll direction. + If you set @code{scroll-conservatively} to a small number @var{n}, +then moving point just a little off the screen (no more than @var{n} +lines) causes Emacs to scroll just enough to bring point back on +screen; if doing so fails to make point visible, Emacs scrolls just +far enough to center point in the window. If you set +@code{scroll-conservatively} to a large number (larger than 100), +automatic scrolling never centers point, no matter how far point +moves; Emacs always scrolls text just enough to bring point into view, +either at the top or bottom of the window depending on the scroll +direction. By default, @code{scroll-conservatively} is@tie{}0, which +means to always center point in the window. @vindex scroll-step - An alternative way of controlling how Emacs scrolls text is by -customizing the variable @code{scroll-step}. Its value determines how -many lines to scroll the window when point moves off the screen. If -moving by that number of lines fails to bring point back into view, -point is centered instead. The default value is zero, which causes -point to always be centered after scrolling. - - Since both @code{scroll-conservatively} and @code{scroll-step} -control automatic scrolling in contradicting ways, you should set only -one of them. If you customize both, the value of -@code{scroll-conservatively} takes precedence. + Another way to control automatic scrolling is to customize the +variable @code{scroll-step}. Its value determines the number of lines +by which to automatically scroll, when point moves off the screen. If +scrolling by that number of lines fails to bring point back into view, +point is centered instead. The default value is zero, which (by +default) causes point to always be centered after scrolling. @cindex aggressive scrolling @vindex scroll-up-aggressively @vindex scroll-down-aggressively - When the window does scroll by a distance longer than -@code{scroll-step}, you can control how aggressively it scrolls by -setting the variables @code{scroll-up-aggressively} and -@code{scroll-down-aggressively}. The value of -@code{scroll-up-aggressively} should be either @code{nil}, or a -fraction @var{f} between 0 and 1. A fraction specifies where on the -screen to put point when scrolling upward, i.e.@: forward. When point -goes off the window end, the new start position is chosen to put point -@var{f} parts of the window height from the bottom margin. Thus, -larger @var{f} means more aggressive scrolling: more new text is -brought into view. The default value, @code{nil}, is equivalent to -0.5. - - Likewise, @code{scroll-down-aggressively} is used for scrolling -down, i.e.@: backward. The value specifies how far point should be -placed from the top margin of the window; thus, as with -@code{scroll-up-aggressively}, a larger value is more aggressive. - - These two variables are ignored if either @code{scroll-step} or -@code{scroll-conservatively} are set to a non-zero value. + A third way to control automatic scrolling is to customize the +variables @code{scroll-up-aggressively} and +@code{scroll-down-aggressively}, which directly specify the vertical +position of point after scrolling. The value of +@code{scroll-up-aggressively} should be either @code{nil} (the +default), or a floating point number @var{f} between 0 and 1. The +latter means that when point goes below the bottom window edge (i.e.@: +scrolling forward), Emacs scrolls the window so that point is @var{f} +parts of the window height from the bottom window edge. Thus, larger +@var{f} means more aggressive scrolling: more new text is brought into +view. The default value, @code{nil}, is equivalent to 0.5. + + Likewise, @code{scroll-down-aggressively} is used when point goes +above the bottom window edge (i.e.@: scrolling backward). The value +specifies how far point should be from the top margin of the window +after scrolling. Thus, as with @code{scroll-up-aggressively}, a +larger value is more aggressive. + + Note that the variables @code{scroll-conservatively}, +@code{scroll-step}, and @code{scroll-up-aggressively} / +@code{scroll-down-aggressively} control automatic scrolling in +contradictory ways. Therefore, you should pick no more than one of +these methods to customize automatic scrolling. In case you customize +multiple variables, the order of priority is: +@code{scroll-conservatively}, then @code{scroll-step}, and finally +@code{scroll-up-aggressively} / @code{scroll-down-aggressively}. @vindex scroll-margin The variable @code{scroll-margin} restricts how close point can come @@ -295,10 +298,10 @@ @vindex hscroll-margin The variable @code{hscroll-margin} controls how close point can get -to the window's edges before automatic scrolling occurs. It is -measured in columns. For example, if the value is 5, then moving -point within 5 columns of an edge causes horizontal scrolling away -from that edge. +to the window's left and right edges before automatic scrolling +occurs. It is measured in columns. For example, if the value is 5, +then moving point within 5 columns of an edge causes horizontal +scrolling away from that edge. @vindex hscroll-step The variable @code{hscroll-step} determines how many columns to === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-11-18 01:52:36 +0000 +++ doc/lispref/ChangeLog 2012-11-21 04:47:55 +0000 @@ -1,3 +1,20 @@ +2012-11-21 Glenn Morris + + * debugging.texi (Profiling): New section. + (Debugging): Mention profiling in the introduction. + * tips.texi (Compilation Tips): Move profiling to separate section. + * elisp.texi: Add Profiling to detailed menu. + +2012-11-21 Martin Rudalics + + * windows.texi (Display Action Functions): Fix recently added + example. Suggested by Michael Heerdegen. + +2012-11-21 Paul Eggert + + Minor cleanup for times as lists of four integers. + * os.texi (Time Parsing): Time values can now be four integers. + 2012-11-18 Glenn Morris * loading.texi (How Programs Do Loading): Add eager macro expansion. === modified file 'doc/lispref/debugging.texi' --- doc/lispref/debugging.texi 2012-11-11 01:16:25 +0000 +++ doc/lispref/debugging.texi 2012-11-21 01:52:03 +0000 @@ -32,6 +32,9 @@ @item You can use the ERT package to write regression tests for the program. @xref{Top,the ERT manual,, ERT, ERT: Emacs Lisp Regression Testing}. + +@item +You can profile the program to get hints about how to make it more efficient. @end itemize Other useful tools for debugging input and output problems are the @@ -43,6 +46,7 @@ * Edebug:: A source-level Emacs Lisp debugger. * Syntax Errors:: How to find syntax errors. * Test Coverage:: Ensuring you have tested all branches in your code. +* Profiling:: Measuring the resources that your code uses. @end menu @node Debugger @@ -809,3 +813,63 @@ Edebug also has a coverage testing feature (@pxref{Coverage Testing}). These features partly duplicate each other, and it would be cleaner to combine them. + + +@node Profiling +@section Profiling +@cindex profiling +@cindex measuring resource usage +@cindex memory usage + +If your program is working correctly, but you want to make it run more +quickly or efficiently, the first thing to do is @dfn{profile} your +code so that you know how it is using resources. If you find that one +particular function is responsible for a significant portion of the +runtime, you can start looking for ways to optimize that piece. + +Emacs has built-in support for this. To begin profiling, type +@kbd{M-x profiler-start}. You can choose to profile by processor +usage, memory usage, or both. After doing some work, type +@kbd{M-x profiler-report} to display a summary buffer for each +resource that you chose to profile. The names of the report buffers +include the times at which the reports were generated, so you can +generate another report later on without erasing previous results. +When you have finished profiling, type @kbd{M-x profiler-stop} (there +is a small overhead associated with profiling). + +The profiler report buffer shows, on each line, a function that was +called, followed by how much resource (processor or memory) it used in +absolute and percentage times since profiling started. If a given +line has a @samp{+} symbol at the left-hand side, you can expand that +line by typing @key{RET}, in order to see the function(s) called by +the higher-level function. Pressing @key{RET} again will collapse +back to the original state. + +Press @kbd{j} or @kbd{mouse-2} to jump to the definition of a function. +Press @kbd{d} to view a function's documentation. +You can save a profile to a file using @kbd{C-x C-w}. +You can compare two profiles using @kbd{=}. + +@c FIXME reversed calltree? + +@cindex @file{elp.el} +@cindex timing programs +The @file{elp} library offers an alternative approach. See the file +@file{elp.el} for instructions. + +@cindex @file{benchmark.el} +@cindex benchmarking +You can check the speed of individual Emacs Lisp forms using the +@file{benchmark} library. See the functions @code{benchmark-run} and +@code{benchmark-run-compiled} in @file{benchmark.el}. + +@c Not worth putting in the printed manual. +@ifnottex +@cindex --enable-profiling option of configure +For low-level profiling of Emacs itself, you can build it using the +@option{--enable-profiling} option of @command{configure}. When Emacs +exits, it generates a file @file{gmon.out} that you can examine using +the @command{gprof} utility. This feature is mainly useful for +debugging Emacs. It actually stops the Lisp-level @kbd{M-x +profiler-@dots{}} commands described above from working. +@end ifnottex === modified file 'doc/lispref/elisp.texi' --- doc/lispref/elisp.texi 2012-11-07 09:41:52 +0000 +++ doc/lispref/elisp.texi 2012-11-20 08:02:54 +0000 @@ -617,6 +617,7 @@ * Edebug:: A source-level Emacs Lisp debugger. * Syntax Errors:: How to find syntax errors. * Test Coverage:: Ensuring you have tested all branches in your code. +* Profiling:: Measuring the resources that your code uses. The Lisp Debugger === modified file 'doc/lispref/os.texi' --- doc/lispref/os.texi 2012-11-08 07:50:43 +0000 +++ doc/lispref/os.texi 2012-11-21 04:47:55 +0000 @@ -1373,8 +1373,8 @@ @node Time Parsing @section Parsing and Formatting Times - These functions convert time values (lists of two or three integers) -to text in a string, and vice versa. + These functions convert time values to text in a string, and vice versa. +Time values are lists of two to four integers (@pxref{Time of Day}). @defun date-to-time string This function parses the time-string @var{string} and returns the === modified file 'doc/lispref/tips.texi' --- doc/lispref/tips.texi 2012-10-22 02:18:58 +0000 +++ doc/lispref/tips.texi 2012-11-20 08:02:54 +0000 @@ -460,18 +460,8 @@ @itemize @bullet @item -@cindex profiling -@cindex timing programs -@cindex @file{elp.el} -Profile your program with the @file{elp} library. See the file -@file{elp.el} for instructions. - -@item -@cindex @file{benchmark.el} -@cindex benchmarking -Check the speed of individual Emacs Lisp forms using the -@file{benchmark} library. See the functions @code{benchmark-run} and -@code{benchmark-run-compiled} in @file{benchmark.el}. +Profile your program, to find out where the time is being spent. +@xref{Profiling}. @item Use iteration rather than recursion whenever possible. === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2012-11-18 01:52:36 +0000 +++ doc/lispref/windows.texi 2012-11-21 04:47:55 +0000 @@ -2038,7 +2038,8 @@ follows: If `*foo*' already appears on a visible or iconified frame, it will reuse its window. Otherwise, it will try to pop up a new window or, if that is impossible, a new frame. If all these steps fail, it -will try to use some existing window. +will proceed using whatever @code{display-buffer-base-action} and +@code{display-buffer-fallback-action} prescribe. Furthermore, @code{display-buffer} will try to adjust a reused window (provided `*foo*' was put by @code{display-buffer} there before) or a === modified file 'etc/NEWS' --- etc/NEWS 2012-11-20 20:06:17 +0000 +++ etc/NEWS 2012-11-21 04:47:55 +0000 @@ -847,7 +847,7 @@ ** New sampling-based Elisp profiler. Try M-x profiler-start, do some work, and then call M-x profiler-report. When finished, use M-x profiler-stop. The sampling rate can be based on -CPU time (only supported on some systems) or memory allocations. +CPU time or memory allocations. +++ ** CL-style generalized variables are now in core Elisp. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-20 19:32:20 +0000 +++ lisp/ChangeLog 2012-11-21 04:47:55 +0000 @@ -1,3 +1,46 @@ +2012-11-21 Eli Zaretskii + + * simple.el (line-move): Don't call line-move-partial if + scroll-conservatively is in effect. (Bug#12927) + +2012-11-21 Stefan Monnier + + * eshell/em-cmpl.el (eshell-pcomplete): Refine fix for bug#12838: + Fallback on completion-at-point rather than + pcomplete-expand-and-complete, and only if pcomplete actually failed. + (eshell-cmpl-initialize): Setup completion-at-point. + + * pcomplete.el (pcomplete--entries): Obey pcomplete-ignore-case. + + * emacs-lisp/ert.el (ert--expand-should-1): Adapt to cl-lib. + +2012-11-21 Michael Albinus + + * net/tramp-sh.el (tramp-do-copy-or-rename-file): If both files + are remote, check out-of-band property for both. + +2012-11-21 Stefan Monnier + + * window.el (switch-to-buffer): Re-add the warning that was lost in the + code rewrite. + +2012-11-21 Paul Eggert + + More minor time fixes. + * calendar/time-date.el: Commentary fix. + * net/tramp-sh.el (tramp-do-file-attributes-with-ls): Undo last change; + too much other code depends on (0 0) time stamps. + * net/tramp.el (tramp-time-less-p, tramp-time-subtract): + Add a couple of FIXME comments. + + Minor cleanup for times as lists of four integers. + * files.el (dir-locals-directory-cache): + * ps-bdf.el (bdf-file-mod-time, bdf-read-font-info): + Doc fixes. + * net/tramp-sh.el (tramp-do-file-attributes-with-ls): + * ps-bdf.el (bdf-file-newer-than-time): + Process four-integers time stamps, not two. Doc fixes. + 2012-11-20 Stefan Monnier * uniquify.el (uniquify-managed): Use defvar-local. === modified file 'lisp/calendar/time-date.el' --- lisp/calendar/time-date.el 2012-11-19 16:17:49 +0000 +++ lisp/calendar/time-date.el 2012-11-21 04:47:55 +0000 @@ -30,11 +30,10 @@ ;; value equal to HIGH * 2^16 + LOW + USEC * 10^-6 + PSEC * 10^-12 ;; seconds, where missing components are treated as zero. HIGH can be ;; negative, either because the value is a time difference, or because -;; the machine supports negative time stamps that fall before the -;; epoch. The macro `with-decoded-time-value' and the -;; function `encode-time-value' make it easier to deal with these -;; three formats. See `time-subtract' for an example of how to use -;; them. +;; the machine supports negative time stamps that fall before the epoch. +;; The macro `with-decoded-time-value' and the function +;; `encode-time-value' make it easier to deal with these formats. +;; See `time-subtract' for an example of how to use them. ;;; Code: === modified file 'lisp/emacs-lisp/ert.el' --- lisp/emacs-lisp/ert.el 2012-09-24 15:58:20 +0000 +++ lisp/emacs-lisp/ert.el 2012-11-19 17:02:20 +0000 @@ -388,16 +388,11 @@ (defun ert--expand-should-1 (whole form inner-expander) "Helper function for the `should' macro and its variants." (let ((form - ;; If `cl-macroexpand' isn't bound, the code that we're - ;; compiling doesn't depend on cl and thus doesn't need an - ;; environment arg for `macroexpand'. - (if (fboundp 'cl-macroexpand) - ;; Suppress warning about run-time call to cl function: we - ;; only call it if it's fboundp. - (with-no-warnings - (cl-macroexpand form (and (boundp 'cl-macro-environment) - cl-macro-environment))) - (macroexpand form)))) + (macroexpand form (cond + ((boundp 'macroexpand-all-environment) + macroexpand-all-environment) + ((boundp 'cl-macro-environment) + cl-macro-environment))))) (cond ((or (atom form) (ert--special-operator-p (car form))) (let ((value (ert--gensym "value-"))) === modified file 'lisp/eshell/em-cmpl.el' --- lisp/eshell/em-cmpl.el 2012-11-15 07:59:46 +0000 +++ lisp/eshell/em-cmpl.el 2012-11-19 19:22:07 +0000 @@ -297,6 +297,8 @@ (define-key eshell-command-map [? ] 'pcomplete-expand) (define-key eshell-mode-map [tab] 'eshell-pcomplete) (define-key eshell-mode-map [(control ?i)] 'eshell-pcomplete) + (add-hook 'completion-at-point-functions + #'pcomplete-completions-at-point nil t) ;; jww (1999-10-19): Will this work on anything but X? (if (featurep 'xemacs) (define-key eshell-mode-map [iso-left-tab] 'pcomplete-reverse) @@ -452,9 +454,9 @@ (defun eshell-pcomplete () "Eshell wrapper for `pcomplete'." (interactive) - (if eshell-cmpl-ignore-case - (pcomplete-expand-and-complete) ; hack workaround for bug#12838 - (pcomplete))) + (condition-case nil + (pcomplete) + (text-read-only (completion-at-point)))) ; Workaround for bug#12838. (provide 'em-cmpl) === modified file 'lisp/files.el' --- lisp/files.el 2012-11-19 18:27:25 +0000 +++ lisp/files.el 2012-11-21 04:47:55 +0000 @@ -3433,7 +3433,7 @@ CLASS is the name of a variable class (a symbol). MTIME is the recorded modification time of the directory-local variables file associated with this entry. This time is a list -of two integers (the same format as `file-attributes'), and is +of integers (the same format as `file-attributes'), and is used to test whether the cache entry is still valid. Alternatively, MTIME can be nil, which means the entry is always considered valid.") === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2012-10-09 12:49:02 +0000 +++ lisp/net/tramp-sh.el 2012-11-19 15:25:10 +0000 @@ -1270,9 +1270,10 @@ res-uid ;; 3. File gid. res-gid - ;; 4. Last access time, as a list of two integers. First - ;; integer has high-order 16 bits of time, second has low 16 - ;; bits. + ;; 4. Last access time, as a list of integers. Normally this + ;; would be in the same format as `current-time', but the + ;; subseconds part is not currently implemented, and (0 0) + ;; denotes an unknown time. ;; 5. Last modification time, likewise. ;; 6. Last status change time, likewise. '(0 0) '(0 0) '(0 0) ;CCC how to find out? @@ -1980,6 +1981,7 @@ (error "Unknown operation `%s', must be `copy' or `rename'" op)) (let ((t1 (tramp-tramp-file-p filename)) (t2 (tramp-tramp-file-p newname)) + (length (nth 7 (file-attributes (file-truename filename)))) (context (and preserve-selinux-context (apply 'file-selinux-context (list filename)))) pr tm) @@ -2009,8 +2011,9 @@ ok-if-already-exists keep-date preserve-uid-gid)) ;; Try out-of-band operation. - ((tramp-method-out-of-band-p - v1 (nth 7 (file-attributes (file-truename filename)))) + ((and + (tramp-method-out-of-band-p v1 length) + (tramp-method-out-of-band-p v2 length)) (tramp-do-copy-or-rename-file-out-of-band op filename newname keep-date)) @@ -2038,8 +2041,7 @@ ;; If the Tramp file has an out-of-band method, the ;; corresponding copy-program can be invoked. - ((tramp-method-out-of-band-p - v (nth 7 (file-attributes (file-truename filename)))) + ((tramp-method-out-of-band-p v length) (tramp-do-copy-or-rename-file-out-of-band op filename newname keep-date)) === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2012-11-08 15:10:08 +0000 +++ lisp/net/tramp.el 2012-11-21 04:47:55 +0000 @@ -3767,6 +3767,7 @@ ("oct" . 10) ("nov" . 11) ("dec" . 12)) "Alist mapping month names to integers.") +;; FIXME: Shouldn't this also look at any subseconds parts of T1 and T2? ;;;###tramp-autoload (defun tramp-time-less-p (t1 t2) "Say whether time value T1 is less than time value T2." @@ -3776,6 +3777,7 @@ (and (= (car t1) (car t2)) (< (nth 1 t1) (nth 1 t2))))) +;; FIXME: Shouldn't this also look at any subseconds parts of T1 and T2? (defun tramp-time-subtract (t1 t2) "Subtract two time values. Return the difference in the format of a time value." === modified file 'lisp/pcomplete.el' --- lisp/pcomplete.el 2012-09-28 16:02:31 +0000 +++ lisp/pcomplete.el 2012-11-19 19:22:07 +0000 @@ -833,7 +833,8 @@ . ,(lambda (comps) (sort comps pcomplete-compare-entry-function))) ,@(cdr (completion-file-name-table s p a))) - (let ((completion-ignored-extensions nil)) + (let ((completion-ignored-extensions nil) + (completion-ignore-case pcomplete-ignore-case)) (completion-table-with-predicate #'comint-completion-file-name-table pred 'strict s p a)))))) === modified file 'lisp/ps-bdf.el' --- lisp/ps-bdf.el 2012-01-19 07:21:25 +0000 +++ lisp/ps-bdf.el 2012-11-18 02:13:19 +0000 @@ -70,20 +70,15 @@ (defsubst bdf-file-mod-time (filename) "Return modification time of FILENAME. -The value is a list of two integers, the first integer has high-order -16 bits, the second has low 16 bits." +The value is a list of integers in the same format as `current-time'." (nth 5 (file-attributes filename))) (defun bdf-file-newer-than-time (filename mod-time) "Return non-nil if and only if FILENAME is newer than MOD-TIME. -MOD-TIME is a modification time as a list of two integers, the first -integer has high-order 16 bits, the second has low 16 bits." - (let* ((new-mod-time (bdf-file-mod-time filename)) - (new-time (car new-mod-time)) - (time (car mod-time))) - (or (> new-time time) - (and (= new-time time) - (> (nth 1 new-mod-time) (nth 1 mod-time)))))) +MOD-TIME is a modification time as a list of integers in the same +format as `current-time'." + (let ((new-mod-time (bdf-file-mod-time filename))) + (time-less-p mod-time new-mod-time))) (defun bdf-find-file (bdfname) "Return a buffer visiting a bdf file BDFNAME. @@ -178,8 +173,8 @@ (BDFFILE MOD-TIME FONT-BOUNDING-BOX RELATIVE-COMPOSE BASELINE-OFFSET CODE-RANGE MAXLEN OFFSET-VECTOR) -MOD-TIME is last modification time as a list of two integers, the -first integer has high-order 16 bits, the second has low 16 bits. +MOD-TIME is last modification time as a list of integers in the +same format as `current-time'. SIZE is a size of the font on 72 dpi device. This value is got from SIZE record of the font. === modified file 'lisp/simple.el' --- lisp/simple.el 2012-10-07 22:31:58 +0000 +++ lisp/simple.el 2012-11-20 17:44:04 +0000 @@ -4583,6 +4583,9 @@ (unless (and auto-window-vscroll try-vscroll ;; Only vscroll for single line moves (= (abs arg) 1) + ;; Under scroll-conservatively, the display engine + ;; does this better. + (zerop scroll-conservatively) ;; But don't vscroll in a keyboard macro. (not defining-kbd-macro) (not executing-kbd-macro) === modified file 'lisp/window.el' --- lisp/window.el 2012-11-17 02:03:58 +0000 +++ lisp/window.el 2012-11-19 03:16:03 +0000 @@ -5870,7 +5870,12 @@ :version "24.3") (defun switch-to-buffer (buffer-or-name &optional norecord force-same-window) - "Switch to buffer BUFFER-OR-NAME in the selected window. + "Display buffer BUFFER-OR-NAME in the selected window. + +WARNING: This is NOT the way to work on another buffer temporarily +within a Lisp program! Use `set-buffer' instead. That avoids +messing with the window-buffer correspondences. + If the selected window cannot display the specified buffer (e.g. if it is a minibuffer window or strongly dedicated to another buffer), call `pop-to-buffer' to select the buffer in === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-11-18 16:54:31 +0000 +++ nt/ChangeLog 2012-11-21 04:47:55 +0000 @@ -1,3 +1,11 @@ +2012-11-21 Eli Zaretskii + + * nmake.defs: Use !if, not !ifdef. For the details, see + http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00027.html + + * inc/stdint.h (INTPTR_MIN): + (PTRDIFF_MIN) [!__GNUC__]: Define for MSVC. + 2012-11-18 Eli Zaretskii * inc/unistd.h: Don't include fcntl.h and don't define O_RDWR. === modified file 'nt/inc/stdint.h' --- nt/inc/stdint.h 2012-01-05 09:46:05 +0000 +++ nt/inc/stdint.h 2012-11-20 17:07:55 +0000 @@ -37,6 +37,7 @@ #define INT64_MAX 9223372036854775807i64 #define INT64_MIN (~INT64_MAX) #define INTPTR_MAX INT64_MAX +#define INTPTR_MIN INT64_MIN #define UINTMAX_MAX UINT64_MAX #define UINTMAX_MIN UINT64_MIN #define INTMAX_MAX INT64_MAX @@ -51,6 +52,7 @@ #define INT32_MAX 2147483647 #define INT32_MIN (~INT32_MAX) #define INTPTR_MAX INT32_MAX +#define INTPTR_MIN INT32_MIN #define UINTMAX_MAX UINT32_MAX #define UINTMAX_MIN UINT32_MIN #define INTMAX_MAX INT32_MAX @@ -60,6 +62,7 @@ #endif #define PTRDIFF_MAX INTPTR_MAX +#define PTRDIFF_MIN INTPTR_MIN #endif /* !__GNUC__ */ === modified file 'nt/nmake.defs' --- nt/nmake.defs 2012-09-30 21:36:42 +0000 +++ nt/nmake.defs 2012-11-20 17:13:10 +0000 @@ -116,7 +116,7 @@ USE_CRT_DLL = 1 -!ifdef USE_CRT_DLL +!if USE_CRT_DLL libc = msvcrt$(D).lib EMACS_EXTRA_C_FLAGS= -D_DLL -D_MT -DUSE_CRT_DLL=1 !else === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-20 20:06:17 +0000 +++ src/ChangeLog 2012-11-21 04:47:55 +0000 @@ -1,3 +1,24 @@ +2012-11-21 Ken Brown + + * emacs.c (main): Set the G_SLICE environment variable for all + Cygwin builds, not just GTK builds. See + https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html. + +2012-11-21 Eli Zaretskii + + * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED) + (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]: + Define for the MSVC compiler. + + * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon. + + * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory) + (Fexpand_file_name) [DOS_NT]: Pass encoded file name to + dostounix_filename. Prevents crashes down the road, because + dostounix_filename assumes it gets a unibyte string. Reported by + Michel de Ruiter , see + http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html + 2012-11-20 Stefan Monnier Conflate Qnil and Qunbound for `symbol-function'. === modified file 'src/emacs.c' --- src/emacs.c 2012-11-17 22:12:47 +0000 +++ src/emacs.c 2012-11-21 04:47:55 +0000 @@ -715,7 +715,7 @@ stack_base = &dummy; #endif -#if defined (USE_GTK) && defined (G_SLICE_ALWAYS_MALLOC) +#ifdef G_SLICE_ALWAYS_MALLOC /* This is used by the Cygwin build. */ setenv ("G_SLICE", "always-malloc", 1); #endif === modified file 'src/fileio.c' --- src/fileio.c 2012-11-14 04:55:41 +0000 +++ src/fileio.c 2012-11-21 04:47:55 +0000 @@ -315,6 +315,7 @@ register const char *beg; #else register char *beg; + Lisp_Object tem_fn; #endif register const char *p; Lisp_Object handler; @@ -374,10 +375,13 @@ p = beg + strlen (beg); } } - dostounix_filename (beg); -#endif /* DOS_NT */ - + tem_fn = ENCODE_FILE (make_specified_string (beg, -1, p - beg, + STRING_MULTIBYTE (filename))); + dostounix_filename (SSDATA (tem_fn)); + return DECODE_FILE (tem_fn); +#else /* DOS_NT */ return make_specified_string (beg, -1, p - beg, STRING_MULTIBYTE (filename)); +#endif /* DOS_NT */ } DEFUN ("file-name-nondirectory", Ffile_name_nondirectory, @@ -951,7 +955,18 @@ #ifdef DOS_NT /* Make sure directories are all separated with /, but avoid allocation of a new string when not required. */ - dostounix_filename (nm); + if (multibyte) + { + Lisp_Object tem_name = make_specified_string (nm, -1, strlen (nm), + multibyte); + + tem_name = ENCODE_FILE (tem_name); + dostounix_filename (SSDATA (tem_name)); + tem_name = DECODE_FILE (tem_name); + memcpy (nm, SSDATA (tem_name), SBYTES (tem_name) + 1); + } + else + dostounix_filename (nm); #ifdef WINDOWSNT if (IS_DIRECTORY_SEP (nm[1])) { @@ -1305,10 +1320,13 @@ target[0] = '/'; target[1] = ':'; } - dostounix_filename (target); -#endif /* DOS_NT */ - - result = make_specified_string (target, -1, o - target, multibyte); + result = make_specified_string (target, -1, o - target, multibyte); + result = ENCODE_FILE (result); + dostounix_filename (SSDATA (result)); + result = DECODE_FILE (result); +#else /* !DOS_NT */ + result = make_specified_string (target, -1, o - target, multibyte); +#endif /* !DOS_NT */ } /* Again look to see if the file name has special constructs in it @@ -1587,8 +1605,18 @@ memcpy (nm, SDATA (filename), SBYTES (filename) + 1); #ifdef DOS_NT - dostounix_filename (nm); - substituted = (strcmp (nm, SDATA (filename)) != 0); + { + Lisp_Object encoded_filename = ENCODE_FILE (filename); + Lisp_Object tem_fn; + + dostounix_filename (SDATA (encoded_filename)); + tem_fn = DECODE_FILE (encoded_filename); + nm = alloca (SBYTES (tem_fn) + 1); + memcpy (nm, SDATA (tem_fn), SBYTES (tem_fn) + 1); + substituted = (memcmp (nm, SDATA (filename), SBYTES (filename)) != 0); + if (substituted) + filename = tem_fn; + } #endif endp = nm + SBYTES (filename); === modified file 'src/w32.c' --- src/w32.c 2012-11-17 22:12:47 +0000 +++ src/w32.c 2012-11-21 04:47:55 +0000 @@ -119,9 +119,10 @@ #include #ifdef _MSC_VER -/* MSVC doesn't provide the definition of REPARSE_DATA_BUFFER, except - on ntifs.h, which cannot be included because it triggers conflicts - with other Windows API headers. So we define it here by hand. */ +/* MSVC doesn't provide the definition of REPARSE_DATA_BUFFER and the + associated macros, except on ntifs.h, which cannot be included + because it triggers conflicts with other Windows API headers. So + we define it here by hand. */ typedef struct _REPARSE_DATA_BUFFER { ULONG ReparseTag; @@ -149,6 +150,12 @@ } DUMMYUNIONNAME; } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; +#define FILE_DEVICE_FILE_SYSTEM 9 +#define METHOD_BUFFERED 0 +#define FILE_ANY_ACCESS 0x00000000 +#define CTL_CODE(t,f,m,a) (((t)<<16)|((a)<<14)|((f)<<2)|(m)) +#define FSCTL_GET_REPARSE_POINT \ + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS) #endif /* TCP connection support. */ === modified file 'src/w32term.h' --- src/w32term.h 2012-11-18 01:52:36 +0000 +++ src/w32term.h 2012-11-21 04:47:55 +0000 @@ -751,7 +751,7 @@ typedef BOOL (CALLBACK *LOCALE_ENUMPROCA)(LPSTR); typedef BOOL (CALLBACK *LOCALE_ENUMPROCW)(LPWSTR); BOOL WINAPI EnumSystemLocalesA(LOCALE_ENUMPROCA,DWORD); -BOOL WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW,DWORD) +BOOL WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW,DWORD); #ifdef UNICODE #define EnumSystemLocales EnumSystemLocalesW #else ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.