Now on revision 108232. ------------------------------------------------------------ revno: 108232 [merge] committer: Stefan Merten branch nick: trunk timestamp: Mon 2012-05-14 22:39:14 +0200 message: (rst-re-alist): Fix loading (bug#11462). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-05-14 16:11:24 +0000 +++ lisp/ChangeLog 2012-05-14 20:39:14 +0000 @@ -1,3 +1,7 @@ +2012-05-14 Stefan Merten + + * textmodes/rst.el (rst-re-alist): Fix loading (bug#11462). + 2012-05-14 Stefan Monnier * net/rlogin.el (rlogin-mode-map): Fix last change. === modified file 'lisp/textmodes/rst.el' --- lisp/textmodes/rst.el 2012-05-09 00:57:18 +0000 +++ lisp/textmodes/rst.el 2012-05-14 09:31:08 +0000 @@ -422,17 +422,6 @@ Each entry consists of the symbol naming the regex and an argument list for `rst-re'.") -(defconst rst-re-alist - ;; Shadow global value we are just defining so we can construct it step by - ;; step - (let (rst-re-alist) - (dolist (re rst-re-alist-def) - (setq rst-re-alist - (nconc rst-re-alist - (list (list (car re) (apply 'rst-re (cdr re))))))) - rst-re-alist) - "Alist mapping symbols from `rst-re-alist-def' to regex strings.") - ;; FIXME: Use `sregex` or `rx` instead of re-inventing the wheel (defun rst-re (&rest args) "Interpret ARGS as regular expressions and return a regex string. @@ -492,6 +481,18 @@ (error "Unknown object type for building regex: %s" re)))) args))) +;; FIXME: Remove circular dependency between `rst-re' and `rst-re-alist'. +(defconst rst-re-alist + ;; Shadow global value we are just defining so we can construct it step by + ;; step + (let (rst-re-alist) + (dolist (re rst-re-alist-def) + (setq rst-re-alist + (nconc rst-re-alist + (list (list (car re) (apply 'rst-re (cdr re))))))) + rst-re-alist) + "Alist mapping symbols from `rst-re-alist-def' to regex strings.") + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Mode definition. ------------------------------------------------------------ revno: 108231 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-05-14 09:33:11 -0700 message: Make a self-contained ns build able to find its own libexec directory Ref: http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00298.html * src/nsterm.m (ns_init_paths): Put "libexec" before "bin", for the sake of init_callproc_1. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-05-14 16:23:11 +0000 +++ src/ChangeLog 2012-05-14 16:33:11 +0000 @@ -1,6 +1,7 @@ 2012-05-14 Glenn Morris * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec"). + Put "libexec" before "bin", for the sake of init_callproc_1. 2012-05-14 Paul Eggert === modified file 'src/nsterm.m' --- src/nsterm.m 2012-05-14 16:23:11 +0000 +++ src/nsterm.m 2012-05-14 16:33:11 +0000 @@ -338,11 +338,18 @@ /*NSLog (@"loadPath: '%@'\n", resourcePaths); */ } + /* Normally, Emacs does not add its own bin/ directory to the PATH. + However, a self-contained NS build has a different layout, with + bin/ and libexec/ subdirectories in the directory that contains + Emacs.app itself. + We put libexec first, because init_callproc_1 uses the first + element to initialize exec-directory. An alternative would be + for init_callproc to check for invocation-directory/libexec. */ if (!getenv ("EMACSPATH")) { NSArray *paths = [binDir stringsByAppendingPaths: - [NSArray arrayWithObjects: @"bin", - @"libexec", nil]]; + [NSArray arrayWithObjects: @"libexec", + @"bin", nil]]; NSEnumerator *pathEnum = [paths objectEnumerator]; resourcePaths = @""; while (resourcePath = [pathEnum nextObject]) ------------------------------------------------------------ revno: 108230 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-05-14 09:23:11 -0700 message: * src/nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec"). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-05-14 15:22:29 +0000 +++ src/ChangeLog 2012-05-14 16:23:11 +0000 @@ -1,3 +1,7 @@ +2012-05-14 Glenn Morris + + * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec"). + 2012-05-14 Paul Eggert * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local. === modified file 'src/nsterm.m' --- src/nsterm.m 2012-04-09 10:01:04 +0000 +++ src/nsterm.m 2012-05-14 16:23:11 +0000 @@ -342,7 +342,7 @@ { NSArray *paths = [binDir stringsByAppendingPaths: [NSArray arrayWithObjects: @"bin", - @"lib-exec", nil]]; + @"libexec", nil]]; NSEnumerator *pathEnum = [paths objectEnumerator]; resourcePaths = @""; while (resourcePath = [pathEnum nextObject]) ------------------------------------------------------------ revno: 108229 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-05-14 09:11:24 -0700 message: ChangeLog merge fixes diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-05-14 11:59:28 +0000 +++ doc/misc/ChangeLog 2012-05-14 16:11:24 +0000 @@ -1,4 +1,4 @@ -2012-05-12 Andreas Schwab +2012-05-14 Andreas Schwab * cc-mode.texi: Avoid space before macro in 4th argument of cross reference commands. (Bug#11461) === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-05-14 11:59:28 +0000 +++ lisp/ChangeLog 2012-05-14 16:11:24 +0000 @@ -1,9 +1,3 @@ -2012-05-14 Troels Nielsen (tiny change) - - * progmodes/compile.el (compilation-internal-error-properties): - Calculate start position correctly when end-col is set but - end-line is not (Bug#11382). - 2012-05-14 Stefan Monnier * net/rlogin.el (rlogin-mode-map): Fix last change. ------------------------------------------------------------ revno: 108228 committer: Julien Danjou branch nick: trunk timestamp: Mon 2012-05-14 17:42:23 +0200 message: Fix a regression in erc-dcc * erc-dcc.el (erc-dcc-handle-ctcp-send): Fix a regression introduced on 2011-11-28 when fixing quoted filenames matching, the regex group was not corrected. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2012-05-13 18:51:14 +0000 +++ lisp/erc/ChangeLog 2012-05-14 15:42:23 +0000 @@ -1,3 +1,9 @@ +2012-05-14 Mike Kazantsev (tiny change) + + * erc-dcc.el (erc-dcc-handle-ctcp-send): Fix a regression + introduced on 2011-11-28 when fixing quoted filenames matching, + the regex group was not corrected. + 2012-05-13 Teemu Likonen * erc-backend.el (erc-server-timestamp-format): New variable to === modified file 'lisp/erc/erc-dcc.el' --- lisp/erc/erc-dcc.el 2012-04-09 13:05:48 +0000 +++ lisp/erc/erc-dcc.el 2012-05-14 15:42:23 +0000 @@ -674,7 +674,7 @@ ?r "SEND" ?n nick ?u login ?h host)) ((string-match erc-dcc-ctcp-query-send-regexp query) (let ((filename - (or (match-string 3 query) + (or (match-string 5 query) (erc-dcc-unquote-filename (match-string 2 query)))) (ip (erc-decimal-to-ip (match-string 6 query))) (port (match-string 7 query)) ------------------------------------------------------------ revno: 108227 committer: Paul Eggert branch nick: trunk timestamp: Mon 2012-05-14 08:22:29 -0700 message: * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-05-14 15:11:10 +0000 +++ src/ChangeLog 2012-05-14 15:22:29 +0000 @@ -1,5 +1,7 @@ 2012-05-14 Paul Eggert + * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local. + * unexaix.c: Port to more-recent AIX compilers. (report_error, report_error_1, make_hdr, copy_sym) (mark_x, adjust_lnnoptrs, unrelocate_symbols): === modified file 'src/keyboard.c' --- src/keyboard.c 2012-05-14 07:05:03 +0000 +++ src/keyboard.c 2012-05-14 15:22:29 +0000 @@ -3786,7 +3786,6 @@ int *used_mouse_menu, struct timeval *end_time) { - register int c; Lisp_Object obj; #ifdef subprocesses @@ -3809,7 +3808,7 @@ detaching from the terminal. */ || (IS_DAEMON && daemon_pipe[1] >= 0)) { - c = getchar (); + int c = getchar (); XSETINT (obj, c); *kbp = current_kboard; return obj; ------------------------------------------------------------ revno: 108226 committer: Paul Eggert branch nick: trunk timestamp: Mon 2012-05-14 08:11:10 -0700 message: * unexaix.c: Port to more-recent AIX compilers. (report_error, report_error_1, make_hdr, copy_sym) (mark_x, adjust_lnnoptrs, unrelocate_symbols): Make arguments const char *, not char *, to avoid violations of C standard and to fix some AIX warnings reported by Gilles Pion. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-05-14 11:59:28 +0000 +++ src/ChangeLog 2012-05-14 15:11:10 +0000 @@ -1,3 +1,11 @@ +2012-05-14 Paul Eggert + + * unexaix.c: Port to more-recent AIX compilers. + (report_error, report_error_1, make_hdr, copy_sym) + (mark_x, adjust_lnnoptrs, unrelocate_symbols): + Make arguments const char *, not char *, to avoid violations of C + standard and to fix some AIX warnings reported by Gilles Pion. + 2012-05-14 Eli Zaretskii * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we === modified file 'src/unexaix.c' --- src/unexaix.c 2012-05-09 19:44:19 +0000 +++ src/unexaix.c 2012-05-14 15:11:10 +0000 @@ -78,13 +78,13 @@ static long load_scnptr; static long orig_load_scnptr; static long orig_data_scnptr; -static int unrelocate_symbols (int, int, char *, char *); +static int unrelocate_symbols (int, int, const char *, const char *); #ifndef MAX_SECTIONS #define MAX_SECTIONS 10 #endif -static int adjust_lnnoptrs (int, int, char *); +static int adjust_lnnoptrs (int, int, const char *); static int pagemask; @@ -92,7 +92,7 @@ #include "lisp.h" static void -report_error (char *file, int fd) +report_error (const char *file, int fd) { if (fd) close (fd); @@ -104,16 +104,16 @@ #define ERROR2(msg,x,y) report_error_1 (new, msg, x, y); return -1 static void -report_error_1 (int fd, char *msg, int a1, int a2) +report_error_1 (int fd, const char *msg, int a1, int a2) { close (fd); error (msg, a1, a2); } -static int make_hdr (int, int, char *, char *); -static void mark_x (char *); +static int make_hdr (int, int, const char *, const char *); +static void mark_x (const char *); static int copy_text_and_data (int); -static int copy_sym (int, int, char *, char *); +static int copy_sym (int, int, const char *, const char *); static void write_segment (int, char *, char *); /* **************************************************************** @@ -159,7 +159,7 @@ */ static int make_hdr (int new, int a_out, - char *a_name, char *new_name) + const char *a_name, const char *new_name) { int scns; unsigned int bss_start; @@ -429,7 +429,7 @@ * Copy the relocation information and symbol table from the a.out to the new */ static int -copy_sym (int new, int a_out, char *a_name, char *new_name) +copy_sym (int new, int a_out, const char *a_name, const char *new_name) { char page[UnexBlockSz]; int n; @@ -465,7 +465,7 @@ * After successfully building the new a.out, mark it executable */ static void -mark_x (char *name) +mark_x (const char *name) { struct stat sbuf; int um; @@ -483,7 +483,7 @@ } static int -adjust_lnnoptrs (int writedesc, int readdesc, char *new_name) +adjust_lnnoptrs (int writedesc, int readdesc, const char *new_name) { int nsyms; int naux; @@ -530,7 +530,8 @@ } static int -unrelocate_symbols (int new, int a_out, char *a_name, char *new_name) +unrelocate_symbols (int new, int a_out, + const char *a_name, const char *new_name) { int i; LDHDR ldhdr; ------------------------------------------------------------ revno: 108225 [merge] committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-05-14 20:05:11 +0800 message: Merge from emacs-24; up to r107994 diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-05-12 18:03:18 +0000 +++ doc/misc/ChangeLog 2012-05-14 11:59:28 +0000 @@ -1,3 +1,10 @@ +2012-05-12 Andreas Schwab + + * cc-mode.texi: Avoid space before macro in 4th argument of cross + reference commands. (Bug#11461) + + * Makefile.in (gnus.dvi): Use $@ instead of $*.dvi. + 2012-05-12 Glenn Morris * Makefile.in (mostlyclean): Add more TeX intermediates. === modified file 'doc/misc/Makefile.in' --- doc/misc/Makefile.in 2012-05-12 18:04:06 +0000 +++ doc/misc/Makefile.in 2012-05-14 11:59:28 +0000 @@ -415,7 +415,7 @@ gnus.dvi: ${srcdir}/gnus.texi ${srcdir}/gnus-faq.texi sed -e '/@iflatex/,/@end iflatex/d' ${srcdir}/gnus.texi > gnustmp.texi $(ENVADD) $(TEXI2DVI) gnustmp.texi - cp gnustmp.dvi $*.dvi + cp gnustmp.dvi $@ rm gnustmp.* gnus.pdf: ${srcdir}/gnus.texi ${srcdir}/gnus-faq.texi sed -e '/@iflatex/,/@end iflatex/d' ${srcdir}/gnus.texi > gnustmp.texi === modified file 'doc/misc/cc-mode.texi' --- doc/misc/cc-mode.texi 2012-04-11 15:24:20 +0000 +++ doc/misc/cc-mode.texi 2012-05-12 19:00:30 +0000 @@ -701,7 +701,7 @@ precisely what sort of ``whitespace'' this will be. Set the standard Emacs variable @code{indent-tabs-mode} to @code{t} if you want real @samp{tab} characters to be used in the indentation, to @code{nil} if -you want only spaces. @xref{Just Spaces,,, @emacsman{}, +you want only spaces. @xref{Just Spaces,,,@emacsman{}, @emacsmantitle{}}. @defopt c-tab-always-indent @@ -1058,8 +1058,8 @@ @cindex Auto Fill mode @cindex paragraph filling Line breaks are by default handled (almost) the same regardless of -whether they are made by auto fill mode (@pxref{Auto Fill,,, -@emacsman{}, @emacsmantitle{}}), by paragraph filling (e.g. with +whether they are made by auto fill mode (@pxref{Auto +Fill,,,@emacsman{}, @emacsmantitle{}}), by paragraph filling (e.g. with @kbd{M-q}), or explicitly with @kbd{M-j} or similar methods. In string literals, the new line gets the same indentation as the previous nonempty line.@footnote{You can change this default by @@ -1402,7 +1402,7 @@ @vindex abbrev-mode @findex abbrev-mode @cindex Abbrev mode -@ccmode{} uses Abbrev mode (@pxref{Abbrevs,,, @emacsman{}, @emacsmantitle{}}) +@ccmode{} uses Abbrev mode (@pxref{Abbrevs,,,@emacsman{}, @emacsmantitle{}}) to accomplish this. It's therefore turned on by default in all language modes except IDL mode, since CORBA IDL doesn't have any statements. @end deffn @@ -2295,14 +2295,14 @@ A @dfn{file local variable setting} is a setting which applies to an individual source file. You put this in a @dfn{local variables list}, a special block at the end of the source file (@pxref{Specifying File -Variables,,, @emacsman{}}). +Variables,,,@emacsman{}}). @item File Styles A @dfn{file style} is a rarely used variant of the ``style'' mechanism described above, which applies to an individual source file. @xref{File Styles}. You use this by setting certain special variables -in a local variables list (@pxref{Specifying File Variables,,, -@emacsman{}}). +in a local variables list (@pxref{Specifying File +Variables,,,@emacsman{}}). @item Hooks with Styles For ultimate flexibility, you can use hooks and styles together. For @@ -2897,7 +2897,7 @@ The Emacs manual describes how you can customize certain variables on a per-file basis by including a @dfn{file local variable} block at the end -of the file (@pxref{File Variables,, Local Variables in Files, @emacsman{}, +of the file (@pxref{File Variables,, Local Variables in Files,@emacsman{}, @emacsmantitle{}}). So far, you've only seen a functional interface for setting styles in @@ -3139,8 +3139,9 @@ @end defopt @vindex comment-multi-line -If inside a comment and @code{comment-multi-line} (@pxref{Auto Fill,,, -@emacsman{}, @emacsmantitle{}} is non-@code{nil}, the indentation and +If inside a comment and @code{comment-multi-line} (@pxref{Auto +Fill,,,@emacsman{}, @emacsmantitle{}} is non-@code{nil}, the +indentation and line prefix are preserved. If inside a comment and @code{comment-multi-line} is @code{nil}, a new comment of the same type is started on the next line and indented as appropriate for @@ -6771,7 +6772,7 @@ Controls whether a final newline is enforced when the file is saved. The value is an association list that for each language mode specifies the value to give to @code{require-final-newline} (@pxref{Saving -Buffers,,, @lispref{}, @lispreftitle{}}) at mode initialization. If a +Buffers,,,@lispref{}, @lispreftitle{}}) at mode initialization. If a language isn't present on the association list, CC Mode won't touch @code{require-final-newline} in buffers for that language. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-05-14 05:19:46 +0000 +++ lisp/ChangeLog 2012-05-14 11:59:28 +0000 @@ -1,6 +1,28 @@ +2012-05-14 Troels Nielsen (tiny change) + + * progmodes/compile.el (compilation-internal-error-properties): + Calculate start position correctly when end-col is set but + end-line is not (Bug#11382). + +2012-05-14 Stefan Monnier + + * net/rlogin.el (rlogin-mode-map): Fix last change. + +2012-05-14 Jason L. Wright (tiny change) + + * mail/smtpmail.el (smtpmail-send-command): Send the command and + the following \r\n using a single `process-send-string', since the + Lotus SMTP server refuses to accept any commands if they are sent + with two `process-send-string's (Bug#11444). + +2012-05-14 Stefan Monnier + + * shell.el (shell-parse-pcomplete-arguments): Obey + pcomplete-arg-quote-list inside double-quoted args (Bug#11348). + 2012-05-14 Wolfgang Jenkner - * image-mode.el: Fit to width/height for rotated images (bug#11431). + * image-mode.el: Fit to width/height for rotated images (Bug#11431). (image-transform-scale, image-transform-right-angle-fudge): New vars. (image-transform-width, image-transform-fit-width): New functions. (image-transform-properties): Use them. === modified file 'lisp/mail/smtpmail.el' --- lisp/mail/smtpmail.el 2012-03-09 11:06:44 +0000 +++ lisp/mail/smtpmail.el 2012-05-09 19:12:20 +0000 @@ -932,8 +932,7 @@ (insert (match-string 0 command) "\r\n") (insert command "\r\n")) (setq smtpmail-read-point (point)) - (process-send-string process command) - (process-send-string process "\r\n")) + (process-send-string process (concat command "\r\n"))) (defun smtpmail-send-data-1 (process data) (goto-char (point-max)) === modified file 'lisp/net/rlogin.el' --- lisp/net/rlogin.el 2012-01-19 07:21:25 +0000 +++ lisp/net/rlogin.el 2012-05-11 12:40:43 +0000 @@ -114,12 +114,12 @@ (let ((map (if (consp shell-mode-map) (cons 'keymap shell-mode-map) (copy-keymap shell-mode-map)))) - (define-key rlogin-mode-map "\C-c\C-c" 'rlogin-send-Ctrl-C) - (define-key rlogin-mode-map "\C-c\C-d" 'rlogin-send-Ctrl-D) - (define-key rlogin-mode-map "\C-c\C-z" 'rlogin-send-Ctrl-Z) - (define-key rlogin-mode-map "\C-c\C-\\" 'rlogin-send-Ctrl-backslash) - (define-key rlogin-mode-map "\C-d" 'rlogin-delchar-or-send-Ctrl-D) - (define-key rlogin-mode-map "\C-i" 'rlogin-tab-or-complete) + (define-key map "\C-c\C-c" 'rlogin-send-Ctrl-C) + (define-key map "\C-c\C-d" 'rlogin-send-Ctrl-D) + (define-key map "\C-c\C-z" 'rlogin-send-Ctrl-Z) + (define-key map "\C-c\C-\\" 'rlogin-send-Ctrl-backslash) + (define-key map "\C-d" 'rlogin-delchar-or-send-Ctrl-D) + (define-key map "\C-i" 'rlogin-tab-or-complete) map) "Keymap for `rlogin-mode'.") === modified file 'lisp/shell.el' --- lisp/shell.el 2012-05-08 00:27:13 +0000 +++ lisp/shell.el 2012-05-09 17:20:24 +0000 @@ -400,8 +400,9 @@ (t (match-string 3))) arg)) ((match-beginning 2) ;Double quote. - (push (replace-regexp-in-string - "\\\\\\(.\\)" "\\1" (match-string 2)) + (push (if (null pcomplete-arg-quote-list) (match-string 2) + (replace-regexp-in-string + "\\\\\\(.\\)" "\\1" (match-string 2))) arg)) ((match-beginning 1) ;Single quote. (push (match-string 1) arg)) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-05-14 07:05:03 +0000 +++ src/ChangeLog 2012-05-14 11:59:28 +0000 @@ -1,3 +1,38 @@ +2012-05-14 Eli Zaretskii + + * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we + already have overlays loaded. + (handle_single_display_spec): Before returning without displaying + fringe bitmap, synchronize the bidi iterator with the main display + iterator, by calling iterate_out_of_display_property. + (iterate_out_of_display_property): Detect buffer iteration by + testing that it->string is a Lisp string. + (get_next_display_element): When the current object is exhausted, + and there's something on it->stack, call set_iterator_to_next to + proceed with what's on the stack, instead of returning zero. + (set_iterator_to_next): If called at the end of a Lisp string, + proceed to consider_string_end without incrementing string + position. Don't increment display vector index past the end of + the display vector. (Bug#11417) + (pos_visible_p): Don't report a position visible when move_it_to + stopped at the last line of window, which happens to be scanned + backwards by the bidi iteration. (Bug#11464) + +2012-05-14 Eli Zaretskii + + * xdisp.c (handle_single_display_spec): Return 1 for left-margin + and right-margin display specs even if the spec is invalid or we + are on a TTY, and thus unable to display on the fringes. That's + because the text with the property will not be displayed anyway, + so we need to signal to the caller that this is a "replacing" + display spec. This fixes display when the spec is invalid or we + are on a TTY. + +2012-05-14 Paul Eggert + + * unexaix.c (make_hdr): Fix typo in prototype. + This bug broke the build on AIX. Problem reported by Gilles Pion. + 2012-05-14 Michael Albinus * keyboard.c (kbd_buffer_get_event): Read special events also in === modified file 'src/unexaix.c' --- src/unexaix.c 2012-01-19 07:21:25 +0000 +++ src/unexaix.c 2012-05-09 19:44:19 +0000 @@ -110,7 +110,7 @@ error (msg, a1, a2); } -static int make_hdr (int, int, unsigned, unsigned, unsigned, char *, char *); +static int make_hdr (int, int, char *, char *); static void mark_x (char *); static int copy_text_and_data (int); static int copy_sym (int, int, char *, char *); === modified file 'src/xdisp.c' --- src/xdisp.c 2012-05-11 06:39:26 +0000 +++ src/xdisp.c 2012-05-14 11:59:28 +0000 @@ -849,6 +849,7 @@ static int trailing_whitespace_p (EMACS_INT); static intmax_t message_log_check_duplicate (EMACS_INT, EMACS_INT); static void push_it (struct it *, struct text_pos *); +static void iterate_out_of_display_property (struct it *); static void pop_it (struct it *); static void sync_frame_with_window_matrix_rows (struct window *); static void select_frame_for_redisplay (Lisp_Object); @@ -1313,8 +1314,8 @@ glyph. */ int top_x = it.current_x; int top_y = it.current_y; + /* Calling line_bottom_y may change it.method, it.position, etc. */ enum it_method it_method = it.method; - /* Calling line_bottom_y may change it.method, it.position, etc. */ int bottom_y = (last_height = 0, line_bottom_y (&it)); int window_top_y = WINDOW_HEADER_LINE_HEIGHT (w); @@ -1322,6 +1323,31 @@ visible_p = bottom_y > window_top_y; else if (top_y < it.last_visible_y) visible_p = 1; + if (bottom_y >= it.last_visible_y + && it.bidi_p && it.bidi_it.scan_dir == -1 + && IT_CHARPOS (it) < charpos) + { + /* When the last line of the window is scanned backwards + under bidi iteration, we could be duped into thinking + that we have passed CHARPOS, when in fact move_it_to + simply stopped short of CHARPOS because it reached + last_visible_y. To see if that's what happened, we call + move_it_to again with a slightly larger vertical limit, + and see if it actually moved vertically; if it did, we + didn't really reach CHARPOS, which is beyond window end. */ + struct it save_it = it; + /* Why 10? because we don't know how many canonical lines + will the height of the next line(s) be. So we guess. */ + int ten_more_lines = + 10 * FRAME_LINE_HEIGHT (XFRAME (WINDOW_FRAME (w))); + + move_it_to (&it, charpos, -1, bottom_y + ten_more_lines, -1, + MOVE_TO_POS | MOVE_TO_Y); + if (it.current_y > top_y) + visible_p = 0; + + it = save_it; + } if (visible_p) { if (it_method == GET_FROM_DISPLAY_VECTOR) @@ -3135,7 +3161,15 @@ overlays even if the actual buffer text is replaced. */ if (!handle_overlay_change_p || it->sp > 1 - || !get_overlay_strings_1 (it, 0, 0)) + /* Don't call get_overlay_strings_1 if we already + have overlay strings loaded, because doing so + will load them again and push the iterator state + onto the stack one more time, which is not + expected by the rest of the code that processes + overlay strings. */ + || (it->n_overlay_strings <= 0 + ? !get_overlay_strings_1 (it, 0, 0) + : 0)) { if (it->ellipsis_p) setup_for_ellipsis (it, 0); @@ -4691,10 +4725,22 @@ if (!FRAME_WINDOW_P (it->f)) /* If we return here, POSITION has been advanced across the text with this property. */ - return 0; + { + /* Synchronize the bidi iterator with POSITION. This is + needed because we are not going to push the iterator + on behalf of this display property, so there will be + no pop_it call to do this synchronization for us. */ + if (it->bidi_p) + { + it->position = *position; + iterate_out_of_display_property (it); + *position = it->position; + } + return 1; + } } else if (!frame_window_p) - return 0; + return 1; #ifdef HAVE_WINDOW_SYSTEM value = XCAR (XCDR (spec)); @@ -4702,7 +4748,15 @@ || !(fringe_bitmap = lookup_fringe_bitmap (value))) /* If we return here, POSITION has been advanced across the text with this property. */ - return 0; + { + if (it && it->bidi_p) + { + it->position = *position; + iterate_out_of_display_property (it); + *position = it->position; + } + return 1; + } if (it) { @@ -5621,7 +5675,7 @@ static void iterate_out_of_display_property (struct it *it) { - int buffer_p = BUFFERP (it->object); + int buffer_p = !STRINGP (it->string); EMACS_INT eob = (buffer_p ? ZV : it->end_charpos); EMACS_INT bob = (buffer_p ? BEGV : 0); @@ -6790,6 +6844,16 @@ && FACE_FROM_ID (it->f, face_id)->box == FACE_NO_BOX); } } + /* If we reached the end of the object we've been iterating (e.g., a + display string or an overlay string), and there's something on + IT->stack, proceed with what's on the stack. It doesn't make + sense to return zero if there's unprocessed stuff on the stack, + because otherwise that stuff will never be displayed. */ + if (!success_p && it->sp > 0) + { + set_iterator_to_next (it, 0); + success_p = get_next_display_element (it); + } /* Value is 0 if end of buffer or string reached. */ return success_p; @@ -6971,7 +7035,7 @@ display vector entry (these entries may contain faces). */ it->face_id = it->saved_face_id; - if (it->dpvec + it->current.dpvec_index == it->dpend) + if (it->dpvec + it->current.dpvec_index >= it->dpend) { int recheck_faces = it->ellipsis_p; @@ -7009,6 +7073,26 @@ case GET_FROM_STRING: /* Current display element is a character from a Lisp string. */ xassert (it->s == NULL && STRINGP (it->string)); + /* Don't advance past string end. These conditions are true + when set_iterator_to_next is called at the end of + get_next_display_element, in which case the Lisp string is + already exhausted, and all we want is pop the iterator + stack. */ + if (it->current.overlay_string_index >= 0) + { + /* This is an overlay string, so there's no padding with + spaces, and the number of characters in the string is + where the string ends. */ + if (IT_STRING_CHARPOS (*it) >= SCHARS (it->string)) + goto consider_string_end; + } + else + { + /* Not an overlay string. There could be padding, so test + against it->end_charpos . */ + if (IT_STRING_CHARPOS (*it) >= it->end_charpos) + goto consider_string_end; + } if (it->cmp_it.id >= 0) { int i; ------------------------------------------------------------ revno: 108224 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Mon 2012-05-14 09:56:04 +0200 message: Make URL redirection work again. The previous changes would make redirection fail, since the expansion would end up with URLs that looked like "http:www.bing.com/hello". * url-expand.el (url-default-expander): Copy over the fullness of the new URL object based on the definition URL object. diff: === modified file 'lisp/url/ChangeLog' --- lisp/url/ChangeLog 2012-05-10 06:27:12 +0000 +++ lisp/url/ChangeLog 2012-05-14 07:56:04 +0000 @@ -1,3 +1,8 @@ +2012-05-14 Lars Magne Ingebrigtsen + + * url-expand.el (url-default-expander): Copy over the fullness of + the new URL object based on the definition URL object. + 2012-05-10 Chong Yidong * url-parse.el (url-path-and-query, url-port-if-non-default): New === modified file 'lisp/url/url-expand.el' --- lisp/url/url-expand.el 2012-01-19 07:21:25 +0000 +++ lisp/url/url-expand.el 2012-05-14 07:56:04 +0000 @@ -116,13 +116,17 @@ (setf (url-port urlobj) (or (url-port urlobj) (and (string= (url-type urlobj) (url-type defobj)) - (url-port defobj)))) + (url-port defobj)))) (if (not (string= "file" (url-type urlobj))) (setf (url-host urlobj) (or (url-host urlobj) (url-host defobj)))) (if (string= "ftp" (url-type urlobj)) (setf (url-user urlobj) (or (url-user urlobj) (url-user defobj)))) (if (string= (url-filename urlobj) "") (setf (url-filename urlobj) "/")) + ;; If the object we're expanding from is full, then we are now + ;; full. + (unless (url-fullness urlobj) + (setf (url-fullness urlobj) (url-fullness defobj))) (if (string-match "^/" (url-filename urlobj)) nil (let ((query nil) ------------------------------------------------------------ revno: 108223 committer: Michael Albinus branch nick: trunk timestamp: Mon 2012-05-14 09:05:03 +0200 message: * keyboard.c (kbd_buffer_get_event): Read special events also in batch mode. (Bug#11415) diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-05-12 18:10:37 +0000 +++ src/ChangeLog 2012-05-14 07:05:03 +0000 @@ -1,3 +1,8 @@ +2012-05-14 Michael Albinus + + * keyboard.c (kbd_buffer_get_event): Read special events also in + batch mode. (Bug#11415) + 2012-05-12 Glenn Morris * ns.mk: Update for ns_appbindir no longer having trailing "/". === modified file 'src/keyboard.c' --- src/keyboard.c 2012-05-07 16:09:51 +0000 +++ src/keyboard.c 2012-05-14 07:05:03 +0000 @@ -3803,6 +3803,7 @@ } #endif /* subprocesses */ +#ifndef HAVE_DBUS /* We want to read D-Bus events in batch mode. */ if (noninteractive /* In case we are running as a daemon, only do this before detaching from the terminal. */ @@ -3813,6 +3814,7 @@ *kbp = current_kboard; return obj; } +#endif /* ! HAVE_DBUS */ /* Wait until there is input available. */ for (;;) ------------------------------------------------------------ revno: 108222 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11431 author: Wolfgang Jenkner committer: Stefan Monnier branch nick: trunk timestamp: Mon 2012-05-14 01:19:46 -0400 message: * lisp/image-mode.el: Fit to width/height for rotated images. (image-transform-scale, image-transform-right-angle-fudge): New vars. (image-transform-width, image-transform-fit-width): New functions. (image-transform-properties): Use them. (image-transform-check-size): New function. (image-toggle-display-image): Use it (for testing). (image-transform-set-rotation): Reduce angle mod 360. Delete obsolete comment. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-05-14 05:15:59 +0000 +++ lisp/ChangeLog 2012-05-14 05:19:46 +0000 @@ -1,5 +1,16 @@ 2012-05-14 Wolfgang Jenkner + * image-mode.el: Fit to width/height for rotated images (bug#11431). + (image-transform-scale, image-transform-right-angle-fudge): New vars. + (image-transform-width, image-transform-fit-width): New functions. + (image-transform-properties): Use them. + (image-transform-check-size): New function. + (image-toggle-display-image): Use it (for testing). + (image-transform-set-rotation): Reduce angle mod 360. + Delete obsolete comment. + +2012-05-14 Wolfgang Jenkner + * image-mode.el: Fix scaling (bug#11399). (image-transform-resize): Doc fix. (image-transform-properties): Default scale is 1 and height should === modified file 'lisp/image-mode.el' --- lisp/image-mode.el 2012-05-14 05:15:59 +0000 +++ lisp/image-mode.el 2012-05-14 05:19:46 +0000 @@ -532,6 +532,7 @@ (setq image-type type) (if (eq major-mode 'image-mode) (setq mode-name (format "Image[%s]" type))) + (image-transform-check-size) (if (called-interactively-p 'any) (message "Repeat this command to go back to displaying the file as text")))) @@ -636,9 +637,122 @@ - `fit-width', meaning to fit the image to the window width. - A number, which is a scale factor (the default size is 1).") +(defvar image-transform-scale 1.0 + "The scale factor of the image being displayed.") + (defvar image-transform-rotation 0.0 "Rotation angle for the image in the current Image mode buffer.") +(defvar image-transform-right-angle-fudge 0.0001 + "Snap distance to a multiple of a right angle. +There's no deep theory behind the default value, it should just +be somewhat larger than ImageMagick's MagickEpsilon.") + +(defsubst image-transform-width (width height) + "Return the bounding box width of a rotated WIDTH x HEIGHT rectangle. +The rotation angle is the value of `image-transform-rotation' in degrees." + (let ((angle (degrees-to-radians image-transform-rotation))) + ;; Assume, w.l.o.g., that the vertices of the rectangle have the + ;; coordinates (+-w/2, +-h/2) and that (0, 0) is the center of the + ;; rotation by the angle A. The projections onto the first axis + ;; of the vertices of the rotated rectangle are +- (w/2) cos A +- + ;; (h/2) sin A, and the difference between the largest and the + ;; smallest of the four values is the expression below. + (+ (* width (abs (cos angle))) (* height (abs (sin angle)))))) + +;; The following comment and code snippet are from +;; ImageMagick-6.7.4-4/magick/distort.c + +;; /* Set the output image geometry to calculated 'bestfit'. +;; Yes this tends to 'over do' the file image size, ON PURPOSE! +;; Do not do this for DePolar which needs to be exact for virtual tiling. +;; */ +;; if ( fix_bounds ) { +;; geometry.x = (ssize_t) floor(min.x-0.5); +;; geometry.y = (ssize_t) floor(min.y-0.5); +;; geometry.width=(size_t) ceil(max.x-geometry.x+0.5); +;; geometry.height=(size_t) ceil(max.y-geometry.y+0.5); +;; } + +;; Other parts of the same file show that here the origin is in the +;; left lower corner of the image rectangle, the center of the +;; rotation is the center of the rectangle and min.x and max.x +;; (resp. min.y and max.y) are the smallest and the largest of the +;; projections of the vertices onto the first (resp. second) axis. + +(defun image-transform-fit-width (width height length) + "Return (w . h) so that a rotated w x h image has exactly width LENGTH. +The rotation angle is the value of `image-transform-rotation'. +Write W for WIDTH and H for HEIGHT. Then the w x h rectangle is +an \"approximately uniformly\" scaled W x H rectangle, which +currently means that w is one of floor(s W) + {0, 1, -1} and h is +floor(s H), where s can be recovered as the value of `image-transform-scale'. +The value of `image-transform-rotation' may be replaced by +a slightly different angle. Currently this is done for values +close to a multiple of 90, see `image-transform-right-angle-fudge'." + (cond ((< (abs (- (mod (+ image-transform-rotation 90) 180) 90)) + image-transform-right-angle-fudge) + (assert (not (zerop width)) t) + (setq image-transform-rotation + (float (round image-transform-rotation)) + image-transform-scale (/ (float length) width)) + (cons length nil)) + ((< (abs (- (mod (+ image-transform-rotation 45) 90) 45)) + image-transform-right-angle-fudge) + (assert (not (zerop height)) t) + (setq image-transform-rotation + (float (round image-transform-rotation)) + image-transform-scale (/ (float length) height)) + (cons nil length)) + (t + (assert (not (and (zerop width) (zerop height))) t) + (setq image-transform-scale + (/ (float (1- length)) (image-transform-width width height))) + ;; Assume we have a w x h image and an angle A, and let l = + ;; l(w, h) = w |cos A| + h |sin A|, which is the actual width + ;; of the bounding box of the rotated image, as calculated by + ;; `image-transform-width'. The code snippet quoted above + ;; means that ImageMagick puts the rotated image in + ;; a bounding box of width L = 2 ceil((w+l+1)/2) - w. + ;; Elementary considerations show that this is equivalent to + ;; L - w being even and L-3 < l(w, h) <= L-1. In our case, L is + ;; the given `length' parameter and our job is to determine + ;; reasonable values for w and h which satisfy these + ;; conditions. + (let ((w (floor (* image-transform-scale width))) + (h (floor (* image-transform-scale height)))) + ;; Let w and h as bound above. Then l(w, h) <= l(s W, s H) + ;; = L-1 < l(w+1, h+1) = l(w, h) + l(1, 1) <= l(w, h) + 2, + ;; hence l(w, h) > (L-1) - 2 = L-3. + (cons + (cond ((= (mod w 2) (mod length 2)) + w) + ;; l(w+1, h) >= l(w, h) > L-3, but does l(w+1, h) <= + ;; L-1 hold? + ((<= (image-transform-width (1+ w) h) (1- length)) + (1+ w)) + ;; No, it doesn't, but this implies that l(w-1, h) = + ;; l(w+1, h) - l(2, 0) >= l(w+1, h) - 2 > (L-1) - + ;; 2 = L-3. Clearly, l(w-1, h) <= l(w, h) <= L-1. + (t + (1- w))) + h))))) + +(defun image-transform-check-size () + "Check that the image exactly fits the width/height of the window." + (unless (numberp image-transform-resize) + (let ((size (image-display-size (image-get-display-property) t))) + (cond ((eq image-transform-resize 'fit-width) + (assert (= (car size) + (- (nth 2 (window-inside-pixel-edges)) + (nth 0 (window-inside-pixel-edges)))) + t)) + ((eq image-transform-resize 'fit-height) + (assert (= (cdr size) + (- (nth 3 (window-inside-pixel-edges)) + (nth 1 (window-inside-pixel-edges)))) + t)))))) + (defun image-transform-properties (spec) "Return rescaling/rotation properties for image SPEC. These properties are determined by the Image mode variables @@ -647,27 +761,35 @@ Rescaling and rotation properties only take effect if Emacs is compiled with ImageMagick support." + (setq image-transform-scale 1.0) (when (or image-transform-resize - (not (equal image-transform-rotation 0.0))) + (/= image-transform-rotation 0.0)) ;; Note: `image-size' looks up and thus caches the untransformed ;; image. There's no easy way to prevent that. (let* ((size (image-size spec t)) - (height + (resized (cond ((numberp image-transform-resize) (unless (= image-transform-resize 1) - (floor (* image-transform-resize (cdr size))))) + (setq image-transform-scale image-transform-resize) + (cons nil (floor (* image-transform-resize (cdr size)))))) + ((eq image-transform-resize 'fit-width) + (image-transform-fit-width + (car size) (cdr size) + (- (nth 2 (window-inside-pixel-edges)) + (nth 0 (window-inside-pixel-edges))))) ((eq image-transform-resize 'fit-height) - (- (nth 3 (window-inside-pixel-edges)) - (nth 1 (window-inside-pixel-edges)))))) - (width (if (eq image-transform-resize 'fit-width) - (- (nth 2 (window-inside-pixel-edges)) - (nth 0 (window-inside-pixel-edges)))))) - ;;TODO fit-to-* should consider the rotation angle - `(,@(if height (list :height height)) - ,@(if width (list :width width)) - ,@(if (not (equal 0.0 image-transform-rotation)) - (list :rotation image-transform-rotation)))))) + (let ((res (image-transform-fit-width + (cdr size) (car size) + (- (nth 3 (window-inside-pixel-edges)) + (nth 1 (window-inside-pixel-edges)))))) + (cons (cdr res) (car res))))))) + `(,@(when (car resized) + (list :width (car resized))) + ,@(when (cdr resized) + (list :height (cdr resized))) + ,@(unless (= 0.0 image-transform-rotation) + (list :rotation image-transform-rotation)))))) (defun image-transform-set-scale (scale) "Prompt for a number, and resize the current image by that amount. @@ -698,9 +820,7 @@ ROTATION should be in degrees. This command has no effect unless Emacs is compiled with ImageMagick support." (interactive "nRotation angle (in degrees): ") - ;;TODO 0 90 180 270 degrees are the only reasonable angles here - ;;otherwise combining with rescaling will get very awkward - (setq image-transform-rotation (float rotation)) + (setq image-transform-rotation (float (mod rotation 360))) (image-toggle-display-image)) (provide 'image-mode) ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.