]> code.delx.au - gnu-emacs/commitdiff
whitespace.el now takes user customizable variable to display cleanliness of
authorRajesh Vaidheeswarran <rv@gnu.org>
Mon, 29 Sep 2003 18:05:31 +0000 (18:05 +0000)
committerRajesh Vaidheeswarran <rv@gnu.org>
Mon, 29 Sep 2003 18:05:31 +0000 (18:05 +0000)
files.

ffap.el - bugfix.

lisp/ChangeLog
lisp/ffap.el
lisp/whitespace.el

index cbb64276ec89014283565c456b5510a40b94c82d..dfecd4e9ce963950696e2a3109f361a8c75056ad 100644 (file)
@@ -1,3 +1,10 @@
+2003-09-29  Rajesh Vaidheeswarran  <rv@gnu.org>
+
+       * whitespace.el (whitespace-clean-msg): Add user customizable message
+       for displaying ``clean'' output.
+       (whitespace-buffer): Use `whitespace-clean-msg'.
+       (whitespace-global-mode): Fix typo.
+       
 2003-09-29  Thien-Thi Nguyen  <ttn@gnu.org>
 
        * pcvs.el (cvs-mode-unmark-up): Move to goal column when done.
        Handle paren-style types in Pike.  Also fixed some cases of
        insufficient handling of unbalanced parens.
 
+2003-09-24  Rajesh Vaidheeswarran  <rv@gnu.org>
+
+       * ffap.el (ffap-shell-prompt-regexp): Add regexp to identify
+       common shell prompts that are not common filename or URL
+       characters.
+       (ffap-file-at-point): Use the new regexp to strip the prompts from
+       the file names. This is an issue mostly for user prompts that
+       don't have a trailing space and find-file-at-point is invoked from
+       within a shell inside emacs.
+
 2003-09-24  Andre Spiegel  <spiegel@gnu.org>
 
        * vc-cvs.el (vc-cvs-parse-entry): Restore the code to compare time
index 5711150e264088862afffdfc87af0f322d2595fc..2b4c7826c287e41e47cccc07ac978ebd93e22ce2 100644 (file)
@@ -65,6 +65,7 @@
 ;; (setq ffap-alist nil)                ; faster, dumber prompting
 ;; (setq ffap-machine-p-known 'accept)  ; no pinging
 ;; (setq ffap-url-regexp nil)           ; disable URL features in ffap
+;; (setq ffap-shell-prompt-regexp nil)  ; disable shell prompt stripping
 ;;
 ;; ffap uses `browse-url' (if found, else `w3-fetch') to fetch URL's.
 ;; For a hairier `ffap-url-fetcher', try ffap-url.el (same ftp site).
@@ -120,6 +121,18 @@ Otherwise return nil (or the optional DEFAULT value)."
   (let ((sym (intern-soft name)))
     (if (and sym (boundp sym)) (symbol-value sym) default)))
 
+(defcustom ffap-shell-prompt-regexp
+  ;; This used to test for some shell prompts that don't have a space
+  ;; after them. The common root shell prompt (#) is not listed since it
+  ;; also doubles up as a valid URL character.
+  "[$%><]*"
+  "Paths matching this regexp are stripped off the shell prompt
+If nil, ffap doesn't do shell prompt stripping."
+  :type '(choice (const :tag "Disable" nil)
+                 (const :tag "Standard" "[$%><]*")
+                  regexp)
+  :group 'ffap)
+
 (defcustom ffap-ftp-regexp
   ;; This used to test for ange-ftp or efs being present, but it should be
   ;; harmless (and simpler) to give it this value unconditionally.
@@ -1109,6 +1122,11 @@ which may actually result in an url rather than a filename."
          ;; Try stripping off line numbers; good for compilation/grep output.
          ((and (not abs) (string-match ":[0-9]" name)
                (ffap-file-exists-string (substring name 0 (match-beginning 0)))))
+         ;; Try stripping off prominent (non-root - #) shell prompts
+        ;; if the ffap-shell-prompt-regexp is non-nil.
+         ((and ffap-shell-prompt-regexp
+              (not abs) (string-match ffap-shell-prompt-regexp name)
+               (ffap-file-exists-string (substring name (match-end 0)))))
         ;; Immediately test local filenames.  If default-directory is
         ;; remote, you probably already have a connection.
         ((and (not abs) (ffap-file-exists-string name)))
index 6ca1027710c350ffd36f74d34949776ae4fafaaf..edff77211e01aaaf9ff97a5eba3388c4b2b066b3 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author: Rajesh Vaidheeswarran <rv@gnu.org>
 ;; Keywords: convenience
 
-;; $Id: whitespace.el,v 1.25 2003/06/11 04:00:33 rv Exp $
+;; $Id: whitespace.el,v 1.26 2003/09/01 15:45:18 miles Exp $
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
@@ -33,7 +33,7 @@
 ;; 1. Leading space (empty lines at the top of a file).
 ;; 2. Trailing space (empty lines at the end of a file).
 ;; 3. Indentation space (8 or more spaces at beginning of line, that should be
-;;                   replaced with TABS).
+;;                   replaced with TABS).
 ;; 4. Spaces followed by a TAB.  (Almost always, we never want that).
 ;; 5. Spaces or TABS at the end of a line.
 ;;
@@ -87,7 +87,7 @@
 
 ;;; Code:
 
-(defvar whitespace-version "3.3" "Version of the whitespace library.")
+(defvar whitespace-version "3.4" "Version of the whitespace library.")
 
 (defvar whitespace-all-buffer-files nil
   "An associated list of buffers and files checked for whitespace cleanliness.
@@ -236,6 +236,12 @@ It can be overriden by setting a buffer local variable
   :type 'string
   :group 'whitespace)
 
+(defcustom whitespace-clean-msg "clean."
+  "If non-nil, this message will be displayed after a whitespace check
+determines a file to be clean."
+  :type 'string
+  :group 'whitespace)
+
 (defcustom whitespace-abort-on-error nil
   "While writing a file, abort if the file is unclean. If
 `whitespace-auto-cleanup' is set, that takes precedence over this
@@ -503,8 +509,9 @@ and:
                                         (concat "!" whitespace-unchecked)
                                       ""))
                                   whitespace-filename)))
-                 (if (not quiet)
-                     (message "%s clean" whitespace-filename))))))))
+                 (if (and (not quiet) (not (equal whitespace-clean-msg "")))
+                     (message "%s %s" whitespace-filename
+                              whitespace-clean-msg))))))))
     (if whitespace-error
        t
       nil)))
@@ -816,7 +823,7 @@ If timer is not set, then set it to scan the files in
 ;;;###autoload
 (define-minor-mode whitespace-global-mode
   "Toggle using Whitespace mode in new buffers.
-With ARG, turn the mode on if and only iff ARG is positive.
+With ARG, turn the mode on iff ARG is positive.
 
 When this mode is active, `whitespace-buffer' is added to
 `find-file-hook' and `kill-buffer-hook'."