aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorMiles Bader2007-12-28 22:26:14 +0000
committerMiles Bader2007-12-28 22:26:14 +0000
commitb17f53abc28496125965f36147b76ea5f6a2b4fb (patch)
tree4293e53692f304327ba689dfeea32d1b0b5bc12a /lisp/progmodes
parent2e5093251c8e63f4546ffc30182dd4015e9a58fd (diff)
parentea7ac2eb953bf3c30670e60cb00a9fca611b38b7 (diff)
downloademacs-b17f53abc28496125965f36147b76ea5f6a2b4fb.tar.gz
emacs-b17f53abc28496125965f36147b76ea5f6a2b4fb.zip
Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-966
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/asm-mode.el8
-rw-r--r--lisp/progmodes/cc-vars.el58
-rw-r--r--lisp/progmodes/compile.el25
-rw-r--r--lisp/progmodes/grep.el4
4 files changed, 50 insertions, 45 deletions
diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el
index d38e6170a23..591adbd4392 100644
--- a/lisp/progmodes/asm-mode.el
+++ b/lisp/progmodes/asm-mode.el
@@ -79,6 +79,14 @@
79 (define-key map "\C-c;" 'comment-region) 79 (define-key map "\C-c;" 'comment-region)
80 (define-key map "\C-j" 'newline-and-indent) 80 (define-key map "\C-j" 'newline-and-indent)
81 (define-key map "\C-m" 'newline-and-indent) 81 (define-key map "\C-m" 'newline-and-indent)
82 (define-key map [menu-bar] (make-sparse-keymap))
83 (define-key map [menu-bar asm-mode] (cons "Asm" map))
84 (define-key map [asm-colon]
85 '("Insert Colon" . asm-colon))
86 (define-key map [comment-region]
87 '("Comment Region" . comment-region))
88 (define-key map [newline-and-indent]
89 '("Insert Newline and Indent" . newline-and-indent))
82 map) 90 map)
83 "Keymap for Asm mode.") 91 "Keymap for Asm mode.")
84 92
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 6110ab2250f..b1fcdc22241 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -156,44 +156,34 @@ Useful as last item in a `choice' widget."
156 (setq c-fallback-style (cons (cons name val) c-fallback-style))) 156 (setq c-fallback-style (cons (cons name val) c-fallback-style)))
157 157
158(defmacro defcustom-c-stylevar (name val doc &rest args) 158(defmacro defcustom-c-stylevar (name val doc &rest args)
159 "Define a style variable NAME with VAL and DOC. 159 "Defines a style variable."
160More precisely, convert the given `:type FOO', mined out of ARGS, 160 `(let ((-value- ,val))
161to an aggregate `:type (radio STYLE (PREAMBLE FOO))', append some 161 (c-set-stylevar-fallback ',name -value-)
162some boilerplate documentation to DOC, arrange for the fallback 162 (custom-declare-variable
163value of NAME to be VAL, and call `custom-declare-variable' to 163 ',name ''set-from-style
164do the rest of the work. 164 ,(concat doc "
165
166STYLE stands for the choice where the value is taken from some
167style setting. PREAMBLE is optionally prepended to FOO; that is,
168if FOO contains :tag or :value, the respective two-element list
169component is ignored."
170 (declare (debug (symbolp form stringp &rest)))
171 (let* ((expanded-doc (concat doc "
172 165
173This is a style variable. Apart from the valid values described 166This is a style variable. Apart from the valid values described
174above, it can be set to the symbol `set-from-style'. In that case, 167above, it can be set to the symbol `set-from-style'. In that case, it
175it takes its value from the style system (see `c-default-style' and 168takes its value from the style system (see `c-default-style' and
176`c-style-alist') when a CC Mode buffer is initialized. Otherwise, 169`c-style-alist') when a CC Mode buffer is initialized. Otherwise,
177the value set here overrides the style system (there is a variable 170the value set here overrides the style system (there is a variable
178`c-old-style-variable-behavior' that changes this, though).")) 171`c-old-style-variable-behavior' that changes this, though).")
179 (typ (eval (plist-get args :type))) 172 ,@(plist-put
180 (type (if (consp typ) typ (list typ))) 173 args ':type
181 (head (car type)) 174 `(` (radio
182 (tail (cdr type)) 175 (const :tag "Use style settings"
183 (newt (append (unless (plist-get tail :tag) 176 set-from-style)
184 '(:tag "Override style settings")) 177 ,(, (let ((type (eval (plist-get args ':type))))
185 (unless (plist-get tail :value) 178 (unless (consp type)
186 `(:value ,(eval val))) 179 (setq type (list type)))
187 tail)) 180 (unless (c-safe (plist-get (cdr type) ':value))
188 (aggregate `'(radio 181 (setcdr type (append '(:value (, -value-))
189 (const :tag "Use style settings" set-from-style) 182 (cdr type))))
190 ,(cons head newt)))) 183 (unless (c-safe (plist-get (cdr type) ':tag))
191 `(progn 184 (setcdr type (append '(:tag "Override style settings")
192 (c-set-stylevar-fallback ',name ,val) 185 (cdr type))))
193 (custom-declare-variable 186 (bq-process type)))))))))
194 ',name ''set-from-style
195 ,expanded-doc
196 ,@(plist-put args :type aggregate)))))
197 187
198(defun c-valid-offset (offset) 188(defun c-valid-offset (offset)
199 "Return non-nil if OFFSET is a valid offset for a syntactic symbol. 189 "Return non-nil if OFFSET is a valid offset for a syntactic symbol.
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 9a7b3eb5c08..6781862889c 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1163,10 +1163,6 @@ Returns the compilation buffer created."
1163 command "\n") 1163 command "\n")
1164 (setq thisdir default-directory)) 1164 (setq thisdir default-directory))
1165 (set-buffer-modified-p nil)) 1165 (set-buffer-modified-p nil))
1166 ;; If we're already in the compilation buffer, go to the end
1167 ;; of the buffer, so point will track the compilation output.
1168 (if (eq outbuf (current-buffer))
1169 (goto-char (point-max)))
1170 ;; Pop up the compilation buffer. 1166 ;; Pop up the compilation buffer.
1171 ;; http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01638.html 1167 ;; http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01638.html
1172 (setq outwin (display-buffer outbuf)) 1168 (setq outwin (display-buffer outbuf))
@@ -1192,10 +1188,18 @@ Returns the compilation buffer created."
1192 (set (make-local-variable 'revert-buffer-function) 1188 (set (make-local-variable 'revert-buffer-function)
1193 'compilation-revert-buffer) 1189 'compilation-revert-buffer)
1194 (set-window-start outwin (point-min)) 1190 (set-window-start outwin (point-min))
1195 (or (eq outwin (selected-window)) 1191
1196 (set-window-point outwin (if compilation-scroll-output 1192 ;; Position point as the user will see it.
1197 (point) 1193 (let ((desired-visible-point
1198 (point-min)))) 1194 ;; Put it at the end if `compilation-scroll-output' is set.
1195 (if compilation-scroll-output
1196 (point-max)
1197 ;; Normally put it at the top.
1198 (point-min))))
1199 (if (eq outwin (selected-window))
1200 (goto-char desired-visible-point)
1201 (set-window-point outwin desired-visible-point)))
1202
1199 ;; The setup function is called before compilation-set-window-height 1203 ;; The setup function is called before compilation-set-window-height
1200 ;; so it can set the compilation-window-height buffer locally. 1204 ;; so it can set the compilation-window-height buffer locally.
1201 (if compilation-process-setup-function 1205 (if compilation-process-setup-function
@@ -1219,7 +1223,10 @@ Returns the compilation buffer created."
1219 (setq mode-line-process '(":%s")) 1223 (setq mode-line-process '(":%s"))
1220 (set-process-sentinel proc 'compilation-sentinel) 1224 (set-process-sentinel proc 'compilation-sentinel)
1221 (set-process-filter proc 'compilation-filter) 1225 (set-process-filter proc 'compilation-filter)
1222 (set-marker (process-mark proc) (point) outbuf) 1226 ;; Use (point-max) here so that output comes in
1227 ;; after the initial text,
1228 ;; regardless of where the user sees point.
1229 (set-marker (process-mark proc) (point-max) outbuf)
1223 (when compilation-disable-input 1230 (when compilation-disable-input
1224 (condition-case nil 1231 (condition-case nil
1225 (process-send-eof proc) 1232 (process-send-eof proc)
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index f811fce6e7f..062fce4c346 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -839,10 +839,10 @@ This command shares argument histories with \\[lgrep] and \\[grep-find]."
839 grep-find-template 839 grep-find-template
840 regexp 840 regexp
841 (concat (shell-quote-argument "(") 841 (concat (shell-quote-argument "(")
842 " -name " 842 " " find-name-arg " "
843 (mapconcat #'shell-quote-argument 843 (mapconcat #'shell-quote-argument
844 (split-string files) 844 (split-string files)
845 " -o -name ") 845 (concat " -o " find-name-arg " "))
846 " " 846 " "
847 (shell-quote-argument ")")) 847 (shell-quote-argument ")"))
848 dir 848 dir