------------------------------------------------------------ revno: 117686 [merge] committer: Glenn Morris branch nick: trunk timestamp: Sun 2014-08-10 17:59:34 -0700 message: Merge from emacs-24; up to r117439 diff: === modified file 'ChangeLog' --- ChangeLog 2014-08-10 16:23:05 +0000 +++ ChangeLog 2014-08-11 00:59:34 +0000 @@ -1,3 +1,16 @@ +2014-08-11 Paul Eggert + + Don't prevent random file systems from being unmounted (Bug#18232). + This fix relies on having the 'fchdir' function, and on having + "." be searchable (or at least readable, on platforms lacking O_SEARCH), + but that's good enough to handle the vast majority of cases and the + remaining folks can just live with the annoyance of file systems + that occasionally can't be unmounted. + * configure.ac (fchdir): New function to check for. + * lib/save-cwd.c: Copy from gnulib, except omit the part that + allocates memory, since that can cause problems in Emacs. + * lib/save-cwd.h: Copy from gnulib. + 2014-08-10 Eli Zaretskii * config.bat: Fix some confusing wording. === modified file 'configure.ac' --- configure.ac 2014-08-02 21:50:13 +0000 +++ configure.ac 2014-08-11 00:59:34 +0000 @@ -3547,7 +3547,7 @@ OLD_LIBS=$LIBS LIBS="$LIB_PTHREAD $LIB_MATH $LIBS" -AC_CHECK_FUNCS(accept4 gethostname \ +AC_CHECK_FUNCS(accept4 fchdir gethostname \ getrusage get_current_dir_name \ lrand48 random rint \ select getpagesize setlocale \ === modified file 'etc/tutorials/TUTORIAL.fr' --- etc/tutorials/TUTORIAL.fr 2014-03-10 14:05:54 +0000 +++ etc/tutorials/TUTORIAL.fr 2014-08-08 05:20:52 +0000 @@ -698,7 +698,7 @@ proposera de sauvegarder tous les fichiers modifiés avant de quitter Emacs). -Si vous utiliser un affichage graphique, vous n'avez pas besoin de +Si vous utilisez un affichage graphique, vous n'avez pas besoin de commande spéciale pour vous déplacer d'Emacs à une autre application. Vous pouvez le faire à l'aide de la souris ou avec les commandes du gestionnaire de fenêtres. Cependant, si vous utilisez un terminal @@ -1143,7 +1143,7 @@ >> Faites C-x 1 pour supprimer la fenêtre d'aide. C-h i Manuels en ligne (alias Info). Cette commande vous place dans - un tampon spéciale, appelé « *info* », où vous pouvez + un tampon spécial, appelé « *info* », où vous pouvez lire les manuels en ligne des paquetages installés sur votre système. Faites m emacs pour lire le manuel d'Emacs. Si vous n'avez jamais utilisé Info === modified file 'lib/save-cwd.c' --- lib/save-cwd.c 2013-02-01 06:30:51 +0000 +++ lib/save-cwd.c 2014-08-10 21:06:07 +0000 @@ -1,3 +1,89 @@ +/* save-cwd.c -- Save and restore current working directory. + + Copyright (C) 1995, 1997-1998, 2003-2006, 2009-2014 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Gnulib needs to save and restore the current working directory to + fully emulate functions like fstatat. But Emacs doesn't care what + the current working directory is; it always uses absolute file + names. This module replaces the Gnulib module by omitting the code + that Emacs does not need. */ + #include -#define SAVE_CWD_INLINE _GL_EXTERN_INLINE + #include "save-cwd.h" + +#include +#include + +/* Record the location of the current working directory in CWD so that + the program may change to other directories and later use restore_cwd + to return to the recorded location. This function may allocate + space using malloc (via getcwd) or leave a file descriptor open; + use free_cwd to perform the necessary free or close. Upon failure, + no memory is allocated, any locally opened file descriptors are + closed; return non-zero -- in that case, free_cwd need not be + called, but doing so is ok. Otherwise, return zero. + + The _raison d'etre_ for this interface is that the working directory + is sometimes inaccessible, and getcwd is not robust or as efficient. + So, we prefer to use the open/fchdir approach, but fall back on + getcwd if necessary. This module works for most cases with just + the getcwd-lgpl module, but to be truly robust, use the getcwd module. + + Some systems lack fchdir altogether: e.g., OS/2, pre-2001 Cygwin, + SCO Xenix. Also, SunOS 4 and Irix 5.3 provide the function, yet it + doesn't work for partitions on which auditing is enabled. If + you're still using an obsolete system with these problems, please + send email to the maintainer of this code. */ + +#if !defined HAVE_FCHDIR && !defined fchdir +# define fchdir(fd) (-1) +#endif + +int +save_cwd (struct saved_cwd *cwd) +{ + cwd->desc = open (".", O_SEARCH | O_CLOEXEC); + /* The 'name' member is present only to minimize differences from + gnulib. Initialize it to zero, if only to simplify debugging. */ + cwd->name = 0; + return 0; +} + +/* Change to recorded location, CWD, in directory hierarchy. + Upon failure, return -1 (errno is set by chdir or fchdir). + Upon success, return zero. */ + +int +restore_cwd (const struct saved_cwd *cwd) +{ + /* Restore the previous directory if possible, to avoid tying down + the file system of the new directory (Bug#18232). + Don't worry if fchdir fails, as Emacs doesn't care what the + working directory is. The fchdir call is inside an 'if' merely to + pacify compilers that complain if fchdir's return value is ignored. */ + if (fchdir (cwd->desc) == 0) + return 0; + + return 0; +} + +void +free_cwd (struct saved_cwd *cwd) +{ + close (cwd->desc); +} === modified file 'lib/save-cwd.h' --- lib/save-cwd.h 2014-01-01 07:43:34 +0000 +++ lib/save-cwd.h 2014-08-10 20:40:57 +0000 @@ -1,6 +1,7 @@ -/* Do not save and restore the current working directory. +/* Save and restore current working directory. - Copyright 2013-2014 Free Software Foundation, Inc. + Copyright (C) 1995, 1997-1998, 2003, 2009-2014 Free Software Foundation, + Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,32 +16,19 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -/* Gnulib needs to save and restore the current working directory to - fully emulate functions like fstatat. But Emacs doesn't care what - the current working directory is; it always uses absolute file - names. This module replaces the Gnulib module by omitting the code - that Emacs does not need. */ +/* Written by Jim Meyering. */ #ifndef SAVE_CWD_H -#define SAVE_CWD_H 1 - -_GL_INLINE_HEADER_BEGIN -#ifndef SAVE_CWD_INLINE -# define SAVE_CWD_INLINE _GL_INLINE -#endif - -struct saved_cwd { int desc; }; - -SAVE_CWD_INLINE int -save_cwd (struct saved_cwd *cwd) -{ - cwd->desc = -1; - return 0; -} - -SAVE_CWD_INLINE int restore_cwd (struct saved_cwd const *cwd) { return 0; } -SAVE_CWD_INLINE void free_cwd (struct saved_cwd *cwd) { } - -_GL_INLINE_HEADER_END - -#endif +# define SAVE_CWD_H 1 + +struct saved_cwd + { + int desc; + char *name; + }; + +int save_cwd (struct saved_cwd *cwd); +int restore_cwd (const struct saved_cwd *cwd); +void free_cwd (struct saved_cwd *cwd); + +#endif /* SAVE_CWD_H */ === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-08-11 00:50:31 +0000 +++ lisp/ChangeLog 2014-08-11 00:59:34 +0000 @@ -1,3 +1,41 @@ +2014-08-11 Glenn Morris + + * files.el (basic-save-buffer-2): Revert 2013-01-31 change, which + chose coding system for writing before backing up, since it causes + a more serious problem than the one it solves. (Closes Bug#18141, + reopens Bug#13522.) + +2014-08-11 Martin Rudalics + + * window.el (window-total-size): Make doc-string more self-contained. + + * window.el (display-buffer-below-selected): Restore original + behavior if buffer is already displayed in the window below the + selected one (Bug#18181). + +2014-08-11 Stefan Monnier + + * mouse.el (mouse--down-1-maybe-follows-link): Don't convert the down + event (bug#18212). + +2014-08-11 Eli Zaretskii + + * info.el (info): Doc fix. + +2014-08-11 Stefan Monnier + + * info.el (Info-mode-map): Override a global down-mouse-2 binding + (bug#18212). + +2014-08-11 Eli Zaretskii + + * simple.el (default-line-height): A floating-point value of + line-spacing means a fraction of the default frame font's height, + not of the font currently used by the 'default' face. + Truncate the pixel value, like the display engine does. + (window-screen-lines): Use window-inside-pixel-edges for + determining the window height in pixels. (Bug#18195) + 2014-08-11 Grégoire Jadi * leim/quail/latin-post.el: Transform " __" into " _". (Bug#18023) @@ -462,8 +500,8 @@ (python-shell-output-filter): Fix comment typo. Fix Python shell prompts detection for remote hosts. - * progmodes/python.el (python-shell-prompt-detect): Replace - call-process with process-file and make it more robust. + * progmodes/python.el (python-shell-prompt-detect): + Replace call-process with process-file and make it more robust. Autodetect Python shell prompts. (Bug#17370) * progmodes/python.el: === modified file 'lisp/files.el' --- lisp/files.el 2014-08-07 11:49:36 +0000 +++ lisp/files.el 2014-08-11 00:59:34 +0000 @@ -4759,7 +4759,7 @@ ;; This returns a value (MODES EXTENDED-ATTRIBUTES BACKUPNAME), like ;; backup-buffer. (defun basic-save-buffer-2 () - (let (tempsetmodes setmodes writecoding) + (let (tempsetmodes setmodes) (if (not (file-writable-p buffer-file-name)) (let ((dir (file-name-directory buffer-file-name))) (if (not (file-directory-p dir)) @@ -4775,14 +4775,6 @@ buffer-file-name))) (setq tempsetmodes t) (error "Attempt to save to a file which you aren't allowed to write")))))) - ;; This may involve prompting, so do it now before backing up the file. - ;; Otherwise there can be a delay while the user answers the - ;; prompt during which the original file has been renamed. (Bug#13522) - (setq writecoding - ;; Args here should match write-region call below around - ;; which we use writecoding. - (choose-write-coding-system nil nil buffer-file-name nil t - buffer-file-truename)) (or buffer-backed-up (setq setmodes (backup-buffer))) (let* ((dir (file-name-directory buffer-file-name)) @@ -4864,11 +4856,10 @@ (logior (car setmodes) 128)))))) (let (success) (unwind-protect + (progn ;; Pass in nil&nil rather than point-min&max to indicate ;; we're saving the buffer rather than just a region. ;; write-region-annotate-functions may make us of it. - (let ((coding-system-for-write writecoding) - (coding-system-require-warning nil)) (write-region nil nil buffer-file-name nil t buffer-file-truename) (setq success t)) === modified file 'lisp/info.el' --- lisp/info.el 2014-06-25 10:36:51 +0000 +++ lisp/info.el 2014-08-11 00:59:34 +0000 @@ -774,8 +774,7 @@ In interactive use, a non-numeric prefix argument directs this command to read a file name from the minibuffer. -A numeric prefix argument N selects an Info buffer named -\"*info*<%s>\". +A numeric prefix argument of N selects an Info buffer named \"*info*\". The search path for Info files is in the variable `Info-directory-list'. The top-level Info directory is made by combining all the files named `dir' @@ -4009,6 +4008,7 @@ (define-key map "," 'Info-index-next) (define-key map "\177" 'Info-scroll-down) (define-key map [mouse-2] 'Info-mouse-follow-nearest-node) + (define-key map [down-mouse-2] 'ignore) ;Override potential global binding. (define-key map [follow-link] 'mouse-face) (define-key map [XF86Back] 'Info-history-back) (define-key map [XF86Forward] 'Info-history-forward) === modified file 'lisp/mouse.el' --- lisp/mouse.el 2014-07-21 01:38:21 +0000 +++ lisp/mouse.el 2014-08-11 00:59:34 +0000 @@ -94,15 +94,14 @@ (defun mouse--down-1-maybe-follows-link (&optional _prompt) "Turn `mouse-1' events into `mouse-2' events if follows-link. Expects to be bound to `down-mouse-1' in `key-translation-map'." - (if (or (null mouse-1-click-follows-link) - (not (eq (if (eq mouse-1-click-follows-link 'double) - 'double-down-mouse-1 'down-mouse-1) - (car-safe last-input-event))) - (not (mouse-on-link-p (event-start last-input-event))) - (and (not mouse-1-click-in-non-selected-windows) - (not (eq (selected-window) - (posn-window (event-start last-input-event)))))) - nil + (when (and mouse-1-click-follows-link + (eq (if (eq mouse-1-click-follows-link 'double) + 'double-down-mouse-1 'down-mouse-1) + (car-safe last-input-event)) + (mouse-on-link-p (event-start last-input-event)) + (or mouse-1-click-in-non-selected-windows + (eq (selected-window) + (posn-window (event-start last-input-event))))) (let ((this-event last-input-event) (timedout (sit-for (if (numberp mouse-1-click-follows-link) @@ -118,19 +117,14 @@ 'double-mouse-1 'mouse-1)) ;; Turn the mouse-1 into a mouse-2 to follow links. (let ((newup (if (eq mouse-1-click-follows-link 'double) - 'double-mouse-2 'mouse-2)) - (newdown (if (eq mouse-1-click-follows-link 'double) - 'double-down-mouse-2 'down-mouse-2))) + 'double-mouse-2 'mouse-2))) ;; If mouse-2 has never been done by the user, it doesn't have ;; the necessary property to be interpreted correctly. - (put newup 'event-kind (get (car event) 'event-kind)) - (put newdown 'event-kind (get (car this-event) 'event-kind)) + (unless (get newup 'event-kind) + (put newup 'event-kind (get (car event) 'event-kind))) (push (cons newup (cdr event)) unread-command-events) - ;; Modify the event in place, so read-key-sequence doesn't - ;; generate a second fake prefix key (see fake_prefixed_keys in - ;; src/keyboard.c). - (setcar this-event newdown) - (vector this-event)) + ;; Don't change the down event, only the up-event (bug#18212). + nil) (push event unread-command-events) nil)))))) === modified file 'lisp/simple.el' --- lisp/simple.el 2014-07-08 08:27:46 +0000 +++ lisp/simple.el 2014-08-11 00:59:34 +0000 @@ -5140,7 +5140,7 @@ 0) 0))) (if (floatp lsp) - (setq lsp (* dfh lsp))) + (setq lsp (truncate (* (frame-char-height) lsp)))) (+ dfh lsp))) (defun window-screen-lines () @@ -5152,10 +5152,9 @@ for `line-spacing', if any, defined for the window's buffer or frame. The value is a floating-point number." - (let ((canonical (window-text-height)) - (fch (frame-char-height)) + (let ((edges (window-inside-pixel-edges)) (dlh (default-line-height))) - (/ (* (float canonical) fch) dlh))) + (/ (float (- (nth 3 edges) (nth 1 edges))) dlh))) ;; Returns non-nil if partial move was done. (defun line-move-partial (arg noerror to-end) === modified file 'lisp/window.el' --- lisp/window.el 2014-08-07 14:34:06 +0000 +++ lisp/window.el 2014-08-11 00:59:34 +0000 @@ -1155,8 +1155,17 @@ WINDOW must be a valid window and defaults to the selected one. If HORIZONTAL is omitted or nil, return the total height of -WINDOW, in lines, like `window-total-height'. Otherwise return -the total width, in columns, like `window-total-width'. +WINDOW, in lines. If WINDOW is live, its total height includes, +in addition to the height of WINDOW's text, the heights of +WINDOW's mode and header line and a bottom divider, if any. + +If HORIZONTAL is non-nil, return the total width of WINDOW, in +columns. If WINDOW is live, its total width includes, in +addition to the width of WINDOW's text, the widths of WINDOW's +fringes, margins, scroll bars and its right divider, if any. + +If WINDOW is internal, return the respective size of the screen +areas spanned by its children. Optional argument ROUND is handled as for `window-total-height' and `window-total-width'." @@ -6440,7 +6449,10 @@ This either splits the selected window or reuses the window below the selected one." (let (window) - (or (and (not (frame-parameter nil 'unsplittable)) + (or (and (setq window (window-in-direction 'below)) + (eq buffer (window-buffer window)) + (window--display-buffer buffer window 'reuse alist)) + (and (not (frame-parameter nil 'unsplittable)) (let ((split-height-threshold 0) split-width-threshold) (setq window (window--try-to-split-window (selected-window) alist))) === modified file 'src/ChangeLog' --- src/ChangeLog 2014-08-10 16:28:36 +0000 +++ src/ChangeLog 2014-08-11 00:59:34 +0000 @@ -1,3 +1,33 @@ +2014-08-11 Glenn Morris + + * fileio.c: Revert 2013-01-31 change, which chose coding system for + writing before backing up, since it causes a more serious problem + than the one it solves. (Closes Bug#18141, reopens Bug#13522.) + (choose_write_coding_system): No longer callable from Lisp. + Move last piece back here from Fwrite_region. + (Fwrite_region, syms_of_fileio): Update for above changes. + +2014-08-11 Martin Rudalics + + * window.c (Fwindow_valid_p): Fix doc-string (Bug#18194). + (Fwindow_new_total, Fwindow_normal_size, Fwindow_new_normal) + (Fwindow_new_pixel, Fset_window_new_pixel) + (Fset_window_new_total, Fset_window_new_normal) + (Fwindow_resize_apply): Fix doc-strings (see Bug#18112). + See also: + http://lists.gnu.org/archive/html/bug-gnu-emacs/2014-08/msg00287.html + +2014-08-11 Eli Zaretskii + + * fontset.c (Finternal_char_font): Recompute basic faces if the + frame's face cache was cleared. (Bug#18162) + +2014-08-11 Dmitry Antipov + + Fix bug with uninitialized undo list of an indirect buffer (Bug#18180). + * buffer.c (Fmake_indirect_buffer): Initialize undo list with the + base buffer's undo list. + 2014-08-10 Reuben Thomas Fix a couple of recent inadvertent breaks of the MSDOS port. === modified file 'src/buffer.c' --- src/buffer.c 2014-07-27 13:21:30 +0000 +++ src/buffer.c 2014-08-11 00:59:34 +0000 @@ -826,6 +826,9 @@ set_string_intervals (name, NULL); bset_name (b, name); + /* An indirect buffer shares undo list of its base (Bug#18180). */ + bset_undo_list (b, BVAR (b->base_buffer, undo_list)); + reset_buffer (b); reset_buffer_local_variables (b, 1); === modified file 'src/coding.c' --- src/coding.c 2014-07-10 04:35:55 +0000 +++ src/coding.c 2014-08-11 00:59:34 +0000 @@ -1190,8 +1190,8 @@ #define UTF_8_BOM_2 0xBB #define UTF_8_BOM_3 0xBF -/* Unlike the other detect_coding_XXX, this function counts number of - characters and check EOL format. */ +/* Unlike the other detect_coding_XXX, this function counts the number + of characters and checks the EOL format. */ static bool detect_coding_utf_8 (struct coding_system *coding, @@ -11265,7 +11265,7 @@ DEFVAR_BOOL ("disable-ascii-optimization", disable_ascii_optimization, doc: /* If non-nil, Emacs does not optimize code decoder for ASCII files. -Internal use only. Removed after the experimental optimizer gets stable. */); +Internal use only. Remove after the experimental optimizer becomes stable. */); disable_ascii_optimization = 0; DEFVAR_LISP ("translation-table-for-input", Vtranslation_table_for_input, === modified file 'src/fileio.c' --- src/fileio.c 2014-07-26 13:17:25 +0000 +++ src/fileio.c 2014-08-11 00:59:34 +0000 @@ -323,7 +323,6 @@ static Lisp_Object Qset_file_acl; static Lisp_Object Qfile_newer_than_file_p; Lisp_Object Qinsert_file_contents; -static Lisp_Object Qchoose_write_coding_system; Lisp_Object Qwrite_region; static Lisp_Object Qverify_visited_file_modtime; static Lisp_Object Qset_visited_file_modtime; @@ -4525,24 +4524,14 @@ /* Decide the coding-system to encode the data with. */ -DEFUN ("choose-write-coding-system", Fchoose_write_coding_system, - Schoose_write_coding_system, 3, 6, 0, - doc: /* Choose the coding system for writing a file. -Arguments are as for `write-region'. -This function is for internal use only. It may prompt the user. */ ) - (Lisp_Object start, Lisp_Object end, Lisp_Object filename, - Lisp_Object append, Lisp_Object visit, Lisp_Object lockname) +static Lisp_Object +choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object filename, + Lisp_Object append, Lisp_Object visit, Lisp_Object lockname, + struct coding_system *coding) { Lisp_Object val; Lisp_Object eol_parent = Qnil; - /* Mimic write-region behavior. */ - if (NILP (start)) - { - XSETFASTINT (start, BEGV); - XSETFASTINT (end, ZV); - } - if (auto_saving && NILP (Fstring_equal (BVAR (current_buffer, filename), BVAR (current_buffer, auto_save_file_name)))) @@ -4635,6 +4624,10 @@ } val = coding_inherit_eol_type (val, eol_parent); + setup_coding_system (val, coding); + + if (!STRINGP (start) && !NILP (BVAR (current_buffer, selective_display))) + coding->mode |= CODING_MODE_SELECTIVE_DISPLAY; return val; } @@ -4803,14 +4796,9 @@ We used to make this choice before calling build_annotations, but that leads to problems when a write-annotate-function takes care of unsavable chars (as was the case with X-Symbol). */ - Vlast_coding_system_used = - Fchoose_write_coding_system (start, end, filename, - append, visit, lockname); - - setup_coding_system (Vlast_coding_system_used, &coding); - - if (!STRINGP (start) && !NILP (BVAR (current_buffer, selective_display))) - coding.mode |= CODING_MODE_SELECTIVE_DISPLAY; + Vlast_coding_system_used + = choose_write_coding_system (start, end, filename, + append, visit, lockname, &coding); if (open_and_close_file && !auto_saving) { @@ -5829,7 +5817,6 @@ DEFSYM (Qset_file_acl, "set-file-acl"); DEFSYM (Qfile_newer_than_file_p, "file-newer-than-file-p"); DEFSYM (Qinsert_file_contents, "insert-file-contents"); - DEFSYM (Qchoose_write_coding_system, "choose-write-coding-system"); DEFSYM (Qwrite_region, "write-region"); DEFSYM (Qverify_visited_file_modtime, "verify-visited-file-modtime"); DEFSYM (Qset_visited_file_modtime, "set-visited-file-modtime"); @@ -6068,7 +6055,6 @@ defsubr (&Sdefault_file_modes); defsubr (&Sfile_newer_than_file_p); defsubr (&Sinsert_file_contents); - defsubr (&Schoose_write_coding_system); defsubr (&Swrite_region); defsubr (&Scar_less_than_car); defsubr (&Sverify_visited_file_modtime); === modified file 'src/fontset.c' --- src/fontset.c 2014-06-19 16:52:20 +0000 +++ src/fontset.c 2014-08-11 00:59:34 +0000 @@ -1843,6 +1843,10 @@ return Qnil; if (!FRAME_WINDOW_P (f)) return Qnil; + /* We need the basic faces to be valid below, so recompute them if + some code just happened to clear the face cache. */ + if (FRAME_FACE_CACHE (f)->used == 0) + recompute_basic_faces (f); face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil); face = FACE_FROM_ID (f, face_id); if (face->font) === modified file 'src/window.c' --- src/window.c 2014-08-04 16:47:27 +0000 +++ src/window.c 2014-08-11 00:59:34 +0000 @@ -329,7 +329,7 @@ DEFUN ("window-valid-p", Fwindow_valid_p, Swindow_valid_p, 1, 1, 0, doc: /* Return t if OBJECT is a valid window and nil otherwise. A valid window is either a window that displays a buffer or an internal -window. Deleted windows are not live. */) +window. Windows that have been deleted are not valid. */) (Lisp_Object object) { return WINDOW_VALID_P (object) ? Qt : Qnil; @@ -810,7 +810,12 @@ DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, doc: /* Return the new total size of window WINDOW. -WINDOW must be a valid window and defaults to the selected one. */) +WINDOW must be a valid window and defaults to the selected one. + +The new total size of WINDOW is the value set by the last call of +`set-window-new-total' for WINDOW. If it is valid, it will be shortly +installed as WINDOW's total height (see `window-total-height') or total +width (see `window-total-width'). */) (Lisp_Object window) { return decode_valid_window (window)->new_total; @@ -819,7 +824,25 @@ DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0, doc: /* Return the normal height of window WINDOW. WINDOW must be a valid window and defaults to the selected one. -If HORIZONTAL is non-nil, return the normal width of WINDOW. */) +If HORIZONTAL is non-nil, return the normal width of WINDOW. + +The normal height of a frame's root window or a window that is +horizontally combined (a window that has a left or right sibling) is +1.0. The normal height of a window that is vertically combined (has a +sibling above or below) is the fraction of the window's height with +respect to its parent. The sum of the normal heights of all windows in a +vertical combination equals 1.0. + +Similarly, the normal width of a frame's root window or a window that is +vertically combined equals 1.0. The normal width of a window that is +horizontally combined is the fraction of the window's width with respect +to its parent. The sum of the normal widths of all windows in a +horizontal combination equals 1.0. + +The normal sizes of windows are used to restore the proportional sizes +of windows after they have been shrunk to their minimum sizes; for +example when a frame is temporarily made very small and afterwards gets +re-enlarged to its previous size. */) (Lisp_Object window, Lisp_Object horizontal) { struct window *w = decode_valid_window (window); @@ -829,7 +852,11 @@ DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0, doc: /* Return new normal size of window WINDOW. -WINDOW must be a valid window and defaults to the selected one. */) +WINDOW must be a valid window and defaults to the selected one. + +The new normal size of WINDOW is the value set by the last call of +`set-window-new-normal' for WINDOW. If valid, it will be shortly +installed as WINDOW's normal size (see `window-normal-size'). */) (Lisp_Object window) { return decode_valid_window (window)->new_normal; @@ -837,7 +864,12 @@ DEFUN ("window-new-pixel", Fwindow_new_pixel, Swindow_new_pixel, 0, 1, 0, doc: /* Return new pixel size of window WINDOW. -WINDOW must be a valid window and defaults to the selected one. */) +WINDOW must be a valid window and defaults to the selected one. + +The new pixel size of WINDOW is the value set by the last call of +`set-window-new-pixel' for WINDOW. If it is valid, it will be shortly +installed as WINDOW's pixel height (see `window-pixel-height') or pixel +width (see `window-pixel-width'). */) (Lisp_Object window) { return decode_valid_window (window)->new_pixel; @@ -3705,6 +3737,10 @@ Optional argument ADD non-nil means add SIZE to the new pixel size of WINDOW and return the sum. +The new pixel size of WINDOW, if valid, will be shortly installed as +WINDOW's pixel height (see `window-pixel-height') or pixel width (see +`window-pixel-width'). + Note: This function does not operate on any child windows of WINDOW. */) (Lisp_Object window, Lisp_Object size, Lisp_Object add) { @@ -3729,6 +3765,10 @@ Optional argument ADD non-nil means add SIZE to the new total size of WINDOW and return the sum. +The new total size of WINDOW, if valid, will be shortly installed as +WINDOW's total height (see `window-total-height') or total width (see +`window-total-width'). + Note: This function does not operate on any child windows of WINDOW. */) (Lisp_Object window, Lisp_Object size, Lisp_Object add) { @@ -3748,6 +3788,9 @@ WINDOW must be a valid window and defaults to the selected one. Return SIZE. +The new normal size of WINDOW, if valid, will be shortly installed as +WINDOW's normal size (see `window-normal-size'). + Note: This function does not operate on any child windows of WINDOW. */) (Lisp_Object window, Lisp_Object size) { @@ -4012,9 +4055,14 @@ Optional argument HORIZONTAL omitted or nil means apply requested height values. HORIZONTAL non-nil means apply requested width values. -This function checks whether the requested values sum up to a valid -window layout, recursively assigns the new sizes of all child windows -and calculates and assigns the new start positions of these windows. +The requested size values are those set by `set-window-new-pixel' and +`set-window-new-normal'. This function checks whether the requested +values sum up to a valid window layout, recursively assigns the new +sizes of all child windows and calculates and assigns the new start +positions of these windows. + +Return t if the requested values have been applied correctly, nil +otherwise. Note: This function does not check any of `window-fixed-size-p', `window-min-height' or `window-min-width'. All these checks have to === modified file 'test/ChangeLog' --- test/ChangeLog 2014-08-11 00:50:31 +0000 +++ test/ChangeLog 2014-08-11 00:59:34 +0000 @@ -1,3 +1,9 @@ +2014-08-11 Glenn Morris + + * automated/data/files-bug18141.el.gz: New file. + * automated/files.el (files-test-bug-18141-file): + New variable and test. (Bug#18141) + 2014-08-10 Ulf Jasper Enumerate evaluated sexp diary entries (Bug#7911). === added file 'test/automated/data/files-bug18141.el.gz' Binary files test/automated/data/files-bug18141.el.gz 1970-01-01 00:00:00 +0000 and test/automated/data/files-bug18141.el.gz 2014-08-11 00:38:19 +0000 differ === modified file 'test/automated/files.el' --- test/automated/files.el 2014-01-01 07:43:34 +0000 +++ test/automated/files.el 2014-08-11 00:38:19 +0000 @@ -148,6 +148,24 @@ (should (file-test--do-local-variables-test str subtest)))))) (ad-disable-advice 'hack-local-variables-confirm 'around 'files-test))) +(defvar files-test-bug-18141-file + (expand-file-name "data/files-bug18141.el.gz" (getenv "EMACS_TEST_DIRECTORY")) + "Test file for bug#18141.") + +(ert-deftest files-test-bug-18141 () + "Test for http://debbugs.gnu.org/18141 ." + (skip-unless (executable-find "gzip")) + (let ((tempfile (make-temp-file "files-test-bug-18141" nil ".gz"))) + (unwind-protect + (progn + (copy-file files-test-bug-18141-file tempfile t) + (with-current-buffer (find-file-noselect tempfile) + (set-buffer-modified-p t) + (save-buffer) + (should (eq buffer-file-coding-system 'iso-2022-7bit-unix)))) + (delete-file tempfile)))) + + ;; Stop the above "Local Var..." confusing Emacs. ------------------------------------------------------------ revno: 117685 committer: Glenn Morris branch nick: trunk timestamp: Sun 2014-08-10 17:50:31 -0700 message: ChangeLog fixes diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-08-11 00:43:33 +0000 +++ lisp/ChangeLog 2014-08-11 00:50:31 +0000 @@ -5,24 +5,19 @@ 2014-08-10 Ulf Jasper Enumerate evaluated sexp diary entries (Bug#7911). - * calendar/icalendar.el (icalendar-export-sexp-enumerate-all) - (icalendar-export-sexp-enumeration-days): New - (icalendar-export-region): `icalendar--convert-to-ical' now + (icalendar-export-sexp-enumeration-days): New. + (icalendar-export-region): Now `icalendar--convert-to-ical' returns a cons cell or a list of cons cells. (icalendar--convert-to-ical): Take care of - `icalendar-export-sexp-enumerate-all'. Return (a list of) cons - cells. - (icalendar--convert-ordinary-to-ical), - (icalendar--convert-weekly-to-ical), - (icalendar--convert-yearly-to-ical), - (icalendar--convert-block-to-ical), - (icalendar--convert-block-to-ical), - (icalendar--convert-float-to-ical), - (icalendar--convert-cyclic-to-ical), + `icalendar-export-sexp-enumerate-all'. Return (a list of) cons cells. + (icalendar--convert-ordinary-to-ical) + (icalendar--convert-weekly-to-ical, icalendar--convert-yearly-to-ical) + (icalendar--convert-block-to-ical, icalendar--convert-block-to-ical) + (icalendar--convert-float-to-ical, icalendar--convert-cyclic-to-ical) (icalendar--convert-anniversary-to-ical): Return cons cell. (icalendar--convert-sexp-to-ical): Enumerate evaluated sexp - entries. Return (list of) cons cells. + entries. Return (list of) cons cells. 2014-08-09 Juri Linkov @@ -95,7 +90,7 @@ 2014-08-06 Ulf Jasper - * calendar/icalendar.el (icalendar--diarytime-to-isotime): + * calendar/icalendar.el (icalendar--diarytime-to-isotime) (icalendar--convert-ordinary-to-ical): Allow for missing minutes (Bug#13750). === modified file 'test/ChangeLog' --- test/ChangeLog 2014-08-10 17:48:51 +0000 +++ test/ChangeLog 2014-08-11 00:50:31 +0000 @@ -1,17 +1,12 @@ 2014-08-10 Ulf Jasper Enumerate evaluated sexp diary entries (Bug#7911). - - * automated/icalendar-tests.el - (icalendar--convert-anniversary-to-ical), - (icalendar--convert-cyclic-to-ical), - (icalendar--convert-block-to-ical), - (icalendar--convert-yearly-to-ical), - (icalendar--convert-weekly-to-ical), + * automated/icalendar-tests.el (icalendar--convert-anniversary-to-ical) + (icalendar--convert-cyclic-to-ical, icalendar--convert-block-to-ical) + (icalendar--convert-yearly-to-ical, icalendar--convert-weekly-to-ical) (icalendar--convert-ordinary-to-ical): Returns cons cell now. - (icalendar--convert-to-ical), - (icalendar--convert-sexp-to-ical): New tests. - + (icalendar--convert-to-ical, icalendar--convert-sexp-to-ical): + New tests. 2014-08-07 Glenn Morris @@ -19,8 +14,7 @@ 2014-08-06 Ulf Jasper - * automated/icalendar-tests.el - (icalendar--convert-ordinary-to-ical), + * automated/icalendar-tests.el (icalendar--convert-ordinary-to-ical) (icalendar--diarytime-to-isotime): More testcases (Bug#13750). 2014-08-03 Glenn Morris ------------------------------------------------------------ revno: 117684 committer: Glenn Morris branch nick: trunk timestamp: Sun 2014-08-10 17:47:10 -0700 message: * lisp/calendar/icalendar.el: Add missing :version tags for new defcustoms. diff: === modified file 'lisp/calendar/icalendar.el' --- lisp/calendar/icalendar.el 2014-08-10 17:48:51 +0000 +++ lisp/calendar/icalendar.el 2014-08-11 00:47:10 +0000 @@ -250,6 +250,7 @@ See `icalendar-export-sexp-enumerate-all' for a list of sexp entries which by default are NOT enumerated." + :version "24.5" :type 'integer :group 'icalendar) @@ -262,6 +263,7 @@ following sexp diary entries: `diary-anniversary', `diary-cyclic', `diary-date', `diary-float',`diary-block'. All other sexp entries are enumerated in any case." + :version "24.5" :type 'boolean :group 'icalendar) ------------------------------------------------------------ revno: 117683 fixes bug: http://debbugs.gnu.org/18023 author: Gr?goire Jadi committer: Glenn Morris branch nick: trunk timestamp: Sun 2014-08-10 17:43:33 -0700 message: * leim/quail/latin-post.el: Transform " __" into " _". diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-08-10 17:48:51 +0000 +++ lisp/ChangeLog 2014-08-11 00:43:33 +0000 @@ -1,3 +1,7 @@ +2014-08-11 Grégoire Jadi + + * leim/quail/latin-post.el: Transform " __" into " _". (Bug#18023) + 2014-08-10 Ulf Jasper Enumerate evaluated sexp diary entries (Bug#7911). === modified file 'lisp/leim/quail/latin-post.el' --- lisp/leim/quail/latin-post.el 2014-01-01 07:43:34 +0000 +++ lisp/leim/quail/latin-post.el 2014-08-11 00:43:33 +0000 @@ -2299,6 +2299,7 @@ ("z." ?ż) ("z~" ?ž) + (" __" [" _"]) ("!//" ["!/"]) ("///" ["//"]) ("<<<" ["<<"]) ------------------------------------------------------------ revno: 117682 committer: Ulf Jasper branch nick: trunk timestamp: Sun 2014-08-10 19:48:51 +0200 message: iCalendar export: Enumerate evaluated sexp diary entries (Bug#7911). 2014-08-10 Ulf Jasper Enumerate evaluated sexp diary entries (Bug#7911). * calendar/icalendar.el (icalendar-export-sexp-enumerate-all) (icalendar-export-sexp-enumeration-days): New (icalendar-export-region): `icalendar--convert-to-ical' now returns a cons cell or a list of cons cells. (icalendar--convert-to-ical): Take care of `icalendar-export-sexp-enumerate-all'. Return (a list of) cons cells. (icalendar--convert-ordinary-to-ical), (icalendar--convert-weekly-to-ical), (icalendar--convert-yearly-to-ical), (icalendar--convert-block-to-ical), (icalendar--convert-block-to-ical), (icalendar--convert-float-to-ical), (icalendar--convert-cyclic-to-ical), (icalendar--convert-anniversary-to-ical): Return cons cell. (icalendar--convert-sexp-to-ical): Enumerate evaluated sexp entries. Return (list of) cons cells. 2014-08-10 Ulf Jasper Enumerate evaluated sexp diary entries (Bug#7911). * automated/icalendar-tests.el (icalendar--convert-anniversary-to-ical), (icalendar--convert-cyclic-to-ical), (icalendar--convert-block-to-ical), (icalendar--convert-yearly-to-ical), (icalendar--convert-weekly-to-ical), (icalendar--convert-ordinary-to-ical): Returns cons cell now. (icalendar--convert-to-ical), (icalendar--convert-sexp-to-ical): New tests. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-08-09 23:55:39 +0000 +++ lisp/ChangeLog 2014-08-10 17:48:51 +0000 @@ -1,3 +1,25 @@ +2014-08-10 Ulf Jasper + + Enumerate evaluated sexp diary entries (Bug#7911). + + * calendar/icalendar.el (icalendar-export-sexp-enumerate-all) + (icalendar-export-sexp-enumeration-days): New + (icalendar-export-region): `icalendar--convert-to-ical' now + returns a cons cell or a list of cons cells. + (icalendar--convert-to-ical): Take care of + `icalendar-export-sexp-enumerate-all'. Return (a list of) cons + cells. + (icalendar--convert-ordinary-to-ical), + (icalendar--convert-weekly-to-ical), + (icalendar--convert-yearly-to-ical), + (icalendar--convert-block-to-ical), + (icalendar--convert-block-to-ical), + (icalendar--convert-float-to-ical), + (icalendar--convert-cyclic-to-ical), + (icalendar--convert-anniversary-to-ical): Return cons cell. + (icalendar--convert-sexp-to-ical): Enumerate evaluated sexp + entries. Return (list of) cons cells. + 2014-08-09 Juri Linkov * vc/vc-annotate.el (vc-annotate-background-mode): Add :set === modified file 'lisp/calendar/icalendar.el' --- lisp/calendar/icalendar.el 2014-08-06 18:19:34 +0000 +++ lisp/calendar/icalendar.el 2014-08-10 17:48:51 +0000 @@ -240,6 +240,31 @@ :type 'string :group 'icalendar) +(defcustom icalendar-export-sexp-enumeration-days + 14 + "Number of days over which a sexp diary entry is enumerated. +In general sexp entries cannot be translated to icalendar format. +They are therefore enumerated, i.e. explicitly evaluated for a +certain number of days, and then exported. The enumeration starts +on the current day and continues for the number of days given here. + +See `icalendar-export-sexp-enumerate-all' for a list of sexp +entries which by default are NOT enumerated." + :type 'integer + :group 'icalendar) + +(defcustom icalendar-export-sexp-enumerate-all + nil + "Determines whether ALL sexp diary entries are enumerated. +If non-nil all sexp diary entries are enumerated for +`icalendar-export-sexp-enumeration-days' days instead of +translating into an icalendar equivalent. This affects the +following sexp diary entries: `diary-anniversary', +`diary-cyclic', `diary-date', `diary-float',`diary-block'. All +other sexp entries are enumerated in any case." + :type 'boolean + :group 'icalendar) + (defvar icalendar-debug nil "Enable icalendar debug messages.") @@ -1027,40 +1052,48 @@ (condition-case error-val (progn - (setq contents-n-summary + (setq cns-cons-or-list (icalendar--convert-to-ical nonmarker entry-main)) (setq other-elements (icalendar--parse-summary-and-rest entry-full)) - (setq contents (concat (car contents-n-summary) - "\nSUMMARY:" (cadr contents-n-summary))) - (let ((cla (cdr (assoc 'cla other-elements))) - (des (cdr (assoc 'des other-elements))) - (loc (cdr (assoc 'loc other-elements))) - (org (cdr (assoc 'org other-elements))) - (sta (cdr (assoc 'sta other-elements))) - (sum (cdr (assoc 'sum other-elements))) - (url (cdr (assoc 'url other-elements))) - (uid (cdr (assoc 'uid other-elements)))) - (if cla - (setq contents (concat contents "\nCLASS:" cla))) - (if des - (setq contents (concat contents "\nDESCRIPTION:" des))) - (if loc - (setq contents (concat contents "\nLOCATION:" loc))) - (if org - (setq contents (concat contents "\nORGANIZER:" org))) - (if sta - (setq contents (concat contents "\nSTATUS:" sta))) - ;;(if sum - ;; (setq contents (concat contents "\nSUMMARY:" sum))) - (if url - (setq contents (concat contents "\nURL:" url))) + (mapc (lambda (contents-n-summary) + (setq contents (concat (car contents-n-summary) + "\nSUMMARY:" + (cdr contents-n-summary))) + (let ((cla (cdr (assoc 'cla other-elements))) + (des (cdr (assoc 'des other-elements))) + (loc (cdr (assoc 'loc other-elements))) + (org (cdr (assoc 'org other-elements))) + (sta (cdr (assoc 'sta other-elements))) + (sum (cdr (assoc 'sum other-elements))) + (url (cdr (assoc 'url other-elements))) + (uid (cdr (assoc 'uid other-elements)))) + (if cla + (setq contents (concat contents "\nCLASS:" cla))) + (if des + (setq contents (concat contents "\nDESCRIPTION:" + des))) + (if loc + (setq contents (concat contents "\nLOCATION:" loc))) + (if org + (setq contents (concat contents "\nORGANIZER:" + org))) + (if sta + (setq contents (concat contents "\nSTATUS:" sta))) + ;;(if sum + ;; (setq contents (concat contents "\nSUMMARY:" sum))) + (if url + (setq contents (concat contents "\nURL:" url))) - (setq header (concat "\nBEGIN:VEVENT\nUID:" - (or uid - (icalendar--create-uid entry-full - contents))))) - (setq result (concat result header contents "\nEND:VEVENT"))) + (setq header (concat "\nBEGIN:VEVENT\nUID:" + (or uid + (icalendar--create-uid + entry-full contents))))) + (setq result (concat result header contents + "\nEND:VEVENT"))) + (if (consp cns-cons-or-list) + (list cns-cons-or-list) + cns-cons-or-list))) ;; handle errors (error (setq found-error t) @@ -1092,16 +1125,18 @@ NONMARKER is a regular expression matching the start of non-marking entries. ENTRY-MAIN is the first line of the diary entry." (or - ;; anniversaries -- %%(diary-anniversary ...) - (icalendar--convert-anniversary-to-ical nonmarker entry-main) - ;; cyclic events -- %%(diary-cyclic ...) - (icalendar--convert-cyclic-to-ical nonmarker entry-main) - ;; diary-date -- %%(diary-date ...) - (icalendar--convert-date-to-ical nonmarker entry-main) - ;; float events -- %%(diary-float ...) - (icalendar--convert-float-to-ical nonmarker entry-main) - ;; block events -- %%(diary-block ...) - (icalendar--convert-block-to-ical nonmarker entry-main) + (unless icalendar-export-sexp-enumerate-all + (or + ;; anniversaries -- %%(diary-anniversary ...) + (icalendar--convert-anniversary-to-ical nonmarker entry-main) + ;; cyclic events -- %%(diary-cyclic ...) + (icalendar--convert-cyclic-to-ical nonmarker entry-main) + ;; diary-date -- %%(diary-date ...) + (icalendar--convert-date-to-ical nonmarker entry-main) + ;; float events -- %%(diary-float ...) + (icalendar--convert-float-to-ical nonmarker entry-main) + ;; block events -- %%(diary-block ...) + (icalendar--convert-block-to-ical nonmarker entry-main))) ;; other sexp diary entries (icalendar--convert-sexp-to-ical nonmarker entry-main) ;; weekly by day -- Monday 8:30 Team meeting @@ -1300,7 +1335,7 @@ (- time 230000))) (setq endisostring1 endisostring)) ))) - (list (concat "\nDTSTART;" + (cons (concat "\nDTSTART;" (if starttimestring "VALUE=DATE-TIME:" "VALUE=DATE:") startisostring @@ -1381,7 +1416,7 @@ starttimestring)))) (setq endtimestring (format "T%06d" (+ 10000 time)))))) - (list (concat "\nDTSTART;" + (cons (concat "\nDTSTART;" (if starttimestring "VALUE=DATE-TIME:" "VALUE=DATE:") @@ -1468,7 +1503,7 @@ starttimestring)))) (setq endtimestring (format "T%06d" (+ 10000 time)))))) - (list (concat "\nDTSTART;" + (cons (concat "\nDTSTART;" (if starttimestring "VALUE=DATE-TIME:" "VALUE=DATE:") (format "1900%02d%02d" month day) @@ -1489,13 +1524,16 @@ ;; no match nil)) -(defun icalendar--convert-sexp-to-ical (nonmarker entry-main) - "Convert complex sexp diary entry to iCalendar format -- unsupported! - -FIXME! - -NONMARKER is a regular expression matching the start of non-marking -entries. ENTRY-MAIN is the first line of the diary entry." +(defun icalendar--convert-sexp-to-ical (nonmarker entry-main &optional start) + "Convert sexp diary entry to iCalendar format. +Enumerate the evaluated sexp entry for the next +`icalendar-export-sexp-enumeration-days' days. NONMARKER is a +regular expression matching the start of non-marking entries. +ENTRY-MAIN is the first line of the diary entry. + +Optional argument START determines the first day of the +enumeration, given as a time value, in same format as returned by +`current-time' -- used for test purposes." (cond ((string-match (concat nonmarker "%%(and \\(([^)]+)\\))\\(\\s-*.*?\\) ?$") entry-main) @@ -1508,10 +1546,37 @@ (substring entry-main (match-beginning 1) (match-end 1)) (substring entry-main (match-beginning 2) (match-end 2))))) ((string-match (concat nonmarker - "%%([^)]+)\\s-*.*") + "%%\\(([^)]+)\\)\\s-*\\(.*\\)") entry-main) + ;; regular sexp entry (icalendar--dmsg "diary-sexp %s" entry-main) - (error "Sexp-entries are not supported yet")) + (let ((p1 (substring entry-main (match-beginning 1) (match-end 1))) + (p2 (substring entry-main (match-beginning 2) (match-end 2))) + (now (or start (current-time)))) + (delete nil + (mapcar + (lambda (offset) + (let* ((day (decode-time (time-add now + (seconds-to-time + (* offset 60 60 24))))) + (d (nth 3 day)) + (m (nth 4 day)) + (y (nth 5 day)) + (se (diary-sexp-entry p1 p2 (list m d y))) + (see (cond ((stringp se) se) + ((consp se) (cdr se)) + (t nil)))) + (cond ((null see) + nil) + ((stringp see) + (let ((calendar-date-style 'iso)) + (icalendar--convert-ordinary-to-ical + nonmarker (format "%4d/%02d/%02d %s" y m d see)))) + (;TODO: + (error (format "Unsopported Sexp-entry: %s" + entry-main)))))) + (number-sequence + 0 (- icalendar-export-sexp-enumeration-days 1)))))) (t ;; no match nil))) @@ -1576,7 +1641,7 @@ (+ 10000 time)))))) (if starttimestring ;; with time -> write rrule - (list (concat "\nDTSTART;VALUE=DATE-TIME:" + (cons (concat "\nDTSTART;VALUE=DATE-TIME:" startisostring starttimestring "\nDTEND;VALUE=DATE-TIME:" @@ -1586,7 +1651,7 @@ endisostring) summary) ;; no time -> write long event - (list (concat "\nDTSTART;VALUE=DATE:" startisostring + (cons (concat "\nDTSTART;VALUE=DATE:" startisostring "\nDTEND;VALUE=DATE:" endisostring+1) summary))) ;; no match @@ -1622,7 +1687,7 @@ (icalendar--dmsg "diary-float %s" entry-main) (error "Don't know if or how to implement day in `diary-float'"))) - (list (concat + (cons (concat ;;Start today (yes this is an arbitrary choice): "\nDTSTART;VALUE=DATE:" (format-time-string "%Y%m%d" (current-time)) @@ -1727,7 +1792,7 @@ starttimestring)))) (setq endtimestring (format "T%06d" (+ 10000 time)))))) - (list (concat "\nDTSTART;" + (cons (concat "\nDTSTART;" (if starttimestring "VALUE=DATE-TIME:" "VALUE=DATE:") startisostring @@ -1796,7 +1861,7 @@ starttimestring)))) (setq endtimestring (format "T%06d" (+ 10000 time)))))) - (list (concat "\nDTSTART;" + (cons (concat "\nDTSTART;" (if starttimestring "VALUE=DATE-TIME:" "VALUE=DATE:") startisostring === modified file 'test/ChangeLog' --- test/ChangeLog 2014-08-07 00:07:32 +0000 +++ test/ChangeLog 2014-08-10 17:48:51 +0000 @@ -1,3 +1,18 @@ +2014-08-10 Ulf Jasper + + Enumerate evaluated sexp diary entries (Bug#7911). + + * automated/icalendar-tests.el + (icalendar--convert-anniversary-to-ical), + (icalendar--convert-cyclic-to-ical), + (icalendar--convert-block-to-ical), + (icalendar--convert-yearly-to-ical), + (icalendar--convert-weekly-to-ical), + (icalendar--convert-ordinary-to-ical): Returns cons cell now. + (icalendar--convert-to-ical), + (icalendar--convert-sexp-to-ical): New tests. + + 2014-08-07 Glenn Morris * automated/Makefile.in (check-tar): Remove, hydra recipe does it now. === modified file 'test/automated/icalendar-tests.el' --- test/automated/icalendar-tests.el 2014-08-06 18:19:34 +0000 +++ test/automated/icalendar-tests.el 2014-08-10 17:48:51 +0000 @@ -98,13 +98,13 @@ result) (setq result (icalendar--convert-anniversary-to-ical "" "%%(diary-anniversary 1964 6 30) g")) - (should (= 2 (length result))) + (should (consp result)) (should (string= (concat "\nDTSTART;VALUE=DATE:19640630" "\nDTEND;VALUE=DATE:19640701" "\nRRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=30") (car result))) - (should (string= "g" (cadr result))))) + (should (string= "g" (cdr result))))) (ert-deftest icalendar--convert-cyclic-to-ical () "Test method for `icalendar--convert-cyclic-to-ical'." @@ -112,12 +112,12 @@ result) (setq result (icalendar--convert-block-to-ical "" "%%(diary-block 2004 7 19 2004 8 27) Sommerferien")) - (should (= 2 (length result))) + (should (consp result)) (should (string= (concat "\nDTSTART;VALUE=DATE:20040719" "\nDTEND;VALUE=DATE:20040828") (car result))) - (should (string= "Sommerferien" (cadr result))))) + (should (string= "Sommerferien" (cdr result))))) (ert-deftest icalendar--convert-block-to-ical () "Test method for `icalendar--convert-block-to-ical'." @@ -125,12 +125,12 @@ result) (setq result (icalendar--convert-block-to-ical "" "%%(diary-block 2004 7 19 2004 8 27) Sommerferien")) - (should (= 2 (length result))) + (should (consp result)) (should (string= (concat "\nDTSTART;VALUE=DATE:20040719" "\nDTEND;VALUE=DATE:20040828") (car result))) - (should (string= "Sommerferien" (cadr result))))) + (should (string= "Sommerferien" (cdr result))))) (ert-deftest icalendar--convert-yearly-to-ical () "Test method for `icalendar--convert-yearly-to-ical'." @@ -140,13 +140,13 @@ ["January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December"])) (setq result (icalendar--convert-yearly-to-ical "" "May 1 Tag der Arbeit")) - (should (= 2 (length result))) + (should (consp result)) (should (string= (concat "\nDTSTART;VALUE=DATE:19000501" "\nDTEND;VALUE=DATE:19000502" "\nRRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=5;BYMONTHDAY=1") (car result))) - (should (string= "Tag der Arbeit" (cadr result))))) + (should (string= "Tag der Arbeit" (cdr result))))) (ert-deftest icalendar--convert-weekly-to-ical () "Test method for `icalendar--convert-weekly-to-ical'." @@ -156,12 +156,49 @@ ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"])) (setq result (icalendar--convert-weekly-to-ical "" "Monday 8:30 subject")) - (should (= 2 (length result))) + (should (consp result)) (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20050103T083000" "\nDTEND;VALUE=DATE-TIME:20050103T093000" "\nRRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO") (car result))) - (should (string= "subject" (cadr result))))) + (should (string= "subject" (cdr result))))) + +(ert-deftest icalendar--convert-sexp-to-ical () + "Test method for `icalendar--convert-sexp-to-ical'." + (let* (result + (icalendar-export-sexp-enumeration-days 3)) + ;; test case %%(diary-hebrew-date) + (setq result (icalendar--convert-sexp-to-ical "" "%%(diary-hebrew-date)")) + (should (consp result)) + (should (eq icalendar-export-sexp-enumeration-days (length result))) + (mapc (lambda (i) + (should (consp i)) + (should (string-match "Hebrew date (until sunset): .*" (cdr i)))) + result))) + +(ert-deftest icalendar--convert-to-ical () + "Test method for `icalendar--convert-to-ical'." + (let* (result + (icalendar-export-sexp-enumerate-all t) + (icalendar-export-sexp-enumeration-days 3) + (calendar-date-style 'iso)) + ;; test case: %%(diary-anniversary 1642 12 25) Newton + ;; forced enumeration not matching the actual day --> empty + (setq result (icalendar--convert-sexp-to-ical + "" "%%(diary-anniversary 1642 12 25) Newton's birthday" + (encode-time 1 1 1 6 12 2014))) + (should (null result)) + ;; test case: %%(diary-anniversary 1642 12 25) Newton + ;; enumeration does match the actual day --> + (setq result (icalendar--convert-sexp-to-ical + "" "%%(diary-anniversary 1642 12 25) Newton's birthday" + (encode-time 1 1 1 24 12 2014))) + (should (= 1 (length result))) + (should (consp (car result))) + (should (string-match + "\nDTSTART;VALUE=DATE:20141225\nDTEND;VALUE=DATE:20141226" + (car (car result)))) + (should (string-match "Newton's birthday" (cdr (car result)))))) (ert-deftest icalendar--parse-vtimezone () "Test method for `icalendar--parse-vtimezone'." @@ -215,37 +252,37 @@ result) ;; without time (setq result (icalendar--convert-ordinary-to-ical "&?" "2010 2 15 subject")) - (should (= 2 (length result))) + (should (consp result)) (should (string= "\nDTSTART;VALUE=DATE:20100215\nDTEND;VALUE=DATE:20100216" (car result))) - (should (string= "subject" (cadr result))) + (should (string= "subject" (cdr result))) ;; with start time (setq result (icalendar--convert-ordinary-to-ical "&?" "&2010 2 15 12:34 s")) - (should (= 2 (length result))) + (should (consp result)) (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T123400" "\nDTEND;VALUE=DATE-TIME:20100215T133400") (car result))) - (should (string= "s" (cadr result))) + (should (string= "s" (cdr result))) ;; with time (setq result (icalendar--convert-ordinary-to-ical "&?" "&2010 2 15 12:34-23:45 s")) - (should (= 2 (length result))) + (should (consp result)) (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T123400" "\nDTEND;VALUE=DATE-TIME:20100215T234500") (car result))) - (should (string= "s" (cadr result))) + (should (string= "s" (cdr result))) ;; with time, again -- test bug#5549 (setq result (icalendar--convert-ordinary-to-ical "x?" "x2010 2 15 0:34-1:45 s")) - (should (= 2 (length result))) + (should (consp result)) (should (string= (concat "\nDTSTART;VALUE=DATE-TIME:20100215T003400" "\nDTEND;VALUE=DATE-TIME:20100215T014500") (car result))) - (should (string= "s" (cadr result))))) + (should (string= "s" (cdr result))))) (ert-deftest icalendar--diarytime-to-isotime () "Test method for `icalendar--diarytime-to-isotime'." ------------------------------------------------------------ revno: 117681 committer: Reuben Thomas branch nick: trunk timestamp: Sun 2014-08-10 17:28:36 +0100 message: Fix a couple of recent inadvertent breaks of the MSDOS port. src/msdos.c: include required menu.h src/term.c: set correct menu_show_hook on MSDOS. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-08-10 08:26:28 +0000 +++ src/ChangeLog 2014-08-10 16:28:36 +0000 @@ -1,3 +1,9 @@ +2014-08-10 Reuben Thomas + + Fix a couple of recent inadvertent breaks of the MSDOS port. + * msdos.c: include required menu.h + * term.c: set correct menu_show_hook on MSDOS. + 2014-08-10 Martin Rudalics Fix handling of menu bar line on TTY frames (Bug#18136) === modified file 'src/msdos.c' --- src/msdos.c 2014-08-09 16:12:33 +0000 +++ src/msdos.c 2014-08-10 16:28:36 +0000 @@ -71,6 +71,7 @@ #include "coding.h" #include "disptab.h" #include "window.h" +#include "menu.h" #include "buffer.h" #include "commands.h" #include "blockinput.h" === modified file 'src/term.c' --- src/term.c 2014-08-10 08:26:28 +0000 +++ src/term.c 2014-08-10 16:28:36 +0000 @@ -3936,7 +3936,11 @@ terminal->reset_terminal_modes_hook = &tty_reset_terminal_modes; terminal->set_terminal_modes_hook = &tty_set_terminal_modes; terminal->update_end_hook = &tty_update_end; +#ifdef MSDOS + terminal->menu_show_hook = &x_menu_show; +#else terminal->menu_show_hook = &tty_menu_show; +#endif terminal->set_terminal_window_hook = &tty_set_terminal_window; terminal->read_socket_hook = &tty_read_avail_input; /* keyboard.c */ terminal->delete_frame_hook = &tty_free_frame_resources; ------------------------------------------------------------ revno: 117680 committer: Reuben Thomas branch nick: trunk timestamp: Sun 2014-08-10 17:23:05 +0100 message: config.bat: fix some confusing wording diff: === modified file 'ChangeLog' --- ChangeLog 2014-08-09 18:48:45 +0000 +++ ChangeLog 2014-08-10 16:23:05 +0000 @@ -1,3 +1,7 @@ +2014-08-10 Eli Zaretskii + + * config.bat: Fix some confusing wording. + 2014-08-09 Eli Zaretskii * config.bat: Fix EOL format in lines modified by last commit. === modified file 'config.bat' --- config.bat 2014-08-09 18:48:45 +0000 +++ config.bat 2014-08-10 16:23:05 +0000 @@ -25,7 +25,7 @@ rem + DJGPP version 2.02 or later (version 2.03 or later recommended). rem + make utility that allows breaking of the 128 chars limit on rem command lines. ndmake (as of version 4.5) won't work due to a -rem line length limit. The make that comes with DJGPP does work (and is +rem line length limit. The DJGPP port of make works (and is rem recommended). rem + rm, mv, and cp (from GNU file utilities). rem + sed (you can use the port that comes with DJGPP). ------------------------------------------------------------ revno: 117679 committer: martin rudalics branch nick: trunk timestamp: Sun 2014-08-10 10:26:28 +0200 message: Fix handling of menu bar line on TTY frames (Bug#18136) (Bug#18196). * dispnew.c (handle_window_change_signal): * keyboard.c (Fsuspend_emacs): Call change_frame_size with frame's menu bar lines subtracted from height. * frame.c (frame_inhibit_resize): Inhibit resizing of TTY frames. (adjust_frame_size): Count in menu bar when setting FrameRows. (make_terminal_frame): When setting up the frame's lines and text height don't count in the menu bar. (Fmake_terminal_frame): Call adjust_frame_size with menu bar lines subtracted from height. (do_switch_frame): Set tty's FrameRows to number of total lines of frame. (Fframe_pixel_height, Fframe_pixel_width): If no window system is used, return total number of lines and columns. * menu.c (emulate_dialog_with_menu): Use FRAME_TOTAL_LINES instead of FRAME_LINES. * term.c (OUTPUT, tty_set_terminal_modes) (tty_set_terminal_window, tty_set_scroll_region) (tty_clear_to_end, tty_write_glyphs, tty_write_glyphs_with_face) (tty_ins_del_lines, tty_menu_display, tty_menu_activate): Use FRAME_TOTAL_LINES instead of FRAME_LINES. (Fresume_tty): Use FRAME_TOTAL_LINES instead of FRAME_LINES. Call change_frame_size with frame's menu bar lines subtracted from height. * w32console.c (w32con_clear_to_end, w32con_clear_frame) (w32con_ins_del_lines): Use FRAME_TOTAL_LINES instead of FRAME_LINES. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-08-09 21:50:14 +0000 +++ src/ChangeLog 2014-08-10 08:26:28 +0000 @@ -1,3 +1,35 @@ +2014-08-10 Martin Rudalics + + Fix handling of menu bar line on TTY frames (Bug#18136) + (Bug#18196). + * dispnew.c (handle_window_change_signal): + * keyboard.c (Fsuspend_emacs): Call change_frame_size with + frame's menu bar lines subtracted from height. + * frame.c (frame_inhibit_resize): Inhibit resizing of TTY + frames. + (adjust_frame_size): Count in menu bar when setting FrameRows. + (make_terminal_frame): When setting up the frame's lines and + text height don't count in the menu bar. + (Fmake_terminal_frame): Call adjust_frame_size with menu bar + lines subtracted from height. + (do_switch_frame): Set tty's FrameRows to number of total lines + of frame. + (Fframe_pixel_height, Fframe_pixel_width): If no window system + is used, return total number of lines and columns. + * menu.c (emulate_dialog_with_menu): Use FRAME_TOTAL_LINES instead + of FRAME_LINES. + * term.c (OUTPUT, tty_set_terminal_modes) + (tty_set_terminal_window, tty_set_scroll_region) + (tty_clear_to_end, tty_write_glyphs, tty_write_glyphs_with_face) + (tty_ins_del_lines, tty_menu_display, tty_menu_activate): Use + FRAME_TOTAL_LINES instead of FRAME_LINES. + (Fresume_tty): Use FRAME_TOTAL_LINES instead of FRAME_LINES. + Call change_frame_size with frame's menu bar lines subtracted + from height. + * w32console.c (w32con_clear_to_end, w32con_clear_frame) + (w32con_ins_del_lines): Use FRAME_TOTAL_LINES instead of + FRAME_LINES. + 2014-08-09 Reuben Thomas * alloc.c (Fmemory_info): Remove a stray brace. === modified file 'src/dispnew.c' --- src/dispnew.c 2014-08-03 23:16:39 +0000 +++ src/dispnew.c 2014-08-10 08:26:28 +0000 @@ -5444,7 +5444,9 @@ /* Record the new sizes, but don't reallocate the data structures now. Let that be done later outside of the signal handler. */ - change_frame_size (XFRAME (frame), width, height, 0, 1, 0, 0); + change_frame_size (XFRAME (frame), width, + height - FRAME_MENU_BAR_LINES (XFRAME (frame)), + 0, 1, 0, 0); } } } === modified file 'src/frame.c' --- src/frame.c 2014-08-04 16:47:27 +0000 +++ src/frame.c 2014-08-10 08:26:28 +0000 @@ -215,7 +215,8 @@ { return (frame_inhibit_implied_resize - || !NILP (get_frame_param (f, Qfullscreen))); + || !NILP (get_frame_param (f, Qfullscreen)) + || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)); } #if 0 @@ -563,7 +564,7 @@ /* MSDOS frames cannot PRETEND, as they change frame size by manipulating video hardware. */ if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f)) - FrameRows (FRAME_TTY (f)) = new_lines; + FrameRows (FRAME_TTY (f)) = new_lines + FRAME_TOP_MARGIN (f); } /* Assign new sizes. */ @@ -917,7 +918,9 @@ #endif FRAME_MENU_BAR_LINES (f) = NILP (Vmenu_bar_mode) ? 0 : 1; + FRAME_LINES (f) = FRAME_LINES (f) - FRAME_MENU_BAR_LINES (f); FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f); + FRAME_TEXT_HEIGHT (f) = FRAME_TEXT_HEIGHT (f) - FRAME_MENU_BAR_HEIGHT (f); /* Set the top frame to the newly created frame. */ if (FRAMEP (FRAME_TTY (f)->top_frame) @@ -1037,7 +1040,7 @@ { int width, height; get_tty_size (fileno (FRAME_TTY (f)->input), &width, &height); - adjust_frame_size (f, width, height, 5, 0); + adjust_frame_size (f, width, height - FRAME_MENU_BAR_LINES (f), 5, 0); } adjust_frame_glyphs (f); @@ -1168,8 +1171,8 @@ frame's data. */ if (FRAME_COLS (f) != FrameCols (tty)) FrameCols (tty) = FRAME_COLS (f); - if (FRAME_LINES (f) != FrameRows (tty)) - FrameRows (tty) = FRAME_LINES (f); + if (FRAME_TOTAL_LINES (f) != FrameRows (tty)) + FrameRows (tty) = FRAME_TOTAL_LINES (f); } tty->top_frame = frame; } @@ -2733,7 +2736,7 @@ return make_number (FRAME_PIXEL_HEIGHT (f)); else #endif - return make_number (FRAME_LINES (f)); + return make_number (FRAME_TOTAL_LINES (f)); } DEFUN ("frame-pixel-width", Fframe_pixel_width, @@ -2750,7 +2753,7 @@ return make_number (FRAME_PIXEL_WIDTH (f)); else #endif - return make_number (FRAME_COLS (f)); + return make_number (FRAME_TOTAL_COLS (f)); } DEFUN ("tool-bar-pixel-width", Ftool_bar_pixel_width, === modified file 'src/keyboard.c' --- src/keyboard.c 2014-08-05 05:43:35 +0000 +++ src/keyboard.c 2014-08-10 08:26:28 +0000 @@ -1868,7 +1868,7 @@ safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args) { Lisp_Object hook, fun, msgargs[4]; - + eassert (nargs == 2); hook = args[0]; fun = args[1]; @@ -10221,8 +10221,9 @@ with a window system; but suspend should be disabled in that case. */ get_tty_size (fileno (CURTTY ()->input), &width, &height); if (width != old_width || height != old_height) - change_frame_size (SELECTED_FRAME (), width, height - - FRAME_MENU_BAR_LINES (SELECTED_FRAME ()), 0, 0, 0, 0); + change_frame_size (SELECTED_FRAME (), width, + height - FRAME_MENU_BAR_LINES (SELECTED_FRAME ()), + 0, 0, 0, 0); /* Run suspend-resume-hook. */ hook = intern ("suspend-resume-hook"); === modified file 'src/menu.c' --- src/menu.c 2014-07-03 06:00:53 +0000 +++ src/menu.c 2014-08-10 08:26:28 +0000 @@ -1455,7 +1455,7 @@ their upper-left corner at the given position.) */ if (STRINGP (prompt)) x_coord -= SCHARS (prompt); - y_coord = FRAME_LINES (f); + y_coord = FRAME_TOTAL_LINES (f); } XSETFRAME (frame, f); === modified file 'src/term.c' --- src/term.c 2014-07-27 13:21:30 +0000 +++ src/term.c 2014-08-10 08:26:28 +0000 @@ -91,7 +91,7 @@ #define OUTPUT(tty, a) \ emacs_tputs ((tty), a, \ - FRAME_LINES (XFRAME (selected_frame)) - curY (tty), \ + FRAME_TOTAL_LINES (XFRAME (selected_frame)) - curY (tty), \ cmputc) #define OUTPUT1(tty, a) emacs_tputs ((tty), a, 1, cmputc) @@ -201,7 +201,7 @@ off the screen, so it won't be overwritten and lost. */ int i; current_tty = tty; - for (i = 0; i < FRAME_LINES (XFRAME (selected_frame)); i++) + for (i = 0; i < FRAME_TOTAL_LINES (XFRAME (selected_frame)); i++) cmputc ('\n'); } @@ -257,7 +257,7 @@ { struct tty_display_info *tty = FRAME_TTY (f); - tty->specified_window = size ? size : FRAME_LINES (f); + tty->specified_window = size ? size : FRAME_TOTAL_LINES (f); if (FRAME_SCROLL_REGION_OK (f)) tty_set_scroll_region (f, 0, tty->specified_window); } @@ -272,9 +272,9 @@ buf = tparam (tty->TS_set_scroll_region, 0, 0, start, stop - 1, 0, 0); else if (tty->TS_set_scroll_region_1) buf = tparam (tty->TS_set_scroll_region_1, 0, 0, - FRAME_LINES (f), start, - FRAME_LINES (f) - stop, - FRAME_LINES (f)); + FRAME_TOTAL_LINES (f), start, + FRAME_TOTAL_LINES (f) - stop, + FRAME_TOTAL_LINES (f)); else buf = tparam (tty->TS_set_window, 0, 0, start, 0, stop, FRAME_COLS (f)); @@ -446,7 +446,7 @@ } else { - for (i = curY (tty); i < FRAME_LINES (f); i++) + for (i = curY (tty); i < FRAME_TOTAL_LINES (f); i++) { cursor_to (f, i, 0); clear_end_of_line (f, FRAME_COLS (f)); @@ -748,7 +748,7 @@ since that would scroll the whole frame on some terminals. */ if (AutoWrap (tty) - && curY (tty) + 1 == FRAME_LINES (f) + && curY (tty) + 1 == FRAME_TOTAL_LINES (f) && (curX (tty) + len) == FRAME_COLS (f)) len --; if (len <= 0) @@ -820,7 +820,7 @@ since that would scroll the whole frame on some terminals. */ if (AutoWrap (tty) - && curY (tty) + 1 == FRAME_LINES (f) + && curY (tty) + 1 == FRAME_TOTAL_LINES (f) && (curX (tty) + len) == FRAME_COLS (f)) len --; if (len <= 0) @@ -1009,7 +1009,7 @@ && vpos + i >= tty->specified_window) return; if (!FRAME_MEMORY_BELOW_FRAME (f) - && vpos + i >= FRAME_LINES (f)) + && vpos + i >= FRAME_TOTAL_LINES (f)) return; if (multi) @@ -1046,7 +1046,7 @@ && FRAME_MEMORY_BELOW_FRAME (f) && n < 0) { - cursor_to (f, FRAME_LINES (f) + n, 0); + cursor_to (f, FRAME_TOTAL_LINES (f) + n, 0); clear_to_end (f); } } @@ -2405,13 +2405,14 @@ struct frame *f = XFRAME (t->display_info.tty->top_frame); int width, height; int old_height = FRAME_COLS (f); - int old_width = FRAME_LINES (f); + int old_width = FRAME_TOTAL_LINES (f); /* Check if terminal/window size has changed while the frame was suspended. */ get_tty_size (fileno (t->display_info.tty->input), &width, &height); if (width != old_width || height != old_height) - change_frame_size (f, width, height - FRAME_MENU_BAR_LINES (f), 0, 0, 0, 0); + change_frame_size (f, width, height - FRAME_MENU_BAR_LINES (f), + 0, 0, 0, 0); SET_FRAME_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1); } @@ -2894,7 +2895,7 @@ /* Don't try to display more menu items than the console can display using the available screen lines. Exclude the echo area line, as it will be overwritten by the help-echo anyway. */ - int max_items = min (menu->count - first_item, FRAME_LINES (sf) - 1 - y); + int max_items = min (menu->count - first_item, FRAME_TOTAL_LINES (sf) - 1 - y); menu_help_message = NULL; @@ -3274,7 +3275,7 @@ { mi_result input_status; int min_y = state[0].y; - int max_y = min (min_y + state[0].menu->count, FRAME_LINES (sf) - 1) - 1; + int max_y = min (min_y + state[0].menu->count, FRAME_TOTAL_LINES (sf) - 1) - 1; input_status = read_menu_input (sf, &x, &y, min_y, max_y, &first_time); if (input_status) === modified file 'src/w32console.c' --- src/w32console.c 2014-07-27 13:21:30 +0000 +++ src/w32console.c 2014-08-10 08:26:28 +0000 @@ -118,7 +118,7 @@ w32con_clear_to_end (struct frame *f) { w32con_clear_end_of_line (f, FRAME_COLS (f) - 1); - w32con_ins_del_lines (f, cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1); + w32con_ins_del_lines (f, cursor_coords.Y, FRAME_TOTAL_LINES (f) - cursor_coords.Y - 1); } /* Clear the frame. */ @@ -133,7 +133,7 @@ GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info); /* Remember that the screen buffer might be wider than the window. */ - n = FRAME_LINES (f) * info.dwSize.X; + n = FRAME_TOTAL_LINES (f) * info.dwSize.X; dest.X = dest.Y = 0; FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r); @@ -175,18 +175,18 @@ if (n < 0) { scroll.Top = vpos - n; - scroll.Bottom = FRAME_LINES (f); + scroll.Bottom = FRAME_TOTAL_LINES (f); dest.Y = vpos; } else { scroll.Top = vpos; - scroll.Bottom = FRAME_LINES (f) - n; + scroll.Bottom = FRAME_TOTAL_LINES (f) - n; dest.Y = vpos + n; } clip.Top = clip.Left = scroll.Left = 0; clip.Right = scroll.Right = FRAME_COLS (f); - clip.Bottom = FRAME_LINES (f); + clip.Bottom = FRAME_TOTAL_LINES (f); dest.X = 0; ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.