From: Miles Bader Date: Sun, 20 May 2007 03:12:22 +0000 (+0000) Subject: Merge from emacs--rel--22 X-Git-Tag: emacs-pretest-23.0.90~12622 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7d5f6be179b35a1e255624234f9c436d146f3b55;p=emacs.git Merge from emacs--rel--22 Patches applied: * emacs--rel--22 (patch 20-21) - Update from CVS 2007-05-18 Richard M. Stallman * lisp/simple.el (push-mark): Doc fix. 2007-05-18 Rob Riepel * lisp/emulation/tpu-edt.el (CSI-map, SS3-map) Moved from global-map to tpu-global-map. (tpu-original-global-map) Variable deleted. (tpu-control-keys-map) New keymap variable. (tpu-set-control-keys) Use tpu-reset-control-keys rather than setting keymapping directly. (tpu-reset-control-keys) Use tpu-control-keys-map instead of tpu-global-map. (tpu-edt-on): Activate the tpu-global-map. (tpu-edt-off): Deactivate the tpu-global-map. 2007-05-18 Ryan Yeske * lisp/textmodes/ispell.el (ispell-get-word): Return markers for start and end positions. (ispell-word): Assume END is a marker. 2007-05-19 Stefan Monnier * src/syntax.c (skip_chars): Update syntax-table only after we checked that the new location is valid. 2007-05-19 YAMAMOTO Mitsuharu * src/macterm.c (x_calc_absolute_position): Add BLOCK_INPUT around mac_get_window_bounds. Revision: emacs@sv.gnu.org/emacs--devo--0--patch-759 --- 7d5f6be179b35a1e255624234f9c436d146f3b55 diff --cc lisp/ChangeLog index 7babaf1fe51,cd6587e6d57..44722def963 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@@ -1,55 -1,34 +1,78 @@@ +2007-05-20 Nick Roberts + + * t-mouse.el: Reduce to a minor-mode macro call. + +2007-05-19 Dan Nicolaescu + + * files.el (auto-mode-alist): Change the regexp so that + ChangeLog.unicode and ChangeLog.multi-tty use change-log-mode. + +2007-05-19 Chong Yidong + + * paren.el (show-paren-function): Undo 2007-04-19 and 2007-04-20 + changes. + +2007-05-19 Kevin Ryde + + * info.el (Info-fontify-node): Fontify https as well as http and ftp. + +2007-05-18 Thien-Thi Nguyen + + * textmodes/sgml-mode.el: Revert last change. + + 2007-05-18 Richard Stallman + + * simple.el (push-mark): Doc fix. + + 2007-05-18 Rob Riepel + + * emulation/tpu-edt.el (CSI-map, SS3-map) Moved from global-map to + tpu-global-map. + (tpu-original-global-map) Variable deleted. + (tpu-control-keys-map) New keymap variable. + (tpu-set-control-keys) Use tpu-reset-control-keys rather than + setting keymapping directly. + (tpu-reset-control-keys) Use tpu-control-keys-map instead of + tpu-global-map. + (tpu-edt-on): Activate the tpu-global-map. + (tpu-edt-off): Deactivate the tpu-global-map. + + 2007-05-18 Ryan Yeske + + * textmodes/ispell.el (ispell-get-word): Return markers + for start and end positions. + (ispell-word): Assume END is a marker. + 2007-05-17 Vinicius Jose Latorre - * ps-print.el: Use default color when foreground or background color - are unspecified. Reported by Leo . - (ps-print-version): New version 6.7.4. - (ps-rgb-color): New argument. Use default color when color is - unspecified. - (ps-begin-job): Fix code. + * printing.el: Group together all XEmacs/Emacs definitions. + (pr-version): New version 6.9. + (pr-global-menubar, pr-menu-char-height, pr-menu-char-width): New funs. + (pr-menu-char-height, pr-menu-char-width): Fix initialization code. + (pr-menu-bind): Fix code. + (pr-e-frame-char-height, pr-e-frame-char-width) + (pr-e-mouse-pixel-position, pr-x-add-submenu, pr-x-event-function) + (pr-x-event-object, pr-x-find-menu-item, pr-x-font-height) + (pr-x-font-width, pr-x-get-popup-menu-response, pr-x-make-event) + (pr-x-misc-user-event-p, pr-x-relabel-menu-item, pr-x-event-x-pixel) + (pr-x-event-y-pixel): Aliases eliminated. + (pr-xemacs-global-menubar): Macro moved. + (current-menubar, current-mouse-event, zmacs-region-stays) + (deactivate-mark, pr-menu-position, pr-menu-state, pr-ps-name-old) + (pr-txt-name-old, pr-ps-utility-old, pr-even-or-odd-old, pr-temp-menu): + Vars moved. + (pr-region-active-p, pr-menu-position, pr-menu-lookup, pr-menu-lock) + (pr-update-mode-line, pr-do-update-menus, pr-menu-alist) + (pr-relabel-menu-item, pr-menu-set-ps-title, pr-menu-set-txt-title) + (pr-menu-set-utility-title, pr-even-or-odd-pages) + (pr-f-set-keymap-parents, pr-f-set-keymap-name, pr-f-read-string) + (pr-keep-region-active, pr-menu-get-item, pr-menu-set-item-name): Funs + moved. + +2007-05-17 Christian Plate (tiny change) + + * textmodes/sgml-mode.el (sgml-tag): + Fix bug: Call sgml-transformation-function. 2007-05-17 Martin Rudalics diff --cc lisp/t-mouse.el index 29b17f9b716,0da957ec3f8..42db325176b --- a/lisp/t-mouse.el +++ b/lisp/t-mouse.el @@@ -39,22 -69,240 +39,24 @@@ ;;; Code: -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Return number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (with-temp-buffer - (call-process "ps" nil t nil "h" (format "%s" (emacs-pid))) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t) - (re-search-forward " +vc/\\(.?[0-9a-f]\\)" nil t) - (re-search-forward " +pts/\\(.?[0-9a-f]\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1))))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (time (nth 1 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (w (window-at x y)) - (ltrb (window-edges w)) - (left (nth 0 ltrb)) - (top (nth 1 ltrb)) - (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) time) - event)) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -(defun t-mouse-make-event () - "Make a Lisp style event from the contents of mouse input accumulator. -Also trim the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (progn - ;; this test is just needed for Fedora Core 3 - (if (string-match "STILL RUNNING_1\n" - t-mouse-filter-accumulator) - (setq t-mouse-filter-accumulator - (substring - t-mouse-filter-accumulator (match-end 0)))) - (read-from-string t-mouse-filter-accumulator)) - (error nil)))) - ;; this test is just needed for Fedora Core 3 - (if (or (eq (car ob-pos) 'STILL) (eq (car ob-pos) '***) (not ob-pos)) - nil - (setq ob (car ob-pos)) - (if (string-match "mev:$" (prin1-to-string ob)) - (error "Can't open mouse connection")) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - -(defun t-mouse-mouse-position-function (pos) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (setcdr pos t-mouse-current-xy) - pos) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - ;;;###autoload (define-minor-mode t-mouse-mode - "Toggle t-mouse mode. + "Toggle t-mouse mode to use the mouse in Linux consoles. With prefix arg, turn t-mouse mode on iff arg is positive. - Turn it on to use Emacs mouse commands, and off to use t-mouse commands." + This allows the use of the mouse when operating on a Linux console, in the + same way as you can use the mouse under X11. + It requires the `mev' program, part of the `gpm' utilities." nil " Mouse" nil :global t - (if t-mouse-mode - ;; Turn it on - (unless window-system - ;; Starts getting a stream of mouse events from an asynchronous process. - ;; Only works if Emacs is running on a virtual terminal without a window system. + (unless window-system + (if t-mouse-mode (progn - (setq mouse-position-function #'t-mouse-mouse-position-function) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (not (stringp tty)) - (error "Cannot find a virtual terminal")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" - "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (set-process-query-on-exit-flag t-mouse-process nil))) - ;; Turn it off - (setq mouse-position-function nil) - (delete-process t-mouse-process) - (setq t-mouse-process nil))) + (unless (fboundp 'term-open-connection) + (error "Emacs must be built with Gpm to use this mode")) + (unless (term-open-connection) + (error "Can't open mouse connection"))) + ;; Turn it off + (term-close-connection)))) (provide 't-mouse) diff --cc src/ChangeLog index e21a1ca1389,220a32a5022..c2394e368b0 --- a/src/ChangeLog +++ b/src/ChangeLog @@@ -1,56 -1,13 +1,66 @@@ + 2007-05-19 Stefan Monnier + + * syntax.c (skip_chars): Update syntax-table only after we checked that + the new location is valid. + + 2007-05-19 YAMAMOTO Mitsuharu + + * macterm.c (x_calc_absolute_position): Add BLOCK_INPUT around + mac_get_window_bounds. + +2007-05-20 Nick Roberts + + * Makefile.in (LIBGPM): Allow it to be set from configure. + If set then link Emacs with it. + + * config.in: Regenerate. + + * lisp.h (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): + New externs. + + * termhooks.h [HAVE_GPM_H] (enum event_kind): Add GPM_CLICK_EVENT. + Include gpm.h. + (handle_one_term_event, term_gpm) New externs. + + * sysdep.c [HAVE_GPM_H] (init_sys_modes): Make gpm_fd nonblocking + and allow it to be interrupted by SIGIO. + + * process.c (gpm_wait_mask, max_gpm_desc): New variables. + (wait_reading_process_output): Wait on gpm_fd too. + (add_gpm_wait_descriptor, delete_gpm_wait_descriptor)): New functions. + (add_gpm_wait_descriptor_called_flag): New variable. + (delete_keyboard_wait_descriptor): Check gpm_wait_mask. + + * keyboard.c [HAVE_GPM_H] (Qmouse_fixup_help_message) + (make_lispy_movement, tracking_off, Ftrack_mouse, some_mouse_moved) + (show_help_echo, readable_events, kbd_buffer_get_event, init_keyboard): + Extend HAVE_MOUSE ifdefs to HAVE_GPM_H. + (make_lispy_event): Add case GPM_CLICK_EVENT. + (read_avail_input): Handle mouse input. + + * term.c (write_glyphs_with_face): New function. + [HAVE_GPM_H]: Include buffer.h, sys/fcntl.h. + (mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row) + (mouse_face_end_col, mouse_face_past_end, mouse_face_window) + (mouse_face_face_id, term_gpm, pos_x, pos_y) + (last_mouse_x, last_mouse_y): New variables. + (term_show_mouse_face, term_clear_mouse_face, fast_find_position) + (term_mouse_highlight, term_mouse_movement, term_mouse_position) + (term_mouse_click, handle_one_term_event, Fterm_open_connection) + (Fterm_close_connection): New functions. + (term_init): Initialise mouse_face_window. + +2007-05-19 Chong Yidong + + * xdisp.c (redisplay_window): If first window line is a + continuation line, recompute the new window start instead of + recentering. + +2007-05-18 Glenn Morris + + * m/alpha.h (ORDINARY_LINK): No longer define on OpenBSD. + Suggested by Alfred M. Szmidt . + 2007-05-17 Glenn Morris * m/macppc.h (ORDINARY_LINK): No longer define on OpenBSD.