aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2004-04-14 17:49:43 +0000
committerStefan Monnier2004-04-14 17:49:43 +0000
commit96ef1febd290979a5d1be6ddf0a885c68c83e625 (patch)
tree4ed7d7277d4421b662d85953a975abb468bcabc3
parent65114860f50064669720032a1c598483395633f2 (diff)
downloademacs-96ef1febd290979a5d1be6ddf0a885c68c83e625.tar.gz
emacs-96ef1febd290979a5d1be6ddf0a885c68c83e625.zip
(checkdoc-output-mode-map, checkdoc-find-error-mouse, checkdoc-find-error):
Use posn-set-point to merge the mouse and non-mouse case.
-rw-r--r--lisp/ChangeLog22
-rw-r--r--lisp/emacs-lisp/checkdoc.el23
2 files changed, 30 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b3cada9ab06..d7c2e3d3144 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,25 @@
12004-04-14 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * pcvs-info.el (cvs-status-map): Update binding name.
4
5 * pcvs.el (cvs-mode-toggle-mark): Rename from cvs-mouse-toggle-mark.
6 Make it work for non-mouse events.
7
8 * subr.el (posn-set-point): New function.
9
10 * mouse.el (mouse-set-point): Use it.
11
12 * progmodes/compile.el (compile-goto-error): Use it.
13
14 * smerge-mode.el (smerge-popup-context-menu): Use it.
15
16 * emacs-lisp/checkdoc.el (checkdoc-output-mode-map)
17 (checkdoc-find-error-mouse, checkdoc-find-error): Use it to merge the
18 mouse and non-mouse case.
19
20 * diff-mode.el (diff-goto-source): Make it work for mouse bindings.
21 (diff-mouse-goto-source): Make it an alias of diff-goto-source.
22
12004-04-14 Jesper Harder <harder@ifa.au.dk> 232004-04-14 Jesper Harder <harder@ifa.au.dk>
2 24
3 * info.el (info-apropos): Don't clobber Info-history-list. 25 * info.el (info-apropos): Don't clobber Info-history-list.
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 8e68cb428dc..fddab94dfd4 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -653,8 +653,7 @@ style."
653 (sit-for 2)) 653 (sit-for 2))
654 (setq err-list (cdr err-list)))) 654 (setq err-list (cdr err-list))))
655 (beginning-of-defun) 655 (beginning-of-defun)
656 (let ((pe (car err-list)) 656 (let ((ne (funcall findfunc nil)))
657 (ne (funcall findfunc nil)))
658 (if ne 657 (if ne
659 (setq err-list (cons ne err-list)) 658 (setq err-list (cons ne err-list))
660 (cond ((not err-list) 659 (cond ((not err-list)
@@ -900,7 +899,7 @@ Prefix argument TAKE-NOTES means to continue through the whole buffer and
900save warnings in a separate buffer. Second optional argument START-POINT 899save warnings in a separate buffer. Second optional argument START-POINT
901is the starting location. If this is nil, `point-min' is used instead." 900is the starting location. If this is nil, `point-min' is used instead."
902 (interactive "P") 901 (interactive "P")
903 (let ((wrong nil) (msg nil) (errors nil) 902 (let ((wrong nil) (msg nil)
904 ;; Assign a flag to spellcheck flag 903 ;; Assign a flag to spellcheck flag
905 (checkdoc-spellcheck-documentation-flag 904 (checkdoc-spellcheck-documentation-flag
906 (car (memq checkdoc-spellcheck-documentation-flag 905 (car (memq checkdoc-spellcheck-documentation-flag
@@ -2598,14 +2597,13 @@ This function will not modify `match-data'."
2598 (setq checkdoc-output-mode-map (make-sparse-keymap)) 2597 (setq checkdoc-output-mode-map (make-sparse-keymap))
2599 (if (not (string-match "XEmacs" emacs-version)) 2598 (if (not (string-match "XEmacs" emacs-version))
2600 (define-key checkdoc-output-mode-map [mouse-2] 2599 (define-key checkdoc-output-mode-map [mouse-2]
2601 'checkdoc-find-error-mouse)) 2600 'checkdoc-find-error))
2602 (define-key checkdoc-output-mode-map "\C-c\C-c" 'checkdoc-find-error) 2601 (define-key checkdoc-output-mode-map "\C-c\C-c" 'checkdoc-find-error)
2603 (define-key checkdoc-output-mode-map "\C-m" 'checkdoc-find-error)) 2602 (define-key checkdoc-output-mode-map "\C-m" 'checkdoc-find-error))
2604 2603
2605(defun checkdoc-output-mode () 2604(defun checkdoc-output-mode ()
2606 "Create and setup the buffer used to maintain checkdoc warnings. 2605 "Create and setup the buffer used to maintain checkdoc warnings.
2607\\<checkdoc-output-mode-map>\\[checkdoc-find-error] - Go to this error location 2606\\<checkdoc-output-mode-map>\\[checkdoc-find-error] - Go to this error location."
2608\\[checkdoc-find-error-mouse] - Goto the error clicked on."
2609 (if (get-buffer checkdoc-diagnostic-buffer) 2607 (if (get-buffer checkdoc-diagnostic-buffer)
2610 (get-buffer checkdoc-diagnostic-buffer) 2608 (get-buffer checkdoc-diagnostic-buffer)
2611 (save-excursion 2609 (save-excursion
@@ -2619,16 +2617,11 @@ This function will not modify `match-data'."
2619 (run-hooks 'checkdoc-output-mode-hook) 2617 (run-hooks 'checkdoc-output-mode-hook)
2620 (current-buffer)))) 2618 (current-buffer))))
2621 2619
2622(defun checkdoc-find-error-mouse (e) 2620(defalias 'checkdoc-find-error-mouse 'checkdoc-find-error)
2623 ;; checkdoc-params: (e) 2621(defun checkdoc-find-error (&optional event)
2624 "Call `checkdoc-find-error' where the user clicks the mouse."
2625 (interactive "e")
2626 (mouse-set-point e)
2627 (checkdoc-find-error))
2628
2629(defun checkdoc-find-error ()
2630 "In a checkdoc diagnostic buffer, find the error under point." 2622 "In a checkdoc diagnostic buffer, find the error under point."
2631 (interactive) 2623 (interactive (list last-input-event))
2624 (if event (posn-set-point (event-end e)))
2632 (beginning-of-line) 2625 (beginning-of-line)
2633 (if (looking-at "\\(\\(\\w+\\|\\s_\\)+\\.el\\):\\([0-9]+\\):") 2626 (if (looking-at "\\(\\(\\w+\\|\\s_\\)+\\.el\\):\\([0-9]+\\):")
2634 (let ((l (string-to-int (match-string 3))) 2627 (let ((l (string-to-int (match-string 3)))