------------------------------------------------------------ revno: 117086 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2014-05-11 01:49:14 -0400 message: * lisp/mouse.el: Use the normal toplevel loop while dragging. (mouse-set-point): Handle multi-clicks. (mouse-set-region): Handle multi-clicks for drags. (mouse-drag-region): Update call accordingly. (mouse-drag-track): Remove `do-mouse-drag-region-post-process' hack. Use the normal event loop instead of a local while/read-event loop. (global-map): Remove redundant bindings for double/triple-mouse-1. * lisp/xt-mouse.el (xterm-mouse-translate-1): Only process one event at a time. Generate synthetic down events when the protocol only sends up events. (xterm-mouse-last): Remove. (xterm-mouse--read-event-sequence-1000): Use xterm-mouse-last-down terminal parameter instead. (xterm-mouse--set-click-count): New function. (xterm-mouse-event): Detect/generate double/triple clicks. * lisp/reveal.el (reveal-close-old-overlays): Don't close while dragging. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-11 03:49:53 +0000 +++ lisp/ChangeLog 2014-05-11 05:49:14 +0000 @@ -1,5 +1,21 @@ 2014-05-11 Stefan Monnier + * mouse.el: Use the normal toplevel loop while dragging. + (mouse-set-point): Handle multi-clicks. + (mouse-set-region): Handle multi-clicks for drags. + (mouse-drag-region): Update call accordingly. + (mouse-drag-track): Remove `do-mouse-drag-region-post-process' hack. + Use the normal event loop instead of a local while/read-event loop. + (global-map): Remove redundant bindings for double/triple-mouse-1. + * xt-mouse.el (xterm-mouse-translate-1): Only process one event at a time. + Generate synthetic down events when the protocol only sends up events. + (xterm-mouse-last): Remove. + (xterm-mouse--read-event-sequence-1000): Use xterm-mouse-last-down + terminal parameter instead. + (xterm-mouse--set-click-count): New function. + (xterm-mouse-event): Detect/generate double/triple clicks. + * reveal.el (reveal-close-old-overlays): Don't close while dragging. + * info.el (Info-quoted): New face. (Info-mode-font-lock-keywords): New var. (Info-mode): Use it. === modified file 'lisp/mouse.el' --- lisp/mouse.el 2014-02-10 01:34:22 +0000 +++ lisp/mouse.el 2014-05-11 05:49:14 +0000 @@ -514,14 +514,18 @@ (interactive "e") (mouse-drag-line start-event 'vertical)) -(defun mouse-set-point (event) +(defun mouse-set-point (event &optional promote-to-region) "Move point to the position clicked on with the mouse. -This should be bound to a mouse click event type." - (interactive "e") +This should be bound to a mouse click event type. +If PROMOTE-TO-REGION is non-nil and event is a multiple-click, +select the corresponding element around point." + (interactive "e\np") (mouse-minibuffer-check event) - ;; Use event-end in case called from mouse-drag-region. - ;; If EVENT is a click, event-end and event-start give same value. - (posn-set-point (event-end event))) + (if (and promote-to-region (> (event-click-count event) 1)) + (mouse-set-region event) + ;; Use event-end in case called from mouse-drag-region. + ;; If EVENT is a click, event-end and event-start give same value. + (posn-set-point (event-end event)))) (defvar mouse-last-region-beg nil) (defvar mouse-last-region-end nil) @@ -534,6 +538,8 @@ (eq mouse-last-region-end (region-end)) (eq mouse-last-region-tick (buffer-modified-tick)))) +(defvar mouse--drag-start-event nil) + (defun mouse-set-region (click) "Set the region to the text dragged over, and copy to kill ring. This should be bound to a mouse drag event. @@ -543,7 +549,22 @@ (mouse-minibuffer-check click) (select-window (posn-window (event-start click))) (let ((beg (posn-point (event-start click))) - (end (posn-point (event-end click)))) + (end (posn-point (event-end click))) + (click-count (event-click-count click))) + (let ((drag-start (terminal-parameter nil 'mouse-drag-start))) + ;; Drag events don't come with a click count, sadly, so we hack + ;; our way around this problem by remembering the start-event in + ;; `mouse-drag-start' and fetching the click-count from there. + (when drag-start + (when (and (<= click-count 1) + (equal beg (posn-point (event-start drag-start)))) + (setq click-count (event-click-count drag-start))) + (setf (terminal-parameter nil 'mouse-drag-start) nil))) + (when (and (integerp beg) (integerp end)) + (let ((range (mouse-start-end beg end (1- click-count)))) + (if (< end beg) + (setq end (nth 0 range) beg (nth 1 range)) + (setq beg (nth 0 range) end (nth 1 range))))) (and mouse-drag-copy-region (integerp beg) (integerp end) ;; Don't set this-command to `kill-region', so a following ;; C-w won't double the text in the kill ring. Ignore @@ -637,13 +658,11 @@ Highlight the drag area as you move the mouse. This must be bound to a button-down mouse event. In Transient Mark mode, the highlighting remains as long as the mark -remains active. Otherwise, it remains until the next input event. - -If the click is in the echo area, display the `*Messages*' buffer." +remains active. Otherwise, it remains until the next input event." (interactive "e") ;; Give temporary modes such as isearch a chance to turn off. (run-hooks 'mouse-leave-buffer-hook) - (mouse-drag-track start-event t)) + (mouse-drag-track start-event)) (defun mouse-posn-property (pos property) @@ -747,12 +766,9 @@ "mouse-1" (substring msg 7))))))) msg) -(defun mouse-drag-track (start-event &optional - do-mouse-drag-region-post-process) +(defun mouse-drag-track (start-event) "Track mouse drags by highlighting area between point and cursor. -The region will be defined with mark and point. -DO-MOUSE-DRAG-REGION-POST-PROCESS should only be used by -`mouse-drag-region'." +The region will be defined with mark and point." (mouse-minibuffer-check start-event) (setq mouse-selection-click-count-buffer (current-buffer)) (deactivate-mark) @@ -765,8 +781,6 @@ (start-posn (event-start start-event)) (start-point (posn-point start-posn)) (start-window (posn-window start-posn)) - (start-window-start (window-start start-window)) - (start-hscroll (window-hscroll start-window)) (bounds (window-edges start-window)) (make-cursor-line-fully-visible nil) (top (nth 1 bounds)) @@ -777,9 +791,7 @@ (click-count (1- (event-click-count start-event))) ;; Suppress automatic hscrolling, because that is a nuisance ;; when setting point near the right fringe (but see below). - (auto-hscroll-mode-saved auto-hscroll-mode) - (auto-hscroll-mode nil) - moved-off-start event end end-point) + (auto-hscroll-mode-saved auto-hscroll-mode)) (setq mouse-selection-click-count click-count) ;; In case the down click is in the middle of some intangible text, @@ -798,23 +810,21 @@ (push-mark (nth 0 range) t t) (goto-char (nth 1 range))) - ;; Track the mouse until we get a non-movement event. - (track-mouse - (while (progn - (setq event (read-event)) - (or (mouse-movement-p event) - (memq (car-safe event) '(switch-frame select-window)))) - (unless (memq (car-safe event) '(switch-frame select-window)) - ;; Automatic hscrolling did not occur during the call to - ;; `read-event'; but if the user subsequently drags the - ;; mouse, go ahead and hscroll. - (let ((auto-hscroll-mode auto-hscroll-mode-saved)) - (redisplay)) - (setq end (event-end event) - end-point (posn-point end)) - ;; Note whether the mouse has left the starting position. + (setf (terminal-parameter nil 'mouse-drag-start) start-event) + (setq track-mouse t) + (setq auto-hscroll-mode nil) + + (set-transient-map + (let ((map (make-sparse-keymap))) + (define-key map [switch-frame] #'ignore) + (define-key map [select-window] #'ignore) + (define-key map [mouse-movement] + (lambda (event) (interactive "e") + (let* ((end (event-end event)) + (end-point (posn-point end))) (unless (eq end-point start-point) - (setq moved-off-start t)) + ;; As soon as the user moves, we can re-enable auto-hscroll. + (setq auto-hscroll-mode auto-hscroll-mode-saved)) (if (and (eq (posn-window end) start-window) (integer-or-marker-p end-point)) (mouse--drag-set-mark-and-point start-point @@ -828,55 +838,12 @@ ((>= mouse-row bottom) (mouse-scroll-subr start-window (1+ (- mouse-row bottom)) nil start-point)))))))) - - ;; Handle the terminating event if possible. - (when (consp event) - ;; Ensure that point is on the end of the last event. - (when (and (setq end-point (posn-point (event-end event))) - (eq (posn-window end) start-window) - (integer-or-marker-p end-point) - (/= start-point end-point)) - (mouse--drag-set-mark-and-point start-point - end-point click-count)) - - ;; Find its binding. - (let* ((fun (key-binding (vector (car event)))) - ;; FIXME This doesn't make sense, because - ;; event-click-count always returns something >= 1. - (do-multi-click (and (> (event-click-count event) 0) - (functionp fun) - (not (memq fun '(mouse-set-point - mouse-set-region)))))) - (if (and (/= (mark) (point)) - (not do-multi-click)) - - ;; If point has moved, finish the drag. - (let* (last-command this-command) - (and mouse-drag-copy-region - do-mouse-drag-region-post-process - (let (deactivate-mark) - (copy-region-as-kill (mark) (point))))) - - ;; Otherwise, run binding of terminating up-event. + map) + t (lambda () + (setq track-mouse nil) + (setq auto-hscroll-mode auto-hscroll-mode-saved) (deactivate-mark) - (if do-multi-click - (goto-char start-point) - (unless moved-off-start - (pop-mark))) - - (when (and (functionp fun) - (= start-hscroll (window-hscroll start-window)) - ;; Don't run the up-event handler if the window - ;; start changed in a redisplay after the - ;; mouse-set-point for the down-mouse event at - ;; the beginning of this function. When the - ;; window start has changed, the up-mouse event - ;; contains a different position due to the new - ;; window contents, and point is set again. - (or end-point - (= (window-start start-window) - start-window-start))) - (push event unread-command-events))))))) + (pop-mark))))) (defun mouse--drag-set-mark-and-point (start click click-count) (let* ((range (mouse-start-end start click click-count)) @@ -1904,14 +1871,10 @@ ;;; Bindings for mouse commands. -(define-key global-map [down-mouse-1] 'mouse-drag-region) +(global-set-key [down-mouse-1] 'mouse-drag-region) (global-set-key [mouse-1] 'mouse-set-point) (global-set-key [drag-mouse-1] 'mouse-set-region) -;; These are tested for in mouse-drag-region. -(global-set-key [double-mouse-1] 'mouse-set-point) -(global-set-key [triple-mouse-1] 'mouse-set-point) - (defun mouse--strip-first-event (_prompt) (substring (this-single-command-raw-keys) 1)) === modified file 'lisp/reveal.el' --- lisp/reveal.el 2014-01-01 07:43:34 +0000 +++ lisp/reveal.el 2014-05-11 05:49:14 +0000 @@ -83,7 +83,8 @@ (cond ((eq (car x) (selected-window)) (cdr x)) ((not (and (window-live-p (car x)) - (eq (window-buffer (car x)) (current-buffer)))) + (eq (window-buffer (car x)) + (current-buffer)))) ;; Adopt this since it's owned by a window that's ;; either not live or at least not showing this ;; buffer any more. @@ -135,8 +136,9 @@ old-ols) (defun reveal-close-old-overlays (old-ols) - (if (not (eq reveal-last-tick - (setq reveal-last-tick (buffer-modified-tick)))) + (if (or track-mouse ;Don't close in the middle of a click. + (not (eq reveal-last-tick + (setq reveal-last-tick (buffer-modified-tick))))) ;; The buffer was modified since last command: let's refrain from ;; closing any overlay because it tends to behave poorly when ;; inserting text at the end of an overlay (basically the overlay === modified file 'lisp/xt-mouse.el' --- lisp/xt-mouse.el 2014-05-08 03:41:21 +0000 +++ lisp/xt-mouse.el 2014-05-11 05:49:14 +0000 @@ -42,13 +42,12 @@ (defvar xterm-mouse-debug-buffer nil) -(defvar xterm-mouse-last) - ;; Mouse events symbols must have an 'event-kind property with ;; the value 'mouse-click. -(dolist (event-type '(mouse-1 mouse-2 mouse-3 - M-down-mouse-1 M-down-mouse-2 M-down-mouse-3)) - (put event-type 'event-kind 'mouse-click)) +(dolist (event '(mouse-1 mouse-2 mouse-3 mouse-4 mouse-5)) + (let ((M-event (intern (concat "M-" (symbol-name event))))) + (put event 'event-kind 'mouse-click) + (put M-event 'event-kind 'mouse-click))) (defun xterm-mouse-translate (_event) "Read a click and release event from XTerm." @@ -65,59 +64,47 @@ (save-excursion (save-window-excursion ;FIXME: Why? (deactivate-mark) ;FIXME: Why? - (let* ((xterm-mouse-last nil) - (down (xterm-mouse-event extension)) - (down-command (nth 0 down)) - (down-data (nth 1 down)) - (down-where (nth 1 down-data)) - (down-binding (key-binding (if (symbolp down-where) - (vector down-where down-command) - (vector down-command)))) - (is-down (string-match "down" (symbol-name (car down))))) - - ;; Retrieve the expected preface for the up-event. - (unless is-down - (unless (cond ((null extension) - (and (eq (read-event) ?\e) - (eq (read-event) ?\[) - (eq (read-event) ?M))) - ((eq extension 1006) - (and (eq (read-event) ?\e) - (eq (read-event) ?\[) - (eq (read-event) ?<)))) - (error "Unexpected escape sequence from XTerm"))) - - ;; Process the up-event. - (let* ((click (if is-down (xterm-mouse-event extension) down)) - (click-data (nth 1 click)) - (click-where (nth 1 click-data))) + (let* ((event (xterm-mouse-event extension)) + (ev-command (nth 0 event)) + (ev-data (nth 1 event)) + (ev-where (nth 1 ev-data)) + (vec (if (and (symbolp ev-where) (consp ev-where)) + ;; FIXME: This condition can *never* be non-nil!?! + (vector (list ev-where ev-data) event) + (vector event))) + (is-down (string-match "down-" (symbol-name ev-command)))) + (cond - ((null down) nil) - ((memq down-binding '(nil ignore)) - (if (and (symbolp click-where) - (consp click-where)) - (vector (list click-where click-data) click) - (vector click))) + ((null event) nil) ;Unknown/bogus byte sequence! + (is-down + (setf (terminal-parameter nil 'xterm-mouse-last-down) event) + vec) + (t + (let* ((down (terminal-parameter nil 'xterm-mouse-last-down)) + (down-data (nth 1 down)) + (down-where (nth 1 down-data))) + (setf (terminal-parameter nil 'xterm-mouse-last-down) nil) + (cond + ((null down) + ;; This is an "up-only" event. Pretend there was an up-event + ;; right before and keep the up-event for later. + (push event unread-command-events) + (vector (cons (intern (replace-regexp-in-string + "\\`\\([ACMHSs]-\\)*" "\\&down-" + (symbol-name ev-command) t)) + (cdr event)))) + ((equal ev-where down-where) vec) (t - (setq unread-command-events - (append (if (eq down-where click-where) - (list click) - (list - ;; Cheat `mouse-drag-region' with move event. - (list 'mouse-movement click-data) - ;; Generate a drag event. - (if (symbolp down-where) - 0 - (list (intern (format "drag-mouse-%d" - (1+ xterm-mouse-last))) - down-data click-data)))) - unread-command-events)) - (if xterm-mouse-debug-buffer - (print unread-command-events xterm-mouse-debug-buffer)) - (if (and (symbolp down-where) - (consp down-where)) - (vector (list down-where down-data) down) - (vector down))))))))) + (let ((drag (if (symbolp ev-where) + 0 ;FIXME: Why?!? + (list (replace-regexp-in-string + "\\`\\([ACMHSs]-\\)*" "\\&drag-" + (symbol-name ev-command) t) + down-data ev-data)))) + (if (null track-mouse) + (vector drag) + (push drag unread-command-events) + (vector (list 'mouse-movement ev-data))))))))))))) ;; These two variables have been converted to terminal parameters. ;; @@ -165,16 +152,14 @@ (cond ((>= code 64) (format "mouse-%d" (- code 60))) ((memq code '(8 9 10)) - (setq xterm-mouse-last (- code 8)) (format "M-down-mouse-%d" (- code 7))) - ((and (= code 11) xterm-mouse-last) - (format "M-mouse-%d" (1+ xterm-mouse-last))) - ((and (= code 3) xterm-mouse-last) - ;; For buttons > 5 xterm only reports a button-release event. - ;; Drop them since they're not usable and can be spurious. - (format "mouse-%d" (1+ xterm-mouse-last))) + ((memq code '(3 11)) + (let ((down (car (terminal-parameter + nil 'xterm-mouse-last-down)))) + (when (and down (string-match "[0-9]" (symbol-name down))) + (format (if (eq code 3) "mouse-%s" "M-mouse-%s") + (match-string 0 (symbol-name down)))))) ((memq code '(0 1 2)) - (setq xterm-mouse-last code) (format "down-mouse-%d" (+ 1 code)))))) (x (- (read-event) 33)) (y (- (read-event) 33))) @@ -212,10 +197,20 @@ (if down "down-" "") (if wheel (- code 60) - (1+ (setq xterm-mouse-last (mod code 4))))))) + (1+ (mod code 4)))))) (1- (string-to-number (apply 'string (nreverse x-bytes)))) (1- (string-to-number (apply 'string (nreverse y-bytes))))))) +(defun xterm-mouse--set-click-count (event click-count) + (setcdr (cdr event) (list click-count)) + (let ((name (symbol-name (car event)))) + (when (string-match "\\(.*?\\)\\(\\(?:down-\\)?mouse-.*\\)" name) + (setcar event + (intern (concat (match-string 1 name) + (if (= click-count 2) + "double-" "triple-") + (match-string 2 name))))))) + (defun xterm-mouse-event (&optional extension) "Convert XTerm mouse event to Emacs mouse event. EXTENSION, if non-nil, means to use an extension to the usual @@ -241,18 +236,42 @@ (w (window-at x y)) (ltrb (window-edges w)) (left (nth 0 ltrb)) - (top (nth 1 ltrb))) + (top (nth 1 ltrb)) + (posn (if w + (posn-at-x-y (- x left) (- y top) w t) + (append (list nil 'menu-bar) + (nthcdr 2 (posn-at-x-y x y))))) + (event (list type posn))) + (setcar (nthcdr 3 posn) timestamp) + + ;; Try to handle double/triple clicks. + (let* ((last-click (terminal-parameter nil 'xterm-mouse-last-click)) + (last-type (nth 0 last-click)) + (last-name (symbol-name last-type)) + (last-time (nth 1 last-click)) + (click-count (nth 2 last-click)) + (this-time (float-time)) + (name (symbol-name type))) + (cond + ((not (string-match "down-" name)) + ;; For up events, make the up side match the down side. + (setq this-time last-time) + (when (and (> click-count 1) + (string-match "down-" last-name) + (equal name (replace-match "" t t last-name))) + (xterm-mouse--set-click-count event click-count))) + ((not last-time) nil) + ((and (> double-click-time (* 1000 (- this-time last-time))) + (equal last-name (replace-match "" t t name))) + (setq click-count (1+ click-count)) + (xterm-mouse--set-click-count event click-count)) + (t (setq click-count 1))) + (set-terminal-parameter nil 'xterm-mouse-last-click + (list type this-time click-count))) + (set-terminal-parameter nil 'xterm-mouse-x x) (set-terminal-parameter nil 'xterm-mouse-y y) - (setq - last-input-event - (list type - (let ((event (if w - (posn-at-x-y (- x left) (- y top) w t) - (append (list nil 'menu-bar) - (nthcdr 2 (posn-at-x-y x y)))))) - (setcar (nthcdr 3 event) timestamp) - event))))))) + (setq last-input-event event))))) ;;;###autoload (define-minor-mode xterm-mouse-mode ------------------------------------------------------------ revno: 117085 committer: Stefan Monnier branch nick: trunk timestamp: Sat 2014-05-10 23:49:53 -0400 message: * lisp/info.el (Info-quoted): New face. (Info-mode-font-lock-keywords): New var. (Info-mode): Use it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-11 03:48:15 +0000 +++ lisp/ChangeLog 2014-05-11 03:49:53 +0000 @@ -1,5 +1,9 @@ 2014-05-11 Stefan Monnier + * info.el (Info-quoted): New face. + (Info-mode-font-lock-keywords): New var. + (Info-mode): Use it. + * emacs-lisp/lisp-mode.el (preceding-sexp): Exclude leading "," which are a hindrance for C-x C-e. @@ -232,14 +236,14 @@ (diary-chinese-insert-yearly-entry): New commands to insert Chinese diary entries. - * calendar/diary-lib.el (diary-font-lock-keywords): Support - font-locking Chinese dates. + * calendar/diary-lib.el (diary-font-lock-keywords): + Support font-locking Chinese dates. * calendar/cal-menu.el (cal-menu-diary-menu): Add entries for inserting Chinese diary entries. - * calendar/calendar.el (diary-chinese-entry-symbol): New - customizable variable. + * calendar/calendar.el (diary-chinese-entry-symbol): + New customizable variable. (calendar-mode-map): Add bindings for inserting Chinese diary entries. @@ -258,8 +262,8 @@ incorrectness of position adjustments when undoing in region. (Bug#17235) (undo-elt-crosses-region): Make obsolete. - (undo-adjust-elt, undo-adjust-beg-end, undo-adjust-pos): New - functions to adjust positions using undo-deltas. + (undo-adjust-elt, undo-adjust-beg-end, undo-adjust-pos): + New functions to adjust positions using undo-deltas. 2014-05-01 Stefan Monnier === modified file 'lisp/info.el' --- lisp/info.el 2014-04-24 14:04:36 +0000 +++ lisp/info.el 2014-05-11 03:49:53 +0000 @@ -4209,9 +4209,16 @@ st) "Syntax table used in `Info-mode'.") +(defface Info-quoted + '((t :family "courier")) + "Face used for quoted elements.") + +(defvar Info-mode-font-lock-keywords + '(("‘\\([^’]*\\)’" (1 'Info-quoted)))) + ;; Autoload cookie needed by desktop.el ;;;###autoload -(define-derived-mode Info-mode nil "Info" +(define-derived-mode Info-mode nil "Info" ;FIXME: Derive from special-mode? "Info mode provides commands for browsing through the Info documentation tree. Documentation in Info is divided into \"nodes\", each of which discusses one topic and contains references to other nodes which discuss related @@ -4297,6 +4304,7 @@ (setq-local isearch-push-state-function #'Info-isearch-push-state) (setq-local isearch-filter-predicate #'Info-isearch-filter) (setq-local revert-buffer-function #'Info-revert-buffer-function) + (setq-local font-lock-defaults '(Info-mode-font-lock-keywords t t)) (Info-set-mode-line) (setq-local bookmark-make-record-function #'Info-bookmark-make-record)) ------------------------------------------------------------ revno: 117084 committer: Stefan Monnier branch nick: trunk timestamp: Sat 2014-05-10 23:48:15 -0400 message: * lisp/emacs-lisp/lisp-mode.el (preceding-sexp): Exclude leading "," which are a hindrance for C-x C-e. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-11 01:39:49 +0000 +++ lisp/ChangeLog 2014-05-11 03:48:15 +0000 @@ -1,3 +1,8 @@ +2014-05-11 Stefan Monnier + + * emacs-lisp/lisp-mode.el (preceding-sexp): Exclude leading "," which + are a hindrance for C-x C-e. + 2014-05-11 Leo Liu * net/rcirc.el (rcirc-sentinel): Fix last change. === modified file 'lisp/emacs-lisp/lisp-mode.el' --- lisp/emacs-lisp/lisp-mode.el 2014-05-01 16:14:03 +0000 +++ lisp/emacs-lisp/lisp-mode.el 2014-05-11 03:48:15 +0000 @@ -1017,26 +1017,20 @@ (forward-sexp -1)))) (save-restriction - ;; vladimir@cs.ualberta.ca 30-Jul-1997: skip ` in - ;; `variable' so that the value is returned, not the - ;; name - (if (and ignore-quotes - (eq (following-char) ?`)) + (if (and ignore-quotes (eq (following-char) ?`)) + ;; vladimir@cs.ualberta.ca 30-Jul-1997: Skip ` in `variable' so + ;; that the value is returned, not the name. (forward-char)) + (when (looking-at ",@?") (goto-char (match-end 0))) (narrow-to-region (point-min) opoint) (setq expr (read (current-buffer))) - ;; If it's an (interactive ...) form, it's more - ;; useful to show how an interactive call would - ;; use it. - (and (consp expr) - (eq (car expr) 'interactive) + ;; If it's an (interactive ...) form, it's more useful to show how an + ;; interactive call would use it. + ;; FIXME: Is it really the right place for this? + (when (eq (car-safe expr) 'interactive) (setq expr - (list 'call-interactively - (list 'quote - (list 'lambda - '(&rest args) - expr - 'args))))) + `(call-interactively + (lambda (&rest args) ,expr args)))) expr))))) ------------------------------------------------------------ revno: 117083 fixes bug: http://debbugs.gnu.org/17438 committer: Paul Eggert branch nick: trunk timestamp: Sat 2014-05-10 19:52:00 -0700 message: Revert last two changes. diff: === modified file 'ChangeLog' --- ChangeLog 2014-05-11 02:47:57 +0000 +++ ChangeLog 2014-05-11 02:52:00 +0000 @@ -1,10 +1,3 @@ -2014-05-11 Paul Eggert - - Require pkg-config 0.26 or later (Bug#17438). - Earlier versions are buggy, as pkg-config --libs can output - nothing, which causes xrandr link failures. - * autogen.sh (pkg_config_min): Make this at least 0.26. - 2014-05-07 Glenn Morris * autogen.sh: Check for failing aclocal. === modified file 'autogen.sh' --- autogen.sh 2014-05-11 02:47:57 +0000 +++ autogen.sh 2014-05-11 02:52:00 +0000 @@ -42,11 +42,6 @@ automake_min=`sed -n 's/^ *AM_INIT_AUTOMAKE(\([0-9\.]*\)).*/\1/p' configure.ac` pkg_config_min=`sed -n 's/^ *PKG_PROG_PKG_CONFIG(\([0-9\.]*\)).*/\1/p' configure.ac` -# Building from the repository needs pkg-config 0.26 or later; see Bug#17438. -case $pkg_config_min in - 0.[0-9] | 0.[0-9].* | 0.1[0-9] | 0.1[0-9].* | 0.2[0-5] | 0.2[0-5].* ) - pkg_config_min=0.26 -esac ## $1 = program, eg "autoconf". ## Echo the version string, eg "2.59". ------------------------------------------------------------ revno: 117082 fixes bug: http://debbugs.gnu.org/17438 committer: Paul Eggert branch nick: trunk timestamp: Sat 2014-05-10 19:47:57 -0700 message: Require pkg-config 0.26 or later in autogen.sh only. * autogen.sh (pkg_config_min): Make this at least 0.26. * configure.ac (PKG_PROG_PKG_CONFIG): Revert back to 0.9.0. diff: === modified file 'ChangeLog' --- ChangeLog 2014-05-11 02:27:53 +0000 +++ ChangeLog 2014-05-11 02:47:57 +0000 @@ -3,7 +3,7 @@ Require pkg-config 0.26 or later (Bug#17438). Earlier versions are buggy, as pkg-config --libs can output nothing, which causes xrandr link failures. - * configure.ac (PKG_PROG_PKG_CONFIG): Bump from 0.9.0 to 0.26. + * autogen.sh (pkg_config_min): Make this at least 0.26. 2014-05-07 Glenn Morris === modified file 'autogen.sh' --- autogen.sh 2014-05-07 16:56:34 +0000 +++ autogen.sh 2014-05-11 02:47:57 +0000 @@ -42,6 +42,11 @@ automake_min=`sed -n 's/^ *AM_INIT_AUTOMAKE(\([0-9\.]*\)).*/\1/p' configure.ac` pkg_config_min=`sed -n 's/^ *PKG_PROG_PKG_CONFIG(\([0-9\.]*\)).*/\1/p' configure.ac` +# Building from the repository needs pkg-config 0.26 or later; see Bug#17438. +case $pkg_config_min in + 0.[0-9] | 0.[0-9].* | 0.1[0-9] | 0.1[0-9].* | 0.2[0-5] | 0.2[0-5].* ) + pkg_config_min=0.26 +esac ## $1 = program, eg "autoconf". ## Echo the version string, eg "2.59". === modified file 'configure.ac' --- configure.ac 2014-05-11 02:27:53 +0000 +++ configure.ac 2014-05-11 02:47:57 +0000 @@ -1349,7 +1349,7 @@ pre_PKG_CONFIG_CFLAGS=$CFLAGS pre_PKG_CONFIG_LIBS=$LIBS -PKG_PROG_PKG_CONFIG(0.26) +PKG_PROG_PKG_CONFIG(0.9.0) dnl EMACS_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4) dnl acts like PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, ------------------------------------------------------------ revno: 117081 fixes bug: http://debbugs.gnu.org/17438 committer: Paul Eggert branch nick: trunk timestamp: Sat 2014-05-10 19:27:53 -0700 message: Require pkg-config 0.26 or later. Earlier versions are buggy, as pkg-config --libs can output nothing, which causes xrandr link failures. * configure.ac (PKG_PROG_PKG_CONFIG): Bump from 0.9.0 to 0.26. diff: === modified file 'ChangeLog' --- ChangeLog 2014-05-07 16:56:34 +0000 +++ ChangeLog 2014-05-11 02:27:53 +0000 @@ -1,3 +1,10 @@ +2014-05-11 Paul Eggert + + Require pkg-config 0.26 or later (Bug#17438). + Earlier versions are buggy, as pkg-config --libs can output + nothing, which causes xrandr link failures. + * configure.ac (PKG_PROG_PKG_CONFIG): Bump from 0.9.0 to 0.26. + 2014-05-07 Glenn Morris * autogen.sh: Check for failing aclocal. === modified file 'configure.ac' --- configure.ac 2014-05-06 20:36:40 +0000 +++ configure.ac 2014-05-11 02:27:53 +0000 @@ -1349,7 +1349,7 @@ pre_PKG_CONFIG_CFLAGS=$CFLAGS pre_PKG_CONFIG_LIBS=$LIBS -PKG_PROG_PKG_CONFIG(0.9.0) +PKG_PROG_PKG_CONFIG(0.26) dnl EMACS_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4) dnl acts like PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, ------------------------------------------------------------ revno: 117080 committer: Leo Liu branch nick: trunk timestamp: Sun 2014-05-11 09:39:49 +0800 message: * net/rcirc.el (rcirc-sentinel): Fix last change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-09 17:04:46 +0000 +++ lisp/ChangeLog 2014-05-11 01:39:49 +0000 @@ -1,3 +1,7 @@ +2014-05-11 Leo Liu + + * net/rcirc.el (rcirc-sentinel): Fix last change. + 2014-05-08 Sam Steingold * net/rcirc.el (rcirc-reconnect-delay): New user option. === modified file 'lisp/net/rcirc.el' --- lisp/net/rcirc.el 2014-05-09 17:04:46 +0000 +++ lisp/net/rcirc.el 2014-05-11 01:39:49 +0000 @@ -686,7 +686,7 @@ (when (or (null rcirc-last-connect-time) (< rcirc-reconnect-delay (float-time (time-subtract now rcirc-last-connect-time)))) - (setq sds-rcirc-sentinel-last now) + (setq rcirc-last-connect-time now) (rcirc-cmd-reconnect nil)))) (run-hook-with-args 'rcirc-sentinel-functions process sentinel)))) ------------------------------------------------------------ revno: 117079 committer: Sam Steingold branch nick: trunk timestamp: Fri 2014-05-09 13:04:46 -0400 message: Optionally auto-reconnect depending on `rcirc-reconnect-delay'. * net/rcirc.el (rcirc-reconnect-delay): New user option. (rcirc-sentinel): Auto-reconnect to the server if `rcirc-reconnect-delay' is non-0 (but not more often than its value in case the host is off-line). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-09 09:10:56 +0000 +++ lisp/ChangeLog 2014-05-09 17:04:46 +0000 @@ -1,3 +1,10 @@ +2014-05-08 Sam Steingold + + * net/rcirc.el (rcirc-reconnect-delay): New user option. + (rcirc-sentinel): Auto-reconnect to the server if + `rcirc-reconnect-delay' is non-0 (but not more often than its + value in case the host is off-line). + 2014-05-09 Eli Zaretskii * progmodes/grep.el (lgrep): Fix a typo in last commit. === modified file 'lisp/net/rcirc.el' --- lisp/net/rcirc.el 2014-04-09 13:37:49 +0000 +++ lisp/net/rcirc.el 2014-05-09 17:04:46 +0000 @@ -658,6 +658,15 @@ "Hook functions called when the process sentinel is called. Functions are called with PROCESS and SENTINEL arguments.") +(defcustom rcirc-reconnect-delay 0 + "*The minimum interval in seconds between reconnect attempts. +When 0, do not auto-reconnect." + :type 'integer + :group 'rcirc) + +(defvar rcirc-last-connect-time nil + "The last time the buffer was connected.") + (defun rcirc-sentinel (process sentinel) "Called when PROCESS receives SENTINEL." (let ((sentinel (replace-regexp-in-string "\n" "" sentinel))) @@ -671,6 +680,14 @@ sentinel (process-status process)) (not rcirc-target)) (rcirc-disconnect-buffer))) + (when (and (string= sentinel "deleted") + (< 0 rcirc-reconnect-delay)) + (let ((now (current-time))) + (when (or (null rcirc-last-connect-time) + (< rcirc-reconnect-delay + (float-time (time-subtract now rcirc-last-connect-time)))) + (setq sds-rcirc-sentinel-last now) + (rcirc-cmd-reconnect nil)))) (run-hook-with-args 'rcirc-sentinel-functions process sentinel)))) (defun rcirc-disconnect-buffer (&optional buffer) @@ -1007,6 +1024,7 @@ (setq-local fill-paragraph-function 'rcirc-fill-paragraph) (setq-local rcirc-recent-quit-alist nil) (setq-local rcirc-current-line 0) + (setq-local rcirc-last-connect-time (current-time)) (use-hard-newlines t) (setq-local rcirc-short-buffer-name nil)