aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2010-08-20 22:00:00 +0200
committerJoakim Verona2010-08-20 22:00:00 +0200
commit38f9163d622c5024a75775ce1a2fc9e99e4bd9cb (patch)
treed7ae74d47cd743840f6e6c79b850bc6c1a4b1081
parentccd806186417c006a97ac89162d2af3acb3d3047 (diff)
parentff2de6d2bb239c5fdcfaba2c8efd5c62610e3b7d (diff)
downloademacs-38f9163d622c5024a75775ce1a2fc9e99e4bd9cb.tar.gz
emacs-38f9163d622c5024a75775ce1a2fc9e99e4bd9cb.zip
merge from upstream
-rw-r--r--etc/NEWS2
-rw-r--r--lisp/ChangeLog12
-rw-r--r--lisp/facemenu.el105
-rw-r--r--lisp/files.el45
-rw-r--r--lisp/simple.el4
-rw-r--r--msdos/ChangeLog4
-rw-r--r--msdos/mainmake.v22
-rw-r--r--nt/ChangeLog4
-rw-r--r--nt/addpm.c7
-rw-r--r--src/ChangeLog29
-rw-r--r--src/cmds.c41
-rw-r--r--src/dispnew.c37
-rw-r--r--src/emacs.c2
-rw-r--r--src/image.c9
-rw-r--r--src/w32fns.c7
-rw-r--r--src/w32menu.c6
-rw-r--r--src/xdisp.c21
17 files changed, 227 insertions, 110 deletions
diff --git a/etc/NEWS b/etc/NEWS
index fe111ad7038..0df0d20dbac 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -453,6 +453,8 @@ has now been removed.
453 453
454* Lisp changes in Emacs 24.1 454* Lisp changes in Emacs 24.1
455 455
456** New hook post-self-insert-hook run at the end of self-insert-command.
457
456** Syntax tables support a new "comment style c" additionally to style b. 458** Syntax tables support a new "comment style c" additionally to style b.
457** frame-local variables cannot be let-bound any more. 459** frame-local variables cannot be let-bound any more.
458** prog-mode is a new major-mode meant to be the parent of programming mode. 460** prog-mode is a new major-mode meant to be the parent of programming mode.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 333764d846c..4902da03f4d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,15 @@
12010-08-19 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * files.el (locate-file-completion-table): Only list the .el and .elc
4 extensions if there's no other choice (bug#5955).
5
6 * facemenu.el (facemenu-self-insert-data): New var.
7 (facemenu-post-self-insert-function, facemenu-set-self-insert-face):
8 New functions.
9 (facemenu-add-face): Use them.
10
11 * simple.el (blink-matching-open): Obey forward-sexp-function.
12
12010-08-18 Stefan Monnier <monnier@iro.umontreal.ca> 132010-08-18 Stefan Monnier <monnier@iro.umontreal.ca>
2 14
3 * simple.el (prog-mode-map): New var. 15 * simple.el (prog-mode-map): New var.
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 20b86676ea9..992c6418d45 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -699,6 +699,22 @@ determine the correct answer."
699 (cond ((equal a b) t) 699 (cond ((equal a b) t)
700 ((equal (color-values a) (color-values b))))) 700 ((equal (color-values a) (color-values b)))))
701 701
702
703(defvar facemenu-self-insert-data nil)
704
705(defun facemenu-post-self-insert-function ()
706 (when (and (car facemenu-self-insert-data)
707 (eq last-command (cdr facemenu-self-insert-data)))
708 (put-text-property (1- (point)) (point)
709 'face (car facemenu-self-insert-data))
710 (setq facemenu-self-insert-data nil))
711 (remove-hook 'post-self-insert-hook 'facemenu-post-self-insert-function))
712
713(defun facemenu-set-self-insert-face (face)
714 "Arrange for the next self-inserted char to have face `face'."
715 (setq facemenu-self-insert-data (cons face this-command))
716 (add-hook 'post-self-insert-hook 'facemenu-post-self-insert-function))
717
702(defun facemenu-add-face (face &optional start end) 718(defun facemenu-add-face (face &optional start end)
703 "Add FACE to text between START and END. 719 "Add FACE to text between START and END.
704If START is nil or START to END is empty, add FACE to next typed character 720If START is nil or START to END is empty, add FACE to next typed character
@@ -712,51 +728,52 @@ As a special case, if FACE is `default', then the region is left with NO face
712text property. Otherwise, selecting the default face would not have any 728text property. Otherwise, selecting the default face would not have any
713effect. See `facemenu-remove-face-function'." 729effect. See `facemenu-remove-face-function'."
714 (interactive "*xFace: \nr") 730 (interactive "*xFace: \nr")
715 (if (and (eq face 'default) 731 (cond
716 (not (eq facemenu-remove-face-function t))) 732 ((and (eq face 'default)
717 (if facemenu-remove-face-function 733 (not (eq facemenu-remove-face-function t)))
718 (funcall facemenu-remove-face-function start end) 734 (if facemenu-remove-face-function
719 (if (and start (< start end)) 735 (funcall facemenu-remove-face-function start end)
720 (remove-text-properties start end '(face default))
721 (setq self-insert-face 'default
722 self-insert-face-command this-command)))
723 (if facemenu-add-face-function
724 (save-excursion
725 (if end (goto-char end))
726 (save-excursion
727 (if start (goto-char start))
728 (insert-before-markers
729 (funcall facemenu-add-face-function face end)))
730 (if facemenu-end-add-face
731 (insert (if (stringp facemenu-end-add-face)
732 facemenu-end-add-face
733 (funcall facemenu-end-add-face face)))))
734 (if (and start (< start end)) 736 (if (and start (< start end))
735 (let ((part-start start) part-end) 737 (remove-text-properties start end '(face default))
736 (while (not (= part-start end)) 738 (facemenu-set-self-insert-face 'default))))
737 (setq part-end (next-single-property-change part-start 'face 739 (facemenu-add-face-function
738 nil end)) 740 (save-excursion
739 (let ((prev (get-text-property part-start 'face))) 741 (if end (goto-char end))
740 (put-text-property part-start part-end 'face 742 (save-excursion
741 (if (null prev) 743 (if start (goto-char start))
742 face 744 (insert-before-markers
743 (facemenu-active-faces 745 (funcall facemenu-add-face-function face end)))
744 (cons face 746 (if facemenu-end-add-face
745 (if (listp prev) 747 (insert (if (stringp facemenu-end-add-face)
746 prev 748 facemenu-end-add-face
747 (list prev))) 749 (funcall facemenu-end-add-face face))))))
748 ;; Specify the selected frame 750 ((and start (< start end))
749 ;; because nil would mean to use 751 (let ((part-start start) part-end)
750 ;; the new-frame default settings, 752 (while (not (= part-start end))
751 ;; and those are usually nil. 753 (setq part-end (next-single-property-change part-start 'face
752 (selected-frame))))) 754 nil end))
753 (setq part-start part-end))) 755 (let ((prev (get-text-property part-start 'face)))
754 (setq self-insert-face (if (eq last-command self-insert-face-command) 756 (put-text-property part-start part-end 'face
755 (cons face (if (listp self-insert-face) 757 (if (null prev)
756 self-insert-face 758 face
757 (list self-insert-face))) 759 (facemenu-active-faces
758 face) 760 (cons face
759 self-insert-face-command this-command)))) 761 (if (listp prev)
762 prev
763 (list prev)))
764 ;; Specify the selected frame
765 ;; because nil would mean to use
766 ;; the new-frame default settings,
767 ;; and those are usually nil.
768 (selected-frame)))))
769 (setq part-start part-end))))
770 (t
771 (facemenu-set-self-insert-face
772 (if (eq last-command (cdr facemenu-self-insert-data))
773 (cons face (if (listp (car facemenu-self-insert-data))
774 (car facemenu-self-insert-data)
775 (list (car facemenu-self-insert-data))))
776 face))))
760 (unless (facemenu-enable-faces-p) 777 (unless (facemenu-enable-faces-p)
761 (message "Font-lock mode will override any faces you set in this buffer"))) 778 (message "Font-lock mode will override any faces you set in this buffer")))
762 779
diff --git a/lisp/files.el b/lisp/files.el
index 8b131e04ebc..9a07509ed8b 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -757,21 +757,44 @@ one or more of those symbols."
757 (let ((x (file-name-directory suffix))) 757 (let ((x (file-name-directory suffix)))
758 (if x (1- (length x)) (length suffix)))))) 758 (if x (1- (length x)) (length suffix))))))
759 (t 759 (t
760 (let ((names nil) 760 (let ((names '())
761 ;; If we have files like "foo.el" and "foo.elc", we could load one of
762 ;; them with "foo.el", "foo.elc", or "foo", where just "foo" is the
763 ;; preferred way. So if we list all 3, that gives a lot of redundant
764 ;; entries for the poor soul looking just for "foo". OTOH, sometimes
765 ;; the user does want to pay attention to the extension. We try to
766 ;; diffuse this tension by stripping the suffix, except when the
767 ;; result is a single element (i.e. usually we only list "foo" unless
768 ;; it's the only remaining element in the list, in which case we do
769 ;; list "foo", "foo.elc" and "foo.el").
770 (fullnames '())
761 (suffix (concat (regexp-opt suffixes t) "\\'")) 771 (suffix (concat (regexp-opt suffixes t) "\\'"))
762 (string-dir (file-name-directory string)) 772 (string-dir (file-name-directory string))
763 (string-file (file-name-nondirectory string))) 773 (string-file (file-name-nondirectory string)))
764 (dolist (dir dirs) 774 (dolist (dir dirs)
765 (unless dir 775 (unless dir
766 (setq dir default-directory)) 776 (setq dir default-directory))
767 (if string-dir (setq dir (expand-file-name string-dir dir))) 777 (if string-dir (setq dir (expand-file-name string-dir dir)))
768 (when (file-directory-p dir) 778 (when (file-directory-p dir)
769 (dolist (file (file-name-all-completions 779 (dolist (file (file-name-all-completions
770 string-file dir)) 780 string-file dir))
771 (push file names) 781 (if (not (string-match suffix file))
772 (when (string-match suffix file) 782 (push file names)
773 (setq file (substring file 0 (match-beginning 0))) 783 (push file fullnames)
774 (push file names))))) 784 (push (substring file 0 (match-beginning 0)) names)))))
785 ;; Switching from names to names+fullnames creates a non-monotonicity
786 ;; which can cause problems with things like partial-completion.
787 ;; To minimize the problem, filter out completion-regexp-list, so that
788 ;; M-x load-library RET t/x.e TAB finds some files.
789 (if completion-regexp-list
790 (setq names (all-completions "" names)))
791 ;; Remove duplicates of the first element, so that we can easily check
792 ;; if `names' really only contains a single element.
793 (when (cdr names) (setcdr names (delete (car names) (cdr names))))
794 (unless (cdr names)
795 ;; There's no more than one matching non-suffixed element, so expand
796 ;; the list by adding the suffixed elements as well.
797 (setq names (nconc names fullnames)))
775 (completion-table-with-context 798 (completion-table-with-context
776 string-dir names string-file pred action))))) 799 string-dir names string-file pred action)))))
777 800
diff --git a/lisp/simple.el b/lisp/simple.el
index 7c941fd63b9..b998eef88a0 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5495,7 +5495,9 @@ it skips the contents of comments that end before point."
5495 (and parse-sexp-ignore-comments 5495 (and parse-sexp-ignore-comments
5496 (not blink-matching-paren-dont-ignore-comments)))) 5496 (not blink-matching-paren-dont-ignore-comments))))
5497 (condition-case () 5497 (condition-case ()
5498 (scan-sexps oldpos -1) 5498 (progn
5499 (forward-sexp -1)
5500 (point))
5499 (error nil)))))) 5501 (error nil))))))
5500 (matching-paren 5502 (matching-paren
5501 (and blinkpos 5503 (and blinkpos
diff --git a/msdos/ChangeLog b/msdos/ChangeLog
index 7df89880410..7227b8b8b51 100644
--- a/msdos/ChangeLog
+++ b/msdos/ChangeLog
@@ -1,3 +1,7 @@
12010-08-15 Eli Zaretskii <eliz@gnu.org>
2
3 * mainmake.v2 (version): Update due to change in emacs.c.
4
12010-08-05 Eli Zaretskii <eliz@gnu.org> 52010-08-05 Eli Zaretskii <eliz@gnu.org>
2 6
3 * sed1v2.inp (UNEXEC_OBJ): Edit to unexcoff.o, due to renaming of 7 * sed1v2.inp (UNEXEC_OBJ): Edit to unexcoff.o, due to renaming of
diff --git a/msdos/mainmake.v2 b/msdos/mainmake.v2
index 4bb13e367ed..79bd827d8c6 100644
--- a/msdos/mainmake.v2
+++ b/msdos/mainmake.v2
@@ -65,7 +65,7 @@ MAKESHELL=/xyzzy/command
65top_srcdir := $(subst \,/,$(shell cd)) 65top_srcdir := $(subst \,/,$(shell cd))
66 66
67# Find out which version of Emacs this is. 67# Find out which version of Emacs this is.
68version := ${shell sed -n -e '/^const char emacs_version/s/^[^"]*\("[^"]*"\).*/\1/p' src/emacs.c} 68version := ${shell sed -n -e '/^static const char emacs_version/s/^[^"]*\("[^"]*"\).*/\1/p' src/emacs.c}
69 69
70# Q: Do we need to bootstrap? 70# Q: Do we need to bootstrap?
71# A: Only if we find admin/admin.el, i.e. we are building out of 71# A: Only if we find admin/admin.el, i.e. we are building out of
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 07550e1b2d2..05f01767bd3 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,7 @@
12010-08-19 Juanma Barranquero <lekktu@gmail.com>
2
3 * addpm.c (add_registry): Create App Paths of type REG_EXPAND_SZ.
4
12010-08-12 Jason Rumney <jasonr@gnu.org> 52010-08-12 Jason Rumney <jasonr@gnu.org>
2 6
3 * addpm.c (add_registry): Set path for runemacs.exe to use. 7 * addpm.c (add_registry): Set path for runemacs.exe to use.
diff --git a/nt/addpm.c b/nt/addpm.c
index 4fcebe2ca14..de09fd5382c 100644
--- a/nt/addpm.c
+++ b/nt/addpm.c
@@ -113,7 +113,7 @@ add_registry (char *path)
113 emacs_path = (char *) alloca (len); 113 emacs_path = (char *) alloca (len);
114 sprintf (emacs_path, "%s\\bin\\emacs.exe", path); 114 sprintf (emacs_path, "%s\\bin\\emacs.exe", path);
115 115
116 RegSetValueEx (hrootkey, NULL, 0, REG_SZ, emacs_path, len); 116 RegSetValueEx (hrootkey, NULL, 0, REG_EXPAND_SZ, emacs_path, len);
117 117
118 /* Look for a GTK installation. If found, add it to the library search 118 /* Look for a GTK installation. If found, add it to the library search
119 path for Emacs so that the image libraries it provides are available 119 path for Emacs so that the image libraries it provides are available
@@ -135,7 +135,8 @@ add_registry (char *path)
135 len = strlen (path) + 5 + size; 135 len = strlen (path) + 5 + size;
136 dll_paths = (char *) alloca (size + strlen (path) + 1); 136 dll_paths = (char *) alloca (size + strlen (path) + 1);
137 sprintf (dll_paths, "%s\\bin;%s", path, gtk_path); 137 sprintf (dll_paths, "%s\\bin;%s", path, gtk_path);
138 RegSetValueEx (hrootkey, "Path", 0, REG_SZ, dll_paths, len); 138 RegSetValueEx (hrootkey, "Path", 0, REG_EXPAND_SZ,
139 dll_paths, len);
139 140
140 /* Set the same path for runemacs.exe, as the Explorer shell 141 /* Set the same path for runemacs.exe, as the Explorer shell
141 looks this up, so the above does not take effect when 142 looks this up, so the above does not take effect when
@@ -145,7 +146,7 @@ add_registry (char *path)
145 KEY_WRITE, NULL, &runemacs_key, NULL) 146 KEY_WRITE, NULL, &runemacs_key, NULL)
146 == ERROR_SUCCESS) 147 == ERROR_SUCCESS)
147 { 148 {
148 RegSetValueEx (runemacs_key, "Path", 0, REG_SZ, 149 RegSetValueEx (runemacs_key, "Path", 0, REG_EXPAND_SZ,
149 dll_paths, len); 150 dll_paths, len);
150 151
151 RegCloseKey (runemacs_key); 152 RegCloseKey (runemacs_key);
diff --git a/src/ChangeLog b/src/ChangeLog
index 5d26db96634..5b44cc8f34c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,32 @@
12010-08-20 Eli Zaretskii <eliz@gnu.org>
2
3 * emacs.c <emacs_version>: Add a comment regarding
4 msdos/mainmake.v2's dependency on the syntax of this declaration.
5
62010-08-20 Eli Zaretskii <eliz@gnu.org>
7
8 * dispnew.c (buffer_posn_from_coords): Fix calculation of buffer
9 position for R2L lines by mirroring the pixel position wrt the
10 text are box. Improve commentary.
11
122010-08-20 Andreas Schwab <schwab@linux-m68k.org>
13
14 * image.c (imagemagick_clear_image): Remove debugging output.
15
162010-08-19 Stefan Monnier <monnier@iro.umontreal.ca>
17
18 * cmds.c (Vself_insert_face, Vself_insert_face_command): Remove.
19 (Qpost_self_insert_hook, Vpost_self_insert_hook): New vars.
20 (internal_self_insert): Run Qpost_self_insert_hook rather than handle
21 self-insert-face.
22 (syms_of_cmds): Initialize the new vars.
23
242010-08-19 Jason Rumney <jasonr@gnu.org>
25
26 * w32menu.c (set_frame_menubar): Remove call to undefined function.
27
28 * w32fns.c (w32_wnd_proc): Don't check context before initializing.
29
12010-08-19 Jan Djärv <jan.h.d@swipnet.se> 302010-08-19 Jan Djärv <jan.h.d@swipnet.se>
2 31
3 * nsselect.m (nxatoms_of_nsselect): Use "Selection" and "Secondary". 32 * nsselect.m (nxatoms_of_nsselect): Use "Selection" and "Secondary".
diff --git a/src/cmds.c b/src/cmds.c
index 4cb6ca199e7..f306ede7ca5 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -37,12 +37,6 @@ Lisp_Object Qkill_forward_chars, Qkill_backward_chars, Vblink_paren_function;
37/* A possible value for a buffer's overwrite-mode variable. */ 37/* A possible value for a buffer's overwrite-mode variable. */
38Lisp_Object Qoverwrite_mode_binary; 38Lisp_Object Qoverwrite_mode_binary;
39 39
40/* Non-nil means put this face on the next self-inserting character. */
41Lisp_Object Vself_insert_face;
42
43/* This is the command that set up Vself_insert_face. */
44Lisp_Object Vself_insert_face_command;
45
46static int internal_self_insert (int, int); 40static int internal_self_insert (int, int);
47 41
48DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0, 42DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0,
@@ -346,6 +340,7 @@ After insertion, the value of `auto-fill-function' is called if the
346 A value of 2 means this did things that call for an undo boundary. */ 340 A value of 2 means this did things that call for an undo boundary. */
347 341
348static Lisp_Object Qexpand_abbrev; 342static Lisp_Object Qexpand_abbrev;
343static Lisp_Object Qpost_self_insert_hook, Vpost_self_insert_hook;
349 344
350static int 345static int
351internal_self_insert (int c, int noautofill) 346internal_self_insert (int c, int noautofill)
@@ -451,10 +446,10 @@ internal_self_insert (int c, int noautofill)
451 && synt != Sword 446 && synt != Sword
452 && NILP (current_buffer->read_only) 447 && NILP (current_buffer->read_only)
453 && PT > BEGV 448 && PT > BEGV
454 && (!NILP (current_buffer->enable_multibyte_characters) 449 && (SYNTAX (!NILP (current_buffer->enable_multibyte_characters)
455 ? SYNTAX (XFASTINT (Fprevious_char ())) == Sword 450 ? XFASTINT (Fprevious_char ())
456 : (SYNTAX (UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ()))) 451 : UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ())))
457 == Sword))) 452 == Sword))
458 { 453 {
459 int modiff = MODIFF; 454 int modiff = MODIFF;
460 Lisp_Object sym; 455 Lisp_Object sym;
@@ -514,15 +509,6 @@ internal_self_insert (int c, int noautofill)
514 hairy = 2; 509 hairy = 2;
515 } 510 }
516 511
517 /* If previous command specified a face to use, use it. */
518 if (!NILP (Vself_insert_face)
519 && EQ (current_kboard->Vlast_command, Vself_insert_face_command))
520 {
521 Fput_text_property (make_number (PT - 1), make_number (PT),
522 Qface, Vself_insert_face, Qnil);
523 Vself_insert_face = Qnil;
524 }
525
526 if ((synt == Sclose || synt == Smath) 512 if ((synt == Sclose || synt == Smath)
527 && !NILP (Vblink_paren_function) && INTERACTIVE 513 && !NILP (Vblink_paren_function) && INTERACTIVE
528 && !noautofill) 514 && !noautofill)
@@ -530,6 +516,9 @@ internal_self_insert (int c, int noautofill)
530 call0 (Vblink_paren_function); 516 call0 (Vblink_paren_function);
531 hairy = 2; 517 hairy = 2;
532 } 518 }
519 /* Run hooks for electric keys. */
520 call1 (Vrun_hooks, Qpost_self_insert_hook);
521
533 return hairy; 522 return hairy;
534} 523}
535 524
@@ -550,15 +539,13 @@ syms_of_cmds (void)
550 Qexpand_abbrev = intern_c_string ("expand-abbrev"); 539 Qexpand_abbrev = intern_c_string ("expand-abbrev");
551 staticpro (&Qexpand_abbrev); 540 staticpro (&Qexpand_abbrev);
552 541
553 DEFVAR_LISP ("self-insert-face", &Vself_insert_face, 542 Qpost_self_insert_hook = intern_c_string ("post-self-insert-hook");
554 doc: /* If non-nil, set the face of the next self-inserting character to this. 543 staticpro (&Qpost_self_insert_hook);
555See also `self-insert-face-command'. */);
556 Vself_insert_face = Qnil;
557 544
558 DEFVAR_LISP ("self-insert-face-command", &Vself_insert_face_command, 545 DEFVAR_LISP ("post-self-insert-hook", &Vpost_self_insert_hook,
559 doc: /* This is the command that set up `self-insert-face'. 546 doc: /* Hook run at the end of `self-insert-command'.
560If `last-command' does not equal this value, we ignore `self-insert-face'. */); 547This run is run after inserting the charater. */);
561 Vself_insert_face_command = Qnil; 548 Vpost_self_insert_hook = Qnil;
562 549
563 DEFVAR_LISP ("blink-paren-function", &Vblink_paren_function, 550 DEFVAR_LISP ("blink-paren-function", &Vblink_paren_function,
564 doc: /* Function called, if non-nil, whenever a close parenthesis is inserted. 551 doc: /* Function called, if non-nil, whenever a close parenthesis is inserted.
diff --git a/src/dispnew.c b/src/dispnew.c
index 35893872c73..efcfd101782 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5351,9 +5351,15 @@ update_frame_line (struct frame *f, int vpos)
5351 ***********************************************************************/ 5351 ***********************************************************************/
5352 5352
5353/* Determine what's under window-relative pixel position (*X, *Y). 5353/* Determine what's under window-relative pixel position (*X, *Y).
5354 Return the object (string or buffer) that's there. 5354 Return the OBJECT (string or buffer) that's there.
5355 Return in *POS the position in that object. 5355 Return in *POS the position in that object.
5356 Adjust *X and *Y to character positions. */ 5356 Adjust *X and *Y to character positions.
5357 Return in *DX and *DY the pixel coordinates of the click,
5358 relative to the top left corner of OBJECT, or relative to
5359 the top left corner of the character glyph at (*X, *Y)
5360 if OBJECT is nil.
5361 Return WIDTH and HEIGHT of the object at (*X, *Y), or zero
5362 if the coordinates point to an empty area of the display. */
5357 5363
5358Lisp_Object 5364Lisp_Object
5359buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *pos, Lisp_Object *object, int *dx, int *dy, int *width, int *height) 5365buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *pos, Lisp_Object *object, int *dx, int *dy, int *width, int *height)
@@ -5366,7 +5372,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
5366#ifdef HAVE_WINDOW_SYSTEM 5372#ifdef HAVE_WINDOW_SYSTEM
5367 struct image *img = 0; 5373 struct image *img = 0;
5368#endif 5374#endif
5369 int x0, x1; 5375 int x0, x1, to_x;
5370 5376
5371 /* We used to set current_buffer directly here, but that does the 5377 /* We used to set current_buffer directly here, but that does the
5372 wrong thing with `face-remapping-alist' (bug#2044). */ 5378 wrong thing with `face-remapping-alist' (bug#2044). */
@@ -5377,8 +5383,29 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
5377 start_display (&it, w, startp); 5383 start_display (&it, w, startp);
5378 5384
5379 x0 = *x - WINDOW_LEFT_MARGIN_WIDTH (w); 5385 x0 = *x - WINDOW_LEFT_MARGIN_WIDTH (w);
5380 move_it_to (&it, -1, x0 + it.first_visible_x, *y, -1, 5386
5381 MOVE_TO_X | MOVE_TO_Y); 5387 /* First, move to the beginning of the row corresponding to *Y. We
5388 need to be in that row to get the correct value of base paragraph
5389 direction for the paragraph at *X. */
5390 move_it_to (&it, -1, 0, *y, -1, MOVE_TO_X | MOVE_TO_Y);
5391
5392 /* TO_X is the pixel position that the iterator will compute for the
5393 glyph at *X. This is because iterator positions are not offset
5394 due to hscroll. */
5395 to_x = x0 + it.first_visible_x;
5396 if (it.bidi_it.paragraph_dir == R2L)
5397 /* For lines in an R2L paragraph, we need to mirror TO_X wrt the
5398 text area. This is because the iterator, even in R2L
5399 paragraphs, delivers glyphs as if they started at the left
5400 margin of the window. (When we actually produce glyphs for
5401 display, we reverse their order in PRODUCE_GLYPHS, but the
5402 iterator doesn't know about that.) The following line adjusts
5403 the pixel position to the iterator geometry, which is what
5404 move_it_* routines use. */
5405 to_x = window_box_width (w, TEXT_AREA) - to_x;
5406
5407 /* Now move horizontally in the row to the glyph under *X. */
5408 move_it_in_display_line (&it, ZV, to_x, MOVE_TO_X);
5382 5409
5383 Fset_buffer (old_current_buffer); 5410 Fset_buffer (old_current_buffer);
5384 5411
diff --git a/src/emacs.c b/src/emacs.c
index 026a210af50..67a99d674e7 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -91,6 +91,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
91#endif 91#endif
92#endif 92#endif
93 93
94/* If you change the following line, remember to update
95 msdos/mainmake.v2 which gleans the Emacs version from it! */
94static const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc."; 96static const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
95static const char emacs_version[] = "24.0.50"; 97static const char emacs_version[] = "24.0.50";
96 98
diff --git a/src/image.c b/src/image.c
index e2aeae3f357..ae4bf2fd937 100644
--- a/src/image.c
+++ b/src/image.c
@@ -7400,7 +7400,6 @@ static void
7400imagemagick_clear_image (struct frame *f, 7400imagemagick_clear_image (struct frame *f,
7401 struct image *img) 7401 struct image *img)
7402{ 7402{
7403 printf("clearing imagemagick image\n");
7404 x_clear_image (f, img); 7403 x_clear_image (f, img);
7405} 7404}
7406 7405
@@ -7485,7 +7484,6 @@ imagemagick_load_image (/* Pointer to emacs frame structure. */
7485 image. Interface :index is same as for GIF. First we "ping" the 7484 image. Interface :index is same as for GIF. First we "ping" the
7486 image to see how many sub-images it contains. Pinging is faster 7485 image to see how many sub-images it contains. Pinging is faster
7487 than loading the image to find out things about it. */ 7486 than loading the image to find out things about it. */
7488 printf("im ping file %s\n", filename);
7489 image = image_spec_value (img->spec, QCindex, NULL); 7487 image = image_spec_value (img->spec, QCindex, NULL);
7490 ino = INTEGERP (image) ? XFASTINT (image) : 0; 7488 ino = INTEGERP (image) ? XFASTINT (image) : 0;
7491 ping_wand=NewMagickWand(); 7489 ping_wand=NewMagickWand();
@@ -7519,7 +7517,6 @@ imagemagick_load_image (/* Pointer to emacs frame structure. */
7519 7517
7520 if (filename != NULL) 7518 if (filename != NULL)
7521 { 7519 {
7522 printf("im read file %s\n", filename);
7523 image_info=CloneImageInfo((ImageInfo *) NULL); 7520 image_info=CloneImageInfo((ImageInfo *) NULL);
7524 (void) strcpy(image_info->filename, filename); 7521 (void) strcpy(image_info->filename, filename);
7525 image_info -> number_scenes = 1; 7522 image_info -> number_scenes = 1;
@@ -7529,7 +7526,6 @@ imagemagick_load_image (/* Pointer to emacs frame structure. */
7529 im_image = ReadImage (image_info, exception); 7526 im_image = ReadImage (image_info, exception);
7530 CatchException(exception); 7527 CatchException(exception);
7531 7528
7532 printf("im wand from image\n");
7533 image_wand = NewMagickWandFromImage(im_image); 7529 image_wand = NewMagickWandFromImage(im_image);
7534 } 7530 }
7535 else 7531 else
@@ -7565,7 +7561,6 @@ imagemagick_load_image (/* Pointer to emacs frame structure. */
7565 } 7561 }
7566 if(desired_width != -1 && desired_height != -1) 7562 if(desired_width != -1 && desired_height != -1)
7567 { 7563 {
7568 printf("MagickScaleImage %d %d\n", desired_width, desired_height);
7569 status = MagickScaleImage(image_wand, desired_width, desired_height); 7564 status = MagickScaleImage(image_wand, desired_width, desired_height);
7570 if (status == MagickFalse) { 7565 if (status == MagickFalse) {
7571 image_error ("Imagemagick scale failed", Qnil, Qnil); 7566 image_error ("Imagemagick scale failed", Qnil, Qnil);
@@ -7592,7 +7587,6 @@ imagemagick_load_image (/* Pointer to emacs frame structure. */
7592 h=XFASTINT(XCAR(XCDR(crop))); 7587 h=XFASTINT(XCAR(XCDR(crop)));
7593 x=XFASTINT(XCAR(XCDR(XCDR(crop)))); 7588 x=XFASTINT(XCAR(XCDR(XCDR(crop))));
7594 y=XFASTINT(XCAR(XCDR(XCDR(XCDR(crop))))); 7589 y=XFASTINT(XCAR(XCDR(XCDR(XCDR(crop)))));
7595 printf("MagickCropImage(image_wand, %d,%d, %d,%d)\n", w, h, x, y);
7596 MagickCropImage(image_wand, w,h, x,y); 7590 MagickCropImage(image_wand, w,h, x,y);
7597 } 7591 }
7598 7592
@@ -7609,7 +7603,6 @@ imagemagick_load_image (/* Pointer to emacs frame structure. */
7609 PixelSetColor (background, "#ffffff");/*TODO remove hardcode*/ 7603 PixelSetColor (background, "#ffffff");/*TODO remove hardcode*/
7610 7604
7611 rotation = extract_float (value); 7605 rotation = extract_float (value);
7612 printf ("MagickRotateImage %f\n", rotation);
7613 7606
7614 status = MagickRotateImage (image_wand, background, rotation); 7607 status = MagickRotateImage (image_wand, background, rotation);
7615 DestroyPixelWand (background); 7608 DestroyPixelWand (background);
@@ -7691,7 +7684,6 @@ imagemagick_load_image (/* Pointer to emacs frame structure. */
7691 int imagedepth = 24;/*MagickGetImageDepth(image_wand);*/ 7684 int imagedepth = 24;/*MagickGetImageDepth(image_wand);*/
7692 char* exportdepth = imagedepth <= 8 ? "I" : "BGRP";/*"RGBP";*/ 7685 char* exportdepth = imagedepth <= 8 ? "I" : "BGRP";/*"RGBP";*/
7693 /* Try to create a x pixmap to hold the imagemagick pixmap. */ 7686 /* Try to create a x pixmap to hold the imagemagick pixmap. */
7694 printf("imagedepth:%d exportdepth:%s\n", imagedepth, exportdepth);
7695 if (!x_create_x_image_and_pixmap (f, width, height, imagedepth, 7687 if (!x_create_x_image_and_pixmap (f, width, height, imagedepth,
7696 &ximg, &img->pixmap)){ 7688 &ximg, &img->pixmap)){
7697 image_error("Imagemagick X bitmap allocation failure", Qnil, Qnil); 7689 image_error("Imagemagick X bitmap allocation failure", Qnil, Qnil);
@@ -7758,7 +7750,6 @@ imagemagick_load_image (/* Pointer to emacs frame structure. */
7758 imagemagick_error: 7750 imagemagick_error:
7759 /* TODO more cleanup. */ 7751 /* TODO more cleanup. */
7760 image_error ("Error parsing IMAGEMAGICK image `%s'", img->spec, Qnil); 7752 image_error ("Error parsing IMAGEMAGICK image `%s'", img->spec, Qnil);
7761 printf("Imagemagick error, see *Messages*\n");
7762 return 0; 7753 return 0;
7763} 7754}
7764 7755
diff --git a/src/w32fns.c b/src/w32fns.c
index 64d0d8cb6d1..f91ad948828 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -3109,9 +3109,6 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
3109 HIMC context; 3109 HIMC context;
3110 struct window *w; 3110 struct window *w;
3111 3111
3112 if (!context)
3113 break;
3114
3115 f = x_window_to_frame (dpyinfo, hwnd); 3112 f = x_window_to_frame (dpyinfo, hwnd);
3116 w = XWINDOW (FRAME_SELECTED_WINDOW (f)); 3113 w = XWINDOW (FRAME_SELECTED_WINDOW (f));
3117 3114
@@ -3129,6 +3126,10 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
3129 - WINDOW_MODE_LINE_HEIGHT (w)); 3126 - WINDOW_MODE_LINE_HEIGHT (w));
3130 3127
3131 context = get_ime_context_fn (hwnd); 3128 context = get_ime_context_fn (hwnd);
3129
3130 if (!context)
3131 break;
3132
3132 set_ime_composition_window_fn (context, &form); 3133 set_ime_composition_window_fn (context, &form);
3133 release_ime_context_fn (hwnd, context); 3134 release_ime_context_fn (hwnd, context);
3134 } 3135 }
diff --git a/src/w32menu.c b/src/w32menu.c
index 1146843bec8..0ed9bffe70c 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -420,12 +420,8 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
420 420
421 set_buffer_internal_1 (XBUFFER (buffer)); 421 set_buffer_internal_1 (XBUFFER (buffer));
422 422
423 /* Run the Lucid hook. */ 423 /* Run the hooks. */
424 safe_run_hooks (Qactivate_menubar_hook); 424 safe_run_hooks (Qactivate_menubar_hook);
425 /* If it has changed current-menubar from previous value,
426 really recompute the menubar from the value. */
427 if (! NILP (Vlucid_menu_bar_dirty_flag))
428 call0 (Qrecompute_lucid_menubar);
429 safe_run_hooks (Qmenu_bar_update_hook); 425 safe_run_hooks (Qmenu_bar_update_hook);
430 FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); 426 FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f));
431 427
diff --git a/src/xdisp.c b/src/xdisp.c
index d730387a51b..c80e1f35df3 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -217,7 +217,26 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
217 glyph with suitably computed width. Both the blanks and the 217 glyph with suitably computed width. Both the blanks and the
218 stretch glyph are given the face of the background of the line. 218 stretch glyph are given the face of the background of the line.
219 This way, the terminal-specific back-end can still draw the glyphs 219 This way, the terminal-specific back-end can still draw the glyphs
220 left to right, even for R2L lines. */ 220 left to right, even for R2L lines.
221
222 Note one important detail mentioned above: that the bidi reordering
223 engine, driven by the iterator, produces characters in R2L rows
224 starting at the character that will be the rightmost on display.
225 As far as the iterator is concerned, the geometry of such rows is
226 still left to right, i.e. the iterator "thinks" the first character
227 is at the leftmost pixel position. The iterator does not know that
228 PRODUCE_GLYPHS reverses the order of the glyphs that the iterator
229 delivers. This is important when functions from the the move_it_*
230 family are used to get to certain screen position or to match
231 screen coordinates with buffer coordinates: these functions use the
232 iterator geometry, which is left to right even in R2L paragraphs.
233 This works well with most callers of move_it_*, because they need
234 to get to a specific column, and columns are still numbered in the
235 reading order, i.e. the rightmost character in a R2L paragraph is
236 still column zero. But some callers do not get well with this; a
237 notable example is mouse clicks that need to find the character
238 that corresponds to certain pixel coordinates. See
239 buffer_posn_from_coords in dispnew.c for how this is handled. */
221 240
222#include <config.h> 241#include <config.h>
223#include <stdio.h> 242#include <stdio.h>