aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMiles Bader2004-10-04 01:04:18 +0000
committerMiles Bader2004-10-04 01:04:18 +0000
commitd3857d85ab7e18b5dafdb6395e811bb566f8184b (patch)
tree8ca58a68eabf852a340c3757e81a4f74b23f4c6d /lisp
parentb9b1c01690ef9e061dfa2a2c37ca4e7892a1172a (diff)
parentdd166d5fa1712b0dda35859c91d89666c2873471 (diff)
downloademacs-d3857d85ab7e18b5dafdb6395e811bb566f8184b.tar.gz
emacs-d3857d85ab7e18b5dafdb6395e811bb566f8184b.zip
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-50
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-587 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-588 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-589 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-590 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-593 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-39 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-40 - miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-41 Update from CVS
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog55
-rw-r--r--lisp/edmacro.el56
-rw-r--r--lisp/gnus/ChangeLog10
-rw-r--r--lisp/gnus/gnus-sum.el3
-rw-r--r--lisp/gnus/mailcap.el14
-rw-r--r--lisp/indent.el26
-rw-r--r--lisp/kmacro.el35
-rw-r--r--lisp/newcomment.el4
-rw-r--r--lisp/progmodes/cc-langs.el3
-rw-r--r--lisp/term.el83
-rw-r--r--lisp/textmodes/tex-mode.el74
11 files changed, 284 insertions, 79 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0ed8630d850..29abaaf21b8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,58 @@
12004-10-03 Stefan <monnier@iro.umontreal.ca>
2
3 * textmodes/tex-mode.el (tex-dvi-view-command): Use `yap' on w32.
4 (tex-font-lock-keywords-1): Add url and nolinkurl for args with `_'.
5 (latex-block-args-alist): Add minipage and picture.
6 (latex-block-body-alist): Use reftex-label if enabled.
7 (latex-insert-block): Don't insert a \n if not necessary.
8 (tex-compile-commands): Make sure dvips doesn't send to printer.
9 (tex-compile-default): Handle the case where no executable is found.
10 (latex-noindent-environments): New var.
11 (latex-find-indent): Use it. Take an empty line as an arg-breaker.
12 If tex-indent-allhanging is non-nil, make sure we only align for macros
13 at beginning of line.
14
152004-10-03 Daniel Pfeiffer <occitan@esperanto.org>
16
17 * newcomment.el (comment-beginning): Doc fix and don't choke on
18 unset `comment-end-skip' when at beginning of comment.
19
202004-10-02 Dan Nicolaescu <dann@ics.uci.edu>
21
22 * term.el (term-adjust-current-row-cache): Don't allow the current
23 row to become negative.
24 (term-emulate-terminal): Fix insert mode. Handle tab insertion at
25 the end of the line. Fix scroll down. Add comments.
26 (term-handle-ansi-escape): Don't exceed terminal width when moving
27 right.
28 (term-scroll-region): Move the cursor after setting the scroll region.
29
302004-10-01 Luc Teirlinck <teirllm@auburn.edu>
31
32 * indent.el (set-left-margin, set-right-margin): Rename `lm' arg
33 to `width' for consistency with docstring. Doc fix.
34
352004-10-01 Martin Stjernholm <bug-cc-mode@gnu.org>
36
37 * progmodes/cc-langs.el: Load cl here since cc-defs doesn't do it.
38 This is necessary for derived modes.
39
402004-09-30 Kim F. Storm <storm@cua.dk>
41
42 * kmacro.el (kmacro-lambda-form, kmacro-extract-lambda): Add.
43 (kmacro-bind-to-key, kmacro-name-last-macro): Use kmacro-lambda-form.
44
45 * edmacro.el: Require kmacro to use the new kmacro-lambda-form and
46 kmacro-extract-lambda functions.
47 (edit-kbd-macro): Handle kmacro lambda forms.
48 Include counter and counter format in edit buffer.
49 (edmacro-finish-edit): Get counter and format from edit buffer and
50 update kmacro bindings when found.
51
12004-09-29 Luc Teirlinck <teirllm@auburn.edu> 522004-09-29 Luc Teirlinck <teirllm@auburn.edu>
2 53
3 * textmodes/paragraphs.el (forward-paragraph): Avoid 54 * textmodes/paragraphs.el (forward-paragraph):
4 args-out-of-range error when point winds up at the beginning of 55 Avoid args-out-of-range error when point winds up at the beginning of
5 the buffer and hard newlines are enabled. 56 the buffer and hard newlines are enabled.
6 57
7 * newcomment.el (comment-multi-line): Doc fix. 58 * newcomment.el (comment-multi-line): Doc fix.
diff --git a/lisp/edmacro.el b/lisp/edmacro.el
index 072b52fc8fd..b40cbaafe2d 100644
--- a/lisp/edmacro.el
+++ b/lisp/edmacro.el
@@ -73,6 +73,8 @@
73(eval-when-compile 73(eval-when-compile
74 (require 'cl)) 74 (require 'cl))
75 75
76(require 'kmacro)
77
76;;; The user-level commands for editing macros. 78;;; The user-level commands for editing macros.
77 79
78;;;###autoload 80;;;###autoload
@@ -101,7 +103,8 @@ With a prefix argument, format the macro in a more concise way."
101 (interactive "kKeyboard macro to edit (C-x e, M-x, C-h l, or keys): \nP") 103 (interactive "kKeyboard macro to edit (C-x e, M-x, C-h l, or keys): \nP")
102 (when keys 104 (when keys
103 (let ((cmd (if (arrayp keys) (key-binding keys) keys)) 105 (let ((cmd (if (arrayp keys) (key-binding keys) keys))
104 (mac nil)) 106 (mac nil) (mac-counter nil) (mac-format nil)
107 kmacro)
105 (cond (store-hook 108 (cond (store-hook
106 (setq mac keys) 109 (setq mac keys)
107 (setq cmd nil)) 110 (setq cmd nil))
@@ -112,14 +115,17 @@ With a prefix argument, format the macro in a more concise way."
112 (y-or-n-p "No keyboard macro defined. Create one? ") 115 (y-or-n-p "No keyboard macro defined. Create one? ")
113 (keyboard-quit)) 116 (keyboard-quit))
114 (setq mac (or last-kbd-macro "")) 117 (setq mac (or last-kbd-macro ""))
118 (setq keys nil)
115 (setq cmd 'last-kbd-macro)) 119 (setq cmd 'last-kbd-macro))
116 ((eq cmd 'execute-extended-command) 120 ((eq cmd 'execute-extended-command)
117 (setq cmd (read-command "Name of keyboard macro to edit: ")) 121 (setq cmd (read-command "Name of keyboard macro to edit: "))
118 (if (string-equal cmd "") 122 (if (string-equal cmd "")
119 (error "No command name given")) 123 (error "No command name given"))
124 (setq keys nil)
120 (setq mac (symbol-function cmd))) 125 (setq mac (symbol-function cmd)))
121 ((memq cmd '(view-lossage electric-view-lossage)) 126 ((memq cmd '(view-lossage electric-view-lossage))
122 (setq mac (recent-keys)) 127 (setq mac (recent-keys))
128 (setq keys nil)
123 (setq cmd 'last-kbd-macro)) 129 (setq cmd 'last-kbd-macro))
124 ((null cmd) 130 ((null cmd)
125 (error "Key sequence %s is not defined" (key-description keys))) 131 (error "Key sequence %s is not defined" (key-description keys)))
@@ -128,6 +134,10 @@ With a prefix argument, format the macro in a more concise way."
128 (t 134 (t
129 (setq mac cmd) 135 (setq mac cmd)
130 (setq cmd nil))) 136 (setq cmd nil)))
137 (when (setq kmacro (kmacro-extract-lambda mac))
138 (setq mac (car kmacro)
139 mac-counter (nth 1 kmacro)
140 mac-format (nth 2 kmacro)))
131 (unless (arrayp mac) 141 (unless (arrayp mac)
132 (error "Key sequence %s is not a keyboard macro" 142 (error "Key sequence %s is not a keyboard macro"
133 (key-description keys))) 143 (key-description keys)))
@@ -153,11 +163,15 @@ With a prefix argument, format the macro in a more concise way."
153 (insert ";; Original keys: " fmt "\n") 163 (insert ";; Original keys: " fmt "\n")
154 (unless store-hook 164 (unless store-hook
155 (insert "\nCommand: " (if cmd (symbol-name cmd) "none") "\n") 165 (insert "\nCommand: " (if cmd (symbol-name cmd) "none") "\n")
156 (let ((keys (where-is-internal (or cmd mac) '(keymap)))) 166 (let ((gkeys (where-is-internal (or cmd mac) '(keymap))))
157 (if keys 167 (if (and keys (not (member keys gkeys)))
158 (while keys 168 (setq gkeys (cons keys gkeys)))
159 (insert "Key: " (edmacro-format-keys (pop keys) 1) "\n")) 169 (if gkeys
160 (insert "Key: none\n")))) 170 (while gkeys
171 (insert "Key: " (edmacro-format-keys (pop gkeys) 1) "\n"))
172 (insert "Key: none\n")))
173 (when (and mac-counter mac-format)
174 (insert (format "Counter: %d\nFormat: \"%s\"\n" mac-counter mac-format))))
161 (insert "\nMacro:\n\n") 175 (insert "\nMacro:\n\n")
162 (save-excursion 176 (save-excursion
163 (insert fmtv "\n")) 177 (insert fmtv "\n"))
@@ -217,6 +231,7 @@ or nil, use a compact 80-column format."
217 "This command is valid only in buffers created by `edit-kbd-macro'")) 231 "This command is valid only in buffers created by `edit-kbd-macro'"))
218 (run-hooks 'edmacro-finish-hook) 232 (run-hooks 'edmacro-finish-hook)
219 (let ((cmd nil) (keys nil) (no-keys nil) 233 (let ((cmd nil) (keys nil) (no-keys nil)
234 (mac-counter nil) (mac-format nil) (kmacro nil)
220 (top (point-min))) 235 (top (point-min)))
221 (goto-char top) 236 (goto-char top)
222 (let ((case-fold-search nil)) 237 (let ((case-fold-search nil))
@@ -231,6 +246,7 @@ or nil, use a compact 80-column format."
231 (setq cmd (and (not (equal str "none")) 246 (setq cmd (and (not (equal str "none"))
232 (intern str))) 247 (intern str)))
233 (and (fboundp cmd) (not (arrayp (symbol-function cmd))) 248 (and (fboundp cmd) (not (arrayp (symbol-function cmd)))
249 (not (setq kmacro (get cmd 'kmacro)))
234 (not (y-or-n-p 250 (not (y-or-n-p
235 (format "Command %s is already defined; %s" 251 (format "Command %s is already defined; %s"
236 cmd "proceed? "))) 252 cmd "proceed? ")))
@@ -248,6 +264,7 @@ or nil, use a compact 80-column format."
248 (push key keys) 264 (push key keys)
249 (let ((b (key-binding key))) 265 (let ((b (key-binding key)))
250 (and b (commandp b) (not (arrayp b)) 266 (and b (commandp b) (not (arrayp b))
267 (not (kmacro-extract-lambda b))
251 (or (not (fboundp b)) 268 (or (not (fboundp b))
252 (not (arrayp (symbol-function b)))) 269 (not (arrayp (symbol-function b))))
253 (not (y-or-n-p 270 (not (y-or-n-p
@@ -256,6 +273,22 @@ or nil, use a compact 80-column format."
256 "proceed? "))) 273 "proceed? ")))
257 (keyboard-quit)))))) 274 (keyboard-quit))))))
258 t) 275 t)
276 ((looking-at "Counter:[ \t]*\\([^ \t\n]*\\)[ \t]*$")
277 (when edmacro-store-hook
278 (error "\"Counter\" line not allowed in this context"))
279 (let ((str (buffer-substring (match-beginning 1)
280 (match-end 1))))
281 (unless (equal str "")
282 (setq mac-counter (string-to-int str))))
283 t)
284 ((looking-at "Format:[ \t]*\"\\([^\n]*\\)\"[ \t]*$")
285 (when edmacro-store-hook
286 (error "\"Format\" line not allowed in this context"))
287 (let ((str (buffer-substring (match-beginning 1)
288 (match-end 1))))
289 (unless (equal str "")
290 (setq mac-format str)))
291 t)
259 ((looking-at "Macro:[ \t\n]*") 292 ((looking-at "Macro:[ \t\n]*")
260 (goto-char (match-end 0)) 293 (goto-char (match-end 0))
261 nil) 294 nil)
@@ -285,7 +318,10 @@ or nil, use a compact 80-column format."
285 (when cmd 318 (when cmd
286 (if (= (length mac) 0) 319 (if (= (length mac) 0)
287 (fmakunbound cmd) 320 (fmakunbound cmd)
288 (fset cmd mac))) 321 (fset cmd
322 (if (and mac-counter mac-format)
323 (kmacro-lambda-form mac mac-counter mac-format)
324 mac))))
289 (if no-keys 325 (if no-keys
290 (when cmd 326 (when cmd
291 (loop for key in (where-is-internal cmd '(keymap)) do 327 (loop for key in (where-is-internal cmd '(keymap)) do
@@ -294,7 +330,11 @@ or nil, use a compact 80-column format."
294 (if (= (length mac) 0) 330 (if (= (length mac) 0)
295 (loop for key in keys do (global-unset-key key)) 331 (loop for key in keys do (global-unset-key key))
296 (loop for key in keys do 332 (loop for key in keys do
297 (global-set-key key (or cmd mac))))))))) 333 (global-set-key key
334 (or cmd
335 (if (and mac-counter mac-format)
336 (kmacro-lambda-form mac mac-counter mac-format)
337 mac))))))))))
298 (kill-buffer buf) 338 (kill-buffer buf)
299 (when (buffer-name obuf) 339 (when (buffer-name obuf)
300 (switch-to-buffer obuf)) 340 (switch-to-buffer obuf))
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 6ac6d46e28f..907ad5f3411 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,13 @@
12004-10-01 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus-sum.el (gnus-summary-toggle-header): Make it work even if
4 there's no visible header.
5
62004-10-01 Simon Josefsson <jas@extundo.com>
7
8 * mailcap.el (mailcap-mime-data): Add pdf. Remove non-free
9 acroread.
10
12004-09-29 Jesper Harder <harder@ifa.au.dk> 112004-09-29 Jesper Harder <harder@ifa.au.dk>
2 12
3 * gnus.el (gnus-method-to-server): Oops, move it don't delete it. 13 * gnus.el (gnus-method-to-server): Oops, move it don't delete it.
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 7ecc7eb19b9..40278da4716 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -8732,7 +8732,8 @@ If ARG is a negative number, hide the unwanted header lines."
8732 (inhibit-point-motion-hooks t) 8732 (inhibit-point-motion-hooks t)
8733 (hidden (if (numberp arg) 8733 (hidden (if (numberp arg)
8734 (>= arg 0) 8734 (>= arg 0)
8735 (gnus-article-hidden-text-p 'headers))) 8735 (or (not (looking-at "[^ \t\n]+:"))
8736 (gnus-article-hidden-text-p 'headers))))
8736 s e) 8737 s e)
8737 (delete-region (point-min) (point-max)) 8738 (delete-region (point-min) (point-max))
8738 (with-current-buffer gnus-original-article-buffer 8739 (with-current-buffer gnus-original-article-buffer
diff --git a/lisp/gnus/mailcap.el b/lisp/gnus/mailcap.el
index db0ab6143e1..d285e342370 100644
--- a/lisp/gnus/mailcap.el
+++ b/lisp/gnus/mailcap.el
@@ -1,5 +1,5 @@
1;;; mailcap.el --- MIME media types configuration 1;;; mailcap.el --- MIME media types configuration
2;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 2;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
3;; Free Software Foundation, Inc. 3;; Free Software Foundation, Inc.
4 4
5;; Author: William M. Perry <wmperry@aventail.com> 5;; Author: William M. Perry <wmperry@aventail.com>
@@ -135,23 +135,21 @@
135 (non-viewer . t) 135 (non-viewer . t)
136 (type . "application/zip") 136 (type . "application/zip")
137 ("copiousoutput")) 137 ("copiousoutput"))
138 ;; Prefer free viewers.
139 ("pdf" 138 ("pdf"
140 (viewer . "gv -safer %s") 139 (viewer . "gv -safer %s")
141 (type . "application/pdf") 140 (type . "application/pdf")
142 (test . window-system) 141 (test . window-system)
143 ("print" . ,(concat "pdf2ps %s - | " mailcap-print-command))) 142 ("print" . ,(concat "pdf2ps %s - | " mailcap-print-command)))
144 ("pdf" 143 ("pdf"
145 (viewer . "xpdf %s") 144 (viewer . "gpdf %s")
146 (type . "application/pdf") 145 (type . "application/pdf")
147 ("print" . ,(concat "pdftops %s - | " mailcap-print-command)) 146 ("print" . ,(concat "pdftops %s - | " mailcap-print-command))
148 (test . (eq window-system 'x))) 147 (test . (eq window-system 'x)))
149 ("pdf" 148 ("pdf"
150 (viewer . "acroread %s") 149 (viewer . "xpdf %s")
151 (type . "application/pdf") 150 (type . "application/pdf")
152 ("print" . ,(concat "cat %s | acroread -toPostScript | " 151 ("print" . ,(concat "pdftops %s - | " mailcap-print-command))
153 mailcap-print-command)) 152 (test . (eq window-system 'x)))
154 (test . window-system))
155 ("pdf" 153 ("pdf"
156 (viewer . ,(concat "pdftotext %s -")) 154 (viewer . ,(concat "pdftotext %s -"))
157 (type . "application/pdf") 155 (type . "application/pdf")
diff --git a/lisp/indent.el b/lisp/indent.el
index 3f423adbace..e1a9cae4819 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -1,6 +1,6 @@
1;;; indent.el --- indentation commands for Emacs 1;;; indent.el --- indentation commands for Emacs
2 2
3;; Copyright (C) 1985, 1995, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1985, 1995, 2001, 2004 Free Software Foundation, Inc.
4 4
5;; Maintainer: FSF 5;; Maintainer: FSF
6 6
@@ -198,11 +198,14 @@ Args FROM and TO are optional; default is the whole buffer."
198 (forward-line 1)) 198 (forward-line 1))
199 (move-marker to nil))) 199 (move-marker to nil)))
200 200
201(defun set-left-margin (from to lm) 201(defun set-left-margin (from to width)
202 "Set the left margin of the region to WIDTH. 202 "Set the left margin of the region to WIDTH.
203If `auto-fill-mode' is active, re-fill the region to fit the new margin." 203If `auto-fill-mode' is active, re-fill the region to fit the new margin.
204
205Interactively, WIDTH is the prefix argument, if specified.
206Without prefix argument, the command prompts for WIDTH."
204 (interactive "r\nNSet left margin to column: ") 207 (interactive "r\nNSet left margin to column: ")
205 (if (interactive-p) (setq lm (prefix-numeric-value lm))) 208 (if (interactive-p) (setq width (prefix-numeric-value width)))
206 (save-excursion 209 (save-excursion
207 ;; If inside indentation, start from BOL. 210 ;; If inside indentation, start from BOL.
208 (goto-char from) 211 (goto-char from)
@@ -214,21 +217,24 @@ If `auto-fill-mode' is active, re-fill the region to fit the new margin."
214 (setq to (point-marker))) 217 (setq to (point-marker)))
215 ;; Delete margin indentation first, but keep paragraph indentation. 218 ;; Delete margin indentation first, but keep paragraph indentation.
216 (delete-to-left-margin from to) 219 (delete-to-left-margin from to)
217 (put-text-property from to 'left-margin lm) 220 (put-text-property from to 'left-margin width)
218 (indent-rigidly from to lm) 221 (indent-rigidly from to width)
219 (if auto-fill-function (save-excursion (fill-region from to nil t t))) 222 (if auto-fill-function (save-excursion (fill-region from to nil t t)))
220 (move-marker to nil)) 223 (move-marker to nil))
221 224
222(defun set-right-margin (from to lm) 225(defun set-right-margin (from to width)
223 "Set the right margin of the region to WIDTH. 226 "Set the right margin of the region to WIDTH.
224If `auto-fill-mode' is active, re-fill the region to fit the new margin." 227If `auto-fill-mode' is active, re-fill the region to fit the new margin.
228
229Interactively, WIDTH is the prefix argument, if specified.
230Without prefix argument, the command prompts for WIDTH."
225 (interactive "r\nNSet right margin to width: ") 231 (interactive "r\nNSet right margin to width: ")
226 (if (interactive-p) (setq lm (prefix-numeric-value lm))) 232 (if (interactive-p) (setq width (prefix-numeric-value width)))
227 (save-excursion 233 (save-excursion
228 (goto-char from) 234 (goto-char from)
229 (skip-chars-backward " \t") 235 (skip-chars-backward " \t")
230 (if (bolp) (setq from (point)))) 236 (if (bolp) (setq from (point))))
231 (put-text-property from to 'right-margin lm) 237 (put-text-property from to 'right-margin width)
232 (if auto-fill-function (save-excursion (fill-region from to nil t t)))) 238 (if auto-fill-function (save-excursion (fill-region from to nil t t))))
233 239
234(defun alter-text-property (from to prop func &optional object) 240(defun alter-text-property (from to prop func &optional object)
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index 5aefe46625d..b2226d4a895 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -740,6 +740,30 @@ If kbd macro currently being defined end it before activating it."
740;; letters and digits, provided that we inhibit the keymap while 740;; letters and digits, provided that we inhibit the keymap while
741;; executing the macro later on (but that's controversial...) 741;; executing the macro later on (but that's controversial...)
742 742
743(defun kmacro-lambda-form (mac &optional counter format)
744 "Create lambda form for macro bound to symbol or key."
745 (if counter
746 (setq mac (list mac counter format)))
747 `(lambda (&optional arg)
748 "Keyboard macro."
749 (interactive "p")
750 (kmacro-exec-ring-item ',mac arg)))
751
752(defun kmacro-extract-lambda (mac)
753 "Extract kmacro from a kmacro lambda form."
754 (and (consp mac)
755 (eq (car mac) 'lambda)
756 (setq mac (assoc 'kmacro-exec-ring-item mac))
757 (consp (cdr mac))
758 (consp (car (cdr mac)))
759 (consp (cdr (car (cdr mac))))
760 (setq mac (car (cdr (car (cdr mac)))))
761 (listp mac)
762 (= (length mac) 3)
763 (arrayp (car mac))
764 mac))
765
766
743(defun kmacro-bind-to-key (arg) 767(defun kmacro-bind-to-key (arg)
744 "When not defining or executing a macro, offer to bind last macro to a key. 768 "When not defining or executing a macro, offer to bind last macro to a key.
745The key sequences [C-x C-k 0] through [C-x C-k 9] and [C-x C-k A] 769The key sequences [C-x C-k 0] through [C-x C-k 9] and [C-x C-k A]
@@ -775,10 +799,7 @@ may be shaded by a local key binding."
775 (format-kbd-macro key-seq) 799 (format-kbd-macro key-seq)
776 cmd)))) 800 cmd))))
777 (define-key global-map key-seq 801 (define-key global-map key-seq
778 `(lambda (&optional arg) 802 (kmacro-lambda-form (kmacro-ring-head)))
779 "Keyboard macro."
780 (interactive "p")
781 (kmacro-exec-ring-item ',(kmacro-ring-head) arg)))
782 (message "Keyboard macro bound to %s" (format-kbd-macro key-seq)))))) 803 (message "Keyboard macro bound to %s" (format-kbd-macro key-seq))))))
783 804
784 805
@@ -798,11 +819,7 @@ Such a \"function\" cannot be called from Lisp, but it is a valid editor command
798 symbol)) 819 symbol))
799 (if (string-equal symbol "") 820 (if (string-equal symbol "")
800 (error "No command name given")) 821 (error "No command name given"))
801 (fset symbol 822 (fset symbol (kmacro-lambda-form (kmacro-ring-head)))
802 `(lambda (&optional arg)
803 "Keyboard macro."
804 (interactive "p")
805 (kmacro-exec-ring-item ',(kmacro-ring-head) arg)))
806 (put symbol 'kmacro t)) 823 (put symbol 'kmacro t))
807 824
808 825
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 120777ab704..5711e7903ad 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -423,7 +423,7 @@ and raises an error or returns nil if NOERROR is non-nil."
423(defun comment-beginning () 423(defun comment-beginning ()
424 "Find the beginning of the enclosing comment. 424 "Find the beginning of the enclosing comment.
425Returns nil if not inside a comment, else moves point and returns 425Returns nil if not inside a comment, else moves point and returns
426the same as `comment-search-forward'." 426the same as `comment-search-backward'."
427 ;; HACK ATTACK! 427 ;; HACK ATTACK!
428 ;; We should really test `in-string-p' but that can be expensive. 428 ;; We should really test `in-string-p' but that can be expensive.
429 (unless (eq (get-text-property (point) 'face) 'font-lock-string-face) 429 (unless (eq (get-text-property (point) 'face) 'font-lock-string-face)
@@ -435,7 +435,7 @@ the same as `comment-search-forward'."
435 (and 435 (and
436 ;; For modes where comment-start and comment-end are the same, 436 ;; For modes where comment-start and comment-end are the same,
437 ;; the search above may have found a `ce' rather than a `cs'. 437 ;; the search above may have found a `ce' rather than a `cs'.
438 (or (not (looking-at comment-end-skip)) 438 (or (if comment-end-skip (not (looking-at comment-end-skip)))
439 ;; Maybe font-lock knows that it's a `cs'? 439 ;; Maybe font-lock knows that it's a `cs'?
440 (eq (get-text-property (match-end 0) 'face) 440 (eq (get-text-property (match-end 0) 'face)
441 'font-lock-comment-face) 441 'font-lock-comment-face)
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 6aeb70ba4e3..6a36f89c8d3 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -124,6 +124,9 @@
124(cc-require 'cc-defs) 124(cc-require 'cc-defs)
125(cc-require 'cc-vars) 125(cc-require 'cc-vars)
126 126
127;; This file is not always loaded. See note above.
128(cc-external-require 'cl)
129
127 130
128;;; Setup for the `c-lang-defvar' system. 131;;; Setup for the `c-lang-defvar' system.
129 132
diff --git a/lisp/term.el b/lisp/term.el
index 35bb74834b5..07702551718 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -2586,8 +2586,9 @@ See `term-prompt-regexp'."
2586 (- (term-vertical-motion -9999)))))))) 2586 (- (term-vertical-motion -9999))))))))
2587 2587
2588(defun term-adjust-current-row-cache (delta) 2588(defun term-adjust-current-row-cache (delta)
2589 (if term-current-row 2589 (when term-current-row
2590 (setq term-current-row (+ term-current-row delta)))) 2590 (setq term-current-row
2591 (max 0 (+ term-current-row delta)))))
2591 2592
2592(defun term-terminal-pos () 2593(defun term-terminal-pos ()
2593 (save-excursion ; save-restriction 2594 (save-excursion ; save-restriction
@@ -2762,7 +2763,17 @@ See `term-prompt-regexp'."
2762 (when (not (or (eobp) term-insert-mode)) 2763 (when (not (or (eobp) term-insert-mode))
2763 (setq pos (point)) 2764 (setq pos (point))
2764 (term-move-columns columns) 2765 (term-move-columns columns)
2765 (delete-region pos (point)))) 2766 (delete-region pos (point)))
2767 ;; In insert if the if the current line
2768 ;; has become too long it needs to be
2769 ;; chopped off.
2770 (when term-insert-mode
2771 (setq pos (point))
2772 (end-of-line)
2773 (when (> (current-column) term-width)
2774 (delete-region (- (point) (- (current-column) term-width))
2775 (point)))
2776 (goto-char pos)))
2766 (setq term-current-column nil) 2777 (setq term-current-column nil)
2767 2778
2768 (put-text-property old-point (point) 2779 (put-text-property old-point (point)
@@ -2776,12 +2787,21 @@ See `term-prompt-regexp'."
2776 (setq i (1- funny))) 2787 (setq i (1- funny)))
2777 ((and (setq term-terminal-state 0) 2788 ((and (setq term-terminal-state 0)
2778 (eq char ?\^I)) ; TAB (terminfo: ht) 2789 (eq char ?\^I)) ; TAB (terminfo: ht)
2779 ;; FIXME: Does not handle line wrap!
2780 (setq count (term-current-column)) 2790 (setq count (term-current-column))
2781 (setq count (+ count 8 (- (mod count 8)))) 2791 ;; The line cannot exceed term-width. TAB at
2782 (if (< (move-to-column count nil) count) 2792 ;; the end of a line should not cause wrapping.
2783 (term-insert-char char 1)) 2793 (setq count (min term-width
2784 (setq term-current-column count)) 2794 (+ count 8 (- (mod count 8)))))
2795 (if (> term-width count)
2796 (progn
2797 (term-move-columns
2798 (- count (term-current-column)))
2799 (setq term-current-column count))
2800 (when (> term-width (term-current-column))
2801 (term-move-columns
2802 (1- (- term-width (term-current-column)))))
2803 (when (= term-width (term-current-column))
2804 (term-move-columns -1))))
2785 ((eq char ?\r) 2805 ((eq char ?\r)
2786 ;; Optimize CRLF at end of buffer: 2806 ;; Optimize CRLF at end of buffer:
2787 (cond ((and (< (setq temp (1+ i)) str-length) 2807 (cond ((and (< (setq temp (1+ i)) str-length)
@@ -2849,8 +2869,14 @@ See `term-prompt-regexp'."
2849 (term-handle-deferred-scroll) 2869 (term-handle-deferred-scroll)
2850 (term-down 1 t) 2870 (term-down 1 t)
2851 (setq term-terminal-state 0)) 2871 (setq term-terminal-state 0))
2852 ((eq char ?M) ;; scroll reversed 2872 ;; ((eq char ?E) ;; (terminfo: nw), not used for
2853 (term-insert-lines 1) 2873 ;; ;; now, but this is a working
2874 ;; ;; implementation
2875 ;; (term-down 1)
2876 ;; (term-goto term-current-row 0)
2877 ;; (setq term-terminal-state 0))
2878 ((eq char ?M) ;; scroll reversed (terminfo: ri)
2879 (term-down -1)
2854 (setq term-terminal-state 0)) 2880 (setq term-terminal-state 0))
2855 ((eq char ?7) ;; Save cursor (terminfo: sc) 2881 ((eq char ?7) ;; Save cursor (terminfo: sc)
2856 (term-handle-deferred-scroll) 2882 (term-handle-deferred-scroll)
@@ -2863,6 +2889,13 @@ See `term-prompt-regexp'."
2863 (term-goto (car term-saved-cursor) 2889 (term-goto (car term-saved-cursor)
2864 (cdr term-saved-cursor))) 2890 (cdr term-saved-cursor)))
2865 (setq term-terminal-state 0)) 2891 (setq term-terminal-state 0))
2892 ;; The \E#8 reset sequence for xterm. We
2893 ;; probably don't need to handle it, but this
2894 ;; is the code to parse it.
2895 ;; ((eq char ?#)
2896 ;; (when (eq (aref str (1+ i)) ?8)
2897 ;; (setq i (1+ i))
2898 ;; (setq term-terminal-state 0)))
2866 ((setq term-terminal-state 0)))) 2899 ((setq term-terminal-state 0))))
2867 ((eq term-terminal-state 3) ; Seen Esc [ 2900 ((eq term-terminal-state 3) ; Seen Esc [
2868 (cond ((and (>= char ?0) (<= char ?9)) 2901 (cond ((and (>= char ?0) (<= char ?9))
@@ -3119,7 +3152,10 @@ See `term-prompt-regexp'."
3119 3152
3120(defun term-handle-ansi-escape (proc char) 3153(defun term-handle-ansi-escape (proc char)
3121 (cond 3154 (cond
3122 ((eq char ?H) ; cursor motion 3155 ((or (eq char ?H) ; cursor motion (terminfo: cup)
3156 ;; (eq char ?f) ; xterm seems to handle this sequence too, not
3157 ;; needed for now
3158 )
3123 (if (<= term-terminal-parameter 0) 3159 (if (<= term-terminal-parameter 0)
3124 (setq term-terminal-parameter 1)) 3160 (setq term-terminal-parameter 1))
3125 (if (<= term-terminal-previous-parameter 0) 3161 (if (<= term-terminal-previous-parameter 0)
@@ -3131,17 +3167,21 @@ See `term-prompt-regexp'."
3131 (term-goto 3167 (term-goto
3132 (1- term-terminal-previous-parameter) 3168 (1- term-terminal-previous-parameter)
3133 (1- term-terminal-parameter))) 3169 (1- term-terminal-parameter)))
3134 ;; \E[A - cursor up (terminfo: cuu1) 3170 ;; \E[A - cursor up (terminfo: cuu, cuu1)
3135 ((eq char ?A) 3171 ((eq char ?A)
3136 (term-handle-deferred-scroll) 3172 (term-handle-deferred-scroll)
3137 (term-down (- (max 1 term-terminal-parameter)) t)) 3173 (term-down (- (max 1 term-terminal-parameter)) t))
3138 ;; \E[B - cursor down 3174 ;; \E[B - cursor down (terminfo: cud)
3139 ((eq char ?B) 3175 ((eq char ?B)
3140 (term-down (max 1 term-terminal-parameter) t)) 3176 (term-down (max 1 term-terminal-parameter) t))
3141 ;; \E[C - cursor right 3177 ;; \E[C - cursor right (terminfo: cuf)
3142 ((eq char ?C) 3178 ((eq char ?C)
3143 (term-move-columns (max 1 term-terminal-parameter))) 3179 (term-move-columns
3144 ;; \E[D - cursor left 3180 (max 1
3181 (if (>= (+ term-terminal-parameter (term-current-column)) term-width)
3182 (- term-width (term-current-column) 1)
3183 term-terminal-parameter))))
3184 ;; \E[D - cursor left (terminfo: cub)
3145 ((eq char ?D) 3185 ((eq char ?D)
3146 (term-move-columns (- (max 1 term-terminal-parameter)))) 3186 (term-move-columns (- (max 1 term-terminal-parameter))))
3147 ;; \E[J - clear to end of screen (terminfo: ed, clear) 3187 ;; \E[J - clear to end of screen (terminfo: ed, clear)
@@ -3199,7 +3239,7 @@ See `term-prompt-regexp'."
3199 (1+ (term-current-row)) 3239 (1+ (term-current-row))
3200 (1+ (term-horizontal-column))))) 3240 (1+ (term-horizontal-column)))))
3201 ;; \E[r - Set scrolling region 3241 ;; \E[r - Set scrolling region
3202 ((eq char ?r) 3242 ((eq char ?r) ;; (terminfo: csr)
3203 (term-scroll-region 3243 (term-scroll-region
3204 (1- term-terminal-previous-parameter) 3244 (1- term-terminal-previous-parameter)
3205 term-terminal-parameter)) 3245 term-terminal-parameter))
@@ -3221,7 +3261,10 @@ The top-most line is line 0."
3221 (setq term-scroll-with-delete 3261 (setq term-scroll-with-delete
3222 (or (term-using-alternate-sub-buffer) 3262 (or (term-using-alternate-sub-buffer)
3223 (not (and (= term-scroll-start 0) 3263 (not (and (= term-scroll-start 0)
3224 (= term-scroll-end term-height)))))) 3264 (= term-scroll-end term-height)))))
3265 (term-move-columns (- (term-current-column)))
3266 (term-goto
3267 term-scroll-start (term-current-column)))
3225 3268
3226;; (defun term-switch-to-alternate-sub-buffer (set) 3269;; (defun term-switch-to-alternate-sub-buffer (set)
3227;; ;; If asked to switch to (from) the alternate sub-buffer, and already (not) 3270;; ;; If asked to switch to (from) the alternate sub-buffer, and already (not)
@@ -3599,8 +3642,8 @@ Should only be called when point is at the start of a screen line."
3599 (end-region (if (eq kind 1) (point) (point-max)))) 3642 (end-region (if (eq kind 1) (point) (point-max))))
3600 (delete-region start-region end-region) 3643 (delete-region start-region end-region)
3601 (term-unwrap-line) 3644 (term-unwrap-line)
3602 (if (eq kind 1) 3645 (when (eq kind 1)
3603 (term-insert-char ?\n row)) 3646 (term-insert-char ?\n row))
3604 (setq term-current-column nil) 3647 (setq term-current-column nil)
3605 (setq term-current-row nil) 3648 (setq term-current-row nil)
3606 (term-goto row col))))) 3649 (term-goto row col)))))
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 08d25997a11..24347479e57 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1,7 +1,7 @@
1;;; tex-mode.el --- TeX, LaTeX, and SliTeX mode commands -*- coding: utf-8 -*- 1;;; tex-mode.el --- TeX, LaTeX, and SliTeX mode commands -*- coding: utf-8 -*-
2 2
3;; Copyright (C) 1985,86,89,92,94,95,96,97,98,1999,2002,03,2004 3;; Copyright (C) 1985, 1986, 1989, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
4;; Free Software Foundation, Inc. 4;; 2002, 2003, 2004 Free Software Foundation, Inc.
5 5
6;; Maintainer: FSF 6;; Maintainer: FSF
7;; Keywords: tex 7;; Keywords: tex
@@ -196,7 +196,11 @@ use."
196 :group 'tex-view) 196 :group 'tex-view)
197 197
198;;;###autoload 198;;;###autoload
199(defcustom tex-dvi-view-command '(if (eq window-system 'x) "xdvi" "dvi2tty * | cat -s") 199(defcustom tex-dvi-view-command
200 '(cond
201 ((eq window-system 'x) "xdvi")
202 ((eq window-system 'w32) "yap")
203 (t "dvi2tty * | cat -s"))
200 "*Command used by \\[tex-view] to display a `.dvi' file. 204 "*Command used by \\[tex-view] to display a `.dvi' file.
201If it is a string, that specifies the command directly. 205If it is a string, that specifies the command directly.
202If this string contains an asterisk (`*'), that is replaced by the file name; 206If this string contains an asterisk (`*'), that is replaced by the file name;
@@ -453,7 +457,8 @@ An alternative value is \" . \", if you use a font with a narrow period."
453 '("input" "include" "includeonly" "bibliography" 457 '("input" "include" "includeonly" "bibliography"
454 "epsfig" "psfig" "epsf" "nofiles" "usepackage" 458 "epsfig" "psfig" "epsf" "nofiles" "usepackage"
455 "documentstyle" "documentclass" "verbatiminput" 459 "documentstyle" "documentclass" "verbatiminput"
456 "includegraphics" "includegraphics*") 460 "includegraphics" "includegraphics*"
461 "url" "nolinkurl")
457 t)) 462 t))
458 ;; Miscellany. 463 ;; Miscellany.
459 (slash "\\\\") 464 (slash "\\\\")
@@ -771,8 +776,10 @@ Inherits `shell-mode-map' with a few additions.")
771 "part" "chapter" "newcommand" 776 "part" "chapter" "newcommand"
772 "renewcommand") 'words) 777 "renewcommand") 'words)
773 "\\|NeedsTeXFormat{LaTeX"))) 778 "\\|NeedsTeXFormat{LaTeX")))
774 (if (looking-at 779 (if (and (looking-at
775 "document\\(style\\|class\\)\\(\\[.*\\]\\)?{slides}") 780 "document\\(style\\|class\\)\\(\\[.*\\]\\)?{slides}")
781 ;; SliTeX is almost never used any more nowadays.
782 (tex-executable-exists-p slitex-run-command))
776 'slitex-mode 783 'slitex-mode
777 'latex-mode) 784 'latex-mode)
778 'plain-tex-mode)))) 785 'plain-tex-mode))))
@@ -1219,8 +1226,13 @@ A prefix arg inhibits the checking."
1219(defvar latex-block-default "enumerate") 1226(defvar latex-block-default "enumerate")
1220 1227
1221(defvar latex-block-args-alist 1228(defvar latex-block-args-alist
1222 '(("array" nil ?\{ (skeleton-read "[options]: ") ?\}) 1229 '(("array" nil ?\{ (skeleton-read "Format: ") ?\})
1223 ("tabular" nil ?\{ (skeleton-read "[options]: ") ?\})) 1230 ("tabular" nil ?\{ (skeleton-read "Format: ") ?\})
1231 ("minipage" nil ?\{ (skeleton-read "Size: ") ?\})
1232 ("picture" nil ?\( (skeleton-read "SizeX,SizeY: ") ?\))
1233 ;; FIXME: This is right for Prosper, but not for seminar.
1234 ;; ("slide" nil ?\{ (skeleton-read "Title: ") ?\})
1235 )
1224 "Skeleton element to use for arguments to particular environments. 1236 "Skeleton element to use for arguments to particular environments.
1225Every element of the list has the form (NAME . SKEL-ELEM) where NAME is 1237Every element of the list has the form (NAME . SKEL-ELEM) where NAME is
1226the name of the environment and SKEL-ELEM is an element to use in 1238the name of the environment and SKEL-ELEM is an element to use in
@@ -1229,8 +1241,11 @@ a skeleton (see `skeleton-insert').")
1229(defvar latex-block-body-alist 1241(defvar latex-block-body-alist
1230 '(("enumerate" nil '(latex-insert-item) > _) 1242 '(("enumerate" nil '(latex-insert-item) > _)
1231 ("itemize" nil '(latex-insert-item) > _) 1243 ("itemize" nil '(latex-insert-item) > _)
1232 ("table" nil "\\caption{" > - "}" > \n _) 1244 ("table" nil "\\caption{" > (skeleton-read "Caption: ") "}" > \n
1233 ("figure" nil > _ \n "\\caption{" > _ "}" >)) 1245 '(if (and (boundp 'reftex-mode) reftex-mode) (reftex-label "table"))
1246 \n _)
1247 ("figure" nil > _ \n "\\caption{" > (skeleton-read "Caption: ") "}" > \n
1248 '(if (and (boundp 'reftex-mode) reftex-mode) (reftex-label "table"))))
1234 "Skeleton element to use for the body of particular environments. 1249 "Skeleton element to use for the body of particular environments.
1235Every element of the list has the form (NAME . SKEL-ELEM) where NAME is 1250Every element of the list has the form (NAME . SKEL-ELEM) where NAME is
1236the name of the environment and SKEL-ELEM is an element to use in 1251the name of the environment and SKEL-ELEM is an element to use in
@@ -1254,7 +1269,8 @@ Puts point on a blank line between them."
1254 choice) 1269 choice)
1255 \n "\\begin{" str "}" 1270 \n "\\begin{" str "}"
1256 (cdr (assoc str latex-block-args-alist)) 1271 (cdr (assoc str latex-block-args-alist))
1257 > \n (or (cdr (assoc str latex-block-body-alist)) '(nil > _)) \n 1272 > \n (or (cdr (assoc str latex-block-body-alist)) '(nil > _))
1273 (unless (bolp) '\n)
1258 "\\end{" str "}" > \n) 1274 "\\end{" str "}" > \n)
1259 1275
1260(define-skeleton latex-insert-item 1276(define-skeleton latex-insert-item
@@ -1598,7 +1614,7 @@ If NOT-ALL is non-nil, save the `.dvi' file."
1598 ("texindex %r.??") 1614 ("texindex %r.??")
1599 ("dvipdfm %r" "%r.dvi" "%r.pdf") 1615 ("dvipdfm %r" "%r.dvi" "%r.pdf")
1600 ("dvipdf %r" "%r.dvi" "%r.pdf") 1616 ("dvipdf %r" "%r.dvi" "%r.pdf")
1601 ("dvips %r" "%r.dvi" "%r.ps") 1617 ("dvips -o %r.ps %r" "%r.dvi" "%r.ps")
1602 ("ps2pdf %r.ps" "%r.ps" "%r.pdf") 1618 ("ps2pdf %r.ps" "%r.ps" "%r.pdf")
1603 ("gv %r.ps &" "%r.ps") 1619 ("gv %r.ps &" "%r.ps")
1604 ("gv %r.pdf &" "%r.pdf") 1620 ("gv %r.pdf &" "%r.pdf")
@@ -1767,7 +1783,7 @@ FILE is typically the output DVI or PDF file."
1767 (not (tex-uptodate-p (format-spec out fspec))))))) 1783 (not (tex-uptodate-p (format-spec out fspec)))))))
1768 1784
1769(defun tex-compile-default (fspec) 1785(defun tex-compile-default (fspec)
1770 "Guess a default command given the format-spec FSPEC." 1786 "Guess a default command given the `format-spec' FSPEC."
1771 ;; TODO: Learn to do latex+dvips! 1787 ;; TODO: Learn to do latex+dvips!
1772 (let ((cmds nil) 1788 (let ((cmds nil)
1773 (unchanged-in nil)) 1789 (unchanged-in nil))
@@ -1777,6 +1793,9 @@ FILE is typically the output DVI or PDF file."
1777 (if (tex-command-active-p cmd fspec) 1793 (if (tex-command-active-p cmd fspec)
1778 (push cmd cmds) 1794 (push cmd cmds)
1779 (push (nth 1 cmd) unchanged-in)))) 1795 (push (nth 1 cmd) unchanged-in))))
1796 ;; If no command seems to be applicable, arbitrarily pick the first one.
1797 (unless cmds
1798 (setq cmds (list (car tex-compile-commands))))
1780 ;; Remove those commands whose input was considered stable for 1799 ;; Remove those commands whose input was considered stable for
1781 ;; some other command (typically if (t . "%.pdf") is inactive 1800 ;; some other command (typically if (t . "%.pdf") is inactive
1782 ;; then we're using pdflatex and the fact that the dvi file 1801 ;; then we're using pdflatex and the fact that the dvi file
@@ -2261,6 +2280,7 @@ Runs the shell command defined by `tex-show-queue-command'."
2261(defvar tex-indent-basic 2) 2280(defvar tex-indent-basic 2)
2262(defvar tex-indent-item tex-indent-basic) 2281(defvar tex-indent-item tex-indent-basic)
2263(defvar tex-indent-item-re "\\\\\\(bib\\)?item\\>") 2282(defvar tex-indent-item-re "\\\\\\(bib\\)?item\\>")
2283(defvar latex-noindent-environments '("document"))
2264 2284
2265(defvar tex-latex-indent-syntax-table 2285(defvar tex-latex-indent-syntax-table
2266 (let ((st (make-syntax-table tex-mode-syntax-table))) 2286 (let ((st (make-syntax-table tex-mode-syntax-table)))
@@ -2311,7 +2331,6 @@ There might be text before point."
2311 (latex-find-indent 'virtual)))) 2331 (latex-find-indent 'virtual))))
2312 ;; Default (maybe an argument) 2332 ;; Default (maybe an argument)
2313 (let ((pos (point)) 2333 (let ((pos (point))
2314 (char (char-after))
2315 ;; Outdent \item if necessary. 2334 ;; Outdent \item if necessary.
2316 (indent (if (looking-at tex-indent-item-re) (- tex-indent-item) 0)) 2335 (indent (if (looking-at tex-indent-item-re) (- tex-indent-item) 0))
2317 up-list-pos) 2336 up-list-pos)
@@ -2329,6 +2348,17 @@ There might be text before point."
2329 ;; Have to indent relative to the open-paren. 2348 ;; Have to indent relative to the open-paren.
2330 (goto-char up-list-pos) 2349 (goto-char up-list-pos)
2331 (if (and (not tex-indent-allhanging) 2350 (if (and (not tex-indent-allhanging)
2351 (save-excursion
2352 ;; Make sure we're an argument to a macro and
2353 ;; that the macro is at the beginning of a line.
2354 (condition-case nil
2355 (progn
2356 (while (eq (char-syntax (char-after)) ?\()
2357 (forward-sexp -1))
2358 (and (eq (char-syntax (char-after)) ?/)
2359 (progn (skip-chars-backward " \t&")
2360 (bolp))))
2361 (scan-error nil)))
2332 (> pos (progn (latex-down-list) 2362 (> pos (progn (latex-down-list)
2333 (forward-comment (point-max)) 2363 (forward-comment (point-max))
2334 (point)))) 2364 (point))))
@@ -2336,18 +2366,24 @@ There might be text before point."
2336 (current-column) 2366 (current-column)
2337 ;; We're the first element after a hanging brace. 2367 ;; We're the first element after a hanging brace.
2338 (goto-char up-list-pos) 2368 (goto-char up-list-pos)
2339 (+ indent tex-indent-basic (latex-find-indent 'virtual)))) 2369 (+ (if (and (looking-at "\\\\begin *{\\([^\n}]+\\)")
2370 (member (match-string 1)
2371 latex-noindent-environments))
2372 0 tex-indent-basic)
2373 indent (latex-find-indent 'virtual))))
2340 ;; We're now at the "beginning" of a line. 2374 ;; We're now at the "beginning" of a line.
2341 ((not (and (not virtual) (eq (char-after) ?\\))) 2375 ((not (and (not virtual) (eq (char-after) ?\\)))
2342 ;; Nothing particular here: just keep the same indentation. 2376 ;; Nothing particular here: just keep the same indentation.
2343 (+ indent (current-column))) 2377 (+ indent (current-column)))
2344 ;; We're now looking at a macro call. 2378 ;; We're now looking at a macro call.
2345 ((looking-at tex-indent-item-re) 2379 ((looking-at tex-indent-item-re)
2346 ;; Indenting relative to an item, have to re-add the outdenting. 2380 ;; Indenting relative to an item, have to re-add the outdenting.
2347 (+ indent (current-column) tex-indent-item)) 2381 (+ indent (current-column) tex-indent-item))
2348 (t 2382 (t
2349 (let ((col (current-column))) 2383 (let ((col (current-column)))
2350 (if (or (null char) (not (eq (char-syntax char) ?\())) 2384 (if (or (not (eq (char-syntax (or (char-after pos) ?\ )) ?\())
2385 ;; Can't be an arg if there's an empty line inbetween.
2386 (save-excursion (re-search-forward "^[ \t]*$" pos t)))
2351 ;; If the first char was not an open-paren, there's 2387 ;; If the first char was not an open-paren, there's
2352 ;; a risk that this is really not an argument to the 2388 ;; a risk that this is really not an argument to the
2353 ;; macro at all. 2389 ;; macro at all.
@@ -2422,5 +2458,5 @@ There might be text before point."
2422 2458
2423(provide 'tex-mode) 2459(provide 'tex-mode)
2424 2460
2425;;; arch-tag: c0a680b1-63aa-4547-84b9-4193c29c0080 2461;; arch-tag: c0a680b1-63aa-4547-84b9-4193c29c0080
2426;;; tex-mode.el ends here 2462;;; tex-mode.el ends here