Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 102285. ------------------------------------------------------------ revno: 102285 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-11-06 19:02:54 -0700 message: Fix typo in previos flymake change. diff: === modified file 'lisp/progmodes/flymake.el' --- lisp/progmodes/flymake.el 2010-11-07 01:50:52 +0000 +++ lisp/progmodes/flymake.el 2010-11-07 02:02:54 +0000 @@ -799,7 +799,7 @@ (goto-char (point-min)) (forward-line (1- line-no)) (let* ((line-beg (point-at-bol)) - (line-end (poin-at-eol)) + (line-end (point-at-eol)) (beg line-beg) (end line-end) (tooltip-text (flymake-ler-text (nth 0 line-err-info-list))) ------------------------------------------------------------ revno: 102284 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-11-06 18:56:09 -0700 message: Minor esh-util changes. * lisp/eshell/esh-util.el (subst-char-in-string) (directory-files-and-attributes): These compatibility definitions are not needed on any version of Emacs since at least 21.4. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-07 01:50:52 +0000 +++ lisp/ChangeLog 2010-11-07 01:56:09 +0000 @@ -1,5 +1,9 @@ 2010-11-07 Glenn Morris + * eshell/esh-util.el (subst-char-in-string) + (directory-files-and-attributes): These compatibility definitions are + not needed on any version of Emacs since at least 21.4. + * progmodes/verilog-mode.el (verilog-get-beg-of-line) (verilog-get-end-of-line): Remove. (verilog-within-string, verilog-re-search-forward-substr) === modified file 'lisp/eshell/esh-util.el' --- lisp/eshell/esh-util.el 2010-11-07 01:50:52 +0000 +++ lisp/eshell/esh-util.el 2010-11-07 01:56:09 +0000 @@ -536,17 +536,18 @@ (eshell-read-hosts eshell-hosts-file 'eshell-host-names 'eshell-host-timestamp))) -(unless (fboundp 'subst-char-in-string) - (defun subst-char-in-string (fromchar tochar string &optional inplace) - "Replace FROMCHAR with TOCHAR in STRING each time it occurs. +(and (featurep 'xemacs) + (not (fboundp 'subst-char-in-string)) + (defun subst-char-in-string (fromchar tochar string &optional inplace) + "Replace FROMCHAR with TOCHAR in STRING each time it occurs. Unless optional argument INPLACE is non-nil, return a new string." - (let ((i (length string)) - (newstr (if inplace string (copy-sequence string)))) - (while (> i 0) - (setq i (1- i)) - (if (eq (aref newstr i) fromchar) - (aset newstr i tochar))) - newstr))) + (let ((i (length string)) + (newstr (if inplace string (copy-sequence string)))) + (while (> i 0) + (setq i (1- i)) + (if (eq (aref newstr i) fromchar) + (aset newstr i tochar))) + newstr))) (defsubst eshell-copy-environment () "Return an unrelated copy of `process-environment'." @@ -586,8 +587,9 @@ (substring string 0 sublen) string))) -(unless (fboundp 'directory-files-and-attributes) - (defun directory-files-and-attributes (directory &optional full match nosort id-format) +(and (featurep 'xemacs) + (not (fboundp 'directory-files-and-attributes)) + (defun directory-files-and-attributes (directory &optional full match nosort id-format) "Return a list of names of files and their attributes in DIRECTORY. There are three optional arguments: If FULL is non-nil, return absolute file names. Otherwise return names @@ -599,7 +601,7 @@ (mapcar (function (lambda (file) - (cons file (eshell-file-attributes (expand-file-name file directory))))) + (cons file (eshell-file-attributes (expand-file-name file directory))))) (directory-files directory full match nosort))))) (defvar ange-cache) ------------------------------------------------------------ revno: 102283 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-11-06 18:50:52 -0700 message: Replace unneeded compatibility definitions with point-at-bol, point-at-eol. * lisp/progmodes/verilog-mode.el (verilog-get-beg-of-line) (verilog-get-end-of-line): Remove. (verilog-within-string, verilog-re-search-forward-substr) (verilog-re-search-backward-substr, verilog-set-auto-endcomments) (verilog-surelint-off, verilog-getopt-file, verilog-highlight-region): Use point-at-bol, point-at-eol. * lisp/progmodes/pascal.el (pascal-get-beg-of-line, pascal-get-end-of-line): Remove. (pascal-declaration-end, pascal-declaration-beg, pascal-within-string) (electric-pascal-terminate-line, pascal-set-auto-comments) (pascal-indent-paramlist, pascal-indent-declaration) (pascal-get-lineup-indent, pascal-func-completion) (pascal-get-completion-decl, pascal-var-completion, pascal-completion): Use point-at-bol, point-at-eol. * lisp/progmodes/flymake.el (flymake-line-beginning-position) (flymake-line-end-position): Remove. (flymake-highlight-line): Use point-at-bol, point-at-eol. * lisp/eshell/esh-util.el (line-end-position, line-beginning-position): Remove compat definitions. * net/tramp/tramp-compat.el: Comment. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-07 01:44:13 +0000 +++ lisp/ChangeLog 2010-11-07 01:50:52 +0000 @@ -1,5 +1,25 @@ 2010-11-07 Glenn Morris + * progmodes/verilog-mode.el (verilog-get-beg-of-line) + (verilog-get-end-of-line): Remove. + (verilog-within-string, verilog-re-search-forward-substr) + (verilog-re-search-backward-substr, verilog-set-auto-endcomments) + (verilog-surelint-off, verilog-getopt-file, verilog-highlight-region): + Use point-at-bol, point-at-eol. + * progmodes/pascal.el (pascal-get-beg-of-line, pascal-get-end-of-line): + Remove. + (pascal-declaration-end, pascal-declaration-beg, pascal-within-string) + (electric-pascal-terminate-line, pascal-set-auto-comments) + (pascal-indent-paramlist, pascal-indent-declaration) + (pascal-get-lineup-indent, pascal-func-completion) + (pascal-get-completion-decl, pascal-var-completion, pascal-completion): + Use point-at-bol, point-at-eol. + * progmodes/flymake.el (flymake-line-beginning-position) + (flymake-line-end-position): Remove. + (flymake-highlight-line): Use point-at-bol, point-at-eol. + * eshell/esh-util.el (line-end-position, line-beginning-position): + Remove compat definitions. + * emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): Use end-of-line N. (checkdoc-this-string-valid-engine, checkdoc-file-comments-engine): === modified file 'lisp/eshell/esh-util.el' --- lisp/eshell/esh-util.el 2010-09-25 21:51:55 +0000 +++ lisp/eshell/esh-util.el 2010-11-07 01:50:52 +0000 @@ -536,14 +536,6 @@ (eshell-read-hosts eshell-hosts-file 'eshell-host-names 'eshell-host-timestamp))) -(unless (fboundp 'line-end-position) - (defsubst line-end-position (&optional N) - (save-excursion (end-of-line N) (point)))) - -(unless (fboundp 'line-beginning-position) - (defsubst line-beginning-position (&optional N) - (save-excursion (beginning-of-line N) (point)))) - (unless (fboundp 'subst-char-in-string) (defun subst-char-in-string (fromchar tochar string &optional inplace) "Replace FROMCHAR with TOCHAR in STRING each time it occurs. @@ -802,5 +794,4 @@ (provide 'esh-util) -;; arch-tag: 70159778-5c7a-480a-bae4-3ad332fca19d ;;; esh-util.el ends here === modified file 'lisp/net/tramp-compat.el' --- lisp/net/tramp-compat.el 2010-10-05 14:20:24 +0000 +++ lisp/net/tramp-compat.el 2010-11-07 01:50:52 +0000 @@ -199,6 +199,8 @@ (ignore-errors (tramp-compat-funcall 'font-lock-add-keywords mode keywords how))) +;; FIXME is this really necessary? Eg Emacs has both l-b-p and p-at-b +;; since at least 21.1. (defsubst tramp-compat-line-beginning-position () "Return point at beginning of line (compat function). Calls `line-beginning-position' or `point-at-bol' if defined, else @@ -209,6 +211,8 @@ ((fboundp 'point-at-bol) (tramp-compat-funcall 'point-at-bol)) (t (save-excursion (beginning-of-line) (point))))) +;; FIXME is this really necessary? Eg Emacs has both l-e-p and p-at-e +;; since at least 21.1. (defsubst tramp-compat-line-end-position () "Return point at end of line (compat function). Calls `line-end-position' or `point-at-eol' if defined, else @@ -529,5 +533,4 @@ ;;; TODO: -;; arch-tag: 0e724b18-6699-4f87-ad96-640b272e5c85 ;;; tramp-compat.el ends here === modified file 'lisp/progmodes/flymake.el' --- lisp/progmodes/flymake.el 2010-08-18 18:24:52 +0000 +++ lisp/progmodes/flymake.el 2010-11-07 01:50:52 +0000 @@ -106,16 +106,6 @@ 'temp-directory (lambda () temporary-file-directory))) -(defalias 'flymake-line-beginning-position - (if (fboundp 'line-beginning-position) - 'line-beginning-position - (lambda (&optional arg) (save-excursion (beginning-of-line arg) (point))))) - -(defalias 'flymake-line-end-position - (if (fboundp 'line-end-position) - 'line-end-position - (lambda (&optional arg) (save-excursion (end-of-line arg) (point))))) - (defun flymake-posn-at-point-as-event (&optional position window dx dy) "Return pixel position of top left corner of glyph at POSITION, relative to top left corner of WINDOW, as a mouse-1 click @@ -808,8 +798,8 @@ Perhaps use text from LINE-ERR-INFO-LIST to enhance highlighting." (goto-char (point-min)) (forward-line (1- line-no)) - (let* ((line-beg (flymake-line-beginning-position)) - (line-end (flymake-line-end-position)) + (let* ((line-beg (point-at-bol)) + (line-end (poin-at-eol)) (beg line-beg) (end line-end) (tooltip-text (flymake-ler-text (nth 0 line-err-info-list))) @@ -1764,5 +1754,4 @@ (provide 'flymake) -;; arch-tag: 8f0d6090-061d-4cac-8862-7c151c4a02dd ;;; flymake.el ends here === modified file 'lisp/progmodes/pascal.el' --- lisp/progmodes/pascal.el 2010-09-20 14:57:01 +0000 +++ lisp/progmodes/pascal.el 2010-11-07 01:50:52 +0000 @@ -1,8 +1,8 @@ ;;; pascal.el --- major mode for editing pascal source in Emacs -;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -;; 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -;; Free Software Foundation, Inc. +;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +;; 2002 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +;; Free Software Foundation, Inc. ;; Author: Espen Skoglund ;; Keywords: languages @@ -274,22 +274,12 @@ ;;; Macros ;;; -(defsubst pascal-get-beg-of-line (&optional arg) - (save-excursion - (beginning-of-line arg) - (point))) - -(defsubst pascal-get-end-of-line (&optional arg) - (save-excursion - (end-of-line arg) - (point))) - (defun pascal-declaration-end () (let ((nest 1)) (while (and (> nest 0) (re-search-forward "[:=]\\|\\(\\\\)\\|\\(\\\\)" - (save-excursion (end-of-line 2) (point)) t)) + (point-at-eol 2) t)) (cond ((match-beginning 1) (setq nest (1+ nest))) ((match-beginning 2) (setq nest (1- nest))) ((looking-at "[^(\n]+)") (setq nest 0)))))) @@ -298,7 +288,7 @@ (defun pascal-declaration-beg () (let ((nest 1)) (while (and (> nest 0) - (re-search-backward "[:=]\\|\\<\\(type\\|var\\|label\\|const\\)\\>\\|\\(\\\\)\\|\\(\\\\)" (pascal-get-beg-of-line 0) t)) + (re-search-backward "[:=]\\|\\<\\(type\\|var\\|label\\|const\\)\\>\\|\\(\\\\)\\|\\(\\\\)" (point-at-bol 0) t)) (cond ((match-beginning 1) (setq nest 0)) ((match-beginning 2) (setq nest (1- nest))) ((match-beginning 3) (setq nest (1+ nest))))) @@ -306,8 +296,7 @@ (defsubst pascal-within-string () - (save-excursion - (nth 3 (parse-partial-sexp (pascal-get-beg-of-line) (point))))) + (nth 3 (parse-partial-sexp (point-at-bol) (point)))) ;;;###autoload @@ -407,8 +396,7 @@ (forward-char 1) (delete-horizontal-space)) ((and (looking-at "(\\*\\|\\*[^)]") - (not (save-excursion - (search-forward "*)" (pascal-get-end-of-line) t)))) + (not (save-excursion (search-forward "*)" (point-at-eol) t)))) (setq setstar t)))) ;; If last line was a star comment line then this one shall be too. (if (null setstar) @@ -727,7 +715,7 @@ (if (and (looking-at "\\" stpos t))) (if arg (progn @@ -1046,7 +1034,7 @@ (setq ind (pascal-get-lineup-indent stpos edpos lineup)) (goto-char stpos) (while (and (<= (point) edpos) (not (eobp))) - (if (search-forward lineup (pascal-get-end-of-line) 'move) + (if (search-forward lineup (point-at-eol) 'move) (forward-char -1)) (delete-horizontal-space) (indent-to ind) @@ -1073,7 +1061,7 @@ (goto-char b) ;; Get rightmost position (while (< (point) e) - (and (re-search-forward reg (min e (pascal-get-end-of-line 2)) 'move) + (and (re-search-forward reg (min e (point-at-eol 2)) 'move) (cond ((match-beginning 1) ;; Skip record blocks (pascal-declaration-end)) @@ -1137,7 +1125,7 @@ ;; Search through all reachable functions (while (pascal-beg-of-defun) - (if (re-search-forward pascal-str (pascal-get-end-of-line) t) + (if (re-search-forward pascal-str (point-at-eol) t) (progn (setq match (buffer-substring (match-beginning 2) (match-end 2))) (push match pascal-all))) @@ -1154,17 +1142,17 @@ match) ;; Traverse lines (while (< (point) end) - (if (re-search-forward "[:=]" (pascal-get-end-of-line) t) + (if (re-search-forward "[:=]" (point-at-eol) t) ;; Traverse current line (while (and (re-search-backward (concat "\\((\\|\\<\\(var\\|type\\|const\\)\\>\\)\\|" pascal-symbol-re) - (pascal-get-beg-of-line) t) + (point-at-bol) t) (not (match-end 1))) (setq match (buffer-substring (match-beginning 0) (match-end 0))) (if (string-match (concat "\\<" pascal-str) match) (push match pascal-all)))) - (if (re-search-forward "\\" (pascal-get-end-of-line) t) + (if (re-search-forward "\\" (point-at-eol) t) (pascal-declaration-end) (forward-line 1))) @@ -1206,7 +1194,7 @@ (if (> start (prog1 (save-excursion (pascal-end-of-defun) (point)))) () ; Declarations not reachable - (if (search-forward "(" (pascal-get-end-of-line) t) + (if (search-forward "(" (point-at-eol) t) ;; Check parameterlist ;; FIXME: pascal-get-completion-decl doesn't understand ;; the var declarations in parameter lists :-( @@ -1264,8 +1252,7 @@ (or (eq state 'declaration) (eq state 'paramlist) (and (eq state 'defun) (save-excursion - (re-search-backward ")[ \t]*:" - (pascal-get-beg-of-line) t)))) + (re-search-backward ")[ \t]*:" (point-at-bol) t)))) (if (or (eq state 'paramlist) (eq state 'defun)) (pascal-beg-of-defun)) (nconc @@ -1554,5 +1541,4 @@ (provide 'pascal) -;; arch-tag: 04535136-fd93-40b4-a505-c9bebdc051f5 ;;; pascal.el ends here === modified file 'lisp/progmodes/verilog-mode.el' --- lisp/progmodes/verilog-mode.el 2010-10-24 21:36:09 +0000 +++ lisp/progmodes/verilog-mode.el 2010-11-07 01:50:52 +0000 @@ -1378,19 +1378,8 @@ ;; Macros ;; -(defsubst verilog-get-beg-of-line (&optional arg) - (save-excursion - (beginning-of-line arg) - (point))) - -(defsubst verilog-get-end-of-line (&optional arg) - (save-excursion - (end-of-line arg) - (point))) - (defsubst verilog-within-string () - (save-excursion - (nth 3 (parse-partial-sexp (verilog-get-beg-of-line) (point))))) + (nth 3 (parse-partial-sexp (point-at-bol) (point)))) (defsubst verilog-string-replace-matches (from-string to-string fixedcase literal string) "Replace occurrences of FROM-STRING with TO-STRING. @@ -1480,7 +1469,7 @@ (search-forward substr bound noerror)) (save-excursion (beginning-of-line) - (setq done (re-search-forward regexp (verilog-get-end-of-line) noerror))) + (setq done (re-search-forward regexp (point-at-eol) noerror))) (unless (and (<= (match-beginning 0) (point)) (>= (match-end 0) (point))) (setq done nil))) @@ -1500,7 +1489,7 @@ (search-backward substr bound noerror)) (save-excursion (end-of-line) - (setq done (re-search-backward regexp (verilog-get-beg-of-line) noerror))) + (setq done (re-search-backward regexp (point-at-bol) noerror))) (unless (and (<= (match-beginning 0) (point)) (>= (match-end 0) (point))) (setq done nil))) @@ -3925,7 +3914,7 @@ (or kill-existing-comment (not (save-excursion (end-of-line) - (search-backward "//" (verilog-get-beg-of-line) t))))) + (search-backward "//" (point-at-bol) t))))) (let ((nest 1) b e m (else (if (match-end 2) "!" " "))) @@ -3978,7 +3967,7 @@ (or kill-existing-comment (not (save-excursion (end-of-line) - (search-backward "//" (verilog-get-beg-of-line) t))))) + (search-backward "//" (point-at-bol) t))))) (let ((type (car indent-str))) (unless (eq type 'declaration) (unless (looking-at (concat "\\(" verilog-end-block-ordered-re "\\)[ \t]*:")) ;; ignore named ends @@ -4512,7 +4501,7 @@ (cond ((looking-at "// surefire lint_off_line ") (goto-char (match-end 0)) - (let ((lim (save-excursion (end-of-line) (point)))) + (let ((lim (point-at-eol))) (if (re-search-forward code lim 'move) (throw 'already t) (insert (concat " " code))))) @@ -8272,8 +8261,7 @@ ": Can't find verilog-getopt-file -f file: " filename))) (goto-char (point-min)) (while (not (eobp)) - (setq line (buffer-substring (point) - (save-excursion (end-of-line) (point)))) + (setq line (buffer-substring (point) (point-at-eol))) (forward-line 1) (when (string-match "//" line) (setq line (substring line 0 (match-beginning 0)))) @@ -11898,7 +11886,7 @@ (verilog-save-scan-cache (let (end-point) (goto-char end) - (setq end-point (verilog-get-end-of-line)) + (setq end-point (point-at-eol)) (goto-char beg) (beginning-of-line) ; scan entire line ;; delete overlays existing on this line @@ -12122,5 +12110,4 @@ ;; checkdoc-force-docstrings-flag:nil ;; End: -;; arch-tag: 87923725-57b3-41b5-9494-be21118c6a6f ;;; verilog-mode.el ends here ------------------------------------------------------------ revno: 102282 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-11-06 18:44:13 -0700 message: Minor checkdoc simplifications. * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): Use end-of-line N. (checkdoc-this-string-valid-engine, checkdoc-file-comments-engine): Use line-end-position. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-07 01:36:33 +0000 +++ lisp/ChangeLog 2010-11-07 01:44:13 +0000 @@ -1,5 +1,10 @@ 2010-11-07 Glenn Morris + * emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): + Use end-of-line N. + (checkdoc-this-string-valid-engine, checkdoc-file-comments-engine): + Use line-end-position. + * emacs-lisp/chart.el (chart-zap-chars): * play/decipher.el (decipher-set-map): * progmodes/ada-mode.el (ada-get-current-indent) === modified file 'lisp/emacs-lisp/checkdoc.el' --- lisp/emacs-lisp/checkdoc.el 2010-11-06 20:23:42 +0000 +++ lisp/emacs-lisp/checkdoc.el 2010-11-07 01:44:13 +0000 @@ -1486,12 +1486,10 @@ "First line not a complete sentence. Add RET here? " "\n" t) (let (l1 l2) - (forward-line 1) - (end-of-line) + (end-of-line 2) (setq l1 (current-column) l2 (save-excursion - (forward-line 1) - (end-of-line) + (end-of-line 2) (current-column))) (if (> (+ l1 l2 1) 80) (setq msg "Incomplete auto-fix; doc string \ @@ -1508,10 +1506,7 @@ (forward-line 1) (beginning-of-line) (if (and (re-search-forward "[.!?:\"]\\([ \t\n]+\\|\"\\)" - (save-excursion - (end-of-line) - (point)) - t) + (line-end-position) t) (< (current-column) numc)) (if (checkdoc-autofix-ask-replace p (1+ p) @@ -1526,9 +1521,7 @@ (if msg (checkdoc-create-error msg s (save-excursion (goto-char s) - (end-of-line) - (point))) - nil) )))) + (line-end-position)))))))) ;; Continuation of above. Make sure our sentence is capitalized. (save-excursion (skip-chars-forward "\"\\*") @@ -1628,7 +1621,7 @@ (if (and (< (point) e) (> (current-column) 80)) (checkdoc-create-error "Some lines are over 80 columns wide" - s (save-excursion (goto-char s) (end-of-line) (point)) )))) + s (save-excursion (goto-char s) (line-end-position)))))) ;; Here we deviate to tests based on a variable or function. ;; We must do this before checking for symbols in quotes because there ;; is a chance that just such a symbol might really be an argument. @@ -1773,9 +1766,8 @@ (end-of-line) ;; check string-continuation (if (checkdoc-char= (preceding-char) ?\\) - (progn (forward-line 1) - (end-of-line))) - (point))) + (line-end-position 2) + (point)))) (rs nil) replace original (case-fold-search t)) (while (and (not rs) (re-search-forward @@ -2253,8 +2245,8 @@ (insert ";;; " fn fe " --- " (read-string "Summary: ") "\n")) (checkdoc-create-error "The first line should be of the form: \";;; package --- Summary\"" - (point-min) (save-excursion (goto-char (point-min)) (end-of-line) - (point)))) + (point-min) (save-excursion (goto-char (point-min)) + (line-end-position)))) nil)) (setq err ------------------------------------------------------------ revno: 102281 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-11-06 18:36:33 -0700 message: Replace end-of-line, save-excursion etc with point-at-eol, point-at-bol. * lisp/mh-e/mh-seq.el (mh-read-msg-list): Use point-at-eol. * lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-show-infos) (gnus-bookmark-kill-line): Use point-at-eol. * lisp/cedet/ede/proj-elisp.el (ede-proj-flush-autoconf): Use point-at-bol. * lisp/emacs-lisp/chart.el (chart-zap-chars): * lisp/play/decipher.el (decipher-set-map): * lisp/progmodes/ada-mode.el (ada-get-current-indent) (ada-search-ignore-string-comment, ada-tab-hard, ada-untab-hard): * lisp/progmodes/ada-prj.el (ada-prj-load-from-file, ada-prj-display-help): * lisp/progmodes/ada-xref.el (ada-initialize-runtime-library) (ada-get-all-references): * lisp/progmodes/cperl-mode.el (cperl-electric-paren) (cperl-electric-rparen, cperl-electric-keyword, cperl-electric-else) (cperl-linefeed, cperl-sniff-for-indent, cperl-to-comment-or-eol) (cperl-find-pods-heres, cperl-indent-exp, cperl-fix-line-spacing) (cperl-word-at-point-hard): * lisp/progmodes/idlw-shell.el (idlwave-shell-move-or-history) (idlwave-shell-filename-string, idlwave-shell-batch-command) (idlwave-shell-display-line): * lisp/progmodes/idlwave.el (idlwave-show-begin, idlwave-fill-paragraph) (idlwave-calc-hanging-indent, idlwave-auto-fill, idlwave-template): * lisp/progmodes/js.el (js--re-search-forward-inner) (js--re-search-backward-inner): * lisp/progmodes/vhdl-mode.el (vhdl-align-region-1, vhdl-align-region-2) (vhdl-fix-clause, vhdl-compose-configuration-architecture): * lisp/progmodes/ruby-mode.el (ruby-parse-partial, eval-when-compile): * lisp/textmodes/flyspell.el (flyspell-process-localwords): * lisp/textmodes/ispell.el (ispell-buffer-local-parsing) (ispell-buffer-local-dict, ispell-buffer-local-words): Use point-at-bol and point-at-eol. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-07 01:06:37 +0000 +++ lisp/ChangeLog 2010-11-07 01:36:33 +0000 @@ -1,5 +1,32 @@ 2010-11-07 Glenn Morris + * emacs-lisp/chart.el (chart-zap-chars): + * play/decipher.el (decipher-set-map): + * progmodes/ada-mode.el (ada-get-current-indent) + (ada-search-ignore-string-comment, ada-tab-hard, ada-untab-hard): + * progmodes/ada-prj.el (ada-prj-load-from-file, ada-prj-display-help): + * progmodes/ada-xref.el (ada-initialize-runtime-library) + (ada-get-all-references): + * progmodes/cperl-mode.el (cperl-electric-paren) + (cperl-electric-rparen, cperl-electric-keyword, cperl-electric-else) + (cperl-linefeed, cperl-sniff-for-indent, cperl-to-comment-or-eol) + (cperl-find-pods-heres, cperl-indent-exp, cperl-fix-line-spacing) + (cperl-word-at-point-hard): + * progmodes/idlw-shell.el (idlwave-shell-move-or-history) + (idlwave-shell-filename-string, idlwave-shell-batch-command) + (idlwave-shell-display-line): + * progmodes/idlwave.el (idlwave-show-begin, idlwave-fill-paragraph) + (idlwave-calc-hanging-indent, idlwave-auto-fill, idlwave-template): + * progmodes/js.el (js--re-search-forward-inner) + (js--re-search-backward-inner): + * progmodes/vhdl-mode.el (vhdl-align-region-1, vhdl-align-region-2) + (vhdl-fix-clause, vhdl-compose-configuration-architecture): + * progmodes/ruby-mode.el (ruby-parse-partial, eval-when-compile): + * textmodes/flyspell.el (flyspell-process-localwords): + * textmodes/ispell.el (ispell-buffer-local-parsing) + (ispell-buffer-local-dict, ispell-buffer-local-words): + Use point-at-bol and point-at-eol. + * speedbar.el (speedbar-generic-item-info) (speedbar-item-info-tag-helper, speedbar-change-expand-button-char) (speedbar-add-indicator, speedbar-check-vc-this-line) === modified file 'lisp/cedet/ChangeLog' --- lisp/cedet/ChangeLog 2010-11-01 07:34:04 +0000 +++ lisp/cedet/ChangeLog 2010-11-07 01:36:33 +0000 @@ -1,3 +1,7 @@ +2010-11-07 Glenn Morris + + * ede/proj-elisp.el (ede-proj-flush-autoconf): Use point-at-bol. + 2010-11-01 Glenn Morris * semantic/bovine/c.el (semantic-analyze-split-name): Move before use. === modified file 'lisp/cedet/ede/proj-elisp.el' --- lisp/cedet/ede/proj-elisp.el 2010-10-31 22:55:44 +0000 +++ lisp/cedet/ede/proj-elisp.el 2010-11-07 01:36:33 +0000 @@ -1,7 +1,7 @@ ;;; ede-proj-elisp.el --- EDE Generic Project Emacs Lisp support -;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, +;; 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Eric M. Ludlam ;; Keywords: project, make @@ -245,10 +245,7 @@ (let ((path (match-string 1))) (if (string= path "nil") nil - (delete-region (save-excursion (beginning-of-line) (point)) - (save-excursion (end-of-line) - (forward-char 1) - (point)))))))))) + (delete-region (point-at-bol) (point-at-bol 2))))))))) ;;; ;; Autoload generators === modified file 'lisp/emacs-lisp/chart.el' --- lisp/emacs-lisp/chart.el 2010-10-10 23:12:30 +0000 +++ lisp/emacs-lisp/chart.el 2010-11-07 01:36:33 +0000 @@ -1,7 +1,7 @@ ;;; chart.el --- Draw charts (bar charts, etc) -;; Copyright (C) 1996, 1998, 1999, 2001, 2004, 2005, 2007, 2008, 2009, 2010 -;; Free Software Foundation, Inc. +;; Copyright (C) 1996, 1998, 1999, 2001, 2004, 2005, 2007, 2008, 2009, +;; 2010 Free Software Foundation, Inc. ;; Author: Eric M. Ludlam ;; Version: 0.2 @@ -525,9 +525,9 @@ (defun chart-zap-chars (n) "Zap up to N chars without deleting EOLs." (if (not (eobp)) - (if (< n (- (save-excursion (end-of-line) (point)) (point))) + (if (< n (- (point-at-eol) (point))) (delete-char n) - (delete-region (point) (save-excursion (end-of-line) (point)))))) + (delete-region (point) (point-at-eol))))) (defun chart-display-label (label dir zone start end &optional face) "Display LABEL in direction DIR in column/row ZONE between START and END. @@ -746,5 +746,4 @@ (provide 'chart) -;; arch-tag: 43847e44-5b45-465e-adc9-e505490a6b59 ;;; chart.el ends here === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-11-07 01:10:01 +0000 +++ lisp/gnus/ChangeLog 2010-11-07 01:36:33 +0000 @@ -1,3 +1,8 @@ +2010-11-07 Glenn Morris + + * gnus-bookmark.el (gnus-bookmark-bmenu-show-infos) + (gnus-bookmark-kill-line): Use point-at-eol. + 2010-11-07 Katsumi Yamaoka * gnus-gravatar.el (gnus-gravatar-transform-address): No need to skip === modified file 'lisp/gnus/gnus-bookmark.el' --- lisp/gnus/gnus-bookmark.el 2010-09-30 08:39:23 +0000 +++ lisp/gnus/gnus-bookmark.el 2010-11-07 01:36:33 +0000 @@ -1,6 +1,7 @@ ;;; gnus-bookmark.el --- Bookmarks in Gnus -;; Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2006, 2007, 2008, 2009, 2010 +;; Free Software Foundation, Inc. ;; Author: Bastien Guerry ;; Keywords: news @@ -538,7 +539,7 @@ (let ((bmrk (gnus-bookmark-bmenu-bookmark))) (setq gnus-bookmark-bmenu-hidden-bookmarks (cons bmrk gnus-bookmark-bmenu-hidden-bookmarks)) - (let ((start (save-excursion (end-of-line) (point)))) + (let ((start (point-at-eol))) (move-to-column gnus-bookmark-bmenu-file-column t) ;; Strip off `mouse-face' from the white spaces region. (if (gnus-bookmark-mouse-available-p) @@ -572,10 +573,9 @@ "Kill from point to end of line. If optional arg NEWLINE-TOO is non-nil, delete the newline too. Does not affect the kill ring." - (let ((eol (save-excursion (end-of-line) (point)))) - (delete-region (point) eol) - (if (and newline-too (looking-at "\n")) - (delete-char 1)))) + (delete-region (point) (point-at-eol)) + (if (and newline-too (looking-at "\n")) + (delete-char 1))) (defun gnus-bookmark-get-details (bmk-name details-list) "Get details for a Gnus BMK-NAME depending on DETAILS-LIST." === modified file 'lisp/mh-e/ChangeLog' --- lisp/mh-e/ChangeLog 2010-11-03 03:27:38 +0000 +++ lisp/mh-e/ChangeLog 2010-11-07 01:36:33 +0000 @@ -1,3 +1,7 @@ +2010-11-07 Glenn Morris + + * mh-seq.el (mh-read-msg-list): Use point-at-eol. + 2010-11-03 Glenn Morris * mh-mime.el (dots, type, ov): Avoid unnecessary declaration. === modified file 'lisp/mh-e/mh-seq.el' --- lisp/mh-e/mh-seq.el 2010-01-13 08:35:10 +0000 +++ lisp/mh-e/mh-seq.el 2010-11-07 01:36:33 +0000 @@ -1,8 +1,7 @@ ;;; mh-seq.el --- MH-E sequences support -;; Copyright (C) 1993, 1995, -;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -;; Free Software Foundation, Inc. +;; Copyright (C) 1993, 1995, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +;; 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Bill Wohler ;; Maintainer: Bill Wohler @@ -819,7 +818,7 @@ "Return a list of message numbers from point to the end of the line. Expands ranges into set of individual numbers." (let ((msgs ()) - (end-of-line (save-excursion (end-of-line) (point))) + (end-of-line (point-at-eol)) num) (while (re-search-forward "[0-9]+" end-of-line t) (setq num (string-to-number (buffer-substring (match-beginning 0) @@ -1017,5 +1016,4 @@ ;; sentence-end-double-space: nil ;; End: -;; arch-tag: 8e952711-01a2-485b-bf21-c9e3ad4de942 ;;; mh-seq.el ends here === modified file 'lisp/play/decipher.el' --- lisp/play/decipher.el 2010-10-10 23:12:30 +0000 +++ lisp/play/decipher.el 2010-11-07 01:36:33 +0000 @@ -487,7 +487,7 @@ (let ((font-lock-fontify-region-function 'ignore)) ;; insert-and-inherit will pick the right face automatically (while (search-forward-regexp "^:" nil t) - (setq bound (save-excursion (end-of-line) (point))) + (setq bound (point-at-eol)) (while (search-forward cipher-string bound 'end) (decipher-insert plain-char))))))) @@ -1062,5 +1062,4 @@ ;; (delete-char -1) ;; (insert ")\n")))))) -;; arch-tag: 8f094d88-ffe1-4f99-afe3-a5e81dd939d9 ;;; decipher.el ends here === modified file 'lisp/progmodes/ada-mode.el' --- lisp/progmodes/ada-mode.el 2010-11-01 02:33:11 +0000 +++ lisp/progmodes/ada-mode.el 2010-11-07 01:36:33 +0000 @@ -2602,7 +2602,7 @@ ((and (= (char-after) ?#) (equal ada-which-compiler 'gnat) (looking-at "#[ \t]*\\(if\\|els\\(e\\|if\\)\\|end[ \t]*if\\)")) - (list (save-excursion (beginning-of-line) (point)) 0)) + (list (point-at-bol) 0)) ;;-------------------------------- ;; starting with ')' (end of a parameter list) @@ -4049,11 +4049,7 @@ (funcall search-func search-re limit 1)) (setq begin (match-beginning 0)) (setq end (match-end 0)) - - (setq parse-result (parse-partial-sexp - (save-excursion (beginning-of-line) (point)) - (point))) - + (setq parse-result (parse-partial-sexp (point-at-bol) (point))) (cond ;; ;; If inside a string, skip it (and the following comments) @@ -4272,16 +4268,12 @@ (save-excursion (beginning-of-line) (insert-char ? ada-indent)) - (if (save-excursion (= (point) (progn (beginning-of-line) (point)))) - (forward-char ada-indent))) + (if (bolp) (forward-char ada-indent))) (defun ada-untab-hard () "Indent current line to previous tab stop." (interactive) - (let ((bol (save-excursion (progn (beginning-of-line) (point)))) - (eol (save-excursion (progn (end-of-line) (point))))) - (indent-rigidly bol eol (- 0 ada-indent)))) - + (indent-rigidly (point-at-bol) (point-at-eol) (- 0 ada-indent))) ;; ------------------------------------------------------------ === modified file 'lisp/progmodes/ada-prj.el' --- lisp/progmodes/ada-prj.el 2010-08-29 16:17:13 +0000 +++ lisp/progmodes/ada-prj.el 2010-11-07 01:36:33 +0000 @@ -196,21 +196,17 @@ (widen) (goto-char (point-min)) (while (not (eobp)) - (set 'line (buffer-substring-no-properties - (point) (save-excursion (end-of-line) (point)))) + (set 'line (buffer-substring-no-properties (point) (point-at-eol))) (add-to-list 'list line) - (forward-line 1) - ) + (forward-line 1)) (kill-buffer nil) (set-buffer buffer) (set 'ada-prj-current-values (plist-put ada-prj-current-values symbol (append (plist-get ada-prj-current-values symbol) - (reverse list)))) - ) - (ada-prj-display-page 2) - )) + (reverse list))))) + (ada-prj-display-page 2))) (defun ada-prj-subdirs-of (dir) "Return a list of all the subdirectories of DIR, recursively." @@ -568,8 +564,7 @@ ;; variables (momentary-string-display (concat "*****Help*****\n" text "\n**************\n") - (save-excursion (forward-line) (beginning-of-line) (point))) - ))) + (point-at-bol 2))))) (defun ada-prj-show-value (widget widget-modified event) "Show the current field value in WIDGET. @@ -681,5 +676,4 @@ (provide 'ada-prj) -;; arch-tag: 65978c77-816e-49c6-896e-6905605d1b4c ;;; ada-prj.el ends here === modified file 'lisp/progmodes/ada-xref.el' --- lisp/progmodes/ada-xref.el 2010-08-29 16:17:13 +0000 +++ lisp/progmodes/ada-xref.el 2010-11-07 01:36:33 +0000 @@ -1,7 +1,8 @@ ;; ada-xref.el --- for lookup and completion in Ada mode -;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, -;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +;; 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +;; Free Software Foundation, Inc. ;; Author: Markus Heritsch ;; Rolf Ebert @@ -324,7 +325,7 @@ (add-to-list 'ada-xref-runtime-library-specs-path (buffer-substring-no-properties (point) - (save-excursion (end-of-line) (point))))) + (point-at-eol)))) (forward-line 1)) ;; Object path @@ -338,7 +339,7 @@ (add-to-list 'ada-xref-runtime-library-ali-path (buffer-substring-no-properties (point) - (save-excursion (end-of-line) (point))))) + (point-at-eol)))) (forward-line 1)) ) (kill-buffer nil)))) @@ -1817,7 +1818,7 @@ (beginning-of-line) (if declaration-found (let ((current-line (buffer-substring - (point) (save-excursion (end-of-line) (point))))) + (point) (point-at-eol)))) (save-excursion (forward-line 1) (beginning-of-line) @@ -2379,5 +2380,4 @@ (provide 'ada-xref) -;; arch-tag: 415a39fe-577b-4676-b3b1-6ff6db7ca24e ;;; ada-xref.el ends here === modified file 'lisp/progmodes/cperl-mode.el' --- lisp/progmodes/cperl-mode.el 2010-10-03 21:05:47 +0000 +++ lisp/progmodes/cperl-mode.el 2010-11-07 01:36:33 +0000 @@ -1,8 +1,8 @@ ;;; cperl-mode.el --- Perl code editing commands for Emacs -;; Copyright (C) 1985, 1986, 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, -;; 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, -;; 2010 Free Software Foundation, Inc. +;; Copyright (C) 1985, 1986, 1987, 1991, 1992, 1993, 1994, 1995, 1996, +;; 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +;; 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Ilya Zakharevich ;; Bob Olson @@ -2145,7 +2145,7 @@ "Insert an opening parenthesis or a matching pair of parentheses. See `cperl-electric-parens'." (interactive "P") - (let ((beg (save-excursion (beginning-of-line) (point))) + (let ((beg (point-at-bol)) (other-end (if (and cperl-electric-parens-mark (cperl-mark-active) (> (mark) (point))) @@ -2182,7 +2182,7 @@ If not, or if we are not at the end of marking range, would self-insert. Affected by `cperl-electric-parens'." (interactive "P") - (let ((beg (save-excursion (beginning-of-line) (point))) + (let ((beg (point-at-bol)) (other-end (if (and cperl-electric-parens-mark (cperl-val 'cperl-electric-parens) (memq last-command-event @@ -2215,7 +2215,7 @@ "Insert a construction appropriate after a keyword. Help message may be switched off by setting `cperl-message-electric-keyword' to nil." - (let ((beg (save-excursion (beginning-of-line) (point))) + (let ((beg (point-at-bol)) (dollar (and (eq last-command-event ?$) (eq this-command 'self-insert-command))) (delete (and (memq last-command-event '(?\s ?\n ?\t ?\f)) @@ -2358,7 +2358,7 @@ "Insert a construction appropriate after a keyword. Help message may be switched off by setting `cperl-message-electric-keyword' to nil." - (let ((beg (save-excursion (beginning-of-line) (point)))) + (let ((beg (point-at-bol))) (and (save-excursion (backward-sexp 1) (cperl-after-expr-p nil "{;:")) @@ -2397,8 +2397,8 @@ "Go to end of line, open a new line and indent appropriately. If in POD, insert appropriate lines." (interactive) - (let ((beg (save-excursion (beginning-of-line) (point))) - (end (save-excursion (end-of-line) (point))) + (let ((beg (point-at-bol)) + (end (point-at-eol)) (pos (point)) start over cut res) (if (and ; Check if we need to split: ; i.e., on a boundary and inside "{...}" @@ -2476,12 +2476,8 @@ (forward-paragraph -1) (forward-word 1) (setq pos (point)) - (setq cut (buffer-substring (point) - (save-excursion - (end-of-line) - (point)))) - (delete-char (- (save-excursion (end-of-line) (point)) - (point))) + (setq cut (buffer-substring (point) (point-at-eol))) + (delete-char (- (point-at-eol) (point))) (setq res (expand-abbrev)) (save-excursion (goto-char pos) @@ -2946,8 +2942,7 @@ (point-max)))) ; do not loop if no syntaxification ;; label: (t - (save-excursion (end-of-line) - (setq colon-line-end (point))) + (setq colon-line-end (point-at-eol)) (search-forward ":")))) ;; We are at beginning of code (NOT label or comment) ;; First, the following code counts @@ -3220,7 +3215,7 @@ Returns true if comment is found. In POD will not move the point." ;; If the line is inside other syntax groups (qq-style strings, HERE-docs) ;; then looks for literal # or end-of-line. - (let (state stop-in cpoint (lim (progn (end-of-line) (point))) pr e) + (let (state stop-in cpoint (lim (point-at-eol)) pr e) (or cperl-font-locking (cperl-update-syntaxification lim lim)) (beginning-of-line) @@ -3814,7 +3809,7 @@ (let ((case-fold-search t)) (looking-at "extproc[ \t]")) ; Analogue of #! (cperl-commentify min - (save-excursion (end-of-line) (point)) + (point-at-eol) nil)) (while (and (< (point) max) @@ -5002,7 +4997,7 @@ conditional/loop constructs." (interactive) (save-excursion - (let ((tmp-end (progn (end-of-line) (point))) top done) + (let ((tmp-end (point-at-eol)) top done) (save-excursion (beginning-of-line) (while (null done) @@ -5045,13 +5040,9 @@ "\\<\\(else\\|elsif\|continue\\)\\>")) (progn (goto-char (match-end 0)) - (save-excursion - (end-of-line) - (setq tmp-end (point)))) + (setq tmp-end (point-at-eol))) (setq done t)))) - (save-excursion - (end-of-line) - (setq tmp-end (point)))) + (setq tmp-end (point-at-eol))) (goto-char tmp-end) (setq tmp-end (point-marker))) (if cperl-indent-region-fix-constructs @@ -5064,7 +5055,7 @@ (interactive) (or end (setq end (point-max))) - (let ((ee (save-excursion (end-of-line) (point))) + (let ((ee (point-at-eol)) (cperl-indent-region-fix-constructs (or cperl-indent-region-fix-constructs 1)) p pp ml have-brace ret) @@ -5217,7 +5208,7 @@ (if (cperl-indent-line parse-data) (setq ret (cperl-fix-line-spacing end parse-data))))))))))) (beginning-of-line) - (setq p (point) pp (save-excursion (end-of-line) (point))) ; May be different from ee. + (setq p (point) pp (point-at-eol)) ; May be different from ee. ;; Now check whether there is a hanging `}' ;; Looking at: ;; } blah @@ -7479,7 +7470,7 @@ ;; Get to the something meaningful (or (eobp) (eolp) (forward-char 1)) (re-search-backward "[-a-zA-Z0-9_:!&*+,-./<=>?\\\\^|~$%@]" - (save-excursion (beginning-of-line) (point)) + (point-at-bol) 'to-beg) ;; (cond ;; ((or (eobp) (looking-at "[][ \t\n{}();,]")) ; Not at a symbol @@ -8999,5 +8990,4 @@ (provide 'cperl-mode) -;; arch-tag: 42e5b19b-e187-4537-929f-1a7408980ce6 ;;; cperl-mode.el ends here === modified file 'lisp/progmodes/idlw-shell.el' --- lisp/progmodes/idlw-shell.el 2010-08-29 20:10:43 +0000 +++ lisp/progmodes/idlw-shell.el 2010-11-07 01:36:33 +0000 @@ -1458,7 +1458,7 @@ (arg (if up arg (- arg)))) (if (eq t idlwave-shell-arrows-do-history) (goto-char proc-pos)) (if (and idlwave-shell-arrows-do-history - (>= (1+ (save-excursion (end-of-line) (point))) proc-pos)) + (>= (1+ (point-at-eol)) proc-pos)) (comint-previous-input arg) (forward-line (- arg))))) @@ -2211,7 +2211,7 @@ (defun idlwave-shell-filename-string () "Return t if in a string and after what could be a file name." - (let ((limit (save-excursion (beginning-of-line) (point)))) + (let ((limit (point-at-bol))) (save-excursion ;; Skip backwards over file name chars (skip-chars-backward idlwave-shell-file-name-chars limit) @@ -2220,7 +2220,7 @@ (defun idlwave-shell-batch-command () "Return t if we're in a batch command statement like @foo" - (let ((limit (save-excursion (beginning-of-line) (point)))) + (let ((limit (point-at-bol))) (save-excursion ;; Skip backwards over filename (skip-chars-backward idlwave-shell-file-name-chars limit) @@ -2398,7 +2398,7 @@ idlwave-shell-electric-stop-line-face idlwave-shell-stop-line-face)) (move-overlay idlwave-shell-stop-line-overlay - (point) (save-excursion (end-of-line) (point)) + (point) (point-at-eol) (current-buffer))) ;; use the arrow instead, but only if marking is wanted. (if idlwave-shell-mark-stop-line @@ -4693,5 +4693,4 @@ (if idlwave-shell-use-toolbar (add-hook 'idlwave-shell-mode-hook 'idlwave-toolbar-add-everywhere)) -;; arch-tag: 20c2e8ce-0709-41d8-a5b6-bb039148440a ;;; idlw-shell.el ends here === modified file 'lisp/progmodes/idlwave.el' --- lisp/progmodes/idlwave.el 2010-11-06 19:55:44 +0000 +++ lisp/progmodes/idlwave.el 2010-11-07 01:36:33 +0000 @@ -2152,7 +2152,7 @@ ;;(backward-char 1) (let* ((pos (point-marker)) (last-abbrev-marker (copy-marker last-abbrev-location)) - (eol-pos (save-excursion (end-of-line) (point))) + (eol-pos (point-at-eol)) begin-pos end-pos end end1 ) (if idlwave-reindent-end (idlwave-indent-line)) (setq last-abbrev-location (marker-position last-abbrev-marker)) @@ -3301,10 +3301,8 @@ (setq here (point)) (beginning-of-line) (setq bcl (point)) - (re-search-forward - (concat "^[ \t]*" comment-start "+") - (save-excursion (end-of-line) (point)) - t) + (re-search-forward (concat "^[ \t]*" comment-start "+") + (point-at-eol) t) ;; Get the comment leader on the line and its length (setq pre (current-column)) ;; the comment leader is the indentation plus exactly the @@ -3369,9 +3367,7 @@ (setq indent hang) (beginning-of-line) (while (> (point) start) - (re-search-forward comment-start-skip - (save-excursion (end-of-line) (point)) - t) + (re-search-forward comment-start-skip (point-at-eol) t) (if (> (setq diff (- indent (current-column))) 0) (progn (if (>= here (point)) @@ -3393,13 +3389,9 @@ (setq indent (min indent (progn - (re-search-forward - comment-start-skip - (save-excursion (end-of-line) (point)) - t) + (re-search-forward comment-start-skip (point-at-eol) t) (current-column)))) - (forward-line -1)) - ) + (forward-line -1))) (setq fill-prefix (concat fill-prefix (make-string (- indent pre) ?\ ))) @@ -3407,10 +3399,7 @@ (setq first-indent (max (progn - (re-search-forward - comment-start-skip - (save-excursion (end-of-line) (point)) - t) + (re-search-forward comment-start-skip (point-at-eol) t) (current-column)) indent)) @@ -3448,17 +3437,11 @@ (if idlwave-use-last-hang-indent (save-excursion (end-of-line) - (if (re-search-backward - idlwave-hang-indent-regexp - (save-excursion (beginning-of-line) (point)) - t) + (if (re-search-backward idlwave-hang-indent-regexp (point-at-bol) t) (+ (current-column) (length idlwave-hang-indent-regexp)))) (save-excursion (beginning-of-line) - (if (re-search-forward - idlwave-hang-indent-regexp - (save-excursion (end-of-line) (point)) - t) + (if (re-search-forward idlwave-hang-indent-regexp (point-at-eol) t) (current-column))))) (defun idlwave-auto-fill () @@ -3502,18 +3485,14 @@ (save-excursion (forward-line -1) (idlwave-calc-hanging-indent)))) - (if indent - (progn - ;; Remove whitespace between comment delimiter and - ;; text, insert spaces for appropriate indentation. - (beginning-of-line) - (re-search-forward - comment-start-skip - (save-excursion (end-of-line) (point)) t) - (delete-horizontal-space) - (idlwave-indent-to indent) - (goto-char (- (point-max) here))) - ))) + (when indent + ;; Remove whitespace between comment delimiter and + ;; text, insert spaces for appropriate indentation. + (beginning-of-line) + (re-search-forward comment-start-skip (point-at-eol) t) + (delete-horizontal-space) + (idlwave-indent-to indent) + (goto-char (- (point-max) here))))) ;; Split code or comment? (if (save-excursion (end-of-line 0) @@ -3767,7 +3746,7 @@ (setq s1 (downcase s1) s2 (downcase s2))) (idlwave-abbrev-change-case (setq s1 (upcase s1) s2 (upcase s2)))) - (let ((beg (save-excursion (beginning-of-line) (point))) + (let ((beg (point-at-bol)) end) (if (not (looking-at "\\s-*\n")) (open-line 1)) === modified file 'lisp/progmodes/js.el' --- lisp/progmodes/js.el 2010-09-18 00:35:00 +0000 +++ lisp/progmodes/js.el 2010-11-07 01:36:33 +0000 @@ -703,7 +703,7 @@ (setq str-terminator ?/)) (re-search-forward (concat "\\([^\\]\\|^\\)" (string str-terminator)) - (save-excursion (end-of-line) (point)) t)) + (point-at-eol) t)) ((nth 7 parse) (forward-line)) ((or (nth 4 parse) @@ -759,7 +759,7 @@ (setq str-terminator ?/)) (re-search-backward (concat "\\([^\\]\\|^\\)" (string str-terminator)) - (save-excursion (beginning-of-line) (point)) t)) + (point-at-bol) t)) ((nth 7 parse) (goto-char (nth 8 parse))) ((or (nth 4 parse) @@ -3377,5 +3377,4 @@ (provide 'js) -;; arch-tag: 1a0d0409-e87f-4fc7-a58c-3731c66ddaac ;; js.el ends here === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2010-11-01 06:00:04 +0000 +++ lisp/progmodes/ruby-mode.el 2010-11-07 01:36:33 +0000 @@ -616,7 +616,7 @@ (setq re (regexp-quote (or (match-string 4) (match-string 2)))) (if (match-beginning 1) (setq re (concat "\\s *" re))) (let* ((id-end (goto-char (match-end 0))) - (line-end-position (save-excursion (end-of-line) (point))) + (line-end-position (point-at-eol)) (state (list in-string nest depth pcol indent))) ;; parse the rest of the line (while (and (> line-end-position (point)) @@ -1256,7 +1256,7 @@ (save-excursion (beginning-of-line) (catch 'done - (let ((eol (save-excursion (end-of-line) (point))) + (let ((eol (point-at-eol)) (case-fold-search nil) ;; Fake match data such that (match-end 0) is at eol (end-match-data (progn (looking-at ".*$") (match-data))) === modified file 'lisp/progmodes/vhdl-mode.el' --- lisp/progmodes/vhdl-mode.el 2010-09-10 23:13:42 +0000 +++ lisp/progmodes/vhdl-mode.el 2010-11-07 01:36:33 +0000 @@ -7269,7 +7269,7 @@ (save-excursion (goto-char begin) (let (element - (eol (save-excursion (progn (end-of-line) (point))))) + (eol (point-at-eol))) (setq element (nth 0 copy)) (when (and (or (and (listp (car element)) (memq major-mode (car element))) @@ -7295,7 +7295,7 @@ ;; Determine the greatest whitespace distance to the alignment ;; character (goto-char begin) - (setq eol (progn (end-of-line) (point)) + (setq eol (point-at-eol) bol (setq begin (progn (beginning-of-line) (point)))) (while (< bol end) (save-excursion @@ -7306,13 +7306,13 @@ (setq max distance)))) (forward-line) (setq bol (point) - eol (save-excursion (end-of-line) (point))) + eol (point-at-eol)) (setq lines (1+ lines))) ;; Now insert enough maxs to push each assignment operator to ;; the same column. We need to use 'lines' as a counter, since ;; the location of the mark may change (goto-char (setq bol begin)) - (setq eol (save-excursion (end-of-line) (point))) + (setq eol (point-at-eol)) (while (> lines 0) (when (and (re-search-forward match eol t) (not (vhdl-in-literal))) @@ -7324,7 +7324,7 @@ (beginning-of-line) (forward-line) (setq bol (point) - eol (save-excursion (end-of-line) (point))) + eol (point-at-eol)) (setq lines (1- lines)))))) (defun vhdl-align-region-groups (beg end &optional spacing @@ -7988,7 +7988,7 @@ (forward-char) (vhdl-forward-syntactic-ws)) (goto-char end) - (when (> pos (save-excursion (end-of-line) (point))) + (when (> pos (point-at-eol)) (error "ERROR: Not within a generic/port clause")) ;; delete closing parenthesis on separate line (not supported style) (when (save-excursion (beginning-of-line) (looking-at "^\\s-*);")) @@ -15916,7 +15916,7 @@ &optional insert-conf) "Generate block configuration for architecture." (let ((margin (current-indentation)) - (beg (save-excursion (beginning-of-line) (point))) + (beg (point-at-bol)) ent-entry inst-entry inst-path inst-prev-path cons-key tmp-alist) ;; insert block configuration (for architecture) (vhdl-insert-keyword "FOR ") (insert arch-name "\n") @@ -16977,5 +16977,4 @@ (provide 'vhdl-mode) -;; arch-tag: 780d7073-9b5d-4c6c-b0d8-26b28783aba3 ;;; vhdl-mode.el ends here === modified file 'lisp/textmodes/flyspell.el' --- lisp/textmodes/flyspell.el 2010-10-23 21:58:18 +0000 +++ lisp/textmodes/flyspell.el 2010-11-07 01:36:33 +0000 @@ -1465,7 +1465,7 @@ (goto-char (point-min)) ;; Localwords parsing copied from ispell.el. (while (search-forward ispell-words-keyword nil t) - (let ((end (save-excursion (end-of-line) (point))) + (let ((end (point-at-eol)) string) ;; buffer-local words separated by a space, and can contain ;; any character other than a space. Not rigorous enough. === modified file 'lisp/textmodes/ispell.el' --- lisp/textmodes/ispell.el 2010-11-03 07:42:27 +0000 +++ lisp/textmodes/ispell.el 2010-11-07 01:36:33 +0000 @@ -3815,7 +3815,7 @@ (goto-char (point-max)) ;; Uses last occurrence of ispell-parsing-keyword (if (search-backward ispell-parsing-keyword nil t) - (let ((end (save-excursion (end-of-line) (point))) + (let ((end (point-at-eol)) string) (search-forward ispell-parsing-keyword) (while (re-search-forward " *\\([^ \"]+\\)" end t) @@ -3851,7 +3851,7 @@ (if (search-backward ispell-dictionary-keyword nil t) (progn (search-forward ispell-dictionary-keyword) - (setq end (save-excursion (end-of-line) (point))) + (setq end (point-at-eol)) (if (re-search-forward " *\\([^ \"]+\\)" end t) (setq ispell-local-dictionary (match-string-no-properties 1)))))) @@ -3859,7 +3859,7 @@ (if (search-backward ispell-pdict-keyword nil t) (progn (search-forward ispell-pdict-keyword) - (setq end (save-excursion (end-of-line) (point))) + (setq end (point-at-eol)) (if (re-search-forward " *\\([^ \"]+\\)" end t) (setq ispell-local-pdict (match-string-no-properties 1))))))) @@ -3883,7 +3883,7 @@ (while (search-forward ispell-words-keyword nil t) (or ispell-buffer-local-name (setq ispell-buffer-local-name (buffer-name))) - (let ((end (save-excursion (end-of-line) (point))) + (let ((end (point-at-eol)) (ispell-casechars (ispell-get-casechars)) string) ;; buffer-local words separated by a space, and can contain ------------------------------------------------------------ revno: 102280 committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2010-11-07 01:10:01 +0000 message: gnus-gravatar.el (gnus-gravatar-transform-address): No need to skip asterisks in From header. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-11-07 00:22:06 +0000 +++ lisp/gnus/ChangeLog 2010-11-07 01:10:01 +0000 @@ -1,3 +1,8 @@ +2010-11-07 Katsumi Yamaoka + + * gnus-gravatar.el (gnus-gravatar-transform-address): No need to skip + asterisks in From header. + 2010-11-06 Lars Magne Ingebrigtsen * gnus-ems.el (gnus-put-image): Use a blank text as the insertion === modified file 'lisp/gnus/gnus-gravatar.el' --- lisp/gnus/gnus-gravatar.el 2010-10-13 02:19:11 +0000 +++ lisp/gnus/gnus-gravatar.el 2010-11-07 01:10:01 +0000 @@ -63,14 +63,11 @@ (gravatar-size gnus-gravatar-size) name) (dolist (address addresses) - (when (and (setq name (cdr address)) - (string-match "\\`\\*+ " name)) ;; (X-)Faces exist. - (setcdr address (setq name (substring name (match-end 0))))) (when (or force (not (and gnus-gravatar-too-ugly (or (string-match gnus-gravatar-too-ugly (car address)) - (and name + (and (setq name (cdr address)) (string-match gnus-gravatar-too-ugly name)))))) (ignore-errors ------------------------------------------------------------ revno: 102279 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-11-06 18:06:37 -0700 message: Replace more speedbar uses of end-of-line etc with line-end-position. * lisp/speedbar.el (speedbar-generic-item-info) (speedbar-item-info-tag-helper, speedbar-change-expand-button-char) (speedbar-add-indicator, speedbar-check-vc-this-line) (speedbar-check-obj-this-line, speedbar-extract-one-symbol) (speedbar-buffers-line-directory, speedbar-buffer-revert-buffer): Replace more uses of end-of-line etc with line-end-position. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-06 20:23:42 +0000 +++ lisp/ChangeLog 2010-11-07 01:06:37 +0000 @@ -1,3 +1,12 @@ +2010-11-07 Glenn Morris + + * speedbar.el (speedbar-generic-item-info) + (speedbar-item-info-tag-helper, speedbar-change-expand-button-char) + (speedbar-add-indicator, speedbar-check-vc-this-line) + (speedbar-check-obj-this-line, speedbar-extract-one-symbol) + (speedbar-buffers-line-directory, speedbar-buffer-revert-buffer): + Replace more uses of end-of-line etc with line-end-position. + 2010-11-06 Glenn Morris * textmodes/texnfo-upd.el (texinfo-start-menu-description) === modified file 'lisp/speedbar.el' --- lisp/speedbar.el 2010-11-06 20:23:42 +0000 +++ lisp/speedbar.el 2010-11-07 01:06:37 +0000 @@ -1472,7 +1472,7 @@ (if (looking-at "\\s-*[[<({].[]>)}] ") (goto-char (match-end 0))) ;; Get the text (speedbar-message "Text: %s" (buffer-substring-no-properties - (point) (progn (end-of-line) (point)))))) + (point) (line-end-position))))) (defun speedbar-item-info () "Display info in the minibuffer about the button the mouse is over. @@ -1498,8 +1498,7 @@ Return nil if not applicable." (save-excursion (beginning-of-line) - (if (re-search-forward " [-+=]?> \\([^\n]+\\)" - (save-excursion(end-of-line)(point)) t) + (if (re-search-forward " [-+=]?> \\([^\n]+\\)" (line-end-position) t) (let* ((tag (match-string 1)) (attr (speedbar-line-token)) (item nil) @@ -1517,8 +1516,7 @@ (looking-at "\\([0-9]+\\):") (setq item (file-name-nondirectory (speedbar-line-directory))) (speedbar-message "Tag: %s in %s" tag item))) - (if (re-search-forward "{[+-]} \\([^\n]+\\)$" - (save-excursion(end-of-line)(point)) t) + (if (re-search-forward "{[+-]} \\([^\n]+\\)$" (line-end-position) t) (speedbar-message "Group of tags \"%s\"" (match-string 1)) (if (re-search-forward " [+-]?[()|@] \\([^\n]+\\)$" nil t) (let* ((detailtext (match-string 1)) @@ -2062,8 +2060,7 @@ "Change the expansion button character to CHAR for the current line." (save-excursion (beginning-of-line) - (if (re-search-forward ":\\s-*.\\([-+?]\\)" (save-excursion (end-of-line) - (point)) t) + (if (re-search-forward ":\\s-*.\\([-+?]\\)" (line-end-position) t) (speedbar-with-writable (goto-char (match-end 1)) (insert-char char 1 t) @@ -2852,9 +2849,7 @@ (speedbar-with-writable (save-excursion (if (and replace-this - (re-search-forward replace-this (save-excursion (end-of-line) - (point)) - t)) + (re-search-forward replace-this (line-end-position) t)) (delete-region (match-beginning 0) (match-end 0)))) (end-of-line) (if (not (string= " " indicator-string)) @@ -2952,9 +2947,7 @@ (fn (buffer-substring-no-properties ;; Skip-chars: thanks ptype@dra.hmg.gb (point) (progn - (skip-chars-forward "^ " - (save-excursion (end-of-line) - (point))) + (skip-chars-forward "^ " (line-end-position)) (point)))) (fulln (concat f fn))) (if (<= 2 speedbar-verbosity-level) @@ -3026,9 +3019,7 @@ (fn (buffer-substring-no-properties ;; Skip-chars: thanks ptype@dra.hmg.gb (point) (progn - (skip-chars-forward "^ " - (save-excursion (end-of-line) - (point))) + (skip-chars-forward "^ " (line-end-position)) (point)))) (fulln (concat f fn))) (if (<= 2 speedbar-verbosity-level) @@ -3764,17 +3755,12 @@ regular expression EXPR." (let* ((sym (if (stringp expr) (if (save-excursion - (re-search-forward expr (save-excursion - (end-of-line) - (point)) t)) + (re-search-forward expr (line-end-position) t)) (buffer-substring-no-properties (match-beginning 1) (match-end 1))) (funcall expr))) (pos (let ((j (re-search-forward "[\C-?\C-a]\\([0-9]+\\),\\([0-9]+\\)" - (save-excursion - (end-of-line) - (point)) - t))) + (line-end-position) t))) (if (and j sym) (1+ (string-to-number (buffer-substring-no-properties (match-beginning 2) @@ -3948,9 +3934,7 @@ (let* ((bn (speedbar-line-text)) (buffer (if bn (get-buffer bn)))) (if buffer - (if (save-excursion - (end-of-line) - (eq start (point))) + (if (eq start (line-end-position)) (or (with-current-buffer buffer default-directory) "") (buffer-file-name buffer)))))))) @@ -3982,14 +3966,10 @@ (beginning-of-line) ;; If this fails, then it is a non-standard click, and as such, ;; perfectly allowed - (if (re-search-forward "[]>?}] [^ ]" - (line-end-position) - t) + (if (re-search-forward "[]>?}] [^ ]" (line-end-position) t) (let ((text (progn (forward-char -1) - (buffer-substring (point) (save-excursion - (end-of-line) - (point)))))) + (buffer-substring (point) (line-end-position))))) (if (get-buffer text) (progn (set-buffer text) ------------------------------------------------------------ revno: 102278 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2010-11-07 00:22:06 +0000 message: gnus-int.el, nnimap.el, nnir.el: More improvements to thread-referral. message.el (message-send-mail): Don't insert courtesy messages if the message already has List-Post and List-ID messages. gnus-ems.el (gnus-put-image): Use a blank text as the insertion string to avoid making the From headers syntactically invalid. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-11-06 19:35:19 +0000 +++ lisp/gnus/ChangeLog 2010-11-07 00:22:06 +0000 @@ -1,9 +1,32 @@ +2010-11-06 Lars Magne Ingebrigtsen + + * gnus-ems.el (gnus-put-image): Use a blank text as the insertion + string to avoid making the From headers syntactically invalid. + + * message.el (message-send-mail): Don't insert courtesy messages if the + message already has List-Post and List-ID messages. + 2010-11-06 Glenn Morris * gnus-art.el (gnus-treat-article): Give dynamic local variables `condition', `type', `length' a prefix. (gnus-treat-predicate): Update for above name changes. +2010-11-06 Andrew Cohen + + * nnir.el (gnus-summary-nnir-goto-thread): Remove function and + binding. Handled by `gnus-summary-refer-thread' instead. + (nnir-warp-to-article): New backend function. + + * nnimap.el (nnimap-request-thread): Force dependency updating. + + * gnus-sum.el (gnus-fetch-headers): Allow more arguments. + (gnus-summary-refer-thread): Rework to improve thread-referral. + + * gnus-int.el (gnus-warp-to-article): New function. + + * gnus-sum.el (gnus-summary-article-map): Bind it. + 2010-11-04 Andrew Cohen * nnir.el (gnus-summary-nnir-goto-thread): Limit work done by === modified file 'lisp/gnus/gnus-ems.el' --- lisp/gnus/gnus-ems.el 2010-10-29 13:51:15 +0000 +++ lisp/gnus/gnus-ems.el 2010-11-07 00:22:06 +0000 @@ -181,7 +181,7 @@ (defun gnus-put-image (glyph &optional string category) (let ((point (point))) - (insert-image glyph (or string "*")) + (insert-image glyph (or string " ")) (put-text-property point (point) 'gnus-image-category category) (unless string (put-text-property (1- (point)) (point) === modified file 'lisp/gnus/gnus-int.el' --- lisp/gnus/gnus-int.el 2010-10-30 05:59:34 +0000 +++ lisp/gnus/gnus-int.el 2010-11-07 00:22:06 +0000 @@ -503,11 +503,22 @@ (nth 1 gnus-command-method) buffer))) (defun gnus-request-thread (id) - "Request the thread containing the article specified by Message-ID id." + "Request the headers in the thread containing the article +specified by Message-ID id." (let ((gnus-command-method (gnus-find-method-for-group gnus-newsgroup-name))) (funcall (gnus-get-function gnus-command-method 'request-thread) id))) +(defun gnus-warp-to-article () + "Warps from an article in a virtual group to the article in its +real group. Does nothing on a real group." + (interactive) + (let ((gnus-command-method + (gnus-find-method-for-group gnus-newsgroup-name))) + (when (gnus-check-backend-function + 'warp-to-article (car gnus-command-method)) + (funcall (gnus-get-function gnus-command-method 'warp-to-article))))) + (defun gnus-request-head (article group) "Request the head of ARTICLE in GROUP." (let* ((gnus-command-method (gnus-find-method-for-group group)) === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2010-11-04 22:18:09 +0000 +++ lisp/gnus/gnus-sum.el 2010-11-07 00:22:06 +0000 @@ -2061,6 +2061,7 @@ "D" gnus-summary-enter-digest-group "R" gnus-summary-refer-references "T" gnus-summary-refer-thread + "W" gnus-warp-to-article "g" gnus-summary-show-article "s" gnus-summary-isearch-article "P" gnus-summary-print-article @@ -5468,7 +5469,7 @@ (substring subject (match-end 1))))) (mail-header-set-subject header subject)))))) -(defun gnus-fetch-headers (articles) +(defun gnus-fetch-headers (articles &optional limit force-new dependencies) "Fetch headers of ARTICLES." (let ((name (gnus-group-decoded-name gnus-newsgroup-name))) (gnus-message 5 "Fetching headers for %s..." name) @@ -5477,16 +5478,17 @@ (setq gnus-headers-retrieved-by (gnus-retrieve-headers articles gnus-newsgroup-name - ;; We might want to fetch old headers, but - ;; not if there is only 1 article. - (and (or (and - (not (eq gnus-fetch-old-headers 'some)) - (not (numberp gnus-fetch-old-headers))) - (> (length articles) 1)) - gnus-fetch-old-headers)))) + (or limit + ;; We might want to fetch old headers, but + ;; not if there is only 1 article. + (and (or (and + (not (eq gnus-fetch-old-headers 'some)) + (not (numberp gnus-fetch-old-headers))) + (> (length articles) 1)) + gnus-fetch-old-headers))))) (gnus-get-newsgroup-headers-xover - articles nil nil gnus-newsgroup-name t) - (gnus-get-newsgroup-headers)) + articles force-new dependencies gnus-newsgroup-name t) + (gnus-get-newsgroup-headers dependencies force-new)) (gnus-message 5 "Fetching headers for %s...done" name)))) (defun gnus-select-newsgroup (group &optional read-all select-articles) @@ -8835,46 +8837,39 @@ fetch what's specified by the `gnus-refer-thread-limit' variable." (interactive "P") + (gnus-warp-to-article) (let ((id (mail-header-id (gnus-summary-article-header))) - (subject (gnus-simplify-subject - (mail-header-subject (gnus-summary-article-header)))) - (refs (split-string (or (mail-header-references - (gnus-summary-article-header)) ""))) - (gnus-summary-ignore-duplicates t) (gnus-inhibit-demon t) + (gnus-agent nil) + (gnus-summary-ignore-duplicates t) (gnus-read-all-available-headers t) (limit (if limit (prefix-numeric-value limit) gnus-refer-thread-limit))) - (if (gnus-check-backend-function 'request-thread gnus-newsgroup-name) - (setq gnus-newsgroup-headers - (gnus-merge 'list - gnus-newsgroup-headers - (gnus-request-thread id) - 'gnus-article-sort-by-number)) - (unless (eq gnus-fetch-old-headers 'invisible) - (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name) - ;; Retrieve the headers and read them in. - (if (numberp limit) - (gnus-retrieve-headers - (list (min - (+ (mail-header-number - (gnus-summary-article-header)) - limit) - gnus-newsgroup-end)) - gnus-newsgroup-name (* limit 2)) - ;; gnus-refer-thread-limit is t, i.e. fetch _all_ - ;; headers. - (gnus-retrieve-headers (list gnus-newsgroup-end) - gnus-newsgroup-name limit) - (gnus-message 5 "Fetching headers for %s...done" - gnus-newsgroup-name)))) - (when (eq gnus-headers-retrieved-by 'nov) - ;; might as well restrict the headers to the relevant ones. this - ;; should save time when building threads. - (with-current-buffer nntp-server-buffer - (goto-char (point-min)) - (keep-lines (regexp-opt (append refs (list id subject))))) - (gnus-build-all-threads)) + (setq gnus-newsgroup-headers + (gnus-merge + 'list gnus-newsgroup-headers + (if (gnus-check-backend-function + 'request-thread gnus-newsgroup-name) + (gnus-request-thread id) + (let* ((last (if (numberp limit) + (min (+ (mail-header-number + (gnus-summary-article-header)) + limit) + gnus-newsgroup-highest) + gnus-newsgroup-highest)) + (subject (gnus-simplify-subject + (mail-header-subject + (gnus-summary-article-header)))) + (refs (split-string (or (mail-header-references + (gnus-summary-article-header)) + ""))) + (gnus-parse-headers-hook + (lambda () (goto-char (point-min)) + (keep-lines + (regexp-opt (append refs (list id subject))))))) + (gnus-fetch-headers (list last) (if (numberp limit) + (* 2 limit) limit) t))) + 'gnus-article-sort-by-number)) (gnus-summary-limit-include-thread id))) (defun gnus-summary-refer-article (message-id) === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2010-11-04 22:18:09 +0000 +++ lisp/gnus/message.el 2010-11-07 00:22:06 +0000 @@ -4482,6 +4482,8 @@ (save-restriction (message-narrow-to-headers) (and news + (not (message-fetch-field "List-Post")) + (not (message-fetch-field "List-ID")) (or (message-fetch-field "cc") (message-fetch-field "bcc") (message-fetch-field "to")) === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2010-11-04 22:18:09 +0000 +++ lisp/gnus/nnimap.el 2010-11-07 00:22:06 +0000 @@ -1397,23 +1397,23 @@ nil) (deffoo nnimap-request-thread (id) - (let* ((refs (split-string - (or (mail-header-references (gnus-summary-article-header)) - ""))) - (cmd (let ((value - (format - "(OR HEADER REFERENCES %s HEADER Message-Id %s)" - id id))) - (dolist (refid refs value) - (setq value (format - "(OR (OR HEADER Message-Id %s HEADER REFERENCES %s) %s)" - refid refid value))))) - (result - (with-current-buffer (nnimap-buffer) - (nnimap-command "UID SEARCH %s" cmd)))) - (gnus-fetch-headers (and (car result) - (delete 0 (mapcar #'string-to-number - (cdr (assoc "SEARCH" (cdr result))))))))) + (let* ((refs (split-string + (or (mail-header-references (gnus-summary-article-header)) + ""))) + (cmd (let ((value + (format + "(OR HEADER REFERENCES %s HEADER Message-Id %s)" + id id))) + (dolist (refid refs value) + (setq value (format + "(OR (OR HEADER Message-Id %s HEADER REFERENCES %s) %s)" + refid refid value))))) + (result (with-current-buffer (nnimap-buffer) + (nnimap-command "UID SEARCH %s" cmd)))) + (gnus-fetch-headers + (and (car result) (delete 0 (mapcar #'string-to-number + (cdr (assoc "SEARCH" (cdr result)))))) + nil t))) (defun nnimap-possibly-change-group (group server) (let ((open-result t)) === modified file 'lisp/gnus/nnir.el' --- lisp/gnus/nnir.el 2010-11-04 22:18:09 +0000 +++ lisp/gnus/nnir.el 2010-11-07 00:22:06 +0000 @@ -41,9 +41,10 @@ ;; Retrieval Status Value (score). ;; When looking at the retrieval result (in the Summary buffer) you -;; can type `G T' (aka M-x gnus-summary-nnir-goto-thread RET) on an -;; article. You will be teleported into the group this article came -;; from, showing the thread this article is part of. +;; can type `A W' (aka M-x gnus-warp-article RET) on an article. You +;; will be warped into the group this article came from. Typing `A W' +;; (aka M-x gnus-summary-refer-thread RET) will warp to the group and +;; also show the thread this article is part of. ;; The Lisp setup may involve setting a few variables and setting up the ;; search engine. You can define the variables in the server definition @@ -473,56 +474,6 @@ (cons (current-buffer) gnus-current-window-configuration) nil))) -;; Summary mode commands. - -(defun gnus-summary-nnir-goto-thread () - "Only applies to nnir groups. Go to group this article came from -and show thread that contains this article." - (interactive) - (unless (eq 'nnir (car (gnus-find-method-for-group gnus-newsgroup-name))) - (error "Can't execute this command unless in nnir group")) - (let* ((cur (gnus-summary-article-number)) - (group (nnir-artlist-artitem-group nnir-artlist cur)) - (backend-number (nnir-artlist-artitem-number nnir-artlist cur)) - (id (mail-header-id (gnus-summary-article-header))) - (refs (split-string - (mail-header-references (gnus-summary-article-header))))) - (if (eq (car (gnus-find-method-for-group group)) 'nnimap) - (progn - (nnimap-possibly-change-group (gnus-group-short-name group) nil) - (with-current-buffer (nnimap-buffer) - (let* ((cmd - (let ((value - (format - "(OR HEADER REFERENCES %s HEADER Message-Id %s)" - id id))) - (dolist (refid refs value) - (setq value - (format - "(OR (OR HEADER Message-Id %s HEADER REFERENCES %s) %s)" - refid refid value))))) - (result (nnimap-command "UID SEARCH %s" cmd))) - (gnus-summary-read-group-1 - group t t gnus-summary-buffer nil - (and (car result) - (delete 0 (mapcar - #'string-to-number - (cdr (assoc "SEARCH" (cdr result)))))))))) - (gnus-summary-read-group-1 group t t gnus-summary-buffer - nil (list backend-number)) - (gnus-summary-refer-thread)))) - - -(if (fboundp 'eval-after-load) - (eval-after-load "gnus-sum" - '(define-key gnus-summary-goto-map - "T" 'gnus-summary-nnir-goto-thread)) - (add-hook 'gnus-summary-mode-hook - (function (lambda () - (define-key gnus-summary-goto-map - "T" 'gnus-summary-nnir-goto-thread))))) - - ;; Gnus backend interface functions. @@ -656,6 +607,13 @@ (gnus-group-real-name to-newsgroup))) ; Is this move internal )) +(deffoo nnir-warp-to-article () + (let* ((cur (gnus-summary-article-number)) + (gnus-newsgroup-name (nnir-artlist-artitem-group nnir-artlist cur)) + (backend-number (nnir-artlist-artitem-number nnir-artlist cur))) + (gnus-summary-read-group-1 gnus-newsgroup-name t t gnus-summary-buffer + nil (list backend-number)))) + (nnoo-define-skeleton nnir) ------------------------------------------------------------ revno: 102277 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-11-06 13:23:42 -0700 message: Use line-end-position rather than end-of-line, etc. * textmodes/texnfo-upd.el (texinfo-start-menu-description) (texinfo-update-menu-region-beginning, texinfo-menu-first-node) (texinfo-delete-existing-pointers, texinfo-find-pointer) (texinfo-clean-up-node-line, texinfo-insert-node-lines) (texinfo-multiple-files-update): * textmodes/table.el (table--probe-cell-left-up) (table--probe-cell-right-bottom): * textmodes/picture.el (picture-tab-search): * textmodes/page-ext.el (pages-copy-header-and-position) (pages-directory-for-addresses): * progmodes/vera-mode.el (vera-get-offset): * progmodes/simula.el (simula-calculate-indent): * progmodes/python.el (python-pdbtrack-overlay-arrow): * progmodes/prolog.el (end-of-prolog-clause): * progmodes/perl-mode.el (perl-calculate-indent, perl-indent-exp): * progmodes/icon.el (indent-icon-exp): * progmodes/etags.el (tag-re-match-p): * progmodes/ebrowse.el (ebrowse-show-file-name-at-point): * progmodes/ebnf2ps.el (ebnf-begin-file): * progmodes/dcl-mode.el (dcl-back-to-indentation-1) (dcl-save-local-variable): * play/life.el (life-setup): * play/gametree.el (gametree-looking-at-ply): * nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set): * mail/sendmail.el (mail-mode-auto-fill): * emacs-lisp/lisp-mode.el (calculate-lisp-indent): * emacs-lisp/edebug.el (edebug-overlay-arrow): * emacs-lisp/checkdoc.el (checkdoc-this-string-valid): * woman.el (woman-parse-numeric-value, woman2-TH, woman2-SH) (woman-tab-to-tab-stop, WoMan-warn-ignored): * type-break.el (type-break-file-keystroke-count): * term.el (term-replace-by-expanded-history-before-point) (term-skip-prompt, term-extract-string): * speedbar.el (speedbar-edit-line, speedbar-expand-line) (speedbar-contract-line, speedbar-toggle-line-expansion) (speedbar-parse-c-or-c++tag, speedbar-parse-tex-string) (speedbar-buffer-revert-buffer, speedbar-highlight-one-tag-line): * sort.el (sort-skip-fields): * skeleton.el (skeleton-internal-list): * simple.el (line-move-finish, line-move-to-column): * shell.el (shell-forward-command): * misc.el (copy-from-above-command): * makesum.el (double-column): * ebuff-menu.el (electric-buffer-update-highlight): * dired.el (dired-move-to-end-of-filename): * dframe.el (dframe-popup-kludge): * bookmark.el (bookmark-kill-line, bookmark-bmenu-show-filenames): * arc-mode.el (archive-get-lineno): Use line-end-position and line-beginning-position. * net/ange-ftp.el, progmodes/hideif.el, reposition.el: Same, but only in comments. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-06 19:55:44 +0000 +++ lisp/ChangeLog 2010-11-06 20:23:42 +0000 @@ -1,5 +1,55 @@ 2010-11-06 Glenn Morris + * textmodes/texnfo-upd.el (texinfo-start-menu-description) + (texinfo-update-menu-region-beginning, texinfo-menu-first-node) + (texinfo-delete-existing-pointers, texinfo-find-pointer) + (texinfo-clean-up-node-line, texinfo-insert-node-lines) + (texinfo-multiple-files-update): + * textmodes/table.el (table--probe-cell-left-up) + (table--probe-cell-right-bottom): + * textmodes/picture.el (picture-tab-search): + * textmodes/page-ext.el (pages-copy-header-and-position) + (pages-directory-for-addresses): + * progmodes/vera-mode.el (vera-get-offset): + * progmodes/simula.el (simula-calculate-indent): + * progmodes/python.el (python-pdbtrack-overlay-arrow): + * progmodes/prolog.el (end-of-prolog-clause): + * progmodes/perl-mode.el (perl-calculate-indent, perl-indent-exp): + * progmodes/icon.el (indent-icon-exp): + * progmodes/etags.el (tag-re-match-p): + * progmodes/ebrowse.el (ebrowse-show-file-name-at-point): + * progmodes/ebnf2ps.el (ebnf-begin-file): + * progmodes/dcl-mode.el (dcl-back-to-indentation-1) + (dcl-save-local-variable): + * play/life.el (life-setup): + * play/gametree.el (gametree-looking-at-ply): + * nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set): + * mail/sendmail.el (mail-mode-auto-fill): + * emacs-lisp/lisp-mode.el (calculate-lisp-indent): + * emacs-lisp/edebug.el (edebug-overlay-arrow): + * emacs-lisp/checkdoc.el (checkdoc-this-string-valid): + * woman.el (woman-parse-numeric-value, woman2-TH, woman2-SH) + (woman-tab-to-tab-stop, WoMan-warn-ignored): + * type-break.el (type-break-file-keystroke-count): + * term.el (term-replace-by-expanded-history-before-point) + (term-skip-prompt, term-extract-string): + * speedbar.el (speedbar-edit-line, speedbar-expand-line) + (speedbar-contract-line, speedbar-toggle-line-expansion) + (speedbar-parse-c-or-c++tag, speedbar-parse-tex-string) + (speedbar-buffer-revert-buffer, speedbar-highlight-one-tag-line): + * sort.el (sort-skip-fields): + * skeleton.el (skeleton-internal-list): + * simple.el (line-move-finish, line-move-to-column): + * shell.el (shell-forward-command): + * misc.el (copy-from-above-command): + * makesum.el (double-column): + * ebuff-menu.el (electric-buffer-update-highlight): + * dired.el (dired-move-to-end-of-filename): + * dframe.el (dframe-popup-kludge): + * bookmark.el (bookmark-kill-line, bookmark-bmenu-show-filenames): + * arc-mode.el (archive-get-lineno): + Use line-end-position and line-beginning-position. + * progmodes/idlwave.el (idlwave-routine-entry-compare-twins): (idlwave-study-twins): Prefix dynamic local `class'. (idlwave-routine-twin-compare): Update for above name change. === modified file 'lisp/arc-mode.el' --- lisp/arc-mode.el 2010-07-10 18:52:53 +0000 +++ lisp/arc-mode.el 2010-11-06 20:23:42 +0000 @@ -616,7 +616,7 @@ (defun archive-get-lineno () (if (>= (point) archive-file-list-start) (count-lines archive-file-list-start - (save-excursion (beginning-of-line) (point))) + (line-beginning-position)) 0)) (defun archive-get-descr (&optional noerror) @@ -2213,5 +2213,4 @@ (provide 'arc-mode) -;; arch-tag: e5966a01-35ec-4f27-8095-a043a79b457b ;;; arc-mode.el ends here === modified file 'lisp/bookmark.el' --- lisp/bookmark.el 2010-07-14 19:09:28 +0000 +++ lisp/bookmark.el 2010-11-06 20:23:42 +0000 @@ -1,7 +1,8 @@ ;;; bookmark.el --- set bookmarks, maybe annotate them, jump to them later -;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 2001, 2002, 2003, -;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 2001, 2002, 2003, 2004, +;; 2005, 2006, 2007, 2008, 2009, 2010 +;; Free Software Foundation, Inc. ;; Author: Karl Fogel ;; Maintainer: Karl Fogel @@ -816,7 +817,7 @@ "Kill from point to end of line. If optional arg NEWLINE-TOO is non-nil, delete the newline too. Does not affect the kill ring." - (let ((eol (save-excursion (end-of-line) (point)))) + (let ((eol (line-end-position))) (delete-region (point) eol) (if (and newline-too (looking-at "\n")) (delete-char 1)))) @@ -1684,7 +1685,7 @@ (while (< (point) (point-max)) (let ((bmrk (bookmark-bmenu-bookmark))) (push bmrk bookmark-bmenu-hidden-bookmarks) - (let ((start (save-excursion (end-of-line) (point)))) + (let ((start (line-end-position))) (move-to-column bookmark-bmenu-file-column t) ;; Strip off `mouse-face' from the white spaces region. (if (display-mouse-p) @@ -2225,5 +2226,4 @@ (provide 'bookmark) -;; arch-tag: 139f519a-dd0c-4b8d-8b5d-f9fcf53ca8f6 ;;; bookmark.el ends here === modified file 'lisp/dframe.el' --- lisp/dframe.el 2010-09-17 09:04:35 +0000 +++ lisp/dframe.el 2010-11-06 20:23:42 +0000 @@ -1,7 +1,8 @@ ;;; dframe --- dedicate frame support modes -;;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +;; 2005, 2006, 2007, 2008, 2009, 2010 +;; Free Software Foundation, Inc. ;; Author: Eric M. Ludlam ;; Keywords: file, tags, tools @@ -784,8 +785,8 @@ (popup-mode-menu event) (goto-char (event-closest-point event)) (beginning-of-line) - (forward-char (min 5 (- (save-excursion (end-of-line) (point)) - (save-excursion (beginning-of-line) (point))))) + (forward-char (min 5 (- (line-end-position) + (line-beginning-position)))) (popup-mode-menu)) ;; Wait for menu to bail out. `popup-mode-menu' (and other popup ;; menu functions) return immediately. @@ -991,5 +992,4 @@ (provide 'dframe) -;; arch-tag: df9b91b6-e85e-4a76-a02e-b3cb5b686bd4 ;;; dframe.el ends here === modified file 'lisp/dired.el' --- lisp/dired.el 2010-10-08 10:14:47 +0000 +++ lisp/dired.el 2010-11-06 20:23:42 +0000 @@ -2138,7 +2138,7 @@ ;; case-fold-search is nil now, so we can test for capital F: (setq used-F (string-match "F" dired-actual-switches) opoint (point) - eol (save-excursion (end-of-line) (point)) + eol (line-end-position) hidden (and selective-display (save-excursion (search-forward "\r" eol t)))) (if hidden @@ -4030,5 +4030,4 @@ (run-hooks 'dired-load-hook) ; for your customizations -;; arch-tag: e1af7a8f-691c-41a0-aac1-ddd4d3c87517 ;;; dired.el ends here === modified file 'lisp/ebuff-menu.el' --- lisp/ebuff-menu.el 2010-05-08 00:20:30 +0000 +++ lisp/ebuff-menu.el 2010-11-06 20:23:42 +0000 @@ -1,7 +1,7 @@ ;;; ebuff-menu.el --- electric-buffer-list mode -;; Copyright (C) 1985, 1986, 1994, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1985, 1986, 1994, 2001, 2002, 2003, 2004, 2005, 2006, +;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Richard Mlynarik ;; Maintainer: FSF @@ -282,11 +282,10 @@ (make-local-variable 'electric-buffer-overlay) (setq electric-buffer-overlay (make-overlay (point) (point))))) (move-overlay electric-buffer-overlay - (save-excursion (beginning-of-line) (point)) - (save-excursion (end-of-line) (point))) + (line-beginning-position) + (line-end-position)) (overlay-put electric-buffer-overlay 'face 'highlight))) (provide 'ebuff-menu) -;; arch-tag: 1d4509b3-eece-4d4f-95ea-77c83eaf0275 ;;; ebuff-menu.el ends here === modified file 'lisp/emacs-lisp/checkdoc.el' --- lisp/emacs-lisp/checkdoc.el 2010-11-03 03:49:04 +0000 +++ lisp/emacs-lisp/checkdoc.el 2010-11-06 20:23:42 +0000 @@ -1366,7 +1366,7 @@ (setq checkdoc-autofix-flag 'never)))) (checkdoc-create-error "You should convert this comment to documentation" - (point) (save-excursion (end-of-line) (point)))) + (point) (line-end-position))) (checkdoc-create-error (if (nth 2 fp) "All interactive functions should have documentation" === modified file 'lisp/emacs-lisp/edebug.el' --- lisp/emacs-lisp/edebug.el 2010-10-10 23:12:30 +0000 +++ lisp/emacs-lisp/edebug.el 2010-11-06 20:23:42 +0000 @@ -1,8 +1,8 @@ ;;; edebug.el --- a source-level debugger for Emacs Lisp -;; Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, -;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -;; Free Software Foundation, Inc. +;; Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1997, +;; 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, +;; 2010 Free Software Foundation, Inc. ;; Author: Daniel LaLiberte ;; Maintainer: FSF @@ -2991,7 +2991,7 @@ ;; Set up the overlay arrow at beginning-of-line in current buffer. ;; The arrow string is derived from edebug-arrow-alist and ;; edebug-execution-mode. - (let ((pos (save-excursion (beginning-of-line) (point)))) + (let ((pos (line-beginning-position))) (setq overlay-arrow-string (cdr (assq edebug-execution-mode edebug-arrow-alist))) (setq overlay-arrow-position (make-marker)) @@ -4454,5 +4454,4 @@ (provide 'edebug) -;; arch-tag: 19c8d05c-4554-426e-ac72-e0fa1fcb0808 ;;; edebug.el ends here === modified file 'lisp/emacs-lisp/lisp-mode.el' --- lisp/emacs-lisp/lisp-mode.el 2010-10-31 19:25:39 +0000 +++ lisp/emacs-lisp/lisp-mode.el 2010-11-06 20:23:42 +0000 @@ -1067,7 +1067,7 @@ (goto-char calculate-lisp-indent-last-sexp) (or (and (looking-at ":") (setq indent (current-column))) - (and (< (save-excursion (beginning-of-line) (point)) + (and (< (line-beginning-position) (prog2 (backward-sexp) (point))) (looking-at ":") (setq indent (current-column)))) @@ -1429,5 +1429,4 @@ (provide 'lisp-mode) -;; arch-tag: 414c7f93-c245-4b77-8ed5-ed05ef7ff1bf ;;; lisp-mode.el ends here === modified file 'lisp/mail/sendmail.el' --- lisp/mail/sendmail.el 2010-09-28 02:13:41 +0000 +++ lisp/mail/sendmail.el 2010-11-06 20:23:42 +0000 @@ -718,7 +718,7 @@ "Carry out Auto Fill for Mail mode. If within the headers, this makes the new lines into continuation lines." (if (< (point) (mail-header-end)) - (let ((old-line-start (save-excursion (beginning-of-line) (point)))) + (let ((old-line-start (line-beginning-position))) (if (do-auto-fill) (save-excursion (beginning-of-line) @@ -1955,5 +1955,4 @@ (provide 'sendmail) -;; arch-tag: 48bc1025-d993-4d31-8d81-2a29491f0626 ;;; sendmail.el ends here === modified file 'lisp/makesum.el' --- lisp/makesum.el 2010-01-13 08:35:10 +0000 +++ lisp/makesum.el 2010-11-06 20:23:42 +0000 @@ -1,7 +1,7 @@ ;;; makesum.el --- generate key binding summary for Emacs -;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, -;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +;; 2009, 2010 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: help @@ -98,7 +98,7 @@ (forward-line half) (while (< half nlines) (setq half (1+ half)) - (setq line (buffer-substring (point) (save-excursion (end-of-line) (point)))) + (setq line (buffer-substring (point) (line-end-position))) (setq lines (cons line lines)) (delete-region (point) (progn (forward-line 1) (point))))) (setq lines (nreverse lines)) @@ -112,5 +112,4 @@ (provide 'makesum) -;; arch-tag: c2383336-fc89-46ad-8110-ded42bffaee3 ;;; makesum.el ends here === modified file 'lisp/misc.el' --- lisp/misc.el 2010-08-29 16:17:13 +0000 +++ lisp/misc.el 2010-11-06 20:23:42 +0000 @@ -1,7 +1,7 @@ ;;; misc.el --- some nonstandard basic editing commands for Emacs -;; Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005, -;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +;; 2009, 2010 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: convenience @@ -54,7 +54,7 @@ (setq string (concat string (buffer-substring (point) - (min (save-excursion (end-of-line) (point)) + (min (line-end-position) (+ n (point))))))) (insert string))) @@ -132,5 +132,4 @@ (provide 'misc) -;; arch-tag: 908f7884-c19e-4388-920c-9cfa425e449b ;;; misc.el ends here === modified file 'lisp/net/ange-ftp.el' --- lisp/net/ange-ftp.el 2010-09-21 08:35:18 +0000 +++ lisp/net/ange-ftp.el 2010-11-06 20:23:42 +0000 @@ -4901,7 +4901,7 @@ ;; ;; This is the Unix dl version. ;; (let ((opoint (point)) ;; case-fold-search hidden) -;; (or eol (setq eol (save-excursion (end-of-line) (point)))) +;; (or eol (setq eol (line-end-position))) ;; (setq hidden (and selective-display ;; (save-excursion ;; (search-forward "\r" eol t)))) @@ -5300,7 +5300,7 @@ ;; ;; This is the VMS version. ;; (let (opoint hidden case-fold-search) ;; (setq opoint (point)) -;; (or eol (setq eol (save-excursion (end-of-line) (point)))) +;; (or eol (setq eol (line-end-position))) ;; (setq hidden (and selective-display ;; (save-excursion (search-forward "\r" eol t)))) ;; (if hidden @@ -5658,7 +5658,7 @@ ;; ;; This is the MTS version. ;; (let (opoint hidden case-fold-search) ;; (setq opoint (point) -;; eol (save-excursion (end-of-line) (point)) +;; eol (line-end-position) ;; hidden (and selective-display ;; (save-excursion (search-forward "\r" eol t)))) ;; (if hidden @@ -5879,7 +5879,7 @@ ;; ;; This is the CMS version. ;; (let ((opoint (point)) ;; case-fold-search hidden) -;; (or eol (setq eol (save-excursion (end-of-line) (point)))) +;; (or eol (setq eol (line-end-position))) ;; (setq hidden (and selective-display ;; (save-excursion ;; (search-forward "\r" eol t)))) @@ -6153,5 +6153,4 @@ (provide 'ange-ftp) -;; arch-tag: 2987ef88-cb56-4ec1-87a9-79132572e316 ;;; ange-ftp.el ends here === modified file 'lisp/nxml/nxml-maint.el' --- lisp/nxml/nxml-maint.el 2010-01-13 08:35:10 +0000 +++ lisp/nxml/nxml-maint.el 2010-11-06 20:23:42 +0000 @@ -1,6 +1,7 @@ ;;; nxml-maint.el --- commands for maintainers of nxml-*.el -;; Copyright (C) 2003, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2007, 2008, 2009, 2010 +;; Free Software Foundation, Inc. ;; Author: James Clark ;; Keywords: XML @@ -78,7 +79,7 @@ (goto-char (point-min)) (while (re-search-forward "^ *\\([a-FA-F0-9]\\{2\\}\\)[ \t]+" nil t) (let ((row (match-string 1)) - (eol (save-excursion (end-of-line) (point)))) + (eol (line-end-position))) (while (re-search-forward "\\([a-FA-F0-9]\\{2\\}\\)-\\([a-FA-F0-9]\\{2\\}\\)\\|\\([a-FA-F0-9]\\{2\\}\\)" eol t) (setq lst (cons (if (match-beginning 3) @@ -102,5 +103,4 @@ (provide 'nxml-maint) -;; arch-tag: 2cff6b55-12af-47db-90da-a91f782f435a ;;; nxml-maint.el ends here === modified file 'lisp/play/gametree.el' --- lisp/play/gametree.el 2010-01-13 08:35:10 +0000 +++ lisp/play/gametree.el 2010-11-06 20:23:42 +0000 @@ -201,7 +201,7 @@ (let ((boundary (concat "[ \t]*\\([1-9][0-9]*\\)\\(" gametree-full-ply-regexp "\\|" gametree-half-ply-regexp "\\)")) - (limit (save-excursion (beginning-of-line 1) (point)))) + (limit (line-beginning-position 1))) (if (looking-at boundary) (+ (* 2 (string-to-number (match-string 1))) (if (string-match gametree-half-ply-regexp (match-string 2)) 1 0)) @@ -617,5 +617,4 @@ (provide 'gametree) -;; arch-tag: aaa30943-9ae4-4cc1-813d-a46f96b7e4f1 ;;; gametree.el ends here === modified file 'lisp/play/life.el' --- lisp/play/life.el 2010-01-13 08:35:10 +0000 +++ lisp/play/life.el 2010-11-06 20:23:42 +0000 @@ -1,7 +1,7 @@ ;;; life.el --- John Horton Conway's `Life' game for GNU Emacs -;; Copyright (C) 1988, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1988, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +;; 2009, 2010 Free Software Foundation, Inc. ;; Author: Kyle Jones ;; Maintainer: FSF @@ -163,7 +163,7 @@ (replace-match (life-life-string) t t)) ;; center the pattern horizontally (goto-char (point-min)) - (setq n (/ (- fill-column (save-excursion (end-of-line) (point))) 2)) + (setq n (/ (- fill-column (line-end-position)) 2)) (while (not (eobp)) (indent-to n) (forward-line)) @@ -302,5 +302,4 @@ (provide 'life) -;; arch-tag: e9373544-755e-42f5-a9a1-4d4c422bb97a ;;; life.el ends here === modified file 'lisp/progmodes/dcl-mode.el' --- lisp/progmodes/dcl-mode.el 2010-10-24 21:36:09 +0000 +++ lisp/progmodes/dcl-mode.el 2010-11-06 20:23:42 +0000 @@ -1,7 +1,7 @@ ;;; dcl-mode.el --- major mode for editing DCL command files -;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -;; Free Software Foundation, Inc. +;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +;; 2009, 2010 Free Software Foundation, Inc. ;; Author: Odd Gripenstam ;; Maintainer: Odd Gripenstam @@ -821,7 +821,7 @@ ;; text ;; 1 - (let* ((default-limit (save-excursion (end-of-line) (1+ (point)))) + (let* ((default-limit (1+ (line-end-position))) (limit (or limit default-limit)) (last-good-point (point)) (opoint (point))) @@ -1783,7 +1783,7 @@ (skip-chars-forward " \t") (or (eolp) (setq suffix-string (buffer-substring (point) - (progn (end-of-line) (point))))) + (line-end-position)))) (goto-char (match-beginning 0)) (or (bolp) (setq prefix-string @@ -2214,5 +2214,4 @@ (run-hooks 'dcl-mode-load-hook) ; for your customizations -;; arch-tag: e00d421b-f26c-483e-a8bd-af412ea7764a ;;; dcl-mode.el ends here === modified file 'lisp/progmodes/ebnf2ps.el' --- lisp/progmodes/ebnf2ps.el 2010-01-13 08:35:10 +0000 +++ lisp/progmodes/ebnf2ps.el 2010-11-06 20:23:42 +0000 @@ -1,7 +1,7 @@ ;;; ebnf2ps.el --- translate an EBNF to a syntactic chart on PostScript -;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -;; Free Software Foundation, Inc. +;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +;; 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Vinicius Jose Latorre ;; Maintainer: Vinicius Jose Latorre @@ -5279,7 +5279,7 @@ (goto-char (point-min)) (and (search-forward "%%Creator: " nil t) (not (search-forward "& ebnf2ps v" - (save-excursion (end-of-line) (point)) + (line-end-position) t)) (progn ;; adjust creator comment @@ -6395,5 +6395,4 @@ (provide 'ebnf2ps) -;; arch-tag: 148bc8af-5398-468b-b922-eeb7afef3e4f ;;; ebnf2ps.el ends here === modified file 'lisp/progmodes/ebrowse.el' --- lisp/progmodes/ebrowse.el 2010-01-13 08:35:10 +0000 +++ lisp/progmodes/ebrowse.el 2010-11-06 20:23:42 +0000 @@ -1,8 +1,8 @@ ;;; ebrowse.el --- Emacs C++ class browser & tags facility -;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -;; Free Software Foundation Inc. +;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +;; Free Software Foundation Inc. ;; Author: Gerd Moellmann ;; Maintainer: FSF @@ -1313,7 +1313,7 @@ (skip-chars-forward " \t*a-zA-Z0-9_") (setq start (point) file-name-existing (looking-at "(")) - (delete-region start (save-excursion (end-of-line) (point))) + (delete-region start (line-end-position)) (unless file-name-existing (indent-to ebrowse-source-file-column) (insert "(" (or (ebrowse-cs-file @@ -4491,5 +4491,4 @@ ;; eval:(put 'ebrowse-for-all-trees 'lisp-indent-hook 1) ;; End: -;; arch-tag: 4fa3c8bf-1771-479b-bcd7-b029c7c9677b ;;; ebrowse.el ends here === modified file 'lisp/progmodes/etags.el' --- lisp/progmodes/etags.el 2010-09-25 21:42:48 +0000 +++ lisp/progmodes/etags.el 2010-11-06 20:23:42 +0000 @@ -1,8 +1,8 @@ ;;; etags.el --- etags facility for Emacs -;; Copyright (C) 1985, 1986, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1998, -;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -;; Free Software Foundation, Inc. +;; Copyright (C) 1985, 1986, 1988, 1989, 1992, 1993, 1994, 1995, 1996, +;; 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, +;; 2010 Free Software Foundation, Inc. ;; Author: Roland McGrath ;; Maintainer: FSF @@ -1681,7 +1681,7 @@ (save-excursion (beginning-of-line) (let ((bol (point))) - (and (search-forward "\177" (save-excursion (end-of-line) (point)) t) + (and (search-forward "\177" (line-end-position) t) (re-search-backward re bol t))))) (defcustom tags-loop-revert-buffers nil @@ -2086,5 +2086,4 @@ (provide 'etags) -;; arch-tag: b897c2b5-08f3-4837-b2d3-0e7d6db1b63e ;;; etags.el ends here === modified file 'lisp/progmodes/hideif.el' --- lisp/progmodes/hideif.el 2010-01-13 08:35:10 +0000 +++ lisp/progmodes/hideif.el 2010-11-06 20:23:42 +0000 @@ -760,7 +760,7 @@ (cond ((hif-looking-at-else) (setq else (point))) (t - (setq end (point)))) ; (save-excursion (end-of-line) (point)) + (setq end (point)))) ; (line-end-position) ;; If found #else, look for #endif. (when else (while (progn @@ -769,7 +769,7 @@ (hif-ifdef-to-endif)) (if (hif-looking-at-else) (error "Found two elses in a row? Broken!")) - (setq end (point))) ; (save-excursion (end-of-line) (point)) + (setq end (point))) ; (line-end-position) (hif-make-range start end else)))) @@ -1025,5 +1025,4 @@ (provide 'hideif) -;; arch-tag: c6381d17-a59a-483a-b945-658f22277981 ;;; hideif.el ends here === modified file 'lisp/progmodes/icon.el' --- lisp/progmodes/icon.el 2010-01-13 08:35:10 +0000 +++ lisp/progmodes/icon.el 2010-11-06 20:23:42 +0000 @@ -1,7 +1,7 @@ ;;; icon.el --- mode for editing Icon code -;; Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -;; Free Software Foundation, Inc. +;; Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +;; 2009, 2010 Free Software Foundation, Inc. ;; Author: Chris Smith ;; Created: 15 Feb 89 @@ -601,7 +601,7 @@ (indent-to this-indent))) ;; Indent any comment following the text. (or (looking-at comment-start-skip) - (if (re-search-forward comment-start-skip (save-excursion (end-of-line) (point)) t) + (if (re-search-forward comment-start-skip (line-end-position) t) (progn (indent-for-comment) (beginning-of-line)))))))))) (defconst icon-font-lock-keywords-1 @@ -687,5 +687,4 @@ (provide 'icon) -;; arch-tag: 8abf8c99-e7df-44af-a58f-ef5ed2ee52cb ;;; icon.el ends here === modified file 'lisp/progmodes/perl-mode.el' --- lisp/progmodes/perl-mode.el 2010-11-03 02:30:12 +0000 +++ lisp/progmodes/perl-mode.el 2010-11-06 20:23:42 +0000 @@ -920,9 +920,7 @@ (cond ((looking-at ";?#") (forward-line 1) t) ((looking-at "\\(\\w\\|\\s_\\)+:[^:]") - (save-excursion - (end-of-line) - (setq colon-line-end (point))) + (setq colon-line-end (line-end-position)) (search-forward ":"))))) ;; The first following code counts ;; if it is before the line we want to indent. @@ -982,7 +980,7 @@ (if (= (char-after (marker-position bof-mark)) ?=) (message "Can't indent a format statement") (message "Indenting Perl expression...") - (save-excursion (end-of-line) (setq eol (point))) + (setq eol (line-end-position)) (save-excursion ; locate matching close paren (while (and (not (eobp)) (<= (point) eol)) (parse-partial-sexp (point) (point-max) 0)) @@ -1080,5 +1078,4 @@ (provide 'perl-mode) -;; arch-tag: 8c7ff68d-15f3-46a2-ade2-b7c41f176826 ;;; perl-mode.el ends here === modified file 'lisp/progmodes/prolog.el' --- lisp/progmodes/prolog.el 2010-10-29 19:20:28 +0000 +++ lisp/progmodes/prolog.el 2010-11-06 20:23:42 +0000 @@ -242,7 +242,7 @@ (defun end-of-prolog-clause () "Go to end of clause in this line." (beginning-of-line 1) - (let* ((eolpos (save-excursion (end-of-line) (point)))) + (let* ((eolpos (line-end-position))) (if (re-search-forward comment-start-skip eolpos 'move) (goto-char (match-beginning 0))) (skip-chars-backward " \t"))) @@ -434,5 +434,4 @@ (provide 'prolog) -;; arch-tag: f3ec6748-1272-4ab6-8826-c50cb1607636 ;;; prolog.el ends here === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2010-09-10 23:13:42 +0000 +++ lisp/progmodes/python.el 2010-11-06 20:23:42 +0000 @@ -2605,7 +2605,7 @@ overlay-arrow-string "=>" python-pdbtrack-is-tracking-p t) (set-marker overlay-arrow-position - (save-excursion (beginning-of-line) (point)) + (line-beginning-position) (current-buffer))) (setq overlay-arrow-position nil python-pdbtrack-is-tracking-p nil))) @@ -2891,5 +2891,4 @@ (provide 'python) (provide 'python-21) -;; arch-tag: 6fce1d99-a704-4de9-ba19-c6e4912b0554 ;;; python.el ends here === modified file 'lisp/progmodes/simula.el' --- lisp/progmodes/simula.el 2010-09-10 23:13:42 +0000 +++ lisp/progmodes/simula.el 2010-11-06 20:23:42 +0000 @@ -964,7 +964,7 @@ (simula-previous-statement 1) (simula-skip-comment-backward))) (setq start-line - (save-excursion (beginning-of-line) (point)) + (line-beginning-position) ;; - perhaps this is a continued statement continued (save-excursion @@ -1023,7 +1023,7 @@ (car simula-continued-statement-offset) simula-continued-statement-offset)))) (setq start-line - (save-excursion (beginning-of-line) (point)) + (line-beginning-position) continued nil)) ;; search failed .. point is at beginning of line ;; determine if we should continue searching @@ -1064,7 +1064,7 @@ simula-continued-statement-offset)))) ;; while ends if point is at beginning of line at loop test (if (not temp) - (setq start-line (save-excursion (beginning-of-line) (point))) + (setq start-line (line-beginning-position)) (beginning-of-line)))) ;; ;; return indentation @@ -1659,5 +1659,4 @@ (provide 'simula) -;; arch-tag: 488c1bb0-eebf-4f06-93df-1df603f06255 ;;; simula.el ends here === modified file 'lisp/progmodes/vera-mode.el' --- lisp/progmodes/vera-mode.el 2010-01-13 08:35:10 +0000 +++ lisp/progmodes/vera-mode.el 2010-11-06 20:23:42 +0000 @@ -770,7 +770,7 @@ relpos 0) (setq offset (vera-evaluate-offset offset langelem symbol))) (+ (if (and relpos - (< relpos (save-excursion (beginning-of-line) (point)))) + (< relpos (line-beginning-position))) (save-excursion (goto-char relpos) (current-column)) @@ -1482,5 +1482,4 @@ (provide 'vera-mode) -;; arch-tag: 22eae722-7ac5-47ac-a713-c4db1cf623a9 ;;; vera-mode.el ends here === modified file 'lisp/reposition.el' --- lisp/reposition.el 2010-01-13 08:35:10 +0000 +++ lisp/reposition.el 2010-11-06 20:23:42 +0000 @@ -1,7 +1,7 @@ ;;; reposition.el --- center a Lisp function or comment on the screen -;; Copyright (C) 1991, 1994, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1991, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +;; 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Michael D. Ernst ;; Created: Jan 1991 @@ -58,7 +58,7 @@ comments, including the first comment line, are visible), or to make the first comment line visible (if point is in a comment)." (interactive "P") - (let* (;; (here (save-excursion (beginning-of-line) (point))) + (let* (;; (here (line-beginning-position)) (here (point)) ;; change this name once I've gotten rid of references to ht. ;; this is actually the number of the last screen line @@ -193,5 +193,4 @@ (provide 'reposition) -;; arch-tag: 79487039-3bd7-4ab5-a3e8-ecf3b4919010 ;;; reposition.el ends here === modified file 'lisp/shell.el' --- lisp/shell.el 2010-11-06 12:08:58 +0000 +++ lisp/shell.el 2010-11-06 20:23:42 +0000 @@ -1,7 +1,8 @@ ;;; shell.el --- specialized comint.el for running the shell -;; Copyright (C) 1988, 1993, 1994, 1995, 1996, 1997, 2000, 2001, -;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1988, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, +;; 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +;; Free Software Foundation, Inc. ;; Author: Olin Shivers ;; Simon Marshall @@ -928,7 +929,7 @@ "Move forward across ARG shell command(s). Does not cross lines. See `shell-command-regexp'." (interactive "p") - (let ((limit (save-excursion (end-of-line nil) (point)))) + (let ((limit (line-end-position))) (if (re-search-forward (concat shell-command-regexp "\\([;&|][\t ]*\\)+") limit 'move arg) (skip-syntax-backward " ")))) @@ -1111,5 +1112,4 @@ (provide 'shell) -;; arch-tag: bcb5f12a-c1f4-4aea-a809-2504bd5bd797 ;;; shell.el ends here === modified file 'lisp/simple.el' --- lisp/simple.el 2010-10-29 03:29:29 +0000 +++ lisp/simple.el 2010-11-06 20:23:42 +0000 @@ -4474,7 +4474,7 @@ (let (new (old (point)) - (line-beg (save-excursion (beginning-of-line) (point))) + (line-beg (line-beginning-position)) (line-end ;; Compute the end of the line ;; ignoring effectively invisible newlines. @@ -4582,7 +4582,7 @@ ;; that will get us to the same place on the screen ;; but with a more reasonable buffer position. (goto-char normal-location) - (let ((line-beg (save-excursion (beginning-of-line) (point)))) + (let ((line-beg (line-beginning-position))) (while (and (not (bolp)) (invisible-p (1- (point)))) (goto-char (previous-char-property-change (point) line-beg)))))))) === modified file 'lisp/skeleton.el' --- lisp/skeleton.el 2010-05-25 02:11:08 +0000 +++ lisp/skeleton.el 2010-11-06 20:23:42 +0000 @@ -1,7 +1,7 @@ ;;; skeleton.el --- Lisp language extension for writing statement skeletons -*- coding: utf-8 -*- -;; Copyright (C) 1993, 1994, 1995, 1996, 2001, 2002, 2003, -;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1994, 1995, 1996, 2001, 2002, 2003, 2004, 2005, +;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Daniel Pfeiffer ;; Maintainer: FSF @@ -318,7 +318,7 @@ prompt)) (defun skeleton-internal-list (skeleton &optional str recursive) - (let* ((start (save-excursion (beginning-of-line) (point))) + (let* ((start (line-beginning-position)) (column (current-column)) (line (buffer-substring start (line-end-position))) opoint) @@ -562,5 +562,4 @@ (provide 'skeleton) -;; arch-tag: ccad7bd5-eb5d-40de-9ded-900197215c3e ;;; skeleton.el ends here === modified file 'lisp/sort.el' --- lisp/sort.el 2010-01-13 08:35:10 +0000 +++ lisp/sort.el 2010-11-06 20:23:42 +0000 @@ -1,7 +1,7 @@ ;;; sort.el --- commands to sort text in an Emacs buffer -;; Copyright (C) 1986, 1987, 1994, 1995, 2001, 2002, 2003, -;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1986, 1987, 1994, 1995, 2001, 2002, 2003, 2004, 2005, +;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Howie Kaye ;; Maintainer: FSF @@ -361,8 +361,8 @@ (if (eolp) (error "Line has too few fields: %s" (buffer-substring - (save-excursion (beginning-of-line) (point)) - (save-excursion (end-of-line) (point)))))) + (line-beginning-position) + (line-end-position))))) (end-of-line) ;; Skip back across - N - 1 fields. (let ((i (1- (- n)))) @@ -374,8 +374,8 @@ (if (bolp) (error "Line has too few fields: %s" (buffer-substring - (save-excursion (beginning-of-line) (point)) - (save-excursion (end-of-line) (point))))) + (line-beginning-position) + (line-end-position)))) ;; Position at the front of the field ;; even if moving backwards. (skip-chars-backward "^ \t\n"))) @@ -559,5 +559,4 @@ (provide 'sort) -;; arch-tag: fbac12be-2a7b-4c8a-9665-264d61f70bd9 ;;; sort.el ends here === modified file 'lisp/speedbar.el' --- lisp/speedbar.el 2010-10-31 14:40:01 +0000 +++ lisp/speedbar.el 2010-11-06 20:23:42 +0000 @@ -3249,7 +3249,7 @@ ;; If this fails, then it is a non-standard click, and as such, ;; perfectly allowed. (if (re-search-forward "[]>?}] [^ ]" - (save-excursion (end-of-line) (point)) + (line-end-position) t) (progn (forward-char -1) @@ -3267,7 +3267,7 @@ (condition-case nil (progn (re-search-forward ":\\s-*.\\+. " - (save-excursion (end-of-line) (point))) + (line-end-position)) (forward-char -2) (speedbar-do-function-pointer)) (error (speedbar-position-cursor-on-line))))) @@ -3284,7 +3284,7 @@ (condition-case nil (progn (re-search-forward ":\\s-*.-. " - (save-excursion (end-of-line) (point))) + (line-end-position)) (forward-char -2) (speedbar-do-function-pointer)) (error (speedbar-position-cursor-on-line)))) @@ -3296,7 +3296,7 @@ (condition-case nil (progn (re-search-forward ":\\s-*.[-+]. " - (save-excursion (end-of-line) (point))) + (line-end-position)) (forward-char -2) (speedbar-do-function-pointer)) (error (speedbar-position-cursor-on-line)))) @@ -3787,7 +3787,7 @@ (defun speedbar-parse-c-or-c++tag () "Parse a C or C++ tag, which tends to be a little complex." (save-excursion - (let ((bound (save-excursion (end-of-line) (point)))) + (let ((bound (line-end-position))) (cond ((re-search-forward "\C-?\\([^\C-a]+\\)\C-a" bound t) (buffer-substring-no-properties (match-beginning 1) (match-end 1))) @@ -3803,7 +3803,7 @@ (defun speedbar-parse-tex-string () "Parse a Tex string. Only find data which is relevant." (save-excursion - (let ((bound (save-excursion (end-of-line) (point)))) + (let ((bound (line-end-position))) (cond ((re-search-forward "\\(\\(sub\\)*section\\|chapter\\|cite\\)\\s-*{[^\C-?}]*}?" bound t) (buffer-substring-no-properties (match-beginning 0) (match-end 0))) @@ -3983,7 +3983,7 @@ ;; If this fails, then it is a non-standard click, and as such, ;; perfectly allowed (if (re-search-forward "[]>?}] [^ ]" - (save-excursion (end-of-line) (point)) + (line-end-position) t) (let ((text (progn (forward-char -1) @@ -4005,7 +4005,7 @@ "Highlight the current line, unhighlighting a previously jumped to line." (speedbar-unhighlight-one-tag-line) (setq speedbar-highlight-one-tag-line - (speedbar-make-overlay (save-excursion (beginning-of-line) (point)) + (speedbar-make-overlay (line-beginning-position) (save-excursion (end-of-line) (forward-char 1) (point)))) === modified file 'lisp/term.el' --- lisp/term.el 2010-09-02 10:17:02 +0000 +++ lisp/term.el 2010-11-06 20:23:42 +0000 @@ -1,7 +1,8 @@ ;;; term.el --- general command interpreter in a window stuff -;; Copyright (C) 1988, 1990, 1992, 1994, 1995, 2001, 2002, 2003, -;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1988, 1990, 1992, 1994, 1995, 2001, 2002, 2003, 2004, +;; 2005, 2006, 2007, 2008, 2009, 2010 +;; Free Software Foundation, Inc. ;; Author: Per Bothner ;; Maintainer: Dan Nicolaescu , Per Bothner @@ -1798,15 +1799,11 @@ "Expand directory stack reference before point. See `term-replace-by-expanded-history'. Returns t if successful." (save-excursion - (let ((toend (- (save-excursion (end-of-line nil) (point)) (point))) + (let ((toend (- (line-end-position) (point))) (start (progn (term-bol nil) (point)))) (while (progn - (skip-chars-forward "^!^" - (save-excursion - (end-of-line nil) (- (point) toend))) - (< (point) - (save-excursion - (end-of-line nil) (- (point) toend)))) + (skip-chars-forward "^!^" (- (line-end-position) toend)) + (< (point) (- (line-end-position) toend))) ;; This seems a bit complex. We look for references such as !!, !-num, ;; !foo, !?foo, !{bar}, !?{bar}, ^oh, ^my^, ^god^it, ^never^ends^. ;; If that wasn't enough, the plings can be suffixed with argument @@ -2112,7 +2109,7 @@ (defun term-skip-prompt () "Skip past the text matching regexp `term-prompt-regexp'. If this takes us past the end of the current line, don't skip at all." - (let ((eol (save-excursion (end-of-line) (point)))) + (let ((eol (line-end-position))) (when (and (looking-at term-prompt-regexp) (<= (match-end 0) eol)) (goto-char (match-end 0))))) @@ -2471,11 +2468,10 @@ "Return string around `point' that starts the current line or nil." (save-excursion (let* ((point (point)) - (bol (progn (beginning-of-line) (point))) - (eol (progn (end-of-line) (point))) - (start (progn (goto-char point) - (and (search-backward "\"" bol t) - (1+ (point))))) + (bol (line-beginning-position)) + (eol (line-end-position)) + (start (and (search-backward "\"" bol t) + (1+ (point)))) (end (progn (goto-char point) (and (search-forward "\"" eol t) (1- (point)))))) @@ -4534,5 +4530,4 @@ (provide 'term) -;; arch-tag: eee16bc8-2cd7-4147-9534-a5694752f716 ;;; term.el ends here === modified file 'lisp/textmodes/page-ext.el' --- lisp/textmodes/page-ext.el 2010-09-23 06:42:45 +0000 +++ lisp/textmodes/page-ext.el 2010-11-06 20:23:42 +0000 @@ -671,7 +671,7 @@ (setq position (make-marker)) (set-marker position (point)) (let ((start (point)) - (end (save-excursion (end-of-line) (point))) + (end (line-end-position)) inserted-at) ;; change to directory buffer (set-buffer standard-output) @@ -783,7 +783,7 @@ (delete-other-windows)) (save-excursion (goto-char (point-min)) - (delete-region (point) (save-excursion (end-of-line) (point))) + (delete-region (point) (line-end-position)) (insert "=== Address List Directory: use `C-c C-c' to go to page under cursor. ===") (set-buffer-modified-p nil) @@ -801,5 +801,4 @@ (provide 'page-ext) -;; arch-tag: 2f311550-c6e0-4458-9c12-7f039c058bdb ;;; page-ext.el ends here === modified file 'lisp/textmodes/picture.el' --- lisp/textmodes/picture.el 2010-09-23 06:42:45 +0000 +++ lisp/textmodes/picture.el 2010-11-06 20:23:42 +0000 @@ -438,7 +438,7 @@ (move-to-column target)) (if (re-search-forward (concat "[ \t]+[" (regexp-quote picture-tab-chars) "]") - (save-excursion (end-of-line) (point)) + (line-end-position) 'move) (setq target (1- (current-column))) (setq target nil))) @@ -775,5 +775,4 @@ (provide 'picture) -;; arch-tag: e452d08d-a470-4fbf-896e-ea276698d1ca ;;; picture.el ends here === modified file 'lisp/textmodes/table.el' --- lisp/textmodes/table.el 2010-09-23 06:48:13 +0000 +++ lisp/textmodes/table.el 2010-11-06 20:23:42 +0000 @@ -5057,7 +5057,7 @@ (intersection-str (regexp-quote (char-to-string table-cell-intersection-char))) (v-border (format "[%c%c]" table-cell-vertical-char table-cell-intersection-char)) (h-border (format "[%s%c]" table-cell-horizontal-chars table-cell-intersection-char)) - (limit (save-excursion (beginning-of-line) (point)))) + (limit (line-beginning-position))) (catch 'end (while t (catch 'retry-horizontal @@ -5095,7 +5095,7 @@ (intersection-str (regexp-quote (char-to-string table-cell-intersection-char))) (v-border (format "[%c%c]" table-cell-vertical-char table-cell-intersection-char)) (h-border (format "[%s%c]" table-cell-horizontal-chars table-cell-intersection-char)) - (limit (save-excursion (end-of-line) (point)))) + (limit (line-end-position))) (catch 'end (while t (catch 'retry-horizontal @@ -5589,5 +5589,4 @@ (provide 'table) -;; arch-tag: 0d69b03e-aa5f-4e72-8806-5727217617e0 ;;; table.el ends here === modified file 'lisp/textmodes/texnfo-upd.el' --- lisp/textmodes/texnfo-upd.el 2010-01-13 08:35:10 +0000 +++ lisp/textmodes/texnfo-upd.el 2010-11-06 20:23:42 +0000 @@ -719,21 +719,21 @@ (let (beginning end node-name title) (save-excursion (beginning-of-line) - (if (search-forward "* " (save-excursion (end-of-line) (point)) t) + (if (search-forward "* " (line-end-position) t) (progn (skip-chars-forward " \t") (setq beginning (point))) (error "This is not a line in a menu")) (cond ;; "Double colon" entry line; menu entry and node name are the same, - ((search-forward "::" (save-excursion (end-of-line) (point)) t) + ((search-forward "::" (line-end-position) t) (if (looking-at "[ \t]*[^ \t\n]+") (error "Descriptive text already exists")) (skip-chars-backward ": \t") (setq node-name (buffer-substring beginning (point)))) ;; "Single colon" entry line; menu entry and node name are different. - ((search-forward ":" (save-excursion (end-of-line) (point)) t) + ((search-forward ":" (line-end-position) t) (skip-chars-forward " \t") (setq beginning (point)) ;; Menu entry line ends in a period, comma, or tab. @@ -1154,8 +1154,7 @@ (save-excursion (goto-char (point-min)) (re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" nil t) - (beginning-of-line) - (point))) + (line-beginning-position))) (t (save-excursion (re-search-backward @@ -1206,13 +1205,11 @@ First argument is the position of the beginning of the section in which the menu will be located; second argument is the position of the end of that region; it limits the search." - (save-excursion (goto-char beginning) (forward-line 1) (re-search-forward "^@node" end t) - (beginning-of-line) - (point))) + (line-beginning-position))) ;;; Updating a node @@ -1331,7 +1328,7 @@ Starts from the current position of the cursor, and searches forward on the line for a comma and if one is found, deletes the rest of the line, including the comma. Leaves point at beginning of line." - (let ((eol-point (save-excursion (end-of-line) (point)))) + (let ((eol-point (line-end-position))) (if (search-forward "," eol-point t) (delete-region (1- (point)) eol-point))) (beginning-of-line)) @@ -1437,8 +1434,7 @@ "\\)") (save-excursion (goto-char beginning) - (beginning-of-line) - (point)) + (line-beginning-position)) t) 'normal 'no-pointer)) @@ -1483,7 +1479,7 @@ "Remove extra commas, if any, at end of node line." (end-of-line) (skip-chars-backward ", ") - (delete-region (point) (save-excursion (end-of-line) (point)))) + (delete-region (point) (line-end-position))) ;;; Updating nodes sequentially @@ -1647,7 +1643,7 @@ (skip-chars-forward " \t") (setq title (buffer-substring (point) - (save-excursion (end-of-line) (point)))))) + (line-end-position))))) ;; Insert node line if necessary. (if (re-search-backward "^@node" @@ -1993,9 +1989,7 @@ (point-min) (save-excursion (re-search-forward "^@include") - (beginning-of-line) - (point))) - + (line-beginning-position))) ;; If found, leave point after word `menu' on the `@menu' line. (progn (texinfo-incorporate-descriptions main-menu-list) @@ -2057,5 +2051,4 @@ ;; Place `provide' at end of file. (provide 'texnfo-upd) -;; arch-tag: d21613a5-c32f-43f4-8af4-bfb1e7455842 ;;; texnfo-upd.el ends here === modified file 'lisp/type-break.el' --- lisp/type-break.el 2010-05-03 02:29:46 +0000 +++ lisp/type-break.el 2010-11-06 20:23:42 +0000 @@ -1,7 +1,7 @@ ;;; type-break.el --- encourage rests from typing at appropriate intervals -;; Copyright (C) 1994, 1995, 1997, 2000, 2001, 2002, 2003, -;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1995, 1997, 2000, 2001, 2002, 2003, 2004, 2005, +;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Noah Friedman ;; Maintainer: Noah Friedman @@ -495,7 +495,7 @@ (let ((inhibit-read-only t)) (goto-char (point-min)) (forward-line) - (delete-region (point) (save-excursion (end-of-line) (point))) + (delete-region (point) (line-end-position)) (insert (format "%s" type-break-keystroke-count)) ;; file saving is left to auto-save )))))) @@ -1243,5 +1243,4 @@ (if type-break-mode (type-break-mode 1)) -;; arch-tag: 943a2eb3-07e6-420b-993f-96e4796f5fd0 ;;; type-break.el ends here === modified file 'lisp/woman.el' --- lisp/woman.el 2010-11-05 08:16:55 +0000 +++ lisp/woman.el 2010-11-06 20:23:42 +0000 @@ -3543,8 +3543,8 @@ ; (WoMan-warn "Unimplemented numerical operator `%c' in %s" ; (following-char) ; (buffer-substring -; (save-excursion (beginning-of-line) (point)) -; (save-excursion (end-of-line) (point)))) +; (line-beginning-position) +; (line-end-position))) ; (skip-syntax-forward "^ ")) value )) @@ -3613,7 +3613,7 @@ (WoMan-warn "Numeric/register argument error: %s" (buffer-substring (point) - (save-excursion (end-of-line) (point)))) + (line-end-position))) (skip-syntax-forward "^ ") 0) (goto-char (match-end 0)) @@ -3763,8 +3763,7 @@ (buffer-substring start here)) (delete-region here (point))))) ;; Embolden heading (point is at end of heading): - (woman-set-face - (save-excursion (beginning-of-line) (point)) (point) 'woman-bold) + (woman-set-face (line-beginning-position) (point) 'woman-bold) (forward-line) (delete-blank-lines) (setq woman-left-margin woman-default-indent) @@ -3783,8 +3782,7 @@ (setq woman-leave-blank-lines nil) ;; Optionally embolden heading (point is at beginning of heading): (if woman-bold-headings - (woman-set-face - (point) (save-excursion (end-of-line) (point)) 'woman-bold)) + (woman-set-face (point) (line-end-position) 'woman-bold)) (forward-line) (setq woman-left-margin woman-default-indent woman-nofill nil) ; fill output lines @@ -4376,7 +4374,7 @@ eol n) (if type (setq tab (woman-get-tab-stop tab) - eol (save-excursion (end-of-line) (point)) + eol (line-end-position) n (save-excursion (search-forward "\t" eol t)) n (- (if n (1- n) eol) (point)) @@ -4507,7 +4505,7 @@ IGNORED is a string appended to the log message." (let ((tail (buffer-substring (point) - (save-excursion (end-of-line) (point))))) + (line-end-position)))) (if (and (> (length tail) 0) (/= (string-to-char tail) ?\ )) (setq tail (concat " " tail))) ------------------------------------------------------------ revno: 102276 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-11-06 12:55:44 -0700 message: Minor idlwave change. * lisp/progmodes/idlwave.el (idlwave-routine-entry-compare-twins): (idlwave-study-twins): Prefix dynamic local `class'. (idlwave-routine-twin-compare): Update for above name change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-06 19:47:42 +0000 +++ lisp/ChangeLog 2010-11-06 19:55:44 +0000 @@ -1,5 +1,9 @@ 2010-11-06 Glenn Morris + * progmodes/idlwave.el (idlwave-routine-entry-compare-twins): + (idlwave-study-twins): Prefix dynamic local `class'. + (idlwave-routine-twin-compare): Update for above name change. + * emacs-lisp/eieio-comp.el (byte-compile-file-form-defmethod): Use boundp tests to silence compiler. Update for changed name of bytecomp-filename variable. === modified file 'lisp/progmodes/idlwave.el' --- lisp/progmodes/idlwave.el 2010-11-03 07:57:43 +0000 +++ lisp/progmodes/idlwave.el 2010-11-06 19:55:44 +0000 @@ -8828,7 +8828,7 @@ (let* ((entry (car entries)) (name (car entry)) ; (type (nth 1 entry)) ; Must be bound for - (class (nth 2 entry)) ; idlwave-routine-twin-compare + (idlwave-twin-class (nth 2 entry)) ; idlwave-routine-twin-compare (cnt 0) source type type-cons file alist syslibp key) (while (setq entry (pop entries)) @@ -8870,7 +8870,6 @@ ;; FIXME: Dynamically scoped vars need to use the `idlwave-' prefix. ;; (defvar type) -;; (defvar class) (defmacro idlwave-xor (a b) `(and (or ,a ,b) (not (and ,a ,b)))) @@ -8903,7 +8902,9 @@ (defun idlwave-routine-entry-compare-twins (a b) "Compare two routine entries, under the assumption that they are twins. This basically calls `idlwave-routine-twin-compare' with the correct args." - (let* ((name (car a)) (type (nth 1 a)) (class (nth 2 a)) ; needed outside + (let* ((name (car a)) + (type (nth 1 a)) + (idlwave-twin-class (nth 2 a)) ; used in idlwave-routine-twin-compare (asrc (nth 3 a)) (atype (car asrc)) (bsrc (nth 3 b)) @@ -8916,18 +8917,16 @@ (list atype afile (list atype))) (if (stringp bfile) (list (file-truename bfile) bfile (list btype)) - (list btype bfile (list btype)))) - )) + (list btype bfile (list btype)))))) ;; Bound in idlwave-study-twins,idlwave-routine-entry-compare-twins. -;; FIXME: Dynamically scoped vars need to use the `idlwave-' prefix. -(defvar class) +(defvar idlwave-twin-class) (defun idlwave-routine-twin-compare (a b) "Compare two routine twin entries for sorting. In here, A and B are not normal routine info entries, but special lists (KEY FILENAME (TYPES...)). -This expects NAME TYPE CLASS to be bound to the right values." +This expects NAME TYPE IDLWAVE-TWIN-CLASS to be bound to the right values." (let* (;; Dis-assemble entries (akey (car a)) (bkey (car b)) (afile (nth 1 a)) (bfile (nth 1 b)) @@ -8959,16 +8958,19 @@ ;; Look at file names (aname (if (stringp afile) (downcase (file-name-nondirectory afile)) "")) (bname (if (stringp bfile) (downcase (file-name-nondirectory bfile)) "")) - (fname-re (if class (format "\\`%s__\\(%s\\|define\\)\\.pro\\'" - (regexp-quote (downcase class)) - (regexp-quote (downcase name))) + (fname-re (if idlwave-twin-class + (format "\\`%s__\\(%s\\|define\\)\\.pro\\'" + (regexp-quote (downcase idlwave-twin-class)) + (regexp-quote (downcase name))) (format "\\`%s\\.pro" (regexp-quote (downcase name))))) ;; Is file name derived from the routine name? ;; Method file or class definition file? (anamep (string-match fname-re aname)) - (adefp (and class anamep (string= "define" (match-string 1 aname)))) + (adefp (and idlwave-twin-class anamep + (string= "define" (match-string 1 aname)))) (bnamep (string-match fname-re bname)) - (bdefp (and class bnamep (string= "define" (match-string 1 bname))))) + (bdefp (and idlwave-twin-class bnamep + (string= "define" (match-string 1 bname))))) ;; Now: follow JD's ideas about sorting. Looks really simple now, ;; doesn't it? The difficult stuff is hidden above... @@ -8980,7 +8982,7 @@ ((idlwave-xor acompp bcompp) acompp) ; Compiled entries ((idlwave-xor apathp bpathp) apathp) ; Library before non-library ((idlwave-xor anamep bnamep) anamep) ; Correct file names first - ((and class anamep bnamep ; both file names match -> + ((and idlwave-twin-class anamep bnamep ; both file names match -> (idlwave-xor adefp bdefp)) bdefp) ; __define after __method ((> anpath bnpath) t) ; Who is first on path? (t nil)))) ; Default ------------------------------------------------------------ revno: 102275 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-11-06 12:47:42 -0700 message: Minor eieio-comp changes. * lisp/emacs-lisp/eieio-comp.el (byte-compile-file-form-defmethod): Use boundp tests to silence compiler. Update for changed name of bytecomp-filename variable. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-06 19:44:11 +0000 +++ lisp/ChangeLog 2010-11-06 19:47:42 +0000 @@ -1,5 +1,9 @@ 2010-11-06 Glenn Morris + * emacs-lisp/eieio-comp.el (byte-compile-file-form-defmethod): + Use boundp tests to silence compiler. Update for changed name of + bytecomp-filename variable. + * emulation/viper-cmd.el (viper-read-string-with-history): Prefix dynamic local `initial'. (viper-minibuffer-standard-hook): Update for above name change. === modified file 'lisp/emacs-lisp/eieio-comp.el' --- lisp/emacs-lisp/eieio-comp.el 2010-08-29 16:17:13 +0000 +++ lisp/emacs-lisp/eieio-comp.el 2010-11-06 19:47:42 +0000 @@ -47,10 +47,6 @@ ;; This teaches the byte compiler how to do this sort of thing. (put 'defmethod 'byte-hunk-handler 'byte-compile-file-form-defmethod) -;; Variables used free: -(defvar outbuffer) -(defvar filename) - (defun byte-compile-file-form-defmethod (form) "Mumble about the method we are compiling. This function is mostly ripped from `byte-compile-file-form-defun', @@ -83,14 +79,18 @@ (class (if (listp arg1) (nth 1 arg1) nil)) (my-outbuffer (if (eval-when-compile (featurep 'xemacs)) byte-compile-outbuffer - (condition-case nil - bytecomp-outbuffer - (error outbuffer)))) - ) + (cond ((boundp 'bytecomp-outbuffer) + bytecomp-outbuffer) ; Emacs >= 23.2 + ((boundp 'outbuffer) outbuffer) + (t (error "Unable to set outbuffer")))))) (let ((name (format "%s::%s" (or class "#") meth))) (if byte-compile-verbose ;; #### filename used free - (message "Compiling %s... (%s)" (or filename "") name)) + (message "Compiling %s... (%s)" + (cond ((boundp 'bytecomp-filename) bytecomp-filename) + ((boundp 'filename) filename) + (t "")) + name)) (setq byte-compile-current-form name) ; for warnings ) ;; Flush any pending output @@ -139,5 +139,4 @@ (provide 'eieio-comp) -;; arch-tag: f2aacdd3-1da2-4ee9-b3e5-e8eac0832ee3 ;;; eieio-comp.el ends here ------------------------------------------------------------ revno: 102274 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-11-06 12:44:11 -0700 message: Silence viper-cmd compilation. * lisp/emulation/viper-cmd.el (viper-read-string-with-history): Prefix dynamic local `initial'. (viper-minibuffer-standard-hook): Update for above name change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-06 19:40:33 +0000 +++ lisp/ChangeLog 2010-11-06 19:44:11 +0000 @@ -1,5 +1,9 @@ 2010-11-06 Glenn Morris + * emulation/viper-cmd.el (viper-read-string-with-history): + Prefix dynamic local `initial'. + (viper-minibuffer-standard-hook): Update for above name change. + * emacs-lisp/elint.el (elint-init-env): Prefix dynamic local `env'. (elint-init-form): Update for above name change. === modified file 'lisp/emulation/viper-cmd.el' --- lisp/emulation/viper-cmd.el 2010-08-29 16:17:13 +0000 +++ lisp/emulation/viper-cmd.el 2010-11-06 19:44:11 +0000 @@ -1,7 +1,7 @@ ;;; viper-cmd.el --- Vi command support for Viper -;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, +;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Michael Kifer ;; Package: viper @@ -42,7 +42,7 @@ (defvar quail-current-str) (defvar mark-even-if-inactive) (defvar init-message) -(defvar initial) +(defvar viper-initial) (defvar undo-beg-posn) (defvar undo-end-posn) @@ -2065,23 +2065,22 @@ (funcall hook) )) -;; Thie is a temp hook that uses free variables init-message and initial. +;; This is a temp hook that uses free variables init-message and viper-initial. ;; A dirty feature, but it is the simplest way to have it do the right thing. -;; The INIT-MESSAGE and INITIAL vars come from the scope set by +;; The INIT-MESSAGE and VIPER-INITIAL vars come from the scope set by ;; viper-read-string-with-history (defun viper-minibuffer-standard-hook () (if (stringp init-message) (viper-tmp-insert-at-eob init-message)) - (if (stringp initial) - (progn - ;; don't wait if we have unread events or in kbd macro - (or unread-command-events - executing-kbd-macro - (sit-for 840)) - (if (fboundp 'minibuffer-prompt-end) - (delete-region (minibuffer-prompt-end) (point-max)) - (erase-buffer)) - (insert initial)))) + (when (stringp viper-initial) + ;; don't wait if we have unread events or in kbd macro + (or unread-command-events + executing-kbd-macro + (sit-for 840)) + (if (fboundp 'minibuffer-prompt-end) + (delete-region (minibuffer-prompt-end) (point-max)) + (erase-buffer)) + (insert viper-initial))) (defsubst viper-minibuffer-real-start () (if (fboundp 'minibuffer-prompt-end) @@ -2180,10 +2179,10 @@ ;;; Reading string with history -(defun viper-read-string-with-history (prompt &optional initial +(defun viper-read-string-with-history (prompt &optional viper-initial history-var default keymap init-message) - ;; Read string, prompting with PROMPT and inserting the INITIAL + ;; Read string, prompting with PROMPT and inserting the VIPER-INITIAL ;; value. Uses HISTORY-VAR. DEFAULT is the default value to accept if the ;; input is an empty string. ;; Default value is displayed until the user types something in the @@ -2206,14 +2205,14 @@ temp-msg) (setq keymap (or keymap minibuffer-local-map) - initial (or initial "") + viper-initial (or viper-initial "") temp-msg (if default (format "(default %s) " default) "")) (setq viper-incomplete-ex-cmd nil) (setq val (read-from-minibuffer prompt - (concat temp-msg initial val padding) + (concat temp-msg viper-initial val padding) keymap nil history-var)) (setq minibuffer-setup-hook nil padding (viper-array-to-string (this-command-keys)) @@ -5093,5 +5092,4 @@ -;; arch-tag: 739a6450-5fda-44d0-88b0-325053d888c2 ;;; viper-cmd.el ends here ------------------------------------------------------------ revno: 102273 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-11-06 12:40:33 -0700 message: Silence elint compilation. * lisp/emacs-lisp/elint.el (elint-init-env): Prefix dynamic local `env'. (elint-init-form): Update for above name change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-06 19:28:44 +0000 +++ lisp/ChangeLog 2010-11-06 19:40:33 +0000 @@ -1,5 +1,8 @@ 2010-11-06 Glenn Morris + * emacs-lisp/elint.el (elint-init-env): Prefix dynamic local `env'. + (elint-init-form): Update for above name change. + * mail/mail-extr.el (mail-extract-address-components): Give dynamic local variables `cbeg' and `cend' a prefix. (mail-extr-voodoo): Update for above name change. === modified file 'lisp/emacs-lisp/elint.el' --- lisp/emacs-lisp/elint.el 2010-02-28 01:22:44 +0000 +++ lisp/emacs-lisp/elint.el 2010-11-06 19:40:33 +0000 @@ -394,40 +394,41 @@ (parse-partial-sexp (point) (point-max) nil t) (not (eobp))) -(defvar env) ; from elint-init-env +(defvar elint-env) ; from elint-init-env (defun elint-init-form (form) - "Process FORM, adding to ENV if recognized." + "Process FORM, adding to ELINT-ENV if recognized." (cond ;; Eg nnmaildir seems to use [] as a form of comment syntax. ((not (listp form)) (elint-warning "Skipping non-list form `%s'" form)) ;; Add defined variable ((memq (car form) '(defvar defconst defcustom)) - (setq env (elint-env-add-var env (cadr form)))) + (setq elint-env (elint-env-add-var elint-env (cadr form)))) ;; Add function ((memq (car form) '(defun defsubst)) - (setq env (elint-env-add-func env (cadr form) (nth 2 form)))) + (setq elint-env (elint-env-add-func elint-env (cadr form) (nth 2 form)))) ;; FIXME needs a handler to say second arg is not a variable when we come ;; to scan the form. ((eq (car form) 'define-derived-mode) - (setq env (elint-env-add-func env (cadr form) ()) - env (elint-env-add-var env (cadr form)) - env (elint-env-add-var env (intern (format "%s-map" (cadr form)))))) + (setq elint-env (elint-env-add-func elint-env (cadr form) ()) + elint-env (elint-env-add-var elint-env (cadr form)) + elint-env (elint-env-add-var elint-env + (intern (format "%s-map" (cadr form)))))) ((eq (car form) 'define-minor-mode) - (setq env (elint-env-add-func env (cadr form) '(&optional arg)) + (setq elint-env (elint-env-add-func elint-env (cadr form) '(&optional arg)) ;; FIXME mode map? - env (elint-env-add-var env (cadr form)))) + elint-env (elint-env-add-var elint-env (cadr form)))) ((and (eq (car form) 'easy-menu-define) (cadr form)) - (setq env (elint-env-add-func env (cadr form) '(event)) - env (elint-env-add-var env (cadr form)))) + (setq elint-env (elint-env-add-func elint-env (cadr form) '(event)) + elint-env (elint-env-add-var elint-env (cadr form)))) ;; FIXME it would be nice to check the autoloads are correct. ((eq (car form) 'autoload) - (setq env (elint-env-add-func env (cadr (cadr form)) 'unknown))) + (setq elint-env (elint-env-add-func elint-env (cadr (cadr form)) 'unknown))) ((eq (car form) 'declare-function) - (setq env (elint-env-add-func - env (cadr form) + (setq elint-env (elint-env-add-func + elint-env (cadr form) (if (or (< (length form) 4) (eq (nth 3 form) t) (unless (stringp (nth 2 form)) @@ -440,14 +441,14 @@ ;; If the alias points to something already in the environment, ;; add the alias to the environment with the same arguments. ;; FIXME symbol-function, eg backquote.el? - (let ((def (elint-env-find-func env (cadr (nth 2 form))))) - (setq env (elint-env-add-func env (cadr (cadr form)) + (let ((def (elint-env-find-func elint-env (cadr (nth 2 form))))) + (setq elint-env (elint-env-add-func elint-env (cadr (cadr form)) (if def (cadr def) 'unknown))))) ;; Add macro, both as a macro and as a function ((eq (car form) 'defmacro) - (setq env (elint-env-add-macro env (cadr form) + (setq elint-env (elint-env-add-macro elint-env (cadr form) (cons 'lambda (cddr form))) - env (elint-env-add-func env (cadr form) (nth 2 form)))) + elint-env (elint-env-add-func elint-env (cadr form) (nth 2 form)))) ((and (eq (car form) 'put) (= 4 (length form)) (eq (car-safe (cadr form)) 'quote) @@ -471,12 +472,12 @@ (setq name 'cl-macs file nil elint-doing-cl t)) ; blech - (setq env (elint-add-required-env env name file)))))) - env) + (setq elint-env (elint-add-required-env elint-env name file)))))) + elint-env) (defun elint-init-env (forms) "Initialize the environment from FORMS." - (let ((env (elint-make-env)) + (let ((elint-env (elint-make-env)) form) (while forms (setq form (elint-top-form-form (car forms)) @@ -489,7 +490,7 @@ with-no-warnings)) (mapc 'elint-init-form (cdr form)) (elint-init-form form))) - env)) + elint-env)) (defun elint-add-required-env (env name file) "Augment ENV with the variables defined by feature NAME in FILE." @@ -1171,5 +1172,4 @@ (provide 'elint) -;; arch-tag: b2f061e2-af84-4ddc-8e39-f5e969ac228f ;;; elint.el ends here ------------------------------------------------------------ revno: 102272 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-11-06 12:35:19 -0700 message: Silence gnus-art compilation. * lisp/gnus/gnus-art.el (gnus-treat-article): Give dynamic local variables `condition', `type', `length' a prefix. (gnus-treat-predicate): Update for above name changes. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-11-04 22:18:09 +0000 +++ lisp/gnus/ChangeLog 2010-11-06 19:35:19 +0000 @@ -1,13 +1,19 @@ +2010-11-06 Glenn Morris + + * gnus-art.el (gnus-treat-article): Give dynamic local variables + `condition', `type', `length' a prefix. + (gnus-treat-predicate): Update for above name changes. + 2010-11-04 Andrew Cohen - * nnir.el (gnus-summary-nnir-goto-thread): limiting work done by + * nnir.el (gnus-summary-nnir-goto-thread): Limit work done by gnus-summary-refer-thread. - * gnus-sum.el (gnus-build-all-threads): force updating of dependency + * gnus-sum.el (gnus-build-all-threads): Force updating of dependency headers. - (gnus-summary-limit-include-thread): prevent articles in thread from + (gnus-summary-limit-include-thread): Prevent articles in thread from being cut in gnus-cut-threads. - (gnus-summary-refer-thread): limit retrieved headers to those in + (gnus-summary-refer-thread): Limit retrieved headers to those in thread. 2010-11-04 Lars Magne Ingebrigtsen === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2010-10-31 22:31:24 +0000 +++ lisp/gnus/gnus-art.el 2010-11-06 19:35:19 +0000 @@ -8257,16 +8257,17 @@ (defvar gnus-inhibit-article-treatments nil) -(defun gnus-treat-article (condition &optional part-number total-parts type) - (let ((length (- (point-max) (point-min))) +(defun gnus-treat-article (gnus-treat-condition + &optional part-number total-parts gnus-treat-type) + (let ((gnus-treat-length (- (point-max) (point-min))) (alist gnus-treatment-function-alist) (article-goto-body-goes-to-point-min-p t) (treated-type - (or (not type) + (or (not gnus-treat-type) (catch 'found (let ((list gnus-article-treat-types)) (while list - (when (string-match (pop list) type) + (when (string-match (pop list) gnus-treat-type) (throw 'found t))))))) (highlightp (gnus-visual-p 'article-highlight 'highlight)) val elem) @@ -8280,7 +8281,7 @@ (when (and (or (consp val) treated-type) (or (not gnus-inhibit-article-treatments) - (eq condition 'head)) + (eq gnus-treat-condition 'head)) (gnus-treat-predicate val) (or (not (get (car elem) 'highlight)) highlightp)) @@ -8290,16 +8291,16 @@ ;; Dynamic variables. (defvar part-number) (defvar total-parts) -(defvar type) -(defvar condition) -(defvar length) +(defvar gnus-treat-type) +(defvar gnus-treat-condition) +(defvar gnus-treat-length) (defun gnus-treat-predicate (val) (cond ((null val) nil) - (condition - (eq condition val)) + (gnus-treat-condition + (eq gnus-treat-condition val)) ((and (listp val) (stringp (car val))) (apply 'gnus-or (mapcar `(lambda (s) @@ -8315,7 +8316,7 @@ ((eq pred 'not) (not (gnus-treat-predicate (car val)))) ((eq pred 'typep) - (equal (car val) type)) + (equal (car val) gnus-treat-type)) (t (error "%S is not a valid predicate" pred))))) ((eq val t) @@ -8327,7 +8328,7 @@ ((eq val 'last) (eq part-number total-parts)) ((numberp val) - (< length val)) + (< gnus-treat-length val)) (t (error "%S is not a valid value" val)))) ------------------------------------------------------------ revno: 102271 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-11-06 12:28:44 -0700 message: Silence mail-extr compilation. * lisp/mail/mail-extr.el (mail-extract-address-components): Give dynamic local variables `cbeg' and `cend' a prefix. (mail-extr-voodoo): Update for above name change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-06 19:11:38 +0000 +++ lisp/ChangeLog 2010-11-06 19:28:44 +0000 @@ -1,5 +1,9 @@ 2010-11-06 Glenn Morris + * mail/mail-extr.el (mail-extract-address-components): Give dynamic + local variables `cbeg' and `cend' a prefix. + (mail-extr-voodoo): Update for above name change. + * textmodes/reftex-toc.el (reftex-toc-do-promote) (reftex-toc-promote-prepare): Pass `delta' as an explicit argument. (reftex-toc-promote-action): Doc fix. === modified file 'lisp/mail/mail-extr.el' --- lisp/mail/mail-extr.el 2010-08-29 16:17:13 +0000 +++ lisp/mail/mail-extr.el 2010-11-06 19:28:44 +0000 @@ -1,7 +1,8 @@ ;;; mail-extr.el --- extract full name and address from RFC 822 mail header -*- coding: utf-8 -*- ;; Copyright (C) 1991, 1992, 1993, 1994, 1997, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; 2005, 2006, 2007, 2008, 2009, 2010 +;; Free Software Foundation, Inc. ;; Author: Joe Wells ;; Maintainer: FSF @@ -691,8 +692,8 @@ ;; (defvar disable-initial-guessing-flag) ; dynamic assignment -(defvar cbeg) ; dynamic assignment -(defvar cend) ; dynamic assignment +(defvar mailextr-cbeg) ; dynamic assignment +(defvar mailextr-cend) ; dynamic assignment (defvar mail-extr-all-top-level-domains) ; Defined below. ;;;###autoload @@ -762,7 +763,8 @@ record-pos-symbol first-real-pos last-real-pos phrase-beg phrase-end - cbeg cend ; dynamically set from -voodoo + ;; Dynamically set in mail-extr-voodoo. + mailextr-cbeg mailextr-cend quote-beg quote-end atom-beg atom-end mbox-beg mbox-end @@ -796,19 +798,19 @@ ((eq char ?\() (set-syntax-table mail-extr-address-comment-syntax-table) ;; only record the first non-empty comment's position - (if (and (not cbeg) + (if (and (not mailextr-cbeg) (save-excursion (forward-char 1) (mail-extr-skip-whitespace-forward) (not (eq ?\) (char-after (point)))))) - (setq cbeg (point))) + (setq mailextr-cbeg (point))) ;; TODO: don't record if unbalanced (or (mail-extr-safe-move-sexp 1) (forward-char 1)) (set-syntax-table mail-extr-address-syntax-table) - (if (and cbeg - (not cend)) - (setq cend (point)))) + (if (and mailextr-cbeg + (not mailextr-cend)) + (setq mailextr-cend (point)))) ;; quoted text ((eq char ?\") ;; only record the first non-empty quote's position @@ -994,10 +996,10 @@ (> last-real-pos (1+ group-\;-pos)) (setq last-real-pos (1+ group-\;-pos))) ;; *** This may be wrong: - (and cend - (> cend group-\;-pos) - (setq cend nil - cbeg nil)) + (and mailextr-cend + (> mailextr-cend group-\;-pos) + (setq mailextr-cend nil + mailextr-cbeg nil)) (and quote-end (> quote-end group-\;-pos) (setq quote-end nil @@ -1228,8 +1230,8 @@ (narrow-to-region phrase-beg phrase-end)) ;; Example: fml@foo.bar.dom (First M. Last) - (cbeg - (narrow-to-region (1+ cbeg) (1- cend)) + (mailextr-cbeg + (narrow-to-region (1+ mailextr-cbeg) (1- mailextr-cend)) (mail-extr-undo-backslash-quoting (point-min) (point-max)) ;; Deal with spacing problems @@ -1472,7 +1474,6 @@ (case-fold-search nil) mixed-case-flag lower-case-flag ;;upper-case-flag suffix-flag last-name-comma-flag - ;;cbeg cend initial begin-again-flag drop-this-word-if-trailing-flag @@ -1618,7 +1619,7 @@ ;; Delete parenthesized/quoted comment/nickname ((memq (following-char) '(?\( ?\{ ?\[ ?\" ?\' ?\`)) - (setq cbeg (point)) + (setq mailextr-cbeg (point)) (set-syntax-table mail-extr-address-text-comment-syntax-table) (cond ((memq (following-char) '(?\' ?\`)) (or (search-forward "'" nil t @@ -1628,23 +1629,23 @@ (or (mail-extr-safe-move-sexp 1) (goto-char (point-max))))) (set-syntax-table mail-extr-address-text-syntax-table) - (setq cend (point)) + (setq mailextr-cend (point)) (cond ;; Handle case of entire name being quoted ((and (eq word-count 0) (looking-at " *\\'") - (>= (- cend cbeg) 2)) - (narrow-to-region (1+ cbeg) (1- cend)) + (>= (- mailextr-cend mailextr-cbeg) 2)) + (narrow-to-region (1+ mailextr-cbeg) (1- mailextr-cend)) (goto-char (point-min))) (t ;; Handle case of quoted initial - (if (and (or (= 3 (- cend cbeg)) - (and (= 4 (- cend cbeg)) - (eq ?. (char-after (+ 2 cbeg))))) + (if (and (or (= 3 (- mailextr-cend mailextr-cbeg)) + (and (= 4 (- mailextr-cend mailextr-cbeg)) + (eq ?. (char-after (+ 2 mailextr-cbeg))))) (not (looking-at " *\\'"))) - (setq initial (char-after (1+ cbeg))) + (setq initial (char-after (1+ mailextr-cbeg))) (setq initial nil)) - (delete-region cbeg cend) + (delete-region mailextr-cbeg mailextr-cend) (if initial (insert initial ". "))))) @@ -2174,5 +2175,4 @@ (provide 'mail-extr) -;; arch-tag: 7785fade-1073-4ed6-b4f6-28db34a7982d ;;; mail-extr.el ends here ------------------------------------------------------------ revno: 102270 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-11-06 12:11:38 -0700 message: Silence reftex compilation. * lisp/textmodes/reftex-toc.el (reftex-toc-do-promote) (reftex-toc-promote-prepare): Pass `delta' as an explicit argument. (reftex-toc-promote-action): Doc fix. * lisp/textmodes/reftex-sel.el (reftex-select-item): Give local variables `prompt', `data' a prefix. (reftex-select-post-command-hook, reftex-select-callback) (reftex-select-mouse-accept, reftex-select-read-cite): Update for above name changes. * lisp/textmodes/reftex-ref.el (reftex-reference): Rename local variable `refstyle' to reftex-refstyle. (reftex-offer-label-menu): Update for above name change. * lisp/textmodes/reftex-sel.el (reftex-select-toggle-varioref): Update for `refstyle' name change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-06 18:51:11 +0000 +++ lisp/ChangeLog 2010-11-06 19:11:38 +0000 @@ -1,5 +1,21 @@ 2010-11-06 Glenn Morris + * textmodes/reftex-toc.el (reftex-toc-do-promote) + (reftex-toc-promote-prepare): Pass `delta' as an explicit argument. + (reftex-toc-promote-action): Doc fix. + + * textmodes/reftex-sel.el (reftex-select-item): Give local variables + `prompt', `data' a prefix. + (reftex-select-post-command-hook, reftex-select-callback) + (reftex-select-mouse-accept, reftex-select-read-cite): + Update for above name changes. + + * textmodes/reftex-ref.el (reftex-reference): Rename local variable + `refstyle' to reftex-refstyle. + (reftex-offer-label-menu): Update for above name change. + * textmodes/reftex-sel.el (reftex-select-toggle-varioref): Update for + `refstyle' name change. + * vc/emerge.el (emerge-eval-in-buffer): Remove, and replace all uses with with-current-buffer. (diff, template): Give dynamic local variables a prefix. === modified file 'lisp/textmodes/reftex-ref.el' --- lisp/textmodes/reftex-ref.el 2010-08-29 16:17:13 +0000 +++ lisp/textmodes/reftex-ref.el 2010-11-06 19:11:38 +0000 @@ -180,8 +180,8 @@ (string-match "^[ \t]*$" default)) (setq default prefix force-prompt t) ; need to prompt - (setq default - (concat prefix + (setq default + (concat prefix (funcall reftex-string-to-label-function default))) ;; Make it unique. @@ -227,7 +227,7 @@ ((setq entry (assoc label (symbol-value reftex-docstruct-symbol))) (ding) - (if (y-or-n-p + (if (y-or-n-p (format "Label '%s' exists. Use anyway? " label)) (setq valid t))) @@ -294,7 +294,7 @@ ;; Translate the upper 128 chars in the Latin-1 charset to ASCII equivalents (let ((tab "@@@@@@@@@@@@@@@@@@'@@@@@@@@@@@@@ icLxY|S\"ca<--R-o|23'uq..1o>423?AAAAAAACEEEEIIIIDNOOOOOXOUUUUYP3aaaaaaaceeeeiiiidnooooo:ouuuuypy") (emacsp (not (featurep 'xemacs)))) - (mapconcat + (mapconcat (lambda (c) (cond ((and (> c 127) (< c 256)) ; 8 bit Latin-1 (char-to-string (aref tab (- c 128)))) @@ -430,7 +430,7 @@ type (car type)) (setq type (reftex-query-label-type)))) - (let* ((refstyle + (let* ((reftex-refstyle (cond ((reftex-typekey-check type reftex-vref-is-default) "\\vref") ((reftex-typekey-check type reftex-fref-is-default) "\\fref") (t "\\ref"))) @@ -452,7 +452,7 @@ (setq type (nth 1 (car labels)) form (or (cdr (assoc type reftex-typekey-to-format-alist)) form)) - + (cond (no-insert ;; Just return the first label @@ -466,7 +466,7 @@ sep (nth 2 (car labels)) sep1 (cdr (assoc sep reftex-multiref-punctuation)) labels (cdr labels)) - (when cut + (when cut (backward-delete-char cut) (setq cut nil)) @@ -477,9 +477,9 @@ ;; do we have a special format? (setq reftex-format-ref-function (cond - ((string= refstyle "\\vref") 'reftex-format-vref) - ((string= refstyle "\\fref") 'reftex-format-fref) - ((string= refstyle "\\Fref") 'reftex-format-Fref) + ((string= reftex-refstyle "\\vref") 'reftex-format-vref) + ((string= reftex-refstyle "\\fref") 'reftex-format-fref) + ((string= reftex-refstyle "\\Fref") 'reftex-format-Fref) (t reftex-format-ref-function))) ;; ok, insert the reference (if sep1 (insert sep1)) @@ -501,7 +501,7 @@ matched cell) (save-excursion (while (and (setq cell (pop words)) - (not (setq matched + (not (setq matched (re-search-backward (car cell) bound t)))))) (if matched (cons (cdr cell) (- (match-end 0) (match-end 1))) @@ -549,7 +549,7 @@ (setq mode-line-format (list "---- " 'mode-line-buffer-identification " " 'global-mode-string " (" mode-name ")" - " S<" 'refstyle ">" + " S<" 'reftex-refstyle ">" " -%-")) (cond ((= 0 (buffer-size)) @@ -564,9 +564,9 @@ context counter commented - (or here-I-am offset) + (or here-I-am offset) prefix - nil ; no a toc buffer + nil ; no a toc buffer )))) (here-I-am (setq offset (reftex-get-offset buf here-I-am typekey))) @@ -690,13 +690,13 @@ (defun reftex-query-label-type () ;; Ask for label type - (let ((key (reftex-select-with-char + (let ((key (reftex-select-with-char reftex-type-query-prompt reftex-type-query-help 3))) (unless (member (char-to-string key) reftex-typekey-list) (error "No such label type: %s" (char-to-string key))) (char-to-string key))) -(defun reftex-show-label-location (data forward no-revisit +(defun reftex-show-label-location (data forward no-revisit &optional stay error) ;; View the definition site of a label in another window. ;; DATA is an entry from the docstruct list. @@ -718,7 +718,7 @@ (throw 'exit nil)) ;; Goto the file in another window - (setq buffer + (setq buffer (if no-revisit (reftex-get-buffer-visiting file) (reftex-get-file-buffer-force @@ -784,7 +784,7 @@ (when (or (not (eq major-mode 'latex-mode)) (not font-lock-mode)) (latex-mode) - (run-hook-with-args + (run-hook-with-args 'reftex-pre-refontification-functions reftex-call-back-to-this-buffer 'reftex-hidden) (turn-on-font-lock)) @@ -839,10 +839,8 @@ (unless other-window (set-window-configuration wcfg) (switch-to-buffer (marker-buffer where)) - (goto-char where)) + (goto-char where)) (reftex-unhighlight 0))) - -;; arch-tag: 52f14032-fb76-4d31-954f-750c72415675 ;;; reftex-ref.el ends here === modified file 'lisp/textmodes/reftex-sel.el' --- lisp/textmodes/reftex-sel.el 2010-08-29 16:17:13 +0000 +++ lisp/textmodes/reftex-sel.el 2010-11-06 19:11:38 +0000 @@ -369,22 +369,21 @@ (defvar reftex-last-line nil) (defvar reftex-select-marked nil) -(defun reftex-select-item (prompt help-string keymap +(defun reftex-select-item (reftex-select-prompt help-string keymap &optional offset call-back cb-flag) -;; Select an item, using PROMPT. The function returns a key indicating -;; an exit status, along with a data structure indicating which item was -;; selected. -;; HELP-STRING contains help. KEYMAP is a keymap with the available -;; selection commands. -;; OFFSET can be a label list item which will be selected at start. -;; When it is t, point will start out at the beginning of the buffer. -;; Any other value will cause restart where last selection left off. -;; When CALL-BACK is given, it is a function which is called with the index -;; of the element. -;; CB-FLAG is the initial value of that flag. - - (let* (ev data last-data (selection-buffer (current-buffer))) + ;; Select an item, using REFTEX-SELECT-PROMPT. + ;; The function returns a key indicating an exit status, along with a + ;; data structure indicating which item was selected. + ;; HELP-STRING contains help. KEYMAP is a keymap with the available + ;; selection commands. + ;; OFFSET can be a label list item which will be selected at start. + ;; When it is t, point will start out at the beginning of the buffer. + ;; Any other value will cause restart where last selection left off. + ;; When CALL-BACK is given, it is a function which is called with the index + ;; of the element. + ;; CB-FLAG is the initial value of that flag. + (let (ev reftex-select-data last-data (selection-buffer (current-buffer))) (setq reftex-select-marked nil) @@ -404,7 +403,7 @@ (use-local-map keymap) (add-hook 'pre-command-hook 'reftex-select-pre-command-hook nil t) (add-hook 'post-command-hook 'reftex-select-post-command-hook nil t) - (princ prompt) + (princ reftex-select-prompt) (set-marker reftex-recursive-edit-marker (point)) ;; XEmacs does not run post-command-hook here (and (featurep 'xemacs) (run-hooks 'post-command-hook)) @@ -426,19 +425,18 @@ (reftex-kill-buffer "*RefTeX Help*") (setq reftex-callback-fwd (not reftex-callback-fwd)) ;; ;-))) (message "") - (list ev data last-data))) + (list ev reftex-select-data last-data))) ;; The following variables are all bound dynamically in `reftex-select-item'. ;; The defvars are here only to silence the byte compiler. (defvar found-list) (defvar cb-flag) -(defvar data) -(defvar prompt) +(defvar reftex-select-data) +(defvar reftex-select-prompt) (defvar last-data) (defvar call-back) (defvar help-string) -(defvar refstyle) ;; The selection commands @@ -448,15 +446,15 @@ (defun reftex-select-post-command-hook () (let (b e) - (setq data (get-text-property (point) :data)) - (setq last-data (or data last-data)) + (setq reftex-select-data (get-text-property (point) :data)) + (setq last-data (or reftex-select-data last-data)) - (when (and data cb-flag + (when (and reftex-select-data cb-flag (not (equal reftex-last-follow-point (point)))) (setq reftex-last-follow-point (point)) - (funcall call-back data reftex-callback-fwd + (funcall call-back reftex-select-data reftex-callback-fwd (not reftex-revisit-to-follow))) - (if data + (if reftex-select-data (setq b (or (previous-single-property-change (1+ (point)) :data) (point-min)) @@ -470,7 +468,7 @@ (not (pos-visible-in-window-p e))) (recenter '(4))) (unless (current-message) - (princ prompt)))) + (princ reftex-select-prompt)))) (defun reftex-select-next (&optional arg) "Move to next selectable item." @@ -531,19 +529,22 @@ (interactive) (setq reftex-last-follow-point -1) (setq cb-flag (not cb-flag))) + +(defvar reftex-refstyle) ; from reftex-reference + (defun reftex-select-toggle-varioref () "Toggle the macro used for referencing the label between \\ref and \\vref." (interactive) - (if (string= refstyle "\\ref") - (setq refstyle "\\vref") - (setq refstyle "\\ref")) + (if (string= reftex-refstyle "\\ref") + (setq reftex-refstyle "\\vref") + (setq reftex-refstyle "\\ref")) (force-mode-line-update)) (defun reftex-select-toggle-fancyref () "Toggle the macro used for referencing the label between \\ref and \\vref." (interactive) - (setq refstyle - (cond ((string= refstyle "\\ref") "\\fref") - ((string= refstyle "\\fref") "\\Fref") + (setq reftex-refstyle + (cond ((string= reftex-refstyle "\\ref") "\\fref") + ((string= reftex-refstyle "\\fref") "\\Fref") (t "\\ref"))) (force-mode-line-update)) (defun reftex-select-show-insertion-point () @@ -560,7 +561,7 @@ (defun reftex-select-callback () "Show full context in another window." (interactive) - (if data (funcall call-back data reftex-callback-fwd nil) (ding))) + (if reftex-select-data (funcall call-back reftex-select-data reftex-callback-fwd nil) (ding))) (defun reftex-select-accept () "Accept the currently selected item." (interactive) @@ -569,8 +570,8 @@ "Accept the item at the mouse click." (interactive "e") (mouse-set-point ev) - (setq data (get-text-property (point) :data)) - (setq last-data (or data last-data)) + (setq reftex-select-data (get-text-property (point) :data)) + (setq last-data (or reftex-select-data last-data)) (throw 'myexit 'return)) (defun reftex-select-read-label () "Use minibuffer to read a label to reference, with completion." @@ -588,8 +589,8 @@ (cond ((or (null key) (equal key ""))) (entry - (setq data entry) - (setq last-data data) + (setq reftex-select-data entry) + (setq last-data reftex-select-data) (throw 'myexit 'return)) (t (throw 'myexit key))))) @@ -736,5 +737,4 @@ do (define-key reftex-select-bib-map (car x) (cdr x))) -;; arch-tag: 842078ff-0586-4e0b-957e-536e08218464 ;;; reftex-sel.el ends here === modified file 'lisp/textmodes/reftex-toc.el' --- lisp/textmodes/reftex-toc.el 2010-11-03 08:03:42 +0000 +++ lisp/textmodes/reftex-toc.el 2010-11-06 19:11:38 +0000 @@ -545,7 +545,6 @@ ;; Promotion/Demotion stuff -(defvar delta) (defvar pro-or-de) (defvar start-pos) (defvar start-line) @@ -601,7 +600,9 @@ (reftex-toc-extract-section-number (nth (1- nsec) entries))))) ;; Run through the list and prepare the changes. - (setq entries (mapcar 'reftex-toc-promote-prepare entries)) + (setq entries (mapcar + (lambda (e) (reftex-toc-promote-prepare e delta)) + entries)) ;; Ask for permission (if (or (not reftex-toc-confirm-promotion) ; never confirm (and (integerp reftex-toc-confirm-promotion) ; confirm if many @@ -643,12 +644,11 @@ (setq mark-active t deactivate-mark nil))))) -(defun reftex-toc-promote-prepare (x) +(defun reftex-toc-promote-prepare (x delta) "Look at a toc entry and see if we could pro/demote it. -Expects the level change DELTA to be dynamically scoped into this function. This function prepares everything for the changes, but does not do it. The return value is a list with information needed when doing the -promotion/demotion later." +promotion/demotion later. DELTA is the level change." (let* ((data (car x)) (toc-point (cdr x)) (marker (nth 4 data)) @@ -684,7 +684,6 @@ (progn (goto-char toc-point) (error "Cannot %smote special sections" pro-or-de)))) - ;; Delta is dynamically scoped into here... (newlevel (if (>= level 0) (+ delta level) (- level delta))) (dummy2 (if (or (and (>= level 0) (= newlevel -1)) (and (< level 0) (= newlevel 0))) @@ -698,7 +697,7 @@ (defun reftex-toc-promote-action (x) "Change the level of a toc entry. -DELTA and PRO-OR-DE are assumed to be dynamically scoped into this function." +PRO-OR-DE is assumed to be dynamically scoped into this function." (let* ((data (car x)) (name (nth 1 x)) (newname (nth 2 x)) ------------------------------------------------------------ revno: 102269 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-11-06 11:51:11 -0700 message: Minor emerge changes. * lisp/vc/emerge.el (emerge-eval-in-buffer): Remove, and replace all uses with with-current-buffer. (diff, template): Give dynamic local variables a prefix. (emerge-line-numbers): Rename local `diff' to emerge-line-diff. (emerge-line-number-in-buf): Update for above name change. (emerge-combine-versions-internal): Rename local `template' to emerge-combine-template. (emerge-combine-versions-edit): Update for above name change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-06 15:56:29 +0000 +++ lisp/ChangeLog 2010-11-06 18:51:11 +0000 @@ -1,3 +1,14 @@ +2010-11-06 Glenn Morris + + * vc/emerge.el (emerge-eval-in-buffer): Remove, and replace all uses + with with-current-buffer. + (diff, template): Give dynamic local variables a prefix. + (emerge-line-numbers): Rename local `diff' to emerge-line-diff. + (emerge-line-number-in-buf): Update for above name change. + (emerge-combine-versions-internal): Rename local `template' to + emerge-combine-template. + (emerge-combine-versions-edit): Update for above name change. + 2010-11-06 Ralf Angeli * textmodes/reftex-cite.el === modified file 'lisp/vc/emerge.el' --- lisp/vc/emerge.el 2010-06-11 19:09:57 +0000 +++ lisp/vc/emerge.el 2010-11-06 18:51:11 +0000 @@ -29,25 +29,13 @@ (defvar A-end) (defvar B-begin) (defvar B-end) -(defvar diff) (defvar diff-vector) (defvar merge-begin) (defvar merge-end) -(defvar template) (defvar valid-diff) ;;; Macros -(defmacro emerge-eval-in-buffer (buffer &rest forms) - "Macro to switch to BUFFER, evaluate FORMS, returns to original buffer. -Differs from `save-excursion' in that it doesn't save the point and mark." - `(let ((StartBuffer (current-buffer))) - (unwind-protect - (progn - (set-buffer ,buffer) - ,@forms) - (set-buffer StartBuffer)))) - (defmacro emerge-defvar-local (var value doc) "Defines SYMBOL as an advertised variable. Performs a defvar, then executes `make-variable-buffer-local' on @@ -565,7 +553,7 @@ (if output-file (setq emerge-last-dir-output (file-name-directory output-file))) ;; Make sure the entire files are seen, and they reflect what is on disk - (emerge-eval-in-buffer + (with-current-buffer buffer-A (widen) (let ((temp (file-local-copy file-A))) @@ -576,7 +564,7 @@ startup-hooks)) ;; Verify that the file matches the buffer (emerge-verify-file-buffer)))) - (emerge-eval-in-buffer + (with-current-buffer buffer-B (widen) (let ((temp (file-local-copy file-B))) @@ -599,10 +587,10 @@ (let* ((merge-buffer-name (emerge-unique-buffer-name "*merge" "*")) ;; create the merge buffer from buffer A, so it inherits buffer A's ;; default directory, etc. - (merge-buffer (emerge-eval-in-buffer + (merge-buffer (with-current-buffer buffer-A (get-buffer-create merge-buffer-name)))) - (emerge-eval-in-buffer + (with-current-buffer merge-buffer (emerge-copy-modes buffer-A) (setq buffer-read-only nil) @@ -625,14 +613,14 @@ (emerge-remember-buffer-characteristics) (emerge-handle-local-variables)) (emerge-setup-windows buffer-A buffer-B merge-buffer t) - (emerge-eval-in-buffer merge-buffer + (with-current-buffer merge-buffer (run-hooks 'startup-hooks 'emerge-startup-hook) (setq buffer-read-only t)))) ;; Generate the Emerge difference list between two files (defun emerge-make-diff-list (file-A file-B) (setq emerge-diff-buffer (get-buffer-create "*emerge-diff*")) - (emerge-eval-in-buffer + (with-current-buffer emerge-diff-buffer (erase-buffer) (shell-command @@ -648,7 +636,7 @@ (defun emerge-extract-diffs (diff-buffer) (let (list) - (emerge-eval-in-buffer + (with-current-buffer diff-buffer (goto-char (point-min)) (while (re-search-forward emerge-match-diff-line nil t) @@ -692,7 +680,7 @@ ;; Set up buffer of diff/diff3 error messages. (defun emerge-prepare-error-list (ok-regexp) (setq emerge-diff-error-buffer (get-buffer-create "*emerge-diff-errors*")) - (emerge-eval-in-buffer + (with-current-buffer emerge-diff-error-buffer (erase-buffer) (save-excursion (insert-buffer-substring emerge-diff-buffer)) @@ -719,7 +707,7 @@ (if output-file (setq emerge-last-dir-output (file-name-directory output-file))) ;; Make sure the entire files are seen, and they reflect what is on disk - (emerge-eval-in-buffer + (with-current-buffer buffer-A (widen) (let ((temp (file-local-copy file-A))) @@ -730,7 +718,7 @@ startup-hooks)) ;; Verify that the file matches the buffer (emerge-verify-file-buffer)))) - (emerge-eval-in-buffer + (with-current-buffer buffer-B (widen) (let ((temp (file-local-copy file-B))) @@ -741,7 +729,7 @@ startup-hooks)) ;; Verify that the file matches the buffer (emerge-verify-file-buffer)))) - (emerge-eval-in-buffer + (with-current-buffer buffer-ancestor (widen) (let ((temp (file-local-copy file-ancestor))) @@ -768,10 +756,10 @@ (let* ((merge-buffer-name (emerge-unique-buffer-name "*merge" "*")) ;; create the merge buffer from buffer A, so it inherits buffer A's ;; default directory, etc. - (merge-buffer (emerge-eval-in-buffer + (merge-buffer (with-current-buffer buffer-A (get-buffer-create merge-buffer-name)))) - (emerge-eval-in-buffer + (with-current-buffer merge-buffer (emerge-copy-modes buffer-A) (setq buffer-read-only nil) @@ -796,14 +784,14 @@ (emerge-select-prefer-Bs) (emerge-handle-local-variables)) (emerge-setup-windows buffer-A buffer-B merge-buffer t) - (emerge-eval-in-buffer merge-buffer + (with-current-buffer merge-buffer (run-hooks 'startup-hooks 'emerge-startup-hook) (setq buffer-read-only t)))) ;; Generate the Emerge difference list between two files with an ancestor (defun emerge-make-diff3-list (file-A file-B file-ancestor) (setq emerge-diff-buffer (get-buffer-create "*emerge-diff*")) - (emerge-eval-in-buffer + (with-current-buffer emerge-diff-buffer (erase-buffer) (shell-command @@ -820,7 +808,7 @@ (defun emerge-extract-diffs3 (diff-buffer) (let (list) - (emerge-eval-in-buffer + (with-current-buffer diff-buffer (while (re-search-forward "^====\\(.?\\)$" nil t) ;; leave point after matched line @@ -928,10 +916,10 @@ (interactive "bBuffer A to merge: \nbBuffer B to merge: ") (let ((emerge-file-A (emerge-make-temp-file "A")) (emerge-file-B (emerge-make-temp-file "B"))) - (emerge-eval-in-buffer + (with-current-buffer buffer-A (write-region (point-min) (point-max) emerge-file-A nil 'no-message)) - (emerge-eval-in-buffer + (with-current-buffer buffer-B (write-region (point-min) (point-max) emerge-file-B nil 'no-message)) (emerge-setup (get-buffer buffer-A) emerge-file-A @@ -953,13 +941,13 @@ (let ((emerge-file-A (emerge-make-temp-file "A")) (emerge-file-B (emerge-make-temp-file "B")) (emerge-file-ancestor (emerge-make-temp-file "anc"))) - (emerge-eval-in-buffer + (with-current-buffer buffer-A (write-region (point-min) (point-max) emerge-file-A nil 'no-message)) - (emerge-eval-in-buffer + (with-current-buffer buffer-B (write-region (point-min) (point-max) emerge-file-B nil 'no-message)) - (emerge-eval-in-buffer + (with-current-buffer buffer-ancestor (write-region (point-min) (point-max) emerge-file-ancestor nil 'no-message)) @@ -1093,7 +1081,7 @@ (emerge-file-A (emerge-make-temp-file "A")) (emerge-file-B (emerge-make-temp-file "B"))) ;; Get the revisions into buffers - (emerge-eval-in-buffer + (with-current-buffer buffer-A (erase-buffer) (shell-command @@ -1101,7 +1089,7 @@ t) (write-region (point-min) (point-max) emerge-file-A nil 'no-message) (set-buffer-modified-p nil)) - (emerge-eval-in-buffer + (with-current-buffer buffer-B (erase-buffer) (shell-command @@ -1131,7 +1119,7 @@ (emerge-file-B (emerge-make-temp-file "B")) (emerge-ancestor (emerge-make-temp-file "ancestor"))) ;; Get the revisions into buffers - (emerge-eval-in-buffer + (with-current-buffer buffer-A (erase-buffer) (shell-command @@ -1140,7 +1128,7 @@ t) (write-region (point-min) (point-max) emerge-file-A nil 'no-message) (set-buffer-modified-p nil)) - (emerge-eval-in-buffer + (with-current-buffer buffer-B (erase-buffer) (shell-command @@ -1148,7 +1136,7 @@ t) (write-region (point-min) (point-max) emerge-file-B nil 'no-message) (set-buffer-modified-p nil)) - (emerge-eval-in-buffer + (with-current-buffer buffer-ancestor (erase-buffer) (shell-command @@ -1379,7 +1367,7 @@ (if pos (goto-char (point-min))) ;; If diff/diff3 reports errors, display them rather than the merge buffer. - (if (/= 0 (emerge-eval-in-buffer emerge-diff-error-buffer (buffer-size))) + (if (/= 0 (with-current-buffer emerge-diff-error-buffer (buffer-size))) (progn (ding) (message "Errors found in diff/diff3 output. Merge buffer is %s." @@ -1434,14 +1422,14 @@ (do-auto-save) ;; remember and alter buffer characteristics (setq emerge-A-buffer-values - (emerge-eval-in-buffer + (with-current-buffer emerge-A-buffer (prog1 (emerge-save-variables emerge-saved-variables) (emerge-restore-variables emerge-saved-variables emerge-merging-values)))) (setq emerge-B-buffer-values - (emerge-eval-in-buffer + (with-current-buffer emerge-B-buffer (prog1 (emerge-save-variables emerge-saved-variables) @@ -1452,10 +1440,10 @@ "Restore characteristics saved by `emerge-remember-buffer-characteristics'." (let ((A-values emerge-A-buffer-values) (B-values emerge-B-buffer-values)) - (emerge-eval-in-buffer emerge-A-buffer + (with-current-buffer emerge-A-buffer (emerge-restore-variables emerge-saved-variables A-values)) - (emerge-eval-in-buffer emerge-B-buffer + (with-current-buffer emerge-B-buffer (emerge-restore-variables emerge-saved-variables B-values)))) @@ -1470,15 +1458,15 @@ merge-buffer lineno-list) (let* (marker-list - (A-point-min (emerge-eval-in-buffer A-buffer (point-min))) + (A-point-min (with-current-buffer A-buffer (point-min))) (offset (1- A-point-min)) - (B-point-min (emerge-eval-in-buffer B-buffer (point-min))) + (B-point-min (with-current-buffer B-buffer (point-min))) ;; Record current line number in each buffer ;; so we don't have to count from the beginning. (a-line 1) (b-line 1)) - (emerge-eval-in-buffer A-buffer (goto-char (point-min))) - (emerge-eval-in-buffer B-buffer (goto-char (point-min))) + (with-current-buffer A-buffer (goto-char (point-min))) + (with-current-buffer B-buffer (goto-char (point-min))) (while lineno-list (let* ((list-element (car lineno-list)) a-begin-marker @@ -1493,13 +1481,13 @@ (b-end (aref list-element 3)) (state (aref list-element 4))) ;; place markers at the appropriate places in the buffers - (emerge-eval-in-buffer + (with-current-buffer A-buffer (setq a-line (emerge-goto-line a-begin a-line)) (setq a-begin-marker (point-marker)) (setq a-line (emerge-goto-line a-end a-line)) (setq a-end-marker (point-marker))) - (emerge-eval-in-buffer + (with-current-buffer B-buffer (setq b-line (emerge-goto-line b-begin b-line)) (setq b-begin-marker (point-marker)) @@ -1759,7 +1747,7 @@ to the left margin, if they are in windows." (interactive) (emerge-operate-on-windows - (function (lambda (x) (set-window-hscroll (selected-window) 0))) + (lambda (x) (set-window-hscroll (selected-window) 0)) nil)) ;; Attempt to show the region nicely. @@ -1869,13 +1857,13 @@ (emerge-restore-buffer-characteristics) ;; null out the difference markers so they don't slow down future editing ;; operations - (mapc (function (lambda (d) - (set-marker (aref d 0) nil) - (set-marker (aref d 1) nil) - (set-marker (aref d 2) nil) - (set-marker (aref d 3) nil) - (set-marker (aref d 4) nil) - (set-marker (aref d 5) nil))) + (mapc (lambda (d) + (set-marker (aref d 0) nil) + (set-marker (aref d 1) nil) + (set-marker (aref d 2) nil) + (set-marker (aref d 3) nil) + (set-marker (aref d 4) nil) + (set-marker (aref d 5) nil)) emerge-difference-list) ;; allow them to be garbage collected (setq emerge-difference-list nil) @@ -1900,19 +1888,18 @@ even if the difference has been edited." (interactive "P") (let ((operate - (function (lambda () - (emerge-select-A-edit merge-begin merge-end A-begin A-end) - (if emerge-auto-advance - (emerge-next-difference))))) + (lambda () + (emerge-select-A-edit merge-begin merge-end A-begin A-end) + (if emerge-auto-advance + (emerge-next-difference)))) (operate-no-change - (function (lambda () - (if emerge-auto-advance - (emerge-next-difference)))))) + (lambda () (if emerge-auto-advance + (emerge-next-difference))))) (emerge-select-version force operate-no-change operate operate))) ;; Actually select the A variant (defun emerge-select-A-edit (merge-begin merge-end A-begin A-end) - (emerge-eval-in-buffer + (with-current-buffer emerge-merge-buffer (delete-region merge-begin merge-end) (goto-char merge-begin) @@ -1929,19 +1916,18 @@ even if the difference has been edited." (interactive "P") (let ((operate - (function (lambda () - (emerge-select-B-edit merge-begin merge-end B-begin B-end) - (if emerge-auto-advance - (emerge-next-difference))))) + (lambda () + (emerge-select-B-edit merge-begin merge-end B-begin B-end) + (if emerge-auto-advance + (emerge-next-difference)))) (operate-no-change - (function (lambda () - (if emerge-auto-advance - (emerge-next-difference)))))) + (lambda () (if emerge-auto-advance + (emerge-next-difference))))) (emerge-select-version force operate operate-no-change operate))) ;; Actually select the B variant (defun emerge-select-B-edit (merge-begin merge-end B-begin B-end) - (emerge-eval-in-buffer + (with-current-buffer emerge-merge-buffer (delete-region merge-begin merge-end) (goto-char merge-begin) @@ -2134,12 +2120,12 @@ (interactive) (delete-other-windows) (let ((temp-buffer-show-function - (function (lambda (buf) - (split-window-vertically) - (switch-to-buffer buf) - (other-window 1))))) + (lambda (buf) + (split-window-vertically) + (switch-to-buffer buf) + (other-window 1)))) (with-output-to-temp-buffer "*Help*" - (emerge-eval-in-buffer emerge-A-buffer + (with-current-buffer emerge-A-buffer (if buffer-file-name (progn (princ "File A is: ") @@ -2148,7 +2134,7 @@ (princ "Buffer A is: ") (princ (buffer-name)))) (princ "\n")) - (emerge-eval-in-buffer emerge-B-buffer + (with-current-buffer emerge-B-buffer (if buffer-file-name (progn (princ "File B is: ") @@ -2158,7 +2144,7 @@ (princ (buffer-name)))) (princ "\n")) (if emerge-ancestor-buffer - (emerge-eval-in-buffer emerge-ancestor-buffer + (with-current-buffer emerge-ancestor-buffer (if buffer-file-name (progn (princ "Ancestor file is: ") @@ -2229,9 +2215,9 @@ ;; check that this is a valid difference (emerge-validate-difference) ;; get the point values and old difference - (let ((A-point (emerge-eval-in-buffer emerge-A-buffer + (let ((A-point (with-current-buffer emerge-A-buffer (point-marker))) - (B-point (emerge-eval-in-buffer emerge-B-buffer + (B-point (with-current-buffer emerge-B-buffer (point-marker))) (merge-point (point-marker)) (old-diff (aref emerge-difference-list n))) @@ -2313,10 +2299,10 @@ (while success (setq size (min size (- bottom-a top-a) (- bottom-b top-b) (- bottom-m top-m))) - (setq sa (emerge-eval-in-buffer emerge-A-buffer + (setq sa (with-current-buffer emerge-A-buffer (buffer-substring top-a (+ size top-a)))) - (setq sb (emerge-eval-in-buffer emerge-B-buffer + (setq sb (with-current-buffer emerge-B-buffer (buffer-substring top-b (+ size top-b)))) (setq sm (buffer-substring top-m (+ size top-m))) @@ -2335,10 +2321,10 @@ (while success (setq size (min size (- bottom-a top-a) (- bottom-b top-b) (- bottom-m top-m))) - (setq sa (emerge-eval-in-buffer emerge-A-buffer + (setq sa (with-current-buffer emerge-A-buffer (buffer-substring (- bottom-a size) bottom-a))) - (setq sb (emerge-eval-in-buffer emerge-B-buffer + (setq sb (with-current-buffer emerge-B-buffer (buffer-substring (- bottom-b size) bottom-b))) (setq sm (buffer-substring (- bottom-m size) bottom-m)) @@ -2351,14 +2337,14 @@ ;; {top,bottom}-{a,b,m} are now set at the new beginnings and ends ;; of the difference regions. Move them to the beginning of lines, as ;; appropriate. - (emerge-eval-in-buffer emerge-A-buffer + (with-current-buffer emerge-A-buffer (goto-char top-a) (beginning-of-line) (aset diff 0 (point-marker)) (goto-char bottom-a) (beginning-of-line 2) (aset diff 1 (point-marker))) - (emerge-eval-in-buffer emerge-B-buffer + (with-current-buffer emerge-B-buffer (goto-char top-b) (beginning-of-line) (aset diff 2 (point-marker)) @@ -2413,7 +2399,7 @@ ;; search for the point in the A buffer, using the markers ;; for the beginning and end of the differences in the A buffer (emerge-find-difference1 arg - (emerge-eval-in-buffer emerge-A-buffer (point)) + (with-current-buffer emerge-A-buffer (point)) 0 1)) (defun emerge-find-difference-B (arg) @@ -2426,7 +2412,7 @@ ;; search for the point in the B buffer, using the markers ;; for the beginning and end of the differences in the B buffer (emerge-find-difference1 arg - (emerge-eval-in-buffer emerge-B-buffer (point)) + (with-current-buffer emerge-B-buffer (point)) 2 3)) (defun emerge-find-difference1 (arg location begin end) @@ -2474,16 +2460,19 @@ (let* ((valid-diff (and (>= emerge-current-difference 0) (< emerge-current-difference emerge-number-of-differences))) - (diff (and valid-diff - (aref emerge-difference-list emerge-current-difference))) - (merge-line (emerge-line-number-in-buf 4 5)) - (A-line (emerge-eval-in-buffer emerge-A-buffer - (emerge-line-number-in-buf 0 1))) - (B-line (emerge-eval-in-buffer emerge-B-buffer - (emerge-line-number-in-buf 2 3)))) + (emerge-line-diff (and valid-diff + (aref emerge-difference-list + emerge-current-difference))) + (merge-line (emerge-line-number-in-buf 4 5)) + (A-line (with-current-buffer emerge-A-buffer + (emerge-line-number-in-buf 0 1))) + (B-line (with-current-buffer emerge-B-buffer + (emerge-line-number-in-buf 2 3)))) (message "At lines: merge = %d, A = %d, B = %d" merge-line A-line B-line))) +(defvar emerge-line-diff) + (defun emerge-line-number-in-buf (begin-marker end-marker) (let (temp) (setq temp (save-excursion @@ -2491,9 +2480,9 @@ (1+ (count-lines 1 (point))))) (if valid-diff (progn - (if (> (point) (aref diff begin-marker)) + (if (> (point) (aref emerge-line-diff begin-marker)) (setq temp (- temp emerge-before-flag-lines))) - (if (> (point) (aref diff end-marker)) + (if (> (point) (aref emerge-line-diff end-marker)) (setq temp (- temp emerge-after-flag-lines))))) temp)) @@ -2548,30 +2537,32 @@ (error "Register does not contain text")) (emerge-combine-versions-internal template force))) -(defun emerge-combine-versions-internal (template force) +(defun emerge-combine-versions-internal (emerge-combine-template force) (let ((operate - (function (lambda () - (emerge-combine-versions-edit merge-begin merge-end - A-begin A-end B-begin B-end) - (if emerge-auto-advance - (emerge-next-difference)))))) + (lambda () + (emerge-combine-versions-edit merge-begin merge-end + A-begin A-end B-begin B-end) + (if emerge-auto-advance + (emerge-next-difference))))) (emerge-select-version force operate operate operate))) +(defvar emerge-combine-template) + (defun emerge-combine-versions-edit (merge-begin merge-end A-begin A-end B-begin B-end) - (emerge-eval-in-buffer + (with-current-buffer emerge-merge-buffer (delete-region merge-begin merge-end) (goto-char merge-begin) (let ((i 0)) - (while (< i (length template)) - (let ((c (aref template i))) + (while (< i (length emerge-combine-template)) + (let ((c (aref emerge-combine-template i))) (if (= c ?%) (progn (setq i (1+ i)) (setq c (condition-case nil - (aref template i) + (aref emerge-combine-template i) (error ?%))) (cond ((= c ?a) (insert-buffer-substring emerge-A-buffer A-begin A-end)) @@ -2620,7 +2611,7 @@ (defun emerge-place-flags-in-buffer (buffer difference before-index after-index) (if buffer - (emerge-eval-in-buffer + (with-current-buffer buffer (emerge-place-flags-in-buffer1 difference before-index after-index)) (emerge-place-flags-in-buffer1 difference before-index after-index))) @@ -2689,7 +2680,7 @@ (run-hooks 'emerge-unselect-hook)) (defun emerge-remove-flags-in-buffer (buffer before after) - (emerge-eval-in-buffer + (with-current-buffer buffer (let ((buffer-read-only nil)) ;; remove the flags, if they're there @@ -2838,11 +2829,11 @@ (while (< x-begin x-end) ;; bite off and compare no more than 1000 characters at a time (let* ((compare-length (min (- x-end x-begin) 1000)) - (x-string (emerge-eval-in-buffer + (x-string (with-current-buffer buffer-x (buffer-substring x-begin (+ x-begin compare-length)))) - (y-string (emerge-eval-in-buffer + (y-string (with-current-buffer buffer-y (buffer-substring y-begin (+ y-begin compare-length))))) @@ -2879,9 +2870,9 @@ ;; A "function" is anything that funcall can handle as an argument. (defun emerge-save-variables (vars) - (mapcar (function (lambda (v) (if (symbolp v) - (symbol-value v) - (funcall (car v))))) + (mapcar (lambda (v) (if (symbolp v) + (symbol-value v) + (funcall (car v)))) vars)) (defun emerge-restore-variables (vars values) @@ -2972,7 +2963,7 @@ ;; buffer. (defun emerge-copy-modes (buffer) ;; Set the major mode - (funcall (emerge-eval-in-buffer buffer major-mode))) + (funcall (with-current-buffer buffer major-mode))) ;; Define a key, even if a prefix of it is defined (defun emerge-force-define-key (keymap key definition) @@ -3163,11 +3154,11 @@ (aref s i)) 65536)) (setq i (1+ i))) - (mapconcat (function (lambda (b) - (setq b (+ (% b 93) ?!)) - (if (>= b ?/) - (setq b (1+ b))) - (char-to-string b))) + (mapconcat (lambda (b) + (setq b (+ (% b 93) ?!)) + (if (>= b ?/) + (setq b (1+ b))) + (char-to-string b)) bins ""))) ;; Quote any /s in a string by replacing them with \!. @@ -3205,5 +3196,4 @@ (provide 'emerge) -;; arch-tag: a575f092-6e44-400e-b8a2-4124e9377585 ;;; emerge.el ends here ------------------------------------------------------------ revno: 102268 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2010-11-06 20:19:32 +0200 message: xdisp.c: Add commentary about character compositions in bidirectional text. diff: === modified file 'src/xdisp.c' --- src/xdisp.c 2010-11-06 08:28:31 +0000 +++ src/xdisp.c 2010-11-06 18:19:32 +0000 @@ -214,11 +214,41 @@ leftmost character with special glyphs, which will display as, well, empty. On text terminals, these special glyphs are simply blank characters. On graphics terminals, there's a single stretch - glyph with suitably computed width. Both the blanks and the + glyph of a suitably computed width. Both the blanks and the stretch glyph are given the face of the background of the line. This way, the terminal-specific back-end can still draw the glyphs left to right, even for R2L lines. + Bidirectional display and character compositions + + Some scripts cannot be displayed by drawing each character + individually, because adjacent characters change each other's shape + on display. For example, Arabic and Indic scripts belong to this + category. + + Emacs display supports this by providing "character compositions", + most of which is implemented in composite.c. During the buffer + scan that delivers characters to PRODUCE_GLYPHS, if the next + character to be delivered is a composed character, the iteration + calls composition_reseat_it and next_element_from_composition. If + they succeed to compose the character with one or more of the + following characters, the whole sequence of characters that where + composed is recorded in the `struct composition_it' object that is + part of the buffer iterator. The composed sequence could produce + one or more font glyphs (called "grapheme clusters") on the screen. + Each of these grapheme clusters is then delivered to PRODUCE_GLYPHS + in the direction corresponding to the current bidi scan direction + (recorded in the scan_dir member of the `struct bidi_it' object + that is part of the buffer iterator). In particular, if the bidi + iterator currently scans the buffer backwards, the grapheme + clusters are delivered back to front. This reorders the grapheme + clusters as appropriate for the current bidi context. Note that + this means that the grapheme clusters are always stored in the + LGSTRING object (see composite.c) in the logical order. + + Moving an iterator in bidirectional text + without producing glyphs + Note one important detail mentioned above: that the bidi reordering engine, driven by the iterator, produces characters in R2L rows starting at the character that will be the rightmost on display. ------------------------------------------------------------ revno: 102267 committer: Ralf Angeli branch nick: trunk timestamp: Sat 2010-11-06 16:56:29 +0100 message: RefTeX: Improve matching of bib entries. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-06 12:08:58 +0000 +++ lisp/ChangeLog 2010-11-06 15:56:29 +0000 @@ -1,3 +1,12 @@ +2010-11-06 Ralf Angeli + + * textmodes/reftex-cite.el + (reftex-extract-bib-entries-from-thebibliography): Match bibitem + entries with whitespace after \bibitem. + (reftex-create-bibtex-file): Match entries containing numbers and + symbol constituents. Make sure that entries with whitespace at + various places are found. + 2010-11-05 Christian Millour (tiny change) * shell.el (shell-process-popd): Made aware of comint-file-name-prefix. === modified file 'lisp/textmodes/reftex-cite.el' --- lisp/textmodes/reftex-cite.el 2010-10-16 15:08:47 +0000 +++ lisp/textmodes/reftex-cite.el 2010-11-06 15:56:29 +0000 @@ -379,7 +379,7 @@ (split-string (buffer-substring-no-properties start end) - "[ \t\n\r]*\\\\bibitem\ + "[ \t\n\r]*\\\\bibitem[ \t]*\ \\(\\[[^]]*]\\)*\[ \t]*")))))) (goto-char end)))))) (unless entries @@ -1147,9 +1147,8 @@ (save-restriction (widen) (goto-char (point-min)) - (while (re-search-forward - "^[ \t]*@[a-zA-Z]+[ \t]*{\\([^ \t\r\n]+\\)," - nil t) + (while (re-search-forward "^[ \t]*@\\(?:\\w\\|\\s_\\)+[ \t\n\r]*\ +\[{(][ \t\n\r]*\\([^ \t\n\r,]+\\)" nil t) (setq key (match-string 1) beg (match-beginning 0) end (progn ------------------------------------------------------------ revno: 102266 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2010-11-06 15:49:29 +0200 message: src/ChangeLog: Fix log entry for revno 102262. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-11-06 13:45:37 +0000 +++ src/ChangeLog 2010-11-06 13:49:29 +0000 @@ -9,6 +9,7 @@ 2010-11-06 Jan Djärv * nsfont.m: Include termchar for new mouse-highlight. + (nsfont_draw): Use MOUSE_HL_INFO. 2010-11-05 Eli Zaretskii ------------------------------------------------------------ revno: 102265 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2010-11-06 15:45:37 +0200 message: Support R2L lines in tool-tip text. xfns.c (Fx_show_tip): If any of the tool-tip text lines is R2L, adjust width of tool-tip frame to the width of text, excluding the stretch glyph at the beginning of R2L glyph rows. w32fns.c (Fx_show_tip): Likewise. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-11-06 09:33:22 +0000 +++ src/ChangeLog 2010-11-06 13:45:37 +0000 @@ -1,3 +1,11 @@ +2010-11-06 Eli Zaretskii + + * xfns.c (Fx_show_tip): If any of the tool-tip text lines is R2L, + adjust width of tool-tip frame to the width of text, excluding the + stretch glyph at the beginning of R2L glyph rows. + + * w32fns.c (Fx_show_tip): Likewise. + 2010-11-06 Jan Djärv * nsfont.m: Include termchar for new mouse-highlight. === modified file 'src/w32fns.c' --- src/w32fns.c 2010-10-29 07:04:09 +0000 +++ src/w32fns.c 2010-11-06 13:45:37 +0000 @@ -5657,7 +5657,7 @@ int root_x, root_y; struct buffer *old_buffer; struct text_pos pos; - int i, width, height; + int i, width, height, seen_reversed_p; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; int old_windows_or_buffers_changed = windows_or_buffers_changed; int count = SPECPDL_INDEX (); @@ -5787,7 +5787,7 @@ try_window (FRAME_ROOT_WINDOW (f), pos, 0); /* Compute width and height of the tooltip. */ - width = height = 0; + width = height = seen_reversed_p = 0; for (i = 0; i < w->desired_matrix->nrows; ++i) { struct glyph_row *row = &w->desired_matrix->rows[i]; @@ -5801,24 +5801,83 @@ /* Let the row go over the full width of the frame. */ row->full_width_p = 1; -#ifdef TODO /* Investigate why some fonts need more width than is - calculated for some tooltips. */ - /* There's a glyph at the end of rows that is use to place - the cursor there. Don't include the width of this glyph. */ + row_width = row->pixel_width; if (row->used[TEXT_AREA]) { - last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; - row_width = row->pixel_width - last->pixel_width; + if (!row->reversed_p) + { +#ifdef TODO /* Investigate why some fonts need more width than is + calculated for some tooltips. */ + + /* There's a glyph at the end of rows that is used to + place the cursor there. Don't include the width of + this glyph. */ + last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; + if (INTEGERP (last->object)) + row_width -= last->pixel_width; +#endif + } + else + { + /* There could be a stretch glyph at the beginning of R2L + rows that is produced by extend_face_to_end_of_line. + Don't count that glyph. */ + struct glyph *g = row->glyphs[TEXT_AREA]; + + if (g->type == STRETCH_GLYPH && INTEGERP (g->object)) + { + row_width -= g->pixel_width; + seen_reversed_p = 1; + } + } } - else -#endif - row_width = row->pixel_width; /* TODO: find why tips do not draw along baseline as instructed. */ height += row->height; width = max (width, row_width); } + /* If we've seen partial-length R2L rows, we need to re-adjust the + tool-tip frame width and redisplay it again, to avoid over-wide + tips due to the stretch glyph that extends R2L lines to full + width of the frame. */ + if (seen_reversed_p) + { + /* w->total_cols and FRAME_TOTAL_COLS want the width in columns, + not in pixels. */ + width /= WINDOW_FRAME_COLUMN_WIDTH (w); + w->total_cols = make_number (width); + FRAME_TOTAL_COLS (f) = width; + adjust_glyphs (f); + clear_glyph_matrix (w->desired_matrix); + clear_glyph_matrix (w->current_matrix); + try_window (FRAME_ROOT_WINDOW (f), pos, 0); + width = height = 0; + /* Recompute width and height of the tooltip. */ + for (i = 0; i < w->desired_matrix->nrows; ++i) + { + struct glyph_row *row = &w->desired_matrix->rows[i]; + struct glyph *last; + int row_width; + + if (!row->enabled_p || !row->displays_text_p) + break; + row->full_width_p = 1; + row_width = row->pixel_width; +#ifdef TODO /* See above. */ + if (row->used[TEXT_AREA] && !row->reversed_p) + { + last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; + if (INTEGERP (last->object)) + row_width -= last->pixel_width; + } +#endif + + height += row->height; + width = max (width, row_width); + } + } + /* Add the frame's internal border to the width and height the X window should have. */ height += 2 * FRAME_INTERNAL_BORDER_WIDTH (f); === modified file 'src/xfns.c' --- src/xfns.c 2010-10-29 07:04:09 +0000 +++ src/xfns.c 2010-11-06 13:45:37 +0000 @@ -5017,7 +5017,7 @@ int root_x, root_y; struct buffer *old_buffer; struct text_pos pos; - int i, width, height; + int i, width, height, seen_reversed_p; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; int old_windows_or_buffers_changed = windows_or_buffers_changed; int count = SPECPDL_INDEX (); @@ -5158,7 +5158,7 @@ try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE); /* Compute width and height of the tooltip. */ - width = height = 0; + width = height = seen_reversed_p = 0; for (i = 0; i < w->desired_matrix->nrows; ++i) { struct glyph_row *row = &w->desired_matrix->rows[i]; @@ -5173,19 +5173,74 @@ row->full_width_p = 1; row_width = row->pixel_width; - /* There's a glyph at the end of rows that is used to place - the cursor there. Don't include the width of this glyph. */ if (row->used[TEXT_AREA]) { - last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; - if (INTEGERP (last->object)) - row_width -= last->pixel_width; + /* There's a glyph at the end of rows that is used to place + the cursor there. Don't include the width of this glyph. */ + if (!row->reversed_p) + { + last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; + if (INTEGERP (last->object)) + row_width -= last->pixel_width; + } + else + { + /* There could be a stretch glyph at the beginning of R2L + rows that is produced by extend_face_to_end_of_line. + Don't count that glyph. */ + struct glyph *g = row->glyphs[TEXT_AREA]; + + if (g->type == STRETCH_GLYPH && INTEGERP (g->object)) + { + row_width -= g->pixel_width; + seen_reversed_p = 1; + } + } } height += row->height; width = max (width, row_width); } + /* If we've seen partial-length R2L rows, we need to re-adjust the + tool-tip frame width and redisplay it again, to avoid over-wide + tips due to the stretch glyph that extends R2L lines to full + width of the frame. */ + if (seen_reversed_p) + { + /* w->total_cols and FRAME_TOTAL_COLS want the width in columns, + not in pixels. */ + width /= WINDOW_FRAME_COLUMN_WIDTH (w); + w->total_cols = make_number (width); + FRAME_TOTAL_COLS (f) = width; + adjust_glyphs (f); + clear_glyph_matrix (w->desired_matrix); + clear_glyph_matrix (w->current_matrix); + try_window (FRAME_ROOT_WINDOW (f), pos, 0); + width = height = 0; + /* Recompute width and height of the tooltip. */ + for (i = 0; i < w->desired_matrix->nrows; ++i) + { + struct glyph_row *row = &w->desired_matrix->rows[i]; + struct glyph *last; + int row_width; + + if (!row->enabled_p || !row->displays_text_p) + break; + row->full_width_p = 1; + row_width = row->pixel_width; + if (row->used[TEXT_AREA] && !row->reversed_p) + { + last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; + if (INTEGERP (last->object)) + row_width -= last->pixel_width; + } + + height += row->height; + width = max (width, row_width); + } + } + /* Add the frame's internal border to the width and height the X window should have. */ height += 2 * FRAME_INTERNAL_BORDER_WIDTH (f); ------------------------------------------------------------ revno: 102264 committer: Michael Albinus branch nick: trunk timestamp: Sat 2010-11-06 13:08:58 +0100 message: * shell.el (shell-process-popd): Made aware of comint-file-name-prefix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-05 12:11:12 +0000 +++ lisp/ChangeLog 2010-11-06 12:08:58 +0000 @@ -1,3 +1,7 @@ +2010-11-05 Christian Millour (tiny change) + + * shell.el (shell-process-popd): Made aware of comint-file-name-prefix. + 2010-11-05 Jan Djärv * mouse.el (mouse-yank-primary): Update comment (Bug#6802). === modified file 'lisp/shell.el' --- lisp/shell.el 2010-10-10 23:12:30 +0000 +++ lisp/shell.el 2010-11-06 12:08:58 +0000 @@ -700,7 +700,7 @@ (defun shell-process-popd (arg) (let ((num (or (shell-extract-num arg) 0))) (cond ((and num (= num 0) shell-dirstack) - (shell-cd (car shell-dirstack)) + (shell-cd (shell-prefixed-directory-name (car shell-dirstack))) (setq shell-dirstack (cdr shell-dirstack)) (shell-dirstack-message)) ((and num (> num 0) (<= num (length shell-dirstack))) ------------------------------------------------------------ revno: 102263 committer: Andreas Schwab branch nick: trunk timestamp: Sat 2010-11-06 11:31:56 +0100 message: configure.in: Fix indentation diff: === modified file 'ChangeLog' --- ChangeLog 2010-10-31 23:21:53 +0000 +++ ChangeLog 2010-11-06 10:31:56 +0000 @@ -1,3 +1,7 @@ +2010-11-06 Andreas Schwab + + * configure.in: Fix indentation. + 2010-10-31 Ken Brown * configure.in (checking whether localtime caches TZ): Use === modified file 'configure' --- configure 2010-10-31 23:21:53 +0000 +++ configure 2010-11-06 10:31:56 +0000 @@ -14986,7 +14986,7 @@ echo " Does Emacs use -ldbus? ${HAVE_DBUS}" echo " Does Emacs use -lgconf? ${HAVE_GCONF}" echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" -echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}" +echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}" echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}" === modified file 'configure.in' --- configure.in 2010-10-31 23:21:53 +0000 +++ configure.in 2010-11-06 10:31:56 +0000 @@ -3704,7 +3704,7 @@ echo " Does Emacs use -ldbus? ${HAVE_DBUS}" echo " Does Emacs use -lgconf? ${HAVE_GCONF}" echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" -echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}" +echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}" echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}" === modified file 'src/config.in' --- src/config.in 2010-10-09 01:59:50 +0000 +++ src/config.in 2010-11-06 10:31:56 +0000 @@ -1059,6 +1059,9 @@ /* Define to `int' if does not define. */ #undef pid_t +/* Define to `unsigned int' if does not define. */ +#undef size_t + /* Define to any substitute for sys_siglist. */ #undef sys_siglist @@ -1097,17 +1100,14 @@ #include config_opsysfile #include config_machfile -/* Set up some defines, C and LD flags for NeXTstep interface on GNUstep. - (There is probably a better place to do this, but right now the Cocoa - side does this in s/darwin.h and we cannot - parallel this exactly since GNUstep is multi-OS. */ -#ifdef HAVE_NS -# ifdef NS_IMPL_GNUSTEP /* GNUstep needs a bit more pure memory. Of the existing knobs, -SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */ + SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. + (There is probably a better place to do this, but right now the + Cocoa side does this in s/darwin.h and we cannot parallel this + exactly since GNUstep is multi-OS. */ +#if defined HAVE_NS && defined NS_IMPL_GNUSTEP # define SYSTEM_PURESIZE_EXTRA 30000 -# endif /* NS_IMPL_GNUSTEP */ -#endif /* HAVE_NS */ +#endif /* SIGTYPE is the macro we actually use. */ #ifndef SIGTYPE ------------------------------------------------------------ revno: 102262 committer: Jan D. branch nick: trunk timestamp: Sat 2010-11-06 10:33:22 +0100 message: * src/nsfont.m: Include termchar for new mouse-highlight. diff: === modified file 'lisp/emacs-lisp/cl-loaddefs.el' --- lisp/emacs-lisp/cl-loaddefs.el 2010-09-04 19:44:39 +0000 +++ lisp/emacs-lisp/cl-loaddefs.el 2010-11-06 09:33:22 +0000 @@ -282,7 +282,7 @@ ;;;;;; do-all-symbols do-symbols dotimes dolist do* do loop return-from ;;;;;; return block etypecase typecase ecase case load-time-value ;;;;;; eval-when destructuring-bind function* defmacro* defun* gentemp -;;;;;; gensym) "cl-macs" "cl-macs.el" "c10b5cbebb5267291ef15c782c0271a6") +;;;;;; gensym) "cl-macs" "cl-macs.el" "82f8370745a60dc26536a0237cba893f") ;;; Generated autoloads from cl-macs.el (autoload 'gensym "cl-macs" "\ === modified file 'src/ChangeLog' --- src/ChangeLog 2010-11-06 08:28:31 +0000 +++ src/ChangeLog 2010-11-06 09:33:22 +0000 @@ -1,3 +1,7 @@ +2010-11-06 Jan Djärv + + * nsfont.m: Include termchar for new mouse-highlight. + 2010-11-05 Eli Zaretskii Unify mouse-highlight code for all GUI and TTY sessions. === modified file 'src/nsfont.m' --- src/nsfont.m 2010-11-04 18:10:50 +0000 +++ src/nsfont.m 2010-11-06 09:33:22 +0000 @@ -37,6 +37,7 @@ #include "frame.h" #include "character.h" #include "font.h" +#include "termchar.h" /* TODO: Drop once we can assume gnustep-gui 0.17.1. */ #ifdef NS_IMPL_GNUSTEP @@ -1040,8 +1041,7 @@ face = s->face; break; case NS_DUMPGLYPH_MOUSEFACE: - face = FACE_FROM_ID (s->f, - FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id); + face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id); if (!face) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); break; ------------------------------------------------------------ revno: 102261 [merge] committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2010-11-06 10:28:31 +0200 message: Unify mouse-highlight code for all GUI and TTY sessions. term.c: Remove static mouse_face_* variables. All users changed. (term_show_mouse_face, term_clear_mouse_face) (fast_find_position, term_mouse_highlight): Functions deleted. (tty_draw_row_with_mouse_face): New function. (term_mouse_movement): Call note_mouse_highlight instead of term_mouse_highlight. nsterm.m (ns_update_window_begin, ns_update_window_end) (ns_update_end, x_destroy_window, ns_frame_up_to_date) (ns_dumpglyphs_box_or_relief, ns_maybe_dumpglyphs_background) (ns_dumpglyphs_image, ns_dumpglyphs_stretch) (ns_initialize_display_info, keyDown, mouseMoved, mouseExited): Replace Display_Info with Mouse_HLInfo everywhere where mouse_face_* members were accessed for mouse highlight purposes. xterm.c (x_update_window_begin, x_update_window_end) (x_update_end, XTframe_up_to_date, x_set_mouse_face_gc) (handle_one_xevent, x_free_frame_resources, x_term_init): Replace Display_Info with Mouse_HLInfo everywhere where mouse_face_* members were accessed for mouse highlight purposes. w32term.c (x_update_window_begin, x_update_window_end) (x_update_end, w32_read_socket, x_free_frame_resources) (w32_initialize_display_info): Replace Display_Info with Mouse_HLInfo everywhere where mouse_face_* members were accessed for mouse highlight purposes. xdisp.c (show_mouse_face, note_mode_line_or_margin_highlight) (note_mouse_highlight) [HAVE_WINDOW_SYSTEM]: Don't run GUI code unless the frame is on a window-system. (get_tool_bar_item, handle_tool_bar_click) (note_tool_bar_highlight, draw_glyphs, erase_phys_cursor) (show_mouse_face, clear_mouse_face, coords_in_mouse_face_p) (note_mode_line_or_margin_highlight, note_mouse_highlight) (x_clear_window_mouse_face, cancel_mouse_face, expose_frame): Replace Display_Info with Mouse_HLInfo everywhere where mouse_face_* members were accessed for mouse highlight purposes. (coords_in_mouse_face_p): Move prototype out of the HAVE_WINDOW_SYSTEM conditional. (x_y_to_hpos_vpos, frame_to_window_pixel_xy): Move out of the HAVE_WINDOW_SYSTEM block. (try_window_id) [HAVE_GPM || MSDOS]: Call x_clear_window_mouse_face. (draw_row_with_mouse_face): Implementation for HAVE_WINDOW_SYSTEM systems. Call tty_draw_row_with_mouse_face for TTY systems. (show_mouse_face): Call draw_row_with_mouse_face, instead of calling draw_glyphs directly. (show_mouse_face, clear_mouse_face, coords_in_mouse_face_p) (cursor_in_mouse_face_p, rows_from_pos_range) (mouse_face_from_buffer_pos, mouse_face_from_string_pos) (note_mode_line_or_margin_highlight, note_mouse_highlight) (x_clear_window_mouse_face, cancel_mouse_face): Move out of the HAVE_WINDOW_SYSTEM block. Ifdef away window-system specific fragments. (note_mouse_highlight): Call popup_activated for MSDOS as well. Clear mouse highlight if pointer is over glyphs whose OBJECT is an integer. (mouse_face_from_buffer_pos): Add parentheses around && within ||. (x_consider_frame_title, tool_bar_lines_needed): Move prototypes to HAVE_WINDOW_SYSTEM-only part. (get_window_cursor_type): Move inside a HAVE_WINDOW_SYSTEM-only part. Remove "#ifdef HAVE_WINDOW_SYSTEM" from body of function. (null_glyph_slice): Move declaration into HAVE_WINDOW_SYSTEM-only part. dispnew.c (mirror_make_current): Set Y coordinate of the mode-line and header-line rows. (init_display): Setup initial frame's output_data for text terminal frames. xmenu.c (popup_activated): Don't define on MSDOS, which now has its own definition on msdos.c. msdos.c (show_mouse_face, clear_mouse_face) (fast_find_position, IT_note_mode_line_highlight) (IT_note_mouse_highlight): Functions deleted. (IT_frame_up_to_date, dos_rawgetc): Call note_mouse_highlight instead of IT_note_mouse_highlight. (draw_row_with_mouse_face, popup_activated): New functions. (dos_set_window_size, draw_row_with_mouse_face, IT_update_begin) (IT_update_end, IT_frame_up_to_date, internal_terminal_init) (dos_rawgetc): Replace Display_Info with Mouse_HLInfo everywhere where mouse_face_* members were accessed for mouse highlight purposes. msdos.h (initialize_msdos_display): Add prototype. frame.h (MOUSE_HL_INFO): New macro. lisp.h (Mouse_HLInfo): New data type. xterm.h (struct x_display_info): w32term.h (struct w32_display_info): nsterm.h (struct ns_display_info): termchar.h (struct tty_display_info): Use it instead of mouse_face_* members. dispextern.h (show_mouse_face, clear_mouse_face): Update type of 1st argument. (frame_to_window_pixel_xy, note_mouse_highlight) (x_clear_window_mouse_face, cancel_mouse_face, clear_mouse_face) (show_mouse_face, cursor_in_mouse_face_p): Move prototypes out of HAVE_WINDOW_SYSTEM conditional. (draw_row_with_mouse_face): Declare prototype. (tty_draw_row_with_mouse_face): Declare prototype. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-11-05 17:52:06 +0000 +++ src/ChangeLog 2010-11-06 08:28:31 +0000 @@ -1,5 +1,116 @@ 2010-11-05 Eli Zaretskii + Unify mouse-highlight code for all GUI and TTY sessions. + + * term.c: Remove static mouse_face_* variables. All users + changed. + (term_show_mouse_face, term_clear_mouse_face) + (fast_find_position, term_mouse_highlight): Functions deleted. + (tty_draw_row_with_mouse_face): New function. + (term_mouse_movement): Call note_mouse_highlight instead of + term_mouse_highlight. + + * nsterm.m (ns_update_window_begin, ns_update_window_end) + (ns_update_end, x_destroy_window, ns_frame_up_to_date) + (ns_dumpglyphs_box_or_relief, ns_maybe_dumpglyphs_background) + (ns_dumpglyphs_image, ns_dumpglyphs_stretch) + (ns_initialize_display_info, keyDown, mouseMoved, mouseExited): + Replace Display_Info with Mouse_HLInfo everywhere where + mouse_face_* members were accessed for mouse highlight purposes. + + * xterm.c (x_update_window_begin, x_update_window_end) + (x_update_end, XTframe_up_to_date, x_set_mouse_face_gc) + (handle_one_xevent, x_free_frame_resources, x_term_init): Replace + Display_Info with Mouse_HLInfo everywhere where mouse_face_* + members were accessed for mouse highlight purposes. + + * w32term.c (x_update_window_begin, x_update_window_end) + (x_update_end, w32_read_socket, x_free_frame_resources) + (w32_initialize_display_info): Replace Display_Info with + Mouse_HLInfo everywhere where mouse_face_* members were accessed + for mouse highlight purposes. + + * xdisp.c (show_mouse_face, note_mode_line_or_margin_highlight) + (note_mouse_highlight) [HAVE_WINDOW_SYSTEM]: Don't run GUI code + unless the frame is on a window-system. + (get_tool_bar_item, handle_tool_bar_click) + (note_tool_bar_highlight, draw_glyphs, erase_phys_cursor) + (show_mouse_face, clear_mouse_face, coords_in_mouse_face_p) + (note_mode_line_or_margin_highlight, note_mouse_highlight) + (x_clear_window_mouse_face, cancel_mouse_face, expose_frame): + Replace Display_Info with Mouse_HLInfo everywhere where + mouse_face_* members were accessed for mouse highlight purposes. + (coords_in_mouse_face_p): Move prototype out of the + HAVE_WINDOW_SYSTEM conditional. + (x_y_to_hpos_vpos, frame_to_window_pixel_xy): Move out of the + HAVE_WINDOW_SYSTEM block. + (try_window_id) [HAVE_GPM || MSDOS]: Call + x_clear_window_mouse_face. + (draw_row_with_mouse_face): Implementation for HAVE_WINDOW_SYSTEM + systems. Call tty_draw_row_with_mouse_face for TTY systems. + (show_mouse_face): Call draw_row_with_mouse_face, instead of + calling draw_glyphs directly. + (show_mouse_face, clear_mouse_face, coords_in_mouse_face_p) + (cursor_in_mouse_face_p, rows_from_pos_range) + (mouse_face_from_buffer_pos, mouse_face_from_string_pos) + (note_mode_line_or_margin_highlight, note_mouse_highlight) + (x_clear_window_mouse_face, cancel_mouse_face): Move out of the + HAVE_WINDOW_SYSTEM block. Ifdef away window-system specific + fragments. + (note_mouse_highlight): Call popup_activated for MSDOS as well. + Clear mouse highlight if pointer is over glyphs whose OBJECT is an + integer. + (mouse_face_from_buffer_pos): Add parentheses around && within ||. + (x_consider_frame_title, tool_bar_lines_needed): Move + prototypes to HAVE_WINDOW_SYSTEM-only part. + (get_window_cursor_type): Move inside a HAVE_WINDOW_SYSTEM-only + part. Remove "#ifdef HAVE_WINDOW_SYSTEM" from body of function. + (null_glyph_slice): Move declaration into HAVE_WINDOW_SYSTEM-only + part. + + * dispnew.c (mirror_make_current): Set Y coordinate of the + mode-line and header-line rows. + (init_display): Setup initial frame's output_data for text + terminal frames. + + * xmenu.c (popup_activated): Don't define on MSDOS, which now has + its own definition on msdos.c. + + * msdos.c (show_mouse_face, clear_mouse_face) + (fast_find_position, IT_note_mode_line_highlight) + (IT_note_mouse_highlight): Functions deleted. + (IT_frame_up_to_date, dos_rawgetc): Call note_mouse_highlight + instead of IT_note_mouse_highlight. + (draw_row_with_mouse_face, popup_activated): New functions. + (dos_set_window_size, draw_row_with_mouse_face, IT_update_begin) + (IT_update_end, IT_frame_up_to_date, internal_terminal_init) + (dos_rawgetc): Replace Display_Info with Mouse_HLInfo everywhere + where mouse_face_* members were accessed for mouse highlight + purposes. + + * msdos.h (initialize_msdos_display): Add prototype. + + * frame.h (MOUSE_HL_INFO): New macro. + + * lisp.h (Mouse_HLInfo): New data type. + + * xterm.h (struct x_display_info): + * w32term.h (struct w32_display_info): + * nsterm.h (struct ns_display_info): + * termchar.h (struct tty_display_info): Use it instead of + mouse_face_* members. + + * dispextern.h (show_mouse_face, clear_mouse_face): Update type of + 1st argument. + (frame_to_window_pixel_xy, note_mouse_highlight) + (x_clear_window_mouse_face, cancel_mouse_face, clear_mouse_face) + (show_mouse_face, cursor_in_mouse_face_p): Move prototypes out of + HAVE_WINDOW_SYSTEM conditional. + (draw_row_with_mouse_face): Declare prototype. + (tty_draw_row_with_mouse_face): Declare prototype. + +2010-11-05 Eli Zaretskii + * term.c (append_glyphless_glyph, produce_glyphless_glyph): Remove unused variables. === modified file 'src/dispextern.h' --- src/dispextern.h 2010-11-01 04:09:26 +0000 +++ src/dispextern.h 2010-11-06 08:28:31 +0000 @@ -69,6 +69,11 @@ typedef XImagePtr XImagePtr_or_DC; #endif +#ifndef HAVE_WINDOW_SYSTEM +typedef int Cursor; +#define No_Cursor (0) +#endif + #ifndef NativeRectangle #define NativeRectangle int #endif @@ -3060,28 +3065,31 @@ extern void x_clear_cursor (struct window *); extern void x_draw_vertical_border (struct window *w); -extern void frame_to_window_pixel_xy (struct window *, int *, int *); extern int get_glyph_string_clip_rects (struct glyph_string *, NativeRectangle *, int); extern void get_glyph_string_clip_rect (struct glyph_string *, NativeRectangle *nr); extern Lisp_Object find_hot_spot (Lisp_Object, int, int); -extern void note_mouse_highlight (struct frame *, int, int); -extern void x_clear_window_mouse_face (struct window *); -extern void cancel_mouse_face (struct frame *); extern void handle_tool_bar_click (struct frame *, int, int, int, unsigned int); -/* msdos.c defines its own versions of these functions. */ -extern int clear_mouse_face (Display_Info *); -extern void show_mouse_face (Display_Info *, enum draw_glyphs_face); -extern int cursor_in_mouse_face_p (struct window *w); - extern void expose_frame (struct frame *, int, int, int, int); extern int x_intersect_rectangles (XRectangle *, XRectangle *, XRectangle *); -#endif +#endif /* HAVE_WINDOW_SYSTEM */ + +extern void frame_to_window_pixel_xy (struct window *, int *, int *); +extern void note_mouse_highlight (struct frame *, int, int); +extern void x_clear_window_mouse_face (struct window *); +extern void cancel_mouse_face (struct frame *); +extern int clear_mouse_face (Mouse_HLInfo *); +extern void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face); +extern int cursor_in_mouse_face_p (struct window *w); +extern void draw_row_with_mouse_face (struct window *, int, struct glyph_row *, + int, int, enum draw_glyphs_face); +extern void tty_draw_row_with_mouse_face (struct window *, struct glyph_row *, + int, int, enum draw_glyphs_face); /* Flags passed to try_window. */ #define TRY_WINDOW_CHECK_MARGINS (1 << 0) === modified file 'src/dispnew.c' --- src/dispnew.c 2010-10-24 21:36:09 +0000 +++ src/dispnew.c 2010-11-05 12:11:22 +0000 @@ -2893,6 +2893,14 @@ else swap_glyph_pointers (desired_row, current_row); current_row->enabled_p = 1; + + /* Set the Y coordinate of the mode/header line's row. + It is needed in draw_row_with_mouse_face to find the + screen coordinates. (Window-based redisplay sets + this in update_window, but no one seems to do that + for frame-based redisplay.) */ + if (current_row->mode_line_p) + current_row->y = row; } } @@ -6416,6 +6424,12 @@ f->terminal = t; t->reference_count++; +#ifdef MSDOS + f->output_data.tty->display_info = &the_only_display_info; +#else + if (f->output_method == output_termcap) + create_tty_output (f); +#endif t->display_info.tty->top_frame = selected_frame; change_frame_size (XFRAME (selected_frame), FrameRows (t->display_info.tty), === modified file 'src/frame.h' --- src/frame.h 2010-10-14 14:32:27 +0000 +++ src/frame.h 2010-11-05 18:07:42 +0000 @@ -544,6 +544,20 @@ #define FRAME_WINDOW_P(f) (0) #endif +/* Return a pointer to the structure holding information about the + region of text, if any, that is currently shown in mouse-face on + frame F. We need to define two versions because a TTY-only build + does not have FRAME_X_DISPLAY_INFO. */ +#ifdef HAVE_WINDOW_SYSTEM +# define MOUSE_HL_INFO(F) \ + (FRAME_WINDOW_P(F) \ + ? &(FRAME_X_DISPLAY_INFO(F)->mouse_highlight) \ + : &(((F)->output_data.tty->display_info)->mouse_highlight)) +#else +# define MOUSE_HL_INFO(F) \ + (&(((F)->output_data.tty->display_info)->mouse_highlight)) +#endif + /* Nonzero if frame F is still alive (not deleted). */ #define FRAME_LIVE_P(f) ((f)->terminal != 0) === modified file 'src/lisp.h' --- src/lisp.h 2010-10-13 14:50:06 +0000 +++ src/lisp.h 2010-10-31 18:50:02 +0000 @@ -1563,6 +1563,41 @@ /* The ID of the mode line highlighting face. */ #define GLYPH_MODE_LINE_FACE 1 +/* Structure to hold mouse highlight data. This is here because other + header files need it for defining struct x_output etc. */ +typedef struct { + /* These variables describe the range of text currently shown in its + mouse-face, together with the window they apply to. As long as + the mouse stays within this range, we need not redraw anything on + its account. Rows and columns are glyph matrix positions in + MOUSE_FACE_WINDOW. */ + int mouse_face_beg_row, mouse_face_beg_col; + int mouse_face_beg_x, mouse_face_beg_y; + int mouse_face_end_row, mouse_face_end_col; + int mouse_face_end_x, mouse_face_end_y; + int mouse_face_past_end; + Lisp_Object mouse_face_window; + int mouse_face_face_id; + Lisp_Object mouse_face_overlay; + + /* 1 if a mouse motion event came and we didn't handle it right away because + gc was in progress. */ + int mouse_face_deferred_gc; + + /* FRAME and X, Y position of mouse when last checked for + highlighting. X and Y can be negative or out of range for the frame. */ + struct frame *mouse_face_mouse_frame; + int mouse_face_mouse_x, mouse_face_mouse_y; + + /* Nonzero means defer mouse-motion highlighting. */ + int mouse_face_defer; + + /* Nonzero means that the mouse highlight should not be shown. */ + int mouse_face_hidden; + + int mouse_face_image_state; +} Mouse_HLInfo; + /* Data type checking */ #define NILP(x) EQ (x, Qnil) === modified file 'src/msdos.c' --- src/msdos.c 2010-10-01 13:56:33 +0000 +++ src/msdos.c 2010-11-05 10:03:17 +0000 @@ -584,14 +584,14 @@ if (current_rows != *rows || current_cols != *cols) { struct frame *f = SELECTED_FRAME(); - struct tty_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); - Lisp_Object window = dpyinfo->mouse_face_window; + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); + Lisp_Object window = hlinfo->mouse_face_window; if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f) { - dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; - dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; - dpyinfo->mouse_face_window = Qnil; + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_window = Qnil; } } @@ -941,551 +941,79 @@ static int mouse_preempted = 0; /* non-zero when XMenu gobbles mouse events */ -/* Set the mouse pointer shape according to whether it is in the - area where the mouse highlight is in effect. */ -static void -IT_set_mouse_pointer (int mode) +int +popup_activated (void) { - /* A no-op for now. DOS text-mode mouse pointer doesn't offer too - many possibilities to change its shape, and the available - functionality pretty much sucks (e.g., almost every reasonable - shape will conceal the character it is on). Since the color of - the pointer changes in the highlighted area, it is not clear to - me whether anything else is required, anyway. */ + return mouse_preempted; } -/* Display the active region described by mouse_face_* - in its mouse-face if HL > 0, in its normal face if HL = 0. */ -static void -show_mouse_face (struct tty_display_info *dpyinfo, int hl) +/* Draw TEXT_AREA glyphs between START and END of glyph row ROW on + window W. X is relative to TEXT_AREA in W. HL is a face override + for drawing the glyphs. */ +void +tty_draw_row_with_mouse_face (struct window *w, struct glyph_row *row, + int start_hpos, int end_hpos, + enum draw_glyphs_face hl) { - struct window *w = XWINDOW (dpyinfo->mouse_face_window); struct frame *f = XFRAME (WINDOW_FRAME (w)); - int i; - struct face *fp; struct tty_display_info *tty = FRAME_TTY (f); - - - /* If window is in the process of being destroyed, don't bother - doing anything. */ - if (w->current_matrix == NULL) - goto set_cursor_shape; - - /* Recognize when we are called to operate on rows that don't exist - anymore. This can happen when a window is split. */ - if (dpyinfo->mouse_face_end_row >= w->current_matrix->nrows) - goto set_cursor_shape; - - /* There's no sense to do anything if the mouse face isn't realized. */ - if (hl > 0) - { - if (dpyinfo->mouse_face_hidden) - goto set_cursor_shape; - - fp = FACE_FROM_ID (SELECTED_FRAME(), dpyinfo->mouse_face_face_id); - if (!fp) - goto set_cursor_shape; - } - - /* Note that mouse_face_beg_row etc. are window relative. */ - for (i = dpyinfo->mouse_face_beg_row; - i <= dpyinfo->mouse_face_end_row; - i++) - { - int start_hpos, end_hpos; - struct glyph_row *row = MATRIX_ROW (w->current_matrix, i); - - /* Don't do anything if row doesn't have valid contents. */ - if (!row->enabled_p) - continue; - - /* For all but the first row, the highlight starts at column 0. */ - if (i == dpyinfo->mouse_face_beg_row) - start_hpos = dpyinfo->mouse_face_beg_col; - else - start_hpos = 0; - - if (i == dpyinfo->mouse_face_end_row) - end_hpos = dpyinfo->mouse_face_end_col; - else - end_hpos = row->used[TEXT_AREA]; - - if (end_hpos <= start_hpos) - continue; - /* Record that some glyphs of this row are displayed in - mouse-face. */ - row->mouse_face_p = hl > 0; - if (hl > 0) - { - int vpos = row->y + WINDOW_TOP_EDGE_Y (w); - int kstart = start_hpos + WINDOW_LEFT_EDGE_X (w); - int nglyphs = end_hpos - start_hpos; - int offset = ScreenPrimary + 2*(vpos*screen_size_X + kstart) + 1; - int start_offset = offset; - - if (tty->termscript) - fprintf (tty->termscript, "\n", - kstart, kstart + nglyphs - 1, vpos); - - mouse_off (); - IT_set_face (dpyinfo->mouse_face_face_id); - /* Since we are going to change only the _colors_ of the - displayed text, there's no need to go through all the - pain of generating and encoding the text from the glyphs. - Instead, we simply poke the attribute byte of each - affected position in video memory with the colors - computed by IT_set_face! */ - _farsetsel (_dos_ds); - while (nglyphs--) - { - _farnspokeb (offset, ScreenAttrib); - offset += 2; - } - if (screen_virtual_segment) - dosv_refresh_virtual_screen (start_offset, end_hpos - start_hpos); - mouse_on (); - } - else - { - /* We are removing a previously-drawn mouse highlight. The - safest way to do so is to redraw the glyphs anew, since - all kinds of faces and display tables could have changed - behind our back. */ - int nglyphs = end_hpos - start_hpos; - int save_x = new_pos_X, save_y = new_pos_Y; - - if (end_hpos >= row->used[TEXT_AREA]) - nglyphs = row->used[TEXT_AREA] - start_hpos; - - /* IT_write_glyphs writes at cursor position, so we need to - temporarily move cursor coordinates to the beginning of - the highlight region. */ - new_pos_X = start_hpos + WINDOW_LEFT_EDGE_X (w); - new_pos_Y = row->y + WINDOW_TOP_EDGE_Y (w); - - if (tty->termscript) - fprintf (tty->termscript, "", - new_pos_X, new_pos_X + nglyphs - 1, new_pos_Y); - IT_write_glyphs (f, row->glyphs[TEXT_AREA] + start_hpos, nglyphs); - if (tty->termscript) - fputs ("\n", tty->termscript); - new_pos_X = save_x; - new_pos_Y = save_y; - } - } - - set_cursor_shape: - /* Change the mouse pointer shape. */ - IT_set_mouse_pointer (hl); -} - -/* Clear out the mouse-highlighted active region. - Redraw it un-highlighted first. */ -static void -clear_mouse_face (struct tty_display_info *dpyinfo) -{ - if (!dpyinfo->mouse_face_hidden && ! NILP (dpyinfo->mouse_face_window)) - show_mouse_face (dpyinfo, 0); - - dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; - dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; - dpyinfo->mouse_face_window = Qnil; -} - -/* Find the glyph matrix position of buffer position POS in window W. - *HPOS and *VPOS are set to the positions found. W's current glyphs - must be up to date. If POS is above window start return (0, 0). - If POS is after end of W, return end of last line in W. */ -static int -fast_find_position (struct window *w, int pos, int *hpos, int *vpos) -{ - int i, lastcol, line_start_position, maybe_next_line_p = 0; - int yb = window_text_bottom_y (w); - struct glyph_row *row = MATRIX_ROW (w->current_matrix, 0), *best_row = row; - - while (row->y < yb) - { - if (row->used[TEXT_AREA]) - line_start_position = row->glyphs[TEXT_AREA]->charpos; - else - line_start_position = 0; - - if (line_start_position > pos) - break; - /* If the position sought is the end of the buffer, - don't include the blank lines at the bottom of the window. */ - else if (line_start_position == pos - && pos == BUF_ZV (XBUFFER (w->buffer))) - { - maybe_next_line_p = 1; - break; - } - else if (line_start_position > 0) - best_row = row; - - /* Don't overstep the last matrix row, lest we get into the - never-never land... */ - if (row->y + 1 >= yb) - break; - - ++row; - } - - /* Find the right column within BEST_ROW. */ - lastcol = 0; - row = best_row; - for (i = 0; i < row->used[TEXT_AREA]; i++) - { - struct glyph *glyph = row->glyphs[TEXT_AREA] + i; - int charpos; - - charpos = glyph->charpos; - if (charpos == pos) - { - *hpos = i; - *vpos = row->y; - return 1; - } - else if (charpos > pos) - break; - else if (charpos > 0) - lastcol = i; - } - - /* If we're looking for the end of the buffer, - and we didn't find it in the line we scanned, - use the start of the following line. */ - if (maybe_next_line_p) - { - ++row; - lastcol = 0; - } - - *vpos = row->y; - *hpos = lastcol + 1; - return 0; -} - -/* Take proper action when mouse has moved to the mode or top line of - window W, x-position X. MODE_LINE_P non-zero means mouse is on the - mode line. X is relative to the start of the text display area of - W, so the width of fringes and scroll bars must be subtracted - to get a position relative to the start of the mode line. */ -static void -IT_note_mode_line_highlight (struct window *w, int x, int mode_line_p) -{ - struct glyph_row *row; - - if (mode_line_p) - row = MATRIX_MODE_LINE_ROW (w->current_matrix); - else - row = MATRIX_HEADER_LINE_ROW (w->current_matrix); - - if (row->enabled_p) - { - struct glyph *glyph, *end; - Lisp_Object help; - - /* Find the glyph under X. */ - glyph = (row->glyphs[TEXT_AREA] - + x - /* in case someone implements scroll bars some day... */ - - WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (w)); - end = glyph + row->used[TEXT_AREA]; - if (glyph < end - && STRINGP (glyph->object) - && STRING_INTERVALS (glyph->object) - && glyph->charpos >= 0 - && glyph->charpos < SCHARS (glyph->object)) - { - /* If we're on a string with `help-echo' text property, - arrange for the help to be displayed. This is done by - setting the global variable help_echo to the help string. */ - help = Fget_text_property (make_number (glyph->charpos), - Qhelp_echo, glyph->object); - if (!NILP (help)) - { - help_echo_string = help; - XSETWINDOW (help_echo_window, w); - help_echo_object = glyph->object; - help_echo_pos = glyph->charpos; - } - } - } -} - -/* Take proper action when the mouse has moved to position X, Y on - frame F as regards highlighting characters that have mouse-face - properties. Also de-highlighting chars where the mouse was before. - X and Y can be negative or out of range. */ -static void -IT_note_mouse_highlight (struct frame *f, int x, int y) -{ - struct tty_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); - enum window_part part = ON_NOTHING; - Lisp_Object window; - struct window *w; - - /* When a menu is active, don't highlight because this looks odd. */ - if (mouse_preempted) - return; - - if (NILP (Vmouse_highlight) - || !f->glyphs_initialized_p) - return; - - dpyinfo->mouse_face_mouse_x = x; - dpyinfo->mouse_face_mouse_y = y; - dpyinfo->mouse_face_mouse_frame = f; - - if (dpyinfo->mouse_face_defer) - return; - - if (gc_in_progress) - { - dpyinfo->mouse_face_deferred_gc = 1; - return; - } - - /* Which window is that in? */ - window = window_from_coordinates (f, x, y, &part, &x, &y, 0); - - /* If we were displaying active text in another window, clear that. */ - if (! EQ (window, dpyinfo->mouse_face_window)) - clear_mouse_face (dpyinfo); - - /* Not on a window -> return. */ - if (!WINDOWP (window)) - return; - - /* Convert to window-relative coordinates. */ - w = XWINDOW (window); - - if (part == ON_MODE_LINE || part == ON_HEADER_LINE) - { - /* Mouse is on the mode or top line. */ - IT_note_mode_line_highlight (w, x, part == ON_MODE_LINE); - return; - } - - IT_set_mouse_pointer (0); - - /* Are we in a window whose display is up to date? - And verify the buffer's text has not changed. */ - if (part == ON_TEXT - && EQ (w->window_end_valid, w->buffer) - && XFASTINT (w->last_modified) == BUF_MODIFF (XBUFFER (w->buffer)) - && (XFASTINT (w->last_overlay_modified) - == BUF_OVERLAY_MODIFF (XBUFFER (w->buffer)))) - { - int pos, i, nrows = w->current_matrix->nrows; - struct glyph_row *row; - struct glyph *glyph; - - /* Find the glyph under X/Y. */ - glyph = NULL; - if (y >= 0 && y < nrows) - { - row = MATRIX_ROW (w->current_matrix, y); - /* Give up if some row before the one we are looking for is - not enabled. */ - for (i = 0; i <= y; i++) - if (!MATRIX_ROW (w->current_matrix, i)->enabled_p) - break; - if (i > y /* all rows upto and including the one at Y are enabled */ - && row->displays_text_p - && x < window_box_width (w, TEXT_AREA)) - { - glyph = row->glyphs[TEXT_AREA]; - if (x >= row->used[TEXT_AREA]) - glyph = NULL; - else - { - glyph += x; - if (!BUFFERP (glyph->object)) - glyph = NULL; - } - } - } - - /* Clear mouse face if X/Y not over text. */ - if (glyph == NULL) - { - clear_mouse_face (dpyinfo); - return; - } - - if (!BUFFERP (glyph->object)) - abort (); - pos = glyph->charpos; - - /* Check for mouse-face and help-echo. */ - { - Lisp_Object mouse_face, overlay, position, *overlay_vec; - int noverlays, obegv, ozv; - struct buffer *obuf; - - /* If we get an out-of-range value, return now; avoid an error. */ - if (pos > BUF_Z (XBUFFER (w->buffer))) - return; - - /* Make the window's buffer temporarily current for - overlays_at and compute_char_face. */ - obuf = current_buffer; - current_buffer = XBUFFER (w->buffer); - obegv = BEGV; - ozv = ZV; - BEGV = BEG; - ZV = Z; - - /* Is this char mouse-active or does it have help-echo? */ - XSETINT (position, pos); - - /* Put all the overlays we want in a vector in overlay_vec. */ - GET_OVERLAYS_AT (pos, overlay_vec, noverlays, NULL, 0); - /* Sort overlays into increasing priority order. */ - noverlays = sort_overlays (overlay_vec, noverlays, w); - - /* Check mouse-face highlighting. */ - if (! (EQ (window, dpyinfo->mouse_face_window) - && y >= dpyinfo->mouse_face_beg_row - && y <= dpyinfo->mouse_face_end_row - && (y > dpyinfo->mouse_face_beg_row - || x >= dpyinfo->mouse_face_beg_col) - && (y < dpyinfo->mouse_face_end_row - || x < dpyinfo->mouse_face_end_col - || dpyinfo->mouse_face_past_end))) - { - /* Clear the display of the old active region, if any. */ - clear_mouse_face (dpyinfo); - - /* Find highest priority overlay that has a mouse-face prop. */ - overlay = Qnil; - for (i = noverlays - 1; i >= 0; --i) - { - mouse_face = Foverlay_get (overlay_vec[i], Qmouse_face); - if (!NILP (mouse_face)) - { - overlay = overlay_vec[i]; - break; - } - } - - /* If no overlay applies, get a text property. */ - if (NILP (overlay)) - mouse_face = Fget_text_property (position, Qmouse_face, - w->buffer); - - /* Handle the overlay case. */ - if (! NILP (overlay)) - { - /* Find the range of text around this char that - should be active. */ - Lisp_Object before, after; - EMACS_INT ignore; - - before = Foverlay_start (overlay); - after = Foverlay_end (overlay); - /* Record this as the current active region. */ - fast_find_position (w, XFASTINT (before), - &dpyinfo->mouse_face_beg_col, - &dpyinfo->mouse_face_beg_row); - dpyinfo->mouse_face_past_end - = !fast_find_position (w, XFASTINT (after), - &dpyinfo->mouse_face_end_col, - &dpyinfo->mouse_face_end_row); - dpyinfo->mouse_face_window = window; - dpyinfo->mouse_face_face_id - = face_at_buffer_position (w, pos, 0, 0, - &ignore, pos + 1, - !dpyinfo->mouse_face_hidden, - -1); - - /* Display it as active. */ - show_mouse_face (dpyinfo, 1); - } - /* Handle the text property case. */ - else if (! NILP (mouse_face)) - { - /* Find the range of text around this char that - should be active. */ - Lisp_Object before, after, beginning, end; - EMACS_INT ignore; - - beginning = Fmarker_position (w->start); - XSETINT (end, (BUF_Z (XBUFFER (w->buffer)) - - XFASTINT (w->window_end_pos))); - before - = Fprevious_single_property_change (make_number (pos + 1), - Qmouse_face, - w->buffer, beginning); - after - = Fnext_single_property_change (position, Qmouse_face, - w->buffer, end); - /* Record this as the current active region. */ - fast_find_position (w, XFASTINT (before), - &dpyinfo->mouse_face_beg_col, - &dpyinfo->mouse_face_beg_row); - dpyinfo->mouse_face_past_end - = !fast_find_position (w, XFASTINT (after), - &dpyinfo->mouse_face_end_col, - &dpyinfo->mouse_face_end_row); - dpyinfo->mouse_face_window = window; - dpyinfo->mouse_face_face_id - = face_at_buffer_position (w, pos, 0, 0, - &ignore, pos + 1, - !dpyinfo->mouse_face_hidden, - -1); - - /* Display it as active. */ - show_mouse_face (dpyinfo, 1); - } - } - - /* Look for a `help-echo' property. */ - { - Lisp_Object help; - - /* Check overlays first. */ - help = Qnil; - for (i = noverlays - 1; i >= 0 && NILP (help); --i) - { - overlay = overlay_vec[i]; - help = Foverlay_get (overlay, Qhelp_echo); - } - - if (!NILP (help)) - { - help_echo_string = help; - help_echo_window = window; - help_echo_object = overlay; - help_echo_pos = pos; - } - /* Try text properties. */ - else if (NILP (help) - && ((STRINGP (glyph->object) - && glyph->charpos >= 0 - && glyph->charpos < SCHARS (glyph->object)) - || (BUFFERP (glyph->object) - && glyph->charpos >= BEGV - && glyph->charpos < ZV))) - { - help = Fget_text_property (make_number (glyph->charpos), - Qhelp_echo, glyph->object); - if (!NILP (help)) - { - help_echo_string = help; - help_echo_window = window; - help_echo_object = glyph->object; - help_echo_pos = glyph->charpos; - } - } - } - - BEGV = obegv; - ZV = ozv; - current_buffer = obuf; - } + Mouse_HLInfo *hlinfo = &tty->mouse_highlight; + + if (hl == DRAW_MOUSE_FACE) + { + int vpos = row->y + WINDOW_TOP_EDGE_Y (w); + int kstart = start_hpos + WINDOW_LEFT_EDGE_X (w); + int nglyphs = end_hpos - start_hpos; + int offset = ScreenPrimary + 2*(vpos*screen_size_X + kstart) + 1; + int start_offset = offset; + + if (tty->termscript) + fprintf (tty->termscript, "\n", + kstart, kstart + nglyphs - 1, vpos); + + mouse_off (); + IT_set_face (hlinfo->mouse_face_face_id); + /* Since we are going to change only the _colors_ of already + displayed text, there's no need to go through all the pain of + generating and encoding the text from the glyphs. Instead, + we simply poke the attribute byte of each affected position + in video memory with the colors computed by IT_set_face! */ + _farsetsel (_dos_ds); + while (nglyphs--) + { + _farnspokeb (offset, ScreenAttrib); + offset += 2; + } + if (screen_virtual_segment) + dosv_refresh_virtual_screen (start_offset, end_hpos - start_hpos); + mouse_on (); + } + else if (hl == DRAW_NORMAL_TEXT) + { + /* We are removing a previously-drawn mouse highlight. The + safest way to do so is to redraw the glyphs anew, since all + kinds of faces and display tables could have changed behind + our back. */ + int nglyphs = end_hpos - start_hpos; + int save_x = new_pos_X, save_y = new_pos_Y; + + if (end_hpos >= row->used[TEXT_AREA]) + nglyphs = row->used[TEXT_AREA] - start_hpos; + + /* IT_write_glyphs writes at cursor position, so we need to + temporarily move cursor coordinates to the beginning of + the highlight region. */ + new_pos_X = start_hpos + WINDOW_LEFT_EDGE_X (w); + new_pos_Y = row->y + WINDOW_TOP_EDGE_Y (w); + + if (tty->termscript) + fprintf (tty->termscript, "", + new_pos_X, new_pos_X + nglyphs - 1, new_pos_Y); + IT_write_glyphs (f, row->glyphs[TEXT_AREA] + start_hpos, nglyphs); + if (tty->termscript) + fputs ("\n", tty->termscript); + new_pos_X = save_x; + new_pos_Y = save_y; } } @@ -1689,7 +1217,8 @@ IT_update_begin (struct frame *f) { struct tty_display_info *display_info = FRAME_X_DISPLAY_INFO (f); - struct frame *mouse_face_frame = display_info->mouse_face_mouse_frame; + Mouse_HLInfo *hlinfo = &display_info->mouse_highlight; + struct frame *mouse_face_frame = hlinfo->mouse_face_mouse_frame; if (display_info->termscript) fprintf (display_info->termscript, "\n\nmouse_face_defer = 1; + hlinfo->mouse_face_defer = 1; /* If F needs to be redrawn, simply forget about any prior mouse highlighting. */ if (FRAME_GARBAGED_P (f)) - display_info->mouse_face_window = Qnil; + hlinfo->mouse_face_window = Qnil; /* Can we tell that this update does not affect the window where the mouse highlight is? If so, no need to turn off. Likewise, don't do anything if none of the enabled rows contains glyphs highlighted in mouse face. */ - if (!NILP (display_info->mouse_face_window) - && WINDOWP (display_info->mouse_face_window)) + if (!NILP (hlinfo->mouse_face_window) + && WINDOWP (hlinfo->mouse_face_window)) { - struct window *w = XWINDOW (display_info->mouse_face_window); + struct window *w = XWINDOW (hlinfo->mouse_face_window); int i; /* If the mouse highlight is in the window that was deleted (e.g., if it was popped by completion), clear highlight unconditionally. */ if (NILP (w->buffer)) - display_info->mouse_face_window = Qnil; + hlinfo->mouse_face_window = Qnil; else { for (i = 0; i < w->desired_matrix->nrows; ++i) @@ -1730,18 +1259,18 @@ } if (NILP (w->buffer) || i < w->desired_matrix->nrows) - clear_mouse_face (display_info); + clear_mouse_face (hlinfo); } } else if (mouse_face_frame && !FRAME_LIVE_P (mouse_face_frame)) { /* If the frame with mouse highlight was deleted, invalidate the highlight info. */ - display_info->mouse_face_beg_row = display_info->mouse_face_beg_col = -1; - display_info->mouse_face_end_row = display_info->mouse_face_end_col = -1; - display_info->mouse_face_window = Qnil; - display_info->mouse_face_deferred_gc = 0; - display_info->mouse_face_mouse_frame = NULL; + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_window = Qnil; + hlinfo->mouse_face_deferred_gc = 0; + hlinfo->mouse_face_mouse_frame = NULL; } UNBLOCK_INPUT; @@ -1754,25 +1283,25 @@ if (dpyinfo->termscript) fprintf (dpyinfo->termscript, "\nmouse_face_defer = 0; + dpyinfo->mouse_highlight.mouse_face_defer = 0; } static void IT_frame_up_to_date (struct frame *f) { - struct tty_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); Lisp_Object new_cursor, frame_desired_cursor; struct window *sw; - if (dpyinfo->mouse_face_deferred_gc - || (f && f == dpyinfo->mouse_face_mouse_frame)) + if (hlinfo->mouse_face_deferred_gc + || (f && f == hlinfo->mouse_face_mouse_frame)) { BLOCK_INPUT; - if (dpyinfo->mouse_face_mouse_frame) - IT_note_mouse_highlight (dpyinfo->mouse_face_mouse_frame, - dpyinfo->mouse_face_mouse_x, - dpyinfo->mouse_face_mouse_y); - dpyinfo->mouse_face_deferred_gc = 0; + if (hlinfo->mouse_face_mouse_frame) + note_mouse_highlight (hlinfo->mouse_face_mouse_frame, + hlinfo->mouse_face_mouse_x, + hlinfo->mouse_face_mouse_y); + hlinfo->mouse_face_deferred_gc = 0; UNBLOCK_INPUT; } @@ -2317,18 +1846,18 @@ if (colors[1] >= 0 && colors[1] < 16) FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = colors[1]; } - the_only_display_info.mouse_face_mouse_frame = NULL; - the_only_display_info.mouse_face_deferred_gc = 0; - the_only_display_info.mouse_face_beg_row = - the_only_display_info.mouse_face_beg_col = -1; - the_only_display_info.mouse_face_end_row = - the_only_display_info.mouse_face_end_col = -1; - the_only_display_info.mouse_face_face_id = DEFAULT_FACE_ID; - the_only_display_info.mouse_face_window = Qnil; - the_only_display_info.mouse_face_mouse_x = - the_only_display_info.mouse_face_mouse_y = 0; - the_only_display_info.mouse_face_defer = 0; - the_only_display_info.mouse_face_hidden = 0; + the_only_display_info.mouse_highlight.mouse_face_mouse_frame = NULL; + the_only_display_info.mouse_highlight.mouse_face_deferred_gc = 0; + the_only_display_info.mouse_highlight.mouse_face_beg_row = + the_only_display_info.mouse_highlight.mouse_face_beg_col = -1; + the_only_display_info.mouse_highlight.mouse_face_end_row = + the_only_display_info.mouse_highlight.mouse_face_end_col = -1; + the_only_display_info.mouse_highlight.mouse_face_face_id = DEFAULT_FACE_ID; + the_only_display_info.mouse_highlight.mouse_face_window = Qnil; + the_only_display_info.mouse_highlight.mouse_face_mouse_x = + the_only_display_info.mouse_highlight.mouse_face_mouse_y = 0; + the_only_display_info.mouse_highlight.mouse_face_defer = 0; + the_only_display_info.mouse_highlight.mouse_face_hidden = 0; if (have_mouse) /* detected in dos_ttraw, which see */ { @@ -2916,7 +2445,7 @@ { struct input_event event; union REGS regs; - struct tty_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (SELECTED_FRAME()); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (SELECTED_FRAME()); EVENT_INIT (event); #ifndef HAVE_X_WINDOWS @@ -3126,10 +2655,10 @@ if (code == 0) continue; - if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)) + if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)) { - clear_mouse_face (dpyinfo); - dpyinfo->mouse_face_hidden = 1; + clear_mouse_face (hlinfo); + hlinfo->mouse_face_hidden = 1; } if (code >= 0x100) @@ -3157,10 +2686,10 @@ might need to update mouse highlight. */ if (mouse_last_x != mouse_prev_x || mouse_last_y != mouse_prev_y) { - if (dpyinfo->mouse_face_hidden) + if (hlinfo->mouse_face_hidden) { - dpyinfo->mouse_face_hidden = 0; - clear_mouse_face (dpyinfo); + hlinfo->mouse_face_hidden = 0; + clear_mouse_face (hlinfo); } /* Generate SELECT_WINDOW_EVENTs when needed. */ @@ -3192,8 +2721,7 @@ previous_help_echo_string = help_echo_string; help_echo_string = help_echo_object = help_echo_window = Qnil; help_echo_pos = -1; - IT_note_mouse_highlight (SELECTED_FRAME(), - mouse_last_x, mouse_last_y); + note_mouse_highlight (SELECTED_FRAME(), mouse_last_x, mouse_last_y); /* If the contents of the global variable help_echo has changed, generate a HELP_EVENT. */ if (!NILP (help_echo_string) || !NILP (previous_help_echo_string)) === modified file 'src/msdos.h' --- src/msdos.h 2010-07-07 15:28:47 +0000 +++ src/msdos.h 2010-11-05 12:11:22 +0000 @@ -34,6 +34,7 @@ char *rootrelativepath (char *); void init_environment (int, char **, int); void internal_terminal_init (void); +void initialize_msdos_display (struct terminal *); extern int have_mouse; void mouse_init (void); === modified file 'src/nsterm.h' --- src/nsterm.h 2010-08-11 08:58:56 +0000 +++ src/nsterm.h 2010-10-31 18:50:02 +0000 @@ -492,21 +492,9 @@ /* The cursor to use for vertical scroll bars. */ Cursor vertical_scroll_bar_cursor; - /* most mouse face stuff moved in here as of 21+ (and reasonably so) */ - int mouse_face_beg_row, mouse_face_beg_col; - int mouse_face_end_row, mouse_face_end_col; - int mouse_face_beg_x, mouse_face_beg_y; - int mouse_face_end_x, mouse_face_end_y; - int mouse_face_past_end; - Lisp_Object mouse_face_window; - int mouse_face_face_id; - int mouse_face_deferred_gc; - Lisp_Object mouse_face_overlay; - FRAME_PTR mouse_face_mouse_frame; - int mouse_face_mouse_x, mouse_face_mouse_y; - int mouse_face_defer; - int mouse_face_hidden; - int mouse_face_image_state; + /* Information about the range of text currently shown in + mouse-face. */ + Mouse_HLInfo mouse_highlight; struct frame *x_highlight_frame; struct frame *x_focus_frame; === modified file 'src/nsterm.m' --- src/nsterm.m 2010-11-05 10:35:36 +0000 +++ src/nsterm.m 2010-11-06 08:28:31 +0000 @@ -553,7 +553,7 @@ -------------------------------------------------------------------------- */ { struct frame *f = XFRAME (WINDOW_FRAME (w)); - struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); NSTRACE (ns_update_window_begin); updated_window = w; @@ -561,15 +561,15 @@ BLOCK_INPUT; - if (f == dpyinfo->mouse_face_mouse_frame) + if (f == hlinfo->mouse_face_mouse_frame) { /* Don't do highlighting for mouse motion during the update. */ - dpyinfo->mouse_face_defer = 1; + hlinfo->mouse_face_defer = 1; /* If the frame needs to be redrawn, simply forget about any prior mouse highlighting. */ if (FRAME_GARBAGED_P (f)) - dpyinfo->mouse_face_window = Qnil; + hlinfo->mouse_face_window = Qnil; /* (further code for mouse faces ifdef'd out in other terms elided) */ } @@ -586,7 +586,7 @@ external (RIF) call; for one window called before update_end -------------------------------------------------------------------------- */ { - struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (XFRAME (w->frame)); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); /* note: this fn is nearly identical in all terms */ if (!w->pseudo_window_p) @@ -608,9 +608,9 @@ frame_up_to_date to redisplay the mouse highlight. */ if (mouse_face_overwritten_p) { - dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; - dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; - dpyinfo->mouse_face_window = Qnil; + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_window = Qnil; } updated_window = NULL; @@ -627,8 +627,8 @@ { NSView *view = FRAME_NS_VIEW (f); -/* if (f == FRAME_NS_DISPLAY_INFO (f)->mouse_face_mouse_frame) */ - FRAME_NS_DISPLAY_INFO (f)->mouse_face_defer = 0; +/* if (f == MOUSE_HL_INFO (f)->mouse_face_mouse_frame) */ + MOUSE_HL_INFO (f)->mouse_face_defer = 0; BLOCK_INPUT; @@ -1032,6 +1032,7 @@ { NSView *view = FRAME_NS_VIEW (f); struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); NSTRACE (x_destroy_window); check_ns (); @@ -1048,13 +1049,13 @@ dpyinfo->x_focus_frame = 0; if (f == dpyinfo->x_highlight_frame) dpyinfo->x_highlight_frame = 0; - if (f == dpyinfo->mouse_face_mouse_frame) + if (f == hlinfo->mouse_face_mouse_frame) { - dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; - dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; - dpyinfo->mouse_face_window = Qnil; - dpyinfo->mouse_face_deferred_gc = 0; - dpyinfo->mouse_face_mouse_frame = 0; + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_window = Qnil; + hlinfo->mouse_face_deferred_gc = 0; + hlinfo->mouse_face_mouse_frame = 0; } xfree (f->output_data.ns); @@ -1772,18 +1773,18 @@ if (FRAME_NS_P (f)) { - struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); - if ((dpyinfo->mouse_face_deferred_gc||f ==dpyinfo->mouse_face_mouse_frame) - /*&& dpyinfo->mouse_face_mouse_frame*/) + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); + if ((hlinfo->mouse_face_deferred_gc || f ==hlinfo->mouse_face_mouse_frame) + /*&& hlinfo->mouse_face_mouse_frame*/) { BLOCK_INPUT; - ns_update_begin(f); - if (dpyinfo->mouse_face_mouse_frame) - note_mouse_highlight (dpyinfo->mouse_face_mouse_frame, - dpyinfo->mouse_face_mouse_x, - dpyinfo->mouse_face_mouse_y); - dpyinfo->mouse_face_deferred_gc = 0; - ns_update_end(f); + ns_update_begin(f); + if (hlinfo->mouse_face_mouse_frame) + note_mouse_highlight (hlinfo->mouse_face_mouse_frame, + hlinfo->mouse_face_mouse_x, + hlinfo->mouse_face_mouse_y); + hlinfo->mouse_face_deferred_gc = 0; + ns_update_end(f); UNBLOCK_INPUT; } } @@ -2595,8 +2596,7 @@ if (s->hl == DRAW_MOUSE_FACE) { - face = FACE_FROM_ID - (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id); + face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id); if (!face) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); } @@ -2663,8 +2663,8 @@ struct face *face; if (s->hl == DRAW_MOUSE_FACE) { - face = FACE_FROM_ID - (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id); + face = FACE_FROM_ID (s->f, + MOUSE_HL_INFO (s->f)->mouse_face_face_id); if (!face) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); } @@ -2749,8 +2749,7 @@ with its background color), we must clear just the image area. */ if (s->hl == DRAW_MOUSE_FACE) { - face = FACE_FROM_ID - (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id); + face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id); if (!face) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); } @@ -2873,8 +2872,7 @@ if (s->hl == DRAW_MOUSE_FACE) { - face = FACE_FROM_ID - (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id); + face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id); if (!face) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); } @@ -3545,6 +3543,7 @@ { NSScreen *screen = [NSScreen mainScreen]; NSWindowDepth depth = [screen depth]; + Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; dpyinfo->resx = 72.27; /* used 75.0, but this makes pt == pixel, expected */ dpyinfo->resy = 72.27; @@ -3559,16 +3558,16 @@ dpyinfo->color_table->colors = NULL; dpyinfo->root_window = 42; /* a placeholder.. */ - dpyinfo->mouse_face_mouse_frame = NULL; - dpyinfo->mouse_face_deferred_gc = 0; - dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; - dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; - dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID; - dpyinfo->mouse_face_window = dpyinfo->mouse_face_overlay = Qnil; - dpyinfo->mouse_face_hidden = 0; + hlinfo->mouse_face_mouse_frame = NULL; + hlinfo->mouse_face_deferred_gc = 0; + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_face_id = DEFAULT_FACE_ID; + hlinfo->mouse_face_window = hlinfo->mouse_face_overlay = Qnil; + hlinfo->mouse_face_hidden = 0; - dpyinfo->mouse_face_mouse_x = dpyinfo->mouse_face_mouse_y = 0; - dpyinfo->mouse_face_defer = 0; + hlinfo->mouse_face_mouse_x = hlinfo->mouse_face_mouse_y = 0; + hlinfo->mouse_face_defer = 0; dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame = NULL; @@ -4351,7 +4350,7 @@ - (void)keyDown: (NSEvent *)theEvent { - struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (emacsframe); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (emacsframe); int code; unsigned fnKeysym = 0; int flags; @@ -4389,10 +4388,10 @@ [NSCursor setHiddenUntilMouseMoves: YES]; - if (dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)) + if (hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)) { - clear_mouse_face (dpyinfo); - dpyinfo->mouse_face_hidden = 1; + clear_mouse_face (hlinfo); + hlinfo->mouse_face_hidden = 1; } if (!processingCompose) @@ -4829,7 +4828,7 @@ /* Tell emacs the mouse has moved. */ - (void)mouseMoved: (NSEvent *)e { - struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (emacsframe); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (emacsframe); Lisp_Object frame; // NSTRACE (mouseMoved); @@ -4839,10 +4838,10 @@ = [self convertPoint: [e locationInWindow] fromView: nil]; /* update any mouse face */ - if (dpyinfo->mouse_face_hidden) + if (hlinfo->mouse_face_hidden) { - dpyinfo->mouse_face_hidden = 0; - clear_mouse_face (dpyinfo); + hlinfo->mouse_face_hidden = 0; + clear_mouse_face (hlinfo); } /* tooltip handling */ @@ -5308,20 +5307,19 @@ { NSPoint p = [self convertPoint: [theEvent locationInWindow] fromView: nil]; NSRect r; - struct ns_display_info *dpyinfo - = emacsframe ? FRAME_NS_DISPLAY_INFO (emacsframe) : NULL; + Mouse_HLInfo *hlinfo = emacsframe ? MOUSE_HL_INFO (emacsframe) : NULL; NSTRACE (mouseExited); - if (!dpyinfo) + if (!hlinfo) return; last_mouse_movement_time = EV_TIMESTAMP (theEvent); - if (emacsframe == dpyinfo->mouse_face_mouse_frame) + if (emacsframe == hlinfo->mouse_face_mouse_frame) { - clear_mouse_face (dpyinfo); - dpyinfo->mouse_face_mouse_frame = 0; + clear_mouse_face (hlinfo); + hlinfo->mouse_face_mouse_frame = 0; } } === modified file 'src/term.c' --- src/term.c 2010-11-05 17:52:06 +0000 +++ src/term.c 2010-11-06 08:28:31 +0000 @@ -184,24 +184,10 @@ #ifdef HAVE_GPM #include -static void term_clear_mouse_face (void); -static void term_mouse_highlight (struct frame *f, int x, int y); - /* The device for which we have enabled gpm support (or NULL). */ struct tty_display_info *gpm_tty = NULL; -/* These variables describe the range of text currently shown in its - mouse-face, together with the window they apply to. As long as - the mouse stays within this range, we need not redraw anything on - its account. Rows and columns are glyph matrix positions in - MOUSE_FACE_WINDOW. */ -static int mouse_face_beg_row, mouse_face_beg_col; -static int mouse_face_end_row, mouse_face_end_col; -static int mouse_face_past_end; -static Lisp_Object mouse_face_window; -static int mouse_face_face_id; - -static int pos_x, pos_y; +/* Last recorded mouse coordinates. */ static int last_mouse_x, last_mouse_y; #endif /* HAVE_GPM */ @@ -2686,416 +2672,36 @@ last_mouse_y = y; */ } -static void -term_show_mouse_face (enum draw_glyphs_face draw) +/* Implementation of draw_row_with_mouse_face for TTY/GPM. */ +void +tty_draw_row_with_mouse_face (struct window *w, struct glyph_row *row, + int start_hpos, int end_hpos, + enum draw_glyphs_face draw) { - struct window *w = XWINDOW (mouse_face_window); - int save_x, save_y; - int i; - - struct frame *f = XFRAME (w->frame); + int nglyphs = end_hpos - start_hpos; + struct frame *f = XFRAME (WINDOW_FRAME (w)); struct tty_display_info *tty = FRAME_TTY (f); - - if (/* If window is in the process of being destroyed, don't bother - to do anything. */ - w->current_matrix != NULL - /* Recognize when we are called to operate on rows that don't exist - anymore. This can happen when a window is split. */ - && mouse_face_end_row < w->current_matrix->nrows) - { - /* write_glyphs writes at cursor position, so we need to - temporarily move cursor coordinates to the beginning of - the highlight region. */ - - /* Save current cursor co-ordinates */ - save_y = curY (tty); - save_x = curX (tty); - - /* Note that mouse_face_beg_row etc. are window relative. */ - for (i = mouse_face_beg_row; i <= mouse_face_end_row; i++) - { - int start_hpos, end_hpos, nglyphs; - struct glyph_row *row = MATRIX_ROW (w->current_matrix, i); - - /* Don't do anything if row doesn't have valid contents. */ - if (!row->enabled_p) - continue; - - /* For all but the first row, the highlight starts at column 0. */ - if (i == mouse_face_beg_row) - start_hpos = mouse_face_beg_col; - else - start_hpos = 0; - - if (i == mouse_face_end_row) - end_hpos = mouse_face_end_col; - else - { - end_hpos = row->used[TEXT_AREA]; - if (draw == DRAW_NORMAL_TEXT) - row->fill_line_p = 1; /* Clear to end of line */ - } - - if (end_hpos <= start_hpos) - continue; - /* Record that some glyphs of this row are displayed in - mouse-face. */ - row->mouse_face_p = draw > 0; - - nglyphs = end_hpos - start_hpos; - - if (end_hpos >= row->used[TEXT_AREA]) - nglyphs = row->used[TEXT_AREA] - start_hpos; - - pos_y = row->y + WINDOW_TOP_EDGE_Y (w); - pos_x = row->used[LEFT_MARGIN_AREA] + start_hpos - + WINDOW_LEFT_EDGE_X (w); - - cursor_to (f, pos_y, pos_x); - - if (draw == DRAW_MOUSE_FACE) - { - tty_write_glyphs_with_face (f, row->glyphs[TEXT_AREA] + start_hpos, - nglyphs, mouse_face_face_id); - } - else /* draw == DRAW_NORMAL_TEXT */ - write_glyphs (f, row->glyphs[TEXT_AREA] + start_hpos, nglyphs); - } - cursor_to (f, save_y, save_x); - } -} - -static void -term_clear_mouse_face (void) -{ - if (!NILP (mouse_face_window)) - term_show_mouse_face (DRAW_NORMAL_TEXT); - - mouse_face_beg_row = mouse_face_beg_col = -1; - mouse_face_end_row = mouse_face_end_col = -1; - mouse_face_window = Qnil; -} - -/* Find the glyph matrix position of buffer position POS in window W. - *HPOS and *VPOS are set to the positions found. W's current glyphs - must be up to date. If POS is above window start return (0, 0). - If POS is after end of W, return end of last line in W. - - taken from msdos.c */ -static int -fast_find_position (struct window *w, EMACS_INT pos, int *hpos, int *vpos) -{ - int i, lastcol, maybe_next_line_p = 0; - EMACS_INT line_start_position; - int yb = window_text_bottom_y (w); - struct glyph_row *row = MATRIX_ROW (w->current_matrix, 0), *best_row = row; - - while (row->y < yb) - { - if (row->used[TEXT_AREA]) - line_start_position = row->glyphs[TEXT_AREA]->charpos; - else - line_start_position = 0; - - if (line_start_position > pos) - break; - /* If the position sought is the end of the buffer, - don't include the blank lines at the bottom of the window. */ - else if (line_start_position == pos - && pos == BUF_ZV (XBUFFER (w->buffer))) - { - maybe_next_line_p = 1; - break; - } - else if (line_start_position > 0) - best_row = row; - - /* Don't overstep the last matrix row, lest we get into the - never-never land... */ - if (row->y + 1 >= yb) - break; - - ++row; - } - - /* Find the right column within BEST_ROW. */ - lastcol = 0; - row = best_row; - for (i = 0; i < row->used[TEXT_AREA]; i++) - { - struct glyph *glyph = row->glyphs[TEXT_AREA] + i; - EMACS_INT charpos; - - charpos = glyph->charpos; - if (charpos == pos) - { - *hpos = i; - *vpos = row->y; - return 1; - } - else if (charpos > pos) - break; - else if (charpos > 0) - lastcol = i; - } - - /* If we're looking for the end of the buffer, - and we didn't find it in the line we scanned, - use the start of the following line. */ - if (maybe_next_line_p) - { - ++row; - lastcol = 0; - } - - *vpos = row->y; - *hpos = lastcol + 1; - return 0; -} - -static void -term_mouse_highlight (struct frame *f, int x, int y) -{ - enum window_part part; - Lisp_Object window; - struct window *w; - struct buffer *b; - - if (NILP (Vmouse_highlight) - || !f->glyphs_initialized_p) - return; - - /* Which window is that in? */ - window = window_from_coordinates (f, x, y, &part, &x, &y, 0); - - /* Not on a window -> return. */ - if (!WINDOWP (window)) - return; - - if (!EQ (window, mouse_face_window)) - term_clear_mouse_face (); - - w = XWINDOW (window); - - /* Are we in a window whose display is up to date? - And verify the buffer's text has not changed. */ - b = XBUFFER (w->buffer); - if (part == ON_TEXT - && EQ (w->window_end_valid, w->buffer) - && XFASTINT (w->last_modified) == BUF_MODIFF (b) - && XFASTINT (w->last_overlay_modified) == BUF_OVERLAY_MODIFF (b)) - { - int i, nrows = w->current_matrix->nrows; - EMACS_INT pos; - struct glyph_row *row; - struct glyph *glyph; - - /* Find the glyph under X/Y. */ - glyph = NULL; - if (y >= 0 && y < nrows) - { - row = MATRIX_ROW (w->current_matrix, y); - /* Give up if some row before the one we are looking for is - not enabled. */ - for (i = 0; i <= y; i++) - if (!MATRIX_ROW (w->current_matrix, i)->enabled_p) - break; - if (i > y /* all rows upto and including the one at Y are enabled */ - && row->displays_text_p - && x < window_box_width (w, TEXT_AREA)) - { - glyph = row->glyphs[TEXT_AREA]; - if (x >= row->used[TEXT_AREA]) - glyph = NULL; - else - { - glyph += x; - if (!BUFFERP (glyph->object)) - glyph = NULL; - } - } - } - - /* Clear mouse face if X/Y not over text. */ - if (glyph == NULL) - { - term_clear_mouse_face (); - return; - } - - if (!BUFFERP (glyph->object)) - abort (); - pos = glyph->charpos; - - /* Check for mouse-face. */ - { - Lisp_Object mouse_face, overlay, position, *overlay_vec; - int noverlays; - EMACS_INT obegv, ozv; - struct buffer *obuf; - - /* If we get an out-of-range value, return now; avoid an error. */ - if (pos > BUF_Z (b)) - return; - - /* Make the window's buffer temporarily current for - overlays_at and compute_char_face. */ - obuf = current_buffer; - current_buffer = b; - obegv = BEGV; - ozv = ZV; - BEGV = BEG; - ZV = Z; - - /* Is this char mouse-active? */ - XSETINT (position, pos); - - /* Put all the overlays we want in a vector in overlay_vec. */ - GET_OVERLAYS_AT (pos, overlay_vec, noverlays, NULL, 0); - /* Sort overlays into increasing priority order. */ - noverlays = sort_overlays (overlay_vec, noverlays, w); - - /* Check mouse-face highlighting. */ - if (!(EQ (window, mouse_face_window) - && y >= mouse_face_beg_row - && y <= mouse_face_end_row - && (y > mouse_face_beg_row - || x >= mouse_face_beg_col) - && (y < mouse_face_end_row - || x < mouse_face_end_col - || mouse_face_past_end))) - { - /* Clear the display of the old active region, if any. */ - term_clear_mouse_face (); - - /* Find the highest priority overlay that has a mouse-face - property. */ - overlay = Qnil; - for (i = noverlays - 1; i >= 0; --i) - { - mouse_face = Foverlay_get (overlay_vec[i], Qmouse_face); - if (!NILP (mouse_face)) - { - overlay = overlay_vec[i]; - break; - } - } - - /* If no overlay applies, get a text property. */ - if (NILP (overlay)) - mouse_face = Fget_text_property (position, Qmouse_face, - w->buffer); - - /* Handle the overlay case. */ - if (!NILP (overlay)) - { - /* Find the range of text around this char that - should be active. */ - Lisp_Object before, after; - EMACS_INT ignore; - - - before = Foverlay_start (overlay); - after = Foverlay_end (overlay); - /* Record this as the current active region. */ - fast_find_position (w, XFASTINT (before), - &mouse_face_beg_col, - &mouse_face_beg_row); - - mouse_face_past_end - = !fast_find_position (w, XFASTINT (after), - &mouse_face_end_col, - &mouse_face_end_row); - mouse_face_window = window; - - mouse_face_face_id - = face_at_buffer_position (w, pos, 0, 0, - &ignore, pos + 1, 1, -1); - - /* Display it as active. */ - term_show_mouse_face (DRAW_MOUSE_FACE); - } - /* Handle the text property case. */ - else if (!NILP (mouse_face)) - { - /* Find the range of text around this char that - should be active. */ - Lisp_Object before, after, beginning, end; - EMACS_INT ignore; - - beginning = Fmarker_position (w->start); - XSETINT (end, (BUF_Z (b) - XFASTINT (w->window_end_pos))); - before - = Fprevious_single_property_change (make_number (pos + 1), - Qmouse_face, - w->buffer, beginning); - after - = Fnext_single_property_change (position, Qmouse_face, - w->buffer, end); - - /* Record this as the current active region. */ - fast_find_position (w, XFASTINT (before), - &mouse_face_beg_col, - &mouse_face_beg_row); - mouse_face_past_end - = !fast_find_position (w, XFASTINT (after), - &mouse_face_end_col, - &mouse_face_end_row); - mouse_face_window = window; - - mouse_face_face_id - = face_at_buffer_position (w, pos, 0, 0, - &ignore, pos + 1, 1, -1); - - /* Display it as active. */ - term_show_mouse_face (DRAW_MOUSE_FACE); - } - } - - /* Look for a `help-echo' property. */ - { - Lisp_Object help; - - /* Check overlays first. */ - help = Qnil; - for (i = noverlays - 1; i >= 0 && NILP (help); --i) - { - overlay = overlay_vec[i]; - help = Foverlay_get (overlay, Qhelp_echo); - } - - if (!NILP (help)) - { - help_echo_string = help; - help_echo_window = window; - help_echo_object = overlay; - help_echo_pos = pos; - } - /* Try text properties. */ - else if (NILP (help) - && ((STRINGP (glyph->object) - && glyph->charpos >= 0 - && glyph->charpos < SCHARS (glyph->object)) - || (BUFFERP (glyph->object) - && glyph->charpos >= BEGV - && glyph->charpos < ZV))) - { - help = Fget_text_property (make_number (glyph->charpos), - Qhelp_echo, glyph->object); - if (!NILP (help)) - { - help_echo_string = help; - help_echo_window = window; - help_echo_object = glyph->object; - help_echo_pos = glyph->charpos; - } - } - } - - BEGV = obegv; - ZV = ozv; - current_buffer = obuf; - } - } + int face_id = tty->mouse_highlight.mouse_face_face_id; + int save_x, save_y, pos_x, pos_y; + + if (end_hpos >= row->used[TEXT_AREA]) + nglyphs = row->used[TEXT_AREA] - start_hpos; + + pos_y = row->y + WINDOW_TOP_EDGE_Y (w); + pos_x = row->used[LEFT_MARGIN_AREA] + start_hpos + WINDOW_LEFT_EDGE_X (w); + + /* Save current cursor co-ordinates. */ + save_y = curY (tty); + save_x = curX (tty); + cursor_to (f, pos_y, pos_x); + + if (draw == DRAW_MOUSE_FACE) + tty_write_glyphs_with_face (f, row->glyphs[TEXT_AREA] + start_hpos, + nglyphs, face_id); + else if (draw == DRAW_NORMAL_TEXT) + write_glyphs (f, row->glyphs[TEXT_AREA] + start_hpos, nglyphs); + + cursor_to (f, save_y, save_x); } static int @@ -3105,7 +2711,7 @@ if (event->x != last_mouse_x || event->y != last_mouse_y) { frame->mouse_moved = 1; - term_mouse_highlight (frame, event->x, event->y); + note_mouse_highlight (frame, event->x, event->y); /* Remember which glyph we're now on. */ last_mouse_x = event->x; last_mouse_y = event->y; @@ -3576,7 +3182,7 @@ #ifdef HAVE_GPM terminal->mouse_position_hook = term_mouse_position; - mouse_face_window = Qnil; + tty->mouse_highlight.mouse_face_window = Qnil; #endif @@ -4211,8 +3817,6 @@ #ifdef HAVE_GPM defsubr (&Sgpm_mouse_start); defsubr (&Sgpm_mouse_stop); - - staticpro (&mouse_face_window); #endif /* HAVE_GPM */ #ifndef DOS_NT === modified file 'src/termchar.h' --- src/termchar.h 2010-01-13 08:35:10 +0000 +++ src/termchar.h 2010-10-31 18:50:02 +0000 @@ -34,18 +34,18 @@ struct tty_display_info { struct tty_display_info *next; /* Chain of all tty devices. */ - + char *name; /* The name of the device file or 0 if stdin/stdout. */ char *type; /* The type of the tty. */ - + /* Input/output */ - + FILE *input; /* The stream to be used for terminal input. NULL if the terminal is suspended. */ FILE *output; /* The stream to be used for terminal output. NULL if the terminal is suspended. */ - + FILE *termscript; /* If nonzero, send all terminal output characters to this stream also. */ @@ -65,38 +65,14 @@ /* Redisplay. */ Lisp_Object top_frame; /* The topmost frame on this tty. */ - + /* The previous frame we displayed on this tty. */ struct frame *previous_frame; int previous_color_mode; -#ifdef MSDOS - /* These variables describe the range of text currently shown in its - mouse-face, together with the window they apply to. As long as - the mouse stays within this range, we need not redraw anything on - its account. Rows and columns are glyph matrix positions in - MOUSE_FACE_WINDOW. */ - int mouse_face_beg_row, mouse_face_beg_col; - int mouse_face_end_row, mouse_face_end_col; - int mouse_face_past_end; - Lisp_Object mouse_face_window; - int mouse_face_face_id; - - /* 1 if a mouse motion event came and we didn't handle it right away because - gc was in progress. */ - int mouse_face_deferred_gc; - - /* FRAME and X, Y position of mouse when last checked for - highlighting. X and Y can be negative or out of range for the frame. */ - struct frame *mouse_face_mouse_frame; - int mouse_face_mouse_x, mouse_face_mouse_y; - - /* Nonzero means defer mouse-motion highlighting. */ - int mouse_face_defer; - - /* Nonzero means that the mouse highlight should not be shown. */ - int mouse_face_hidden; -#endif /* !MSDOS */ + /* Information about the range of text currently shown in + mouse-face. */ + Mouse_HLInfo mouse_highlight; /* Buffer used internally by termcap (see tgetent in the Termcap manual). Only init_tty and delete_tty should change this. */ @@ -190,12 +166,12 @@ int RPov; /* # chars to start a TS_repeat */ int delete_in_insert_mode; /* delete mode == insert mode */ - + int se_is_so; /* 1 if same string both enters and leaves standout mode */ - + int costs_set; /* Nonzero if costs have been calculated. */ - + int insert_mode; /* Nonzero when in insert mode. */ int standout_mode; /* Nonzero when in standout mode. */ @@ -214,7 +190,7 @@ lines from those operations. */ int specified_window; - + /* Flag used in tty_show/hide_cursor. */ int cursor_hidden; === modified file 'src/w32term.c' --- src/w32term.c 2010-11-01 07:35:04 +0000 +++ src/w32term.c 2010-11-06 08:28:31 +0000 @@ -505,7 +505,7 @@ x_update_window_begin (struct window *w) { struct frame *f = XFRAME (WINDOW_FRAME (w)); - struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); /* Hide the system caret during an update. */ if (w32_use_visible_system_caret && w32_system_caret_hwnd) @@ -518,15 +518,15 @@ BLOCK_INPUT; - if (f == display_info->mouse_face_mouse_frame) + if (f == hlinfo->mouse_face_mouse_frame) { /* Don't do highlighting for mouse motion during the update. */ - display_info->mouse_face_defer = 1; + hlinfo->mouse_face_defer = 1; /* If F needs to be redrawn, simply forget about any prior mouse highlighting. */ if (FRAME_GARBAGED_P (f)) - display_info->mouse_face_window = Qnil; + hlinfo->mouse_face_window = Qnil; #if 0 /* Rows in a current matrix containing glyphs in mouse-face have their mouse_face_p flag set, which means that they are always @@ -540,8 +540,8 @@ Likewise, don't do anything if the frame is garbaged; in that case, the frame's current matrix that we would use is all wrong, and we will redisplay that line anyway. */ - if (!NILP (display_info->mouse_face_window) - && w == XWINDOW (display_info->mouse_face_window)) + if (!NILP (hlinfo->mouse_face_window) + && w == XWINDOW (hlinfo->mouse_face_window)) { int i; @@ -550,7 +550,7 @@ break; if (i < w->desired_matrix->nrows) - clear_mouse_face (display_info); + clear_mouse_face (hlinfo); } #endif /* 0 */ } @@ -601,7 +601,7 @@ x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p) { - struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (XFRAME (w->frame)); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); if (!w->pseudo_window_p) { @@ -622,9 +622,9 @@ XTframe_up_to_date to redisplay the mouse highlight. */ if (mouse_face_overwritten_p) { - dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; - dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; - dpyinfo->mouse_face_window = Qnil; + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_window = Qnil; } /* Unhide the caret. This won't actually show the cursor, unless it @@ -649,7 +649,7 @@ return; /* Mouse highlight may be displayed again. */ - FRAME_W32_DISPLAY_INFO (f)->mouse_face_defer = 0; + MOUSE_HL_INFO (f)->mouse_face_defer = 0; } @@ -662,17 +662,17 @@ { if (FRAME_W32_P (f)) { - struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); - if (dpyinfo->mouse_face_deferred_gc - || f == dpyinfo->mouse_face_mouse_frame) + if (hlinfo->mouse_face_deferred_gc + || f == hlinfo->mouse_face_mouse_frame) { BLOCK_INPUT; - if (dpyinfo->mouse_face_mouse_frame) - note_mouse_highlight (dpyinfo->mouse_face_mouse_frame, - dpyinfo->mouse_face_mouse_x, - dpyinfo->mouse_face_mouse_y); - dpyinfo->mouse_face_deferred_gc = 0; + if (hlinfo->mouse_face_mouse_frame) + note_mouse_highlight (hlinfo->mouse_face_mouse_frame, + hlinfo->mouse_face_mouse_x, + hlinfo->mouse_face_mouse_y); + hlinfo->mouse_face_deferred_gc = 0; UNBLOCK_INPUT; } } @@ -999,7 +999,7 @@ struct face *face; /* What face has to be used last for the mouse face? */ - face_id = FRAME_W32_DISPLAY_INFO (s->f)->mouse_face_face_id; + face_id = MOUSE_HL_INFO (s->f)->mouse_face_face_id; face = FACE_FROM_ID (s->f, face_id); if (face == NULL) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); @@ -4060,6 +4060,7 @@ W32Msg msg; struct frame *f; struct w32_display_info *dpyinfo = &one_w32_display_info; + Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; if (interrupt_input_blocked) { @@ -4160,11 +4161,11 @@ if (f && !f->iconified) { - if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) - && !EQ (f->tool_bar_window, dpyinfo->mouse_face_window)) + if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) + && !EQ (f->tool_bar_window, hlinfo->mouse_face_window)) { - clear_mouse_face (dpyinfo); - dpyinfo->mouse_face_hidden = 1; + clear_mouse_face (hlinfo); + hlinfo->mouse_face_hidden = 1; } if (temp_index == sizeof temp_buffer / sizeof (short)) @@ -4185,11 +4186,11 @@ if (f && !f->iconified) { - if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) - && !EQ (f->tool_bar_window, dpyinfo->mouse_face_window)) + if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) + && !EQ (f->tool_bar_window, hlinfo->mouse_face_window)) { - clear_mouse_face (dpyinfo); - dpyinfo->mouse_face_hidden = 1; + clear_mouse_face (hlinfo); + hlinfo->mouse_face_hidden = 1; } if (temp_index == sizeof temp_buffer / sizeof (short)) @@ -4263,11 +4264,11 @@ if (f && !f->iconified) { - if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) - && !EQ (f->tool_bar_window, dpyinfo->mouse_face_window)) + if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) + && !EQ (f->tool_bar_window, hlinfo->mouse_face_window)) { - clear_mouse_face (dpyinfo); - dpyinfo->mouse_face_hidden = 1; + clear_mouse_face (hlinfo); + hlinfo->mouse_face_hidden = 1; } if (temp_index == sizeof temp_buffer / sizeof (short)) @@ -4301,10 +4302,10 @@ else f = x_window_to_frame (dpyinfo, msg.msg.hwnd); - if (dpyinfo->mouse_face_hidden) + if (hlinfo->mouse_face_hidden) { - dpyinfo->mouse_face_hidden = 0; - clear_mouse_face (dpyinfo); + hlinfo->mouse_face_hidden = 0; + clear_mouse_face (hlinfo); } if (f) @@ -4345,7 +4346,7 @@ { /* If we move outside the frame, then we're certainly no longer on any text in the frame. */ - clear_mouse_face (dpyinfo); + clear_mouse_face (hlinfo); } /* If the contents of the global variable help_echo_string @@ -4634,12 +4635,12 @@ f = x_any_window_to_frame (dpyinfo, msg.msg.hwnd); if (f) { - if (f == dpyinfo->mouse_face_mouse_frame) + if (f == hlinfo->mouse_face_mouse_frame) { /* If we move outside the frame, then we're certainly no longer on any text in the frame. */ - clear_mouse_face (dpyinfo); - dpyinfo->mouse_face_mouse_frame = 0; + clear_mouse_face (hlinfo); + hlinfo->mouse_face_mouse_frame = 0; } /* Generate a nil HELP_EVENT to cancel a help-echo. @@ -4669,12 +4670,12 @@ if (f == dpyinfo->w32_focus_frame) x_new_focus_frame (dpyinfo, 0); - if (f == dpyinfo->mouse_face_mouse_frame) + if (f == hlinfo->mouse_face_mouse_frame) { /* If we move outside the frame, then we're certainly no longer on any text in the frame. */ - clear_mouse_face (dpyinfo); - dpyinfo->mouse_face_mouse_frame = 0; + clear_mouse_face (hlinfo); + hlinfo->mouse_face_mouse_frame = 0; } /* Generate a nil HELP_EVENT to cancel a help-echo. @@ -5822,6 +5823,7 @@ x_free_frame_resources (struct frame *f) { struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); BLOCK_INPUT; @@ -5860,15 +5862,15 @@ if (f == dpyinfo->x_highlight_frame) dpyinfo->x_highlight_frame = 0; - if (f == dpyinfo->mouse_face_mouse_frame) + if (f == hlinfo->mouse_face_mouse_frame) { - dpyinfo->mouse_face_beg_row - = dpyinfo->mouse_face_beg_col = -1; - dpyinfo->mouse_face_end_row - = dpyinfo->mouse_face_end_col = -1; - dpyinfo->mouse_face_window = Qnil; - dpyinfo->mouse_face_deferred_gc = 0; - dpyinfo->mouse_face_mouse_frame = 0; + hlinfo->mouse_face_beg_row + = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row + = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_window = Qnil; + hlinfo->mouse_face_deferred_gc = 0; + hlinfo->mouse_face_mouse_frame = 0; } UNBLOCK_INPUT; @@ -5934,6 +5936,7 @@ w32_initialize_display_info (Lisp_Object display_name) { struct w32_display_info *dpyinfo = &one_w32_display_info; + Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; memset (dpyinfo, 0, sizeof (*dpyinfo)); @@ -5959,12 +5962,12 @@ dpyinfo->smallest_font_height = 1; dpyinfo->smallest_char_width = 1; - dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; - dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; - dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID; - dpyinfo->mouse_face_window = Qnil; - dpyinfo->mouse_face_overlay = Qnil; - dpyinfo->mouse_face_hidden = 0; + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_face_id = DEFAULT_FACE_ID; + hlinfo->mouse_face_window = Qnil; + hlinfo->mouse_face_overlay = Qnil; + hlinfo->mouse_face_hidden = 0; dpyinfo->vertical_scroll_bar_cursor = w32_load_cursor (IDC_ARROW); /* TODO: dpyinfo->gray */ === modified file 'src/w32term.h' --- src/w32term.h 2010-07-25 00:20:51 +0000 +++ src/w32term.h 2010-10-31 18:50:02 +0000 @@ -143,36 +143,9 @@ /* Reusable Graphics Context for drawing a cursor in a non-default face. */ XGCValues *scratch_cursor_gc; - /* These variables describe the range of text currently shown in its - mouse-face, together with the window they apply to. As long as - the mouse stays within this range, we need not redraw anything on - its account. Rows and columns are glyph matrix positions in - MOUSE_FACE_WINDOW. */ - int mouse_face_beg_row, mouse_face_beg_col; - int mouse_face_beg_x, mouse_face_beg_y; - int mouse_face_end_row, mouse_face_end_col; - int mouse_face_end_x, mouse_face_end_y; - int mouse_face_past_end; - Lisp_Object mouse_face_window; - int mouse_face_face_id; - Lisp_Object mouse_face_overlay; - - /* 1 if a mouse motion event came and we didn't handle it right away because - gc was in progress. */ - int mouse_face_deferred_gc; - - /* FRAME and X, Y position of mouse when last checked for - highlighting. X and Y can be negative or out of range for the frame. */ - struct frame *mouse_face_mouse_frame; - int mouse_face_mouse_x, mouse_face_mouse_y; - - /* Nonzero means defer mouse-motion highlighting. */ - int mouse_face_defer; - - /* Nonzero means that the mouse highlight should not be shown. */ - int mouse_face_hidden; - - int mouse_face_image_state; + /* Information about the range of text currently shown in + mouse-face. */ + Mouse_HLInfo mouse_highlight; char *w32_id_name; === modified file 'src/xdisp.c' --- src/xdisp.c 2010-11-01 04:09:26 +0000 +++ src/xdisp.c 2010-11-06 08:28:31 +0000 @@ -888,6 +888,9 @@ #ifdef HAVE_WINDOW_SYSTEM #define CLEAR_IMAGE_CACHE_COUNT 101 static int clear_image_cache_count; + +/* Null glyph slice */ +static struct glyph_slice null_glyph_slice = { 0, 0, 0, 0 }; #endif /* Non-zero while redisplay_internal is in progress. */ @@ -913,10 +916,6 @@ Lisp_Object previous_help_echo_string; -/* Null glyph slice */ - -static struct glyph_slice null_glyph_slice = { 0, 0, 0, 0 }; - /* Platform-independent portion of hourglass implementation. */ /* Non-zero means we're allowed to display a hourglass pointer. */ @@ -975,10 +974,8 @@ EMACS_INT, EMACS_INT); static void store_mode_line_noprop_char (char); static int store_mode_line_noprop (const unsigned char *, int, int); -static void x_consider_frame_title (Lisp_Object); static void handle_stop (struct it *); static void handle_stop_backwards (struct it *, EMACS_INT); -static int tool_bar_lines_needed (struct frame *, int *); static int single_display_spec_intangible_p (Lisp_Object); static void ensure_echo_area_buffers (void); static Lisp_Object unwind_with_echo_area_buffer (Lisp_Object); @@ -1091,6 +1088,8 @@ #ifdef HAVE_WINDOW_SYSTEM +static void x_consider_frame_title (Lisp_Object); +static int tool_bar_lines_needed (struct frame *, int *); static void update_tool_bar (struct frame *, int); static void build_desired_tool_bar_string (struct frame *f); static int redisplay_tool_bar (struct frame *); @@ -1100,12 +1099,13 @@ int, int, int, int); static void append_stretch_glyph (struct it *, Lisp_Object, int, int, int); + + +#endif /* HAVE_WINDOW_SYSTEM */ + static int coords_in_mouse_face_p (struct window *, int, int); - -#endif /* HAVE_WINDOW_SYSTEM */ - /*********************************************************************** Window display dimensions @@ -1797,8 +1797,6 @@ } -#ifdef HAVE_WINDOW_SYSTEM - /* Find the glyph under window-relative coordinates X/Y in window W. Consider only glyphs from buffer text, i.e. no glyphs from overlay strings. Return in *HPOS and *VPOS the row and column number of @@ -1881,7 +1879,6 @@ return glyph; } - /* EXPORT: Convert frame-relative x/y to coordinates relative to window W. Takes pseudo-windows into account. */ @@ -1904,6 +1901,8 @@ } } +#ifdef HAVE_WINDOW_SYSTEM + /* EXPORT: Return in RECTS[] at most N clipping rectangles for glyph string S. Return the number of stored rectangles. */ @@ -10818,7 +10817,7 @@ get_tool_bar_item (struct frame *f, int x, int y, struct glyph **glyph, int *hpos, int *vpos, int *prop_idx) { - Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); struct window *w = XWINDOW (f->tool_bar_window); int area; @@ -10833,14 +10832,14 @@ return -1; /* Is mouse on the highlighted item? */ - if (EQ (f->tool_bar_window, dpyinfo->mouse_face_window) - && *vpos >= dpyinfo->mouse_face_beg_row - && *vpos <= dpyinfo->mouse_face_end_row - && (*vpos > dpyinfo->mouse_face_beg_row - || *hpos >= dpyinfo->mouse_face_beg_col) - && (*vpos < dpyinfo->mouse_face_end_row - || *hpos < dpyinfo->mouse_face_end_col - || dpyinfo->mouse_face_past_end)) + if (EQ (f->tool_bar_window, hlinfo->mouse_face_window) + && *vpos >= hlinfo->mouse_face_beg_row + && *vpos <= hlinfo->mouse_face_end_row + && (*vpos > hlinfo->mouse_face_beg_row + || *hpos >= hlinfo->mouse_face_beg_col) + && (*vpos < hlinfo->mouse_face_end_row + || *hpos < hlinfo->mouse_face_end_col + || hlinfo->mouse_face_past_end)) return 0; return 1; @@ -10857,7 +10856,7 @@ handle_tool_bar_click (struct frame *f, int x, int y, int down_p, unsigned int modifiers) { - Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); struct window *w = XWINDOW (f->tool_bar_window); int hpos, vpos, prop_idx; struct glyph *glyph; @@ -10876,8 +10875,8 @@ if (down_p) { /* Show item in pressed state. */ - show_mouse_face (dpyinfo, DRAW_IMAGE_SUNKEN); - dpyinfo->mouse_face_image_state = DRAW_IMAGE_SUNKEN; + show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN); + hlinfo->mouse_face_image_state = DRAW_IMAGE_SUNKEN; last_tool_bar_item = prop_idx; } else @@ -10887,8 +10886,8 @@ EVENT_INIT (event); /* Show item in released state. */ - show_mouse_face (dpyinfo, DRAW_IMAGE_RAISED); - dpyinfo->mouse_face_image_state = DRAW_IMAGE_RAISED; + show_mouse_face (hlinfo, DRAW_IMAGE_RAISED); + hlinfo->mouse_face_image_state = DRAW_IMAGE_RAISED; key = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_KEY); @@ -10918,6 +10917,7 @@ Lisp_Object window = f->tool_bar_window; struct window *w = XWINDOW (window); Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); int hpos, vpos; struct glyph *glyph; struct glyph_row *row; @@ -10931,7 +10931,7 @@ values when mouse moves outside of the frame. */ if (x <= 0 || y <= 0) { - clear_mouse_face (dpyinfo); + clear_mouse_face (hlinfo); return; } @@ -10939,14 +10939,14 @@ if (rc < 0) { /* Not on tool-bar item. */ - clear_mouse_face (dpyinfo); + clear_mouse_face (hlinfo); return; } else if (rc == 0) /* On same tool-bar item as before. */ goto set_help_echo; - clear_mouse_face (dpyinfo); + clear_mouse_face (hlinfo); /* Mouse is down, but on different tool-bar item? */ mouse_down_p = (dpyinfo->grabbed @@ -10956,7 +10956,7 @@ && last_tool_bar_item != prop_idx) return; - dpyinfo->mouse_face_image_state = DRAW_NORMAL_TEXT; + hlinfo->mouse_face_image_state = DRAW_NORMAL_TEXT; draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; /* If tool-bar item is not enabled, don't highlight it. */ @@ -10970,22 +10970,22 @@ x += row->glyphs[TEXT_AREA][i].pixel_width; /* Record this as the current active region. */ - dpyinfo->mouse_face_beg_col = hpos; - dpyinfo->mouse_face_beg_row = vpos; - dpyinfo->mouse_face_beg_x = x; - dpyinfo->mouse_face_beg_y = row->y; - dpyinfo->mouse_face_past_end = 0; + hlinfo->mouse_face_beg_col = hpos; + hlinfo->mouse_face_beg_row = vpos; + hlinfo->mouse_face_beg_x = x; + hlinfo->mouse_face_beg_y = row->y; + hlinfo->mouse_face_past_end = 0; - dpyinfo->mouse_face_end_col = hpos + 1; - dpyinfo->mouse_face_end_row = vpos; - dpyinfo->mouse_face_end_x = x + glyph->pixel_width; - dpyinfo->mouse_face_end_y = row->y; - dpyinfo->mouse_face_window = window; - dpyinfo->mouse_face_face_id = TOOL_BAR_FACE_ID; + hlinfo->mouse_face_end_col = hpos + 1; + hlinfo->mouse_face_end_row = vpos; + hlinfo->mouse_face_end_x = x + glyph->pixel_width; + hlinfo->mouse_face_end_y = row->y; + hlinfo->mouse_face_window = window; + hlinfo->mouse_face_face_id = TOOL_BAR_FACE_ID; /* Display it as active. */ - show_mouse_face (dpyinfo, draw); - dpyinfo->mouse_face_image_state = draw; + show_mouse_face (hlinfo, draw); + hlinfo->mouse_face_image_state = draw; } set_help_echo: @@ -15985,6 +15985,9 @@ + (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0) + window_internal_height (w)); +#if defined (HAVE_GPM) || defined (MSDOS) + x_clear_window_mouse_face (w); +#endif /* Perform the operation on the screen. */ if (dvpos > 0) { @@ -21442,7 +21445,7 @@ if (head && !overlaps && row->contains_overlapping_glyphs_p) { struct glyph_string *h, *t; - Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); int mouse_beg_col, mouse_end_col, check_mouse_face = 0; int dummy_x = 0; @@ -21452,16 +21455,16 @@ { struct glyph_row *mouse_beg_row, *mouse_end_row; - mouse_beg_row = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_beg_row); - mouse_end_row = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_end_row); + mouse_beg_row = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_beg_row); + mouse_end_row = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_end_row); if (row >= mouse_beg_row && row <= mouse_end_row) { check_mouse_face = 1; mouse_beg_col = (row == mouse_beg_row) - ? dpyinfo->mouse_face_beg_col : 0; + ? hlinfo->mouse_face_beg_col : 0; mouse_end_col = (row == mouse_end_row) - ? dpyinfo->mouse_face_end_col + ? hlinfo->mouse_face_end_col : row->used[TEXT_AREA]; } } @@ -23400,6 +23403,8 @@ } +#ifdef HAVE_WINDOW_SYSTEM + /* Return the cursor we want to be displayed in window W. Return width of bar/hbar cursor through WIDTH arg. Return with ACTIVE_CURSOR arg set to 1 if cursor in window W is `active' @@ -23445,10 +23450,7 @@ /* Detect a nonselected window or nonselected frame. */ else if (w != XWINDOW (f->selected_window) -#ifdef HAVE_WINDOW_SYSTEM - || f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame -#endif - ) + || f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame) { *active_cursor = 0; @@ -23489,7 +23491,6 @@ /* Use normal cursor if not blinked off. */ if (!w->cursor_off_p) { -#ifdef HAVE_WINDOW_SYSTEM if (glyph != NULL && glyph->type == IMAGE_GLYPH) { if (cursor_type == FILLED_BOX_CURSOR) @@ -23517,7 +23518,6 @@ cursor_type = HOLLOW_BOX_CURSOR; } } -#endif return cursor_type; } @@ -23559,8 +23559,6 @@ } -#ifdef HAVE_WINDOW_SYSTEM - /* Notice when the text cursor of window W has been completely overwritten by a drawing operation that outputs glyphs in AREA starting at X0 and ending at X1 in the line starting at Y0 and @@ -23726,7 +23724,7 @@ erase_phys_cursor (struct window *w) { struct frame *f = XFRAME (w->frame); - Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); int hpos = w->phys_cursor.hpos; int vpos = w->phys_cursor.vpos; int mouse_face_here_p = 0; @@ -23782,7 +23780,7 @@ /* If the cursor is in the mouse face area, redisplay that when we clear the cursor. */ - if (! NILP (dpyinfo->mouse_face_window) + if (! NILP (hlinfo->mouse_face_window) && coords_in_mouse_face_p (w, hpos, vpos) /* Don't redraw the cursor's spot in mouse face if it is at the end of a line (on a newline). The cursor appears there, but @@ -23974,30 +23972,50 @@ update_window_cursor (w, 0); } +#endif /* HAVE_WINDOW_SYSTEM */ + +/* Implementation of draw_row_with_mouse_face for GUI sessions, GPM, + and MSDOS. */ +void +draw_row_with_mouse_face (struct window *w, int start_x, struct glyph_row *row, + int start_hpos, int end_hpos, + enum draw_glyphs_face draw) +{ +#ifdef HAVE_WINDOW_SYSTEM + if (FRAME_WINDOW_P (XFRAME (w->frame))) + { + draw_glyphs (w, start_x, row, TEXT_AREA, start_hpos, end_hpos, draw, 0); + return; + } +#endif +#if defined (HAVE_GPM) || defined (MSDOS) + tty_draw_row_with_mouse_face (w, row, start_hpos, end_hpos, draw); +#endif +} /* EXPORT: Display the active region described by mouse_face_* according to DRAW. */ void -show_mouse_face (Display_Info *dpyinfo, enum draw_glyphs_face draw) +show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw) { - struct window *w = XWINDOW (dpyinfo->mouse_face_window); + struct window *w = XWINDOW (hlinfo->mouse_face_window); struct frame *f = XFRAME (WINDOW_FRAME (w)); if (/* If window is in the process of being destroyed, don't bother to do anything. */ w->current_matrix != NULL /* Don't update mouse highlight if hidden */ - && (draw != DRAW_MOUSE_FACE || !dpyinfo->mouse_face_hidden) + && (draw != DRAW_MOUSE_FACE || !hlinfo->mouse_face_hidden) /* Recognize when we are called to operate on rows that don't exist anymore. This can happen when a window is split. */ - && dpyinfo->mouse_face_end_row < w->current_matrix->nrows) + && hlinfo->mouse_face_end_row < w->current_matrix->nrows) { int phys_cursor_on_p = w->phys_cursor_on_p; struct glyph_row *row, *first, *last; - first = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_beg_row); - last = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_end_row); + first = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_beg_row); + last = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_end_row); for (row = first; row <= last && row->enabled_p; ++row) { @@ -24012,13 +24030,13 @@ highlighted area in R2L rows. */ if (!row->reversed_p) { - start_hpos = dpyinfo->mouse_face_beg_col; - start_x = dpyinfo->mouse_face_beg_x; + start_hpos = hlinfo->mouse_face_beg_col; + start_x = hlinfo->mouse_face_beg_x; } else if (row == last) { - start_hpos = dpyinfo->mouse_face_end_col; - start_x = dpyinfo->mouse_face_end_x; + start_hpos = hlinfo->mouse_face_end_col; + start_x = hlinfo->mouse_face_end_x; } else { @@ -24028,8 +24046,8 @@ } else if (row->reversed_p && row == last) { - start_hpos = dpyinfo->mouse_face_end_col; - start_x = dpyinfo->mouse_face_end_x; + start_hpos = hlinfo->mouse_face_end_col; + start_x = hlinfo->mouse_face_end_x; } else { @@ -24040,9 +24058,9 @@ if (row == last) { if (!row->reversed_p) - end_hpos = dpyinfo->mouse_face_end_col; + end_hpos = hlinfo->mouse_face_end_col; else if (row == first) - end_hpos = dpyinfo->mouse_face_beg_col; + end_hpos = hlinfo->mouse_face_beg_col; else { end_hpos = row->used[TEXT_AREA]; @@ -24051,7 +24069,7 @@ } } else if (row->reversed_p && row == first) - end_hpos = dpyinfo->mouse_face_beg_col; + end_hpos = hlinfo->mouse_face_beg_col; else { end_hpos = row->used[TEXT_AREA]; @@ -24061,18 +24079,19 @@ if (end_hpos > start_hpos) { - draw_glyphs (w, start_x, row, TEXT_AREA, - start_hpos, end_hpos, - draw, 0); + draw_row_with_mouse_face (w, start_x, row, + start_hpos, end_hpos, draw); row->mouse_face_p = draw == DRAW_MOUSE_FACE || draw == DRAW_IMAGE_RAISED; } } +#ifdef HAVE_WINDOW_SYSTEM /* When we've written over the cursor, arrange for it to be displayed again. */ - if (phys_cursor_on_p && !w->phys_cursor_on_p) + if (FRAME_WINDOW_P (f) + && phys_cursor_on_p && !w->phys_cursor_on_p) { BLOCK_INPUT; display_and_set_cursor (w, 1, @@ -24080,15 +24099,22 @@ w->phys_cursor.x, w->phys_cursor.y); UNBLOCK_INPUT; } +#endif /* HAVE_WINDOW_SYSTEM */ } +#ifdef HAVE_WINDOW_SYSTEM /* Change the mouse cursor. */ - if (draw == DRAW_NORMAL_TEXT && !EQ (dpyinfo->mouse_face_window, f->tool_bar_window)) - FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor); - else if (draw == DRAW_MOUSE_FACE) - FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor); - else - FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor); + if (FRAME_WINDOW_P (f)) + { + if (draw == DRAW_NORMAL_TEXT + && !EQ (hlinfo->mouse_face_window, f->tool_bar_window)) + FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor); + else if (draw == DRAW_MOUSE_FACE) + FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor); + else + FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor); + } +#endif /* HAVE_WINDOW_SYSTEM */ } /* EXPORT: @@ -24097,20 +24123,20 @@ face was actually drawn unhighlighted. */ int -clear_mouse_face (Display_Info *dpyinfo) +clear_mouse_face (Mouse_HLInfo *hlinfo) { int cleared = 0; - if (!dpyinfo->mouse_face_hidden && !NILP (dpyinfo->mouse_face_window)) + if (!hlinfo->mouse_face_hidden && !NILP (hlinfo->mouse_face_window)) { - show_mouse_face (dpyinfo, DRAW_NORMAL_TEXT); + show_mouse_face (hlinfo, DRAW_NORMAL_TEXT); cleared = 1; } - dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; - dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; - dpyinfo->mouse_face_window = Qnil; - dpyinfo->mouse_face_overlay = Qnil; + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_window = Qnil; + hlinfo->mouse_face_overlay = Qnil; return cleared; } @@ -24119,43 +24145,43 @@ static int coords_in_mouse_face_p (struct window *w, int hpos, int vpos) { - Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame)); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); /* Quickly resolve the easy cases. */ - if (!(WINDOWP (dpyinfo->mouse_face_window) - && XWINDOW (dpyinfo->mouse_face_window) == w)) - return 0; - if (vpos < dpyinfo->mouse_face_beg_row - || vpos > dpyinfo->mouse_face_end_row) - return 0; - if (vpos > dpyinfo->mouse_face_beg_row - && vpos < dpyinfo->mouse_face_end_row) + if (!(WINDOWP (hlinfo->mouse_face_window) + && XWINDOW (hlinfo->mouse_face_window) == w)) + return 0; + if (vpos < hlinfo->mouse_face_beg_row + || vpos > hlinfo->mouse_face_end_row) + return 0; + if (vpos > hlinfo->mouse_face_beg_row + && vpos < hlinfo->mouse_face_end_row) return 1; if (!MATRIX_ROW (w->current_matrix, vpos)->reversed_p) { - if (dpyinfo->mouse_face_beg_row == dpyinfo->mouse_face_end_row) + if (hlinfo->mouse_face_beg_row == hlinfo->mouse_face_end_row) { - if (dpyinfo->mouse_face_beg_col <= hpos && hpos < dpyinfo->mouse_face_end_col) + if (hlinfo->mouse_face_beg_col <= hpos && hpos < hlinfo->mouse_face_end_col) return 1; } - else if ((vpos == dpyinfo->mouse_face_beg_row - && hpos >= dpyinfo->mouse_face_beg_col) - || (vpos == dpyinfo->mouse_face_end_row - && hpos < dpyinfo->mouse_face_end_col)) + else if ((vpos == hlinfo->mouse_face_beg_row + && hpos >= hlinfo->mouse_face_beg_col) + || (vpos == hlinfo->mouse_face_end_row + && hpos < hlinfo->mouse_face_end_col)) return 1; } else { - if (dpyinfo->mouse_face_beg_row == dpyinfo->mouse_face_end_row) + if (hlinfo->mouse_face_beg_row == hlinfo->mouse_face_end_row) { - if (dpyinfo->mouse_face_end_col < hpos && hpos <= dpyinfo->mouse_face_beg_col) + if (hlinfo->mouse_face_end_col < hpos && hpos <= hlinfo->mouse_face_beg_col) return 1; } - else if ((vpos == dpyinfo->mouse_face_beg_row - && hpos <= dpyinfo->mouse_face_beg_col) - || (vpos == dpyinfo->mouse_face_end_row - && hpos > dpyinfo->mouse_face_end_col)) + else if ((vpos == hlinfo->mouse_face_beg_row + && hpos <= hlinfo->mouse_face_beg_col) + || (vpos == hlinfo->mouse_face_end_row + && hpos > hlinfo->mouse_face_end_col)) return 1; } return 0; @@ -24296,7 +24322,7 @@ } } -/* This function sets the mouse_face_* elements of DPYINFO, assuming +/* This function sets the mouse_face_* elements of HLINFO, assuming the mouse cursor is on a glyph with buffer charpos MOUSE_CHARPOS in window WINDOW. START_CHARPOS and END_CHARPOS are buffer positions for the overlay or run of text properties specifying the mouse @@ -24307,7 +24333,7 @@ static void mouse_face_from_buffer_pos (Lisp_Object window, - Display_Info *dpyinfo, + Mouse_HLInfo *hlinfo, EMACS_INT mouse_charpos, EMACS_INT start_charpos, EMACS_INT end_charpos, @@ -24352,7 +24378,7 @@ if (r2 == NULL) { r2 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); - dpyinfo->mouse_face_past_end = 1; + hlinfo->mouse_face_past_end = 1; } else if (!NILP (after_string)) { @@ -24381,10 +24407,10 @@ r1 = tem; } - dpyinfo->mouse_face_beg_y = r1->y; - dpyinfo->mouse_face_beg_row = MATRIX_ROW_VPOS (r1, w->current_matrix); - dpyinfo->mouse_face_end_y = r2->y; - dpyinfo->mouse_face_end_row = MATRIX_ROW_VPOS (r2, w->current_matrix); + hlinfo->mouse_face_beg_y = r1->y; + hlinfo->mouse_face_beg_row = MATRIX_ROW_VPOS (r1, w->current_matrix); + hlinfo->mouse_face_end_y = r2->y; + hlinfo->mouse_face_end_row = MATRIX_ROW_VPOS (r2, w->current_matrix); /* For a bidi-reordered row, the positions of BEFORE_STRING, AFTER_STRING, DISPLAY_STRING, START_CHARPOS, and END_CHARPOS @@ -24432,19 +24458,19 @@ start_charpos); /* If pos == 0, it means before_string came from an overlay, not from a buffer position. */ - if (!pos || pos >= start_charpos && pos < end_charpos) + if (!pos || (pos >= start_charpos && pos < end_charpos)) break; } else if (EQ (glyph->object, after_string)) { pos = string_buffer_position (w, after_string, end_charpos); - if (!pos || pos >= start_charpos && pos < end_charpos) + if (!pos || (pos >= start_charpos && pos < end_charpos)) break; } x += glyph->pixel_width; } - dpyinfo->mouse_face_beg_x = x; - dpyinfo->mouse_face_beg_col = glyph - r1->glyphs[TEXT_AREA]; + hlinfo->mouse_face_beg_x = x; + hlinfo->mouse_face_beg_col = glyph - r1->glyphs[TEXT_AREA]; } else { @@ -24482,13 +24508,13 @@ pos = string_buffer_position (w, before_string, start_charpos); /* If pos == 0, it means before_string came from an overlay, not from a buffer position. */ - if (!pos || pos >= start_charpos && pos < end_charpos) + if (!pos || (pos >= start_charpos && pos < end_charpos)) break; } else if (EQ (glyph->object, after_string)) { pos = string_buffer_position (w, after_string, end_charpos); - if (!pos || pos >= start_charpos && pos < end_charpos) + if (!pos || (pos >= start_charpos && pos < end_charpos)) break; } } @@ -24496,8 +24522,8 @@ glyph++; /* first glyph to the right of the highlighted area */ for (g = r1->glyphs[TEXT_AREA], x = r1->x; g < glyph; g++) x += g->pixel_width; - dpyinfo->mouse_face_beg_x = x; - dpyinfo->mouse_face_beg_col = glyph - r1->glyphs[TEXT_AREA]; + hlinfo->mouse_face_beg_x = x; + hlinfo->mouse_face_beg_col = glyph - r1->glyphs[TEXT_AREA]; } /* If the highlight ends in a different row, compute GLYPH and END @@ -24546,13 +24572,13 @@ if (EQ (end->object, before_string)) { pos = string_buffer_position (w, before_string, start_charpos); - if (!pos || pos >= start_charpos && pos < end_charpos) + if (!pos || (pos >= start_charpos && pos < end_charpos)) break; } else if (EQ (end->object, after_string)) { pos = string_buffer_position (w, after_string, end_charpos); - if (!pos || pos >= start_charpos && pos < end_charpos) + if (!pos || (pos >= start_charpos && pos < end_charpos)) break; } } @@ -24560,8 +24586,8 @@ for (; glyph <= end; ++glyph) x += glyph->pixel_width; - dpyinfo->mouse_face_end_x = x; - dpyinfo->mouse_face_end_col = glyph - r2->glyphs[TEXT_AREA]; + hlinfo->mouse_face_end_x = x; + hlinfo->mouse_face_end_col = glyph - r2->glyphs[TEXT_AREA]; } else { @@ -24596,27 +24622,27 @@ if (EQ (end->object, before_string)) { pos = string_buffer_position (w, before_string, start_charpos); - if (!pos || pos >= start_charpos && pos < end_charpos) + if (!pos || (pos >= start_charpos && pos < end_charpos)) break; } else if (EQ (end->object, after_string)) { pos = string_buffer_position (w, after_string, end_charpos); - if (!pos || pos >= start_charpos && pos < end_charpos) + if (!pos || (pos >= start_charpos && pos < end_charpos)) break; } x += end->pixel_width; } - dpyinfo->mouse_face_end_x = x; - dpyinfo->mouse_face_end_col = end - r2->glyphs[TEXT_AREA]; + hlinfo->mouse_face_end_x = x; + hlinfo->mouse_face_end_col = end - r2->glyphs[TEXT_AREA]; } - dpyinfo->mouse_face_window = window; - dpyinfo->mouse_face_face_id + hlinfo->mouse_face_window = window; + hlinfo->mouse_face_face_id = face_at_buffer_position (w, mouse_charpos, 0, 0, &ignore, mouse_charpos + 1, - !dpyinfo->mouse_face_hidden, -1); - show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); + !hlinfo->mouse_face_hidden, -1); + show_mouse_face (hlinfo, DRAW_MOUSE_FACE); } /* The following function is not used anymore (replaced with @@ -24705,11 +24731,11 @@ /* Find the positions of the first and the last glyphs in window W's current matrix that occlude positions [STARTPOS..ENDPOS] in OBJECT - (assumed to be a string), and return in DPYINFO's mouse_face + (assumed to be a string), and return in HLINFO's mouse_face_* members the pixel and column/row coordinates of those glyphs. */ static void -mouse_face_from_string_pos (struct window *w, Display_Info *dpyinfo, +mouse_face_from_string_pos (struct window *w, Mouse_HLInfo *hlinfo, Lisp_Object object, EMACS_INT startpos, EMACS_INT endpos) { @@ -24734,10 +24760,10 @@ if (EQ (g->object, object) && startpos <= g->charpos && g->charpos <= endpos) { - dpyinfo->mouse_face_beg_row = r - w->current_matrix->rows; - dpyinfo->mouse_face_beg_y = r->y; - dpyinfo->mouse_face_beg_col = g - r->glyphs[TEXT_AREA]; - dpyinfo->mouse_face_beg_x = gx; + hlinfo->mouse_face_beg_row = r - w->current_matrix->rows; + hlinfo->mouse_face_beg_y = r->y; + hlinfo->mouse_face_beg_col = g - r->glyphs[TEXT_AREA]; + hlinfo->mouse_face_beg_x = gx; found = 1; break; } @@ -24752,12 +24778,12 @@ if (EQ ((g-1)->object, object) && startpos <= (g-1)->charpos && (g-1)->charpos <= endpos) { - dpyinfo->mouse_face_beg_row = r - w->current_matrix->rows; - dpyinfo->mouse_face_beg_y = r->y; - dpyinfo->mouse_face_beg_col = g - r->glyphs[TEXT_AREA]; + hlinfo->mouse_face_beg_row = r - w->current_matrix->rows; + hlinfo->mouse_face_beg_y = r->y; + hlinfo->mouse_face_beg_col = g - r->glyphs[TEXT_AREA]; for (gx = r->x, g1 = r->glyphs[TEXT_AREA]; g1 < g; ++g1) gx += g1->pixel_width; - dpyinfo->mouse_face_beg_x = gx; + hlinfo->mouse_face_beg_x = gx; found = 1; break; } @@ -24791,8 +24817,8 @@ r--; /* Set the end row and its vertical pixel coordinate. */ - dpyinfo->mouse_face_end_row = r - w->current_matrix->rows; - dpyinfo->mouse_face_end_y = r->y; + hlinfo->mouse_face_end_row = r - w->current_matrix->rows; + hlinfo->mouse_face_end_y = r->y; /* Compute and set the end column and the end column's horizontal pixel coordinate. */ @@ -24804,11 +24830,11 @@ if (EQ ((e-1)->object, object) && startpos <= (e-1)->charpos && (e-1)->charpos <= endpos) break; - dpyinfo->mouse_face_end_col = e - g; + hlinfo->mouse_face_end_col = e - g; for (gx = r->x; g < e; ++g) gx += g->pixel_width; - dpyinfo->mouse_face_end_x = gx; + hlinfo->mouse_face_end_x = gx; } else { @@ -24821,11 +24847,13 @@ break; gx += e->pixel_width; } - dpyinfo->mouse_face_end_col = e - r->glyphs[TEXT_AREA]; - dpyinfo->mouse_face_end_x = gx; + hlinfo->mouse_face_end_col = e - r->glyphs[TEXT_AREA]; + hlinfo->mouse_face_end_x = gx; } } +#ifdef HAVE_WINDOW_SYSTEM + /* See if position X, Y is within a hot-spot of an image. */ static int @@ -24996,6 +25024,8 @@ FRAME_RIF (f)->define_frame_cursor (f, cursor); } +#endif /* HAVE_WINDOW_SYSTEM */ + /* Take proper action when mouse has moved to the mode or header line or marginal area AREA of window W, x-position X and y-position Y. X is relative to the start of the text display area of W, so the @@ -25008,8 +25038,13 @@ { struct window *w = XWINDOW (window); struct frame *f = XFRAME (w->frame); - Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); - Cursor cursor = FRAME_X_OUTPUT (f)->nontext_cursor; + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); +#ifdef HAVE_WINDOW_SYSTEM + Display_Info *dpyinfo; + Cursor cursor; +#else + Cursor cursor = No_Cursor; +#endif Lisp_Object pointer = Qnil; int dx, dy, width, height; EMACS_INT charpos; @@ -25061,6 +25096,7 @@ help = Qnil; +#ifdef HAVE_WINDOW_SYSTEM if (IMAGEP (object)) { Lisp_Object image_map, hotspot; @@ -25097,6 +25133,7 @@ if (NILP (pointer)) pointer = Fplist_get (XCDR (object), QCpointer); } +#endif /* HAVE_WINDOW_SYSTEM */ if (STRINGP (string)) { @@ -25116,19 +25153,27 @@ } } - if (NILP (pointer)) - pointer = Fget_text_property (pos, Qpointer, string); - - /* Change the mouse pointer according to what is under X/Y. */ - if (NILP (pointer) && ((area == ON_MODE_LINE) || (area == ON_HEADER_LINE))) +#ifdef HAVE_WINDOW_SYSTEM + if (FRAME_WINDOW_P (f)) { - Lisp_Object map; - map = Fget_text_property (pos, Qlocal_map, string); - if (!KEYMAPP (map)) - map = Fget_text_property (pos, Qkeymap, string); - if (!KEYMAPP (map)) - cursor = dpyinfo->vertical_scroll_bar_cursor; + dpyinfo = FRAME_X_DISPLAY_INFO (f); + cursor = FRAME_X_OUTPUT (f)->nontext_cursor; + if (NILP (pointer)) + pointer = Fget_text_property (pos, Qpointer, string); + + /* Change the mouse pointer according to what is under X/Y. */ + if (NILP (pointer) + && ((area == ON_MODE_LINE) || (area == ON_HEADER_LINE))) + { + Lisp_Object map; + map = Fget_text_property (pos, Qlocal_map, string); + if (!KEYMAPP (map)) + map = Fget_text_property (pos, Qkeymap, string); + if (!KEYMAPP (map)) + cursor = dpyinfo->vertical_scroll_bar_cursor; + } } +#endif /* Change the mouse face according to what is under X/Y. */ mouse_face = Fget_text_property (pos, Qmouse_face, string); @@ -25208,60 +25253,63 @@ /* If GLYPH's position is included in the region that is already drawn in mouse face, we have nothing to do. */ - if ( EQ (window, dpyinfo->mouse_face_window) + if ( EQ (window, hlinfo->mouse_face_window) && (!row->reversed_p - ? (dpyinfo->mouse_face_beg_col <= hpos - && hpos < dpyinfo->mouse_face_end_col) + ? (hlinfo->mouse_face_beg_col <= hpos + && hpos < hlinfo->mouse_face_end_col) /* In R2L rows we swap BEG and END, see below. */ - : (dpyinfo->mouse_face_end_col <= hpos - && hpos < dpyinfo->mouse_face_beg_col)) - && dpyinfo->mouse_face_beg_row == vpos ) + : (hlinfo->mouse_face_end_col <= hpos + && hpos < hlinfo->mouse_face_beg_col)) + && hlinfo->mouse_face_beg_row == vpos ) return; - if (clear_mouse_face (dpyinfo)) + if (clear_mouse_face (hlinfo)) cursor = No_Cursor; if (!row->reversed_p) { - dpyinfo->mouse_face_beg_col = hpos; - dpyinfo->mouse_face_beg_x = original_x_pixel + hlinfo->mouse_face_beg_col = hpos; + hlinfo->mouse_face_beg_x = original_x_pixel - (total_pixel_width + dx); - dpyinfo->mouse_face_end_col = hpos + gseq_length; - dpyinfo->mouse_face_end_x = 0; + hlinfo->mouse_face_end_col = hpos + gseq_length; + hlinfo->mouse_face_end_x = 0; } else { /* In R2L rows, show_mouse_face expects BEG and END coordinates to be swapped. */ - dpyinfo->mouse_face_end_col = hpos; - dpyinfo->mouse_face_end_x = original_x_pixel + hlinfo->mouse_face_end_col = hpos; + hlinfo->mouse_face_end_x = original_x_pixel - (total_pixel_width + dx); - dpyinfo->mouse_face_beg_col = hpos + gseq_length; - dpyinfo->mouse_face_beg_x = 0; + hlinfo->mouse_face_beg_col = hpos + gseq_length; + hlinfo->mouse_face_beg_x = 0; } - dpyinfo->mouse_face_beg_row = vpos; - dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_beg_row; - dpyinfo->mouse_face_beg_y = 0; - dpyinfo->mouse_face_end_y = 0; - dpyinfo->mouse_face_past_end = 0; - dpyinfo->mouse_face_window = window; + hlinfo->mouse_face_beg_row = vpos; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_beg_row; + hlinfo->mouse_face_beg_y = 0; + hlinfo->mouse_face_end_y = 0; + hlinfo->mouse_face_past_end = 0; + hlinfo->mouse_face_window = window; - dpyinfo->mouse_face_face_id = face_at_string_position (w, string, - charpos, - 0, 0, 0, - &ignore, - glyph->face_id, - 1); - show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); + hlinfo->mouse_face_face_id = face_at_string_position (w, string, + charpos, + 0, 0, 0, + &ignore, + glyph->face_id, + 1); + show_mouse_face (hlinfo, DRAW_MOUSE_FACE); if (NILP (pointer)) pointer = Qhand; } else if ((area == ON_MODE_LINE) || (area == ON_HEADER_LINE)) - clear_mouse_face (dpyinfo); + clear_mouse_face (hlinfo); } - define_frame_cursor1 (f, cursor, pointer); +#ifdef HAVE_WINDOW_SYSTEM + if (FRAME_WINDOW_P (f)) + define_frame_cursor1 (f, cursor, pointer); +#endif } @@ -25274,7 +25322,7 @@ void note_mouse_highlight (struct frame *f, int x, int y) { - Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); enum window_part part; Lisp_Object window; struct window *w; @@ -25283,7 +25331,7 @@ struct buffer *b; /* When a menu is active, don't highlight because this looks odd. */ -#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS) +#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS) || defined (MSDOS) if (popup_activated ()) return; #endif @@ -25293,16 +25341,16 @@ || f->pointer_invisible) return; - dpyinfo->mouse_face_mouse_x = x; - dpyinfo->mouse_face_mouse_y = y; - dpyinfo->mouse_face_mouse_frame = f; + hlinfo->mouse_face_mouse_x = x; + hlinfo->mouse_face_mouse_y = y; + hlinfo->mouse_face_mouse_frame = f; - if (dpyinfo->mouse_face_defer) + if (hlinfo->mouse_face_defer) return; if (gc_in_progress) { - dpyinfo->mouse_face_deferred_gc = 1; + hlinfo->mouse_face_deferred_gc = 1; return; } @@ -25311,10 +25359,10 @@ /* If we were displaying active text in another window, clear that. Also clear if we move out of text area in same window. */ - if (! EQ (window, dpyinfo->mouse_face_window) + if (! EQ (window, hlinfo->mouse_face_window) || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE - && !NILP (dpyinfo->mouse_face_window))) - clear_mouse_face (dpyinfo); + && !NILP (hlinfo->mouse_face_window))) + clear_mouse_face (hlinfo); /* Not on a window -> return. */ if (!WINDOWP (window)) @@ -25327,6 +25375,7 @@ w = XWINDOW (window); frame_to_window_pixel_xy (w, &x, &y); +#ifdef HAVE_WINDOW_SYSTEM /* Handle tool-bar window differently since it doesn't display a buffer. */ if (EQ (window, f->tool_bar_window)) @@ -25334,6 +25383,7 @@ note_tool_bar_highlight (f, x, y); return; } +#endif /* Mouse is on the mode, header line or margin? */ if (part == ON_MODE_LINE || part == ON_HEADER_LINE @@ -25343,6 +25393,7 @@ return; } +#ifdef HAVE_WINDOW_SYSTEM if (part == ON_VERTICAL_BORDER) { cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor; @@ -25353,6 +25404,7 @@ cursor = FRAME_X_OUTPUT (f)->nontext_cursor; else cursor = FRAME_X_OUTPUT (f)->text_cursor; +#endif /* Are we in a window whose display is up to date? And verify the buffer's text has not changed. */ @@ -25376,6 +25428,7 @@ /* Find the glyph under X/Y. */ glyph = x_y_to_hpos_vpos (w, x, y, &hpos, &vpos, &dx, &dy, &area); +#ifdef HAVE_WINDOW_SYSTEM /* Look for :pointer property on image. */ if (glyph != NULL && glyph->type == IMAGE_GLYPH) { @@ -25417,11 +25470,18 @@ pointer = Fplist_get (XCDR (img->spec), QCpointer); } } +#endif /* HAVE_WINDOW_SYSTEM */ /* Clear mouse face if X/Y not over text. */ if (glyph == NULL || area != TEXT_AREA || !MATRIX_ROW (w->current_matrix, vpos)->displays_text_p + /* Glyph's OBJECT is an integer for glyphs inserted by the + display engine for its internal purposes, like truncation + and continuation glyphs and blanks beyond the end of + line's text on text terminals. If we are over such a + glyph, we are not over any text. */ + || INTEGERP (glyph->object) /* R2L rows have a stretch glyph at their front, which stands for no text, whereas L2R rows have no glyphs at all beyond the end of text. Treat such stretch glyphs @@ -25431,15 +25491,17 @@ && glyph->type == STRETCH_GLYPH && glyph->avoid_cursor_p)) { - if (clear_mouse_face (dpyinfo)) + if (clear_mouse_face (hlinfo)) cursor = No_Cursor; - if (NILP (pointer)) +#ifdef HAVE_WINDOW_SYSTEM + if (FRAME_WINDOW_P (f) && NILP (pointer)) { if (area != TEXT_AREA) cursor = FRAME_X_OUTPUT (f)->nontext_cursor; else pointer = Vvoid_text_area_pointer; } +#endif goto set_cursor; } @@ -25485,8 +25547,8 @@ the one we are currently highlighting, we have to check if we enter the overlapping overlay, and then highlight only that. */ - || (OVERLAYP (dpyinfo->mouse_face_overlay) - && mouse_face_overlay_overlaps (dpyinfo->mouse_face_overlay))) + || (OVERLAYP (hlinfo->mouse_face_overlay) + && mouse_face_overlay_overlaps (hlinfo->mouse_face_overlay))) { /* Find the highest priority overlay with a mouse-face. */ overlay = Qnil; @@ -25499,12 +25561,12 @@ /* If we're highlighting the same overlay as before, there's no need to do that again. */ - if (!NILP (overlay) && EQ (overlay, dpyinfo->mouse_face_overlay)) + if (!NILP (overlay) && EQ (overlay, hlinfo->mouse_face_overlay)) goto check_help_echo; - dpyinfo->mouse_face_overlay = overlay; + hlinfo->mouse_face_overlay = overlay; /* Clear the display of the old active region, if any. */ - if (clear_mouse_face (dpyinfo)) + if (clear_mouse_face (hlinfo)) cursor = No_Cursor; /* If no overlay applies, get a text property. */ @@ -25528,14 +25590,14 @@ b = make_number (0); if (NILP (e)) e = make_number (SCHARS (object) - 1); - mouse_face_from_string_pos (w, dpyinfo, object, + mouse_face_from_string_pos (w, hlinfo, object, XINT (b), XINT (e)); - dpyinfo->mouse_face_past_end = 0; - dpyinfo->mouse_face_window = window; - dpyinfo->mouse_face_face_id + hlinfo->mouse_face_past_end = 0; + hlinfo->mouse_face_window = window; + hlinfo->mouse_face_face_id = face_at_string_position (w, object, pos, 0, 0, 0, &ignore, glyph->face_id, 1); - show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); + show_mouse_face (hlinfo, DRAW_MOUSE_FACE); cursor = No_Cursor; } else @@ -25610,7 +25672,7 @@ if (!STRINGP (after_string)) after_string = Qnil; } - mouse_face_from_buffer_pos (window, dpyinfo, pos, + mouse_face_from_buffer_pos (window, hlinfo, pos, XFASTINT (before), XFASTINT (after), before_string, after_string, @@ -25689,8 +25751,9 @@ } } +#ifdef HAVE_WINDOW_SYSTEM /* Look for a `pointer' property. */ - if (NILP (pointer)) + if (FRAME_WINDOW_P (f) && NILP (pointer)) { /* Check overlays first. */ for (i = noverlays - 1; i >= 0 && NILP (pointer); --i) @@ -25729,6 +25792,7 @@ Qpointer, object); } } +#endif /* HAVE_WINDOW_SYSTEM */ BEGV = obegv; ZV = ozv; @@ -25737,7 +25801,14 @@ set_cursor: - define_frame_cursor1 (f, cursor, pointer); +#ifdef HAVE_WINDOW_SYSTEM + if (FRAME_WINDOW_P (f)) + define_frame_cursor1 (f, cursor, pointer); +#else + /* This is here to prevent a compiler error, about "label at end of + compound statement". */ + return; +#endif } @@ -25749,13 +25820,13 @@ void x_clear_window_mouse_face (struct window *w) { - Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame)); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); Lisp_Object window; BLOCK_INPUT; XSETWINDOW (window, w); - if (EQ (window, dpyinfo->mouse_face_window)) - clear_mouse_face (dpyinfo); + if (EQ (window, hlinfo->mouse_face_window)) + clear_mouse_face (hlinfo); UNBLOCK_INPUT; } @@ -25768,20 +25839,18 @@ cancel_mouse_face (struct frame *f) { Lisp_Object window; - Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); - window = dpyinfo->mouse_face_window; + window = hlinfo->mouse_face_window; if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f) { - dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; - dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; - dpyinfo->mouse_face_window = Qnil; + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_window = Qnil; } } -#endif /* HAVE_WINDOW_SYSTEM */ - /*********************************************************************** Exposure Events @@ -26238,12 +26307,12 @@ focus-follows-mouse with delayed raise. --jason 2001-10-12 */ if (mouse_face_overwritten_p && !FRAME_GARBAGED_P (f)) { - Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); - if (f == dpyinfo->mouse_face_mouse_frame) + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); + if (f == hlinfo->mouse_face_mouse_frame) { - int x = dpyinfo->mouse_face_mouse_x; - int y = dpyinfo->mouse_face_mouse_y; - clear_mouse_face (dpyinfo); + int x = hlinfo->mouse_face_mouse_x; + int y = hlinfo->mouse_face_mouse_y; + clear_mouse_face (hlinfo); note_mouse_highlight (f, x, y); } } === modified file 'src/xmenu.c' --- src/xmenu.c 2010-10-22 05:49:47 +0000 +++ src/xmenu.c 2010-10-30 13:09:52 +0000 @@ -2533,13 +2533,16 @@ #endif /* HAVE_MENUS */ -/* Detect if a dialog or menu has been posted. */ +#ifndef MSDOS +/* Detect if a dialog or menu has been posted. MSDOS has its own + implementation on msdos.c. */ int popup_activated (void) { return popup_activated_flag; } +#endif /* not MSDOS */ /* The following is used by delayed window autoselection. */ === modified file 'src/xterm.c' --- src/xterm.c 2010-11-01 07:53:08 +0000 +++ src/xterm.c 2010-11-06 08:28:31 +0000 @@ -548,22 +548,22 @@ x_update_window_begin (struct window *w) { struct frame *f = XFRAME (WINDOW_FRAME (w)); - struct x_display_info *display_info = FRAME_X_DISPLAY_INFO (f); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); updated_window = w; set_output_cursor (&w->cursor); BLOCK_INPUT; - if (f == display_info->mouse_face_mouse_frame) + if (f == hlinfo->mouse_face_mouse_frame) { /* Don't do highlighting for mouse motion during the update. */ - display_info->mouse_face_defer = 1; + hlinfo->mouse_face_defer = 1; /* If F needs to be redrawn, simply forget about any prior mouse highlighting. */ if (FRAME_GARBAGED_P (f)) - display_info->mouse_face_window = Qnil; + hlinfo->mouse_face_window = Qnil; } UNBLOCK_INPUT; @@ -603,7 +603,7 @@ static void x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p) { - struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame)); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); if (!w->pseudo_window_p) { @@ -624,9 +624,9 @@ XTframe_up_to_date to redisplay the mouse highlight. */ if (mouse_face_overwritten_p) { - dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; - dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; - dpyinfo->mouse_face_window = Qnil; + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_window = Qnil; } updated_window = NULL; @@ -640,7 +640,7 @@ x_update_end (struct frame *f) { /* Mouse highlight may be displayed again. */ - FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 0; + MOUSE_HL_INFO (f)->mouse_face_defer = 0; #ifndef XFlush BLOCK_INPUT; @@ -659,17 +659,17 @@ { if (FRAME_X_P (f)) { - struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); - if (dpyinfo->mouse_face_deferred_gc - || f == dpyinfo->mouse_face_mouse_frame) + if (hlinfo->mouse_face_deferred_gc + || f == hlinfo->mouse_face_mouse_frame) { BLOCK_INPUT; - if (dpyinfo->mouse_face_mouse_frame) - note_mouse_highlight (dpyinfo->mouse_face_mouse_frame, - dpyinfo->mouse_face_mouse_x, - dpyinfo->mouse_face_mouse_y); - dpyinfo->mouse_face_deferred_gc = 0; + if (hlinfo->mouse_face_mouse_frame) + note_mouse_highlight (hlinfo->mouse_face_mouse_frame, + hlinfo->mouse_face_mouse_x, + hlinfo->mouse_face_mouse_y); + hlinfo->mouse_face_deferred_gc = 0; UNBLOCK_INPUT; } } @@ -970,7 +970,7 @@ struct face *face; /* What face has to be used last for the mouse face? */ - face_id = FRAME_X_DISPLAY_INFO (s->f)->mouse_face_face_id; + face_id = MOUSE_HL_INFO (s->f)->mouse_face_face_id; face = FACE_FROM_ID (s->f, face_id); if (face == NULL) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); @@ -5788,6 +5788,7 @@ struct frame *f = NULL; struct coding_system coding; XEvent event = *eventp; + Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; *finish = X_EVENT_NORMAL; @@ -6237,12 +6238,12 @@ /* If mouse-highlight is an integer, input clears out mouse highlighting. */ - if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) + if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) && (f == 0 - || !EQ (f->tool_bar_window, dpyinfo->mouse_face_window))) + || !EQ (f->tool_bar_window, hlinfo->mouse_face_window))) { - clear_mouse_face (dpyinfo); - dpyinfo->mouse_face_hidden = 1; + clear_mouse_face (hlinfo); + hlinfo->mouse_face_hidden = 1; } #if defined USE_MOTIF && defined USE_TOOLKIT_SCROLL_BARS @@ -6599,12 +6600,12 @@ f = x_top_window_to_frame (dpyinfo, event.xcrossing.window); if (f) { - if (f == dpyinfo->mouse_face_mouse_frame) + if (f == hlinfo->mouse_face_mouse_frame) { /* If we move outside the frame, then we're certainly no longer on any text in the frame. */ - clear_mouse_face (dpyinfo); - dpyinfo->mouse_face_mouse_frame = 0; + clear_mouse_face (hlinfo); + hlinfo->mouse_face_mouse_frame = 0; } /* Generate a nil HELP_EVENT to cancel a help-echo. @@ -6637,10 +6638,10 @@ else f = x_window_to_frame (dpyinfo, event.xmotion.window); - if (dpyinfo->mouse_face_hidden) + if (hlinfo->mouse_face_hidden) { - dpyinfo->mouse_face_hidden = 0; - clear_mouse_face (dpyinfo); + hlinfo->mouse_face_hidden = 0; + clear_mouse_face (hlinfo); } #ifdef USE_GTK @@ -6695,7 +6696,7 @@ /* If we move outside the frame, then we're certainly no longer on any text in the frame. */ - clear_mouse_face (dpyinfo); + clear_mouse_face (hlinfo); } /* If the contents of the global variable help_echo_string @@ -9385,6 +9386,7 @@ struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); Lisp_Object bar; struct scroll_bar *b; + Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; BLOCK_INPUT; @@ -9478,15 +9480,15 @@ if (f == dpyinfo->x_highlight_frame) dpyinfo->x_highlight_frame = 0; - if (f == dpyinfo->mouse_face_mouse_frame) + if (f == hlinfo->mouse_face_mouse_frame) { - dpyinfo->mouse_face_beg_row - = dpyinfo->mouse_face_beg_col = -1; - dpyinfo->mouse_face_end_row - = dpyinfo->mouse_face_end_col = -1; - dpyinfo->mouse_face_window = Qnil; - dpyinfo->mouse_face_deferred_gc = 0; - dpyinfo->mouse_face_mouse_frame = 0; + hlinfo->mouse_face_beg_row + = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row + = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_window = Qnil; + hlinfo->mouse_face_deferred_gc = 0; + hlinfo->mouse_face_mouse_frame = 0; } UNBLOCK_INPUT; @@ -9863,6 +9865,7 @@ struct terminal *terminal; struct x_display_info *dpyinfo; XrmDatabase xrdb; + Mouse_HLInfo *hlinfo; BLOCK_INPUT; @@ -9993,6 +9996,7 @@ dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info)); memset (dpyinfo, 0, sizeof *dpyinfo); + hlinfo = &dpyinfo->mouse_highlight; terminal = x_create_terminal (dpyinfo); @@ -10115,16 +10119,16 @@ dpyinfo->bitmaps_size = 0; dpyinfo->bitmaps_last = 0; dpyinfo->scratch_cursor_gc = 0; - dpyinfo->mouse_face_mouse_frame = 0; - dpyinfo->mouse_face_deferred_gc = 0; - dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; - dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; - dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID; - dpyinfo->mouse_face_window = Qnil; - dpyinfo->mouse_face_overlay = Qnil; - dpyinfo->mouse_face_mouse_x = dpyinfo->mouse_face_mouse_y = 0; - dpyinfo->mouse_face_defer = 0; - dpyinfo->mouse_face_hidden = 0; + hlinfo->mouse_face_mouse_frame = 0; + hlinfo->mouse_face_deferred_gc = 0; + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_face_id = DEFAULT_FACE_ID; + hlinfo->mouse_face_window = Qnil; + hlinfo->mouse_face_overlay = Qnil; + hlinfo->mouse_face_mouse_x = hlinfo->mouse_face_mouse_y = 0; + hlinfo->mouse_face_defer = 0; + hlinfo->mouse_face_hidden = 0; dpyinfo->x_focus_frame = 0; dpyinfo->x_focus_event_frame = 0; dpyinfo->x_highlight_frame = 0; === modified file 'src/xterm.h' --- src/xterm.h 2010-09-02 09:47:08 +0000 +++ src/xterm.h 2010-10-31 18:50:02 +0000 @@ -190,36 +190,9 @@ /* Reusable Graphics Context for drawing a cursor in a non-default face. */ GC scratch_cursor_gc; - /* These variables describe the range of text currently shown in its - mouse-face, together with the window they apply to. As long as - the mouse stays within this range, we need not redraw anything on - its account. Rows and columns are glyph matrix positions in - MOUSE_FACE_WINDOW. */ - int mouse_face_beg_row, mouse_face_beg_col; - int mouse_face_beg_x, mouse_face_beg_y; - int mouse_face_end_row, mouse_face_end_col; - int mouse_face_end_x, mouse_face_end_y; - int mouse_face_past_end; - Lisp_Object mouse_face_window; - int mouse_face_face_id; - Lisp_Object mouse_face_overlay; - - /* 1 if a mouse motion event came and we didn't handle it right away because - gc was in progress. */ - int mouse_face_deferred_gc; - - /* FRAME and X, Y position of mouse when last checked for - highlighting. X and Y can be negative or out of range for the frame. */ - struct frame *mouse_face_mouse_frame; - int mouse_face_mouse_x, mouse_face_mouse_y; - - /* Nonzero means defer mouse-motion highlighting. */ - int mouse_face_defer; - - /* Nonzero means that the mouse highlight should not be shown. */ - int mouse_face_hidden; - - int mouse_face_image_state; + /* Information about the range of text currently shown in + mouse-face. */ + Mouse_HLInfo mouse_highlight; char *x_id_name; ------------------------------------------------------------ revno: 102260 committer: Sam Steingold branch nick: trunk timestamp: Fri 2010-11-05 15:30:18 -0400 message: chapter, part, section are all DocBook elements diff: === modified file 'etc/schema/schemas.xml' --- etc/schema/schemas.xml 2010-11-04 18:17:38 +0000 +++ etc/schema/schemas.xml 2010-11-05 19:30:18 +0000 @@ -39,7 +39,10 @@ + + + ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.