aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabián Ezequiel Gallina2015-01-28 01:03:46 -0300
committerFabián Ezequiel Gallina2015-01-28 01:03:46 -0300
commit33ab7ee0edcb3608e4a3d5deebc2b72c180dbfe4 (patch)
tree946ccc8bdc1f41a2c4066e6fcef4bfd04a9d693a
parent85ca47671ccbffe87d6ccad17039b49d6b676d61 (diff)
parent8ee825c35b62768e28fe825163dea90d3ab46022 (diff)
downloademacs-33ab7ee0edcb3608e4a3d5deebc2b72c180dbfe4.tar.gz
emacs-33ab7ee0edcb3608e4a3d5deebc2b72c180dbfe4.zip
Merge from origin/emacs-24
8ee825c doc/emacs/programs.texi (Custom C Indent): Fix a typo. (Bug#19647) 88ba49f Fix coding.c subscript error 3ea1b31 Prevent artist-mode from creating runaway timers (Bug#6130).
-rw-r--r--doc/emacs/ChangeLog4
-rw-r--r--doc/emacs/programs.texi2
-rw-r--r--doc/lispref/ChangeLog6
-rw-r--r--doc/lispref/commands.texi23
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/subr.el33
-rw-r--r--lisp/textmodes/artist.el95
-rw-r--r--src/ChangeLog6
-rw-r--r--src/coding.c3
9 files changed, 115 insertions, 64 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index b7853a7f118..329da9418f8 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,7 @@
12015-01-21 Eli Zaretskii <eliz@gnu.org>
2
3 * programs.texi (Custom C Indent): Fix a typo. (Bug#19647)
4
12015-01-27 Ivan Shmakov <ivan@siamics.net> 52015-01-27 Ivan Shmakov <ivan@siamics.net>
2 6
3 * files.texi (File Archives): Document "I" for tar-new-entry. 7 * files.texi (File Archives): Document "I" for tar-new-entry.
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 8f6111dfa24..609392f6bb7 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -546,7 +546,7 @@ your selected @dfn{style} with the syntactic construct and adds this
546onto the indentation of the @dfn{anchor statement}. 546onto the indentation of the @dfn{anchor statement}.
547 547
548@table @kbd 548@table @kbd
549@item C-c . @key{RET} @var{style} @key{RET} 549@item C-c . @var{style} @key{RET}
550Select a predefined style @var{style} (@code{c-set-style}). 550Select a predefined style @var{style} (@code{c-set-style}).
551@end table 551@end table
552 552
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 2bbe28eb16e..ef1d79af003 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,9 @@
12015-01-21 Daniel Koning <dk@danielkoning.com> (tiny change)
2
3 * commands.texi (Drag Events, Motion Events, Event Examples)
4 (Accessing Mouse): Describe actual range of values that mouse
5 position objects can have.
6
12015-01-20 Eli Zaretskii <eliz@gnu.org> 72015-01-20 Eli Zaretskii <eliz@gnu.org>
2 8
3 * display.texi (Manipulating Buttons): Explain more about the 9 * display.texi (Manipulating Buttons): Explain more about the
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index 36c74450ed4..6fdc8e2ec79 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -1489,8 +1489,10 @@ prefix @samp{drag-}. For example, dragging the mouse with button 2
1489held down generates a @code{drag-mouse-2} event. The second and third 1489held down generates a @code{drag-mouse-2} event. The second and third
1490elements of the event give the starting and ending position of the 1490elements of the event give the starting and ending position of the
1491drag, as mouse position lists (@pxref{Click Events}). You can access 1491drag, as mouse position lists (@pxref{Click Events}). You can access
1492the second element of any mouse event in the same way, with no need to 1492the second element of any mouse event in the same way. However, the
1493distinguish drag events from others. 1493drag event may end outside the boundaries of the frame that was
1494initially selected. In that case, the third element's position list
1495contains that frame in place of a window.
1494 1496
1495The @samp{drag-} prefix follows the modifier key prefixes such as 1497The @samp{drag-} prefix follows the modifier key prefixes such as
1496@samp{C-} and @samp{M-}. 1498@samp{C-} and @samp{M-}.
@@ -1635,7 +1637,10 @@ represented by lists that look like this:
1635 1637
1636@noindent 1638@noindent
1637@var{position} is a mouse position list (@pxref{Click Events}), 1639@var{position} is a mouse position list (@pxref{Click Events}),
1638specifying the current position of the mouse cursor. 1640specifying the current position of the mouse cursor. As with the
1641end-position of a drag event, this position list may represent a
1642location outside the boundaries of the initially selected frame, in
1643which case the list contains that frame in place of a window.
1639 1644
1640The special form @code{track-mouse} enables generation of motion 1645The special form @code{track-mouse} enables generation of motion
1641events within its body. Outside of @code{track-mouse} forms, Emacs 1646events within its body. Outside of @code{track-mouse} forms, Emacs
@@ -1850,6 +1855,14 @@ into another window. That produces a pair of events like these:
1850 -453816)) 1855 -453816))
1851@end smallexample 1856@end smallexample
1852 1857
1858The frame with input focus might not take up the entire screen, and
1859the user might move the mouse outside the scope of the frame. Inside
1860the @code{track-mouse} special form, that produces an event like this:
1861
1862@smallexample
1863(mouse-movement (#<frame *ielm* 0x102849a30> nil (563 . 205) 532301936))
1864@end smallexample
1865
1853To handle a SIGUSR1 signal, define an interactive function, and 1866To handle a SIGUSR1 signal, define an interactive function, and
1854bind it to the @code{signal usr1} event sequence: 1867bind it to the @code{signal usr1} event sequence:
1855 1868
@@ -2014,7 +2027,9 @@ Events}); and @code{nil} otherwise.
2014various parts of it: 2027various parts of it:
2015 2028
2016@defun posn-window position 2029@defun posn-window position
2017Return the window that @var{position} is in. 2030Return the window that @var{position} is in. If @var{position}
2031represents a location outside the frame where the event was initiated,
2032return that frame instead.
2018@end defun 2033@end defun
2019 2034
2020@defun posn-area position 2035@defun posn-area position
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bf60d38b2a3..a693cc0bdc6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12015-01-21 Daniel Koning <dk@danielkoning.com> (tiny change)
2
3 * subr.el (posnp): Correct docstring of `posnp'.
4 (posn-col-row): Make it work with all mouse position objects.
5 * textmodes/artist.el (artist-mouse-draw-continously): Cancel
6 timers if an error occurs during continuous drawing. (Bug#6130)
7
12015-01-20 Eli Zaretskii <eliz@gnu.org> 82015-01-20 Eli Zaretskii <eliz@gnu.org>
2 9
3 * button.el (button-activate, push-button): Doc fix. (Bug#19628) 10 * button.el (button-activate, push-button): Doc fix. (Bug#19628)
diff --git a/lisp/subr.el b/lisp/subr.el
index 05345853edc..68cd230c5e2 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1082,7 +1082,12 @@ The return value is a positive integer."
1082;;;; Extracting fields of the positions in an event. 1082;;;; Extracting fields of the positions in an event.
1083 1083
1084(defun posnp (obj) 1084(defun posnp (obj)
1085 "Return non-nil if OBJ appears to be a valid `posn' object." 1085 "Return non-nil if OBJ appears to be a valid `posn' object specifying a window.
1086If OBJ is a valid `posn' object, but specifies a frame rather
1087than a window, return nil."
1088 ;; FIXME: Correct the behavior of this function so that all valid
1089 ;; `posn' objects are recognized, after updating other code that
1090 ;; depends on its present behavior.
1086 (and (windowp (car-safe obj)) 1091 (and (windowp (car-safe obj))
1087 (atom (car-safe (setq obj (cdr obj)))) ;AREA-OR-POS. 1092 (atom (car-safe (setq obj (cdr obj)))) ;AREA-OR-POS.
1088 (integerp (car-safe (car-safe (setq obj (cdr obj))))) ;XOFFSET. 1093 (integerp (car-safe (car-safe (setq obj (cdr obj))))) ;XOFFSET.
@@ -1142,24 +1147,28 @@ For a scroll-bar event, the result column is 0, and the row
1142corresponds to the vertical position of the click in the scroll bar. 1147corresponds to the vertical position of the click in the scroll bar.
1143POSITION should be a list of the form returned by the `event-start' 1148POSITION should be a list of the form returned by the `event-start'
1144and `event-end' functions." 1149and `event-end' functions."
1145 (let* ((pair (posn-x-y position)) 1150 (let* ((pair (posn-x-y position))
1146 (window (posn-window position)) 1151 (frame-or-window (posn-window position))
1147 (area (posn-area position))) 1152 (frame (if (framep frame-or-window)
1153 frame-or-window
1154 (window-frame frame-or-window)))
1155 (window (when (windowp frame-or-window) frame-or-window))
1156 (area (posn-area position)))
1148 (cond 1157 (cond
1149 ((null window) 1158 ((null frame-or-window)
1150 '(0 . 0)) 1159 '(0 . 0))
1151 ((eq area 'vertical-scroll-bar) 1160 ((eq area 'vertical-scroll-bar)
1152 (cons 0 (scroll-bar-scale pair (1- (window-height window))))) 1161 (cons 0 (scroll-bar-scale pair (1- (window-height window)))))
1153 ((eq area 'horizontal-scroll-bar) 1162 ((eq area 'horizontal-scroll-bar)
1154 (cons (scroll-bar-scale pair (window-width window)) 0)) 1163 (cons (scroll-bar-scale pair (window-width window)) 0))
1155 (t 1164 (t
1156 (let* ((frame (if (framep window) window (window-frame window))) 1165 ;; FIXME: This should take line-spacing properties on
1157 ;; FIXME: This should take line-spacing properties on 1166 ;; newlines into account.
1158 ;; newlines into account. 1167 (let* ((spacing (when (display-graphic-p frame)
1159 (spacing (when (display-graphic-p frame) 1168 (or (with-current-buffer
1160 (or (with-current-buffer (window-buffer window) 1169 (window-buffer (frame-selected-window frame))
1161 line-spacing) 1170 line-spacing)
1162 (frame-parameter frame 'line-spacing))))) 1171 (frame-parameter frame 'line-spacing)))))
1163 (cond ((floatp spacing) 1172 (cond ((floatp spacing)
1164 (setq spacing (truncate (* spacing 1173 (setq spacing (truncate (* spacing
1165 (frame-char-height frame))))) 1174 (frame-char-height frame)))))
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index 8a2383c12ff..85d9410868a 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -4963,52 +4963,55 @@ The event, EV, is the mouse event."
4963 (artist-funcall init-fn x1 y1) 4963 (artist-funcall init-fn x1 y1)
4964 (if (not artist-rubber-banding) 4964 (if (not artist-rubber-banding)
4965 (artist-no-rb-set-point1 x1 y1)) 4965 (artist-no-rb-set-point1 x1 y1))
4966 (track-mouse 4966 (unwind-protect
4967 (while (or (mouse-movement-p ev) 4967 (track-mouse
4968 (member 'down (event-modifiers ev))) 4968 (while (or (mouse-movement-p ev)
4969 (setq ev-start-pos (artist-coord-win-to-buf 4969 (member 'down (event-modifiers ev)))
4970 (posn-col-row (event-start ev)))) 4970 (setq ev-start-pos (artist-coord-win-to-buf
4971 (setq x1 (car ev-start-pos)) 4971 (posn-col-row (event-start ev))))
4972 (setq y1 (cdr ev-start-pos)) 4972 (setq x1 (car ev-start-pos))
4973 4973 (setq y1 (cdr ev-start-pos))
4974 ;; Cancel previous timer 4974
4975 (if timer 4975 ;; Cancel previous timer
4976 (cancel-timer timer)) 4976 (if timer
4977 4977 (cancel-timer timer))
4978 (if (not (eq initial-win (posn-window (event-start ev)))) 4978
4979 ;; If we moved outside the window, do nothing 4979 (if (not (eq initial-win (posn-window (event-start ev))))
4980 nil 4980 ;; If we moved outside the window, do nothing
4981 4981 nil
4982 ;; Still in same window: 4982
4983 ;; 4983 ;; Still in same window:
4984 ;; Check if user presses or releases shift key 4984 ;;
4985 (if (artist-shift-has-changed shift-state ev) 4985 ;; Check if user presses or releases shift key
4986 4986 (if (artist-shift-has-changed shift-state ev)
4987 ;; First check that the draw-how is the same as we 4987
4988 ;; already have. Otherwise, ignore the changed shift-state. 4988 ;; First check that the draw-how is the same as we
4989 (if (not (eq draw-how 4989 ;; already have. Otherwise, ignore the changed shift-state.
4990 (artist-go-get-draw-how-from-symbol 4990 (if (not (eq draw-how
4991 (if (not shift-state) shifted unshifted)))) 4991 (artist-go-get-draw-how-from-symbol
4992 (message "Cannot switch to shifted operation") 4992 (if (not shift-state) shifted unshifted))))
4993 4993 (message "Cannot switch to shifted operation")
4994 ;; progn is "implicit" since this is the else-part 4994
4995 (setq shift-state (not shift-state)) 4995 ;; progn is "implicit" since this is the else-part
4996 (setq op (if shift-state shifted unshifted)) 4996 (setq shift-state (not shift-state))
4997 (setq draw-how (artist-go-get-draw-how-from-symbol op)) 4997 (setq op (if shift-state shifted unshifted))
4998 (setq draw-fn (artist-go-get-draw-fn-from-symbol op)))) 4998 (setq draw-how (artist-go-get-draw-how-from-symbol op))
4999 4999 (setq draw-fn (artist-go-get-draw-fn-from-symbol op))))
5000 ;; Draw the new shape 5000
5001 (setq shape (artist-funcall draw-fn x1 y1)) 5001 ;; Draw the new shape
5002 (artist-move-to-xy x1 y1) 5002 (setq shape (artist-funcall draw-fn x1 y1))
5003 5003 (artist-move-to-xy x1 y1)
5004 ;; Start the timer to call `draw-fn' repeatedly every 5004
5005 ;; `interval' second 5005 ;; Start the timer to call `draw-fn' repeatedly every
5006 (if (and interval draw-fn) 5006 ;; `interval' second
5007 (setq timer (run-at-time interval interval draw-fn x1 y1)))) 5007 (if (and interval draw-fn)
5008 5008 (setq timer (run-at-time interval interval draw-fn x1 y1))))
5009 ;; Read next event 5009
5010 (setq ev (read-event)))) 5010 ;; Read next event
5011 5011 (setq ev (read-event))))
5012 ;; Cleanup: get rid of any active timer.
5013 (if timer
5014 (cancel-timer timer)))
5012 ;; Cancel any timers 5015 ;; Cancel any timers
5013 (if timer 5016 (if timer
5014 (cancel-timer timer)) 5017 (cancel-timer timer))
diff --git a/src/ChangeLog b/src/ChangeLog
index 5ced4734bc9..d46e34c8525 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12015-01-21 Paul Eggert <eggert@cs.ucla.edu>
2
3 Fix coding.c subscript error
4 * coding.c (CODING_ISO_INVOKED_CHARSET):
5 Avoid undefined behavior if CODING_ISO_INVOCATION returns negative.
6
12015-01-17 Eli Zaretskii <eliz@gnu.org> 72015-01-17 Eli Zaretskii <eliz@gnu.org>
2 8
3 * xdisp.c (produce_image_glyph): Fix display of images in R2L 9 * xdisp.c (produce_image_glyph): Fix display of images in R2L
diff --git a/src/coding.c b/src/coding.c
index 54811588c6a..a7128ee3e73 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -350,7 +350,8 @@ static Lisp_Object Vbig5_coding_system;
350#define CODING_ISO_BOL(coding) \ 350#define CODING_ISO_BOL(coding) \
351 ((coding)->spec.iso_2022.bol) 351 ((coding)->spec.iso_2022.bol)
352#define CODING_ISO_INVOKED_CHARSET(coding, plane) \ 352#define CODING_ISO_INVOKED_CHARSET(coding, plane) \
353 CODING_ISO_DESIGNATION ((coding), CODING_ISO_INVOCATION ((coding), (plane))) 353 (CODING_ISO_INVOCATION (coding, plane) < 0 ? -1 \
354 : CODING_ISO_DESIGNATION (coding, CODING_ISO_INVOCATION (coding, plane)))
354#define CODING_ISO_CMP_STATUS(coding) \ 355#define CODING_ISO_CMP_STATUS(coding) \
355 (&(coding)->spec.iso_2022.cmp_status) 356 (&(coding)->spec.iso_2022.cmp_status)
356#define CODING_ISO_EXTSEGMENT_LEN(coding) \ 357#define CODING_ISO_EXTSEGMENT_LEN(coding) \