diff options
| author | Eli Zaretskii | 2013-04-20 11:01:06 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2013-04-20 11:01:06 +0300 |
| commit | 47ec731ececec750654e12cbd649e2cd90e069e8 (patch) | |
| tree | ae1f5c33a4a1c4e95a1b920dd29d882e31ddb020 | |
| parent | 373b3ea63375d70183e90ce4a1fb7895336813cd (diff) | |
| parent | 806bda47ddb469f6206ecc533458eadae6a5b575 (diff) | |
| download | emacs-47ec731ececec750654e12cbd649e2cd90e069e8.tar.gz emacs-47ec731ececec750654e12cbd649e2cd90e069e8.zip | |
Merge from trunk.
| -rwxr-xr-x | autogen/configure | 25 | ||||
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/progmodes/gud.el | 30 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 9 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 4 | ||||
| -rw-r--r-- | src/ChangeLog | 19 | ||||
| -rw-r--r-- | src/w32fns.c | 72 | ||||
| -rw-r--r-- | src/w32term.c | 108 | ||||
| -rw-r--r-- | src/w32term.h | 11 | ||||
| -rw-r--r-- | test/ChangeLog | 4 | ||||
| -rw-r--r-- | test/automated/imenu-test.el | 87 |
11 files changed, 276 insertions, 103 deletions
diff --git a/autogen/configure b/autogen/configure index 8e69c9ceffc..7ddac01fb10 100755 --- a/autogen/configure +++ b/autogen/configure | |||
| @@ -4640,6 +4640,11 @@ case "${canonical}" in | |||
| 4640 | opsys=freebsd | 4640 | opsys=freebsd |
| 4641 | ;; | 4641 | ;; |
| 4642 | 4642 | ||
| 4643 | ## DragonFly ports | ||
| 4644 | *-*-dragonfly* ) | ||
| 4645 | opsys=dragonfly | ||
| 4646 | ;; | ||
| 4647 | |||
| 4643 | ## FreeBSD kernel + glibc based userland | 4648 | ## FreeBSD kernel + glibc based userland |
| 4644 | *-*-kfreebsd*gnu* ) | 4649 | *-*-kfreebsd*gnu* ) |
| 4645 | opsys=gnu-kfreebsd | 4650 | opsys=gnu-kfreebsd |
| @@ -8462,7 +8467,7 @@ esac | |||
| 8462 | 8467 | ||
| 8463 | LD_SWITCH_SYSTEM= | 8468 | LD_SWITCH_SYSTEM= |
| 8464 | case "$opsys" in | 8469 | case "$opsys" in |
| 8465 | freebsd) | 8470 | freebsd|dragonfly) |
| 8466 | ## Let `ld' find image libs and similar things in /usr/local/lib. | 8471 | ## Let `ld' find image libs and similar things in /usr/local/lib. |
| 8467 | ## The system compiler, GCC, has apparently been modified to not | 8472 | ## The system compiler, GCC, has apparently been modified to not |
| 8468 | ## look there, contrary to what a stock GCC would do. | 8473 | ## look there, contrary to what a stock GCC would do. |
| @@ -8552,7 +8557,7 @@ case "$opsys" in | |||
| 8552 | ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2. | 8557 | ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2. |
| 8553 | aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;; | 8558 | aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;; |
| 8554 | 8559 | ||
| 8555 | freebsd) LIBS_SYSTEM="-lutil" ;; | 8560 | freebsd|dragonfly) LIBS_SYSTEM="-lutil" ;; |
| 8556 | 8561 | ||
| 8557 | hpux*) LIBS_SYSTEM="-l:libdld.sl" ;; | 8562 | hpux*) LIBS_SYSTEM="-l:libdld.sl" ;; |
| 8558 | 8563 | ||
| @@ -8589,7 +8594,7 @@ case $opsys in | |||
| 8589 | ## Adding -lm confuses the dynamic linker, so omit it. | 8594 | ## Adding -lm confuses the dynamic linker, so omit it. |
| 8590 | LIB_MATH= | 8595 | LIB_MATH= |
| 8591 | ;; | 8596 | ;; |
| 8592 | freebsd ) | 8597 | freebsd | dragonfly ) |
| 8593 | SYSTEM_TYPE=berkeley-unix | 8598 | SYSTEM_TYPE=berkeley-unix |
| 8594 | ;; | 8599 | ;; |
| 8595 | gnu-linux | gnu-kfreebsd ) | 8600 | gnu-linux | gnu-kfreebsd ) |
| @@ -13783,7 +13788,7 @@ mail_lock=no | |||
| 13783 | case "$opsys" in | 13788 | case "$opsys" in |
| 13784 | aix4-2) mail_lock="lockf" ;; | 13789 | aix4-2) mail_lock="lockf" ;; |
| 13785 | 13790 | ||
| 13786 | gnu|freebsd|netbsd|openbsd|darwin|irix6-5) mail_lock="flock" ;; | 13791 | gnu|freebsd|dragonfly|netbsd|openbsd|darwin|irix6-5) mail_lock="flock" ;; |
| 13787 | 13792 | ||
| 13788 | ## On GNU/Linux systems, both methods are used by various mail programs. | 13793 | ## On GNU/Linux systems, both methods are used by various mail programs. |
| 13789 | ## I assume most people are using newer mailers that have heard of flock. | 13794 | ## I assume most people are using newer mailers that have heard of flock. |
| @@ -14150,7 +14155,7 @@ $as_echo "$emacs_cv_freebsd_terminfo" >&6; } | |||
| 14150 | fi | 14155 | fi |
| 14151 | ;; | 14156 | ;; |
| 14152 | 14157 | ||
| 14153 | openbsd) LIBS_TERMCAP="-lncurses" ;; | 14158 | openbsd | dragonfly) LIBS_TERMCAP="-lncurses" ;; |
| 14154 | 14159 | ||
| 14155 | ## hpux: Make sure we get select from libc rather than from libcurses | 14160 | ## hpux: Make sure we get select from libc rather than from libcurses |
| 14156 | ## because libcurses on HPUX 10.10 has a broken version of select. | 14161 | ## because libcurses on HPUX 10.10 has a broken version of select. |
| @@ -15527,7 +15532,7 @@ $as_echo "#define HAVE_PROCFS 1" >>confdefs.h | |||
| 15527 | esac | 15532 | esac |
| 15528 | 15533 | ||
| 15529 | case $opsys in | 15534 | case $opsys in |
| 15530 | darwin | freebsd | netbsd | openbsd ) | 15535 | darwin | dragonfly | freebsd | netbsd | openbsd ) |
| 15531 | 15536 | ||
| 15532 | $as_echo "#define DONT_REOPEN_PTY 1" >>confdefs.h | 15537 | $as_echo "#define DONT_REOPEN_PTY 1" >>confdefs.h |
| 15533 | 15538 | ||
| @@ -15609,7 +15614,7 @@ case $opsys in | |||
| 15609 | 15614 | ||
| 15610 | ;; | 15615 | ;; |
| 15611 | 15616 | ||
| 15612 | gnu-linux | gnu-kfreebsd | freebsd | netbsd ) | 15617 | gnu-linux | gnu-kfreebsd | dragonfly | freebsd | netbsd ) |
| 15613 | if test "x$ac_cv_func_grantpt" = xyes; then | 15618 | if test "x$ac_cv_func_grantpt" = xyes; then |
| 15614 | 15619 | ||
| 15615 | $as_echo "#define UNIX98_PTYS 1" >>confdefs.h | 15620 | $as_echo "#define UNIX98_PTYS 1" >>confdefs.h |
| @@ -15688,7 +15693,7 @@ esac | |||
| 15688 | 15693 | ||
| 15689 | 15694 | ||
| 15690 | case $opsys in | 15695 | case $opsys in |
| 15691 | aix4-2 | cygwin | gnu | irix6-5 | freebsd | netbsd | openbsd | darwin ) | 15696 | aix4-2 | cygwin | gnu | irix6-5 | dragonfly | freebsd | netbsd | openbsd | darwin ) |
| 15692 | $as_echo "#define SIGNALS_VIA_CHARACTERS 1" >>confdefs.h | 15697 | $as_echo "#define SIGNALS_VIA_CHARACTERS 1" >>confdefs.h |
| 15693 | 15698 | ||
| 15694 | ;; | 15699 | ;; |
| @@ -15752,7 +15757,7 @@ case $opsys in | |||
| 15752 | darwin) $as_echo "#define TAB3 OXTABS" >>confdefs.h | 15757 | darwin) $as_echo "#define TAB3 OXTABS" >>confdefs.h |
| 15753 | ;; | 15758 | ;; |
| 15754 | 15759 | ||
| 15755 | gnu | freebsd | netbsd | openbsd ) | 15760 | gnu | dragonfly | freebsd | netbsd | openbsd ) |
| 15756 | 15761 | ||
| 15757 | $as_echo "#define TABDLY OXTABS" >>confdefs.h | 15762 | $as_echo "#define TABDLY OXTABS" >>confdefs.h |
| 15758 | 15763 | ||
| @@ -15831,7 +15836,7 @@ if test x$GCC = xyes; then | |||
| 15831 | 15836 | ||
| 15832 | else | 15837 | else |
| 15833 | case $opsys in | 15838 | case $opsys in |
| 15834 | freebsd | netbsd | openbsd | irix6-5 | sol2* ) | 15839 | dragonfly | freebsd | netbsd | openbsd | irix6-5 | sol2* ) |
| 15835 | $as_echo "#define GC_SETJMP_WORKS 1" >>confdefs.h | 15840 | $as_echo "#define GC_SETJMP_WORKS 1" >>confdefs.h |
| 15836 | 15841 | ||
| 15837 | ;; | 15842 | ;; |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a09d37352f7..9bb155b74da 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2013-04-19 Masatake YAMATO <yamato@redhat.com> | ||
| 2 | |||
| 3 | * progmodes/sh-script.el (sh-imenu-generic-expression): Handle | ||
| 4 | function names with a single character. (Bug#11182) | ||
| 5 | |||
| 6 | 2013-04-19 Dima Kogan <dima@secretsauce.net> (tiny change) | ||
| 7 | |||
| 8 | * progmodes/gud.el (gud-perldb-marker-filter): Understand position info | ||
| 9 | for subroutines defined in an eval (bug#14182). | ||
| 10 | |||
| 1 | 2013-04-19 Thierry Volpiatto <thierry.volpiatto@gmail.com> | 11 | 2013-04-19 Thierry Volpiatto <thierry.volpiatto@gmail.com> |
| 2 | 12 | ||
| 3 | * bookmark.el (bookmark-completing-read): Improve handling of empty | 13 | * bookmark.el (bookmark-completing-read): Improve handling of empty |
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index d339495d76a..4e31c5e827c 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -1487,14 +1487,38 @@ into one that invokes an Emacs-enabled debugging session. | |||
| 1487 | (let ((output "")) | 1487 | (let ((output "")) |
| 1488 | 1488 | ||
| 1489 | ;; Process all the complete markers in this chunk. | 1489 | ;; Process all the complete markers in this chunk. |
| 1490 | (while (string-match "\032\032\\(\\([a-zA-Z]:\\)?[^:\n]*\\):\\([0-9]*\\):.*\n" | 1490 | ;; |
| 1491 | gud-marker-acc) | 1491 | ;; Here I match the string coming out of perldb. |
| 1492 | ;; The strings can look like any of | ||
| 1493 | ;; | ||
| 1494 | ;; "\032\032/tmp/tst.pl:6:0\n" | ||
| 1495 | ;; "\032\032(eval 5)[/tmp/tst.pl:6]:3:0\n" | ||
| 1496 | ;; "\032\032(eval 17)[Basic/Core/Core.pm.PL (i.e. PDL::Core.pm):2931]:1:0\n" | ||
| 1497 | ;; | ||
| 1498 | ;; From those I want the filename and the line number. First I look for | ||
| 1499 | ;; the eval case. If that doesn't match, I look for the "normal" case. | ||
| 1500 | (while | ||
| 1501 | (string-match | ||
| 1502 | (eval-when-compile | ||
| 1503 | (let ((file-re "\\(?:[a-zA-Z]:\\)?[^:\n]*")) | ||
| 1504 | (concat "\032\032\\(?:" | ||
| 1505 | (concat | ||
| 1506 | "(eval [0-9]+)\\[" | ||
| 1507 | "\\(" file-re "\\)" ; Filename. | ||
| 1508 | "\\(?: (i\\.e\\. [^)]*)\\)?" | ||
| 1509 | ":\\([0-9]*\\)\\]") ; Line number. | ||
| 1510 | "\\|" | ||
| 1511 | (concat | ||
| 1512 | "\\(?1:" file-re "\\)" ; Filename. | ||
| 1513 | ":\\(?2:[0-9]*\\)") ; Line number. | ||
| 1514 | "\\):.*\n"))) | ||
| 1515 | gud-marker-acc) | ||
| 1492 | (setq | 1516 | (setq |
| 1493 | 1517 | ||
| 1494 | ;; Extract the frame position from the marker. | 1518 | ;; Extract the frame position from the marker. |
| 1495 | gud-last-frame | 1519 | gud-last-frame |
| 1496 | (cons (match-string 1 gud-marker-acc) | 1520 | (cons (match-string 1 gud-marker-acc) |
| 1497 | (string-to-number (match-string 3 gud-marker-acc))) | 1521 | (string-to-number (match-string 2 gud-marker-acc))) |
| 1498 | 1522 | ||
| 1499 | ;; Append any text before the marker to the output we're going | 1523 | ;; Append any text before the marker to the output we're going |
| 1500 | ;; to return - we don't include the marker in this text. | 1524 | ;; to return - we don't include the marker in this text. |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 06d07d6ee3c..2165c835057 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -3176,6 +3176,7 @@ To this: | |||
| 3176 | (\"decorator\" . 173) | 3176 | (\"decorator\" . 173) |
| 3177 | (\"decorator.wrap\" . 353) | 3177 | (\"decorator.wrap\" . 353) |
| 3178 | (\"decorator.wrapped_f\" . 393))" | 3178 | (\"decorator.wrapped_f\" . 393))" |
| 3179 | ;; Inspired by imenu--flatten-index-alist removed in revno 21853. | ||
| 3179 | (apply | 3180 | (apply |
| 3180 | 'nconc | 3181 | 'nconc |
| 3181 | (mapcar | 3182 | (mapcar |
| @@ -3187,14 +3188,14 @@ To this: | |||
| 3187 | (cond ((or (numberp pos) (markerp pos)) | 3188 | (cond ((or (numberp pos) (markerp pos)) |
| 3188 | (list (cons name pos))) | 3189 | (list (cons name pos))) |
| 3189 | ((listp pos) | 3190 | ((listp pos) |
| 3190 | (message "%S" item) | ||
| 3191 | (cons | 3191 | (cons |
| 3192 | (cons name (cdar pos)) | 3192 | (cons name (cdar pos)) |
| 3193 | (python-imenu-create-flat-index (cddr item) name)))))) | 3193 | (python-imenu-create-flat-index (cddr item) name)))))) |
| 3194 | (or alist | 3194 | (or alist |
| 3195 | (let ((python-imenu-format-item-label-function (lambda (type name) name)) | 3195 | (let* ((fn (lambda (type name) name)) |
| 3196 | (python-imenu-format-parent-item-label-function (lambda (type name) name)) | 3196 | (python-imenu-format-item-label-function fn) |
| 3197 | (python-imenu-format-parent-item-jump-label-function (lambda (type name) name))) | 3197 | (python-imenu-format-parent-item-label-function fn) |
| 3198 | (python-imenu-format-parent-item-jump-label-function fn)) | ||
| 3198 | (python-imenu-create-index)))))) | 3199 | (python-imenu-create-index)))))) |
| 3199 | 3200 | ||
| 3200 | 3201 | ||
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index e197f9cfabe..07e9bb85c4e 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -335,11 +335,11 @@ shell it really is." | |||
| 335 | . ((nil | 335 | . ((nil |
| 336 | ;; function FOO | 336 | ;; function FOO |
| 337 | ;; function FOO() | 337 | ;; function FOO() |
| 338 | "^\\s-*function\\s-+\\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*\\(?:()\\)?" | 338 | "^\\s-*function\\s-+\\\([[:alpha:]_][[:alnum:]_]*\\)\\s-*\\(?:()\\)?" |
| 339 | 1) | 339 | 1) |
| 340 | ;; FOO() | 340 | ;; FOO() |
| 341 | (nil | 341 | (nil |
| 342 | "^\\s-*\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*()" | 342 | "^\\s-*\\([[:alpha:]_][[:alnum:]_]*\\)\\s-*()" |
| 343 | 1) | 343 | 1) |
| 344 | ))) | 344 | ))) |
| 345 | "Alist of regular expressions for recognizing shell function definitions. | 345 | "Alist of regular expressions for recognizing shell function definitions. |
diff --git a/src/ChangeLog b/src/ChangeLog index 04a6c353619..5164dc8ff8d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,22 @@ | |||
| 1 | 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com> | ||
| 2 | |||
| 3 | * w32fns.c (w32_fullscreen_rect): New function to compute the | ||
| 4 | window rectangle for the given fullscreen mode. | ||
| 5 | (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no | ||
| 6 | longer tunes the window size. This keeps the window's edges flush | ||
| 7 | with the screen and allows the taskbar to hide itself in fullboth. | ||
| 8 | |||
| 9 | * w32term.c (w32fullscreen_hook): 'fullboth' now shows without | ||
| 10 | window decorations and uses the entire screen. | ||
| 11 | |||
| 12 | * w32term.h (w32_fullscreen_rect) Add prototype. | ||
| 13 | (struct w32_output): Replace normal_width, normal_height, | ||
| 14 | normal_top, and normal_left members with a single normal_placement | ||
| 15 | struct. | ||
| 16 | (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP): | ||
| 17 | Remove macros. | ||
| 18 | (FRAME_NORMAL_PLACEMENT): New macro. | ||
| 19 | |||
| 1 | 2013-04-16 Juanma Barranquero <lekktu@gmail.com> | 20 | 2013-04-16 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 21 | ||
| 3 | * minibuf.c (Ftest_completion): Silence compiler warning. | 22 | * minibuf.c (Ftest_completion): Silence compiler warning. |
diff --git a/src/w32fns.c b/src/w32fns.c index de52ff144e3..0785e685e6a 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -157,6 +157,8 @@ typedef HWND (WINAPI * ImmSetCompositionWindow_Proc) (IN HIMC context, | |||
| 157 | typedef HMONITOR (WINAPI * MonitorFromPoint_Proc) (IN POINT pt, IN DWORD flags); | 157 | typedef HMONITOR (WINAPI * MonitorFromPoint_Proc) (IN POINT pt, IN DWORD flags); |
| 158 | typedef BOOL (WINAPI * GetMonitorInfo_Proc) | 158 | typedef BOOL (WINAPI * GetMonitorInfo_Proc) |
| 159 | (IN HMONITOR monitor, OUT struct MONITOR_INFO* info); | 159 | (IN HMONITOR monitor, OUT struct MONITOR_INFO* info); |
| 160 | typedef HMONITOR (WINAPI * MonitorFromWindow_Proc) | ||
| 161 | (IN HWND hwnd, IN DWORD dwFlags); | ||
| 160 | 162 | ||
| 161 | TrackMouseEvent_Proc track_mouse_event_fn = NULL; | 163 | TrackMouseEvent_Proc track_mouse_event_fn = NULL; |
| 162 | ImmGetCompositionString_Proc get_composition_string_fn = NULL; | 164 | ImmGetCompositionString_Proc get_composition_string_fn = NULL; |
| @@ -165,6 +167,7 @@ ImmReleaseContext_Proc release_ime_context_fn = NULL; | |||
| 165 | ImmSetCompositionWindow_Proc set_ime_composition_window_fn = NULL; | 167 | ImmSetCompositionWindow_Proc set_ime_composition_window_fn = NULL; |
| 166 | MonitorFromPoint_Proc monitor_from_point_fn = NULL; | 168 | MonitorFromPoint_Proc monitor_from_point_fn = NULL; |
| 167 | GetMonitorInfo_Proc get_monitor_info_fn = NULL; | 169 | GetMonitorInfo_Proc get_monitor_info_fn = NULL; |
| 170 | MonitorFromWindow_Proc monitor_from_window_fn = NULL; | ||
| 168 | 171 | ||
| 169 | #ifdef NTGUI_UNICODE | 172 | #ifdef NTGUI_UNICODE |
| 170 | #define unicode_append_menu AppendMenuW | 173 | #define unicode_append_menu AppendMenuW |
| @@ -336,6 +339,66 @@ x_real_positions (FRAME_PTR f, int *xptr, int *yptr) | |||
| 336 | *yptr = rect.top; | 339 | *yptr = rect.top; |
| 337 | } | 340 | } |
| 338 | 341 | ||
| 342 | /* Returns the window rectangle appropriate for the given fullscreen mode. | ||
| 343 | The normal rect parameter was the window's rectangle prior to entering | ||
| 344 | fullscreen mode. If multiple monitor support is available, the nearest | ||
| 345 | monitor to the window is chosen. */ | ||
| 346 | |||
| 347 | void | ||
| 348 | w32_fullscreen_rect (HWND hwnd, int fsmode, RECT normal, RECT *rect) | ||
| 349 | { | ||
| 350 | struct MONITOR_INFO mi = { sizeof(mi) }; | ||
| 351 | if (monitor_from_window_fn && get_monitor_info_fn) | ||
| 352 | { | ||
| 353 | HMONITOR monitor = | ||
| 354 | monitor_from_window_fn (hwnd, MONITOR_DEFAULT_TO_NEAREST); | ||
| 355 | get_monitor_info_fn (monitor, &mi); | ||
| 356 | } | ||
| 357 | else | ||
| 358 | { | ||
| 359 | mi.rcMonitor.left = 0; | ||
| 360 | mi.rcMonitor.top = 0; | ||
| 361 | mi.rcMonitor.right = GetSystemMetrics (SM_CXSCREEN); | ||
| 362 | mi.rcMonitor.bottom = GetSystemMetrics (SM_CYSCREEN); | ||
| 363 | mi.rcWork.left = 0; | ||
| 364 | mi.rcWork.top = 0; | ||
| 365 | mi.rcWork.right = GetSystemMetrics (SM_CXMAXIMIZED); | ||
| 366 | mi.rcWork.bottom = GetSystemMetrics (SM_CYMAXIMIZED); | ||
| 367 | } | ||
| 368 | |||
| 369 | switch (fsmode) | ||
| 370 | { | ||
| 371 | case FULLSCREEN_BOTH: | ||
| 372 | rect->left = mi.rcMonitor.left; | ||
| 373 | rect->top = mi.rcMonitor.top; | ||
| 374 | rect->right = mi.rcMonitor.right; | ||
| 375 | rect->bottom = mi.rcMonitor.bottom; | ||
| 376 | break; | ||
| 377 | case FULLSCREEN_MAXIMIZED: | ||
| 378 | rect->left = mi.rcWork.left; | ||
| 379 | rect->top = mi.rcWork.top; | ||
| 380 | rect->right = mi.rcWork.right; | ||
| 381 | rect->bottom = mi.rcWork.bottom; | ||
| 382 | break; | ||
| 383 | case FULLSCREEN_WIDTH: | ||
| 384 | rect->left = mi.rcWork.left; | ||
| 385 | rect->top = normal.top; | ||
| 386 | rect->right = mi.rcWork.right; | ||
| 387 | rect->bottom = normal.bottom; | ||
| 388 | break; | ||
| 389 | case FULLSCREEN_HEIGHT: | ||
| 390 | rect->left = normal.left; | ||
| 391 | rect->top = mi.rcWork.top; | ||
| 392 | rect->right = normal.right; | ||
| 393 | rect->bottom = mi.rcWork.bottom; | ||
| 394 | break; | ||
| 395 | case FULLSCREEN_NONE: | ||
| 396 | default: | ||
| 397 | *rect = normal; | ||
| 398 | break; | ||
| 399 | } | ||
| 400 | } | ||
| 401 | |||
| 339 | 402 | ||
| 340 | 403 | ||
| 341 | DEFUN ("w32-define-rgb-color", Fw32_define_rgb_color, | 404 | DEFUN ("w32-define-rgb-color", Fw32_define_rgb_color, |
| @@ -3693,6 +3756,13 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) | |||
| 3693 | /* Don't restrict the sizing of tip frames. */ | 3756 | /* Don't restrict the sizing of tip frames. */ |
| 3694 | if (hwnd == tip_window) | 3757 | if (hwnd == tip_window) |
| 3695 | return 0; | 3758 | return 0; |
| 3759 | |||
| 3760 | /* Don't restrict the sizing of fullscreened frames, allowing them to be | ||
| 3761 | flush with the sides of the screen. */ | ||
| 3762 | f = x_window_to_frame (dpyinfo, hwnd); | ||
| 3763 | if (f && FRAME_PREV_FSMODE (f) != FULLSCREEN_NONE) | ||
| 3764 | return 0; | ||
| 3765 | |||
| 3696 | { | 3766 | { |
| 3697 | WINDOWPLACEMENT wp; | 3767 | WINDOWPLACEMENT wp; |
| 3698 | LPWINDOWPOS lppos = (WINDOWPOS *) lParam; | 3768 | LPWINDOWPOS lppos = (WINDOWPOS *) lParam; |
| @@ -7637,6 +7707,8 @@ globals_of_w32fns (void) | |||
| 7637 | GetProcAddress (user32_lib, "MonitorFromPoint"); | 7707 | GetProcAddress (user32_lib, "MonitorFromPoint"); |
| 7638 | get_monitor_info_fn = (GetMonitorInfo_Proc) | 7708 | get_monitor_info_fn = (GetMonitorInfo_Proc) |
| 7639 | GetProcAddress (user32_lib, "GetMonitorInfoA"); | 7709 | GetProcAddress (user32_lib, "GetMonitorInfoA"); |
| 7710 | monitor_from_window_fn = (MonitorFromWindow_Proc) | ||
| 7711 | GetProcAddress (user32_lib, "MonitorFromWindow"); | ||
| 7640 | 7712 | ||
| 7641 | { | 7713 | { |
| 7642 | HMODULE imm32_lib = GetModuleHandle ("imm32.dll"); | 7714 | HMODULE imm32_lib = GetModuleHandle ("imm32.dll"); |
diff --git a/src/w32term.c b/src/w32term.c index d249d6e3252..58b1d3ca308 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -5663,88 +5663,40 @@ w32fullscreen_hook (FRAME_PTR f) | |||
| 5663 | { | 5663 | { |
| 5664 | if (FRAME_VISIBLE_P (f)) | 5664 | if (FRAME_VISIBLE_P (f)) |
| 5665 | { | 5665 | { |
| 5666 | int width, height, top_pos, left_pos, pixel_height, pixel_width; | 5666 | HWND hwnd = FRAME_W32_WINDOW(f); |
| 5667 | int cur_w = FRAME_COLS (f), cur_h = FRAME_LINES (f); | 5667 | DWORD dwStyle = GetWindowLong (hwnd, GWL_STYLE); |
| 5668 | RECT workarea_rect; | 5668 | RECT rect; |
| 5669 | 5669 | ||
| 5670 | block_input (); | 5670 | block_input(); |
| 5671 | /* Record current "normal" dimensions for restoring later. */ | 5671 | f->want_fullscreen &= ~FULLSCREEN_WAIT; |
| 5672 | if (!( FRAME_PREV_FSMODE (f) == FULLSCREEN_BOTH | 5672 | |
| 5673 | || FRAME_PREV_FSMODE (f) == FULLSCREEN_MAXIMIZED)) | 5673 | if (FRAME_PREV_FSMODE (f) == FULLSCREEN_NONE) |
| 5674 | { | 5674 | GetWindowPlacement (hwnd, &FRAME_NORMAL_PLACEMENT (f)); |
| 5675 | if (FRAME_PREV_FSMODE (f) != FULLSCREEN_HEIGHT) | 5675 | |
| 5676 | { | 5676 | if (FRAME_PREV_FSMODE (f) == FULLSCREEN_BOTH) |
| 5677 | FRAME_NORMAL_HEIGHT (f) = cur_h; | 5677 | { |
| 5678 | FRAME_NORMAL_TOP (f) = f->top_pos; | 5678 | SetWindowLong (hwnd, GWL_STYLE, dwStyle | WS_OVERLAPPEDWINDOW); |
| 5679 | } | 5679 | SetWindowPos (hwnd, NULL, 0, 0, 0, 0, |
| 5680 | if (FRAME_PREV_FSMODE (f) != FULLSCREEN_WIDTH) | 5680 | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | |
| 5681 | { | 5681 | SWP_NOOWNERZORDER | SWP_FRAMECHANGED); |
| 5682 | FRAME_NORMAL_WIDTH (f) = cur_w; | 5682 | } |
| 5683 | FRAME_NORMAL_LEFT (f) = f->left_pos; | ||
| 5684 | } | ||
| 5685 | } | ||
| 5686 | eassert (FRAME_NORMAL_HEIGHT (f) > 0); | ||
| 5687 | eassert (FRAME_NORMAL_WIDTH (f) > 0); | ||
| 5688 | x_real_positions (f, &f->left_pos, &f->top_pos); | ||
| 5689 | x_fullscreen_adjust (f, &width, &height, &top_pos, &left_pos); | ||
| 5690 | |||
| 5691 | SystemParametersInfo (SPI_GETWORKAREA, 0, &workarea_rect, 0); | ||
| 5692 | pixel_height = workarea_rect.bottom - workarea_rect.top; | ||
| 5693 | pixel_width = workarea_rect.right - workarea_rect.left; | ||
| 5694 | /* Need to send SC_RESTORE to the window, in case we are | ||
| 5695 | resizing from FULLSCREEN_MAXIMIZED. Otherwise, the mouse | ||
| 5696 | resize hints will not be shown by the window manager when the | ||
| 5697 | mouse pointer hovers over the window edges, because the WM | ||
| 5698 | will still think the window is maximized. */ | ||
| 5699 | if (f->want_fullscreen != FULLSCREEN_BOTH) | ||
| 5700 | SendMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_RESTORE, 0); | ||
| 5701 | 5683 | ||
| 5684 | w32_fullscreen_rect (hwnd, f->want_fullscreen, | ||
| 5685 | FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect); | ||
| 5702 | FRAME_PREV_FSMODE (f) = f->want_fullscreen; | 5686 | FRAME_PREV_FSMODE (f) = f->want_fullscreen; |
| 5703 | switch (f->want_fullscreen) | 5687 | if (f->want_fullscreen == FULLSCREEN_BOTH) |
| 5704 | { | 5688 | { |
| 5705 | case FULLSCREEN_BOTH: | 5689 | SetWindowLong (hwnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW); |
| 5706 | PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_MAXIMIZE, 0); | 5690 | SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top, |
| 5707 | break; | 5691 | rect.right - rect.left, rect.bottom - rect.top, |
| 5708 | case FULLSCREEN_MAXIMIZED: | 5692 | SWP_NOOWNERZORDER | SWP_FRAMECHANGED); |
| 5709 | height = | 5693 | } |
| 5710 | FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) | 5694 | else |
| 5711 | - XINT (Ftool_bar_lines_needed (selected_frame)) | 5695 | { |
| 5712 | + (NILP (Vmenu_bar_mode) ? 1 : 0); | 5696 | SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top, |
| 5713 | width = | 5697 | rect.right - rect.left, rect.bottom - rect.top, 0); |
| 5714 | FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width) | 5698 | } |
| 5715 | - FRAME_SCROLL_BAR_COLS (f); | ||
| 5716 | left_pos = workarea_rect.left; | ||
| 5717 | top_pos = workarea_rect.top; | ||
| 5718 | break; | ||
| 5719 | case FULLSCREEN_WIDTH: | ||
| 5720 | width = | ||
| 5721 | FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width) | ||
| 5722 | - FRAME_SCROLL_BAR_COLS (f); | ||
| 5723 | height = FRAME_NORMAL_HEIGHT (f); | ||
| 5724 | left_pos = workarea_rect.left; | ||
| 5725 | break; | ||
| 5726 | case FULLSCREEN_HEIGHT: | ||
| 5727 | height = | ||
| 5728 | FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) | ||
| 5729 | - XINT (Ftool_bar_lines_needed (selected_frame)) | ||
| 5730 | + (NILP (Vmenu_bar_mode) ? 1 : 0); | ||
| 5731 | width = FRAME_NORMAL_WIDTH (f); | ||
| 5732 | top_pos = workarea_rect.top; | ||
| 5733 | break; | ||
| 5734 | case FULLSCREEN_NONE: | ||
| 5735 | height = FRAME_NORMAL_HEIGHT (f); | ||
| 5736 | width = FRAME_NORMAL_WIDTH (f); | ||
| 5737 | left_pos = FRAME_NORMAL_LEFT (f); | ||
| 5738 | top_pos = FRAME_NORMAL_TOP (f); | ||
| 5739 | break; | ||
| 5740 | } | ||
| 5741 | 5699 | ||
| 5742 | if (cur_w != width || cur_h != height) | ||
| 5743 | { | ||
| 5744 | x_set_offset (f, left_pos, top_pos, 1); | ||
| 5745 | x_set_window_size (f, 1, width, height); | ||
| 5746 | do_pending_window_change (0); | ||
| 5747 | } | ||
| 5748 | f->want_fullscreen = FULLSCREEN_NONE; | 5700 | f->want_fullscreen = FULLSCREEN_NONE; |
| 5749 | unblock_input (); | 5701 | unblock_input (); |
| 5750 | } | 5702 | } |
diff --git a/src/w32term.h b/src/w32term.h index 9bb37b31ef5..9c27c09d03d 100644 --- a/src/w32term.h +++ b/src/w32term.h | |||
| @@ -71,6 +71,8 @@ struct w32_palette_entry { | |||
| 71 | }; | 71 | }; |
| 72 | 72 | ||
| 73 | extern void w32_regenerate_palette (struct frame *f); | 73 | extern void w32_regenerate_palette (struct frame *f); |
| 74 | extern void w32_fullscreen_rect (HWND hwnd, int fsmode, RECT normal, | ||
| 75 | RECT *rect); | ||
| 74 | 76 | ||
| 75 | 77 | ||
| 76 | /* For each display (currently only one on w32), we have a structure that | 78 | /* For each display (currently only one on w32), we have a structure that |
| @@ -362,7 +364,7 @@ struct w32_output | |||
| 362 | /* Frame geometry and full-screen mode before it was resized by | 364 | /* Frame geometry and full-screen mode before it was resized by |
| 363 | specifying the 'fullscreen' frame parameter. Used to restore the | 365 | specifying the 'fullscreen' frame parameter. Used to restore the |
| 364 | geometry when 'fullscreen' is reset to nil. */ | 366 | geometry when 'fullscreen' is reset to nil. */ |
| 365 | int normal_width, normal_height, normal_top, normal_left; | 367 | WINDOWPLACEMENT normal_placement; |
| 366 | int prev_fsmode; | 368 | int prev_fsmode; |
| 367 | }; | 369 | }; |
| 368 | 370 | ||
| @@ -396,11 +398,8 @@ extern struct w32_output w32term_display; | |||
| 396 | #define FRAME_SMALLEST_FONT_HEIGHT(F) \ | 398 | #define FRAME_SMALLEST_FONT_HEIGHT(F) \ |
| 397 | FRAME_W32_DISPLAY_INFO(F)->smallest_font_height | 399 | FRAME_W32_DISPLAY_INFO(F)->smallest_font_height |
| 398 | 400 | ||
| 399 | #define FRAME_NORMAL_WIDTH(F) ((F)->output_data.w32->normal_width) | 401 | #define FRAME_NORMAL_PLACEMENT(F) ((F)->output_data.w32->normal_placement) |
| 400 | #define FRAME_NORMAL_HEIGHT(F) ((F)->output_data.w32->normal_height) | 402 | #define FRAME_PREV_FSMODE(F) ((F)->output_data.w32->prev_fsmode) |
| 401 | #define FRAME_NORMAL_TOP(F) ((F)->output_data.w32->normal_top) | ||
| 402 | #define FRAME_NORMAL_LEFT(F) ((F)->output_data.w32->normal_left) | ||
| 403 | #define FRAME_PREV_FSMODE(F) ((F)->output_data.w32->prev_fsmode) | ||
| 404 | 403 | ||
| 405 | 404 | ||
| 406 | /* W32-specific scroll bar stuff. */ | 405 | /* W32-specific scroll bar stuff. */ |
diff --git a/test/ChangeLog b/test/ChangeLog index 0c240394c5c..52cc61bdc06 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-04-01 Masatake YAMATO <yamato@redhat.com> | ||
| 2 | |||
| 3 | * automated/imenu-tests.el: New file. (Bug#14112) | ||
| 4 | |||
| 1 | 2013-04-19 Fabián Ezequiel Gallina <fgallina@gnu.org> | 5 | 2013-04-19 Fabián Ezequiel Gallina <fgallina@gnu.org> |
| 2 | 6 | ||
| 3 | * automated/python-tests.el (python-imenu-prev-index-position-1): | 7 | * automated/python-tests.el (python-imenu-prev-index-position-1): |
diff --git a/test/automated/imenu-test.el b/test/automated/imenu-test.el new file mode 100644 index 00000000000..83e19ebd914 --- /dev/null +++ b/test/automated/imenu-test.el | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | ;;; imenu-tests.el --- Test suite for imenu. | ||
| 2 | |||
| 3 | ;; Copyright (C) 2013 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Masatake YAMATO <yamato@redhat.com> | ||
| 6 | ;; Keywords: tools convenience | ||
| 7 | |||
| 8 | ;; This file is part of GNU Emacs. | ||
| 9 | |||
| 10 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 11 | ;; it under the terms of the GNU General Public License as published by | ||
| 12 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 13 | ;; (at your option) any later version. | ||
| 14 | |||
| 15 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | ;; GNU General Public License for more details. | ||
| 19 | |||
| 20 | ;; You should have received a copy of the GNU General Public License | ||
| 21 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 22 | |||
| 23 | ;;; Code: | ||
| 24 | |||
| 25 | (require 'imenu) | ||
| 26 | |||
| 27 | ;; (imenu-simple-scan-deftest-gather-strings-from-list | ||
| 28 | ;; '(nil t 'a (0 . "x") ("c" . "d") ("a" 0 "b") )) | ||
| 29 | ;; => ("b" "a" "d" "c" "x") | ||
| 30 | (defun imenu-simple-scan-deftest-gather-strings-from-list(input) | ||
| 31 | "Gather strings from INPUT, a list." | ||
| 32 | (let ((result ())) | ||
| 33 | (while input | ||
| 34 | (cond | ||
| 35 | ((stringp input) | ||
| 36 | (setq result (cons input result) | ||
| 37 | input nil)) | ||
| 38 | ((atom input) | ||
| 39 | (setq input nil)) | ||
| 40 | ((listp (car input)) | ||
| 41 | (setq result (append | ||
| 42 | (imenu-simple-scan-deftest-gather-strings-from-list (car input)) | ||
| 43 | result) | ||
| 44 | input (cdr input))) | ||
| 45 | ((stringp (car input)) | ||
| 46 | (setq result (cons (car input) result) | ||
| 47 | input (cdr input))) | ||
| 48 | (t | ||
| 49 | (setq input (cdr input))))) | ||
| 50 | result)) | ||
| 51 | |||
| 52 | (defmacro imenu-simple-scan-deftest (name doc major-mode content expected-items) | ||
| 53 | "Generate an ert test for mode-own imenu expression. | ||
| 54 | Run `imenu-create-index-function' at the buffer which content is | ||
| 55 | CONTENT with MAJOR-MODE. A generated test runs `imenu-create-index-function' | ||
| 56 | at the buffer which content is CONTENT with MAJOR-MODE. Then it compares a list | ||
| 57 | of strings which are picked up from the result with EXPECTED-ITEMS." | ||
| 58 | (let ((xname (intern (concat "imenu-simple-scan-deftest-" (symbol-name name))))) | ||
| 59 | `(ert-deftest ,xname () | ||
| 60 | ,doc | ||
| 61 | (with-temp-buffer | ||
| 62 | (insert ,content) | ||
| 63 | (funcall ',major-mode) | ||
| 64 | (let ((result-items (sort (imenu-simple-scan-deftest-gather-strings-from-list | ||
| 65 | (funcall imenu-create-index-function)) | ||
| 66 | #'string-lessp)) | ||
| 67 | (expected-items (sort (copy-sequence ,expected-items) #'string-lessp))) | ||
| 68 | (should (equal result-items expected-items)) | ||
| 69 | ))))) | ||
| 70 | |||
| 71 | (imenu-simple-scan-deftest sh "Test imenu expression for sh-mode." sh-mode "a() | ||
| 72 | { | ||
| 73 | } | ||
| 74 | function b | ||
| 75 | { | ||
| 76 | } | ||
| 77 | function c() | ||
| 78 | { | ||
| 79 | } | ||
| 80 | function ABC_D() | ||
| 81 | { | ||
| 82 | } | ||
| 83 | " '("a" "b" "c" "ABC_D")) | ||
| 84 | |||
| 85 | (provide 'imenu-tests) | ||
| 86 | |||
| 87 | ;;; imenu-tests.el ends here | ||