aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2009-08-22 19:39:54 +0000
committerGlenn Morris2009-08-22 19:39:54 +0000
commit47e83968520f5c2766306cfeded468a3077911fd (patch)
treeab60d1fd9b1681a63228eb7951cc37fa17999e97
parente6ce8c4239a0b7003430d94a5f591e1d4ad50213 (diff)
downloademacs-47e83968520f5c2766306cfeded468a3077911fd.tar.gz
emacs-47e83968520f5c2766306cfeded468a3077911fd.zip
(cperl-imenu-name-and-position): Copy imenu-example--name-and-position
function here for own use. (cperl-xsub-scan): Use cperl-imenu-name-and-position. (cperl-time-fontification): Use forward-line rather than goto-line.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/cperl-mode.el20
2 files changed, 22 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 076a0a863ca..22ec1f69ff3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12009-08-22 Glenn Morris <rgm@gnu.org> 12009-08-22 Glenn Morris <rgm@gnu.org>
2 2
3 * progmodes/cperl-mode.el (cperl-imenu-name-and-position):
4 Copy imenu-example--name-and-position function here for own use.
5 (cperl-xsub-scan): Use cperl-imenu-name-and-position.
6
3 * bs.el (bs--redisplay): 7 * bs.el (bs--redisplay):
4 * cus-edit.el (custom-redraw): 8 * cus-edit.el (custom-redraw):
5 * ibuffer.el (ibuffer-bury-buffer): 9 * ibuffer.el (ibuffer-bury-buffer):
@@ -13,6 +17,7 @@
13 * progmodes/ada-mode.el (ada-compile-goto-error): 17 * progmodes/ada-mode.el (ada-compile-goto-error):
14 * progmodes/ada-xref.el (ada-xref-find-in-modified-ali): 18 * progmodes/ada-xref.el (ada-xref-find-in-modified-ali):
15 (ebrowse-select-1st-to-9nth): 19 (ebrowse-select-1st-to-9nth):
20 * progmodes/cperl-mode.el (cperl-time-fontification):
16 * progmodes/ebrowse.el (ebrowse-toggle-file-name-display) 21 * progmodes/ebrowse.el (ebrowse-toggle-file-name-display)
17 * progmodes/gud.el (gud-display-line): 22 * progmodes/gud.el (gud-display-line):
18 (idlwave-shell-display-line): 23 (idlwave-shell-display-line):
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 722a31eae80..c7607d95861 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -6874,6 +6874,19 @@ by CPerl."
6874 ;; Do not introduce variable if not needed, we check it! 6874 ;; Do not introduce variable if not needed, we check it!
6875 (set 'parse-sexp-lookup-properties t)))) 6875 (set 'parse-sexp-lookup-properties t))))
6876 6876
6877;; Copied from imenu-example--name-and-position.
6878(defvar imenu-use-markers)
6879
6880(defun cperl-imenu-name-and-position ()
6881 "Return the current/previous sexp and its (beginning) location.
6882Does not move point."
6883 (save-excursion
6884 (forward-sexp -1)
6885 (let ((beg (if imenu-use-markers (point-marker) (point)))
6886 (end (progn (forward-sexp) (point))))
6887 (cons (buffer-substring beg end)
6888 beg))))
6889
6877(defun cperl-xsub-scan () 6890(defun cperl-xsub-scan ()
6878 (require 'imenu) 6891 (require 'imenu)
6879 (let ((index-alist '()) 6892 (let ((index-alist '())
@@ -6896,7 +6909,7 @@ by CPerl."
6896 ((not package) nil) ; C language section 6909 ((not package) nil) ; C language section
6897 ((match-beginning 3) ; XSUB 6910 ((match-beginning 3) ; XSUB
6898 (goto-char (1+ (match-beginning 3))) 6911 (goto-char (1+ (match-beginning 3)))
6899 (setq index (imenu-example--name-and-position)) 6912 (setq index (cperl-imenu-name-and-position))
6900 (setq name (buffer-substring (match-beginning 3) (match-end 3))) 6913 (setq name (buffer-substring (match-beginning 3) (match-end 3)))
6901 (if (and prefix (string-match (concat "^" prefix) name)) 6914 (if (and prefix (string-match (concat "^" prefix) name))
6902 (setq name (substring name (length prefix)))) 6915 (setq name (substring name (length prefix))))
@@ -6908,7 +6921,7 @@ by CPerl."
6908 (push index index-alist)) 6921 (push index index-alist))
6909 (t ; BOOT: section 6922 (t ; BOOT: section
6910 ;; (beginning-of-line) 6923 ;; (beginning-of-line)
6911 (setq index (imenu-example--name-and-position)) 6924 (setq index (cperl-imenu-name-and-position))
6912 (setcar index (concat package "::BOOT:")) 6925 (setcar index (concat package "::BOOT:"))
6913 (push index index-alist))))) 6926 (push index index-alist)))))
6914 index-alist)) 6927 index-alist))
@@ -8758,7 +8771,8 @@ start with default arguments, then refine the slowdown regions."
8758 (let ((tt (current-time))) 8771 (let ((tt (current-time)))
8759 (+ (* 1000 (nth 1 tt)) (/ (nth 2 tt) 1000)))))) 8772 (+ (* 1000 (nth 1 tt)) (/ (nth 2 tt) 1000))))))
8760 (tt (funcall timems)) (c 0) delta tot) 8773 (tt (funcall timems)) (c 0) delta tot)
8761 (goto-line l) 8774 (goto-char (point-min))
8775 (forward-line (1- l))
8762 (cperl-mode) 8776 (cperl-mode)
8763 (setq tot (- (- tt (setq tt (funcall timems))))) 8777 (setq tot (- (- tt (setq tt (funcall timems)))))
8764 (message "cperl-mode at %s: %s" l tot) 8778 (message "cperl-mode at %s: %s" l tot)