aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRajesh Vaidheeswarran2003-09-29 18:05:31 +0000
committerRajesh Vaidheeswarran2003-09-29 18:05:31 +0000
commitc98ddbe5daa656e3cbd64c7132b01ba3206879b5 (patch)
tree7b596db54cfcbdb198aec0bfe61c46e5687f4e39
parenta1f3b57e951a07fc647e95c11a79734f3cb9786f (diff)
downloademacs-c98ddbe5daa656e3cbd64c7132b01ba3206879b5.tar.gz
emacs-c98ddbe5daa656e3cbd64c7132b01ba3206879b5.zip
whitespace.el now takes user customizable variable to display cleanliness of
files. ffap.el - bugfix.
-rw-r--r--lisp/ChangeLog17
-rw-r--r--lisp/ffap.el18
-rw-r--r--lisp/whitespace.el19
3 files changed, 48 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cbb64276ec8..dfecd4e9ce9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12003-09-29 Rajesh Vaidheeswarran <rv@gnu.org>
2
3 * whitespace.el (whitespace-clean-msg): Add user customizable message
4 for displaying ``clean'' output.
5 (whitespace-buffer): Use `whitespace-clean-msg'.
6 (whitespace-global-mode): Fix typo.
7
12003-09-29 Thien-Thi Nguyen <ttn@gnu.org> 82003-09-29 Thien-Thi Nguyen <ttn@gnu.org>
2 9
3 * pcvs.el (cvs-mode-unmark-up): Move to goal column when done. 10 * pcvs.el (cvs-mode-unmark-up): Move to goal column when done.
@@ -136,6 +143,16 @@
136 Handle paren-style types in Pike. Also fixed some cases of 143 Handle paren-style types in Pike. Also fixed some cases of
137 insufficient handling of unbalanced parens. 144 insufficient handling of unbalanced parens.
138 145
1462003-09-24 Rajesh Vaidheeswarran <rv@gnu.org>
147
148 * ffap.el (ffap-shell-prompt-regexp): Add regexp to identify
149 common shell prompts that are not common filename or URL
150 characters.
151 (ffap-file-at-point): Use the new regexp to strip the prompts from
152 the file names. This is an issue mostly for user prompts that
153 don't have a trailing space and find-file-at-point is invoked from
154 within a shell inside emacs.
155
1392003-09-24 Andre Spiegel <spiegel@gnu.org> 1562003-09-24 Andre Spiegel <spiegel@gnu.org>
140 157
141 * vc-cvs.el (vc-cvs-parse-entry): Restore the code to compare time 158 * vc-cvs.el (vc-cvs-parse-entry): Restore the code to compare time
diff --git a/lisp/ffap.el b/lisp/ffap.el
index 5711150e264..2b4c7826c28 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -65,6 +65,7 @@
65;; (setq ffap-alist nil) ; faster, dumber prompting 65;; (setq ffap-alist nil) ; faster, dumber prompting
66;; (setq ffap-machine-p-known 'accept) ; no pinging 66;; (setq ffap-machine-p-known 'accept) ; no pinging
67;; (setq ffap-url-regexp nil) ; disable URL features in ffap 67;; (setq ffap-url-regexp nil) ; disable URL features in ffap
68;; (setq ffap-shell-prompt-regexp nil) ; disable shell prompt stripping
68;; 69;;
69;; ffap uses `browse-url' (if found, else `w3-fetch') to fetch URL's. 70;; ffap uses `browse-url' (if found, else `w3-fetch') to fetch URL's.
70;; For a hairier `ffap-url-fetcher', try ffap-url.el (same ftp site). 71;; 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)."
120 (let ((sym (intern-soft name))) 121 (let ((sym (intern-soft name)))
121 (if (and sym (boundp sym)) (symbol-value sym) default))) 122 (if (and sym (boundp sym)) (symbol-value sym) default)))
122 123
124(defcustom ffap-shell-prompt-regexp
125 ;; This used to test for some shell prompts that don't have a space
126 ;; after them. The common root shell prompt (#) is not listed since it
127 ;; also doubles up as a valid URL character.
128 "[$%><]*"
129 "Paths matching this regexp are stripped off the shell prompt
130If nil, ffap doesn't do shell prompt stripping."
131 :type '(choice (const :tag "Disable" nil)
132 (const :tag "Standard" "[$%><]*")
133 regexp)
134 :group 'ffap)
135
123(defcustom ffap-ftp-regexp 136(defcustom ffap-ftp-regexp
124 ;; This used to test for ange-ftp or efs being present, but it should be 137 ;; This used to test for ange-ftp or efs being present, but it should be
125 ;; harmless (and simpler) to give it this value unconditionally. 138 ;; harmless (and simpler) to give it this value unconditionally.
@@ -1109,6 +1122,11 @@ which may actually result in an url rather than a filename."
1109 ;; Try stripping off line numbers; good for compilation/grep output. 1122 ;; Try stripping off line numbers; good for compilation/grep output.
1110 ((and (not abs) (string-match ":[0-9]" name) 1123 ((and (not abs) (string-match ":[0-9]" name)
1111 (ffap-file-exists-string (substring name 0 (match-beginning 0))))) 1124 (ffap-file-exists-string (substring name 0 (match-beginning 0)))))
1125 ;; Try stripping off prominent (non-root - #) shell prompts
1126 ;; if the ffap-shell-prompt-regexp is non-nil.
1127 ((and ffap-shell-prompt-regexp
1128 (not abs) (string-match ffap-shell-prompt-regexp name)
1129 (ffap-file-exists-string (substring name (match-end 0)))))
1112 ;; Immediately test local filenames. If default-directory is 1130 ;; Immediately test local filenames. If default-directory is
1113 ;; remote, you probably already have a connection. 1131 ;; remote, you probably already have a connection.
1114 ((and (not abs) (ffap-file-exists-string name))) 1132 ((and (not abs) (ffap-file-exists-string name)))
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 6ca1027710c..edff77211e0 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -5,7 +5,7 @@
5;; Author: Rajesh Vaidheeswarran <rv@gnu.org> 5;; Author: Rajesh Vaidheeswarran <rv@gnu.org>
6;; Keywords: convenience 6;; Keywords: convenience
7 7
8;; $Id: whitespace.el,v 1.25 2003/06/11 04:00:33 rv Exp $ 8;; $Id: whitespace.el,v 1.26 2003/09/01 15:45:18 miles Exp $
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10 10
11;; GNU Emacs is free software; you can redistribute it and/or modify 11;; GNU Emacs is free software; you can redistribute it and/or modify
@@ -33,7 +33,7 @@
33;; 1. Leading space (empty lines at the top of a file). 33;; 1. Leading space (empty lines at the top of a file).
34;; 2. Trailing space (empty lines at the end of a file). 34;; 2. Trailing space (empty lines at the end of a file).
35;; 3. Indentation space (8 or more spaces at beginning of line, that should be 35;; 3. Indentation space (8 or more spaces at beginning of line, that should be
36;; replaced with TABS). 36;; replaced with TABS).
37;; 4. Spaces followed by a TAB. (Almost always, we never want that). 37;; 4. Spaces followed by a TAB. (Almost always, we never want that).
38;; 5. Spaces or TABS at the end of a line. 38;; 5. Spaces or TABS at the end of a line.
39;; 39;;
@@ -87,7 +87,7 @@
87 87
88;;; Code: 88;;; Code:
89 89
90(defvar whitespace-version "3.3" "Version of the whitespace library.") 90(defvar whitespace-version "3.4" "Version of the whitespace library.")
91 91
92(defvar whitespace-all-buffer-files nil 92(defvar whitespace-all-buffer-files nil
93 "An associated list of buffers and files checked for whitespace cleanliness. 93 "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
236 :type 'string 236 :type 'string
237 :group 'whitespace) 237 :group 'whitespace)
238 238
239(defcustom whitespace-clean-msg "clean."
240 "If non-nil, this message will be displayed after a whitespace check
241determines a file to be clean."
242 :type 'string
243 :group 'whitespace)
244
239(defcustom whitespace-abort-on-error nil 245(defcustom whitespace-abort-on-error nil
240 "While writing a file, abort if the file is unclean. If 246 "While writing a file, abort if the file is unclean. If
241`whitespace-auto-cleanup' is set, that takes precedence over this 247`whitespace-auto-cleanup' is set, that takes precedence over this
@@ -503,8 +509,9 @@ and:
503 (concat "!" whitespace-unchecked) 509 (concat "!" whitespace-unchecked)
504 "")) 510 ""))
505 whitespace-filename))) 511 whitespace-filename)))
506 (if (not quiet) 512 (if (and (not quiet) (not (equal whitespace-clean-msg "")))
507 (message "%s clean" whitespace-filename)))))))) 513 (message "%s %s" whitespace-filename
514 whitespace-clean-msg))))))))
508 (if whitespace-error 515 (if whitespace-error
509 t 516 t
510 nil))) 517 nil)))
@@ -816,7 +823,7 @@ If timer is not set, then set it to scan the files in
816;;;###autoload 823;;;###autoload
817(define-minor-mode whitespace-global-mode 824(define-minor-mode whitespace-global-mode
818 "Toggle using Whitespace mode in new buffers. 825 "Toggle using Whitespace mode in new buffers.
819With ARG, turn the mode on if and only iff ARG is positive. 826With ARG, turn the mode on iff ARG is positive.
820 827
821When this mode is active, `whitespace-buffer' is added to 828When this mode is active, `whitespace-buffer' is added to
822`find-file-hook' and `kill-buffer-hook'." 829`find-file-hook' and `kill-buffer-hook'."