emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/make-mode.el


From: Daniel Pfeiffer
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/make-mode.el
Date: Tue, 17 May 2005 16:44:19 -0400

Index: emacs/lisp/progmodes/make-mode.el
diff -c emacs/lisp/progmodes/make-mode.el:1.91 
emacs/lisp/progmodes/make-mode.el:1.92
*** emacs/lisp/progmodes/make-mode.el:1.91      Mon May 16 20:13:09 2005
--- emacs/lisp/progmodes/make-mode.el   Tue May 17 20:44:18 2005
***************
*** 262,267 ****
--- 262,270 ----
    "^ *\\(\\(?: 
*\\$\\(?:[({]\\(?:\\$\\(?:[({]\\(?:\\$\\(?:[^({]\\|.[^\n$#})]+?[})]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\|
 *[^ \n$#:=]+\\)+?\\)[ \t]*\\(:\\)\\(?:[ \t]*$\\|[^=\n]\\(?:[^#\n]*?;[ 
\t]*\\(.+\\)\\)?\\)"
    "Regex used to find dependency lines in a makefile.")
  
+ (defvar makefile-dependency-skip "^:"
+   "Characters to skip to find a line that might be a dependency.")
+ 
  (defvar makefile-rule-action-regex
    "^\t[ \t]*\\(address@hidden)[ \t]*\\(\\(?:.+\\\\\n\\)*.+\\)"
    "Regex used to highlight rule action lines in font lock mode.")
***************
*** 857,862 ****
--- 860,866 ----
    (set (make-local-variable 'makefile-dependency-regex)
         ;; Identical to default, except allows `!' instead of `:'.
         "^ *\\(\\(?: 
*\\$\\(?:[({]\\(?:\\$\\(?:[({]\\(?:\\$\\(?:[^({]\\|.[^\n$#})]+?[})]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\|
 *[^ \n$#:=]+\\)+?\\)[ \t]*\\([:!]\\)\\(?:[ \t]*$\\|[^=\n]\\(?:[^#\n]*?;[ 
\t]*\\(.+\\)\\)?\\)")
+   (set (make-local-variable 'makefile-dependency-skip) "^:!")
    (set (make-local-variable 'makefile-rule-action-regex)
         "^\t[ \t]*\\(address@hidden)[ \t]*\\(\\(?:.+\\\\\n\\)*.+\\)")
    (setq font-lock-defaults
***************
*** 874,891 ****
    (interactive)
    (let ((here (point)))
      (end-of-line)
!     (if (makefile-match-dependency (point-max))
        (progn (beginning-of-line) t)   ; indicate success
        (goto-char here) nil)))
  
  (defun makefile-previous-dependency ()
    "Move point to the beginning of the previous dependency line."
    (interactive)
!   (let ((here (point)))
      (beginning-of-line)
!     (if (makefile-match-dependency (point-min) t)
!       (progn (beginning-of-line) t)   ; indicate success
!       (goto-char here) nil)))
  
  
  
--- 878,903 ----
    (interactive)
    (let ((here (point)))
      (end-of-line)
!     (if (makefile-match-dependency nil)
        (progn (beginning-of-line) t)   ; indicate success
        (goto-char here) nil)))
  
  (defun makefile-previous-dependency ()
    "Move point to the beginning of the previous dependency line."
    (interactive)
!   (let ((pt (point)))
      (beginning-of-line)
!     ;; makefile-match-dependency done backwards:
!     (catch 'found
!       (while (and (< (skip-chars-backward makefile-dependency-skip) 0)
!                 (not (bobp)))
!       (backward-char)
!       (or (get-text-property (point) 'face)
!           (beginning-of-line)
!           (if (looking-at makefile-dependency-regex)
!               (throw 'found t))))
!       (goto-char pt)
!       nil)))
  
  
  
***************
*** 1683,1698 ****
                  ((string= s "{{") "\\(.*?\\)[ \t]*}}")))
      (if s (looking-at s))))
  
! (defun makefile-match-dependency (bound &optional backward)
    "Search for `makefile-dependency-regex' up to BOUND.
- Optionally search BACKWARD.
  Checks that the colon has not already been fontified, else we
  matched in a rule action."
    (catch 'found
!     (while (funcall (if backward 're-search-backward 're-search-forward)
!                   makefile-dependency-regex bound t)
!       (or (get-text-property (match-beginning 2) 'face)
!         (throw 'found t)))))
  
  (defun makefile-match-action (bound)
    (catch 'found
--- 1695,1717 ----
                  ((string= s "{{") "\\(.*?\\)[ \t]*}}")))
      (if s (looking-at s))))
  
! (defun makefile-match-dependency (bound)
    "Search for `makefile-dependency-regex' up to BOUND.
  Checks that the colon has not already been fontified, else we
  matched in a rule action."
    (catch 'found
!     (let ((pt (point)))
!       (while (and (> (skip-chars-forward makefile-dependency-skip bound) 0)
!                 (not (eobp)))
!       (forward-char)
!       (or (get-text-property (1- (point)) 'face)
!           (when (save-excursion
!                   (beginning-of-line)
!                   (looking-at makefile-dependency-regex))
!             (end-of-line)
!             (throw 'found (point)))))
!       (goto-char pt))
!     nil))
  
  (defun makefile-match-action (bound)
    (catch 'found




reply via email to

[Prev in Thread] Current Thread [Next in Thread]